]> git.saurik.com Git - bison.git/blob - ChangeLog
2e9770aa6c5013051f39684dee0a11af53196d35
[bison.git] / ChangeLog
1 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 Use the new code_props interface for destructors and printers.
4 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
5 printer_location members, and change the type of the destructor and
6 printer members to code_props.
7 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
8 symbol_printer_get, semantic_type_destructor_set,
9 semantic_type_printer_set, default_tagged_destructor_set,
10 default_tagless_destructor_set, default_tagged_printer_set,
11 default_tagless_printer_set): Use code_props in arguments and return
12 types in place of char const * and location.
13 (symbol_destructor_location_get, symbol_printer_location_get): Remove
14 since the locations are now contained in the return of
15 symbol_destructor_get and symbol_printer_get.
16 * src/output.c (symbol_destructors_output, symbol_printers_output):
17 Replace with...
18 (symbol_code_props_output): ... this to eliminate duplicate code.
19 (output_skeleton): Update to use symbol_code_props_output.
20 * src/reader.c (symbol_should_be_used): Update use of
21 symbol_destructor_get.
22 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
23 Update uses of the various _destructor_set and _printer_set functions.
24 * src/symtab.c: (default_tagged_destructor_location,
25 default_tagless_destructor_location, default_tagged_printer_location,
26 default_tagless_printer_location): Remove since we...
27 (default_tagged_destructor, default_tagless_destructor,
28 default_tagged_printer, default_tagless_printer): ... change the type
29 of these to code_props.
30 (symbol_new, semantic_type_new, symbol_destructor_set,
31 semantic_type_destructor_set, symbol_destructor_get,
32 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
33 symbol_check_alias_consistency, default_tagged_destructor_set,
34 default_tagless_destructor_set, default_tagged_printer_set,
35 default_tagless_printer_set): Update.
36 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
37 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
38 code_props members.
39 (symbol_print): Use SYMBOL_CODE_PRINT.
40
41 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
42
43 Use the new code_props interface for rule actions.
44 * src/symlist.h (symbol_list): Replace action, action_location, and
45 used members with a code_props action_props member.
46 * src/reader.c (symbol_should_be_used, grammar_rule_check,
47 grammar_midrule_action, grammar_current_rule_merge_set,
48 grammar_current_rule_symbol_append, packgram): Update.
49 * src/scan-code.h (translate_rule_action): Remove, no longer used.
50 * src/scan-code.l (handle_action_dollar): Update.
51 (translate_rule_action): Remove, no longer used.
52 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
53
54 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
55
56 Use the new code_props interface in parse-gram.y.
57 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
58 Update all uses of translate_* functions to use the new code_props
59 interface and to use gram_scanner_last_string_free and
60 code_scanner_last_string_free where possible.
61 (grammar_declaration): symbol_list_destructor_set and
62 symbol_list_printer_set now perform the translation, so don't do it
63 here. Use gram_scanner_last_string_free where possible.
64 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
65 translate_code): Remove, no longer used.
66 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
67 symbol_list_printer_set): Perform code translation here rather than
68 depending on the caller to do so.
69
70 * src/symlist.h (struct symbol_list): Correct some documentation typos.
71 * src/scan-gram.h (gram_last_string): Remove declaration.
72 * src/scan-gram.l (last_string): Declare it static.
73
74 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
75
76 Encapsulate code properties and related functionality for the various
77 destructors, printers, and actions into a code_props structure and
78 interface. This patch merely implements code_props in scan-code.h and
79 scan-code.l. Future patches will rewrite other modules to use it.
80 Discussed starting at
81 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
82 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
83 consistently initialize const structs that have an empty location
84 field.
85 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
86 to ensure consistency.
87 * src/scan-code.h (code_props): New structure.
88 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
89 function, macro, and const global variable for initializing a
90 code_props with no code.
91 (code_props_plain_init, code_props_symbol_action_init,
92 code_props_rule_action_init, code_props_translate_code): The rest of
93 the new code_props functional interface. Among other things, the init
94 functions set the code_props kind field so that
95 code_props_translate_code will know whether to behave like
96 translate_symbol_action, translate_rule_action, or translate_code.
97 These old translate functions must remain until all other modules are
98 updated to use the new code_props interface.
99 (code_scanner_last_string_free): New function similar to
100 gram_scanner_last_string_free.
101 (code_scanner_free): Add documentation.
102 * src/scan-code.l: Implement the new interface.
103 (code_lex): Make it static, add a code_props* argument, and remove the
104 rule argument.
105 (last_string): New static global similar to the one in scan-gram.l.
106 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
107 instead of rule.
108 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
109 code_props since Bison may one day use this information for destructors
110 and printers.
111 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
112 (handle_action_dollar): Use symbol_list_n_get and set used flag
113 directly since symbol_list_n_used_set is removed.
114 (translate_action): Add a code_props* argument and remove the rule,
115 action, and location arguments. Pass the code_props* on to code_lex.
116 (translate_rule_action, translate_symbol_action, translate_code):
117 Rewrite as wrappers around the new code_props interface.
118 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
119 it would eventually need to break the encapsulation of code_props.
120
121 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
122
123 * etc/.cvsignore: New.
124
125 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
126
127 Add maintainer-push-check to run maintainer-check using push parsing in
128 place of pull parsing where available.
129 * Makefile.am (maintainer-push-check): New.
130 * data/bison.m4 (b4_use_push_for_pull_if): New.
131 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
132 appropriately based on their existing values.
133 (yypush_parse): Don't print push-parser-specific diagnostics if push
134 parsing is being used in place of pull parsing.
135 * data/yacc.c: If push parsing should replace pull parsing, redirect to
136 push.c.
137 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
138 variable, and insert b4_use_push_for_pull_flag into muscles.
139 * tests/Makefile.am (maintainer-push-check): New.
140
141 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
142
143 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
144 (whether successful or failed) so that yypush_parse can be invoked
145 again to start a new parse using the same yypstate.
146 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
147 check multiple yypull_parse invocations on the same yypstate. For pull
148 mode, extend to check multiple yyparse invocations.
149 (Exploding the Stack Size with Alloca): Extend to try with
150 %push-pull-parser.
151 (Exploding the Stack Size with Malloc): Likewise.
152
153 * tests/calc.at (Simple LALR Calculator): Don't specify
154 %skeleton "push.c" since %push-pull-parser implies that now.
155 * tests/headers.at (export YYLTYPE): Don't check for the push
156 declarations. Otherwise, this test case can't be used to see if push
157 mode can truly emulate pull mode.
158 * tests/input.at (Torturing the Scanner): Likewise.
159 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
160 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
161 AT_YACC_IF, which now includes the case of push mode since %skeleton
162 need not be used for push mode. This will be more intuitive once
163 push.c is renamed to yacc.c.
164
165 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
166
167 For push mode, convert yyparse from a macro to a function, invoke yylex
168 instead of passing a yylexp argument to yypull_parse, and don't
169 generate yypull_parse or yyparse unless %push-pull-parser is declared.
170 Discussed starting at
171 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
172 * data/bison.m4 (b4_pull_if): New.
173 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
174 * data/push.c: Improve M4 quoting a little.
175 (b4_generate_macro_args, b4_parenthesize): Remove.
176 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
177 any time a pull parser is requested.
178 Don't #define this as a wrapper around yypull_parse. Instead, when
179 both push and pull are requested, make it a function that does that
180 same thing.
181 (yypull_parse): If there's a b4_prefix, #define this to
182 b4_prefix[pull_parse] when both push and pull are requested.
183 Don't define this as a function unless both push and pull are
184 requested.
185 Remove the yylexp argument and hard-code yylex invocation instead.
186 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
187 %push-parser.
188 * src/getargs.c (pull_parser): New global initialized to true.
189 * getargs.h (pull_parser): extern it.
190 * src/output.c (prepare): Insert pull_flag muscle.
191 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
192 (prologue_declaration): Set both push_parser and pull_parser = true for
193 %push-pull-parser. Set push_parser = true and pull_parser = false for
194 %push-parser.
195 * src/scan-gram.l: Don't accept %push_parser as an alternative to
196 %push-parser since there's no backward-compatibility concern here.
197 Scan %push-pull-parser.
198 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
199 instead of %push-parser.
200 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
201 prototype it in the module that calls yyparse.
202 * tests/input.at (Torturing the Scanner): Likewise.
203 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
204
205 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
206
207 Update etc/bench.pl. Optimize push mode a little (the yyn change
208 deserves most of the credit).
209 * Makefile.am (SUBDIRS): Add etc subdirectory.
210 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
211 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
212 yytoken, yyval, and yyloc declarations to...
213 (yyparse or yypush_parse): ... here to improve performance. For
214 yypush_parse invocations after the first, be sure to assign yyn its old
215 value again.
216 (yypstate_new): Don't bother initializing the yyresult field since the
217 initial value isn't used.
218 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
219 remove the #define that, in push mode, set it to yyps->NAME.
220 * etc/Makefile.am: New.
221 * etc/bench.pl: Remove and build it instead from...
222 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
223 "tests/bison" from the build directory by default rather than just
224 invoking "bison" from $PATH.
225 (calc_grammar): Update push parser code: don't declare yylval globally,
226 don't define yyparse_wrapper, and don't #define yyparse.
227 (bench_grammar): Update to check all working combinations of yacc.c,
228 push.c, impure, pure, pull, and push.
229
230 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
231
232 For push mode, add pull wrappers around yypush_parse.
233 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
234 (yypull_parse): New function wrapping yypush_parse.
235 (yyparse): New #define wrapping yypull_parse.
236 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
237 is declared.
238 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
239 prototype yylex in the module that calls yyparse, and don't prototype
240 yyparse there. Otherwise, the yyparse expansion won't compile.
241 * tests/input.at (Torturing the Scanner): Likewise.
242
243 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
244
245 Enable push parsers to operate in impure mode. Thus, %push-parser no
246 longer implies %pure-parser. The point of this change is to move
247 towards being able to test the push parser code by running the entire
248 test suite as if %push-parser had been declared.
249 * data/push.c (yypush_parse): For impure mode, remove the
250 yypushed_char, yypushed_val, and yypushed_loc arguments.
251 Instead, declare these as local variables initialized to the global
252 yychar, yylval, and yylloc.
253 For the first yypush_parse invocation only, restore the initial values
254 of these global variables when it's time to read a token since they
255 have been overwritten.
256 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
257 %push-parser.
258 * tests/calc.at (Simple LALR(1) Calculator): Always declare
259 %pure-parser along with %push-parser since this test case was designed
260 for pure push parsers.
261 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
262 (AT_YACC_OR_PUSH_IF): New.
263 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
264 add a note that it's still wrong for some cases (as it has been for a
265 while).
266 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
267 %push-parser no longer implies %pure-parser.
268
269 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
270
271 Remove some unnecessary differences between the pull parser code and
272 the push parser code. This patch enables yynerrs in push mode.
273 * data/push.c: Reformat M4 a little.
274 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
275 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
276 because push mode is on. Instead, if pure mode is on, move yynerrs
277 to...
278 (b4_declare_parser_state_variables): ... here.
279 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
280 to yyps->NAME so it can be used in yypush_parse.
281 (yypush_parse): Don't omit uses of yynerrs in push mode.
282
283 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
284
285 Fix bug such that the first pushed token's value and location are
286 sometimes overwritten (sometimes by %initial-action) before being used.
287 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
288 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
289 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
290 more closely mimic the pull parser logic.
291 Don't copy the pushed token to yychar, yylval, and yylloc until it's
292 time to read a token, which is after any initialization of yylval and
293 yylloc.
294 (gottoken): Rename label to...
295 (yyread_pushed_token): ... for clarity and to avoid infringing on the
296 user namespace.
297
298 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
299
300 Rearrange initialization of the parser state variables so that the
301 skeleton doesn't have to have a copy for pull mode and another for push
302 mode. This patch also fixes at least a bug such that yylloc was not
303 initialized (with b4_location_initial_line and
304 b4_location_initial_column) upon calling yypush_parse. However, that
305 initialization now overwrites the first token's location;
306 %initial-action assigning @$ already did the same thing, and both bugs
307 will be fixed in a later patch.
308 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
309 (b4_declare_parser_state_variables): Remove initialization of yytoken,
310 yyss, yyvs, yyls, and yystacksize.
311 (yypstate_new): Remove initialization of some yypstate fields: yystate,
312 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
313 yylsp.
314 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
315 yyps->NAME so it can be used in yypush_parse.
316 (yyparse or yypush_parse): For yypush_parse, don't print the
317 "Starting parse" diagnostic for invocations after the first.
318 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
319 yypush_parse, only do it for the first invocation.
320 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
321 initialization to occur in yypush_parse but only on the first
322 invocation.
323
324 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
325
326 * data/push.c: Add CPP guards around push parser declarations in both
327 the header and the code file.
328 In the code file, move the push parser declarations to the same place
329 they appear in the header file.
330 Clean up the M4 some, especially the inconsistent underquoting in
331 some b4_c_function_def and b4_c_function_decl uses.
332
333 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
334
335 Encapsulate the push parser state variables into an M4 macro so the
336 push skeleton doesn't have to list them again for pull mode's yyparse.
337 For push mode, remove yypush_parse's local equivalents of these
338 variables to eliminate unnecessary copying between the two sets at
339 run-time. This patch also fixes at least a bug related to multiple
340 %initial-action invocations in push mode.
341 * data/push.c (b4_declare_parser_variables): Rename to...
342 (b4_declare_scanner_communication_variables): ... this for clarity and
343 update both uses.
344 (b4_declare_yyparse_variables): Remove and move its contents to the one
345 spot where it was invoked.
346 (b4_declare_parser_state_variables): New macro containing the parser
347 state variables required by push mode.
348 (struct yypstate): Replace all fields but yynew with
349 b4_declare_parser_state_variables.
350 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
351 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
352 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
353 (yyparse or yypush_parse): For yyparse in pull mode, replace local
354 parser state variable declarations with
355 b4_declare_parser_state_variables.
356 Don't initialize parser state variables when calling yypush_parse since
357 yypstate_new already does that.
358 Invoke the user's initial action only upon the first yypush_parse
359 invocation.
360 Remove all code that copies between the local parser state variables
361 and the yypstate.
362
363 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
364
365 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
366 prevent a name collision in a future patch where these names will
367 sometimes be #define'd.
368 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
369 since it no longer has the same name as the existing argument.
370 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
371
372 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
373 and Joel E. Denny <jdenny@ces.clemson.edu>
374
375 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
376 that the argument is case-insensitive, and there's no `=' here.
377 For the %skeleton entry, mention that %language is better.
378 (Bison Options): Likewise for --language and --skeleton. Move the
379 --skeleton entry so that the `Tuning the parser' section is sorted
380 alphabetically on long options.
381 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
382 %language directive in detail here; cross-reference the %language
383 documentation instead.
384 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
385 `%require "2.3b"' so that the example is always up-to-date.
386 (Bison Symbols): Add entries for %language and %skeleton.
387 * examples/extexi (normalize): Instead of replacing every %require
388 argument with the current Bison version, just substitute for
389 `@value{VERSION}'. This guarantees that we're testing what actually
390 appears in the documentation.
391 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
392 rather than `@VERSION@'.
393
394 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
395
396 * NEWS: Reword the %language news a bit, and put it earlier.
397
398 * src/getargs.c (skeleton_arg): Last arg is now location const *.
399 Rewrite to simplify the logic.
400 (language_argmatch): Likewise.
401 (program_name): We now own this var.
402 * src/getargs.h (struct bison_language): Use char[] rather than
403 const char *.
404
405 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
406 Java is supported.
407 * src/complain.c (program_name): Remove decl; no longer needed.
408 * src/main.c (program_name): Remove; now belongs to getargs.
409
410 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
411
412 * NEWS: Document %language.
413
414 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
415
416 * data/c-skel.m4, data/c++-skel.m4: New files.
417 * data/glr.c: Complain on push parsers.
418
419 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
420 over %skeleton.
421 (Directives): Document %language and %skeleton.
422 (Command line): Document -L.
423
424 * examples/extexi: Rewrite %require directive.
425 * examples/calc++/Makefile.am: Pass VERSION to extexi.
426
427 * src/files.c (compute_exts_from_gc): Look in language structure
428 for .y extension.
429 (compute_file_name_parts): Check whether .tab should be added.
430 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
431 (language, skeleton_arg, language_argmatch): New.
432 (long_options): Add --language.
433 (getargs): Use skeleton_arg, add -L/--language.
434 * src/getargs.h: Include location.h.
435 (struct bison_language, language, skeleton_arg, language_argmatch): New.
436 * src/output.c (prepare): Pick default skeleton from struct language.
437 Don't dispatch C skeletons here.
438 * src/parse-gram.y (PERCENT_LANGUAGE): New.
439 (prologue_declaration): Add "%language" rule, use skeleton_arg.
440 * src/scan-gram.l ("%language"): New rule.
441
442 * tests/calc.at: Test %skeleton and %language.
443 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
444 (AT_GLR_IF): Look for %skeleton "glr.cc".
445 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
446 (AT_YACC_IF): Reject %language.
447
448 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
449
450 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
451 since it wasn't used; only the typedef name 'semantic_type' is needed.
452 Also, omit trailing white space.
453
454 * bootstrap: Sync from coreutils.
455 (gnulib_extra_files): Add build-aux/announce.gen.
456 (slurp): Adjust .gitignore files like .cvsignore files.
457 * build-aux/announce-gen: Remove from CVS, since bootstrap
458 now creates this.
459
460 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
461
462 Make %push-parser imply %pure-parser. This fixes several bugs; see
463 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
464 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
465 pure_parser = true.
466 * data/push.c: Don't bother testing b4_push_if when deciding whether
467 to expand b4_declare_parser_variables globally.
468 (yypush_parse): Likewise in here.
469
470 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
471 (yy_reduce_print): Reformat M4 for readability.
472
473 2006-12-15 Bob Rossi <bob@brasko.net>
474 and Joel Denny <jdenny@ces.clemson.edu>
475
476 * data/push.c (yypstate): Add typedef, and update all uses of
477 struct yypstate to just yypstate.
478 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
479
480 2006-12-14 Bob Rossi <bob@brasko.net>
481
482 * data/push.c (yypush_parse): Declare prototype regardless of
483 %locations option.
484
485 2006-12-14 Bob Rossi <bob@brasko.net>
486
487 * data/push.c (yyparse): Remove the prototype and the #define when in
488 push-parser mode.
489
490 2006-12-13 Bob Rossi <bob@brasko.net>
491
492 * data/push.c (yypstate_init): Rename to...
493 (yypstate_new): ... this and use b4_c_function_def.
494 (yypstate_delete): New.
495 (yypush_parse): Change parameters yynval and yynlloc to be const.
496 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
497 yypstate_delete functions.
498
499 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
500
501 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
502 strange test case titles. Reported by Bob Rossi.
503
504 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
505
506 * TODO: Add pointer to Sylvain Schmitz's work on static detection
507 of potential ambiguities in GLR grammers.
508
509 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
510
511 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
512 `bison ', use m4_index instead of m4_substr since chopping up a string
513 containing M4-special characters causes problems here.
514
515 Fix a couple of bugs related to special characters in user-specified
516 file names, and make it easier for skeletons to compute output file
517 names with the same file name prefix as Bison-computed output file
518 names.
519 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
520 b4_parser_file_name and b4_spec_defines_file instead of
521 @output_parser_name@ and @output_header_name@, which are now redundant.
522 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
523 b4_parser_file_name, b4_spec_defines_file, and the new
524 @basename(FILENAME@) instead of @output_parser_name@ and
525 @output_header_name@, which inappropriately escaped the file names as
526 C string literals.
527 * src/files.c (all_but_ext): Remove static qualifier.
528 (compute_output_file_names): Move `free (all_but_ext)' to...
529 (output_file_names_free): ... here since all_but_ext is needed later.
530 * src/files.h (all_but_ext): Extern.
531 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
532 exactly what MUSCLE_INSERT_STRING used to do.
533 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
534 characters are escaped properly.
535 * src/output.c (prepare): Define muscle file_name_all_but_ext as
536 all_but_ext.
537 For pkgdatadir muscle, maintain previous functionality by using
538 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
539 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
540 digraphs would never be expanded. Hopefully no one has M4-special
541 characters in his Bison installation path.
542 * src/scan-skel.l: Don't parse @output_header_name@ and
543 @output_parser_name@ anymore since they're now redundant.
544 In @output, use decode_at_digraphs.
545 Parse a new @basename command that invokes last_component.
546 (decode_at_digraphs): New.
547 (BASE_QPUTS): Remove unused.
548 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
549 (Output file name): New tests.
550
551 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
552
553 Warn about output files that are generated by the skeletons and that
554 conflict with other output files.
555 * data/glr.c: Don't generate the header file here when glr.cc does.
556 * src/files.c (file_names, file_names_count): New static globals.
557 (compute_output_file_names): Invoke output_file_name_check for files
558 not generated by the skeletons and remove existing checks.
559 (output_file_name_check): New function that warns about conflicting
560 output file names.
561 (output_file_names_free): Free file_names.
562 * src/files.h (output_file_name_check): Declare.
563 * src/scan-skel.l: Invoke output_file_name_check for files generated by
564 the skeletons.
565 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
566 (Conflicting output files): New tests.
567
568 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
569
570 * doc/bison.texinfo: Fix a couple of typos.
571
572 2006-12-08 Bob Rossi <bob@brasko.net>
573
574 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
575 Rename to...
576 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
577 update all uses.
578 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
579 (yypush_parse): Rename yypvars argument to yyps and remove redundant
580 local pv.
581 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
582 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
583
584 2006-12-07 Bob Rossi <bob@brasko.net>
585 and Joel Denny <jdenny@ces.clemson.edu>
586
587 * data/push.c (yypvarsinit): Change return type from void* to struct
588 yypvars*. No longer cast to void* on return.
589 (struct yypvars): Remove yylen since it need not be remembered between
590 yypushparse invocations.
591 (yypushparse): Don't copy between yylen and pv->yylen.
592
593 2006-12-05 Bob Rossi <bob@brasko.net>
594
595 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
596 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
597 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
598 (struct yypvars): Remove b4_declare_parser_variables.
599 (yypvarsinit): Remove init code for removed variables.
600 (global scope): Do not declare b4_declare_parser_variables if
601 push or pure mode.
602 (yypushparse): Add b4_declare_parser_variables.
603 Init new local variables, and remove init code for removed
604 yypvars variables.
605 (yyparse): Delete.
606 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
607 and yyparse for other modes.
608 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
609 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
610 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
611 (AT_PURE_LEX_IF): True if pure or push parser.
612
613 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
614
615 Document Yacc prologue alternatives and default %destructor's and
616 %printer's as experimental. Don't mention Java yet. Discussed at
617 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
618 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
619 (2.3a): Annotate this entry to say the old forms of these features were
620 also experimental.
621 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
622 Bison Symbols): Say they're experimental. Comment out any mention
623 of Java (we'll want this back eventually).
624
625 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
626
627 Support a file name argument to %defines. Deprecate `=' in
628 %file-prefix, %name-prefix, and %output. Discussed at
629 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
630 * NEWS (2.3a+): Mention.
631 * doc/bison.texinfo (Decl Summary, Bison Symbols): Add entry for new
632 form of %defines, and remove `=' from entries for %file-prefix,
633 %name-prefix, and %output.
634 * src/parse-gram.y (prologue_declaration): Implement.
635 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
636 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
637 all but one occurrence of %name-prefix.
638 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
639 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
640 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
641 occurrence of each of %file-prefix and %output. Add check for %defines
642 with argument.
643 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
644 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
645 Remove the `=' from %output.
646
647 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
648
649 Don't escape $ in test case titles since Autoconf 2.61 now does that
650 correctly.
651 * tests/actions.at (Default %printer and %destructor are not for error
652 or $undefined): Here.
653 (Default %printer and %destructor are not for $accept): Here.
654 * tests/input.at (Invalid $n and @n): Here.
655
656 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
657
658 Rename <!> to <>. Discussed starting at
659 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
660 * NEWS (2.3a+): Update.
661 * doc/bison.texinfo (Freeing Discarded Symbols, Bison Symbols):
662 Update.
663 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
664 * src/scan-gram.l (INITIAL): Implement.
665 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
666 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
667 comment.
668 * tests/actions.at (Default tagless %printer and %destructor,
669 Default tagged and per-type %printer and %destructor,
670 Default %printer and %destructor are not for error or $undefined,
671 Default %printer and %destructor are not for $accept,
672 Default %printer and %destructor for mid-rule values): Update.
673 * tests/input.at (Default %printer and %destructor redeclared,
674 Unused values with default %destructor): Update.
675
676 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
677
678 Don't let %prec take a nonterminal.
679 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
680 token.
681 * tests/input.at (%prec takes a token): New test checking that %prec
682 won't take a nonterminal.
683
684 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
685
686 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
687 it was double-quoted.
688 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
689 grammar is maintained with Bison's highest standards.
690 * src/getargs.c: Fix some typos in Doxygen comments.
691
692 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
693
694 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
695 later. Reported by Paul Eggert in
696 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
697 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
698 * src/scan-code.l (translate_action): Don't bother invoking
699 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
700 (code_scanner_free): Instead of invoking
701 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
702 which frees more.
703 * src/scan-gram.l (gram_scanner_free): Likewise.
704 * src/scan-skel.l (scan_skel): Likewise.
705
706 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
707
708 * src/files.c (tr): Change return type to void.
709 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
710 has been called previously for the same key.
711 (muscle_find): Return storage instead of value so that
712 --enable-gcc-warnings doesn't produce warnings that the return discards
713 const. aver that the value and storage are the same since storage
714 could potentially be NULL when value is not.
715 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
716 same as 0.
717
718 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
719
720 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
721 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
722 us a slightly cleaner distribution, and also works.
723 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
724 gnulib changes.
725
726 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
727 and Paul Eggert <eggert@cs.ucla.edu>
728
729 Don't let Bison leak memory except when it complains.
730 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
731 (spec_defines_file, dir_prefix): Now char *, not const char *,
732 since they are freed.
733 * src/files.c: Likewise.
734 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
735 Likewise.
736 (tr): Now operates in-place. All uses changed.
737 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
738 values.
739 (compute_file_name_parts, compute_output_file_names): Don't store
740 read-only data in variables that will be freed.
741 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
742 src_extension, and header_extension.
743 (output_file_names_free): New public function to free
744 spec_verbose_file, spec_graph_file, spec_defines_file,
745 parser_file_name, and dir_prefix.
746 * src/getargs.c (getargs): Don't store read-only data in variables that
747 will be freed.
748 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
749 (which previously existed but was unused), and quotearg_free.
750 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
751 * src/muscle_tab.c: Likewise.
752 (muscle_entry): Make the value char const *,
753 and add a new storage member that is char * and can be freed.
754 (muscle_entry_free): New private function.
755 (muscle_init): Use it instead of free.
756 (muscle_insert, muscle_grow): Update and use new storage member.
757 (muscle_code_grow): Free the string passed to muscle_grow
758 since it's not needed anymore.
759 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
760 add a new `char *code' member.
761 ("{...}"): Declare semantic type as code.
762 * src/scan-code.h (translate_rule_action):
763 (translate_symbol_action, translate_code, translate_action): Return
764 `char const *' rather than `char *' since external code should not free
765 these strings.
766 * src/scan-code.l: Likewise.
767 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
768 which is "{...}" in the parser.
769 * tests/Makefile.am (maintainer-check-valgrind): Set
770 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
771 Valgrind.
772 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
773 complain.
774 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
775 expecting a non-zero exit status sets --leak-check=summary and
776 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
777 this case, and we don't want to hear about it.
778
779 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
780
781 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
782 instead of from the template, to simplify configuration a bit.
783 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
784 and m4/wint_t.m4, as they are needed with the latest gnulib.
785
786 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
787
788 Disable unset/unused mid-rule value warnings by default, and recognize
789 --warnings=midrule-values to enable them. Discussed starting at
790 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
791 * NEWS (2.3a+): Mention.
792 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
793 warnings): Add entry for midrule-values subargument.
794 * src/reader.c (symbol_should_be_used): Don't return true just because
795 the value is a set/used mid-rule value unless
796 --warnings=midrule-values was specified.
797 * tests/input.at (Unused values, Unused values before symbol
798 declarations): Run tests with and without --warnings=midrule-values.
799
800 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
801 than LIST_FREE directly.
802
803 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
804
805 Finish implementing --warnings=error, which should not be implied by
806 --warnings=all (or by its synonyms -W and --warnings without
807 subarguments).
808 * src/complain.c (set_warning_issued): New function to report that
809 warnings are being treated as errors and to record an error if so.
810 Invoke...
811 (warn_at, warn): ... here.
812 * src/getargs.c (warnings_args, warnings_types): Reorder so that
813 "error - warnings are errors" does not appear above "all - all of the
814 above".
815 (getargs): For -W and --warnings without subarguments, don't let
816 FLAGS_ARGMATCH set warnings_error in warnings_flag.
817 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
818
819 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
820
821 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
822 empty subargument list. For example: `bison --warnings= parser.y'.
823
824 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
825
826 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
827 the parser header file so that gcc doesn't warn.
828
829 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
830
831 Split the default %destructor/%printer into two kinds: <*> and <!>.
832 Discussed starting at
833 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
834 * NEWS (2.3a+): Mention.
835 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
836 previous change today related to mid-rules.
837 (Bison Symbols): Remove %symbol-default and add <*> and <!>.
838 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
839 (TYPE_TAG_ANY): Add as <*>.
840 (TYPE_TAG_NONE): Add as <!>.
841 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
842 for <*> and <!>.
843 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
844 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
845 * src/symlist.c (symbol_list_default_new): Split into tagged and
846 tagless versions.
847 (symbol_list_destructor_set, symbol_list_printer_set): Split
848 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
849 SYMLIST_DEFAULT_TAGLESS.
850 * src/symlist.h: Update symbol_list_default*_new prototypes.
851 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
852 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
853 * src/symtab.c (default_destructor, default_destructor_location,
854 default_printer, default_printer_location): Split each into tagged and
855 tagless versions.
856 (symbol_destructor_get, symbol_destructor_location_get,
857 symbol_printer_get, symbol_printer_location_get): Implement tagged
858 default and tagless default cases.
859 (default_destructor_set, default_printer_set): Split each into tagged
860 and tagless versions.
861 * src/symtab.h: Update prototypes.
862 * tests/actions.at (Default %printer and %destructor): Rename to...
863 (Default tagless %printer and %destructor): ... this, and extend.
864 (Per-type %printer and %destructor): Rename to...
865 (Default tagged and per-type %printer and %destructor): ... this, and
866 extend.
867 (Default %printer and %destructor for user-defined end token): Extend.
868 (Default %printer and %destructor are not for error or $undefined):
869 Update.
870 (Default %printer and %destructor are not for $accept): Update.
871 (Default %printer and %destructor for mid-rule values): Extend.
872 * tests/input.at (Default %printer and %destructor redeclared): Extend.
873 (Unused values with default %destructor): Extend.
874
875 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
876
877 Don't apply the default %destructor/%printer to an unreferenced midrule
878 value. Mentioned at
879 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
880 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
881 like $@n instead of just @n so that the default %destructor/%printer
882 logic doesn't see them as user-defined symbols.
883 (symbol_is_dummy): Check for both forms of the name.
884 * src/reader.c (packgram): Remove the `$' from each midrule symbol
885 name for which the midrule value is referenced in any action.
886 * tests/actions.at (Default %printer and %destructor for mid-rule
887 values): New test.
888 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
889 for change to dummy symbol names.
890
891 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
892
893 Warn about unset midrule $$ if the corresponding $n is used.
894 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
895 $n usage.
896 (packgram): Before invoking grammar_rule_check on any rule, make sure
897 all actions have already been scanned in order to set `used' flags.
898 Otherwise, checking that a midrule's $$ is set will not always work
899 properly because the midrule check must forward-reference the midrule's
900 parent rule.
901 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
902 warning.
903
904 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
905
906 More improvements to the documentation of the prologue alternatives:
907 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
908 Bison manual.
909 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
910 some text to clarify the relative importance of the new directives and
911 to show how these directives may be viewed as code labels.
912
913 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
914
915 Similar to the recently removed %before-header, add %code-top as the
916 alternative to the pre-prologue. Mentioned at
917 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
918 Also, let the prologue alternatives appear in the grammar section.
919 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
920 (prologue_declaration): Move the existing prologue alternatives to...
921 (grammar_declaration): ... here and add %code-top.
922 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
923
924 Clean up and extend documentation for the prologue alternatives.
925 * NEWS (2.3a+): Describe prologue alternatives.
926 * doc/bison.texinfo (Prologue): Move discussion of prologue
927 alternatives to...
928 (Prologue Alternatives): ... this new section, and extend it to discuss
929 all 4 directives in detail.
930 (Bison Symbols): Clean up discussion of prologue alternatives and add
931 %code-top.
932
933 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
934
935 DJGPP specific issues.
936
937 * djgpp/config.bat: config.hin has been moved to lib. Adjust
938 config.bat accordingly.
939 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
940 * djgpp/config.site: Likewise.
941
942 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
943
944 Replace %*-header with %provides, %requires, %code. See discussion at
945 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
946
947 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
948 (b4_user_start_header): Remove.
949 * data/glr.c: Use new macros instead of b4_*start_header
950 and b4_*end_header.
951 * data/glr.cc: Likewise.
952 * data/lalr1.cc: Likewise.
953 * data/push.c: Likewise.
954 * data/yacc.c: Likewise.
955
956 * doc/bison.texinfo: Remove %before-header, rename
957 %{start,end,after}-header to %requires, %provides, %code.
958
959 * src/parse-gram.y: Likewise (also rename token names accordingly).
960 * src/scan-gram.l: Likewise.
961 * tests/actions.at: Likewise.
962
963 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
964
965 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
966 Problem reported by Joel E. Denny.
967
968 2006-10-14 Jim Meyering <jim@meyering.net>
969
970 (Sync from coreutils.)
971 Work also when the working directory (with e.g. coreutils sources)
972 is version controlled with git, rather than CVS.
973 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
974 rather than CVS.
975 In messages and comments, say e.g., "checked-out sources",
976 rather than "CVS sources".
977 (version_controlled_file): New function. Work for git as well as
978 for CVS. Don't use grep's -q option.
979 (slurp): Call it here, in place of CVS-specific code.
980
981 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
982
983 Fix testsuite for ./configure --enable-gcc-warnings:
984 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
985 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
986 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
987 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
988 * test/regression.at (Diagnostic that expects two alternatives):
989 Likewise.
990
991 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
992
993 * bootstrap.conf (gnulib_modules): Add config-h.
994 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
995 worry about HAVE_CONFIG_H.
996 * lib/abitset.c: Likewise.
997 * lib/bitset.c: Likewise.
998 * lib/bitset_stats.c: Likewise.
999 * lib/bitsetv-print.c: Likewise.
1000 * lib/bitsetv.c: Likewise.
1001 * lib/ebitset.c: Likewise.
1002 * lib/get-errno.c: Likewise.
1003 * lib/lbitset.c: Likewise.
1004 * lib/subpipe.c: Likewise.
1005 * lib/timevar.c: Likewise.
1006 * lib/vbitset.c: Likewise.
1007 * lib/bitset.c: Include "bitset.h" first, to test interface.
1008 * lib/bitset_stats.c: Include "bitset_stats.h" first.
1009 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
1010 * lib/bitsetv.c: Include "bitsetv.h" first.
1011 * lib/get-errno.c: Include "get-errno.h" first.
1012 * m4/.cvsignore: Add config-h.m4.
1013 * tests/actions.at (Default %printer and %destructor for ...):
1014 Adjust expected line numbers in output to reflect removal of #if
1015 HAVE_CONFIG_H lines.
1016 * tests/glr-regression.at (Missed %merge type warnings when ...):
1017 Likewise.
1018 * tests/regression.at (Braced code in declaration in rules section):
1019 Likewise.
1020 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
1021 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
1022 Include <config.h> unconditionally.
1023
1024 * bootstrap: Sync from coreutils, as follows:
1025
1026 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
1027
1028 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
1029 variable was sometimes used without being initialized. This
1030 messed up the installation of the INSTALL file in some cases.
1031
1032 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
1033
1034 * bootstrap (usage, main program, symlink_to_gnulib): Add option
1035 --copy. Inspired by a suggestion from Bruno Haible.
1036
1037 2006-10-03 Jim Meyering <jim@meyering.net>
1038
1039 * bootstrap: Undo last change to this file, since now gnulib-tool
1040 sticks with the automake default in generating dependencies.
1041
1042 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
1043
1044 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
1045 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
1046
1047 * doc/bison.1: Add copyright notice.
1048
1049 * data/glr.c: Don't include <stdarg.h>; not used.
1050
1051 * NEWS: The -g and --graph options now output graphs in Graphviz
1052 DOT format, not VCG format.
1053 * doc/bison.1: Likewise.
1054 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
1055 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
1056 of this change in
1057 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
1058 * TODO: Remove Graphviz entry.
1059 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
1060 remove vcg.c, vcg.h, vcg_defaults.h.
1061 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
1062 * src/graphviz.c, src/graphviz.h: New files.
1063 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
1064 * src/files.h: Make comment more generic.
1065 * src/main.c (main): Likewise.
1066 * src/print_graph.h: Likewise.
1067 * src/getargs.c (usage): Make usage description more generic.
1068 * src/print_graph.c: Include graphviz.h rather than vcg.h.
1069 (static_graph, fgraph): Remove. All uses changed to pass
1070 arguments instead of sharing a static var.
1071 (print_core, print_actions, print_state, print_graph):
1072 Output graphviz format rather than VCG format.
1073 * tests/.cvsignore: Remove *.vcg; add *.dot.
1074 * tests/output.at: Expect *.dot files, not *.vcg files.
1075
1076 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
1077 accommodates the 2006-10-08 change.
1078
1079 2006-10-11 Bob Rossi <bob@brasko.net>
1080
1081 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
1082 (b4_yyssa, b4_yyerror_range): New macros.
1083 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
1084 (yypvarsinit): Remove init of removed fields.
1085 (yypushparse): Remove use of removed fields; use new macros instead.
1086
1087 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
1088
1089 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
1090 in a push parser. Reindent slightly to match yacc.c better.
1091
1092 2006-10-11 Bob Rossi <bob@brasko.net>
1093
1094 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
1095 yymsg_alloc fields.
1096 (yypvarsinit, yypushparse): Remove init of removed fields.
1097 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
1098
1099 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
1100
1101 * THANKS: Add Paolo Bonzini and Bob Rossi.
1102
1103 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
1104
1105 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
1106 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
1107 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
1108 b4_define_user_cde and uses): Remove.
1109 (b4_comment, b4_prefix, b4_sync_start): New.
1110 * data/bison.m4: New file, with most of the content removed from c.m4.
1111 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
1112 * src/output.c (output_skeleton): Pass bison.m4.
1113 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
1114 only if specified.
1115
1116 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
1117
1118 Fix test failure reported by Tom Lane in
1119 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
1120 and try to make such failures easier to catch in the future.
1121 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
1122 that's now the caller's responsibility.
1123 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
1124 Set yychar = YYEOF if it's negative.
1125 * tests/actions.at (yylex): Abort if asked to read past EOF.
1126 * tests/conflicts.at (yylex): Likewise.
1127 * tests/cxx-type.at (yylex): Likewise.
1128 * tests/glr-regression.at (yylex): Likewise.
1129 * tests/input.at (yylex): Likewise.
1130 * tests/regression.at (yylex): Likewise.
1131 * tests/torture.at (yylex): Likewise.
1132
1133 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
1134
1135 Fix problems with translating English-language diagnostics.
1136 * bootstrap: Fix bug introduced in recent bootstrap changes, with
1137 respect to bison-runtime pot generation. The YY_ stuff
1138 wasn't being captured.
1139 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
1140 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
1141 * runtime-po/POTFILES.in: Add data/push.c.
1142
1143 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
1144
1145 Merge bootstrap changes from coreutils.
1146
1147 2006-09-28 Jim Meyering <jim@meyering.net>
1148
1149 Automatically generated dependencies are important even
1150 when all of the sources in a directory come from gnulib.
1151 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
1152 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
1153
1154 2006-09-23 Jim Meyering <jim@meyering.net>
1155
1156 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
1157
1158 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1159
1160 * bootstrap: Add support for --force.
1161 (usage): New function. Describe usage less tersely.
1162 (CVS_only_file): New var.
1163
1164 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
1165
1166 * data/push.c (YYPUSH_MORE): Make it an enum instead.
1167 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
1168 Adjust white space and comments to match GNU style better.
1169
1170 2006-09-20 Bob Rossi <bob@brasko.net>
1171
1172 * data/push.c (yyresult_get): Remove function.
1173 (YYPUSH_MORE): Add #define.
1174 (yypushparse): Modify return value.
1175
1176 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1177
1178 * stamp-h.in: Remove; no longer needed.
1179 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
1180 Remove config.h, config.hin, intl (no longer created).
1181 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
1182 stamp-h1.
1183
1184 Sync bootstrap from coreutils, as follows:
1185
1186 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
1187
1188 * bootstrap (symlink_to_gnulib): New function.
1189 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
1190 to copies-of-gnulib.
1191 (cp_mark_as_generated, slurp, gnulib_files):
1192 Avoid making a copy if it's the same as the old version.
1193 (gnulib_files): Add support for this variable (used by Bison).
1194
1195 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1196
1197 * src/getargs.c (usage): Rework to use conventions similar to
1198 coreutils, to make translation a bit easier and the code a bit
1199 smaller. Problem reported by Tim Van Holder.
1200
1201 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
1202
1203 Use some of gnulib's new modules, taken from coreutils.
1204
1205 * bootstrap: Sync from coreutils, except add support for gnulib_files.
1206 * bootstrap.conf: New file.
1207 (gnulib_modules): Add configmake, inttypes, unistd.
1208 (XGETTEXT_OPTIONS): Add complain, complain_at,
1209 fatal, fatal_at, warn, warn_at, unexpected_end.
1210 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
1211 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
1212 (gl_EARLY): Add.
1213 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
1214 (gl_INIT): Add
1215 (GNULIB_AUTOCONF_SNIPPET): Remove.
1216 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
1217 the pickiest.
1218 * lib/.cvsignore: Add inttypes_.h.
1219 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
1220 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
1221 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
1222 no-longer-necessary initializations.
1223 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
1224 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
1225 use the unistd module.
1226 * src/system.h: Likewise.
1227 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
1228 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
1229 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
1230 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
1231 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
1232 * src/system.h: Include inttypes.h unconditionally, now that we
1233 use the inttypes module. Don't bother to include stdint.h, since
1234 inttypes.h now does that for us.
1235 (LOCALEDIR): Remove, now that we use the configmake module.
1236 * src/getargs.c: Include configmake.h.
1237 * src/main.c: Likewise.
1238 * src/output.c: Likewise.
1239 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
1240 not from $abs_top_builddir, since config.h moved.
1241
1242
1243 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
1244 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
1245
1246 * src/parse-gram.y (symbol_declaration): Don't put statements
1247 before declarations; it's not portable to C89.
1248 * src/scan-code.l (handle_action_at): Likewise.
1249
1250 * src/scan-code.l: Always initialize braces_level; the old code
1251 left it uninitialized and therefore had undefined behavior.
1252
1253 Don't attempt to redefine 'assert', since it runs afoul of
1254 systems where standard headers (mistakenly) include <assert.h>.
1255 Instead, define and use our own alternative, called 'aver'.
1256 * src/reader.c: Don't include assert.h, since we no longer
1257 use assert.
1258 * src/scan-code.l: Likewise.
1259 * src/system.h (assert): Remove, replacing with....
1260 (aver): New function, taking a bool arg. All uses changed.
1261 * src/tables.c (pack_vector): Ensure that aver arg is bool,
1262 not merely an integer.
1263
1264 2006-09-15 Bob Rossi <bob@brasko.net>
1265
1266 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
1267 * data/c.m4 (YYPUSH): New.
1268 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
1269 * src/getargs.c (push_parser): New var.
1270 * src/getargs.h (push_parser): New declaration.
1271 * src/output.c (prepare): Add macro insertion of `push_flag'.
1272 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
1273 (prologue_declaration): Parse %push-parser.
1274 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
1275 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
1276 list of removed lines from the traces observed.
1277 (AT_CHECK_CALC_LALR): Added push parser tests.
1278
1279 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
1280
1281 * NEWS: Version 2.3a.
1282 * configure.ac (AC_INIT): Likewise.
1283
1284 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
1285 "#define YYSTYPE int" that caused "make maintainer-check" to fail
1286 due to header ordering dependencies. I don't know why the #define
1287 was there.
1288
1289 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
1290 runtime cost when YYDEBUG is not defined, and so that some tests
1291 that used to fail now work. Problem and initial suggestion by
1292 Paolo Bonzini.
1293 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
1294 * data/glr.cc (b4_parser_class_name):
1295 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
1296 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
1297 (yydebug_) [YYDEBUG]: New member.
1298 (yycdebug_): Now defined only if YYDEBUG.
1299 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
1300 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
1301 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
1302 if YYYDEBUG.
1303 (debug_stream, set_debug_stream, debug_level, set_debug_level):
1304 Define only if YYDEBUG.
1305 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
1306 set_debug_level.
1307 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
1308 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
1309 AT_CHECK_CALC_GLR_CC that are working now.
1310
1311 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
1312
1313 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
1314 We don't need them in glr.cc, and glr.c defines them.
1315 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
1316 assumes that defining it to anything is the same as defining
1317 it to 1. Problem reported by Paolo Bonzini.
1318
1319 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
1320
1321 * data/c.m4 (b4_null, b4_case): Define.
1322 * src/output.c (prepare_symbols): Use b4_null.
1323 (user_actions_output): Use b4_case.
1324
1325 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
1326
1327 * data/glr.c (b4_shared_declarations): Put start-header first,
1328 before any #includes that we generate, so that feature-test
1329 macros work. Problem reported by Michael Deutschmann in
1330 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
1331 * data/lalr1.cc: Likewise.
1332 * doc/bison.texinfo (Prologue): Document that feature-test macros
1333 should be defined before any Bison declarations.
1334 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
1335 that depend on location.hh after, not before, Bison decls, since
1336 we now include location.hh after the first user prologue.
1337
1338 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
1339 Sander Brandenburg in
1340 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
1341 Also, fix minor white space and comment issues.
1342 (Prologue): Mention that it's better to define feature-test macros
1343 before Bison declarations. Problem reported by Michael Deutschmann.
1344
1345 * README-cvs: Fix typo: "&" should be "&&". Problem reported
1346 by Jim Meyering.
1347 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
1348 This adjusts to recent gnulib changes.
1349
1350 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
1351
1352 Finish implementation of per-type %destructor/%printer. Discussed
1353 starting at
1354 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
1355 and
1356 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
1357 * NEWS (2.3+): Add a description of this feature to the default
1358 %destructor/%printer description.
1359 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
1360 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
1361 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
1362 list node contains a semantic type.
1363 * src/symtab.c, src/symtab.h: Extend with a table that associates
1364 semantic types with their %destructor's and %printer's.
1365 (semantic_type_from_uniqstr, semantic_type_get,
1366 semantic_type_destructor_set, semantic_type_printer_set): New functions
1367 composing the public interface of that table.
1368 (symbol_destructor_get, symbol_destructor_location_get,
1369 symbol_printer_get, symbol_printer_location_get): If there's no
1370 per-symbol %destructor/%printer, look up the per-type before trying
1371 the default.
1372 * tests/actions.at (Per-type %printer and %destructor): New test case.
1373 * tests/input.at (Default %printer and %destructor redeclared):
1374 Extend to check that multiple occurrences of %symbol-default in a
1375 single %destructor/%printer declaration is an error.
1376 (Per-type %printer and %destructor redeclared, Unused values with
1377 per-type %destructor): New test cases.
1378
1379 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
1380
1381 Require default %destructor/%printer to be declared using
1382 %symbol-default instead of an empty symbol list, and start working on
1383 new per-type %destructor/%printer. Discussed at
1384 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
1385 * NEWS (2.3+): Add %symbol-default to example.
1386 * bison.texinfo (Freeing Discarded Symbols): Likewise.
1387 (Bison Symbols): Add entry for %symbol-default.
1388 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
1389 (generic_symlist, generic_symlist_item): New nonterminals for creating
1390 a list in which each item is a symbol, semantic type, or
1391 %symbol-default.
1392 (grammar_declaration): Use generic_symlist in %destructor and %printer
1393 declarations instead of symbols.1 or an empty list.
1394 (symbol_declaration, precedence_declaration, symbols.1): Update actions
1395 for changes to symbol_list.
1396 * src/reader.c: Update for changes to symbol_list.
1397 * src/scan-code.l: Likewise.
1398 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
1399 * src/symlist.c, src/symlist.h: Extend such that a list node may
1400 represent a semantic type or a %symbol-default in addition to just an
1401 ordinary symbol. Add switched functions for setting %destructor's and
1402 %printer's.
1403 * tests/actions.at, tests/input.at: Add %symbol-default to all default
1404 %destructor/%printer declarations.
1405
1406 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
1407
1408 Whether the default %destructor/%printer applies to a particular symbol
1409 isn't a question of whether the user *declares* that symbol (in %token,
1410 for example). It's a question of whether the user by any means
1411 *defines* the symbol at all (by simply using a char token, for
1412 example). $end is defined by Bison whereas any other token with token
1413 number 0 is defined by the user. The error token is always defined by
1414 Bison regardless of whether the user declares it with %token, but we
1415 may one day let the user define error as a nonterminal instead.
1416 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
1417 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
1418 the meaning of "user-defined".
1419 * tests/actions.at (Default %printer and %destructor for user-declared
1420 end token): Rename to...
1421 (Default %printer and %destructor for user-defined end token): ...
1422 this.
1423
1424 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
1425 computation of whether to apply the default, don't maintain a list of
1426 every Bison-defined symbol. Instead, just check for a first character
1427 of '$', which a user symbol cannot have, and check for the error token.
1428
1429 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
1430
1431 Don't apply the default %destructor or %printer to the error token,
1432 $undefined, or $accept. This change fits the general rule that the
1433 default %destructor and %printer are only for user-declared symbols,
1434 and it solves several difficulties that are described in the new test
1435 cases listed below.
1436 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
1437 * tests/actions.at (Default %printer and %destructor are not for error
1438 or $undefined, Default %printer and %destructor are not for $accept):
1439 New test cases.
1440
1441 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
1442
1443 Allow %start after the first rule.
1444 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
1445 when parsing the first rule.
1446 (check_and_convert_grammar): Search for it here after all grammar
1447 declarations have been parsed. Skip midrules, which have dummy LHS
1448 nonterminals.
1449 * src/symtab.c (symbol_is_dummy): New function.
1450 * src/symtab.h (symbol_is_dummy): Declare it.
1451 * tests/input.at (%start after first rule): New test.
1452
1453 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
1454
1455 Redo some of the previous commit: add back the ability to use
1456 non-aliased/undeclared string literals since it might be useful to
1457 those declaring %token-table.
1458 * src/reader.c (check_and_convert_grammar): Undo changes in previous
1459 commit: don't worry about complaints from symbols_pack.
1460 * src/symtab.c (symbol_new, symbol_class_set,
1461 symbol_check_alias_consistency): Undo changes in previous commit: count
1462 each string literal as a new symbol and token, assign it a symbol
1463 number, and don't complain about non-aliased string literals.
1464 (symbols_pack): Since symbol_make_alias still does not decrement symbol
1465 and token counts but does still set aliased tokens to the same number,
1466 symbol_pack_processor now leaves empty slots in the symbols array.
1467 Remove those slots.
1468 * tests/regression.at (Undeclared string literal): Remove test case
1469 added in previous commit since non-aliased string literals are allowed
1470 again.
1471 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
1472 remove unnecessary string literal declarations.
1473 * tests/sets.at (Firsts): Likewise.
1474
1475 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
1476
1477 Don't allow an undeclared string literal, but allow a string literal to
1478 be used before its declaration.
1479 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
1480 symbols_pack complained.
1481 * src/symtab.c (symbol_new): Don't count a string literal as a new
1482 symbol.
1483 (symbol_class_set): Don't count a string literal as a new token, and
1484 don't assign it a symbol number since symbol_make_alias does that.
1485 (symbol_make_alias): It's not necessary to decrement the symbol and
1486 token counts anymore. Don't assume that an alias declaration occurs
1487 before any uses of the identifier or string, and thus don't assert that
1488 one of them has the highest symbol number so far.
1489 (symbol_check_alias_consistency): Complain if there's a string literal
1490 that wasn't declared as an alias.
1491 (symbols_pack): Bail if symbol_check_alias_consistency failed since
1492 symbol_pack asserts that every token has been assigned a symbol number
1493 although undeclared string literals have not.
1494 * tests/regression.at (String alias declared after use, Undeclared
1495 string literal): New test cases.
1496 (Characters Escapes, Web2c Actions): Declare string literals as
1497 aliases.
1498 * tests/sets.at (Firsts): Likewise.
1499
1500 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
1501
1502 In the grammar scanner, STRING_FINISH unclosed constructs and return
1503 them to the parser in order to improve error messages.
1504 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
1505 SC_BRACED_CODE, SC_PROLOGUE): Implement.
1506 * tests/input.at (Unclosed constructs): New test case.
1507 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
1508 seen.
1509
1510 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
1511 unused global.
1512
1513 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
1514
1515 Handle string aliases for character tokens correctly.
1516 * src/symtab.c (symbol_user_token_number_set): If the token has an
1517 alias, check and set its alias's user token number instead of its own,
1518 which is set to indicate the alias. Previously, every occurrence of
1519 the character token in the grammar overwrote that alias indicator with
1520 the character code.
1521 * tests/input.at (String aliases for character tokens): New test.
1522
1523 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
1524
1525 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
1526
1527 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
1528
1529 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
1530 to prevent failures when building on older platforms.
1531 Check for autopoint failure.
1532 Set XGETTEXT_OPTIONS to values that check for C format strings,
1533 so that translators are warned about them (this also helps
1534 prevent core dumps).
1535
1536 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
1537 function, since it simplifies our code a bit.
1538
1539 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
1540 rather than -W, so we don't get bogus warnings about sign comparisons.
1541 Add -Wpointer-arith, since that warning is useful (it reports code
1542 that does not conform to C89 and that some compilers reject).
1543 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
1544 since it's no longer needed.
1545
1546 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
1547
1548 Clean up scanners a bit.
1549 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
1550 definitions so gcc won't warn when obstack_for_string is unused.
1551 * src/scan-code.l: config.h and system.h are already #include'd by
1552 scan-code-c.c, so get rid of them here.
1553 * src/scan-gram.l: Likewise.
1554 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
1555 definitions rather than duplicating the rest of it.
1556 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
1557
1558 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
1559
1560 Suppress signed/unsigned comparison warnings for yycheck.
1561 * data/c.m4 (b4_safest_int_type): New macro.
1562 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
1563 a signed int type, cast it to b4_safest_int_type first.
1564 * data/yacc.c: Likewise.
1565 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
1566 also overwritten.
1567
1568 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
1569
1570 * doc/bison.texinfo: Fix some typos.
1571
1572 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
1573
1574 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
1575 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
1576
1577 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
1578 the latest gnulib does this a different way.
1579 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
1580 translation was patched, so stop omitting it.
1581
1582 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1583
1584 Enable declaration of default %printer/%destructor. Make the parser
1585 use these for all user-declared grammar symbols for which the user does
1586 not declare a specific %printer/%destructor. Thus, the parser uses it
1587 for token 0 if the user declares it but not if Bison generates it as
1588 $end. Discussed starting at
1589 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
1590 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
1591 and
1592 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
1593 * NEWS (2.3+): Mention.
1594 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
1595 declare a %destructor for a mid-rule's semantic value. It's just
1596 impossible to declare one specific to it.
1597 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
1598 code. Describe default %destructor form.
1599 * src/parse-gram.y (grammar_declaration): Parse default
1600 %printer/%destructor declarations.
1601 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
1602 and symbol_destructor_location_get rather than accessing the destructor
1603 and destructor_location members of struct symbol.
1604 (symbol_printers_output): Likewise but for %printer's.
1605 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
1606 again.
1607 * src/symtab.c (default_destructor, default_destructor_location,
1608 default_printer, default_printer_location): New static global
1609 variables to record the default %destructor and %printer.
1610 (symbol_destructor_get, symbol_destructor_location_get,
1611 symbol_printer_get, symbol_printer_location_get): New functions to
1612 compute the appropriate %destructor and %printer for a symbol.
1613 (default_destructor_set, default_printer_set): New functions to set the
1614 default %destructor and %printer.
1615 * src/symtab.h: Prototype all those new functions.
1616 * tests/actions.at (Default %printer and %destructor): New test to
1617 check that the right %printer and %destructor are called, that they're
1618 not called for $end, and that $$ and @$ work correctly.
1619 (Default %printer and %destructor for user-declared end token): New
1620 test to check that the default %printer and %destructor are called for
1621 a user-declared end token.
1622 * tests/input.at (Default %printer and %destructor redeclared, Unused
1623 values with default %destructor): New tests to check related grammar
1624 warnings and errors.
1625
1626 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1627
1628 Clean up handling of %destructor for the end token (token 0).
1629 Discussed starting at
1630 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
1631 and
1632 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
1633
1634 Make the skeletons consistent in how they pop the end token and invoke
1635 its %destructor.
1636 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
1637 state, which has token number 0, since this would invoke the
1638 %destructor for the end token.
1639 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
1640 until after shifting the end token, or else it won't be popped.
1641 * data/yacc.c (yyparse): Likewise.
1642
1643 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
1644 it's the end token. Upon termination, destroy an unshifted lookahead
1645 even when it's the end token.
1646 * data/lalr1.cc (yy::parser::parse): Likewise.
1647 * data/yacc.c (yyparse): Likewise.
1648
1649 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
1650 value warnings for the end token when the user gives the end token a
1651 %destructor.
1652
1653 * tests/actions.at (Printers and Destructors): Test all the above.
1654
1655 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
1656
1657 Update to latest gnulib and gettext versions.
1658 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
1659 Add fopen-safer.
1660 (gnulib_files): Add m4/warning.m4. Don't worry about files
1661 overwritten by autopoint.
1662 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
1663 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
1664 rejects them.
1665 Don't use autoreconf; instead, invoke autopoint etc. by hand,
1666 so that we can remove the intl files at a better time.
1667 (intl_files_to_remove): Remove aclocal.m4, since it gets
1668 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
1669 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
1670 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
1671 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
1672 Remove datarootdir hack; no longer needed.
1673 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
1674 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
1675 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
1676 strdup.h.
1677 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
1678 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
1679
1680 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
1681
1682 * bootstrap: Adjust to today's change to gnulib-tool by invoking
1683 it with --assume-autoconf='latest-stable'.
1684
1685 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
1686
1687 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
1688 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
1689 YYSTYPE' and `{'.
1690 * src/muscle_tab.h (muscle_grow): Replace the header comments with
1691 those from muscle_tab.c since the old ones are misleading.
1692
1693 2006-07-13 Akim Demaille <akim@epita.fr>
1694
1695 Support %define "KEY" {VALUE}.
1696 * src/scan-code.h, src/scan-code.l (translate_action)
1697 (translate_rule_action, translate_symbol_action, translate_code):
1698 Return char *, not const char *.
1699 * src/parse-gram.y (declaration): Rename as...
1700 (prologue_declaration): this.
1701 (string_content): Remove this nonterminal, use STRING.
1702 (braceless, content, content.opt): New nonterminal.
1703 Use them.
1704 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
1705 as value.
1706 * src/scan-gram.l (getargs.h): Don't include it.
1707
1708 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
1709
1710 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
1711 rather than a for-loop that declares a local bool variable. This
1712 should work around a compatibility problem with a Cray x1e C++
1713 compiler reported by Hung Nguyen in
1714 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
1715 The for-loop was introduced in the 2004-11-17 change but I don't
1716 know why it was needed.
1717
1718 2006-07-12 Akim Demaille <akim@epita.fr>
1719
1720 * data/c.m4: Comment changes.
1721
1722 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
1723
1724 * src/complain.c (error_message, ERROR_MESSAGE): New.
1725 To factor...
1726 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
1727 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
1728
1729 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1730
1731 * NEWS: Instead of %union, you can define and use your own union type
1732 YYSTYPE if your grammar contains at least one <type> tag.
1733 Your YYSTYPE need not be a macro; it can be a typedef.
1734 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
1735 (Union Decl, Decl Summary): Document this.
1736 * data/glr.c (YYSTYPE): Implement this.
1737 * data/glr.cc (YYSTYPE): Likewise.
1738 * data/lalr1.cc (YYSTYPE): Likewise.
1739 * data/yacc.c (YYSTYPE): Likewise.
1740 * src/output.c (prepare): Output tag_seen_flag.
1741 * src/parse-gram.y (declaration, grammar_declaration):
1742 Use 'union_seen' rather than 'typed' to determine whether
1743 %union has been seen, since grammars can now be typed without
1744 %union.
1745 (symbol_declaration, type.opt, symbol_def):
1746 Keep track of whether a tag has been seen.
1747 * src/reader.c (union_seen, tag_seen): New vars.
1748 (typed): remove.
1749 * src/reader.h (union_seen, tag_seen, typed): Likewise.
1750 * src/scan-code.l (untyped_var_seen): New variable.
1751 (handle_action_dollar): Adjust to above changes.
1752 (handle_action_dollar, handle_action_at):
1753 Improve overflow checking for outlandish numbers.
1754 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
1755 avoid new diagnostics generated by above changes.
1756 * tests/regression.at (YYSTYPE typedef): Add test to check
1757 for type tags without %union.
1758
1759 * src/symlist.c (symbol_list_length): Return int, not unsigned
1760 int, since callers expect int. This may need to get revisited
1761 once we have proper integer overflow checking.
1762
1763 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
1764 object is now static.
1765
1766 * src/getargs.c (flags_argmatch): Return void, not int,
1767 to pacify ./configure --enable-gcc-warnings.
1768
1769 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
1770 since last_string is already defined to FLEX_PREFIX (last_string).
1771
1772 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
1773
1774 Implement --warnings/-W.
1775 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
1776 replaced by...
1777 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
1778 Adjust callers.
1779 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
1780 (warnings_args, warnings_types): New.
1781 (getargs, short_options, long_options): Accept -W/--warnings.
1782 Sort the options by alphabetical order, upper case letter right
1783 before its lower case.
1784
1785 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1786
1787 Change %merge result type clash warnings to errors. Discussed at
1788 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
1789 * src/reader.c (record_merge_function_type): Use complain_at.
1790 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1791 declared later): Update test case results.
1792
1793 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
1794
1795 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
1796 to be in alphabetical order.
1797 (trace_args): Spelling fixes.
1798
1799 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1800
1801 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
1802 so they don't collide with user-defined macros.
1803 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
1804 this was never guaranteed, and now that we're using gnulib stdint,
1805 which defines int_fast16_t to long int, the problem is exposed.
1806
1807 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
1808
1809 * data/c.m4 (b4_basename): Simplify a bit, since we don't
1810 need the full POSIX semantics (and weren't implementing them
1811 anyway).
1812
1813 Adjust to Autoconf 2.60 and today's gnulib.
1814 * bootstrap (gnulib_modules): Add stdint.
1815 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
1816 no longer copies it.
1817 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
1818 since stdint needs the former and wcwidth (which is now required
1819 by mbswidth) needs the latter.
1820 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
1821 work around a compatibility glitch between gettext 0.14.6 and
1822 Autoconf 2.60.
1823 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
1824 Do not check for uintptr_t, since new stdint module does the right
1825 thing.
1826 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
1827 Add stdint.h, stdint_.h, wcwidth.h.
1828 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
1829 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
1830 stdint.m4, wchar_t.m4, wcwidth.m4.
1831 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
1832 usual order for ../lib/*.h files.
1833 (file_name_split): Use last_component, not base_name, to adjust
1834 to gnulib changes.
1835 * src/parse-gram.h: Include <strverscmp.h> in the usual order
1836 for ../lib/*.h files.
1837 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
1838 Define unconditionally, since we now assume the stdint module.
1839 * src/scan-skel.l: Include <dirname.h>.
1840 (BASE_QPUTS): Use last_component, not base_name.
1841 * src/system.h: Include <unlocked-io.h> in the usual order
1842 for ../lib/*.h files. Include <stdint.h> unconditionally,
1843 since we now use the stdint module.
1844 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
1845 HAVE_UINTPTR_T, since we now use the stdint module.
1846 (base_name): Remove decl, since files now include <dirname.h>
1847 to get the decl.
1848
1849 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
1850
1851 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
1852 New, default to 1.
1853 * data/yacc.c, data/glr.c, data/location.cc: Use them.
1854 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
1855 default.
1856 * tests/calc.at: Adjust.
1857
1858 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
1859
1860 * data/c.m4 (b4_basename): New.
1861 (b4_syncline): Also output the location of its invocation (from
1862 the skeleton).
1863 (b4_user_action, b4_define_user_action, b4_user_actions)
1864 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
1865 (b4_user_stype): New.
1866 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
1867
1868 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1869
1870 In the grammar file, the first column is 1 not 0 on the first line as
1871 on every other line.
1872 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
1873 * tests/input.at (Torturing the Scanner): Update output.
1874
1875 * src/scan-gram.l (scanner_cursor): Declare it static.
1876
1877 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1878
1879 In warnings, say "previous declaration" rather than "first
1880 declaration".
1881 * src/symtab.c (redeclaration): Do that here.
1882 * src/reader.c (record_merge_function_type): In the case of a result
1883 type clash, report the previous declaration rather than the very first
1884 one in the grammar file.
1885 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1886 declared later): Add a third declaration to check this behavior.
1887 * tests/input.at (Incompatible Aliases): Update output.
1888
1889 2006-06-27 Akim Demaille <akim@epita.fr>
1890
1891 * doc/Doxyfile.in: New.
1892 * doc/Makefile.am: Use it.
1893 * src/lalr.h, src/symtab.h: Initial doxygenation.
1894
1895 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1896
1897 Don't miss %merge result type warnings just because the LHS types are
1898 declared after the %merge. This continues the effort of the previous
1899 patch.
1900 * src/reader.c (get_merge_function): Don't set the merger type yet.
1901 (record_merge_function_type): New function for setting the merger type
1902 and checking for clashes.
1903 (grammar_current_rule_merge_set): Set the location of the %merge for
1904 the current rule.
1905 (packgram): Invoke record_merge_function_type for each rule now that
1906 all symbol type declarations have been parsed.
1907 * src/reader.h (merger_list.type_declaration_location): New member
1908 storing the location of the first %merge from which the type for this
1909 merging function was derived.
1910 * src/symlist.h (symbol_list.merger_declaration_location): New member
1911 storing the location of a rule's %merge, if any.
1912 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1913 declared later): New test to catch the error fixed by the above patch.
1914
1915 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1916
1917 Get action warnings (grammar_rule_check) right even when symbol
1918 declarations appear after the rules. Discussed at
1919 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
1920 and
1921 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
1922 Don't mistake the type of $$ in a midrule to be that of its parent
1923 rule's $$.
1924 * src/reader.c (grammar_current_rule_end): Don't invoke
1925 grammar_rule_check yet since not all symbol declarations may have been
1926 parsed yet.
1927 (grammar_midrule_action): Likewise.
1928 Don't record whether the midrule's $$ has been used yet since actions
1929 haven't been translated yet.
1930 Record the midrule's parent rule and its RHS index within the parent
1931 rule.
1932 (grammar_current_rule_action_append): Don't translate the action yet
1933 since not all symbol declarations may have been parsed yet and, thus,
1934 warnings about types for $$, $n, @$, and @n can't be reported yet.
1935 (packgram): Translate the action and invoke grammar_rule_check now that
1936 all symbol declarations have been parsed.
1937 * src/scan-code.l (handle_action_dollar): Now that this is invoked
1938 after parsing the entire grammar file, the symbol list here in the case
1939 of a midrule is actually the midrule's empty RHS, so reference its
1940 parent rule's RHS where necessary.
1941 On the other hand, now that you can already know it's a midrule, you
1942 aren't forced to think $$ has the same type as its parent rule's $$.
1943 (handle_action_at): In the case of a midrule, reference the parent rule
1944 where necessary.
1945 * src/symlist.c (symbol_list_new): Initialize new midrule-related
1946 members.
1947 (symbol_list_length): Now that this is invoked after all rules have
1948 been parsed, a NULL symbol (rather than a NULL symbol list node)
1949 terminates a rule. symbol_list_print already does this correctly.
1950 * src/symlist.h (symbol_list.midrule_parent_rule,
1951 symbol_list.midrule_parent_rhs_index): New members so that midrules can
1952 remember their relationships with their parents.
1953 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
1954 fixed by the above patch.
1955 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
1956 implementing...
1957 (Unused values): ... this old test case and...
1958 (Unused values before symbol declarations): ... this new test case.
1959 This one is the same as `Unused values' except that all symbol
1960 declarations appear after the rules in order to catch the rest of the
1961 errors fixed by the above patch.
1962
1963 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1964
1965 More cleanup.
1966 * src/reader.c (current_rule): Declare it static since it's no longer
1967 used outside this file.
1968 (grammar_current_rule_action_append): Remove redundant arguments from
1969 translate_rule_action invocation.
1970 * src/reader.h (current_rule): Remove this unused extern.
1971 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
1972 * src/scan-code.l (translate_rule_action): Likewise.
1973
1974 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
1975
1976 Clean up yesterday's patch.
1977 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
1978 to...
1979 * src/reader.c (grammar_current_rule_action_append): ... here for
1980 consistency with grammar_current_rule_symbol_append.
1981 * tests/regression.at (Braced code in declaration in rules section):
1982 Make yyerror and yylex static as usual.
1983
1984 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
1985
1986 Fix bug that mistakes braced code in a declaration in the rules section
1987 to be a rule action. Mentioned at
1988 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
1989 * src/scan-gram.l: Move midrule action detection from the start of the
1990 scanning of any braced code to...
1991 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
1992 action. For readability, use $2 and @2 rather than the equivalent
1993 global variables.
1994 * tests/regression.at (Braced code in declaration in rules section):
1995 New test to catch the error fixed by the above patch.
1996
1997 Work on code readability some.
1998 * src/scan-code.l (current_rule): Get rid of this misleading and
1999 redundant declaration: it's actually extern'ed in reader.h.
2000 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
2001 translate_action): Add a rule argument and use it instead of the global
2002 current_rule.
2003 (translate_rule_action): This already receives current_rule through an
2004 argument, so pass it on to translate_action instead of assigning
2005 current_rule to current_rule.
2006 (translate_symbol_action, translate_code): Pass rule = NULL to
2007 translate_action.
2008
2009 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
2010
2011 Rename %before-definitions to %start-header and %after-definitions to
2012 %end-header. Don't use these declarations to separate pre-prologue
2013 blocks from post-prologue blocks. Add new order-independent
2014 declarations %before-header and %after-header as alternatives to the
2015 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
2016 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
2017 * NEWS (2.3+): Update for these changes.
2018 * data/glr.c (b4_before_definitions): Update to...
2019 (b4_start_header): ... this.
2020 (b4_after_definitions): Update to...
2021 (b4_end_header): ... this.
2022 * data/glr.cc: Likewise.
2023 * data/lalr1.cc: Likewise.
2024 * data/yacc.c: Likewise.
2025 * doc/bison.texinfo (The prologue): Update names, and replace remaining
2026 prologue blocks with %*-header declarations.
2027 (Calc++ Parser): Likewise.
2028 (Bison Declaration Summary): Update names.
2029 (Bison Symbols): Update description.
2030 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
2031 (PERCENT_END_HEADER): ... this.
2032 (PERCENT_BEFORE_DEFINITIONS): Update to...
2033 (PERCENT_START_HEADER): ... this.
2034 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
2035 (declaration): Update token names and m4 macro names.
2036 When parsing %end-header and %start-header, invoke translate_code
2037 before muscle_code_grow, and no longer set global booleans to remember
2038 whether these declarations have been seen.
2039 Parse new %after-header and %before-header.
2040 * src/reader.c (before_definitions, after_definitions): Remove.
2041 (prologue_augment): Accept a new bool argument to specify whether to
2042 augment the pre-prologue or post-prologue.
2043 * src/reader.h (before_definitions, after_definitions): Remove these
2044 extern's.
2045 (prologue_augment): Add new bool argument.
2046 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
2047 (PERCENT_END_HEADER): ... this.
2048 (PERCENT_BEFORE_DEFINITIONS): Update to...
2049 (PERCENT_START_HEADER): ... this.
2050 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
2051 * tests/actions.at (Printers and Destructors): Update names.
2052
2053 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
2054
2055 Add comparison operators for C++ location classes. Discussed at
2056 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
2057 * data/c++.m4 (b4_define_location_comparison): New boolean %define
2058 declaration indicating whether filename_type has an operator==. If
2059 filename_type is `std::string', it defaults to `1', `0' otherwise.
2060 * data/location.cc: Iff b4_define_location_comparison is `1', add
2061 operator== and operator!= for class position and for class location.
2062
2063 Some minor fixes.
2064 * src/scan-action.l: Remove unused file.
2065 * src/symtab.c (symbol_printer_set): Use printer_location not
2066 destructor_location.
2067 * src/symtab.h (struct symbol): Replace incorrect source comment for
2068 printer members.
2069 * tests/input.at (Incompatible Aliases): Update output with correct
2070 printer location.
2071
2072 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
2073
2074 Don't put the pre-prologue in the header file. For the yacc.c code
2075 file and the glr.c header and code files, move the pre-prologue before
2076 the token definitions. Add new %before-definitions and
2077 %after-definitions to declare code that will go in both the header file
2078 and code file. Discussed at
2079 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
2080 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
2081 and
2082 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
2083 * NEWS (2.3+): Describe these changes.
2084 * data/glr.c (b4_pre_prologue): Move from within to before...
2085 (b4_shared_declarations): ... this.
2086 Add new b4_before_definitions before b4_token_enums.
2087 Add new b4_after_definitions at the end.
2088 * data/glr.cc (b4_pre_prologue): Replace with...
2089 (b4_before_definitions): ... this in the header file.
2090 (b4_after_definitions): New near the end of the header file.
2091 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
2092 code file right before including the header file.
2093 (b4_before_definitions): New in the previous position of
2094 b4_pre_prologue in the header file.
2095 (b4_after_definitions): New near the end of the header file.
2096 * data/yacc.c: Clean up some m4 quoting especially in the header file.
2097 (b4_token_enums_defines): In the code file, move to right before
2098 YYSTYPE for consistency with the header file.
2099 (b4_before_definitions): New right before b4_token_enums_defines in
2100 both the header and code file.
2101 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
2102 header and code file.
2103 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
2104 of prologues for %union dependencies.
2105 (Bison Declaration Summary): In %defines description, mention the
2106 effect of %before-definitions and %after-definitions on the header
2107 file.
2108 (Calc++ Parser): Forward declare driver in a %before-definitions rather
2109 than in the pre-prologue so that make check succeeds.
2110 (Bison Symbols): Add entries for %before-definitions and
2111 %after-definitions.
2112 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
2113 %before-definitions.
2114 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
2115 (declaration): Parse those declarations and append to
2116 b4_before_definitions and b4_after_definitions, respectively.
2117 * src/reader.c (before_definitions, after_definitions): New bools to
2118 track whether those declarations have been seen.
2119 (prologue_augment): Add to the post-prologue if %union,
2120 %before-definitions, or %after-definitions has been seen.
2121 * src/reader.h (before_definitions, after_definitions): New extern's.
2122 * src/scan-gram.l: Scan the new declarations.
2123 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
2124 prologue block in a %before-definitions or a %after-definitions based
2125 on whether the %union is declared.
2126 * tests/regression.at (Early token definitions with --yacc, Early token
2127 definitions without --yacc): Move tests for token definitions into the
2128 post-prologue since token names are no longer defined in the
2129 pre-prologue.
2130
2131 2006-06-20 Akim Demaille <akim@epita.fr>
2132
2133 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
2134 (symbol_get): Use it.
2135 * src/parse-gram.y: Use it.
2136
2137 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
2138
2139 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
2140 build succeeds when configured with --enable-gcc-warnings.
2141
2142 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
2143
2144 * src/parse-gram.y (char_name): New function.
2145 (CHAR, STRING, string_content): For %printer, properly escape.
2146 (ID): Prefer fputs to fprintf.
2147 (id): Reindent to be consistent with other rules.
2148 Properly quote char.
2149
2150 The Translation Project changed its way of publishing translations
2151 to maintainers. I haven't received any responses to my request
2152 for supporting the old way, or for documenting the new way. I
2153 have modified 'bootstrap' to use screen scraping
2154 (in this case, HTML scraping). This is unreliable and inelegant,
2155 but I don't see any better way. Yuck.
2156 * bootstrap (TP_URL, WGET_COMMAND): New vars.
2157 (get_translations): New function, which uses HTML scraping to
2158 deduce locations of latest translations.
2159 Use this function to grab both bison and bison-runtime .po files.
2160 Don't bother priming the pump for the runtime-po domain any more,
2161 as it's now translated better than bison is.
2162
2163 2006-06-19 Akim Demaille <akim@epita.fr>
2164
2165 * src/scan-gram.l: No longer "parse" things after `%union' until
2166 `{'. Rather, return a single "%union" token.
2167 No longer make symbols: return strings, and leave the conversion
2168 to symbols to the parser.
2169 (SC_PRE_CODE, token_type): Remove.
2170 * src/parse-gram.y (%union): New field `character'.
2171 Sort tokens.
2172 (CHAR): New token.
2173 (ID, ID_COLON): Now that the scanner no longer makes them
2174 identifiers, adjust all uses to invoke symbol_get.
2175 (id_colon): New, wraps the conversion from string to symbol.
2176 (%union): Accept a possible union_name.
2177 (symbol): Now can be a char.
2178 * data/c.m4 (b4_union_name): Leave a default value.
2179 * data/glr.c, data/yacc.c: Use it.
2180
2181 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
2182
2183 For associating token numbers with token names for "yacc.c", don't use
2184 #define statements unless `--yacc' is specified; always use enum
2185 yytokentype. Most important discussions start at:
2186 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
2187 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
2188 and
2189 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
2190 * NEWS (2.3+): Mention.
2191 * data/c.m4 (b4_yacc_if): New.
2192 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
2193 token #define's.
2194 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
2195 on token name definitions.
2196 * src/getargs.c (usage): Capitalize `Yacc' in English.
2197 * src/output.c (prepare): Define b4_yacc_flag.
2198 * tests/regression.at (Early token definitions): Test that tokens names
2199 are defined before the pre-prologue not just before the post-prologue.
2200 Remove this test case and copy to...
2201 (Early token definitions with --yacc): ... this to test #define's.
2202 (Early token definitions without --yacc): ... and this to test enums.
2203
2204 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
2205
2206 * NEWS: Reword the post-2.3 change to not be so optimistic about
2207 removing the old "look-ahead" spelling.
2208 Update previous look-ahead/lookahead change reports.
2209 * REFERENCES: look-ahead -> lookahead (since that's
2210 what he actually wrote).
2211 * doc/refcard.tex: look ahead -> lookahead,
2212 look-ahead -> lookahead
2213
2214 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
2215
2216 For consistency, use `lookahead' instead of `look-ahead' or
2217 `look_ahead'. Discussed starting at
2218 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
2219 and then at
2220 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
2221 * NEWS: For the next release, note the change to `--report'.
2222 * TODO, doc/bison.1: Update English.
2223 * doc/bison.texinfo: Update English.
2224 (Understanding Your Parser, Bison Options): Document as
2225 `--report=lookahead' rather than `--report=look-ahead'.
2226 * src/conflicts.c: Update English in comments.
2227 (lookahead_set): Rename from look_ahead_set.
2228 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
2229 (resolve_sr_conflict): Rename local look_ahead_tokens to
2230 lookahead_tokens, and update other uses.
2231 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
2232 count_rr_conflicts, conflicts_free): Update uses.
2233 * src/getargs.c (report_args): Move "lookahead" before alternate
2234 spellings.
2235 (report_types): Update uses.
2236 (usage): For `--report' usage description, state `lookahead' spelling
2237 rather than `look-ahead'.
2238 * src/getargs.h (report.report_lookahead_tokens): Rename from
2239 report_look_ahead_tokens.
2240 * src/lalr.c: Update English in comments.
2241 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
2242 (state_lookahead_tokens_count): Rename from
2243 state_look_ahead_tokens_count.
2244 Rename local n_look_ahead_tokens to n_lookahead_tokens.
2245 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
2246 Rename local n_look_ahead_tokens to n_lookahead_tokens.
2247 Update other uses.
2248 Update English in output.
2249 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
2250 * src/print.c: Update English in comments.
2251 (lookahead_set): Rename from look_ahead_set.
2252 (print_reduction): Rename argument lookahead_token from
2253 look_ahead_token.
2254 (print_core, state_default_rule, print_reductions, print_results):
2255 Update uses.
2256 * src/print_graph.c: Update English in comments.
2257 (print_core): Update uses.
2258 * src/state.c: Update English in comments.
2259 (reductions_new): Update uses.
2260 (state_rule_lookahead_tokens_print): Rename from
2261 state_rule_look_ahead_tokens_print, and update other uses.
2262 * src/state.h: Update English in comments.
2263 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
2264 (state_rule_lookahead_tokens_print): Rename from
2265 state_rule_look_ahead_tokens_print.
2266 * src/tables.c: Update English in comments.
2267 (conflict_row, action_row): Update uses.
2268 * tests/glr-regression.at
2269 (Incorrect lookahead during deterministic GLR,
2270 Incorrect lookahead during nondeterministic GLR): Rename
2271 print_look_ahead to print_lookahead.
2272 * tests/torture.at: Update English in comments.
2273 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
2274 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
2275 (Many lookahead tokens): Update uses.
2276 * data/glr.c: Update English in comments.
2277 * lalr1.cc: Likewise.
2278 * yacc.c: Likewise.
2279 * src/conflicts.h: Likewise.
2280 * src/lalr.h: Likewise.
2281 * src/main.c: Likewise.
2282 * src/output.c: Likewise.
2283 * src/parse-gram.c: Likewise.
2284 * src/tables.h: Likewise.
2285 * tests/calc.at: Likewise.
2286
2287 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
2288
2289 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
2290
2291 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
2292
2293 * TODO: Add request from Nelson H. F. Beebe to be able to install
2294 Bison without installing the yacc script.
2295
2296 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
2297
2298 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
2299 and yytext if they're already #define'd.
2300 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
2301 * src/scan-code-c.c: ... here.
2302 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
2303 <config.h>.
2304
2305 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
2306
2307 Get Bison to build again when configured with --enable-gcc-warnings.
2308 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
2309 missing #include's.
2310 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
2311 loc argument as it shadows a global.
2312 * src/scan-gram.l: Remove stray comma that prevents boundary_set
2313 invocation.
2314
2315 * src/.cvsignore: Add scan-code.c.
2316
2317 2006-06-07 Akim Demaille <akim@epita.fr>
2318
2319 * src/scan-gram.l: Move the "add a trailing ; to actions" code
2320 to...
2321 * src/scan-code.l: here.
2322 * tests/input.at (Torturing the Scanner): Fix another location
2323 error.
2324
2325 2006-06-07 Akim Demaille <akim@epita.fr>
2326
2327 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
2328
2329 2006-06-06 Akim Demaille <akim@epita.fr>
2330
2331 Extract the parsing of user actions from the grammar scanner.
2332 As a consequence, the relation between the grammar scanner and
2333 parser is much simpler. We can also split "composite tokens" back
2334 into simple tokens.
2335 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
2336 * src/scan-gram.l (add_column_width, adjust_location): Move to and
2337 rename as...
2338 * src/location.h, src/location.c (add_column_width)
2339 (location_compute): these.
2340 Fix the column count: the initial column is 0.
2341 (location_print): Be robust to ending column being 0.
2342 * src/location.h (boundary_set): New.
2343 * src/main.c: Adjust to scanner_free being renamed as
2344 gram_scanner_free.
2345 * src/output.c: Include scan-code.h.
2346 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
2347 Use boundary_set.
2348 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
2349 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
2350 which is now, again, a separate token.
2351 Adjust all dependencies.
2352 Whereever actions with $ and @ are used, use translate_code.
2353 (action): Remove this nonterminal which is now useless.
2354 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
2355 (grammar_current_rule_action_append): Use translate_code.
2356 (packgram): Bound check ruleno, itemno, and rule_length.
2357 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
2358 (last_string, last_braced_code_loc, max_left_semantic_context)
2359 (scanner_initialize, scanner_free, scanner_last_string_free)
2360 (gram_out, gram_lineno, YY_DECL_): Move to...
2361 * src/scan-gram.h: this new file.
2362 (YY_DECL): Rename as...
2363 (GRAM_DECL): this.
2364 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
2365 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
2366 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
2367 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
2368 Move these declarations, and...
2369 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
2370 these to...
2371 * src/flex-scanner.h: this new file.
2372 * src/scan-gram.l (rule_length, rule_length_overflow)
2373 (increment_rule_length): Remove.
2374 (last_braced_code_loc): Rename as...
2375 (gram_last_braced_code_loc): this.
2376 Adjust to the changes of the parser.
2377 Move all the handling of $ and @ into...
2378 * src/scan-code.l: here.
2379 * src/scan-gram.l (handle_dollar, handle_at): Remove.
2380 (handle_action_dollar, handle_action_at): Move to...
2381 * src/scan-code.l: here.
2382 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
2383 scan-code.h, scan-code-c.c, scan-gram.h.
2384 (EXTRA_bison_SOURCES): Add scan-code.l.
2385 (BUILT_SOURCES): Add scan-code.c.
2386 (yacc): Be robust to white spaces.
2387
2388 * tests/conflicts.at, tests/input.at, tests/reduce.at,
2389 * tests/regression.at: Adjust the column numbers.
2390 * tests/regression.at: Adjust the error message.
2391
2392 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
2393
2394 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
2395 Use Akim's wording from
2396 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
2397
2398 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
2399
2400 Between Bison releases, manually append `+' to the previous Bison
2401 release number, and use that as a signal to automatically print the
2402 ChangeLog's CVS Id keyword from --version. Discussed starting at
2403 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
2404 * ChangeLog: Add Id header.
2405 * configure.ac (AC_INIT): Append `+' to `2.3'.
2406 * src/.cvsignore: Add revision.c.
2407 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
2408 (BUILT_SOURCES): Add revision.c.
2409 (revision.c): New target rule. This file defines a new global variable
2410 named revision. It initializes it with either the Id from ChangeLog
2411 or, if VERSION doesn't contain `+', with the empty string.
2412 * src/getargs.c (version): Print the value of revision.
2413 * src/revision.h: Extern revision.
2414
2415 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
2416
2417 * NEWS: Version 2.3.
2418 * configure.ac (AC_INIT): Likewise.
2419
2420 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
2421
2422 * data/glr.c (YYRECOVERING): Define to be a function-like macro
2423 with no arguments, not as an object-like macro. This is for
2424 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
2425 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
2426 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
2427 Document this.
2428
2429 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
2430
2431 * src/getargs.c (usage): Back out yesterday's modification of the
2432 --help output so that we don't have to wait for translation before
2433 releasing 2.3.
2434
2435 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
2436
2437 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
2438 Problem reported by Akim Demaille.
2439
2440 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
2441
2442 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
2443
2444 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
2445
2446 * data/yacc.c (yy_reduce_print): Omit trailing white space in
2447 generated source code. Problem reported by Frans Englich in
2448 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
2449
2450 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
2451
2452 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
2453 shell, not within 'make', so that 'make' by an ordinary builder
2454 (using GNU make) does not worry about configuring gzip. This also
2455 works around a bug reported independently by Keith Thompson and by
2456 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
2457 stderr rather than stdout, messing up the build logs.
2458
2459 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
2460
2461 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
2462 to make sure that YYID will never be unused. This fixes a 'make
2463 maintainer-check' failure caused by the recent changes to the 'Trivial
2464 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
2465 not used.
2466 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
2467
2468 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
2469
2470 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
2471 state before an empty RHS is always resolved here. Only the location
2472 of that state is guaranteed to be resolved, and that's enough. This
2473 fixes the remaining bug reported by Derek M. Jones in
2474 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
2475 * tests/glr-regression.at (Uninitialized location when reporting
2476 ambiguity): Test the above case.
2477 Also, the embedded comments in this test case claim it checks the case
2478 of an empty RHS that has inherited the initial location. However, the
2479 corresponding LHS was already resolved, so yyresolveLocations didn't
2480 actually have reason to modify it. Fix this by forcing
2481 nondeterministic operation at the beginning of the parse.
2482
2483 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
2484
2485 * data/c.m4 (b4_yy_symbol_print_generate):
2486 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
2487 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
2488 of the bugs reported today by Derek M Jones in
2489 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
2490 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
2491 defined to be a type name without parens or brackets.
2492 (Location Type): Similarly for YYLTYPE.
2493 * tests/regression.at (Trivial grammars): Put in a test for this
2494 bug that will be caught by 'make maintainer-check' (though not,
2495 alas, by 'make check' unless your compiler is picky).
2496
2497 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
2498
2499 * NEWS: Version 2.2.
2500 * configure.ac (AC_INIT): Likewise.
2501
2502 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
2503
2504 * data/glr.c (yyreportTree): Make room in yystates for the state
2505 preceding the RHS. This fixes the segmentation fault reported by Derek
2506 M. Jones in
2507 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
2508 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
2509 to the user. Reported for yyreportTree by Derek M. Jones later in the
2510 same thread.
2511 * THANKS: Add Derek M. Jones.
2512 Update my email address.
2513 Fix typo in Steve Murphy's name.
2514
2515 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
2516
2517 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
2518 checking against YYLAST that caused the parser to miss a potential
2519 alternative in its diagnostic.
2520 Problem reported by Maria Jose Moron Fernandez in
2521 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
2522 * data/lalr1.cc (yysyntax_error_): Likewise.
2523 * data/yacc.c (yysyntax_error): Likewise.
2524 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
2525 tokens, in case we run into an older C compiler.
2526 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
2527 Use them to check for the off-by-one error fixed above.
2528
2529 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
2530 YYSIZE_T, not size_t.
2531 * tests/regression.at (Trivial grammars): New test, to catch
2532 the error fixed by the above patch.
2533
2534 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2535
2536 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
2537 scheme.
2538 Reported by Steve Murphy.
2539
2540 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2541
2542 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
2543 * data/glr.cc: b4_location_flag is now b4_locations_flag.
2544
2545 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2546
2547 Implement --trace=m4.
2548 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
2549 * src/output.c (output_skeleton): When set, pass -dV to m4.
2550
2551 Factor the handling of flags in m4.
2552 * src/output.c (prepare): Rename the muscle names debug, defines,
2553 error_verbose to debug_flag, defines_flag, error_verbose_flag.
2554 * data/c.m4: Adjust.
2555 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
2556 Use b4_define_flag_if to define other b4_FLAG_if macros.
2557 (b4_location_if): As a consequence, rename as...
2558 (b4_locations_if): this, for consistency.
2559 Adjust all the skeletons.
2560
2561 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2562
2563 * etc/bench.pm: Shorten bench names.
2564
2565 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2566
2567 * src/output.h, src/output.c (error_verbose): Move to...
2568 * src/getargs.h, src/getargs.c: here.
2569 Sort the flags.
2570 Adjust dependencies.
2571
2572 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
2573
2574 * data/c.m4 (b4_copyright): Put the special exception for Bison
2575 skeletons here, so we don't have to put it in each skeleton. All
2576 uses changed. Suggested by Akim Demaille. Also, wrap the
2577 copyright notice, in case it is longer than 80 columns. Replace
2578 comma by newline after title.
2579
2580 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
2581
2582 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
2583 incompatibility, not a bug. Mention that it wasn't fixed as of
2584 flex 2.5.33.
2585
2586 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
2587
2588 * examples/extexi: Enforce the precedence of concatenation over
2589 >>.
2590 Reported by Tommy Nordgren.
2591
2592 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
2593
2594 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
2595 with the member "token".
2596 Reported by Martin Nylin.
2597
2598 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
2599
2600 * data/glr.c: Switch to Bison 2.2 special-exception language in
2601 the copyright notice. Use more-regular format for titles and
2602 copyright notices.
2603 * data/glr.cc: Likewise.
2604 * data/location.cc: Likewise.
2605 * data/yacc.cc: Likewise.
2606 * doc/bison.texinfo (Conditions): Document this.
2607 * NEWS: likewise. Upgrade version to 2.2.
2608
2609 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
2610
2611 * data/glr.cc: Remove dead code.
2612
2613 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
2614
2615 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
2616 that variable and the line breaks the bootstrap. Problem reported
2617 by Juan M. Guerrero.
2618
2619 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
2620
2621 * doc/bison.texinfo (Multiple start-symbols): New.
2622
2623 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
2624
2625 * etc/README, etc/bench.pl: New.
2626
2627 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
2628
2629 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
2630 rule.
2631 Reported by Mickael Labau.
2632 * tests/input.at (Torturing the Scanner): Test it.
2633
2634 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
2635
2636 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
2637 Problem reported by Bob Rossi.
2638
2639 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
2640
2641 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
2642 and didn't really work.
2643 For the index, use @ifnotinfo, not @iftex.
2644 Minor cleanups of spacing and terminology.
2645
2646 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
2647
2648 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
2649 of AT_NAME_PREFIX when %name-prefix is not used.
2650
2651 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
2652
2653 Apply --prefix to C++ skeletons too: they change the namespace.
2654 The test suite already exercize these cases.
2655 * data/c++.m4 (b4_namespace): New.
2656 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
2657 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
2658 * data/yacc.c, data/glr.c: Remove a useless `[]'.
2659 * doc/bison.texinfo: Document it.
2660 (Option Cross Key): Use @multitable in all formats. It looks
2661 nicer, even in TeX outputs.
2662 (Rules): Use the same code whatever the output type is.
2663 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
2664 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
2665 * tests/calc.at: Use it, instead of hard coding `yy'.
2666
2667 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2668
2669 * TODO: Remove dead items.
2670
2671 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2672
2673 * doc/FAQ: Remove, merged into...
2674 * doc/bison.texinfo (FAQ): this.
2675 * doc/Makefile.am (EXTRA_DIST): Adjust.
2676
2677 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2678
2679 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
2680 even if empty.
2681 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
2682 * doc/bison.texinfo (Calc++ Scanner): Use it.
2683
2684 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
2685
2686 Fix two nits reported by twlevo, plus one more that I discovered.
2687
2688 * src/assoc.h (assoc_to_string): Give a name to the arg, as
2689 this is the usual Bison style.
2690 * src/location.h (location_print): Likewise.
2691
2692 * src/reader.h (token_name): Likewise.
2693
2694 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
2695
2696 Fix some nits reported by twlevo.
2697 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
2698 and "POSIX". Use more-modern syntax for URLs. Mention C++
2699 and ask for Java. Don't hardwire OS version numbers. Add
2700 copyright notice.
2701 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
2702 * src/conflicts.c (solved_conflicts_obstack): Now static.
2703
2704 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2705
2706 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
2707 page. Say "you can use it" not "you may use it" as on the web page;
2708 we're describing capabilities not granting permission.
2709
2710 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
2711
2712 * data/glr.c (yyresolveLocations): Rename local variables to avoid
2713 shadowing warnings. Use usual patter for iterating through RHS.
2714 * tests/glr-regression.at
2715 (Uninitialized location when reporting ambiguity):
2716 Modify yylex so that it uses its argument, rather than trying
2717 to rely on ARGSUSED (which doesn't work for gcc with warnings).
2718 const char -> char const.
2719
2720 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
2721 Don't use tabs inside commands; it messes up 'ps'.
2722 Problem reported by twlevo.
2723
2724 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
2725
2726 * tests/glr-regression.at (Uninitialized location when reporting
2727 ambiguity): New test case.
2728 * data/glr.c (yyresolveLocations): New function, which uses
2729 YYLLOC_DEFAULT.
2730 (yyresolveValue): Invoke yyresolveLocations before reporting an
2731 ambiguity.
2732 * doc/bison.texinfo (Default Action for Locations): Note
2733 YYLLOC_DEFAULT's usage for ambiguity locations.
2734 (GLR Semantic Actions): Cross-reference those notes.
2735
2736 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
2737
2738 * tests/glr-regression.at (Leaked semantic values when reporting
2739 ambiguity): Remove unnecessary union and type declarations.
2740 (Leaked lookahead after nondeterministic parse syntax error): New test
2741 case.
2742 * data/glr.c (yyparse): Check for zero stacks remaining before
2743 attempting to shift the lookahead so that you don't lose it.
2744
2745 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2746
2747 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
2748 * tests/glr-regression.at (Leaked semantic values when reporting
2749 ambiguity): New test case.
2750 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
2751 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
2752 now unnecessary yystackp parameter.
2753 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
2754 destructors can be called.
2755
2756 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
2757 in existing testcases.
2758
2759 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2760
2761 Don't leak semantic values for parent RHS when a user action cuts the
2762 parser, and clean up related code a bit.
2763 * tests/glr-regression.at (Leaked merged semantic value if user action
2764 cuts parse): Rename to...
2765 (Leaked semantic values if user action cuts parse): ... this. Add check
2766 for leaked parent RHS values.
2767 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
2768 between an unresolved state (non-empty chain of semantic options) and
2769 an incomplete one (signaled by an empty chain).
2770 (yyresolveStates): Document the interface. Move all manipulation of a
2771 successfully or unsuccessfully resolved yyGLRState to...
2772 (yyresolveValue): ... here so that yyresolveValue always leaves a
2773 yyGLRState with consistent data and thus is easier to understand.
2774 Remove the yyvalp and yylocp parameters since they are always just
2775 taken from the yys parameter. When reporting a discarded merged value
2776 in debugging output, note that it is incompletely merged. Document the
2777 interface.
2778 (yyresolveAction): If resolving any of the RHS states fails, destroy
2779 them all rather than leaking them. Thus, as long as user actions are
2780 written to clean up the RHS correctly, yyresolveAction always cleans up
2781 the RHS of a semantic option. Document the interface.
2782
2783 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
2784
2785 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
2786 led to a segmentation fault in GNU Pascal. Problem reported
2787 by Waldek Hebisch.
2788
2789 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
2790
2791 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
2792 mid-rule action inside a nonterminal symbol in order to declare a
2793 destructor for its semantic value.
2794
2795 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
2796
2797 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
2798 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
2799 __cplusplus && ! defined _STDLIB_H && !
2800 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
2801 defined free))]: Include <stdlib.h> rather than rolling our own
2802 declarations of malloc and free, to avoid problems with
2803 incompatible declarations (using 'throw') C++'s stdlib.h. This
2804 should fix Debian bug 340012
2805 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
2806 reported by Guillaume Melquiond.
2807
2808 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2809
2810 * NEWS: Clarify symbols versus types in unused-value warnings.
2811
2812 * configure.ac (AC_INIT): Bump version number.
2813
2814 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2815
2816 * NEWS: Version 2.1a.
2817 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
2818 since C99 requires this.
2819
2820 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
2821
2822 * m4/c-working.m4: New file.
2823 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
2824
2825 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
2826
2827 * Makefile.maint: Merge from coreutils.
2828
2829 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
2830
2831 More portability fixes for problems summarized by Nelson H. F. Beebe.
2832
2833 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
2834 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
2835 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
2836 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
2837 messes up because C++ code is compiled in 32-bit mode but linked
2838 in 64-bit mode.
2839
2840 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
2841
2842 More portability fixes for problems summarized by Nelson H. F. Beebe.
2843
2844 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
2845 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
2846
2847 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
2848 nodist_PROGRAMS, since we don't need to actually compile the
2849 example if we're just doing a plain 'make'. This avoids bothering
2850 the installer unnecessarily about problems due to weird C++
2851 compilers.
2852
2853 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
2854
2855 More portability fixes for problems summarized by Nelson H. F. Beebe.
2856
2857 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
2858 than #include "...", and compile with -I'.'. The old method was
2859 not portable, according to Posix and the C standard, and it does
2860 not work with Sun C 5.7, where previous #line directives affect
2861 the working directory used in later #include "..." directives.
2862
2863 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2864
2865 Various DJGGP specific issues in /djgpp
2866
2867 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
2868
2869 More portability fixes for problems summarized by Nelson H. F. Beebe.
2870
2871 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
2872 '#include <map>' works and that you can apply ++ to iterators.
2873
2874 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
2875
2876 Work around portability problems summarized by Nelson H. F. Beebe in
2877 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
2878
2879 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
2880 that '#include <string>' works.
2881
2882 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
2883 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
2884 "warning: sorry: semantics of inline function static data `const
2885 unsigned char translate_table[262]' are wrong (you'll wind up with
2886 multiple copies)".
2887
2888 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
2889 or, xor to not_, and_, or_, and xor_, respectively. This works
2890 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
2891 random system header somewhere that includes the equivalent of
2892 <iso646.h>.
2893
2894 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
2895 -E" works; it apparently doesn't work with PathScale EKO Compiler
2896 Suite Version 2.0.
2897
2898 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
2899
2900 During deterministic GLR operation, user actions should be able to
2901 influence the parse by changing yychar. To make this easier to fix and
2902 to make glr.c easier to evolve in general, don't maintain yytoken in
2903 parallel with yychar; just compute yytoken when needed.
2904 * tests/glr-regression.at (Incorrect lookahead during deterministic
2905 GLR): Check that setting yychar in a user action has the intended
2906 effect.
2907 * data/glr.c (yyGLRStack): Remove yytokenp member.
2908 (yyclearin): Don't set *yytokenp.
2909 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
2910 yychar rather than *yytokenp to determine the current lookahead.
2911 Compute yytoken locally when needed.
2912 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
2913 point to.
2914
2915 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
2916 after `--report' documentation.
2917
2918 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
2919
2920 * src/parse-gram.y (grammar_declaration): Location of printer
2921 symbol is @1, not list->location. Bug reported by twlevo.
2922 * tests/input.at (Incompatible Aliases): Adjust to above change.
2923
2924 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
2925
2926 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
2927 all the test at once. This makes the output easier to read in the
2928 normal case.
2929
2930 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
2931 got from <http://bro-ids.org/download.html>. The bug is that
2932 when two actions appeared in succession, the second one was
2933 scanned before the first one was added to the grammar rule
2934 as a midrule action. Bison then output the incorrect warning
2935 "parse.y:905.17-906.36: warning: unused value: $3".
2936 * src/parse-gram.y (BRACED_CODE, action): These are no longer
2937 associated with a value.
2938 (rhs): Don't invoke grammar_current_rule_action_append.
2939 (action): Invoke it here instead.
2940 * src/reader.c (grammar_midrule_action): Now extern.
2941 (grammar_current_rule_action_append): Don't invoke
2942 grammar_midrule_action; that is now the scanner's job.
2943 * src/reader.h (last_string, last_braced_code_loc):
2944 (grammar_midrule_action): New decls.
2945 * src/scan-gram.l (last_string): Now extern, sigh.
2946 (last_braced_code_loc): New extern variable.
2947 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
2948 rule already has an action.
2949 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
2950 * tests/input.at (AT_CHECK_UNUSED_VALUES):
2951 Add some tests to check that the above changes fixed the bug.
2952
2953 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
2954
2955 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
2956 All used changed. Check whether the symbol has a destructor,
2957 not whether it is typed.
2958 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
2959 that the values are still reported as unused. All line numbers
2960 adjusted.
2961
2962 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
2963
2964 Work around a bug in bro 0.8, which underparenthesizes its
2965 definition of YYLLOC_DEFAULT.
2966 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
2967 their arguments.
2968 * data/lalr1.cc: Likewise.
2969 * data/yacc.cc: Likewise.
2970
2971 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
2972
2973 Work around a bug in Pike 7.0, and give the Pike folks a
2974 better way to override the usual int widths.
2975 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
2976 user can override the types.
2977 (short): #undef, to work around a bug in Pike 7.0.
2978 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
2979 (union yyalloc.yyss): Use yytype_int16 rather than short.
2980 All uses changed.
2981 (yysigned_char): Remove.
2982 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
2983 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
2984 * tests/regression.at (Web2c Actions): Adjust to above changes.
2985
2986 * src/reader.c (check_and_convert_grammar): New function.
2987 (reader): Close the input file even if something went wrong during
2988 parsing. Minor file descriptor leak reported by twlevo.
2989
2990 * src/assoc.c (assoc_to_string): Use a default: abort (); case
2991 to pacify gcc -Wswitch-default.
2992 * src/scan-gram.l (adjust_location): Use a default: break; case
2993 to pacify gcc -Wswitch-default.
2994 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
2995 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
2996 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
2997 Move these decls to scan-skel.l, since they don't need to be
2998 visible elsewhere.
2999 * src/scan-skel.l: Accept the above decls.
3000 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
3001 is used.
3002
3003 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
3004
3005 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
3006 since we don't want to insist on a version number at the start
3007 of the changelog every time.
3008 * Makefile.maint: Sync from coreutils a bit better.
3009 (sc_trailing_blank): Renamed from sc_trailing_space.
3010 All uses changed.
3011 (sc_no_if_have_config_h, sc_require_config_h):
3012 (sc_prohibit_assert_without_use): New rules.
3013 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
3014 (sc_dd_max_sym_length): Fix leading spaces in rule.
3015 (sc_system_h_headers): Prefix with @.
3016 (sc_useless_cpp_parens, m4-check): Output line numbers.
3017 (changelog-check): Allow version only in head.
3018 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
3019 satisfy new Makefile.maint rule.
3020 * data/glr.c: Likewise.
3021 * data/glr.cc: Likewise.
3022 * data/lalr1.cc: Likewise.
3023 * data/yacc.c: Likewise.
3024 * lib/ebitsetv.c: Likewise.
3025 * lib/lbitset.c: Likewise.
3026 * lib/subpipe.c: Likewise.
3027 * lib/timevar.c: Likewise.
3028 * src/system.h: Likewise.
3029 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
3030 * djgpp/Makefile.maint: Add copyright notice.
3031 * djgpp/README.in: Likewise.
3032 * djgpp/config.bat: Likewise.
3033 * djgpp/config.site: Likewise.
3034 * djgpp/config_h.sed: Likewise.
3035 * djgpp/djunpack.bat: Likewise.
3036 * djgpp/config.sed: Fix copyright notice to match standard format.
3037 * djgpp/subpipe.h: Likewise.
3038 * lib/bitsetv-print.c: Likewise.
3039 * lib/bitsetv.c: Likewise.
3040 * lib/subpipe.h: Likewise.
3041 * lib/timevar.c: Likewise.
3042 * lib/timevar.h: Likewise.
3043 * djgpp/subpipe.c: Use standard recipe for config.h.
3044 * lib/abitset.c: Likewise.
3045 * lib/bitset.c: Likewise.
3046 * lib/bitset_stats.c: Likewise.
3047 * lib/bitsetv-print.c: Likewise.
3048 * lib/bitsetv.c: Likewise.
3049 * lib/ebitsetv.c: Likewise.
3050 * lib/get-errno.c: Likewise.
3051 * lib/lbitset.c: Likewise.
3052 * lib/subpipe.c: Likewise.
3053 * lib/timevar.c: Likewise.
3054 * lib/vbitset.c: Likewise.
3055 * tests/local.at: Likewise.
3056 * src/scan-gram.l: Don't include verify.h, since system.h does
3057 that for us.
3058 * .x-sc_require_config_h: New file.
3059 * .x-sc_unmarked_diagnostics: New file.
3060
3061 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
3062
3063 Be a bit more systematic about using 'abort'.
3064 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
3065 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
3066 Put 'default: abort ();' before some other case, to satisfy older
3067 pedantic compilers.
3068 * lib/bitset_stats.c (bitset_stats_init): Likewise.
3069 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
3070 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
3071 * src/conflicts.c (resolve_sr_conflict): Likewise.
3072 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
3073 (get_decision_str, get_orientation_str, get_node_alignment_str):
3074 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
3075 (get_linestyle_str, get_arrowstyle_str): Likewise.
3076 * src/conflicts.c (resolve_sr_conflict):
3077 Use a default case rather than one for the one remaining enum
3078 value, to catch invalid enum values as well.
3079 * src/lalr.c (set_goto_map, map_goto):
3080 Prefer "assert (FOO);" to "if (!FOO) abort ();".
3081 * src/nullable.c (nullable_compute, token_definitions_output):
3082 Likewise.
3083 * src/reader.c (packgram, reader): Likewise.
3084 * src/state.c (transitions_to, state_new, state_reduction_find):
3085 Likewise.
3086 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
3087 (symbol_pack): Likewise.
3088 * src/tables.c (conflict_row, pack_vector): Likewise.
3089 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
3090 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
3091 * src/system.h: Don't include <assert.h>.
3092 (assert): New macro.
3093
3094 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
3095 (Destructor Decl, Parser Function, Pure Calling):
3096 Describe rules for braces inside C code more carefully.
3097
3098 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
3099
3100 Fix some porting glitches found by Nelson H. F. Beebe.
3101 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
3102 compilers that don't understand that abort () does not return.
3103 * src/state.c (transitions_to): Likewise.
3104 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
3105 that '#include <cstdlib>' works.
3106 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
3107 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
3108 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
3109 for the benefit of some pre-C99 compilers.
3110
3111 * bootstrap: Undo changes to gnulib files that autoreconf made.
3112
3113 Minor fixups to get 'make maintainer-check' to work.
3114 * configure.ac: Don't use -Wnested-externs, as it's incompatible
3115 with the new verify.h implementation.
3116 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
3117 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
3118 * data/yacc.c (YYUSE): Likewise.
3119 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
3120 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
3121 * src/parse-gram.y (declaration): Don't pass a string constant
3122 to a function that expects char *, since GCC might complain
3123 about the constant value.
3124 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
3125 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
3126 before #defining them.
3127 * tests/glr-regression.at
3128 (Incorrectly initialized location for empty right-hand side in GLR):
3129 In yyerror, use the msg arg.
3130 (Corrupted semantic options if user action cuts parse):
3131 (Incorrect lookahead during deterministic GLR):
3132 (Incorrect lookahead during nondeterministic GLR):
3133 Don't name a local var 'index'; it shadows string.h's 'index'.
3134
3135 2006-01-19 Akim Demaille <akim@epita.fr>
3136
3137 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
3138 location, not just parts of it.
3139
3140 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
3141
3142 * NEWS: Document the fact that multiple %unions are now allowed.
3143 * doc/bison.texinfo (Union Decl): Likewise.
3144 * TODO: This feature is now implemented, so remove it from
3145 the wishlist.
3146
3147 * Makefile.maint: Merge with coreutils Makefile.maint.
3148 (CVS_LIST): Use build-aux version if available.
3149 (VERSION_REGEXP): New macro.
3150 (syntax-check-rules): Add sc_no_if_have_config_h,
3151 sc_prohibit_assert_without_use, sc_require_config_h,
3152 sc_useless_cpp_parens.
3153 (sc_obsolete_symbols): Check for O_NDELAY.
3154 (sc_dd_max_sym_length): Track coreutils.
3155 (sc_unmarked_diagnostics): Look in all files, not just *.c.
3156 (sc_useless_cpp_parens): New rule.
3157 (news-date-check): Look for version or today's date.
3158 (changelog-check): Don't require version number near head.
3159 (copyright-check): Use current year instead of hardwiring 2005.
3160 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
3161 (announcement): Add --gpg-key-ID.
3162
3163 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
3164 with "file system".
3165
3166 Avoid undefined behavior that addressed just before the start of an
3167 array. Problem reported by twlevo.
3168 * src/reader.c (packgram): Prepend a new sentinel before ritem.
3169 * src/lalr.c (build_relations): Rely on new sentinel.
3170 * src/gram.c (gram_free): Adjust to new sentinel.
3171
3172 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
3173
3174 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
3175 yylookaheadNeeds. All uses updated.
3176 (yysplitStack): Rename local yynewLookaheadStatuses to
3177 yynewLookaheadNeeds.
3178 * data/glr-regression.at (Incorrect lookahead during nondeterministic
3179 GLR): In comments, change `lookahead status' to `lookahead need'.
3180
3181 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3182
3183 * data/glr.c (yysplitStack): A little stylistic rewrite.
3184
3185 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3186
3187 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
3188
3189 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
3190
3191 * doc/bison.texinfo: Fix some typos.
3192 (GLR Semantic Actions): New subsection discussing special
3193 considerations because GLR semantic actions might be deferred.
3194 (Actions): Mention look-ahead usage of yylval.
3195 (Actions and Locations): Mention look-ahead usage of yylloc.
3196 (Special Features for Use in Actions): Add YYEOF entry and mention it
3197 in the yychar entry.
3198 In the yychar entry, remove mention of the local yychar case (pure
3199 parser) since this is irrelevant information when writing semantic
3200 actions and since it's already discussed in `Bison Symbols' where
3201 yychar is otherwise described as an external variable.
3202 In the yychar entry, don't call it the `current' look-ahead since it
3203 isn't when semantic actions are deferred.
3204 In the yychar and yyclearin entries, add note about deferred semantic
3205 actions.
3206 Add yylloc and yylval entries discussing look-ahead usage.
3207 (Look-Ahead Tokens): When discussing yychar, don't call it the
3208 `current' look-ahead, and do mention yylval and yylloc.
3209 (Error Recovery): Cross-reference `Action Features' when mentioning
3210 yyclearin.
3211 (Bison Symbols): In the yychar entry, don't call it the `current'
3212 look-ahead.
3213 In the yylloc and yylval entries, mention look-ahead usage.
3214
3215 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3216
3217 * tests/glr-regression.at: Update copyright year to 2006.
3218
3219 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3220
3221 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
3222 use during nondeterministic operation to track which stacks have
3223 actually needed the current lookahead.
3224 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
3225 Allocate, deallocate, resize, and otherwise shuffle space for
3226 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
3227 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
3228 appropriately during nondeterministic operation.
3229 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
3230 members to store the current lookahead to be used by the deferred
3231 user action.
3232 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
3233 from which the RHS is taken. Set the lookahead members of the new
3234 yySemanticOption according to the lookahead status for stack yyk.
3235 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
3236 yyaddDeferredAction.
3237 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
3238 members of yySemanticOption before invoking yyuserAction, and then set
3239 them back to their current values afterward.
3240 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
3241 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
3242 * tests/glr-regression.at: Remove `.' from the ends of recent test case
3243 titles for consistency.
3244 (Leaked merged semantic value if user action cuts parse): In order to
3245 suppress lint warnings, use arguments in merge function, and assign
3246 char value < 128 in main.
3247 (Incorrect lookahead during deterministic GLR): New test case.
3248 (Incorrect lookahead during nondeterministic GLR): New test case.
3249
3250 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3251
3252 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
3253 !yyvaluep as signal that no semantic value is available to print.
3254 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
3255 to print a semantic value.
3256
3257 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3258
3259 * tests/glr-regression.at: For consistency with my newer test cases,
3260 don't thank myself.
3261
3262 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
3263
3264 * data/glr.c (yyresolveValue): When merging semantic options, if at
3265 least one user action succeeds but a later one cuts the parse, then
3266 destroy the semantic value before returning rather than leaking it.
3267 (yyresolveStates): If a user action cuts the parse and thus
3268 yyresolveValue fails, ignore the (unset) semantic value rather than
3269 corrupting the yyGLRState, and empty the semantic options list since
3270 the user actions should have called all necessary destructors.
3271 Simplify code with YYCHK.
3272 * tests/glr-regression.at (Corrupted semantic options if user action
3273 cuts parse): New test case.
3274 (Undesirable destructors if user action cuts parse): New test case.
3275 Before applying any of this patch, this test case never actually failed
3276 for me... but only because the corrupted semantic options usually
3277 masked this bug.
3278 (Leaked merged semantic value if user action cuts parse): New test
3279 case.
3280
3281 2006-01-05 Akim Demaille <akim@epita.fr>
3282
3283 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
3284
3285 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
3286
3287 * data/c.m4 (b4_c_modern): New macro, with a new provision for
3288 _MSC_VER. Problem reported by Cenzato Marco.
3289 (b4_c_function_def): Use it.
3290 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
3291 b4_c_modern.
3292 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
3293 than rolling our own.
3294
3295 2006-01-04 Akim Demaille <akim@epita.fr>
3296
3297 Also warn about non-used mid-rule values.
3298 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
3299 member.
3300 (symbol_list_new): Adjust.
3301 * src/reader.c (symbol_typed_p): New.
3302 (grammar_rule_check): Use it.
3303 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
3304 Check its rule.
3305 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
3306 Use it.
3307 * tests/actions.at (Exotic Dollars): Adjust.
3308
3309 2006-01-04 Akim Demaille <akim@epita.fr>
3310
3311 * src/reader.c (grammar_midrule_action): If $$ is set in a
3312 mid-rule, move the `used' bit to its lhs.
3313 * tests/input.at (Unused values): New.
3314 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
3315
3316 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
3317
3318 * doc/bison.texinfo (Bison Options): Say more accurately what
3319 --yacc does.
3320 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
3321 about declarations in the grammar when in Yacc mode, as POSIX does
3322 not require a diagnostic when the grammar uses extensions.
3323
3324 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
3325
3326 Warn about dubious constructions like "%token T T".
3327 Reported by twlevo.
3328 * src/symtab.h (struct symbol.declared): New member.
3329 * src/symtab.c (symbol_new): Initialize it to false.
3330 (symbol_class_set): New arg DECLARING, specifying whether
3331 this is a declaration that we want to warn about, if there
3332 is more than one of them. All uses changed.
3333
3334 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
3335 Allow multiple %union directives, whose contents concatenate.
3336 * src/parse-gram.y (grammar_declaration): Likewise.
3337 Use muscle_code_grow, so that we don't need stype_line any more.
3338 All uses changed.
3339
3340 * src/muscle_tab.c (muscle_grow): Fix comment.
3341
3342 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
3343 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
3344 Update copyright year to 2006.
3345
3346 2006-01-03 Akim Demaille <akim@epita.fr>
3347
3348 Have glr.cc pass (some of) the calc.at tests.
3349 * data/glr.cc (b4_parse_param_orig): New.
3350 (b4_parse_param): Improve its definition, and bound it more
3351 clearly in the skeleton.
3352 (b4_epilogue): Append, instead of prepending, in order to keep
3353 #line consistency.
3354 Simplify the generation of auxiliary functions: locations and
3355 purity are mandated.
3356 (b4_global_tokens_and_yystype): Honor it.
3357 * data/location.cc (c++.m4): Don't include it.
3358 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
3359 and AT_SKEL_CC_IF.
3360 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
3361 AT_LALR1_CC_IF.
3362 Be sure to initialize the first position's filename.
3363 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
3364 mandated anyway.
3365 (AT_CHECK_CALC_GLR_CC): New.
3366 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
3367
3368 2006-01-02 Akim Demaille <akim@epita.fr>
3369
3370 * src/output.c (output_skeleton): Don't hard wire the inclusion of
3371 c.m4.
3372 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3373 * data/glr.cc: Do not include stack.hh.
3374
3375 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3376
3377 * data/glr.c: Reformat whitespace with tabs.
3378 (b4_lpure_formals): Remove this unused m4 macro.
3379 * tests/cxx-type.at: Reformat whitespace with tabs.
3380 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
3381 since it's a member. Rename type to isNterm for clarity.
3382
3383 2005-12-29 Akim <akim@sulaco.local>
3384
3385 Let glr.cc catch up with symbol_value_print.
3386 * data/glr.cc (b4_yysymprint_generate): Replace by...
3387 (b4_yy_symbol_print_generate): this.
3388 (yy_symbol_print, yy_symbol_value_print): Declare them.
3389
3390 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
3391
3392 * src/location.h (boundary): Note that a line or column equal
3393 to INT_MAX indicates an overflow.
3394 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
3395 (rule_length_overflow, increment_rule_length, add_column_width):
3396 New functions.
3397 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
3398 (<SC_BRACED_CODE>"}"):
3399 Use increment_rule_length rather than incrementing it by hand.
3400 (adjust_location, handle_syncline): Diagnose overflow.
3401 (handle_action_dollar, handle_action_at):
3402 Fix bug with monstrosities like $-2147483648.
3403 Remove now-unnecessary checks.
3404 (scan_integer): Verify assumptions and remove now-unnecessary checks.
3405 (convert_ucn_to_byte): Verify assumptions.
3406 (handle_syncline): New arg LOC. All callers changed.
3407 Don't store through a value derived from char const * pointer.
3408
3409 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
3410 GCC warnings.
3411
3412 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
3413
3414 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
3415 Remove unnecessary forward static decls.
3416
3417 2005-12-27 Akim Demaille <akim@epita.fr>
3418
3419 * src/reader.c (grammar_current_rule_check): Also check that $$
3420 is used.
3421 Take the rule to check as argument, hence rename as...
3422 (grammar_rule_check): this.
3423 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
3424 Rename as...
3425 (grammar_rule_begin, grammar_rule_end): these, for consistency.
3426 (grammar_midrule_action, grammar_symbol_append): Now static.
3427 * tests/torture.at (input): Don't rely on the default action
3428 being always performed.
3429 * tests/calc.at: "Set" $$ even when the action is "cut" with
3430 YYERROR or other.
3431 * tests/actions.at (Exotic Dollars): Instead of using unused
3432 values, check that the warning is issued.
3433
3434 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
3435
3436 * NEWS: Improve wording for unused-value warnings.
3437
3438 2005-12-22 Akim Demaille <akim@epita.fr>
3439
3440 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
3441 (b4_yysymprint_generate): Rename as...
3442 (b4_yy_symbol_print_generate): this.
3443 Generate yy_symbol_print instead of yysymprint.
3444 Generate also yy_symbol_value_print, and use it.
3445
3446 2005-12-22 Akim Demaille <akim@epita.fr>
3447
3448 * NEWS: Warn about unused values.
3449 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
3450 a `used' member.
3451 (symbol_list_n_get, symbol_list_n_used_set): New.
3452 (symbol_list_n_type_name_get): Use symbol_list_n_get.
3453 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
3454 * src/reader.c (grammar_current_rule_check): Check that values are
3455 used.
3456 * src/symtab.c (symbol_print): Accept 0.
3457 * tests/existing.at: Remove the type information.
3458 Empty the actions.
3459 Remove useless actions (beware of mid-rule actions: perl -000
3460 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
3461 * tests/actions.at (Exotic Dollars): Use unused values.
3462 * tests/calc.at: Likewise.
3463 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3464 Likewise.
3465
3466 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
3467 rule_useful_p.
3468
3469 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
3470
3471 Undo 2005-12-01 tentative license wording change. The wording is
3472 still being reviewed by the lawyers, and we don't want to wait for
3473 them before publishing a test release. For now, revert to the
3474 previous wording.
3475 * NEWS: Undo 2005-12-01 change.
3476 * data/glr.c: Revert to previous license wording.
3477 * data/glr.cc: Likewise.
3478 * data/lalr1.cc: Likewise.
3479 * data/location.cc: Likewise.
3480 * data/yacc.c: Likewise.
3481
3482 * NEWS: Reword %destructor vs YYABORT etc.
3483 * data/glr.c: Use American spacing, for consistency.
3484 * data/glr.cc: Likewise.
3485 * data/lalr1.cc: Likewise.
3486 * data/yacc.c: Likewise.
3487 * data/yacc.c: Reformat comments slightly.
3488 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
3489 for consistency. Fix some spelling errors and reword recently-included
3490 text slightly.
3491 * tests/cxx-type.at: Cast results of malloc, for C++.
3492
3493 2005-12-21 Joel E. Denny <address@hidden>
3494
3495 * tests/cxx-type.at: Construct a tree, count the parents of shared
3496 nodes, and free each node once and only once. Previously, the memory
3497 for semantic values was leaked instead.
3498
3499 2005-12-21 Joel E. Denny <address@hidden>
3500
3501 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
3502 (yylval, yylloc): If pure, #define to yystackp->yyval and
3503 yystackp->yyloc similar to yychar and yynerrs.
3504 (yyparse): If pure, remove local yylval and yylloc. Add local
3505 yystackp to accommodate pure definitions of yylval and yylloc.
3506 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
3507 yylvalp and yyllocp to &yylval and &yylloc.
3508 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
3509 namespace. Previously, nerrs and char were missing, but lval and lloc
3510 weren't necessary.
3511 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
3512 yylvalp and yyllocp parameters since, if pure, these are now always
3513 accessible through yystackp. If not pure, they are still accessible
3514 globally.
3515 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
3516 `if (YYID (N))' to pacify lint.
3517
3518 2005-12-21 Akim Demaille <akim@epita.fr>
3519
3520 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
3521 destroy the RHS symbols of a rule.
3522 * data/yacc.c (yylen): Initialize to 0.
3523 Keep its value to the number of items to possibly shift.
3524 In particular, a regular successful parse that ends on YYFINAL by
3525 a (internal) YYACCEPT must not have yylen != 0.
3526 (yyerrorlab, yyreturn): Pop the RHS.
3527 Reorder a bit to emphasize the `shifting' bits of code.
3528 (YYPOPSTACK): Now accept a number of items to pop.
3529 * data/lalr1.cc: Likewise.
3530 * data/glr.c: Formatting changes.
3531 Use goto instead of fall through.
3532 * doc/bison.texinfo (Destructor Decl): Complete.
3533
3534 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3535
3536 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3537 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
3538 * djgpp/config.bat: Replace every occurence of the file name
3539 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3540 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3541 * djgpp/config.sed: Replace every occurence of the file name
3542 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3543 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3544 * djgpp/djunpack.bat: DJGPP specific file.
3545 * djgpp/fnchange.lst: DJGPP specific file.
3546 * djgpp/README.in: Add new information about how to unpack the bison
3547 source on MSDOS and other systems which have 8.3 file name restrictions
3548 using djunpack.bat and fnchange.lst.
3549
3550 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
3551
3552 * bootstrap (build_cvs_prefix): Remove; unused.
3553 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
3554 when getting gnulib.
3555
3556 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
3557
3558 * data/glr.c: Reorder typedef declarations for structs to match order
3559 of struct declarations.
3560 Rename yystack everywhere to yystackp except in yyparse where it's not
3561 a pointer.
3562 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
3563 consistency.
3564 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
3565 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
3566 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
3567 lint.
3568
3569 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
3570
3571 * tests/sets.at (Accept): Fix typos in regular expression used to
3572 sed out the final state number.
3573
3574 Work around portability problem on Solaris 10: flex-generated
3575 files include <stdio.h> before <config.h>, which messes up
3576 because the latter defines __EXTENSIONS__. Address the problem
3577 by creating two new little files that include <config.h> first,
3578 then include the flex-generated files. Rewrite everyone else
3579 to include <config.h> first, as well.
3580 * lib/timevar.c: Always include "config.h".
3581 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
3582 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
3583 (EXTRA_bison_SOURCES): New macro.
3584 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
3585 * src/system.h: Don't include config.h.
3586 * src/LR0.c: Include <config.h> first.
3587 * src/assoc.c: Likewise.
3588 * src/closure.c: Likewise.
3589 * src/complain.c: Likewise.
3590 * src/conflicts.c: Likewise.
3591 * src/derives.c: Likewise.
3592 * src/files.c: Likewise.
3593 * src/getargs.c: Likewise.
3594 * src/gram.c: Likewise.
3595 * src/lalr.c: Likewise.
3596 * src/location.c: Likewise.
3597 * src/main.c: Likewise.
3598 * src/muscle_tab.c: Likewise.
3599 * src/nullable.c: Likewise.
3600 * src/output.c: Likewise.
3601 * src/parse-gram.y: Likewise.
3602 * src/print.c: Likewise.
3603 * src/print_graph.c: Likewise.
3604 * src/reader.c: Likewise.
3605 * src/reduce.c: Likewise.
3606 * src/relation.c: Likewise.
3607 * src/state.c: Likewise.
3608 * src/symlist.c: Likewise.
3609 * src/symtab.c: Likewise.
3610 * src/tables.c: Likewise.
3611 * src/uniqstr.c: Likewise.
3612 * src/vcg.c: Likewise.
3613
3614 * src/parse-gram.y: Fix minor problems uncovered by lint.
3615 (current_lhs, current_lhs_location): Now static.
3616 (current_assoc): Remove unused variable.
3617
3618 Cleanups so that Bison-generated parsers have less lint.
3619 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
3620 Prepend /*ARGSUSED*/, for lint's sake.
3621 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
3622 definition if 'lint' is defined.
3623 (YYID): New macro (or function, if lint).
3624 All uses of /*CONSTCOND*/0 replaced by YYID(0).
3625 * data/yacc.c: Likewise.
3626 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
3627 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
3628 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
3629 is C++ only.
3630 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
3631 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
3632 Use YYID(0) rather than 0, for lint.
3633 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
3634 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
3635
3636 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
3637
3638 * tests/glr-regression.at
3639 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
3640 Close memory leak reported by twlevo.
3641
3642 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
3643
3644 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
3645 all stacks.
3646 (yyparse): Iterate another stack in order to call user destructors.
3647 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3648 New test case.
3649 (Duplicated user destructor for lookahead): This test now is expected
3650 to succeed.
3651
3652 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
3653
3654 * NEWS: Document the following change.
3655 * data/yacc.c: Say "parser skeleton" rather than "file", since
3656 it's no longer just a file.
3657 * data/glr.c: Grant a special exception for C GLR parsers, that
3658 reads like the already-existing exception for C LALR(1) parsers.
3659 * data/glr.cc: Likewise.
3660 * data/lalr1.cc: Likewise.
3661 * data/location.cc: Likewise.
3662 * data/yacc.c: Reword the "written by" statement to clarify that
3663 it was the parser skeleton, not the entire output file.
3664 * data/glr.c: Written by Paul Hilfinger.
3665 * data/glr.cc: Written by Akim Demaille.
3666 * data/lalr1.cc: Likewise.
3667
3668 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
3669
3670 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
3671 Fix typos in previous change that broke 'make check'.
3672 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
3673 supported in C.
3674 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
3675 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
3676 We can revert this once things settle down.
3677
3678 * src/conflicts.c (conflicts_print): Don't print file name twice
3679 when %expect fails because there were no conflicts.
3680 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
3681 change.
3682 * tests/conflicts.at (%expect not enough, %expect too much):
3683 (%expect with reduce conflicts): Adjust to new behavior.
3684
3685 2005-11-18 Akim Demaille <akim@epita.fr>
3686
3687 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
3688 errors.
3689 * NEWS: Document this.
3690 * doc/bison.texinfo (Expect Decl): Likewise.
3691
3692 2005-11-16 Akim Demaille <akim@epita.fr>
3693
3694 Generalize the display of semantic values and locations in traces.
3695 * data/glr.c (yy_reduce_print): Fix indices (again).
3696 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
3697 literal integers.
3698 * data/lalr1.cc (yyreduce_print): Rename as...
3699 (yy_reduce_print): this.
3700 Display values and locations.
3701 * data/yacc.c (yy_reduce_print): Likewise.
3702 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
3703 (yysymprint): Move higher to be visible from yy_reduce_print).
3704 (yyparse): Adjust.
3705 * tests/calc.at: Adjust the expected length of the traces.
3706
3707 2005-11-14 Akim Demaille <akim@epita.fr>
3708
3709 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
3710 from 1 to N, while values and location start at 0.
3711 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
3712
3713 2005-11-14 Akim Demaille <akim@epita.fr>
3714
3715 * data/glr.c (yy_reduce_print): Fix the $ number.
3716
3717 2005-11-14 Akim Demaille <akim@epita.fr>
3718
3719 "Use" parse parameters.
3720 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
3721 * data/glr.c, data/glr.cc: Use them.
3722 * data/glr.c (YYUSE): Have a C++ definition that supports
3723 non-pointer types.
3724
3725 2005-11-14 Akim Demaille <akim@epita.fr>
3726
3727 * data/glr.c (yyexpandGLRStack): Declare only if defined.
3728
3729 2005-11-14 Akim Demaille <akim@epita.fr>
3730
3731 * data/glr.cc: New.
3732 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
3733
3734 2005-11-12 Akim Demaille <akim@epita.fr>
3735
3736 Let position and location be PODs.
3737 * data/location.cc (position::initialize, location::initialize): New.
3738 (position::position, location::location): Define only if
3739 b4_location_constructors is defined.
3740 * data/lalr1.cc (b4_location_constructors): Define it for backward
3741 compatibility.
3742 * doc/bison.texinfo (Initial Action Decl): Use initialize.
3743
3744 2005-11-12 Akim Demaille <akim@epita.fr>
3745
3746 * data/lalr1.cc: Move the body of the ctor and dtor into the
3747 parser file (instead of the header).
3748 Wrap the implementations in a "namespace yy".
3749
3750 2005-11-12 Akim Demaille <akim@epita.fr>
3751
3752 Have glr.c include its header file when created.
3753 * data/glr.c (b4_shared_declarations): New.
3754 Output them verbatim in the parser if !%defines, otherwise
3755 output then in the header file, and include it instead.
3756
3757 2005-11-11 Akim Demaille <akim@epita.fr>
3758
3759 * data/glr.c: Comment changes.
3760
3761 2005-11-11 Akim Demaille <akim@epita.fr>
3762
3763 When yydebug, report semantic and location values for reductions.
3764 * data/glr.c (yy_reduce_print): Report the semantic values and the
3765 locations.
3766 (YY_REDUCE_PRINT): Adjust.
3767 (yyglrReduce): Use them.
3768 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
3769 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
3770 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
3771 traces.
3772
3773 2005-11-10 Akim Demaille <akim@epita.fr>
3774
3775 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
3776 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
3777 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
3778
3779 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
3780
3781 * m4/cxx.m4, examples/Makefile.am: Don't build
3782 examples/calc++ if no C++ compiler is available. (trivial change)
3783
3784 2005-11-09 Akim Demaille <akim@epita.fr>
3785
3786 * src/scan-skel.l: Use a couple of asserts.
3787
3788 2005-11-03 Akim Demaille <akim@epita.fr>
3789
3790 In some (weird) cases, the final state number is incorrect.
3791 Reported by Alexandre Duret-Lutz.
3792 * src/LR0.c (state_list_append): Remove the computation of
3793 final_state.
3794 (save_reductions): Do it here.
3795 (get_state): Alpha conversion.
3796 (generate_states): Use a for loop.
3797 * src/gram.h (item_number_is_rule_number)
3798 (item_number_is_symbol_number): New.
3799 * src/state.c: Use assert.
3800 * src/system.h: Include assert.h.
3801 * tests/sets.at (Accept): New.
3802
3803 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3804
3805 * data/glr.c (yyfill): Adjust comment.
3806 (yyresolveAction): Initialize default location properly
3807 for empty right-hand sides.
3808 (yydoAction): Ditto.
3809 Add comment explaining apparently dead code.
3810 * tests/glr-regression.at
3811 (Incorrectly initialized location for empty right-hand side in GLR):
3812 New test.
3813
3814 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
3815
3816 * bootstrap (cleanup_gnulib): New function. Use it to clean up
3817 gnulib when interrupted. This fixes some race conditions and
3818 works around some portability problems (one noted by Paul
3819 Hilfinger).
3820
3821 2005-10-22 Akim <akim@epita.fr>
3822
3823 * Makefile.cfg: Adjust to config -> build-aux.
3824 Reported by twledo.
3825
3826 2005-10-21 Akim Demaille <akim@epita.fr>
3827
3828 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
3829 the %parse-params.
3830 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
3831 * data/yacc.c (b4_Pure_if): Rename as...
3832 (b4_yacc_pure_if): this.
3833 (YY_SYMBOL_PRINT, yyparse): Adjust.
3834 * doc/bison.texinfo: Formatting changes.
3835
3836 2005-10-21 Akim Demaille <akim@epita.fr>
3837
3838 Finish the transition config -> build-aux.
3839 * configure.ac, Makefile.am: Use build-aux.
3840 * config/prev-version, config/announce-gen, config/Makefile.am:
3841 Move to...
3842 * build-aux/prev-version, build-aux/announce-gen,
3843 * build-aux/Makefile.am: here.
3844
3845 2005-10-14 Akim Demaille <akim@epita.fr>
3846
3847 * examples/calc++/test: Use set -x only when VERBOSE.
3848
3849 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
3850
3851 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
3852 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
3853
3854 2005-10-13 Akim Demaille <akim@epita.fr>
3855
3856 * src/scan-skel.l: Output the base name parts of the parser and
3857 header file names.
3858 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
3859 additional checks.
3860 Use this to exercise C++ outputs in subdirs.
3861 Reported by Oleg Smolsky.
3862
3863 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
3864
3865 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
3866 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
3867 Problem reported by John P. Hartmann.
3868 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
3869 already defined it.
3870
3871 2005-10-12 Akim Demaille <akim@epita.fr>
3872
3873 * src/parse-gram.y (version_check): Exit 63 to please missing
3874 (stands for "version mismatch).
3875 * tests/input.at, doc/bison.texinfo: Adjust.
3876
3877 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
3878
3879 Work around portability problems with Visual Age C compiler
3880 (xlc and xlC_r) reported by John P. Hartmann.
3881 * data/location.cc (initial_column, initial_line): Remove.
3882 All uses replaced by 0 and 1.
3883 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
3884 that xlc complains about.
3885 * src/scan-skel.l (skel_wrap): Likewise.
3886 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
3887 as __STDC__.
3888 * data/yacc.c (YYMODERN_C): New macro, which also looks at
3889 __STDC_VERSION__. Use it everywhere instead of looking at
3890 __STDC__ and __cplusplus.
3891
3892 2005-10-10 Akim Demaille <akim@epita.fr>
3893
3894 * examples/calc++/test: Be quiet unless VERBOSE.
3895
3896 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
3897
3898 * data/c.m4 (yydestruct, yysymprint):
3899 Use YYUSE instead of casting to void.
3900 * data/glr.c (YYUSE): New macro.
3901 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3902 Use it instead of rolling our own.
3903 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3904 (YYCHK1):
3905 Use /*CONSTCOND*/ to suppress lint warnings.
3906 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3907 (YY_STACK_PRINT): Use 'false' not '0'.
3908 (YYUSE): New macro.
3909 (yysymprint_, yydestruct_): Use it instead of rolling our own.
3910 * data/yacc.c (YYUSE): New macro.
3911 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
3912 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
3913 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
3914
3915
3916 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
3917 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
3918
3919 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
3920
3921 Undo the parts of the unlocked-I/O change that substituted
3922 putc or puts for printf. This might hurt performance a bit,
3923 but some people prefer the printf style.
3924 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
3925 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
3926 All uses replaced by YYFPRINTF and YYDPRINTF.
3927 * data/yacc.c: Likewise.
3928 * lib/bitset.c (bitset_print): Likewise.
3929 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
3930 putc and puts.
3931 * lib/lbitset.c (debug_lbitset): Likewise.
3932 * src/closure.c (print_firsts, print_fderives): Likewise.
3933 * src/gram.c (grammar_dump): Likewise.
3934 * src/lalr.c (look_ahead_tokens_print): Likewise.
3935 * src/output.c (escaped_output): Likewise.
3936 (user_actions_output): Break apart two printfs.
3937 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
3938 * src/reduce.c (reduce_print): Likewise.
3939 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
3940 * src/system.h: Include unlocked-io.h rathe than stdio.h.
3941
3942 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3943 Use assignments rather than casts-to-void to suppress
3944 unused-variable warnings. This pacifies 'lint'.
3945 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
3946 unused-variable warnings.
3947
3948 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3949
3950 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3951
3952 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
3953
3954 Use unlocked I/O for a minor performance improvement on hosts like
3955 GNU/Linux and Solaris that support unlocked I/O. The basic idea
3956 is to use the gnlib unlocked-io module, and to prefer putc and
3957 puts to printf when either will work (since the latter doesn't
3958 come in an unlocked flavor).
3959 * bootstrap (gnulib_modules): Add unlocked-io.
3960 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
3961 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
3962 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
3963 and similarly for puts and putc and printf.
3964 * data/yacc.c: Likewise.
3965 * lib/bitset.c (bitset_print): Likewise.
3966 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
3967 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
3968 to printf.
3969 * lib/lbitset.c (debug_lbitset): Likewise.
3970 * src/closure.c (print_firsts, print_fderives): Likewise.
3971 * src/gram.c (grammar_dump): Likewise.
3972 * src/lalr.c (look_ahead_tokens_print): Likewise.
3973 * src/output.c (escaped_output): Likewise.
3974 (user_actions_output): Coalesce two printfs.
3975 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
3976 * src/reduce.c (reduce_print): Likewise.
3977 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
3978 * src/system.h: Include unlocked-io.h rather than stdio.h.
3979
3980 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
3981 this confuses xgettext.
3982
3983 2005-10-02 Akim Demaille <akim@epita.fr>
3984
3985 * bootstrap (gnulib_modules): Add strverscmp.
3986 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
3987 * m4/.cvsignore: Add strverscmp.m4.
3988 * src/parse-gram.y (%require): New token, new rule.
3989 (version_check): New.
3990 * src/scan-gram.l (%require): Adjust.
3991 * tests/input.at (AT_REQUIRE): New.
3992 Use it.
3993 * doc/bison.texinfo (Require Decl): New.
3994 (Calc++ Parser): Use %require.
3995
3996 2005-10-02 Akim Demaille <akim@epita.fr>
3997
3998 * data/location.cc: New.
3999
4000 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
4001 Akim Demaille <akim@epita.fr>
4002
4003 Make sure -odir/foo.cc creates dir/location.hh etc.
4004 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
4005 (spec_file_prefix, spec_verbose_file, spec_graph_file)
4006 (spec_defines_file): Now const.
4007 (dir_prefix): New.
4008 (short_base_name): Remove.
4009 * src/files.c: Adjust.
4010 (dirname.h): Include.
4011 (base_name): Don't prototype it.
4012 (finput): Remove, duplicates gram_in.
4013 (full_base_name, short_base_name): Replace by...
4014 (all_but_ext, all_but_tab_ext): these.
4015 (compute_base_names): Rename as...
4016 (compute_file_name_parts): this.
4017 Update to compute the new variables, including dir_prefix.
4018 Adjust dependencies.
4019 * src/output.c (prepare): Output them.
4020 * src/reader.c: Adjust to use gram_in, not finput.
4021 * src/scan-skel.l (@dir_prefix@): New.
4022
4023 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4024
4025 * lib/subpipe.c: New function end_of_output_subpipe() added
4026 to allow support for non-posix systems. This is a no-op function
4027 for posix systems.
4028
4029 * lib/subpipe.h: New function end_of_output_subpipe() added
4030 to allow support for non-posix systems. This is a no-op function
4031 for posix systems.
4032
4033 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
4034 handle the lack of pipe/fork functionality on non-posix systems.
4035
4036 * djgpp/Makefile.maint: DJGPP specific file.
4037
4038 * djgpp/README.in: DJGPP specific file.
4039
4040 * djgpp/config.bat: DJGPP specific configuration file.
4041
4042 * djgpp/config.sed: DJGPP specific configuration file.
4043
4044 * djgpp/config.site: DJGPP specific configuration file.
4045
4046 * djgpp/config_h.sed: DJGPP specific configuration file.
4047
4048 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
4049
4050 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
4051
4052 2005-10-02 Akim Demaille <akim@epita.fr>
4053
4054 * data/location.cc: New, extract from...
4055 * data/lalr1.cc: here.
4056 (location.hh): Include it after the user prologue, in case the
4057 filename type is defined by the user.
4058 Forward declation location and position before the pre-prologue.
4059 (yyresult_): Rename as...
4060 (yyresult): this, it's a local variable, not an attribute.
4061 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
4062
4063 2005-10-01 Akim Demaille <akim@epita.fr>
4064
4065 * examples/extexi: Restore the #line generation.
4066
4067 2005-09-30 Akim Demaille <akim@epita.fr>,
4068 Alexandre Duret-Lutz <adl@gnu.org>
4069
4070 Move the token type and YYSTYPE in the parser class.
4071 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
4072 (parser::token): New, from the moved free definition of tokens.
4073 (parser::semantic_value): Now a full definition instead of an
4074 indirection to YYSTYPE.
4075 (b4_post_prologue): No longer included in the header file, but
4076 in the implementation file.
4077 * doc/bison.texi (C+ Language Interface): Update.
4078 * src/parse-gram.y: Support unary %define.
4079 * tests/actions.at: Define global_tokens_and_yystype for backward
4080 compatibility until we update the tests.
4081 * tests/calc.at: Idem.
4082 (first_line, first_column, last_line, last_column): Define for lalr1.cc
4083 to simplify the code.
4084
4085 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
4086
4087 Port to SunOS 4.1.4, which lacks strtoul and strerror.
4088 Ah, the good old days! Problem reported by Peter Klein.
4089 * bootstrap (gnulib_modules): Add strerror, strtoul.
4090 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
4091 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
4092
4093 2005-09-29 Akim Demaille <akim@epita.fr>
4094
4095 * data/c.m4 (b4_error_verbose_if): New.
4096 * data/lalr1.cc: Use it.
4097 (YYERROR_VERBOSE_IF): Remove.
4098 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
4099 parser members, replaced by...
4100 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
4101 local variables.
4102 (yysyntax_error_): Takes the state number as argument.
4103 (yyreduce_print_): Use the argument yyrule, not the former
4104 attribute yyn_.
4105
4106 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
4107
4108 * bootstrap (gnulib_modules): Add verify.
4109 * lib/.cvsignore: Add verify.h.
4110 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
4111 * src/system.h (verify): Remove.
4112 Include verify.h instead.
4113 * src/tables.c (tables_generate): Use new API for 'verify'.
4114
4115 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
4116
4117 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
4118 local variables whose names begin with 'yy'.
4119 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
4120 Trivial changes from Joel E. Denny.
4121
4122 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
4123 it itself.
4124 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
4125 don't use alloca any more.
4126
4127 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
4128 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
4129 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
4130 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
4131 to match yacc.c, to test more hosts.
4132
4133 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
4134
4135 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
4136 doesn't affect behavior.
4137 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
4138 Solaris, AIX, MSC.
4139 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
4140 This works a bit better with glibc, if user code has already included
4141 stdlib.h.
4142 * doc/bison.texinfo (Bison Parser): Document that users can't
4143 arbitrarily use malloc and free for other purposes. Document
4144 that <alloca.h> and <malloc.h> might be included.
4145 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
4146 user must declare alloca.
4147
4148 * HACKING (release): Forwarn the Translation Project about
4149 stable releses.
4150
4151 2005-09-20 Akim Demaille <akim@epita.fr>
4152
4153 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
4154
4155 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
4156
4157 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
4158 (YYSTACK_ALLOC_MAXIMUM): Use it.
4159 (yysyntax_error): New function.
4160 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
4161 multiple syntax errors are reported, and alloca is being used.
4162 Instead, reallocate buffers twice as big each time, so that
4163 we waste at most half the allocated memory. Start with a small
4164 (128-byte) buffer that will suffice in most cases anyway.
4165 Use yysyntax_error to do most of the work.
4166
4167 * doc/bison.texinfo (Error Reporting, Table of Symbols):
4168 yynerrs is the number of errors reported, not the number of
4169 errors encountered.
4170
4171 * tests/glr-regression.at (Duplicated user destructor for lookahead):
4172 Mark it as expected to fail.
4173 Cast result of malloc; problem reported by twlevo@xs4all.nl.
4174 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
4175 Don't start user-code symbols with "yy", to avoid name space problems.
4176
4177 2005-09-19 Akim Demaille <akim@epita.fr>
4178
4179 Remove the traits, failed experiment.
4180 It never proved useful, and anyway because of the current
4181 definition, it was not possible to have several specialization of
4182 this traits, making it useless.
4183 * data/lalr1.cc (yy:traits): Remove.
4184 Inline its definitions in the parser class.
4185
4186 2005-09-19 Akim Demaille <akim@epita.fr>
4187
4188 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
4189 least Mac OSX with a /usr/local install of gettext.
4190
4191 2005-09-19 Akim Demaille <akim@epita.fr>
4192
4193 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
4194 and yytoken for similarity with the other skeletons.
4195
4196 2005-09-19 Akim Demaille <akim@epita.fr>
4197
4198 * NEWS, configure.ac: update version number to 2.1a.
4199
4200 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
4201
4202 * NEWS: Version 2.1.
4203
4204 * NEWS: Remove notice of yytname change, since it was never in an
4205 official release.
4206 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
4207 diagnostic.
4208 * src/output.c (prepare): Likewise.
4209 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
4210 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
4211 is not defined. This is an awful hack, but it's enough for now.
4212 All callers changed.
4213 * tests/glr-regression-at (make_value): Args are const pointers now,
4214 to avoid GCC warning.
4215 (Duplicated user destructor for lookahead): New test. Currently
4216 skipped. It fails on my host but I'm not sure it'll always fail.
4217
4218 2005-09-16 Akim Demaille <akim@epita.fr>
4219
4220 * src/symtab.h (struct symbol): Declare the printer and destructor
4221 as const, to avoid accidental calls to free.
4222 (symbol_destructor_set, symbol_printer_set): Adjust.
4223 * src/symtab.c: Adjust.
4224
4225 2005-09-16 Akim Demaille <akim@epita.fr>
4226
4227 * data/c.m4 (b4_token_enums): New.
4228 (b4_token_defines): Rename as...
4229 (b4_token_enums_defines): this.
4230 (b4_token_defines): New, output only the #defines.
4231 * data/yacc.c, data/glr.c: Adjust.
4232 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
4233 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
4234 as default values.
4235
4236 2005-09-16 Akim Demaille <akim@epita.fr>
4237
4238 * data/lalr1.cc (yylex_): Remove, inline its code.
4239 (yyreport_syntax_error_): Remove, replaced by...
4240 (yysyntax_error_): this which returns a string and leaves to the
4241 caller the call to the users' error function.
4242 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
4243 Move from members of the parser object...
4244 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
4245 to local variables of the parse function.
4246
4247 2005-09-16 Akim Demaille <akim@epita.fr>
4248
4249 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
4250 since it's in Bison's name space.
4251
4252 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
4253
4254 * data/glr.c (yyresolveValue): Add default case to pacify
4255 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
4256
4257 * NEWS: Document when yyparse started to return 2.
4258 * doc/bison.texinfo (Parser Function): Document when yyparse
4259 returns 2.
4260
4261 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
4262 (b4_filename_type): Renamed back from b4_file_name_type. All uses
4263 changed.
4264 (class position): file_name -> filename (reverting). All uses changed.
4265
4266 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
4267
4268 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
4269 do anything if $@ exists. This reverts part of the 2005-07-07
4270 patch.
4271
4272 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
4273
4274 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
4275 contains obsolete information and isn't worth distributing as a
4276 separate file anyway.
4277 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
4278 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
4279 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
4280 (yyparse): Abort if user code uses longjmp to throw an unexpected
4281 value.
4282
4283 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
4284
4285 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
4286 Suggested by twlevo@xs4all.nl.
4287
4288 * data/glr.c (YYCHK1): Do not assume YYE is in range.
4289 This avoids a diagnostic from gcc -Wswitch-enum.
4290 Problem reported by twlevo@xs4all.nl.
4291
4292 * doc/bison.texinfo: Don't use "filename", as per GNU coding
4293 standards. Use "file name" or "file" or "name", depending on
4294 the context.
4295 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
4296 not to hack/foo.tab.c.
4297 (Calc++ Top Level): 2nd arg of main is not const.
4298 * data/glr.c: b4_filename -> b4_file_name.
4299 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
4300 All uses changed.
4301 (class position): filename -> file_name. All uses changed.
4302 * data/yacc.c: b4_filename -> b4_file_name.
4303 * lib/bitset.h: filename -> file_name in local vars.
4304 * lib/bitset_stats.c: Likewise.
4305 * src/files.c: Likewise.
4306 * src/scan-skel.l ("@output ".*\n): Likewise.
4307 * src/files.c (file_name_split): Renamed from filename_split.
4308 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
4309
4310 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
4311
4312 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
4313 to accommodate latest gnulib.
4314
4315 * tests/glr-regression.at (Duplicate representation of merged trees):
4316 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
4317
4318 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
4319 needed.
4320
4321 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
4322
4323 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
4324 All uses changed. Invoke user destructor after an error during a
4325 split parse (trivial change from Joel E. Denny).
4326
4327 * tests/glr-regression.at
4328 (User destructor after an error during a split parse): New test case.
4329 Problem reported by Joel E. Denny in:
4330 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
4331
4332 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
4333
4334 * README-cvs: Give URLs for recommended tools.
4335 Mention Gzip version problem, and bootstrapping issues.
4336 Remove troubleshooting section, as it's somewhat obsolete.
4337
4338 * bootstrap (no_cache): New var, to accommodate different wget
4339 variants. Use it instead of '-C off'. Problem reported by
4340 twlevo@xs4all.nl.
4341
4342 * data/glr.c (yydestroyStackItem): New function.
4343 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
4344 debugging information. Problem reported by Joel E. Denny.
4345
4346 2005-08-25 Akim Demaille <akim@epita.fr>
4347
4348 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
4349
4350 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
4351
4352 * data/glr.c (yyrecoverSyntaxError, yyreturn):
4353 Don't invoke destructor on unresolved entries.
4354 * tests/glr-regression.at
4355 (User destructor for unresolved GLR semantic value): New test case.
4356 Problem reported by Joel E. Denny in:
4357 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
4358
4359 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
4360
4361 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
4362 Add strnlen.c.
4363 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
4364 lib-prefix.m4, po.m4.
4365
4366 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
4367 in yydestruct diagnostic, since it might not be an error.
4368 Problem reported by Joel Denny near end of
4369 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
4370 * data/lalr1.cc (yyerturn): Likewise.
4371 * data/yacc.c (yyreturn): Likewise.
4372 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
4373
4374 * src/files.c: Remove obsolete FIXME comment.
4375
4376 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
4377 with the other templates, and to fix bogus run-on messages such
4378 as the one reported at the end of
4379 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
4380 All callers changed to avoid the newline.
4381 (yyprocessOneStack): Output two lines rather than one, to accommodate
4382 the above change. This changes the debug output format slightly.
4383
4384 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
4385 reported by Joel E. Denny in
4386 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
4387 (trivial change).
4388 * tests/glr-regression.at (Duplicate representation of merged trees):
4389 New test, from Joel E. Denny in:
4390 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
4391 * THANKS: Add Joel E. Denny.
4392
4393 * configure.ac (AC_INIT): Bump to 2.0c.
4394
4395 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
4396
4397 * NEWS: Version 2.0b.
4398
4399 * Makefile.am (SUBDIRS): Put examples before tests, so that
4400 "make check" doesn't finish with "All 1 tests passed".
4401
4402 * tests/regression.at (Token definitions): Don't rely on
4403 AT_PARSER_CHECK for data that contains backslashes. It currently
4404 uses 'echo', and 'echo' isn't portable if its argument contains
4405 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
4406 that the byte '\0xff' is not printable in the C locale; it is,
4407 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
4408 not printable, so use '\0x81' to test.
4409
4410 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
4411 version of GCC, since the macro is used with non-GCC compilers.
4412
4413 Fix core dump reported by Pablo De Napoli in
4414 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
4415 * tests/regression.at (Invalid inputs with {}): New test.
4416 * src/parse-gram.y (token_name): Translate type before using
4417 it as an index.
4418
4419 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
4420 the user's name space. All uses changed to __attribute__
4421 ((__unused__)).
4422 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
4423 Add __attribute__ ((__noreturn__)).
4424
4425 * etc/clcommit: Remove. We weren't using it, and it failed
4426 "make maintainer-distcheck".
4427 * Makefile.maint: Merge from coreutils.
4428 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
4429 (syntax-check-rules): Change list of rules as described below.
4430 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
4431 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
4432 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
4433 (sc_trailing_space): New rules.
4434 (sc_xalloc_h_in_src): Remove.
4435 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
4436 (sc_space_tab, sc_error_exit_success, sc_changelog):
4437 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
4438 (makefile-check, po-check, author_mark_check):
4439 (makefile_path_separator_check, copyright-check):
4440 Use grep -n, to make it easier to find violations.
4441 Use CVS_LIST and CVS_LIST_EXCEPT.
4442 (header_regexp, h_re): Remove.
4443 (dd_c): New macro.
4444 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
4445 (my-distcheck): Use more-modern GCC flags.
4446 (signatures, %.asc): Remove.
4447 (rel-files, announcement): Remove signatures.
4448 Restore old updating code, even though we don't use it, so
4449 that we're the same as coreutils.
4450 (alpha, beta, major): Depend on news-date-check.
4451 Make the upload commands.
4452
4453 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
4454 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
4455 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
4456 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
4457 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
4458 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
4459 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
4460 * tests/sets.at: Likewise.
4461
4462 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
4463 we comment out the Autoconf version number.
4464 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
4465 it's error-prone and "make maintainer-distcheck" rejects it.
4466
4467 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
4468 Indent calls to "error" to pacify "make maintainer-distcheck",
4469 when the calls are not intended to be translated.
4470 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
4471
4472 * src/Makefile.am (DEFS): Use +=, to pacify
4473 "make maintainer-distcheck".
4474 (bison_SOURCES): Add scan-skel.h.
4475 (sc_tight_scope): New rule, from coreutils.
4476
4477 * src/files.c (src_extension, header_extension):
4478 Now static, not extern.
4479 * src/getargs.c (short_options): Likewise.
4480 * src/muscle_tab.c (muscle_table): Likewise.
4481 * src/parse-gram.y (current_class, current_type, current_prec):
4482 Likewise.
4483 * src/reader.c (grammar_end, previous_rule_end): Likewise.
4484 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
4485 * src/main.c (main): Cast bindtextdomain and textdomain calls to
4486 void, to avoid warning when NLS is disabled.
4487 * src/output.c: Include scan-skel.h.
4488 (scan_skel): Remove decl, since scan-skel.h does this.
4489 (output_skeleton):
4490 Indent calls to "error" to pacify "make maintainer-distcheck".
4491 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
4492 * src/reader.h (gram_end, gram_lineno): New decls to pacify
4493 "make maintainer-distcheck".
4494 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
4495 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
4496 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
4497 (skel_lex_destroy, scan_skel): Move these decls to...
4498 * src/scan-skel.h: New file.
4499 * src/uniqstr.c (uniqstr_assert):
4500 Indent calls to "error" to pacify "make maintainer-distcheck".
4501
4502 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
4503 not @VAR@.
4504
4505 * tests/torture.at: Revamp to avoid misuse of atoi that
4506 "make maintainer-distcheck" complained about.
4507
4508 * examples/extexi (message): Don't print a message more than once,
4509 and omit line-number decoration that makes Emacs compile think
4510 that informative messages are worth worrying about.
4511
4512 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
4513
4514 * configure.ac: Update version number.
4515
4516 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
4517 accidentally.
4518 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
4519 autogenerated by the maintainer.
4520 * examples/calc++/.cvsignore: Add *.yy.
4521
4522 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
4523 * lib/bitset_stats.c (bitset_stats_init): Likewise.
4524 * lib/bitsetv.c (bitsetv_alloc): Likewise.
4525
4526 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
4527
4528 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
4529 from maintainer-distcheck about casting the argument of 'free'.
4530
4531 * NEWS: Mention recent yytname changes.
4532 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
4533
4534 * bootstrap: For translations that have not yet been upgraded to
4535 the new runtime-po domain, prime the pump by extracting the
4536 relevant strings from the obsolete translations. This code can be
4537 removed once the bison-runtime domain has been translated by each
4538 team.
4539
4540 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
4541 now that token names are already quoted.
4542
4543 Fix problem reported by Anthony Heading.
4544 * data/glr.c (YYTOKEN_TABLE): New macro.
4545 (yytname): Define if YYTOKEN_TABLE.
4546 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
4547 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
4548 (YYERROR_VERBOSE): Define the same way the other skeletons do.
4549 * src/output.c (prepare_symbols): Output token_table_flag.
4550
4551 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
4552
4553 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
4554 again if the first call fails.
4555
4556 * data/glr.c (yytnamerr): New function.
4557 (yyreportSyntaxError): Use it to dequote most string literals.
4558 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
4559 with other skeletons. All uses changed.
4560 (yytnameerr_): New function.
4561 (yyreport_syntax_error): Use it to dequote most string literals.
4562 * data/yacc.c (yytnamerr): New function.
4563 (yyerrlab): Use it to decode most string literals.
4564 * doc/bison.texinfo (Decl Summary, Calling Convention):
4565 Clarify quoting convention of yytname.
4566 * src/output.c (prepare_symbols): Quote all names. This undoes
4567 the 2005-04-17 change, which is now accomplished (mostly) via
4568 changes in the parsers as described above.
4569 * tests/regression.at (Token definitions, Web2c Actions):
4570 Undo most 2005-04-17 change here, too.
4571
4572 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
4573
4574 Fix more problems reported by twlevo@xs4all.nl.
4575 * tests/cxx-type.at: Don't pipe output of ./types through sed to
4576 remove trailing spaces. This loses the exit status of ./types,
4577 and isn't needed since ./types shouldn't be emitting trailing
4578 spaces.
4579 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
4580 as the stack isn't valid in that case.
4581
4582 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4583 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4584 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4585 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
4586 is used.
4587 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
4588 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
4589 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
4590 Likewise.
4591
4592 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
4593 overly-picky compilers that reject 'char *foo = "bar";'.
4594
4595 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
4596 to FILE * parameter, not to stderr. This fixes a typo introduced
4597 in the 2005-07-12 change.
4598
4599 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
4600 warnings from GCC 4.
4601
4602 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
4603 (yyglrShiftDefer, yysplitStack):
4604 Remove unused parameters b4_pure_formals. All uses changed.
4605 (yyglrShift): Remove unused parameters b4_user_formals.
4606 All uses changed.
4607 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
4608
4609 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
4610
4611 Destructor cleanups and regularization among the three skeletons.
4612 * NEWS: Document the behavior changes.
4613 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
4614 stack before failing, as the cleanup code will do it for us now.
4615 * data/lalr1.cc (yyerrlab): Likewise.
4616 * data/glr.c (yyparse): Pop everything off the stack before
4617 freeing it, so that destructors get called properly.
4618 * data/lalr1.cc (yyreturn): Likewise.
4619 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
4620 This is more consistent.
4621 * doc/bison.texinfo (Destructor Decl): Mention more reasons
4622 why destructors might be called. 1.875 -> 2.1.
4623 (Destructor Decl, Decl Summary, Table of Symbols):
4624 Some English-language cleanups for %destructor.
4625 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
4626 Add output line for destructor of start symbol.
4627 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
4628 because of that same extra output line.
4629
4630 * NEWS: Document minor wording changes in diagnostics of
4631 Bison-generated parsers.
4632 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
4633 Remove unused formals. All uses changed.
4634 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
4635 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
4636 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
4637 Rename yyoverflowab to yyexhaustedlab.
4638 When memory exhaustion occurs during syntax-error reporting,
4639 report it separately rather than in a single diagnostic; this
4640 eases translation.
4641 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
4642 (Memory Exhausted): Renamed from Parser Stack Overflow.
4643 Revamp wording slightly to prefer "memory exhaustion".
4644 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
4645
4646 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
4647
4648 Add i18n support to the GLR skeleton. Partially fix the C++
4649 skeleton; a C++ expert needs to finish this. Remove debugging
4650 msgids; there's little point to having them translated, since they
4651 can be understood only by someone who can read the
4652 (English-language) source code.
4653
4654 Generate runtime-po/bison-runtime.pot automatically, so that we
4655 don't have to worry about garbage getting in that file. We'll
4656 make sure after the next official release that old msgids don't
4657 get lost. See
4658 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
4659
4660 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
4661 Now auto-generated.
4662 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
4663 Fix typos in explanations of the runtime file.
4664 * bootstrap: Change gettext keyword from YYI18N to YY_.
4665 Use standard Makefile.in.in in runtime-po, since we'll arrange
4666 for backward-compatible bison-runtime.po files in a different way.
4667 * data/glr.c (YY_): New macro, from yacc.c.
4668 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
4669 Translate messages intended for users.
4670 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
4671 the wording in the other skeletons. We don't know that the memory
4672 is virtual.
4673 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
4674 Use same method that yacc.c uses.
4675 Don't translate debugging messages.
4676 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
4677 it doesn't work (yet), and requires C++ expertise to fix.
4678 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
4679 Move defn to a more logical place, to be consistent with other
4680 skeletons.
4681 Don't translate debugging messages.
4682 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
4683 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
4684 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
4685 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
4686
4687 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
4688 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
4689 void, not int.
4690 * tests/glr-regression.at (Badly Collapsed GLR States):
4691 Likewise.
4692 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4693 yylex should return 0 at EOF rather than aborting.
4694
4695 Improve tests for stack overflow in GLR parser.
4696 Problem reported by twlevo@xs4all.nl.
4697 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
4698 All uses removed.
4699 (yyStackOverflow): Just longjmp, but with value 2 so that caller
4700 can handle the problem.
4701 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
4702 (yyparse): New local variable yyresult to record the result.
4703 Use result of setjmp to set it, rather than storing itinto
4704 struct.
4705 (yyDone): Remove label.
4706 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
4707 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
4708 if YYABORT is used).
4709 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
4710 yyparse status; put status > 1 into diagnostic.
4711 Check that status==2 works.
4712 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
4713 Use exit status 3 for failure to open (which shouldn't happen).
4714
4715 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
4716
4717 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
4718 1 on syntax error; just let yyparse do its thing.
4719 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
4720 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
4721 (Exploding the Stack Size with Alloca):
4722 (Exploding the Stack Size with Malloc):
4723 Expect exit status 2, not 1, since the parser is supposed to blow
4724 its stack. Problem reported by twlevo@xs4all.nl.
4725
4726 * data/glr.c (yyparse): Don't assume that the initial calls
4727 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
4728 Print a stack-overflow message and fail instead.
4729 Initialize the line-number information before creating the stack,
4730 so that the stack-overflow message can report line zero safely.
4731
4732 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
4733
4734 Fix problems reported by twlevo@xs4all.nl.
4735 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
4736 (yyuserMerge): Provide a default case if b4_mergers is empty.
4737 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
4738 * tests/glr-regression.at
4739 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4740 Add casts to pacify C++ compilers.
4741 * tests/glr-regression.at (Improper merging of GLR delayed action
4742 sets): Declare yylex before using it.
4743 * tests/Makefile.am (maintainer-check-g++): Fix a stray
4744 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
4745 test for valgrind; valgrind is independent of g++.
4746 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
4747 for compatibility with POSIX 1003.1-2001 (if running coreutils).
4748 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
4749 Use a destructor, so that we can expand the stack. Change
4750 YYSTYPE to char * so that we can free it. Cast result of malloc.
4751
4752 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4753
4754 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
4755 a valgrind failure. Problem reported by twlevo@xs4all.nl.
4756
4757 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
4758
4759 * PACKAGING: New file, suggested by Bruno Haible and taken from
4760 similar wording in gettext's PACKAGING file.
4761 * NEWS: Mention PACKAGING.
4762 * Makefile.am (EXTRA_DIST): Add PACKAGING.
4763
4764 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
4765
4766 * NEWS: Document recent i18n improvements.
4767 * bootstrap: Get runtime translations into runtime-po.
4768 Create runtime-po files automatically, if possible.
4769 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
4770 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
4771 does not infringe on the user's name space.
4772 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
4773 * doc/bison.texinfo (Internationalization): Revamp the English
4774 and Texinfo syntax a bit, to try to make it clearer.
4775 (Bison Options, Option Cross Key): Mention --print-localedir.
4776 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
4777 YYENABLE_NLS. Quote a bit more.
4778 * runtime-po/.cvsignore: New file.
4779 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
4780 * runtime-po/Rules-quot: Remove; now created by bootstrap.
4781 * runtime-po/quot.sed: Likewise.
4782 * runtime-po/boldquot.sed: Likewise.
4783 * runtime-po/en@quot.header: Likewise.
4784 * runtime-po/en@boldquot.header: Likewise.
4785 * runtime-po/insert-header.sin: Likewise.
4786 * runtime-po/remove-potcdate.sin: Likewise.
4787 * runtime-po/Makevars: Likewise.
4788 * runtime-po/LINGUAS: Likewise.
4789 * runtime-po/de.po: Likewise; we will rely on the translation project
4790 to maintain this, so "bootstrap" should get it.
4791 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
4792 its value.
4793 * src/main.c (main): Bind the bison-runtime domain, too.
4794
4795 2005-07-12 Bruno Haible <bruno@clisp.org>
4796
4797 * data/yacc.c: Include <libintl.h> when NLS is enabled.
4798 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
4799 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
4800 * runtime-po: New directory.
4801 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
4802 $(DOMAIN).pot-update rule, so that old messages are never dropped.
4803 * runtime-po/Rules-quot: New file, copied from po/.
4804 * runtime-po/quot.sed: Likewise.
4805 * runtime-po/boldquot.sed: Likewise.
4806 * runtime-po/en@quot.header: Likewise.
4807 * runtime-po/en@boldquot.header: Likewise.
4808 * runtime-po/insert-header.sin: Likewise.
4809 * runtime-po/remove-potcdate.sin: Likewise.
4810 * runtime-po/Makevars: New file.
4811 * runtime-po/POTFILES.in: New file.
4812 * runtime-po/LINGUAS: New file.
4813 * runtime-po/bison-runtime.pot: New file.
4814 * runtime-po/de.po: New file.
4815 * m4/bison.m4: New file.
4816 * Makefile.am (SUBDIRS): Add runtime-po.
4817 (aclocaldir, aclocal_DATA): New variables.
4818 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
4819 Define aclocaldir.
4820 * src/getargs.c (usage): Document --print-localedir option.
4821 (PRINT_LOCALEDIR_OPTION): New enum item.
4822 (long_options): Add --print-localedir option.
4823 (getargs): Handle --print-localedir option.
4824 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
4825 (Internationalization): New section.
4826
4827 2005-07-12 Akim Demaille <akim@epita.fr>
4828
4829 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
4830 for consistency with the rest of the code.
4831 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
4832 Add separators.
4833
4834 2005-07-12 Akim Demaille <akim@epita.fr>
4835
4836 * src/parse-gram.y: Use %printer instead of YYPRINT.
4837
4838 2005-07-12 Akim Demaille <akim@epita.fr>
4839
4840 * src/symtab.h, src/symtab.c (symbol_print): New.
4841 * src/symlist.h, src/symlist.c (symbol_list_print): New.
4842 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
4843
4844 2005-07-12 Akim Demaille <akim@epita.fr>
4845
4846 * data/glr.c (b4_syncline): Fix (swap) the definitions of
4847 b4_at_dollar and b4_dollar_dollar.
4848
4849 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
4850
4851 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
4852 and Pennello's paper.
4853
4854 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
4855
4856 * data/yacc.c (yyparse): Undo previous patch. Instead,
4857 set yylsp[0] and yyvsp[0] only if the initial action
4858 sets yylloc and yylval, respectively.
4859
4860 * data/yacc.c (yyparse): In the initial action, set
4861 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
4862 This avoids the use of undefined variables if the initial
4863 action does not set yylloc and/or yylval.
4864
4865 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
4866
4867 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
4868 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
4869 Remove from CVS. These files are automatically generated.
4870 * examples/extexi: Clarify that this file is now part of Bison,
4871 not GNU M4, and that it works with any POSIX-compatible Awk.
4872 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
4873 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
4874 so that we also get calc++-parser.yy. Geneate it.
4875 Use $(AWK), not gawk, since any conforming Awk will do.
4876 Put comment before action, since older 'make' can't handle comment
4877 in action.
4878 $(BUILT_SOURCES): List all built sources, not just some of them.
4879 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
4880 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
4881 $($(calc_sources_generated)): Remove unnecessary test for existence
4882 of target. (This had a shell syntax error anyway; a stray "x".)
4883 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
4884 calc++-parser.yy.
4885 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
4886
4887 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
4888 implied by the other modules.
4889
4890 2005-07-06 Akim Demaille <akim@epita.fr>
4891
4892 Bind examples/calc++ to the package.
4893 * examples/calc++/Makefile: Remove, replaced by...
4894 * examples/calc++/Makefile.am: ... this new file.
4895 * examples/calc++/test: Remove input.
4896 * examples/calc++/compile: Remove.
4897 * examples/Makefile.am: New.
4898 * configure.ac, Makefile.am: Adjust.
4899 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
4900
4901 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
4902
4903 * data/glr.c (yyFail): Drastically simplify; since the format argument
4904 never had any % directives, we can simply pass it to yyerror.
4905 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
4906 be modified later, as that is the usual style in glr.c.
4907 Problems reported by Paul Hilfinger.
4908
4909 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
4910 and size overflow errors.
4911 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
4912 in case the user prolog sets feature-test macros like _GNU_SOURCE.
4913 (YYSIZEMAX): New macro.
4914 (yystpcpy): New function, taken from yacc.c.
4915 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
4916 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
4917 so that we don't have to maintain their signatures.
4918 (yyFail): Check for buffer overflow, by using vsnprintf rather
4919 than vsprintf. Allocate a bigger buffer if possible.
4920 Report an error if buffer allocation fails.
4921 (yyStackOverflow): New function.
4922 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
4923 the initialization was successful. It might fail if storage was
4924 exhausted.
4925 (yyexpandGLRStack): Add more checks for storage allocation failure.
4926 Use yyStackOverflow to report failures.
4927 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
4928 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
4929 Don't assume stack number fits in int.
4930 (yysplitStack): Check for storage allocation failure.
4931 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
4932 can print diagnostics on storage allocation failure. All callers
4933 changed.
4934 (yyresolveValue): Use yybool for boolean.
4935 (yyreportSyntaxError): Check for size-calculation overflow.
4936 This code is taken from yacc.c.
4937 (yyparse): Check for storage allocation errors when allocating
4938 the initial stack.
4939
4940 2005-07-05 Akim Demaille <akim@epita.fr>
4941
4942 Extract calc++ from the documentation.
4943 * doc/bison.texinfo (Calc++): Add the extraction marks.
4944 * examples/extexi: New, from the aborted GNU Programming 2E.
4945 Separate the different paragraph of a file with empty lines.
4946 * examples/Makefile: Use it to extract the whole calc++ example.
4947
4948 2005-06-24 Akim Demaille <akim@epita.fr>
4949
4950 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
4951 class typedefs.
4952
4953 2005-06-22 Akim Demaille <akim@epita.fr>
4954
4955 * doc/bison.texinfo (C++ Language Interface): First stab.
4956 (C++ Parsers): Remove.
4957
4958 2005-06-22 Akim Demaille <akim@epita.fr>
4959
4960 * data/lalr1.cc (yylex_): Honor %lex-param.
4961
4962 2005-06-22 Akim Demaille <akim@epita.fr>
4963
4964 Start a set of simple examples.
4965 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
4966 * examples/calc++/calc++-driver.hh,
4967 * examples/calc++/calc++-parser.yy,
4968 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
4969 * examples/calc++/compile, examples/calc++/test: New.
4970
4971 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
4972
4973 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
4974 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
4975 which stems from the 2005-05-27 patch.
4976
4977 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4978
4979 * data/glr.c: Modify treatment of unused parameters to permit use
4980 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
4981
4982 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
4983
4984 Fix infringement on user name space reported by Janos Zoltan Szabo.
4985 * data/yacc.c (yyparse): strlen -> yystrlen.
4986
4987 2005-05-30 Akim Demaille <akim@epita.fr>
4988
4989 * data/lalr1.cc (_): New.
4990 Translate the various messages.
4991
4992 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
4993
4994 Fix infringement on user name space reported by Bruno Haible.
4995 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
4996 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
4997 the user's name space.
4998 (alloca): Include <stdlib.h> to get it, if it's not built in.
4999 (YYMALLOC, YYFREE): Define only if needed.
5000 (malloc, free): Declare, but only if needed, as this infringes on
5001 the user name space.
5002
5003 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
5004
5005 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
5006 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
5007 with %d format.
5008 * lib/ebitset.c (min, max): Undef before defining.
5009 * lib/vbitset.c (min, max): Likewise.
5010 * lib/subpipe.c (create_subpipe): Save local variables in case
5011 vfork clobbers them.
5012
5013 2005-05-24 Bruno Haible <bruno@clisp.org>
5014
5015 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
5016 error message syntax used by gcc-4.0.
5017
5018 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
5019
5020 * README: Mention m4 1.4.3. Remove obsolete advice about
5021 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
5022
5023 * bootstrap: Remove workaround for problem I encountered with
5024 gettext 0.14.1; it seems to be fixed now.
5025
5026 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
5027
5028 * NEWS: Version 2.0a.
5029
5030 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
5031 the previous change.
5032
5033 Various maintainer cleanups.
5034 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
5035 conftest*, for benefit of CVS commands run at the same time as
5036 "configure". Add build-aux, since "bootstrap" now creates it and
5037 its subfiles.
5038 * Makefile.cfg (move_if_change): Remove.
5039 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
5040 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
5041 (po_repo, do-po-update, po-update, wget_files, get-targets):
5042 (config.guess-url_prefix, config.sub-url_prefix):
5043 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
5044 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
5045 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
5046 Remove.
5047 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
5048 this is now the recommended name.
5049 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
5050 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
5051 ylwrap. These files now go into build-aux.
5052 * config/move-if-change: Remove.
5053 * config/prev-version.txt: Bump from 1.75 to 2.0.
5054
5055 * bootstrap: Add stdio-safer, unistd-safer modules.
5056 Remove m4/glibc2.m4 (introduced by latest gnulib, but
5057 we don't need it).
5058 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
5059 fopen-safer.c, stdio-safer.h, unistd-safer.h.
5060 * lib/subpipe.c: Include "unistd-safer.h".
5061 (create_subpipe): Make sure all the newly-created
5062 file descriptors are > 2, so that diagnostics don't
5063 get sent down them (which might cause Bison to hang, in theory).
5064 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
5065 * src/files.c (xfopen): Use fopen_safer, not fopen.
5066
5067 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
5068 yesterday's yacc.c fix.
5069
5070 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
5071
5072 * data/glr.c, data/lalr1.cc: Update copyright date.
5073
5074 Fix a destructor bug reported by Wolfgang Spraul in
5075 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
5076 * data/yacc.c (yyabortlab): Don't call destructor, and
5077 don't set yychar to EMPTY.
5078 (yyoverflowlab): Don't call destructor.
5079 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
5080 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
5081 since we no longer output the message "discarding lookahead token
5082 end of input ()".
5083
5084 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5085
5086 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
5087 fix a small glitch in debugging output.
5088 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
5089 after YY_SYMBOL_PRINT where needed.
5090
5091 (struct yyGLRState): Add some comments.
5092 (struct yySemanticOption): Add some comments.
5093 (union yyGLRStackItem): Add comment.
5094
5095 (yymergeOptionSets): Correct this to properly perform the union,
5096 avoiding infinite reported by Michael Rosien.
5097 Update comment.
5098
5099 * tests/glr-regression.at: Add test for GLR merging error reported
5100 by M. Rosien.
5101
5102 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
5103
5104 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
5105 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
5106 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
5107 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
5108 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
5109 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
5110 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
5111 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
5112 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
5113 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
5114 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
5115 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
5116 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
5117 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
5118 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
5119 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
5120 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
5121 src/derives.h, src/files.c, src/files.h, src/getargs.c,
5122 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
5123 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
5124 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
5125 src/output.h, src/parse-gram.c, src/parse-gram.h,
5126 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
5127 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
5128 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
5129 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
5130 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
5131 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
5132 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
5133 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
5134 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
5135 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
5136 tests/reduce.at, tests/regression.at, tests/sets.at,
5137 tests/synclines.at, tests/testsuite.at, tests/torture.at:
5138 Update FSF postal mail address.
5139
5140 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
5141
5142 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
5143 Problem reported by Ralf Menzel.
5144
5145 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
5146
5147 * tests/actions.at: Test that stack overflow invokes destructors.
5148 From Marcus Holland-Moritz.
5149 * data/yacc.c (yyerrlab): Move the code that destroys the stack
5150 from here....
5151 (yyreturn): to here. That way, destructors are called properly
5152 even if the stack overflows, or the user calls YYACCEPT or
5153 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
5154 (yyoverflowlab): Destroy the lookahead.
5155
5156 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
5157
5158 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
5159
5160 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
5161
5162 * NEWS: Bison-generated C parsers no longer quote literal strings
5163 associated with tokens.
5164 * src/output.c (prepare_symbols): Don't escape strings,
5165 since users don't want to see C escapes.
5166 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
5167 in diagnostics.
5168 * tests/input.at (Torturing the Scanner): Likewise.
5169 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
5170
5171 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
5172
5173 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
5174 the data size is known to be too small and we can't increase it.
5175 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
5176
5177 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
5178
5179 * src/parse-gram.y: Include quotearg.h.
5180 (string_as_id): Quote $1 before using it as a key, since the
5181 lexer no longer quotes it for us.
5182 (string_content): Don't strip quotes, since lexer no longer
5183 quotes it for us.
5184 * src/scan-gram.l: Include quotearg.h.
5185 ("\""): Omit quote.
5186 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
5187 a key, since the rest of the lexer doesn't quote it.
5188 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
5189 * tests/regression.at (Token definitions): Check for backslashes
5190 in token strings.
5191
5192 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
5193 (YYSIZE_T): Define to unsigned long int when using an older compiler.
5194 (yyparse): Revamp code to generate long syntax error message, to
5195 make it easier to translate, and to avoid problems with arithmetic
5196 overflow. Change "virtual memory" to "memory" in diagnostic, since
5197 we don't know whether the memory is virtual.
5198
5199 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
5200
5201 * NEWS: Bison-generated C parsers now use the _ macro to
5202 translate strings.
5203 * data/yacc.c (_) [!defined _]: New macro.
5204 All English strings wrapped inside this macro.
5205 * doc/bison.texinfo (Bison Parser): Document _.
5206 * po/POTFILES.in: Include src/parse-gram.c, since it now
5207 includes translateable strings that parse-gram.y doesn't.
5208
5209 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
5210
5211 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
5212 reverting the 2004-10-11 change to this function.
5213 (symbol_check_alias_consistency): Don't call symbol_type_set
5214 if the type name is already correct.
5215 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
5216
5217 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
5218
5219 * tests/regression.at (Token definitions): Don't use a token named
5220 c, as that generates a "#define c ..." that runs afoul of buggy
5221 stdlib.h that uses the identifier c as a member of struct
5222 drand48_data. Problem reported by Horst Wente.
5223
5224 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
5225
5226 * bootstrap: Change translation URL from
5227 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
5228 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
5229 redirection glitches. Problem reported by twlevo@xs4all.nl.
5230
5231 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
5232
5233 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
5234 after operands; POSIX says this isn't portable for the c99 command.
5235
5236 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
5237
5238 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
5239 immediately if a data overrun has occurred; this may help us track
5240 down what may be a spurious failure on MacOS.
5241
5242 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
5243
5244 Respond to problems reported by twlevo@xs4all.nl.
5245
5246 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
5247
5248 * src/vcg.h: Comment fix.
5249 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
5250 (G_CMAX): Change to -1 instead of INT_MAX.
5251
5252 * data/yacc.c (yyparse): Omit spaces before #line.
5253
5254 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
5255
5256 * src/tables.c (state_number_to_vector_number): Put it inside an
5257 "#if 0", since it's not currently used. Problem reported by
5258 Roland McGrath.
5259
5260 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
5261
5262 * src/output.c (escaped_output): Renamed from
5263 escaped_file_name_output, since we now use it for symbol tags as
5264 well. All uses changed.
5265 (symbol_destructors_output, symbol_printers_output):
5266 Escape symbol tags too.
5267 Problem reported by Matyas Forstner in
5268 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
5269
5270 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
5271 not needed.
5272 * src/output.c (user_actions_output, token_definitions_output,
5273 symbol_destructors_output, symbol_printers_output): Likewise.
5274 * src/reader.c (prologue_augment): Likewise.
5275 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
5276
5277 * src/vcg.c (output_edge): Don't quote linestyle arg.
5278 Problem reported by twlevo@xs4all.nl.
5279
5280 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
5281
5282 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
5283 example, reported by Derek M Jones. Also, make the example even
5284 more outrageous, to better illustrate how bad the problem is.
5285
5286 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
5287
5288 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
5289 putsym. Typo reported by Sebastian Piping.
5290
5291 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
5292
5293 * doc/bison.texinfo (Language and Grammar): some -> same
5294 (Epilogue): int he -> in the
5295 Typos reported by Sebastian Piping via Justin Pence.
5296
5297 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
5298
5299 * tests/glr-regression.at (Improper handling of embedded actions
5300 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
5301 embedded actions and $-N in GLR parsers", work around an Autoconf bug
5302 with dollar signs in test names.
5303 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
5304 for a similar reason.
5305
5306 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
5307
5308 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
5309 wants to redefine G_VIEW.
5310
5311 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
5312
5313 * src/vcg.c (get_view_str): Remove case for normal_view.
5314 Problem reported by twlevo@xs4all.nl.
5315
5316 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
5317
5318 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
5319 Problem reported by twlevo@xs4all.nl.
5320
5321 * doc/bison.texinfo: Change @dircategory from "GNU programming
5322 tools" to "Software development". Requested by Richard Stallman
5323 via Karl Berry.
5324
5325 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
5326
5327 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
5328 Problem reported by twlevo@xs4all.nl.
5329
5330 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
5331
5332 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
5333 keyword; it's not needed with modern compilers, and it doesn't
5334 affect correctness with older compilers. Suggested by
5335 twlevo@xs4all.nl.
5336
5337 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
5338
5339 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
5340 gcc -Wswitch-default.
5341 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
5342 * data/yacc.c (yyparse): Likewise.
5343
5344 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
5345
5346 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
5347 already. Let config.h define any nonstandard values.
5348
5349 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
5350
5351 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
5352 for the benefit of slower hosts. Problem reported by
5353 Nelson H. F. Beebe.
5354
5355 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
5356
5357 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
5358 being defined and not used.
5359 * data/lalr1.cc (yyparse): Likewise.
5360 Use "if (false)" rather than "if (0)".
5361
5362 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
5363
5364 * TODO: Mention that we should allow NUL bytes in tokens.
5365
5366 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
5367
5368 * src/scan-skel.l (<<EOF>>): Don't close standard output.
5369 Problem reported by Hans Aberg.
5370
5371 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
5372
5373 * src/getargs.c (version): Happy new year; update overall
5374 program copyright date from 2004 to 2005.
5375
5376 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
5377 Problem reported by Hans Aberg.
5378 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
5379 (Output file names.): Add a test for the case when standard output
5380 is closed.
5381
5382 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
5383
5384 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
5385 to fix an oversight in the Bison 2.0 manual.
5386
5387 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
5388
5389 * NEWS: Version 2.0. Reformat the existing news items since
5390 1.875, so that related items are grouped together.
5391 * configure.ac (AC_INIT): Bump version to 2.0.
5392 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
5393
5394 * tests/torture.at (Exploding the Stack Size with Alloca): Set
5395 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
5396 otherwise, we're not testing alloca. Unfortunately there's no
5397 simple way to consult HAVE_ALLOCA here.
5398
5399 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
5400 for yymsg, too.
5401
5402 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
5403 hand. This avoids a warning about comparing int to size_t when
5404 GCC warnings are enabled.
5405
5406 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
5407
5408 * NEWS: Bison-generated parsers no longer default to using the
5409 alloca function (when available) to extend the parser stack, due
5410 to widespread problems in unchecked stack-overflow detection.
5411 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
5412 responsibility to set it to a positive value. This lets the user
5413 specify a value that is not a preprocessor constant.
5414 * data/yacc.c (YYMAXDEPTH): Likewise.
5415 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
5416 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
5417 to be a compile-time constant. However, explain the constraints on it.
5418 Also, explain the constraints on YYINITDEPTH.
5419 (Table of Symbols): Explain that alloca is no longer the default.
5420 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
5421 to 1.
5422
5423 * doc/bison.texinfo (Location Default Action): Mention that n must
5424 be zero when k is zero. Suggested by Frank Heckenbach.
5425
5426 2004-12-22 Akim Demaille <akim@epita.fr>
5427
5428 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
5429 (parser::state_type, parser::semantic_type, parser::location_type):
5430 Private, not public.
5431 (parser::parse): Return ints, not bool.
5432 Returning a bool introduces a problem: 0 corresponds to false, and
5433 it seems weird to return false on success. Returning true changes
5434 the conventions for yyparse.
5435 Alternatively we could return void and send an exception.
5436 There is no clear consensus (yet?).
5437 (state_stack, semantic_stack, location_stack): Rename as...
5438 (state_stack_type, semantic_stack_type, location_stack_type): these.
5439 Private, not public.
5440 * tests/c++.at: New.
5441 * tests/testsuite.at, tests/Makefile.am: Adjust.
5442
5443 2004-12-21 Akim Demaille <akim@epita.fr>
5444
5445 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
5446
5447 2004-12-21 Akim Demaille <akim@epita.fr>
5448
5449 Don't impose std::string for filenames.
5450
5451 * data/lalr1.cc (b4_filename_type): New.
5452 (position::filename): Use it.
5453 (parser.hh): Move the inclusion of stack.hh and location.hh below
5454 the user code, so that needed headers for the filename type can be
5455 included first.
5456 Forward declare them before the user code.
5457 * tests/Makefile.am (check-local, installcheck-local): Pass
5458 TESTSUITEFLAGS to the TESTSUITE.
5459
5460 2004-12-20 Akim Demaille <akim@epita.fr>
5461
5462 Use more STL like names: my_class instead of MyClass.
5463
5464 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
5465 (SemanticStack, SemanticType, StateStack, StateType)
5466 (TokenNumberType, Stack, Slice, Traits, Parser::location)
5467 (Parser::value): Rename as...
5468 (location_stack, location_type, rhs_number_type, semantic_stack)
5469 (semantic_type, state_stack, state_type, token_number_type, stack)
5470 (slice, traits, parser::yylloc, parser::yylval): these.
5471
5472 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
5473
5474 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
5475
5476 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
5477 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
5478
5479 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
5480
5481 Remove uses of 'short int' and 'unsigned short int'. This raises
5482 some arbitrary limits. It uses more memory but nowadays that's
5483 not much of an issue.
5484
5485 This change does not affect the generated parsers; that's a different
5486 task, as some users will want to conserve memory there.
5487
5488 Ideally we should use size_t to represent all object counts, and
5489 something like ptrdiff_t to represent signed differences of object
5490 counts; but that will require more code-cleanup than I have the
5491 time to do right now.
5492
5493 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
5494 Use size_t, not int or short int, to count objects.
5495 * src/closure.c (nritemset, closure): Likewise.
5496 * src/closure.h (nritemset, closure): Likewise.
5497 * src/nullable.c (nullable_compute): Likewise.
5498 * src/print.c (print_core): Likewise.
5499 * src/print_graph.c (print_core): Likewise.
5500 * src/state.c (state_compare, state_hash): Likewise.
5501 * src/state.h (struct state): Likewise.
5502 * src/tables.c (default_goto, goto_actions): Likewise.
5503
5504 * src/gram.h (rule_number, rule): Use int, not short int.
5505 * src/output.c (prepare_rules): Likewise.
5506 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
5507 errs, reductions): Likewise.
5508 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
5509 Likewise.
5510 * src/tables.c (vector_number, tally, action_number,
5511 ACTION_NUMBER_MINIMUM): Likewise.
5512 * src/output.c (muscle_insert_short_int_table): Remove.
5513
5514 2004-12-17 Akim Demaille <akim@epita.fr>
5515
5516 * data/lalr1.cc: Extensive Doxygenation.
5517 (error_): Rename as...
5518 (error): this, since it is visible to the user.
5519 Adjust callers.
5520 (Parser::message): Now an automatic variable from...
5521 (Parser::yyreport_syntax_error_): here.
5522 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
5523 Parser::error.
5524 * tests/input.at: Escape $.
5525
5526 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
5527
5528 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
5529 Parenthesize rhs to avoid obscure problems with mistakes like
5530 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
5531 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5532 b4_rhs_location): Likewise.
5533 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5534 b4_rhs_location): Likewise.
5535
5536 2004-12-16 Akim Demaille <akim@epita.fr>
5537
5538 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
5539 yacc.c: be sure to stay within yycheck_.
5540 * tests/actions.at: Re-enable C++ tests.
5541
5542 2004-12-16 Akim Demaille <akim@epita.fr>
5543
5544 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
5545 real.
5546
5547 2004-12-16 Akim Demaille <akim@epita.fr>
5548
5549 Use #define to handle the %name-prefix.
5550
5551 * data/glr.c, data/yacc.c: Comment changes.
5552 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
5553 so that one can refer to yylex in the parser file, and have it
5554 renamed, as is the case with other skeletons.
5555
5556 2004-12-16 Akim Demaille <akim@epita.fr>
5557
5558 Move lalr1.cc internals into yy*.
5559
5560 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
5561 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
5562 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
5563 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
5564 (empty_, final_, terror_, errcode_, ntokens_)
5565 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
5566 (looka_, ilooka_, error_range_, nerrs_):
5567 Rename as...
5568 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
5569 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
5570 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
5571 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
5572 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
5573 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
5574 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
5575 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
5576 these.
5577
5578 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
5579
5580 Fix some problems reported by twlevo at xs4all.
5581 * src/symtab.c (symbol_new): Report an error if the input grammar
5582 contains too many symbols. This is better than calling abort() later.
5583 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
5584 (struct node, struct graph):
5585 Rename member expand to stretch. All uses changed.
5586 (struct graph): Remove member layoutalgorithm. All uses removed.
5587 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
5588 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
5589 All uses changed.
5590 (N_STRETCH): Rename from N_EXPAND. All uses changed.
5591
5592 2004-12-15 Akim Demaille <akim@epita.fr>
5593
5594 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
5595 Add more Doxygen comments.
5596 (symprint_, stack_print_, reduce_print_, destruct_, pop)
5597 (report_syntax_error_, translate_): Rename as...
5598 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
5599 (yypop_, yyreport_syntax_error_, yytranslate_): this.
5600
5601 2004-12-15 Akim Demaille <akim@epita.fr>
5602
5603 * data/lalr1.cc (lex_): Rename as...
5604 (yylex_): this.
5605 Move the trace here.
5606 Take the %name-prefix into account.
5607 Reported by Alexandre Duret-Lutz.
5608
5609 2004-12-15 Akim Demaille <akim@epita.fr>
5610
5611 Simplify the C++ parser constructor.
5612
5613 * data/lalr1.cc (debug_): Rename as...
5614 (yydebug_): so that the parser's internals are always in the yy*
5615 pseudo namespace.
5616 Adjust uses.
5617 (b4_parse_param_decl): Remove the leading comma as it is now only
5618 called as unique argument list.
5619 (Parser::Parser): Remove the constructor accepting a location and
5620 an initial debugging level.
5621 Remove from the other ctor the argument for the debugging level.
5622 (debug_level_type, debug_level, set_debug_level): New.
5623
5624 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
5625 constructor calls.
5626
5627 2004-12-15 Akim Demaille <akim@epita.fr>
5628
5629 Remove b4_root related material: failure experiment
5630 (which goal was to allow to derive from a class).
5631
5632 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
5633 definitions and uses.
5634
5635 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
5636
5637 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
5638 not 2, since it's not portable to subtract 1 from the start of an
5639 array. The new item 0 is never set or used. All uses changed.
5640
5641 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
5642 the default definition of YYLLOC_DEFAULT. Problem reported
5643 by Frank Heckenbach.
5644
5645 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
5646
5647 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
5648 the normal case and one for the error case. Just use the
5649 first one uniformly. Problem reported by Frank Heckenbach.
5650 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
5651 use exactly the same macro in both places.
5652 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
5653 so that the normal-case YYRHSLOC works for the error case too.
5654 All uses changed.
5655 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
5656 (YYLLOC_DEFAULT): Use the same macro as glr.c.
5657 * doc/bison.texinfo (Location Default Action): Don't claim that
5658 we have an array of locations. Use the same macro for both glr
5659 and lalr parsers. Mention YYRHSLOC. Mention what happens when
5660 the index is 0.
5661
5662 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5663
5664 * HACKING: Update email addresses to send announcements to.
5665
5666 * configure.ac (AC_INIT): Bump version to 1.875f.
5667
5668 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5669
5670 * NEWS: Version 1.875e.
5671 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
5672
5673 * src/scan-skel.l: Include "complain.h", for "fatal".
5674
5675 * src/relation.h (relation_print, relation_digraph):
5676 Relation sizes are of type relation_node, not size_t (this is
5677 merely a doc fix, since the two types are equivalent).
5678 (relation_transpose): Relation sizes are of type relation_node,
5679 not int.
5680 * src/relation.c: Likewise.
5681 (top, infinity): Now of type relation_node, not int.
5682 (traverse, relation_transpose): Use relation_node, not int.
5683
5684 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
5685 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
5686 (yyparse): Remove unused local introduced in 2004-10-25 patch.
5687
5688 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
5689 specifying whether the test should be skipped. Use it tp
5690 specify that the [%defines %skeleton "lalr1.cc"] tests currently
5691 fail on some hosts, and should be skipped.
5692
5693 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
5694
5695 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
5696 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
5697 unless otherwise specified below.
5698
5699 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
5700 to allocate kernel_base, kernel_items, kernel_size, since
5701 they needn't be initialized to 0.
5702 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
5703 * src/closure.c (new_closure): Likewise, for itemset.
5704 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
5705 * src/lalr.c (set_goto_map): Likewise, for temp_map.
5706 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
5707 (build_relations): Likewise for edge, states1, includes.
5708 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
5709 * src/reader.c (packgram): Likewise, for ritem, rules.
5710 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
5711 * src/relation.c (relation_digraph): Likewise for VERTICES.
5712 (relation_transpose): Likewise for new_R, end_R.
5713 * src/symtab.c (symbols_token_translations_init): Likewise for
5714 token_translations.
5715 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
5716 (token_actions): Likewise for yydefact, actrow, conflrow,
5717 conflict_list.
5718 (save_column): Likewise for froms[symno], tos[symno].
5719 (goto_actions): Likewise for state_count.
5720 (pack_table): Likewise for base, pos, check.
5721 (tables_generate): Likewise for width.
5722
5723 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
5724 for initial core. Just have a separate core, so we needn't worry
5725 about whether kernel_size and kernel_base are initialized.
5726
5727 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
5728 kernel_size, kernel_items): Remove unnecessary initialization.
5729 * src/conflicts.c (conflicts): Likewise.
5730 * src/derives.c (derives): Likewise.
5731 * src/muscle_tablc (muscle_insert): Likewise.
5732 * src/relation.c (relation_digraph): Likewise.
5733 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
5734 conflrow, conflict_table, conflict_list, table, check):
5735 Likewise.
5736
5737 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
5738 This is because all callers pass unsigned int.
5739 * src/closure.h (new_closure): Likewise.
5740
5741 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
5742 (build_relations): Initialize includes[i] in all cases.
5743 * src/reader.c (packgram): Always initialize rules[ruleno].prec
5744 and rules[ruleno].precsym. Initialize members in order.
5745 * src/relation.c (relation_transpose): Always initialize new_R[i]
5746 and end_R[i].
5747 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
5748
5749 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
5750 conflict_list[0] was always 0, but now it isn't initialized.
5751
5752 * src/table.c (table_grow): When conflict_table grew, the grown
5753 area wasn't cleared. Fix this.
5754
5755 * lib/.cvsignore: Add strdup.c, strdup.h.
5756 * m4/.cvsignore: Add strdup.m4.
5757
5758 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
5759
5760 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
5761 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
5762 GOTO_NUMBER_MAXIMUM, since we occasionally compute
5763 ngotos + 1 without checking for overflow.
5764 (build_relations): Use END_NODE, not -1, to denote end of edges.
5765 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
5766 build_relations): Use goto_number, not int, for goto numbers.
5767 * src/tables.c (save_column, default_goto): Likewise.
5768
5769 2004-11-23 Akim Demaille <akim@epita.fr>
5770
5771 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
5772 of #defining from yystype.
5773 Don't typedef yystype, C++ does not need it.
5774 This lets it possible to forward declare it as union.
5775
5776 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
5777
5778 * bootstrap (gnulib_modules): Add extensions.
5779 Problem reported by Jim Meyering.
5780
5781 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
5782
5783 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
5784 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
5785 src/system.h, src/tables.c: XFREE -> free, to accommodate
5786 recent change to gnulib xalloc.h.
5787 Problem reported by Jim Meyering.
5788
5789 2004-11-17 Akim Demaille <akim@epita.fr>
5790
5791 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
5792
5793 2004-11-17 Akim Demaille <akim@epita.fr>,
5794 Alexandre Duret-Lutz <adl@gnu.org>
5795
5796 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
5797 changes.
5798 (YYCDEBUG): Adjust.
5799 Use it instead of cdebug_.
5800 (Parser::debug_stream, Parser::set_debug_stream): New.
5801 (Parser::symprint_): Define cdebug_ for temporary backward
5802 compatibility.
5803 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
5804 debug_stream ().
5805
5806 2004-11-17 Akim Demaille <akim@epita.fr>
5807
5808 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
5809 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
5810 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
5811 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
5812
5813 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
5814
5815 * data/glr.c (yyloc_default): Remove; not used.
5816 Problem reported by Frank Heckenbach.
5817
5818 2004-10-25 Akim Demaille <akim@epita.fr>
5819
5820 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
5821 Introduce another definition to address simple location arrays.
5822 (yyGLRStack): New member: yyerror_range.
5823 (yyrecoverSyntaxError, yyparse): Update it.
5824 (yyrecoverSyntaxError): Use it when shifting the error token to
5825 have an accurate range, equivalent to the one computed by both
5826 yacc.c and lalr1.cc.
5827 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
5828 that column numbers start at column 0, as per GNU Coding
5829 Standards, the others tests, and the doc.
5830 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
5831 Adjust to the above change (first column is 0).
5832 And adjust the location of the "<error>", now covering the whole
5833 line.
5834
5835 2004-10-22 Akim Demaille <akim@epita.fr>
5836 and Paul Eggert <eggert@cs.ucla.edu>
5837
5838 Remove some arbitrary limits on goto numbers and relations.
5839 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
5840 initial values, since they're never used.
5841 (set_goto_map): ngotos is now unsigned, so test for overflow
5842 by seeing whether it wraps around to zero.
5843 * src/lalr.h (goto_number): Now size_t, not short int.
5844 (GOTO_NUMBER_MAXIMUM): Remove.
5845 * src/relation.c (relation_print, traverse, relation_transpose):
5846 Check for END_NODE rather than looking at sign.
5847 * src/relation.h (END_NODE): New macro.
5848 (relation_node): Now size_t, not short int.
5849
5850 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
5851
5852 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
5853 keyword, not an identifier. Problem reported by Baron Schwartz in
5854 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
5855
5856 2004-10-11 Akim Demaille <akim@epita.fr>
5857
5858 * src/symtab.c (symbol_check_alias_consistency): Also check
5859 type names, destructors, and printers.
5860 Reported by Alexandre Duret-Lutz.
5861 Recode the handling of associativity and precedence in terms
5862 of symbol_precedence_set.
5863 Accept no redeclaration at all, not even equal to the previous
5864 value.
5865 (redeclaration): New.
5866 Use it to factor redeclaration complaints.
5867 (symbol_make_alias): Don't set the type of the alias, let
5868 symbol_check_alias_consistency do it as for other features.
5869 * src/symtab.h (symbol): Add new member prec_location, and
5870 type_location.
5871 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
5872 * tests/input.at (Incompatible Aliases): New.
5873
5874 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
5875
5876 .cvsignore fixes to accommodate gnulib changes,
5877 and the practice of naming build directories "_build".
5878 * .cvsignore: Add "_*". Sort.
5879 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
5880 * m4/.cvsignore: Add "*_gl.m4".
5881
5882 2004-10-06 Akim Demaille <akim@epita.fr>
5883
5884 * src/parse-gram.y (add_param): Fix the truncation of trailing
5885 spaces.
5886
5887 2004-10-05 Akim Demaille <akim@epita.fr>
5888
5889 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
5890 whether the reducion was empty or not. This leaves room to
5891 improve the use of YYLLOC_DEFAULT in such a case.
5892 lalr1.cc is still experimental, so changing this is acceptable.
5893 And finally, there are probably not many users who changed the
5894 handling of locations in GLR, so changing is admissible too.
5895
5896 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
5897 empty reduction, set @$ to an empty location ending the previously
5898 stacked symbol.
5899 Adjust uses to make sure the code is triggered on empty
5900 reductions.
5901 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
5902 expected output: empty reductions have empty locations.
5903
5904 2004-09-29 Akim Demaille <akim@epita.fr>
5905
5906 * data/lalr1.cc: Move towards a more standard C++ coding style
5907 for templates: Class < T > -> Class<T>.
5908
5909 2004-09-29 Akim Demaille <akim@epita.fr>
5910
5911 * data/lalr1.cc: Reinstall the former ctor, for sake of
5912 compatibility, but warn it will be removed.
5913 Move towards a more standard C++ coding style (i.e., type *var ->
5914 type* var).
5915
5916 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
5917
5918 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
5919 since it's less likely to work if NULs are involved in the future.
5920
5921 2004-09-27 Akim Demaille <akim@epita.fr>
5922
5923 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
5924
5925 2004-09-27 Akim Demaille <akim@epita.fr>
5926
5927 * data/lalr1.cc (b4_parse_param_decl_1): New.
5928 (b4_parse_param_decl): Use it to have different names between attribute
5929 and argument names.
5930 (b4_cc_constructor_call): Likewise.
5931
5932 2004-09-24 Akim Demaille <akim@epita.fr>
5933
5934 * src/parse-gram.y (add_param): Strip the leading and trailing
5935 blanks from a formal argument declaration.
5936 (YY_LOCATION_PRINT): New.
5937
5938 2004-09-24 Akim Demaille <akim@epita.fr>
5939
5940 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
5941 after the location.
5942
5943 2004-09-24 Akim Demaille <akim@epita.fr>
5944
5945 * doc/bison.texinfo (Table of Symbols): Sort.
5946
5947 2004-09-21 Akim Demaille <akim@epita.fr>
5948
5949 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
5950 the useless parentheses.
5951 Suggested by Paul Eggert.
5952
5953 2004-09-20 Akim Demaille <akim@epita.fr>
5954
5955 Let the initial-action act on the look-ahead, and use it for the
5956 "initial push" (corresponding to an hypothetical beginning-of-file).
5957 And let lalr1.cc honor %initial-action.
5958
5959 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
5960 example.
5961 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
5962 (Parser::Parser): Remove the ctor that used to initialize it.
5963 (Parser::parse): Like in the other skeletons, issue the "starting
5964 parse" message before any action.
5965 Honor %initial-action.
5966 Initialize the stacks with the lookahead.
5967 * data/yacc.c: Let $$ and @$ in %initial-action designate the
5968 look-ahead.
5969 Push them in the stacks.
5970 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
5971
5972 2004-09-20 Akim Demaille <akim@epita.fr>
5973
5974 * doc/bison.texinfo (Initial Action Decl): New.
5975
5976 2004-09-20 Akim Demaille <akim@epita.fr>
5977
5978 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
5979 clearer criterion to define it.
5980 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
5981 When reducing on an empty RHS, use the latest stacked location as
5982 location.
5983 yylloc is not always available.
5984 * data/glr.c: Likewise.
5985 Also, honor initial-actions.
5986
5987 2004-09-20 Akim Demaille <akim@epita.fr>
5988
5989 * data/yacc.c (YY_LOCATION_PRINT): New.
5990 Define when we know YYLTYPE's structure, i.e., when the default
5991 YYLLOC_DEFAULT is used.
5992 * data/c.m4 (b4_yysymprint_generate): Use it.
5993 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
5994 value of the result.
5995 (error_start_): Replace with...
5996 (error_range_): this location array.
5997 This allows to replace code relying on the implementation of
5998 locations by portable code.
5999 * data/yacc.c (yylerrsp): Replace with...
6000 (yyerror_range): this.
6001 Every time a token is popped, update yyerror_range[0], to have an
6002 accurate location for the error token.
6003 * data/glr.c (YY_LOCATION_PRINT): New.
6004 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
6005 deference a pointer.
6006 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
6007 report the location in %printers.
6008
6009 * src/scan-skel.l: Instead of abort, report error messages to ease
6010 understanding skeleton scanning failures.
6011
6012 2004-09-16 Akim Demaille <akim@epita.fr>
6013
6014 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
6015 (iterator, const_iterator): these, to be more in the C++ spirit.
6016 Also, return reverse iterators so that when displaying the stack
6017 we display its bottom first.
6018 (Parser::stack_print_, Parser::reduce_print_): Match the messages
6019 from yacc.c.
6020 We should probably use vector here though.
6021
6022 2004-09-16 Akim Demaille <akim@epita.fr>
6023
6024 Have more complete shift traces.
6025
6026 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
6027 to report Shifts instead of ad hoc YYDPRINTF invocations,
6028 including for the error token.
6029 * data/lalr1.cc (symprint_): Output the location.
6030 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
6031 output the location within the %printer.
6032 Activate GLR tests, at least to make sure they compile properly.
6033 They still don't pass though.
6034 * tests/calc.at: Adjust expect verbose output, since now "Entering
6035 state..." is on a different line than the "Shifting" message.
6036
6037 2004-09-08 Akim Demaille <akim@epita.fr>
6038
6039 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
6040 Bison directive from the Bison file to the invocation of this
6041 macro, so that these directives are passed to
6042 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
6043 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
6044 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
6045 the extra Bison directives instead of the whole series.
6046 Change the grammar so that there are recoverable errors, and
6047 unrecoverable errors. Now we can have the parser give up before
6048 consuming the whole input. As a result we now can observe that
6049 the lookahead is freed when needed.
6050 Change the parser source to parse argv[1] instead of a hard coded
6051 string.
6052 Simplify yylex, and give a value and location to EOF.
6053 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
6054 passed directives already coded in the file.
6055 Add some tests to check the location of "error".
6056 For some tests, the C++ parser is correct, and not yacc.c.
6057 For other tests, they provide different, but unsatisfying, values,
6058 so keep the C++ value so that at least one parser is "correct"
6059 according to the test suite.
6060 (Actions after errors): Remove, this is subsumed by the
6061 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
6062
6063 2004-09-06 Akim Demaille <akim@epita.fr>
6064
6065 * data/lalr1.cc: Adjust the indentation of the labels.
6066 (Parser::pop): New.
6067 Use it.
6068
6069 2004-09-06 Akim Demaille <akim@epita.fr>
6070
6071 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
6072 argument, an informative message.
6073 Call YY_SYMBOL_PRINT.
6074 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
6075 * data/lalr1.cc (destruct_): Likewise.
6076 In addition, no longer depend on b4_yysymprint_generate and
6077 b4_yydestruct_generate to generate these functions, do it "by
6078 hand".
6079
6080 2004-09-03 Akim Demaille <akim@epita.fr>
6081
6082 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
6083 invoked, yydestruct the lookahead.
6084 * tests/calc.at (Calculator $1): Update the expected lengths of
6085 traces: there is an added line for the discarded lookahead.
6086 * doc/bison.texinfo (Destructor Decl): Some rewording.
6087 Define "discarded" symbols.
6088
6089 2004-09-02 Akim Demaille <akim@epita.fr>
6090
6091 * data/lalr1.cc (translate_, destruct_): No reason to be static.
6092
6093 2004-09-02 Akim Demaille <akim@epita.fr>
6094
6095 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
6096 (YYDSYMPRINTF): Rename as...
6097 (YY_SYMBOL_PRINT): this.
6098 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
6099 two.
6100 Use it instead of direct symprint_ calls.
6101 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
6102 one.
6103
6104 2004-09-02 Akim Demaille <akim@epita.fr>
6105
6106 * data/lalr1.cc (b4_yysymprint_generate): New.
6107 (symprint_): New member function, defined when YYDEBUG.
6108 Use it consistently instead of token/nterm debugging output by
6109 hand.
6110 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
6111 %printer calls to use cdebug_ when using lalr1.cc.
6112
6113 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
6114
6115 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
6116 with #ifdef YYDEBUG.
6117
6118 2004-08-26 Akim Demaille <akim@epita.fr>
6119
6120 * doc/bison.texinfo (Implementing Loops): Rename as...
6121 (Implementing Gotos/Loops): this.
6122
6123 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
6124
6125 Adjust to latest gnulib.
6126 * bootstrap (gnulib_modules): Add xalloc-die.
6127 Set LC_ALL=C so that file names sort consistently.
6128 Prefer the gnulib copies of gettext.m4, glibc21.m4,
6129 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
6130 uintmax_t.m4, ulonglong.m4.
6131 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
6132 po.m4 since we are now using _gl.m4 instead.
6133
6134 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
6135
6136 * src/scan-action.l: Remove. Scanning of semantic actions is
6137 handled in scan-gram.l.
6138
6139 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
6140
6141 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
6142
6143 * src/location.h (struct): The file member is a uniqstr.
6144 (equal_boundaries): Use UNIQSTR_EQ for comparison.
6145
6146 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
6147
6148 Fix bug with non-%union parsers that have printers or destructors,
6149 which led to a Bison core dump. Reported by Peter Fales in
6150 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
6151
6152 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
6153 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
6154 not to our own type.
6155 * src/output.c (symbol_destructors_output, symbol_printers_output):
6156 Don't assume %union.
6157 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
6158 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
6159 UNION-FLAG. All callers changed.
6160 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
6161 Use type char, not unsigned int, when declaring an array of char;
6162 this lets us remove a cast.
6163 (Printers and Destructors): Add non-%union test cases.
6164
6165 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
6166
6167 * doc/bison.texinfo: Minor editorial changes, mostly to the new
6168 GLR writeups. E.g., avoid frenchspacing and the future tense,
6169 change "lookahead" to "look-ahead", and change "wrt" to "with
6170 respect to".
6171
6172 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6173
6174 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
6175 New sections, split off from the GLR Parsers section. Put the new
6176 Simple GLR Parser near the start of the GLR section, for clarity.
6177 Rewrite connective text.
6178
6179 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
6180
6181 * doc/bison.texinfo (Simple GLR Parsers): New section.
6182
6183 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
6184
6185 * NEWS, TODO, doc/bison.texinfo:
6186 Use "look-ahead" instead of "lookahead", to be consistent.
6187 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
6188 while we're fixing "look-ahead".
6189 * src/conflicts.c (shift_set): Renamed from shiftset.
6190 (look_ahead_set): Renamed from lookaheadset.
6191 * src/print.c: Likewise.
6192 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
6193 name for "lookahead".
6194 (report_types, usage): Likewise.
6195 * src/getargs.h (report_look_ahead_tokens): Renamed from
6196 report_lookaheads.
6197 * src/lalr.c (compute_look_ahead_tokens): Renamed from
6198 compute_lookaheads.
6199 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
6200 (look_ahead_tokens_print): Renamed from lookaheads_print.
6201 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
6202 state_rule_lookaheads_print.
6203 * src/state.h: Likewise.
6204 (reductions.look_ahead_tokens): Renamed from lookaheads.
6205 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
6206 AT_DATA_LOOKAHEADS_GRAMMAR.
6207
6208 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
6209
6210 * README: Update location of patched M4 distribution.
6211
6212 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
6213
6214 Don't assume the C++ compiler takes the same arguments as the C compiler
6215 (trivial change).
6216 * configure.ac (O0CXXFLAGS): New var.
6217 * tests/atlocal.in (CXXFLAGS): Use it.
6218
6219 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
6220
6221 Fix some "make check" problems with C++ reported by
6222 Albert Chin-A-Young for Tru64 C++ in this thread:
6223 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
6224
6225 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
6226 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6227 Output to a .cc file for C++, not to a .c file.
6228 * tests/calc.at (AT_CHECK_CALC): Likewise.
6229 * tests/regression.at (AT_CHECK_DANCER): Likewise.
6230 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
6231
6232 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
6233
6234 * tests/calc.at, tests/actions.at: Workaround for SGI
6235 C++ compiler. (trivial change)
6236
6237 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
6238
6239 Spent a few hours checking out which prerequisite versions the
6240 current sources actually require. I went all the way back to
6241 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
6242 a seemingly endless set of combinations of versions more recent
6243 than that. The bottom line is that the current sources require
6244 fairly recent versions of the build tools, and it'll be some work
6245 to change this.
6246 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
6247 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
6248 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
6249 Add comments explaining why those particular versions are
6250 currently needed.
6251
6252 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
6253 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
6254 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
6255
6256 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
6257 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
6258
6259 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
6260
6261 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
6262 0.11.5. Suggested by Bruno Haible.
6263 * bootstrap: Remove gettext version checking.
6264
6265 * doc/bison.texinfo (Decl Summary): Also mention that %union
6266 can depend on prerequisite types. Problem reported by Tim
6267 Van Holder.
6268
6269 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
6270
6271 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
6272 * README-alpha: Don't tell people not to package this.
6273
6274 * bootstrap: Don't assume $(...) works; use `...` instead.
6275 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
6276 gettext better.
6277
6278 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
6279 put into the -d output file, and mention what to do if YYSTYPE is
6280 defined as a macro.
6281
6282 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
6283
6284 Undo change made earlier today: it caused autopoint to not bring
6285 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
6286 autopoint's.
6287
6288 * bootstrap: Check that gettext version matches what's in
6289 configure.ac. Warn users to ignore robots.txt ERROR 404.
6290 * bootstrap: Undo today's earlier change (logged below).
6291 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
6292
6293 The gettext version checking is causing more trouble than it's
6294 curing; remove it. Problem reported by Paul Hilfinger.
6295
6296 * bootstrap: Issue a warning that one can expect a message
6297 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
6298 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
6299
6300 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
6301
6302 Ensure that the C++ compiler used for testing actually works on a
6303 simple test program; if not, skip the C++-related tests. Problem
6304 reported by Vin Shelton in:
6305 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
6306
6307 * m4/cxx.m4: New file.
6308 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
6309 * tests/atlocal.in (BISON_CXX_WORKS): Add.
6310 * tests/local.at (AT_COMPILE_CXX): Use it.
6311
6312 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
6313
6314 * data/glr.c (yylloc): Output this macro even if locations are not
6315 being generated, as the GLR parser needs it even in that case.
6316 Problem reported by Troy A. Johnson
6317 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
6318
6319 * configure.ac (AC_INIT): Update to 1.875e.
6320
6321 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
6322
6323 * NEWS: Version 1.875d.
6324 * configure.ac (AC_INIT): Likewise.
6325 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
6326
6327 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
6328 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
6329 lalr1.cc runs afoul of the first, and the last two are no longer
6330 supported by GCC 3.4.0.
6331 * README: Mention GNU m4 1.4 or later; mention m4 patches.
6332 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
6333
6334 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
6335
6336 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
6337 unsigned int, for compatibility with latest gnulib hash module.
6338 * src/state.c (state_hash, state_hasher): Likewise.
6339 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
6340 * src/uniqstr.c (hash_uniqstr): Likewise.
6341
6342 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
6343
6344 * NEWS: Unescaped newlines are no longer allowed in char & strings.
6345
6346 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
6347 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
6348 character and string literals.
6349 (unexpected_end): New function.
6350 (unexpected_eof): Use it.
6351 (unexpected_newline): New function.
6352 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
6353 actions.
6354
6355 * NEWS: Document %expect-rr.
6356
6357 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
6358 Fix typo by replacing $1 with $option.
6359 Remove more 'intl'-related files.
6360 Don't DEFUN AM_INTL_SUBDIR twice.
6361
6362 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
6363 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
6364 strtoul.c.
6365 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
6366 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
6367 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
6368 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
6369 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
6370 * src/.cvsignore: Add *.output.
6371
6372 * src/parse-gram.y: Put copyright notice inside %{ %} so it
6373 gets copied to the output file.
6374
6375 2004-04-28 Paul Eggert <eggert@twinsun.com>
6376
6377 Get files from the gnulib and po repositories, instead of relying
6378 on them being in our CVS. Upgrade to latest versions of gnulib
6379 and Automake.
6380
6381 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
6382 * bootstrap: Bootstrap from gnulib and po repositories.
6383 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
6384 * README-cvs: Document these changes. Remove version numbers from
6385 mentions of build tools, since they change so often. Mention Flex.
6386
6387 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
6388 (gl_USE_SYSTEM_EXTENSIONS): Add.
6389 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
6390 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
6391 does this for us.
6392 (AC_ISC_POSIX): Remove; we no longer support this
6393 ancient OS, as it gets in the way of latest Autoconf & gnulib.
6394 (AC_HEADER_STDC): Remove: we now assume C89 or better.
6395 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
6396 Do not check for C89 headers, except for locale.h which is used
6397 by the Yacc library and must port to K&R hosts.
6398 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
6399 Do not check for C89 functions, except for setlocale which is
6400 used by the Yacc library.
6401 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
6402 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
6403 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
6404 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
6405 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
6406 AM_GNU_GETTEXT): Remove; now done by:
6407 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
6408 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
6409 for us.
6410
6411 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
6412 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
6413 Define to empty, as gnulib.mk will do the rest for us.
6414 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
6415 for us.
6416 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
6417 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
6418
6419 * src/files.c: Include gnulib's xstrndup.h.
6420
6421 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
6422 (REALLOC): Use xnrealloc, for likewise.
6423 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
6424 (strnlen, memrchr): Remove decls; functions no longer used.
6425 Include <stpcpy.h>.
6426
6427 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
6428 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
6429 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
6430 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
6431 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
6432 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
6433 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
6434 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
6435 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
6436 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
6437 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
6438 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
6439 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
6440 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
6441 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
6442 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
6443 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
6444 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
6445 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
6446 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
6447 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
6448 Remove, as these files are now generated automatically
6449 by bootstrap or automake.
6450
6451 * po/ChangeLog: Remove: all but one entry was a duplicate
6452 of this file, and I moved that 2000-11-02 entry here.
6453
6454 * config/.cvsignore: Add Makefile, depcomp, install-sh.
6455 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
6456 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
6457 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
6458 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
6459 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
6460 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
6461 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
6462 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
6463 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
6464 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
6465 xstrndup.h.
6466 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
6467 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
6468 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
6469 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
6470 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
6471 * src/.cvsignore: Remove *_.c.
6472
6473
6474 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
6475 support it. (The latest stable gzip doesn't.)
6476
6477 2004-04-27 Paul Eggert <eggert@twinsun.com>
6478
6479 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
6480 case, as stos_ is now used by destructors due to the 2004-02-09
6481 change.
6482
6483 Remove more K&R C support.
6484 * lib/libiberty.y (PARAMS): Remove. All uses removed.
6485 * lib/subpipe.c (errno): Remove decl.
6486 Include <stdlib.h> unconditionally.
6487 (EXIT_FAILURE): Remove macro.
6488 * src/complain.c (vfprintf, strerror): Remove.
6489 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
6490 unconditionally.
6491 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
6492 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
6493 (strchr, strspn, memchr): Remove decls.
6494 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
6495 unconditionally. Do not declare perror.
6496 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
6497 unconditionally.
6498
6499 * src/complain.c (_): Remove useless defn, as system.h defines this.
6500
6501 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
6502 with latest obstack.h.
6503 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
6504 to procedure types, as obstack.h now does that for us.
6505 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
6506
6507 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
6508 so that this include file can stand alone.
6509 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
6510 does this now. Include subpipe.h first after config.h, to
6511 test whether it can stand alone.
6512
6513 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
6514 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
6515 unused declaration.
6516
6517 * tests/synclines.at (%union synch line): Put a dummy member in
6518 the union, because empty unions aren't allowed in C. Caught
6519 by GCC 3.4.0.
6520
6521 2004-04-13 Jim Meyering <jim@meyering.net>
6522
6523 * src/conflicts.c (conflicts_print): Correct format string typo:
6524 use `%%' to produce literal `%'. (trivial change)
6525
6526 2004-03-30 Paul Eggert <eggert@twinsun.com>
6527
6528 * src/getargs.c (version): Update copyright year to 2004.
6529
6530 * data/c.m4 (b4_int_type): Use 'short int' rather than
6531 'short', and similarly for 'long', 'unsigned', etc.
6532 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
6533 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
6534 yy_yypstack, yydumpstack): Likewise.
6535 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
6536 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
6537 Likewise.
6538 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
6539 yy_stack_print, yyparse): Likewise.
6540 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
6541 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
6542 * lib/bitset.c (bitset_print): Likewise.
6543 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
6544 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
6545 * lib/bitsetv.c (bitsetv_dump): Likewise.
6546 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
6547 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
6548 Likewise.
6549 * src/LR0.c (allocate_itemsets): Likewise.
6550 * src/gram.h (rule_number, rule): Likewise.
6551 * src/lalr.h (goto_number): Likewise.
6552 * src/nullable.c (nullable_compute): Likewise.
6553 * src/output.c (prepare_rules): Likewise.
6554 * src/relation.c (relation_print, relation_digraph): Likewise.
6555 * src/relation.h (relation_node): Likewise.
6556 * src/state.h (state_number, transitions, errs, reductions,
6557 struct state): Likewise.
6558 * src/symtab.h (symbol_number, struct symbol): Likewise.
6559 * src/tables.c (vector_number, tally, action_number,
6560 default_goto, goto_actions): Likewise.
6561 * tests/existing.at (GNU Cim Grammar): Likewise.
6562 * tests/regression.at (Web2c Actions): Likewise.
6563
6564 * src/output.c (muscle_insert_short_int_table): Renamed from
6565 muscle_insert_short_table. All uses changed.
6566
6567 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6568
6569 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
6570 (declaration): Replace expected_conflicts with expected_sr_conflicts.
6571 Add %expect-rr rule.
6572
6573 * src/scan-gram.l: Recognize %expect-rr.
6574
6575 * src/conflicts.h (expected_sr_conflicts): Rename from
6576 expected_conflicts.
6577 (expected_rr_conflicts): Declare.
6578
6579 * src/conflicts.c (expected_sr_conflicts): Rename from
6580 expected_conflicts.
6581 (expected_rr_conflicts): Define.
6582 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
6583 for GLR parsers.
6584 Use expected_sr_conflicts in place of expected_conflicts.
6585 Warn if expected_rr_conflicts used in non-GLR parser.
6586
6587 * doc/bison.texinfo: Add documentation for %expect-rr.
6588
6589 2004-03-08 Paul Eggert <eggert@gnu.org>
6590
6591 Add support for hex token numbers. Suggested by Odd Arild Olsen in
6592 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
6593
6594 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
6595 in lalr1.cc.
6596 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
6597 * src/scan-gram.l (scan_integer): New function.
6598 ({int}): Use it.
6599 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
6600 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
6601 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
6602 Say "long int", not "long", for uniformity with GNU style.
6603
6604 2004-02-25 Paul Eggert <eggert@twinsun.com>
6605
6606 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
6607 compilers. This fixes a problem with Intel's C++ compiler being
6608 chatty, reported by Guido Trentalancia in
6609 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
6610
6611 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
6612
6613 Support %destructor and merge error locations in lalr1.cc.
6614
6615 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
6616 (Parser::stos_): Define unconditionally.
6617 (Parser::destruct_): New method. Generate its body with
6618 b4_yydestruct_generate.
6619 (Parser::error_start_): New attribute.
6620 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
6621 token which are discarded.
6622 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
6623 error_start_ when erroneous token are discarded.
6624 (Parser::parse) <yyerrlab1>: Compute the location of the error
6625 token so that it covers all the discarded tokens.
6626 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
6627 it can be called with `%skeleton "lalr1.cc"', and do that.
6628
6629 2004-02-02 Paul Eggert <eggert@twinsun.com>
6630
6631 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
6632 $(top_srcdir)/lib and ../lib. This fixes a bug reported
6633 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
6634 There's no need to mention top_builddir since Automake does that
6635 for us.
6636 (INCLUDES): Remove, as Automake says it's obsolescent.
6637 Contents migrated into AM_CPPFLAGS as described above.
6638 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
6639
6640 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6641
6642 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
6643 (yyreportSyntaxError): Handle case where lookahead token is
6644 YYEMPTY.
6645
6646 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6647
6648 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
6649 resulting parsers are compilable with C++.
6650
6651 2003-12-23 Paul Eggert <eggert@twinsun.com>
6652
6653 * config/depcomp, config/install-sh: Sync with Automake 1.8.
6654 * src/output.c (output_skeleton): Rename local var.
6655 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
6656 Bison tokens, as this runs afoul of the 2003-10-07 change that
6657 disallowed NUL bytes in character constants or string literals.
6658
6659 * tests/local.at: Require Autoconf 2.59's Autotest.
6660 * tests/testsuite.at: Don't include local.at, since we now assume
6661 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
6662 including it.
6663 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
6664 multiple inclusion warnings.
6665
6666 2003-12-02 Akim Demaille <akim@epita.fr>
6667
6668 * doc/bison.texinfo (How Can I Reset the Parser): More about start
6669 conditions.
6670 From Bruno Haible.
6671
6672 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
6673
6674 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
6675
6676 2003-10-07 Paul Eggert <eggert@twinsun.com>
6677
6678 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
6679 if testsuite doesn't exist.
6680
6681 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
6682 literals, unfortunately.
6683 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
6684 Complain about NUL bytes in character constants or string literals.
6685
6686 2003-10-05 Paul Eggert <eggert@twinsun.com>
6687
6688 * NEWS: Don't document %no-default-prec, as it's still
6689 too experimental.
6690 * doc/bison.texinfo: Document %no-default-prec only if
6691 the defaultprec flag is set. Normally it's not.
6692
6693 2003-10-04 Paul Eggert <eggert@twinsun.com>
6694
6695 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
6696 non-modifiable lvalue, instead of a modifiable one.
6697 * doc/bison.texinfo (Actions): Document that $$ can
6698 be assigned to. Do not claim that $$ and $N are
6699 array element references: user code should not rely on this.
6700
6701 2003-10-01 Paul Eggert <eggert@twinsun.com>
6702
6703 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
6704 (grammar_declaration): Use it.
6705 * src/scan-gram.l: New token %no-default-prec.
6706 * tests/conflicts.at: Revamp tests to use %no-default-prec.
6707 * NEWS, doc/bison.texinfo: Document the above.
6708
6709 2003-10-01 Akim Demaille <akim@epita.fr>
6710
6711 VCG no longer supports long_straight_phase.
6712
6713 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
6714 * src/print_graph.c (print_graph): Adjust.
6715
6716 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
6717 and Paul Eggert <eggert@twinsun.com>
6718
6719 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
6720 Table of Symbols): Document %default-prec.
6721 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
6722 (grammar_declaration): Set default_prec on %default-prec.
6723 * src/scan-gram.l (%default-prec): New token.
6724 * src/reader.h (default_prec): New flag.
6725 * src/reader.c: Likewise.
6726 (packgram): Handle it.
6727 * tests/conflicts.at (%default-prec without %prec,
6728 %default-prec with %prec, %default-prec 1): New tests.
6729
6730 2003-09-30 Paul Eggert <eggert@twinsun.com>
6731
6732 * tests/testsuite.at: Include local.at, not input.at, fixing
6733 a typo in the 2003-08-25 patch.
6734
6735 2003-08-27 Akim Demaille <akim@epita.fr>
6736
6737 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
6738 GCC warnings.
6739
6740 2003-08-26 Akim Demaille <akim@epita.fr>
6741
6742 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
6743 "<\#" to avoid magic from Gnus when posting parts of this script.
6744
6745 2003-08-26 Akim Demaille <akim@epita.fr>
6746
6747 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
6748 (Parser::parse): here.
6749 Adjust: nerrs and errstatus is now replaced by...
6750 (Parser::nerrs_, Parser::errstatus_): New.
6751
6752 2003-08-25 Akim Demaille <akim@epita.fr>
6753
6754 * config/announce-gen, Makefile.cfg: New.
6755 * Makefile.am: Adjust.
6756 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
6757 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
6758
6759 2003-08-25 Akim Demaille <akim@epita.fr>
6760
6761 When reducing initial empty rules, Bison parser read an initial
6762 location that is not defined. This results in garbage, and that
6763 affects Bison's own parser. Therefore we need (i) to extend Bison
6764 to support a means to initialize this location, and (ii) to use
6765 this CVS Bison to fix CVS Bison's parser.
6766
6767 * src/reader.h, reader.c (epilogue_augment): Remove, replace
6768 with...
6769 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
6770 * src/parse-gram.y: Adjust.
6771 (%initial-action): New.
6772 (%error-verbose): Since we require CVS Bison, there is no reason
6773 not to use it.
6774 * src/scan-gram.l: Adjust.
6775 * src/Makefile.am (YACC): New, to make sure we use our own parser.
6776 * data/yacc.c (yyparse): Use b4_initial_action.
6777
6778 2003-08-25 Akim Demaille <akim@epita.fr>
6779
6780 * doc/bison.texinfo: Don't promote stdout for error messages.
6781
6782 2003-08-25 Akim Demaille <akim@epita.fr>
6783
6784 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
6785 From Alexandre Duret-Lutz.
6786
6787 2003-08-25 Akim Demaille <akim@epita.fr>
6788
6789 Version 1.875c.
6790
6791 2003-08-25 Akim Demaille <akim@epita.fr>
6792
6793 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
6794 Use them.
6795
6796 2003-08-25 Akim Demaille <akim@epita.fr>
6797
6798 * data/lalr1.cc (Parser::reduce_print_): New.
6799 Use it.
6800
6801 2003-08-25 Akim Demaille <akim@epita.fr>
6802
6803 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
6804 error recovery loops. This patch is based on
6805 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
6806 Also, augment the similarity between lalr1.cc and yacc.c.
6807 Note: the locations of error recovery rules are not correct yet.
6808
6809 * data/lalr1.cc: Comment changes to augment the similarity between
6810 lalr1.cc and yacc.c.
6811 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
6812 (yyerrlab1): Remove, but where it used to be (now the bottom part of
6813 yyerrlab), when hitting EOF, pop the whole stack here instead of
6814 merely falling thru the default error handling mechanism.
6815 (yyerrorlab): New label, with the old contents of YYERROR,
6816 plus the following change: pop the stack of rhs corresponding
6817 to the production that invoked YYERROR. That is how Yacc
6818 behaves (required by POSIX).
6819 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
6820 fail.
6821
6822 2003-08-25 Akim Demaille <akim@epita.fr>
6823
6824 Tune local.at so that people can "autom4te -l autotest calc.at -o
6825 calc" for instance, to extract a sub test suite.
6826
6827 * tests/testsuite.at: Move the initialization, Autotest version
6828 requirement, and AT_TESTED invocation into...
6829 * tests/local.at: here.
6830 * tests/testsuite.at: Include it for compatibility with Autoconf
6831 2.57.
6832 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
6833 be ignore.
6834
6835 2003-08-04 Paul Eggert <eggert@twinsun.com>
6836
6837 Rework code slightly to avoid gcc -Wtraditional warnings.
6838 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
6839 The returned value is now stored in *YY0. All callers changed.
6840 * src/output.c (merge_output): Adjust to the above change.
6841
6842 2003-07-26 Paul Eggert <eggert@twinsun.com>
6843
6844 * data/glr.c (YYASSERT): New macro.
6845 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
6846 yyresolveStates, yyprocessOneStack):
6847 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
6848 Derived from a suggestion by Frank Heckenbach.
6849
6850 2003-07-25 Paul Eggert <eggert@twinsun.com>
6851
6852 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
6853 for portability to K&R C (after ansi2knr, presumably). See
6854 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
6855 by Frank Heckenbach, though I have omitted the structure-initialization
6856 part of his glr-knr.diff patch since I recall that the Portable
6857 C Compiler didn't require that change.
6858
6859 Let the user specify how to allocate and free memory.
6860 Derived from a suggestion by Frank Heckenbach in
6861 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
6862 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
6863 All uses of free, malloc, realloc changed to use these macros,
6864 and unnecessary casts removed.
6865 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
6866
6867 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
6868
6869 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
6870 use s.empty() rather than s == "" to test for empty string; see
6871 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
6872 (trivial change)
6873
6874 2003-06-25 Akim Demaille <akim@epita.fr>
6875
6876 * config/depcomp, config/install-sh: Update from masters.
6877
6878 2003-06-20 Paul Eggert <eggert@twinsun.com>
6879
6880 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
6881 and return properly parenthesized result.
6882 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
6883 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
6884 Remove unnecessary parentheses from uses.
6885 * doc/bison.texinfo (Location Default Action): Describe the
6886 conventions for parentheses.
6887
6888 2003-06-19 Paul Eggert <eggert@twinsun.com>
6889
6890 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
6891 yyreportTree): Do not assume that size_t is the same width as int,
6892 when printing sizes. Print sizes using an unsigned format.
6893 Problem reported by Frank Heckenbach in
6894 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
6895
6896 Port to Forte Developer 7 C compiler.
6897 * data/glr.c (struct YYLTYPE): If locations are not being used,
6898 declare a single dummy member, as empty structs do not conform
6899 to the C standard.
6900 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
6901 the Forte Developer 7 C compiler complains that end-of-loop
6902 code is not reached.
6903
6904 2003-06-17 Paul Eggert <eggert@twinsun.com>
6905
6906 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
6907 avoid warnings from picky compilers about redefinition of PARAMS.
6908
6909 2003-06-17 Paul Eggert <eggert@twinsun.com>
6910
6911 Version 1.875b.
6912
6913 * NEWS: Document 1.875b.
6914
6915 * lib/bbitset.h: Do not include config.h; that's the includer's job.
6916 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
6917 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
6918 Don't use 'index' in comments, as it's a builtin fn on some hosts.
6919 * lib/bitset_stats.c: Include gettext.h unconditionally, as
6920 per recent gettext manual's suggestion.
6921 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
6922 Use prototypes, not old-style definitions.
6923 * lib/lbitset.c (lbitset_unused_clear): Likewise.
6924 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
6925 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
6926 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
6927 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
6928 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
6929 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
6930 vbitset_or_and_cmp, vbitset_copy): Likewise.
6931
6932 * lib/libiberty.h: Do not include config.h; that's the includer's job.
6933 Do not include <stdlib.h>.
6934 (PARAMS): Define unconditionally for C89.
6935 (ATTRIBUTE_NORETURN): Remove.
6936 (ATTRIBUTE_UNUSED): Define unconditionally.
6937
6938 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
6939 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
6940 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
6941 * lib/vbitset.c, lib/vbitset.h: New files.
6942 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
6943 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
6944 from libbitset.
6945
6946 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
6947 `How Can I Reset @code{yyparse}', since texinfo does not allow
6948 arbitrary @ in node names.
6949
6950 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
6951 shouldn't be needed according to the gettext 0.12.1 documentation
6952 but which seem to be needed anyway: codeset.m4 glibc21.m4
6953 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
6954 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
6955 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
6956
6957 * lib/.cvsignore: Add stdbool.h.
6958 * m4/.cvsignore: Add nls.m4, po.m4.
6959
6960 Upgrade to CVS gnulib.
6961 * stdbool_.h: File renamed from stdbool.h.in.
6962 * configure.ac (AM_STDBOOL_H): Invoke this instead of
6963 AC_HEADER_STDBOOL.
6964 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
6965 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
6966 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
6967 (MOSTLYCLEANFILES): New var.
6968 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
6969 (stdbool.h): New rule.
6970 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
6971 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
6972 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
6973 m4/quote.m4: Upgrade to today's gnulib.
6974
6975 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
6976 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
6977 the tests right now.
6978 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
6979 yyerror are declared before use; C99 requires this.
6980
6981 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6982
6983 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
6984 first.
6985 (yyrecoverSyntaxError): Correct the logic for setting and testing
6986 yyerrState.
6987 Correct comment on handling EOF.
6988 Allow states with only a default reduction, rather than failing
6989 (I can't quite reconstruct why these were not allowed before).
6990
6991 Fixes to avoid problem that $-N rules in GLR parsers can cause
6992 buffer overruns, corrupting state.
6993
6994 * src/output.c (prepare_rules): Output max_left_semantic_context
6995 definition.
6996 * src/reader.h (max_left_semantic_context): New variable declaration.
6997 * src/scan-gram.l (max_left_semantic_context): Define.
6998 (handle_action_dollar): Update max_left_semantic_context.
6999 * data/glr.c (YYMAXLEFT): New definition.
7000 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
7001 (yyresolveAction): Ditto.
7002
7003 Fixes to problems with location handling in GLR parsers reported by
7004 Frank Heckenbach (2003/06/05).
7005
7006 * data/glr.c (YYLTYPE): Make trivial if locations not used.
7007 (YYRHSLOC): Add parentheses, and define only if locations used.
7008 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
7009 locations not used.
7010 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
7011 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
7012
7013 * tests/cxx-type.at: Exercise location information; update tests
7014 to differentiate output with and without locations.
7015 Remove forward declarations of yylex and yyerror---caused errors
7016 because default YYLTYPE not yet defined.
7017 Change semantic actions to compute strings, rather than printing
7018 them directly (to test proper passing of semantics values). Change
7019 output to prefix notation and update test data and expected results.
7020 (yylex): Track locations.
7021 (stmtMerge): Return value rather than printing, and include arguments
7022 in value.
7023
7024 2003-06-03 Paul Eggert <eggert@twinsun.com>
7025
7026 Avoid warnings generated by GCC 2.95.4 when Bison is
7027 configured with --enable-gcc-warnings.
7028 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
7029 yy::]b4_parser_class_name[::translate_,
7030 yy::Stack::operator[] (unsigned),
7031 yy::Stack::operator[] (unsigned) const,
7032 yy::Slice::operator[] (unsigned),
7033 yy::Slice::operator[] (unsigned) const):
7034 Rename local vars to avoid warnings.
7035 * tests/glr-regression.at (Improper handling of embedded actions
7036 and $-N in GLR parsers): Remove unused local variable from yylex.
7037 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
7038 (void) as arg when not pure, since we now assume C89 when building
7039 Bison. Pacify GCC by using parameter.
7040
7041 2003-06-02 Paul Eggert <eggert@twinsun.com>
7042
7043 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
7044 yy::Location::lines, yy::Location::columns): Rename arguments
7045 to avoid shadowing; this removes a warning generated by GCC 3.3.
7046
7047 2003-06-01 Paul Eggert <eggert@twinsun.com>
7048
7049 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
7050 to g++, as GCC 3.3 complains if you do it.
7051 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
7052 everything that WARNING_CFLAGS has, except omit warnings
7053 not suitable for C++.
7054 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
7055 * tests/atlocal.in (CXXFLAGS): New var.
7056 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
7057
7058 Fix a GLR parser bug I reported in February; see
7059 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
7060 The problem was that GLR parsers did not conform to the C standard,
7061 because actions like { $1 = $2 + $3; } expanded to expressions
7062 that invoked YYFILL in separate subexpressions, and YYFILL assigned
7063 to a local variable. The C standard says that expressions
7064 like (var = f ()) + (var = f ()) have undefined behavior.
7065 Another problem was that GCC sometimes issues warnings that
7066 yyfill and its parameters are unused.
7067
7068 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
7069 as possibly unused.
7070 (yyfill): New function.
7071 (YYFILL): Use it.
7072 (yyuserAction): Change type of yynormal to bool, so that it matches
7073 the new yyfill signature. Mark it as possibly unused.
7074
7075
7076 Follow up on a bug I reported in February, where a Bison-generated
7077 parser can loop. Provide a test case and a fix for yacc.c. I
7078 don't have a fix for lalr1.cc or for glr.c, unfortunately.
7079 The original bug report is in:
7080 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
7081
7082 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
7083 macro's size was becoming unwieldy.
7084 (yyerrlab): Do not discard an empty lookahead symbol, as this
7085 might destroy garbage.
7086 (yyerrorlab): New label, with the old contents of YYERROR,
7087 plus the following change: pop the stack of rhs corresponding
7088 to the production that invoked YYERROR. That is how Yacc
7089 behaves, and POSIX requires this behavior.
7090 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
7091 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
7092 Define 'alarm' to do nothing if unistd.h is not available.
7093 Add a new rule "exp: '-' error;" to test the above change to
7094 data/yacc.c. Use 'alarm' to abort any test taking longer than
7095 10 seconds, as it's probably looping.
7096 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
7097 Also, the new yacc.c generates two fewer diagnostics for an
7098 existing test.
7099
7100 2003-05-24 Paul Eggert <eggert@twinsun.com>
7101
7102 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
7103 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
7104 This fixes a problem reported by John Bowman when the Compaq/HP
7105 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
7106 -ansi -Wall -gall).
7107 * data/yacc.c (union yyalloc): Likewise.
7108 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
7109
7110 Switch from 'int' to 'bool' where that makes sense.
7111
7112 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
7113 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
7114 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
7115 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
7116 Return or accept bool, not int. All callers changed.
7117 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
7118 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
7119 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
7120 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
7121 bitset_or_and_cmp_): Likewise.
7122 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
7123 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
7124 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
7125 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
7126 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
7127 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
7128 bitset_stats_or_and_cmp): Likewise.
7129 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
7130 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
7131 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
7132 ebitset_xor_cmp): Likewise.
7133 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
7134 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
7135 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
7136 lbitset_xor_cmp): Likewise.
7137 * lib/bbitset.h: Include <stdbool.h>.
7138 (struct bitset_vtable): The following members now return bool, not
7139 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
7140 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
7141 or_and_cmp).
7142 * src/conflicts.c (count_rr_conflicts): Likewise.
7143 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
7144 All uses changed.
7145 * lib/ebitset.c (ebitset_obstack_init): Likewise.
7146 * lib/lbitset.c (lbitset_obstack_init): Likewise.
7147 * src/getargs.c (debug_flag, defines_flag, locations_flag,
7148 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
7149 graph_flag): Likewise.
7150 * src/getargs.h (debug_flag, defines_flag, locations_flag,
7151 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
7152 graph_flag): Likewise.
7153 * src/output.c (error_verbose): Likewise.
7154 * src/output.h (error_verbose): Likewise.
7155 * src/reader.c (start_flag, typed): Likewise.
7156 * src/reader.h (typed): Likewise.
7157 * src/getargs.c (LOCATIONS_OPTION): New constant.
7158 (long_options, getargs): Use it.
7159 * src/lalr.c (build_relations): Use bool, not int.
7160 * src/nullable.c (nullable_compute): Likewise.
7161 * src/print.c (print_reductions): Likewise.
7162 * src/tables.c (action_row, pack_vector): Likewise.
7163 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
7164 * src/output.c (prepare): Use it.
7165 * src/output.c (token_definitions_output,
7166 symbol_destructors_output, symbol_destructors_output): Use string,
7167 not boolean integer, to keep track of whether to output separator.
7168 * src/print_graph.c (print_core): Likewise.
7169 * src/state.c (state_rule_lookaheads_print): Likewise.
7170
7171 * config/install-sh: Sync from automake 1.7.5.
7172
7173 2003-05-14 Paul Eggert <eggert@twinsun.com>
7174
7175 * src/parse-gram.y (rules_or_grammar_declaration): Require a
7176 semicolon after a grammar declaration, in the interest of possible
7177 future changes to the Bison input language.
7178 Do not allow a stray semicolon at the start of the grammar.
7179 (rhses.1): Allow one or more semicolons after any rule, including
7180 just before "|" as required by POSIX.
7181 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
7182 grammar.
7183
7184 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
7185
7186 %parse-param support for lalr1.cc.
7187
7188 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
7189 b4_cc_constructor_calls, b4_cc_constructor_call,
7190 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
7191 definitions.
7192 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
7193 parse-param arguments.
7194 (yy::b4_parser_class_name): Declare instance variables to
7195 hold parse-param arguments.
7196 * tests/calc.at: s/value/semantic_value/ because value clashes
7197 with a member of yy::b4_parser_class_name. Adjust C++ code
7198 to handle %parse-param. Enable %parse-param test in C++.
7199
7200 2003-05-12 Paul Eggert <eggert@twinsun.com>
7201
7202 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
7203 English a bit. Fix fclose typo. Change "const char" to "char
7204 const", and use ANSI C rather than K&R for "main". Suggest
7205 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
7206 and suggest yy_switch_to_buffer.
7207
7208 2003-05-05 Paul Eggert <eggert@twinsun.com>
7209
7210 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
7211 C89. This avoids a diagnostic on compilers that define __STDC__
7212 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
7213 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
7214
7215 2003-05-03 Paul Eggert <eggert@twinsun.com>
7216
7217 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
7218 Do not overrun array bounds.
7219 This should fix a bug reported today by Olatunji Oluwabukunmi in
7220 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
7221
7222 2003-04-29 Akim Demaille <akim@epita.fr>
7223
7224 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
7225 * src/getargs.c, src/getargs.h: here, as bool, not int.
7226 (nondeterministic_parser): New.
7227 * src/parse-gram.y, src/scan-gram.l: Support
7228 %nondeterministic-parser.
7229 * src/output.c (prepare): Use nondeterministic_parser instead
7230 of glr_parser where appropriate.
7231 * src/tables.c (conflict_row, action_row, save_row)
7232 (token_actions, token_actions, pack_vector): Ditto.
7233
7234 2003-04-29 Akim Demaille <akim@epita.fr>
7235
7236 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
7237
7238 2003-04-29 Akim Demaille <akim@epita.fr>
7239
7240 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
7241 with %pure-parser and %locations to exercise the patch from Yakov
7242 Markovitch below.
7243
7244 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
7245
7246 * data/yacc.c: (b4_lex_param): Corrected for the case where
7247 %lex-param is provided and %pure-parser isn't.
7248
7249 2003-04-27 Paul Eggert <eggert@twinsun.com>
7250
7251 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
7252 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
7253 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
7254 if it is not defined.
7255 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
7256
7257 2003-04-26 Paul Eggert <eggert@twinsun.com>
7258
7259 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
7260 Declare to be of type suitable for the ninf value itself, not of
7261 type suitable for the corresponding table, since the latter might
7262 be unsigned but the ninf value might be negative. This fixes a
7263 bug reported by Alexandre Duret-Lutz in
7264 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
7265
7266 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
7267 invokes it. We shouldn't invoke it twice because it will attempt
7268 to put error.o in the archive twice. This fixes a glitch reported
7269 by Martin Mokrejs in
7270 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
7271
7272 2003-04-21 Paul Eggert <eggert@twinsun.com>
7273
7274 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
7275 to gnulib.
7276
7277 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
7278
7279 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
7280 Fix obvious typo that results in uncompilable GLR parsers
7281 when both %pure-parser and %locations are used. (trivial change)
7282
7283 2003-04-17 Paul Eggert <eggert@twinsun.com>
7284
7285 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
7286 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
7287 Do not insert the expected token via unput, as this runs afoul
7288 of a POSIX-compatibility bug in flex 2.5.31.
7289 All uses changed to BEGIN the parent state,
7290 since we no longer insert the expected token via unput.
7291 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
7292 that is no longer emitted after the above change.
7293
7294 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
7295 the first one. This change is from Paul Hilfinger, and it fixes
7296 regression reported by Werner Lemberg in
7297 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
7298
7299 (resolve_sr_conflict): Don't invoke state_errs_set
7300 unless one or more tokens have been explicitly made errors.
7301 Otherwise, the above change causes Bison to abort.
7302
7303 * tests/existing.at (GNU pic Grammar): New test case, taken from
7304 Lemberg's email.
7305
7306 2003-03-31 Akim Demaille <akim@epita.fr>
7307
7308 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
7309
7310 2003-03-31 Akim Demaille <akim@epita.fr>
7311
7312 * src/output.c (prepare_symbols): Avoid trailing spaces in the
7313 output.
7314
7315 2003-03-31 Akim Demaille <akim@epita.fr>
7316
7317 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
7318 From Paul Hilfinger.
7319
7320 2003-03-29 Akim Demaille <akim@epita.fr>
7321
7322 * m4/error.m4: Do not put under dynamic conditions some code which
7323 expansion is under static control.
7324
7325 2003-03-29 Akim Demaille <akim@epita.fr>
7326
7327 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
7328
7329 2003-03-29 Akim Demaille <akim@epita.fr>
7330
7331 * doc/bison.texinfo (Strings are Destroyed): New.
7332
7333 2003-03-13 Paul Eggert <eggert@twinsun.com>
7334
7335 * .cvsignore: Add configure.lineno.
7336 * src/.cvsignore: Add yacc.
7337 * tests/.cvsignore: Add testsuite.log.
7338 * doc/fdl.texi: Sync with latest FSF version.
7339
7340 2003-03-12 Paul Eggert <eggert@twinsun.com>
7341
7342 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
7343 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
7344 cursor, instead of leaving it undefined. This fixes a bug
7345 reported by Tim Van Holder in
7346 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
7347 * tests/input.at (Torturing the Scanner): Test the scanner on
7348 an empty input file, which was Tim Van Holder's test case.
7349
7350 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
7351 <sys/resource.h> can be included, include sys/time.h and
7352 sys/times.h first, if available. This works around the SunOS
7353 4.1.4 porting bug reported by Bruce Becker in
7354 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
7355
7356 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
7357 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
7358 AC_HEADER_SYS_WAIT.
7359
7360 Merge changes from gnulib. This was prompted because the CVS
7361 snapshot didn't build on Solaris 7 due to strnlen problems.
7362
7363 These changes need to be merged back into gnulib:
7364 * lib/hash.c: Include <stdbool.h> unconditionally.
7365 * m4/onceonly.m4 (m4_quote): New macro.
7366 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
7367 Quote AC_FOREACH variable-expansions properly.
7368 The 2003-01-03 obstack.h change also needs merging.
7369 {end of changes requiring merging}
7370
7371 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
7372 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
7373 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
7374 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
7375 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
7376 New files, imported from gnulib.
7377 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
7378 above.
7379
7380 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
7381 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
7382 gnulib sources.
7383
7384 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
7385 Add.
7386 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
7387 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
7388 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
7389 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
7390 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
7391 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
7392 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
7393 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
7394 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
7395 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
7396 (jm_PREREQ_ARGMATCH): Remove.
7397 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
7398 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
7399
7400 * src/system.h: Include <stdbool.h> unconditionally.
7401
7402 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
7403 assuming at least C89 in the bitset code for some time now.
7404
7405 2003-03-03 Akim Demaille <akim@epita.fr>
7406
7407 * ro.po: New.
7408
7409 2003-03-02 Akim Demaille <akim@epita.fr>
7410
7411 * doc/bison.texinfo (Table of Symbols): Reactivate the
7412 documentation for %lex-param, and %parse-param.
7413
7414 2003-03-02 Akim Demaille <akim@epita.fr>
7415
7416 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
7417 generate verbose error messages.
7418 Use the number of tokens as an upper bound in yytname, as it
7419 cannot be a non terminal.
7420
7421 2003-03-02 Akim Demaille <akim@epita.fr>
7422
7423 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
7424 message.
7425
7426 2003-03-02 Akim Demaille <akim@epita.fr>
7427
7428 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
7429 Use them to exercise yycheck overrun.
7430 Based on Andrew Suffield's grammar.
7431
7432 2003-03-02 Akim Demaille <akim@epita.fr>
7433
7434 Create tests/local.at for Bison generic testing macros.
7435
7436 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
7437 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
7438 This new file.
7439 * tests/calc.at (AT_CHECK_CALC): Adjust.
7440 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
7441 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
7442 * tests/local.at: here.
7443 (AT_COMPILE_CXX): Tags the tests using it as c++.
7444 Ignore the test if CXX is not functional.
7445
7446 2003-03-01 Paul Eggert <eggert@twinsun.com>
7447
7448 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
7449 not loc->end, since loc->end might contain garbage and this leads
7450 to undefined behavior on some platforms.
7451 (id_loc, token_start): Use (IF_LINTed) initial values that do not
7452 depend on *loc, so that the reader doesn't give the the false
7453 impression that *loc is initialized.
7454 (<INITIAL>"%%"): Do not bother setting code_start, since its value
7455 does not survive the return.
7456
7457 2003-03-01 Akim Demaille <akim@epita.fr>
7458
7459 * src/scan-gram.l (code_start): Always initialize it when entering
7460 into yylex, as SC_EPILOGUE is activated *before* the corresponding
7461 yylex invocation. An alternative would be making it static, but
7462 then it starts with the second %%'s beginning, instead of its end.
7463
7464 2003-02-28 Paul Eggert <eggert@twinsun.com>
7465
7466 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
7467 around a UnixWare 7.1.1 porting bug reported by John Hughes in
7468 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
7469
7470 2003-02-26 Paul Eggert <eggert@twinsun.com>
7471
7472 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
7473 Remove Sequent/Pyramid discussion (nobody uses them any more).
7474 Merge VMS and MS-DOS discussion; these ports may well be dead
7475 but let's keep mentioning them for now. Put <> around email
7476 addresses. Add copyright notice.
7477
7478 2003-02-24 Paul Eggert <eggert@twinsun.com>
7479
7480 * data/glr.c (yy_reduce_print): yylineno -> yylno,
7481 to avoid collision with flex use of yylineno.
7482 Problem reported by Bruce Lilly in
7483 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
7484 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
7485 * data/yacc.c (yy_reduce_print): Likewise.
7486
7487 * config/depcomp: Sync with Automake 1.7.3.
7488
7489 2003-02-21 Akim Demaille <akim@epita.fr>
7490
7491 * data/lalr1.cc: Use temporary variables instead of casts to
7492 change integer types.
7493 Suggested by Paul Eggert.
7494
7495 2003-02-21 Akim Demaille <akim@epita.fr>
7496
7497 * doc/bison.texinfo: Use "location" consistently to refer to @n,
7498 to avoid confusions with lalr1.cc's notion of Position.
7499 Suggested by Paul Eggert.
7500
7501 2003-02-20 Akim Demaille <akim@epita.fr>
7502
7503 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
7504 before initial_columns.
7505 (location.hh): Use consistent variable names when defining the
7506 operator<<.
7507 Use "last" so that we subtract from Positions, not from unsigned.
7508
7509 2003-02-20 Akim Demaille <akim@epita.fr>
7510
7511 * data/lalr1.cc (position.hh): New subfile, including the extended
7512 and Doxygen'ed documentation of class Position.
7513 (location.hh): Use it.
7514 Document a` la Doxygen.
7515 With the help of Benoit Perrot.
7516
7517 2003-02-20 Akim Demaille <akim@epita.fr>
7518
7519 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
7520 AT_YACC_IF.
7521 Redefine AT_YYERROR_SEES_LOC_IF using it.
7522 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
7523 not defined.
7524 Don't use the location in yy::Parser::error_ and
7525 yy::Parser::print_ when not %locations.
7526 Activate more lalr1.cc tests.
7527
7528 2003-02-19 Akim Demaille <akim@epita.fr>
7529
7530 * data/lalr1.cc: When displaying a line number, be sure to make it
7531 an int.
7532
7533 2003-02-19 Akim Demaille <akim@epita.fr>
7534
7535 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
7536 Remove, useless.
7537 (YYABORT, YYACCEPT, YYERROR): New.
7538 * tests/calc.at: Renable the lalr1.cc test.
7539
7540 2003-02-19 Akim Demaille <akim@epita.fr>
7541
7542 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
7543 error recovery, mixing with/without pops and discarding of the
7544 lookahead.
7545 Exercise YYERROR.
7546 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
7547
7548 2003-02-17 Paul Eggert <eggert@twinsun.com>
7549
7550 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
7551 * tests/testsuite.at (AT_COMPILE): Use them.
7552 This fixes the testsuite problem reported by Robert Lentz in
7553 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
7554
7555 2003-02-12 Paul Eggert <eggert@twinsun.com>
7556
7557 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
7558 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
7559 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
7560 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
7561 Check for malloc failure, for consistency with yacc.c.
7562 (yytname_size): Remove, for consistency with yacc.c.
7563
7564 The bug still remains in data/lalr1.cc, as I didn't have time
7565 to fix it there.
7566
7567 2003-02-06 Akim Demaille <akim@epita.fr>
7568
7569 * configure.ac (GXX): Rename as...
7570 (CXX): this, to keep the original Autoconf semantics.
7571 Require 2.57.
7572 * data/lalr1.cc: Fix b4_copyright invocations.
7573 If YYDEBUG is not defined, don't depend upon name_ being defined.
7574 (location.hh): Include string and iostream.
7575 (Position::filename): New member.
7576 (Position::Position ()): New.
7577 (operator<< (Position)): New.
7578 (operator- (Position, int)): New.
7579 (Location::first, Location::last): Rename as...
7580 (Location::begin, Location::end): these, to mock the conventional
7581 iterator names.
7582 (operator<< (Location)): New.
7583 * tests/atlocal.in (CXX): New.
7584 * tests/testsuite.at (AT_COMPILE_CXX): New.
7585 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
7586 locations in a more synthetic way.
7587 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
7588 lalr1.cc is used.
7589 Adjust the C locations to match those from Emacs: first column is
7590 column 0.
7591 Change all the expected results.
7592 Conform to the GCS: simplify the locations when applicable.
7593 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
7594 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
7595 these CPP macros with the m4 macros new defined by...
7596 (AT_CHECK_PUSHDEFS): this, i.e.:
7597 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
7598 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7599 New macros.
7600 (AT_CHECK_POPDEFS): Undefine them.
7601 (AT_CHECK_CALC_LALR1_CC): New.
7602 Use it for the first lalr1.cc test.
7603
7604 2003-02-04 Akim Demaille <akim@epita.fr>
7605
7606 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
7607 Location as is defined.
7608
7609 2003-02-04 Akim Demaille <akim@epita.fr>
7610
7611 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
7612 name_ being defined.
7613
7614 2003-02-03 Paul Eggert <eggert@twinsun.com>
7615
7616 * src/gram.h (start_symbol): Remove unused decl.
7617
7618 Use more-consistent naming conventions for local vars.
7619
7620 * src/derives.c (derives_compute): Change type of local var from
7621 int to rule_number.
7622 * src/gram.c (grammar_rules_partial_print): Likewise.
7623 * src/print.c (print_core): Likewise.
7624 * src/reduce.c (reduce_grammar_tables): Likewise.
7625
7626 * src/gram.c (grammar_dump): Change name of item_number *
7627 local var from r to rp.
7628 * src/nullable.c (nullable_compute): Likewise.
7629
7630 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
7631
7632 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
7633 for symbol or symbol_number var.
7634 * src/reader.c (grammar_start_symbol_set): Likewise.
7635 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
7636 Likewise.
7637 * src/state.c (transitions_to): Likewise.
7638 * src/state.h: Likewise.
7639 * src/tables.c (symbol_number_to_vector_number): Likewise.
7640
7641 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
7642 char * var.
7643
7644 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
7645 var.
7646
7647 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
7648 var.
7649
7650 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
7651 Use str, not s, for char * var. Use ch, not c, for character var.
7652 Use size for size var.
7653
7654 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
7655 char * var.
7656 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
7657 uniqstr var.
7658 * src/uniqstr.h: Likewise.
7659
7660 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
7661 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
7662 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
7663 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
7664 param to have same name as that of enum, so that we don't use
7665 "s" to stand for a non-state.
7666
7667 2003-02-02 Akim Demaille <akim@epita.fr>
7668
7669 * src/scan-skel.l: Scan more than one inert character per yylex
7670 invocation.
7671
7672 2003-02-01 Paul Eggert <eggert@twinsun.com>
7673
7674 Version 1.875a.
7675
7676 * po/LINGUAS: Add ms.
7677
7678 2003-01-30 Akim Demaille <akim@epita.fr>
7679
7680 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
7681
7682 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7683
7684 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
7685 of $1.
7686
7687 Changes in response to error report by S. Eken: GLR mode does not
7688 handle negative $ indices or $ indices in embedded rules correctly.
7689 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
7690
7691 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
7692 (b4_rhs_location): Ditto.
7693 (yyfill): New function to copy from stack tree into array
7694 incrementally.
7695 (yyuserAction): Modify to allow incremental move of semantic values
7696 to rhs array when in GLR mode.
7697 Define YYFILL to use in user-defined actions to fill semantic array
7698 as needed.
7699 Remove dummy use of yystack, as there is now a guaranteed use.
7700 (yydoAction): Modify to allow incremental move of semantic values
7701 to rhs array when in GLR mode.
7702 (yyresolveAction): Ditto.
7703 (yyglrShiftDefer): Update comment.
7704 (yyresolveStates): Use X == NULL for pointers, not !X.
7705 (yyglrReduce): Ditto.
7706 (yydoAction): Ditto
7707
7708 * tests/glr-regr1.at: Rename to ...
7709 * tests/glr-regression.at: Add new regression test for the problems
7710 described above (adapted from S. Eken).
7711 Update copyright notice.
7712 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
7713 * tests/Makefile.am: Ditto.
7714
7715 2003-01-28 Paul Eggert <eggert@twinsun.com>
7716
7717 * data/lalr1.cc: Do not use @output_header_name@ unless
7718 b4_defines_flag is set. This fixes two bugs reported by
7719 Tim Van Holder in
7720 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
7721 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
7722
7723 2003-01-21 Paul Eggert <eggert@twinsun.com>
7724
7725 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
7726 we don't need to worry about yyerrlab1 being reported as an
7727 "unused label" by non-GCC C compilers. The downside is that if
7728 locations are used then a couple of statements are duplicated each
7729 time YYERROR is invoked, but the upside is that the warnings
7730 should vanish.
7731 (yyerrlab1): Move code to YERROR.
7732 (yyerrlab2): Remove. Change uses back to yyerrlab1.
7733 This reverts some of the 2002-12-27 change.
7734
7735 2003-01-17 Paul Eggert <eggert@twinsun.com>
7736
7737 * src/output.c (symbol_printers_output): Fix typo that led
7738 to core dump. Problem reported by Antonio Rus in
7739 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
7740
7741 2003-01-13 Akim Demaille <akim@epita.fr>,
7742 Quoc Peyrot <chojin@lrde.epita.fr>,
7743 Robert Anisko <anisko_r@lrde.epita.fr>
7744
7745 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
7746 when the stacks contain one element, as the loop would otherwise
7747 free the last state, and then use the top state (the one we just
7748 popped). This means that the initial elements will not be freed
7749 explicitly, as is the case in yacc.c; it is not a problem, as
7750 these elements have fake values.
7751
7752 2003-01-11 Paul Eggert <eggert@twinsun.com>
7753
7754 * NEWS: %expect-violations are now just warnings, reverting
7755 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
7756 bootstrapping problem reported by Matthias Klose; see
7757 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
7758 * src/conflicts.c (conflicts_print): Likewise.
7759 * tests/conflicts.at (%expect not enough, %expect too much,
7760 %expect with reduce conflicts): Likewise.
7761 * doc/bison.texinfo (Expect Decl): Document this. Also mention
7762 that the warning is enabled if the number of conflicts changes
7763 (not necessarily increases).
7764
7765 * src/getargs.c (version): Update copyright year.
7766
7767 2003-01-09 Akim Demaille <akim@epita.fr>
7768
7769 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
7770
7771 2003-01-08 Paul Eggert <eggert@twinsun.com>
7772
7773 * Makefile.maint (WGETFLAGS):
7774 New macro, containing "-C off" to disable proxy caches.
7775 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
7776 (rel-check): Use $(WGET) instead of wget.
7777
7778 2003-01-06 Paul Eggert <eggert@twinsun.com>
7779
7780 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
7781 the GLR paper of Scott, Johnstone and Hussain.
7782
7783 2003-01-04 Paul Eggert <eggert@twinsun.com>
7784
7785 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
7786 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
7787 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
7788 (EXTRA_LIBRARIES): New var, for liby.a.
7789 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
7790 (EXTRA_SCRIPTS): New var, for yacc.
7791
7792 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
7793 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
7794 Problem reported by Nelson H. F. Beebe.
7795
7796 2003-01-03 Paul Eggert <eggert@twinsun.com>
7797
7798 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
7799 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7800 when compiling Bison 1.875's `bitset bset = obstack_alloc
7801 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
7802
7803 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
7804 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
7805 grow to a huge size with typical invocation.
7806
7807 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
7808 Use the pattern recommended by Autoconf 2.57, except also protect
7809 against double-definition.
7810 * src/system.h: Likewise.
7811 Portability issues reported by Nelson H. F. Beebe.
7812
7813 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
7814 All uses changed. Provide a definition in both C and C++.
7815 (yytrue, yyfalse): Define even if defined (__cplusplus).
7816
7817 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
7818 Reported by Nelson H. F. Beebe.
7819
7820 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
7821
7822 2003-01-02 Paul Eggert <eggert@twinsun.com>
7823
7824 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
7825 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
7826 Bug reported by Nelson H. F. Beebe.
7827
7828 2003-01-01 Paul Eggert <eggert@twinsun.com>
7829
7830 * Version 1.875.
7831
7832 2002-12-30 Paul Eggert <eggert@twinsun.com>
7833
7834 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
7835 Moved here from...
7836 (<INITIAL>","): Here. This causes stray "," to be treated
7837 more uniformly.
7838
7839 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
7840 last brace in braced code when not in Yacc mode, for compatibility
7841 with Bison 1.35. This resurrects the 2001-12-15 patch to
7842 src/reader.c.
7843
7844 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
7845 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
7846
7847 2002-12-28 Paul Eggert <eggert@twinsun.com>
7848
7849 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
7850 that of SYM's type. This fixes Debian bug 168069, reported by
7851 Thomas Olsson.
7852
7853 2002-12-28 Paul Eggert <eggert@twinsun.com>
7854
7855 Version 1.75f.
7856
7857 Switch back to the Yacc style of conflict reports, undoing some
7858 of the 2002-07-30 change.
7859 * doc/bison.texinfo (Understanding): Use Yacc style for
7860 conflict reports. Also, use new way of locating rules.
7861 * src/conflicts.c (conflict_report):
7862 Renamed from conflict_report_yacc, removing the old
7863 'conflict_report'. Translate the entire conflict report at once,
7864 so that we don't assume that "," has the same interpretation in
7865 all languages.
7866 (conflicts_output): Use Yacc-style conflict report for each state,
7867 instead of our more-complicated style.
7868 (conflicts_print): Use Yacc-style conflict report, except print
7869 the input file name when not emulating Yacc.
7870 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
7871 Conflicted Reduction, %expect not enough, %expect too much,
7872 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
7873 * tests/existing.at (GNU Cim Grammar): Likewise.
7874 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
7875
7876 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
7877 fatal): Don't invoke fflush; it's not needed and it might even be
7878 harmful for stdout, as stdout might not be open.
7879 * src/reduce.c (reduce_print): Likewise.
7880
7881 2002-12-27 Paul Eggert <eggert@twinsun.com>
7882
7883 Fix a bug where error locations were not being recorded correctly.
7884 This problem was originally reported by Paul Hilfinger in
7885 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
7886
7887 * data/yacc.c (yyparse): New local var yylerrsp, to record the
7888 top of the location stack's error locations.
7889 (yyerrlab): Set it. When discarding a token, push its location
7890 onto yylerrsp so that we don't lose track of the error's end.
7891 (yyerrlab1): Now is only the target of YYERROR, so that we can
7892 properly record the location of the action that failed. For GCC
7893 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
7894 GCC warning about yyerrlab1 being unused if YYERROR is unused.
7895 (yyerrlab2): New label, which yyerrlab now falls through to.
7896 Compute the error's location by applying YYLLOC_DEFAULT to
7897 the locations of all the symbols that went into the error.
7898 * doc/bison.texinfo (Location Default Action): Mention that
7899 YYLLOC_DEFAULT is also invoked for syntax errors.
7900 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7901 Error locations include the locations of all the tokens that were
7902 discarded, not just the last token.
7903
7904 2002-12-26 Paul Eggert <eggert@twinsun.com>
7905
7906 * src/files.c: Include quote.h.
7907 (compute_output_file_names): Warn if we detect conflicting
7908 outputs to the same file. This should catch the misunderstanding
7909 exemplified by Debian Bug 165349, reported by Bruce Stephens..
7910
7911 * src/conflicts.c (conflicts_print): If the user specifies
7912 "%expect N", report an error if there are any reduce/reduce
7913 conflicts. This is what the manual says should happen.
7914 This fixes Debian bug 130890, reported by Anthony DeRobertis.
7915 * tests/conflicts.at (%expect with reduce conflicts): New test.
7916
7917 Don't use m4_include on relative file names, as it doesn't work as
7918 desired if there happens to be a file with that name under ".".
7919
7920 * m4sugar/version.m4: Remove; it was included but it wasn't used.
7921 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
7922 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
7923 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
7924 * src/output.c (output_skeleton): Use full path names when
7925 specifying a file to include; don't rely on include path, as
7926 it's unreliable when the working file contains a file with
7927 that name.
7928
7929 2002-12-25 Paul Eggert <eggert@twinsun.com>
7930
7931 Remove obsolete references to bison.simple and bison.hairy.
7932 Problem mentioned by Aubin Mahe in
7933 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
7934 * data/glr.c: Comment fix.
7935 * doc/bison.1: Remove references. Also, mention "yacc".
7936
7937 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
7938 with -g option.
7939
7940 * src/parse-gram.y (declaration): Use enum "report_states" rather
7941 than its numeric value 1.
7942
7943 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
7944 opening a new one. This fixes Debian bug 165349, reported by
7945 Bruce Stephens.
7946
7947 2002-12-24 Paul Eggert <eggert@twinsun.com>
7948
7949 Version 1.75e.
7950
7951 * Makefile.maint (cvs-update): Don't assume that the shell
7952 supports $(...), as Solaris sh doesn't.
7953
7954 * src/parse-gram.y (lloc_default): Remove test for empty
7955 nonterminals at the end, since it didn't change the result.
7956
7957 2002-12-24 Paul Eggert <eggert@twinsun.com>
7958
7959 If the user does not define YYSTYPE as a macro, Bison now declares it
7960 using typedef instead of defining it as a macro. POSIX requires this.
7961 For consistency, YYLTYPE is also declared instead of defined.
7962
7963 %union directives can now have a tag before the `{', e.g., the
7964 directive `%union foo {...}' now generates the C code
7965 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
7966 The default union tag is `YYSTYPE', for compatibility with Solaris 9
7967 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
7968 instead of `yyltype'.
7969
7970 `yystype' and `yyltype' are now obsolescent macros instead of being
7971 typedefs or tags; they are no longer documented and will be
7972 withdrawn in a future release.
7973
7974 * data/glr.c (b4_location_type): Remove.
7975 (YYSTYPE): Renamed from yystype.
7976 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
7977 (struct YYLTYPE): Renamed from struct yyltype.
7978 (YYLTYPE): Renamed from yyltype.
7979 (yyltype, yystype): New (and obsolescent) macros,
7980 for backward compatibility.
7981 * data/yacc.c: Likewise.
7982
7983 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
7984 does not specify a union tag. This is for compatibility with
7985 Solaris 9 yacc.
7986
7987 * src/parse-gram.y (add_param): 2nd arg is now char * not char
7988 const *, since it is now modified by stripping surrounding { }.
7989 (current_braced_code): Remove.
7990 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
7991 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
7992 trailing " {...}". Now of type <chars>.
7993 (grammar_declaration): Adjust to bundled tokens.
7994 (code_content): Remove; stripping is now done by add_param.
7995 (print_token_value): Print contents of bundled tokens.
7996 (token_name): New function.
7997
7998 * src/reader.h (braced_code, current_braced_code): Remove.
7999 (token_name): New decl.
8000
8001 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
8002 token_type, not braced_code code_kind. All uses changed.
8003 (SC_PRE_CODE): New state, for scanning after a keyword that
8004 has (or usually has) an immediately-following braced code.
8005 (token_type): New local var, to keep track of which token type
8006 to return when scanning braced code.
8007 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
8008 <INITIAL>"%parse-param", <INITIAL>"%printer",
8009 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
8010 instead of returning a token type immediately.
8011 (<INITIAL>"{"): Set token type.
8012 (<SC_BRACED_CODE>"}"): Use it.
8013 (handle_action_dollar, handle_action_at): Now returns bool
8014 indicating success. Fail if ! current_rule; this prevents a core dump.
8015 (handle_symbol_code_dollar, handle_symbol_code_at):
8016 Remove; merge body into caller.
8017 (handle_dollar, handle_at): Complain in invalid contexts.
8018
8019 * NEWS, doc/bison.texinfo: Document the above.
8020 * NEWS: Fix years and program names in copyright notice.
8021
8022 2002-12-17 Paul Eggert <eggert@twinsun.com>
8023
8024 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
8025 Reporting, Table of Symbols): Omit mentions of %lex-param and
8026 %parse-param from the documentation for now.
8027
8028 2002-12-15 Paul Eggert <eggert@twinsun.com>
8029
8030 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
8031 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
8032 lookahead symbol, and which sets yychar in parser actions) and it
8033 disagreed with the Bison documentation. Bug
8034 reported by Andrew Walrond.
8035
8036 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
8037 as the caller now does that.
8038 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
8039 (YYEMPTY): Parenthesize right hand side, since others use it.
8040 (yyparse): Don't assume that our generated code is the only code
8041 that sets yychar.
8042
8043 2002-12-13 Paul Eggert <eggert@twinsun.com>
8044
8045 Version 1.75d.
8046
8047 POSIX requires a "yacc" command.
8048 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
8049 (MOSTLYCLEANFILES): Add yacc.
8050 (yacc): New rule.
8051 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
8052 as an alias for bison y.
8053
8054 * po/LINGUAS: Add da.
8055
8056 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
8057 problem with latest <getopt.h>.
8058 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
8059
8060 * doc/fdl.texi: Upgrade to 1.2.
8061 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
8062 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
8063 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
8064 gnulib.
8065 * config/install-sh: Sync with autotools.
8066
8067 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
8068 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
8069 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
8070 locations are requested.
8071 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
8072 locations are requested.
8073
8074 2002-12-12 Paul Eggert <eggert@twinsun.com>
8075
8076 Remove unportable casts and storage allocation tricks.
8077 While we're at it, remove almost all casts, since they
8078 usually aren't needed and are a sign of trouble.
8079
8080 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
8081
8082 * src/derives.c (derives_compute): Do not subtract NTOKENS from
8083 the pointer DSET returned by malloc; this isn't portable.
8084 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
8085 Similarly for DERIVES.
8086 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
8087 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
8088 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
8089
8090 * src/derives.c (derives_compute): Do not bother invoking
8091 int_of_rule_number, since rule numbers are integers.
8092
8093 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
8094 rather than XMALLOC (char, N).
8095
8096 * src/files.c (filename_split): Rewrite to avoid cast.
8097
8098 * src/gram.h (symbol_number_as_item_number,
8099 item_number_as_symbol_number, rule_number_as_item_number,
8100 item_number_as_rule_number):
8101 Now inline functions rather than macros, to avoid casts.
8102 * src/state.h (state_number_as_int): Likewise.
8103 * src/tables.c (state_number_to_vector_number,
8104 symbol_number_to_vector_number): Likewise.
8105
8106 * src/gram.h (int_of_rule_number): Remove; no longer used.
8107
8108 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
8109 since the resulting storage is always stored into.
8110
8111 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
8112 where it's needed.
8113
8114 * src/muscle_tab.c (muscle_m4_output):
8115 Now inline. Return bool, not int.
8116 * src/state.c (state_compare): Likewise.
8117 * src/symtab.c (symbol_check_defined,
8118 symbol_check_alias_consistency, symbol_pack, symbol_translation,
8119 hash_compare_symbol, hash_symbol):
8120 Likewise.
8121 * src/uniqstr.c (uniqstr_print): Likewise.
8122 * src/muscle_tab.c (muscle_m4_output_processor):
8123 New function, to avoid casts.
8124 * src/state.c (state_comparator, stage_hasher): Likewise.
8125 * src/symtab.c (symbol_check_defined_processor,
8126 symbol_check_alias_consistency_processor, symbol_pack_processor,
8127 symbol_translation_processor, hash_symbol_comparator,
8128 hash_symbol_hasher): Likewise.
8129 * src/uniqstr.c (uniqstr_print_processor): Likewise.
8130 * src/muscle_tab.c (muscles_m4_output):
8131 Use new functions instead of casting old functions unportably.
8132 * src/state.c (state_hash_new): Likewise.
8133 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
8134 symbols_token_translations_init):
8135 Likewise.
8136 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
8137
8138 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
8139 var instead of casting to long, to avoid casts.
8140 (prepare_states): Use MALLOC rather than alloca, so that we don't
8141 have to worry about alloca.
8142 * src/state.c (state_hash_lookup): Likewise.
8143
8144 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
8145 local var instead of casting to unsigned char, to avoid casts.
8146
8147 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
8148 STATE_ALLOC): Remove.
8149 (transitions_new, errs_new, reductions_new, state_new): Use malloc
8150 rather than calloc, and use offsetof to avoid allocating slightly
8151 too much storage.
8152 (state_new): Initialize all members.
8153
8154 * src/state.c (state_hash): Use unsigned accumulator, not signed.
8155
8156 * src/symtab.c (symbol_free): Remove; unused.
8157 (symbol_get): Remove cast in lhs of assignment.
8158 (symbols_do): Now static. Accept generic arguments, not
8159 hashing-related ones.
8160
8161 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
8162 (symbol_processor): Remove.
8163 (symbols_do): Remove decl; now static.
8164
8165 * src/system.h (alloca): Remove; decl no longer needed.
8166 (<stddef.h>): Include, for offsetof.
8167 (<inttypes.>, <stdint.h>): Include if available.
8168 (uintptr_t): New type, if system lacks it.
8169 (CALLOC, MALLOC, REALLOC): New macros.
8170 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
8171 new macros.
8172
8173 * src/tables.c (table_size): Now int, to pacify GCC.
8174 (table_grow, table_ninf_remap): Use signed table size.
8175 (save_row): Don't bother initializing locals when not needed.
8176 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
8177 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
8178
8179 * src/vcg.h: Correct misspellings.
8180
8181 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
8182
8183
8184 * src/getargs.c (getargs): Don't assume EOF == -1.
8185
8186 2002-12-09 Paul Eggert <eggert@twinsun.com>
8187
8188 Change identifier spellings to avoid collisions with names
8189 that are reserved by POSIX.
8190
8191 Don't use names ending in _t, since POSIX reserves them.
8192 For consistency, remove _e and _s endings -- they're weren't
8193 needed to remove ambiguity. All uses changed.
8194 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
8195 turn was just renamed from struniq_t.
8196 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
8197 which in turn was just renamed from struniq_processor_t.
8198 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
8199 in turn was renamed from hash_compare_struniq_t.
8200 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
8201 (state_list): Renamed from state_list_t.
8202 * src/assoc.h (assoc): Renamed from assoc_t.
8203 * src/conflicts.c (enum conflict_resolution): Renamed from
8204 enum conflict_resolution_e.
8205 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
8206 (rule_list): Renamed from rule_list_t.
8207 * src/getargs.h (enum trace): Renamed from enum trace_e.
8208 (enum report): Renamed from enum report_e.
8209 * src/gram.h (item_number): Renamed from item_number_t.
8210 (rule_number): Renamed from rule_number_t.
8211 (struct rule_s): Remove the "rule_s" part; not used.
8212 (rule): Renamed from rule_t.
8213 (rule_filter): Renamed from rule_filter_t.
8214 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
8215 (goto_list): Renamed from goto_list_t.
8216 * src/lalr.h (goto_number): Renamed from goto_number_t.
8217 * src/location.h (location): Renamed from location_t.
8218 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
8219 and moved here from:
8220 * src/muscle_tab.h (muscle_entry_t): here.
8221 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
8222 (rule_list): Renamed from rule_list_t.
8223 * src/print_graph.c (static_graph): Renamed from graph.
8224 * src/reader.h (braced_code): Renamed from braced_code_t.
8225 Remove brace_code_e tag.
8226 * src/relation.h (relation_node): Renamed from relation_node_t.
8227 (relation_nodes): Renamed from relation_nodes_t.
8228 (relation): Renamed from relation_t.
8229 * src/state.h (state_number): Renamed from state_number_t.
8230 (struct state): Renamed from struct state_s.
8231 (state): Renamed from state_t.
8232 (transitions): Renamed from transitions_t. Unused (and
8233 misspelled) transtion_s tag removed.
8234 (errs): Renamed from errs_t. Unused errs_s tag removed.
8235 (reductions): Renamed from reductions_t. Unused tag
8236 reductions_s removed.
8237 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
8238 (struct symbol_list): Renamed from struct symbol_list_s.
8239 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
8240 (struct symbol): Renamed from struct symbol_s.
8241 (symbol): Renamed from symbol_t.
8242 * src/tables.c (vector_number): Renamed from vector_number_t.
8243 (action_number): Renamed from action_t.
8244 * src/tables.h (base_number): Renamed from base_t.
8245 * src/vcg.h (enum color): Renamed from enum color_e.
8246 (enum textmode): Renamed from enum textmode_e.
8247 (enum shape): Renamed from enum shape_e.
8248 (struct colorentry): Renamed from struct colorentry_s.
8249 (struct classname): Renamed from struct classname_s.
8250 (struct infoname): Renamed from struct infoname_s.
8251 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
8252 (enum decision): Renamed from enum decision_e.
8253 (enum orientation): Renamed from enum orientation_e.
8254 (enum alignment): Renamed from enum alignment_e.
8255 (enum arrow_mode): Renamed from enum arrow_mode_e.
8256 (enum crossing_type): Renamed from enum crossing_type_e.
8257 (enum view): Renamed from enum view_e.
8258 (struct node): Renamed from struct node_s.
8259 (node): Renamed from node_t.
8260 (enum linestyle): Renamed from enum linestyle_e.
8261 (enum arrowstyle): Renamed from enum arrowstyle_e.
8262 (struct edge): Renamed from struct edge.
8263 (edge): Renamed from edge_t.
8264 (struct graph): Renamed from struct graph_s.
8265 (graph): Renamed from graph_t.
8266 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
8267 Rename value_t -> value.
8268 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
8269 value_t_as_yystype -> value_as_yystype.
8270
8271 Don't include <errno.h> in the mainstream code, since it
8272 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
8273 * lib/get-errno.c, lib/get-errno.h: New files.
8274 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
8275 get-errno.c.
8276 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
8277 * src/output.c (output_skeleton): Likewise.
8278 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
8279 instead of errno.
8280 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
8281 Likewise.
8282 (handle_action_dollar, handle_action_at): Likewise.
8283 * src/system.h: Do not include <errno.h>.
8284 (TAB_EXT): Renamed from EXT_TAB.
8285 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
8286
8287 Avoid str[a-z]*, since <string.h> reserves that name space.
8288 Change all instances of "struniq" in names to "uniqstr", and
8289 likewise for "STRUNIQ" and "UNIQSTR".
8290 * src/uniqstr.c: Renamed from src/struniq.c.
8291 * src/uniqstr.h: Renamed from src/struniq.h.
8292 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
8293 * src/files.c (strsuffix): Remove; unused.
8294 (concat2): Renamed from stringappend. Now static.
8295 * src/files.h (strsuffix, stringappend): Remove; unused.
8296 * src/parse-gram.y (<chars>): Renamed from <string>.
8297 (<uniqstr>): Renamed from <struniq>.
8298 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
8299 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
8300 (struct graph_s.expand): Renamed from struct graph_s.stretch.
8301 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
8302 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
8303 (N_EXPAND): Renamed from N_STRETCH.
8304
8305 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
8306 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
8307 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
8308 Remove; unused.
8309 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
8310 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
8311 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
8312 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
8313 (BASE_MAXIMUM): Renamed from BASE_MAX.
8314 (BASE_MINIMUM): Renamed from BASE_MIN.
8315 (ACTION_MAX): Remove; unused.
8316 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
8317 Unnecessary casts removed from above defines.
8318
8319
8320 Fix misspelling in names.
8321 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
8322 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
8323 G_NODE_ALIGNEMENT.
8324
8325
8326 * lib/timevar.c (timevar_report): Renamed from time_report,
8327 for consistency with other names.
8328 * lib/timevar.h (timevar_report): New decl.
8329 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
8330
8331
8332 Sort include-file uses.
8333
8334 Reorder all include files under src to be in the order "system.h".
8335 then the ../lib include files in angle brackets (alphabetized),
8336 then the . include files in double-quotes (alphabetized). Fix
8337 dependency breakages encountered in this process, as follows:
8338 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
8339 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
8340 * src/state.h: Include "symtab.h".
8341
8342 2002-12-08 Paul Eggert <eggert@twinsun.com>
8343
8344 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
8345 since this causes problems when __file__ contains character
8346 sequences like "@" that are treated specially by src/scan-skel.l.
8347 Instead, just use the file's basename. This fixes the bug
8348 reported by Martin Mokrejs in
8349 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
8350
8351 2002-12-06 Paul Eggert <eggert@twinsun.com>
8352
8353 Add support for rules that do not have trailing semicolons, as
8354 POSIX requires. Improve the quality of locations in Bison
8355 diagnostics.
8356
8357 * src/location.c: Include <quotearg.h>.
8358 (empty_location): Now const.
8359 (location_print): New function. Follow the recommendation of the
8360 GNU Coding Standards for locations that span file boundaries.
8361 * src/location.h: Do not include <quotearg.h>; no longer needed.
8362 (boundary): New type.
8363 (location_t): Use it. This allows locations to span file boundaries.
8364 All member uses changed: file -> start.file or end.file (as needed),
8365 first_line -> start.line, first_column -> start.column,
8366 last_line -> end.line, last_column -> end.column.
8367 (equal_boundaries): New function.
8368 (LOCATION_RESET, LOCATION_STEP): Remove.
8369 (LOCATION_PRINT): Remove. All callers changed to use location_print.
8370 (empty_location): Now const.
8371 (location_print): New decl.
8372 * src/parse-gram.y (lloc_default): New function, which handles
8373 empty locations more accurately.
8374 (YYLLOC_DEFAULT): Use it.
8375 (%token COLON): Remove.
8376 (%token ID_COLON): New token.
8377 (rules): Use it.
8378 (declarations, rules): Remove trailing semicolon.
8379 (declaration, rules_or_grammar_declaration):
8380 Allow empty (";") declaration.
8381 (symbol_def): Remove empty actions; no longer needed.
8382 (rules_or_grammar_declaration): Remove trailing semicolon.
8383 (semi_colon.opt): Remove.
8384 * src/reader.h: Include location.h.
8385 (scanner_cursor): New decl.
8386 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
8387 rolling our own.
8388 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
8389 of *loc.
8390 (STEP): Remove. No longer needed, now that adjust_location does
8391 the work. All uses removed.
8392 (scanner_cursor): New var.
8393 (adjust_location): Renamed from extend_location. It now sets
8394 *loc and adjusts the scanner cursor. All uses changed.
8395 Don't bother testing for CR.
8396 (handle_syncline): Remove location arg; now updates scanner cursor.
8397 All callers changed.
8398 (unexpected_end_of_file): Now accepts start boundary of token or
8399 comment, not location. All callers changed. Update scanner cursor,
8400 not the location.
8401 (SC_AFTER_IDENTIFIER): New state.
8402 (context_state): Renamed from c_context. All uses changed.
8403 (id_loc, code_start, token_start): New local vars.
8404 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
8405 processing of Yacc white space and equivalents here.
8406 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
8407 instead of returning ID immediately, since we need to search for
8408 a subsequent colon.
8409 (<INITIAL>"'", "\""): Save token_start.
8410 (<INITIAL>"%{", "{", "%%"): Save code_start.
8411 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
8412 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
8413 BEGIN context_state at end, not INITIAL.
8414 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
8415 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
8416 Return correct token start.
8417 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
8418 the start of a character, string or multiline comment is found.
8419 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
8420 Reduction): Adjust reported locations to match the more-precise
8421 results now expected.
8422 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
8423 * tests/reduce.at (Useless Rules, Reduced Automaton,
8424 Underivable Rules): Likewise.
8425 * tests/regression.at (Invalid inputs): No longer `expecting ";"
8426 or "|"' now that so many other tokens are allowed by the new grammar.
8427
8428 * src/complain.h (current_file): Remove duplicate decl;
8429 current_file is now owned by files.h.
8430 * src/complain.c, src/scan-gram.l: Include files.h.
8431
8432 2002-12-06 Paul Eggert <eggert@twinsun.com>
8433
8434 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
8435 promotes to int; it might be unsigned int.
8436 * data/yacc.c (yy_reduce_print): Likewise.
8437
8438 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
8439 be #defined in the prologue, not in the Bison declarations.
8440 This fixes Debian Bug 102878, reported by Shaul Karl.
8441
8442 2002-12-02 Paul Eggert <eggert@twinsun.com>
8443
8444 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
8445 * lib/strtoul.c: New file, from gnulib.
8446 This fixes a porting bug reported by Peter Klein in
8447 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
8448
8449 2002-11-30 Paul Eggert <eggert@twinsun.com>
8450
8451 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
8452 and put only a forward declaration in the prologue. This is for
8453 consistency with the other scanner helper functions.
8454
8455 Type clashes now generate warnings, not errors, since it
8456 appears that POSIX may allow some grammars with type clashes.
8457 * src/reader.c (grammar_current_rule_check): Warn about
8458 type clashes instead of complaining.
8459 * tests/input.at (Type Clashes): Expect warnings, not complaints.
8460
8461 Add Yacc library, since POSIX requires it.
8462 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
8463 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
8464 * lib/main.c, lib/yyerror.c: New files.
8465
8466 gram_error can be static; it need not be extern.
8467 * src/reader.h (gram_error): Remove decl.
8468 * src/parse-gram.y (gram_error): Now static. Add static decl.
8469 (print_token_value): Omit parameter names from forward decl,
8470 for consistency.
8471
8472 2002-11-29 Paul Eggert <eggert@twinsun.com>
8473
8474 * doc/bison.texinfo: Emphasize that yylex and yyerror must
8475 be declared before being used. E.g., one should typically
8476 declare them in the prologue. Use GNU coding style in examples.
8477 Put "const" consistently after the type it modifies. Mention
8478 that C99 supports "inline". Mention that yyerror traditionally
8479 returns "int".
8480
8481 %parse-param and %lex-param now take just one argument, the
8482 declaration; the argument name is deduced from the declaration.
8483
8484 * doc/bison.texinfo (Parser Function, Pure Calling, Error
8485 Reporting, Table of Symbols): Document this.
8486 * src/parse-gram.y (add_param): New function.
8487 (COMMA): Remove.
8488 (declaration): Implement new rule for %parse-param and %lex-param.
8489 * src/scan-gram.l: "," now elicits a warning, rather than being
8490 a token; this is more compatible with byacc.
8491 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
8492
8493 2002-11-27 Paul Eggert <eggert@twinsun.com>
8494
8495 Rename identifiers to avoid real and potential collisions.
8496
8497 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
8498 to avoid collision with lex macro described by Bruce Lilly in
8499 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
8500 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
8501 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
8502 * src/parse-gram.y (print_token_value): Renamed from yyprint.
8503 All uses changed.
8504 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
8505 The name "yycontrol" violates the name space rules, and this stuff
8506 wasn't being used anyway.
8507 (input): Remove action; this stuff wasn't being used.
8508 (gram_error): Rename local variable yylloc -> loc.
8509 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
8510 (YY_DECL): Don't use "yy" at start of local variables.
8511 All uses changed, e.g., yylloc -> loc.
8512 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
8513 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
8514 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
8515 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
8516
8517 * src/parse-gram.y (gram_error): loc is now const *.
8518 * src/reader.h (gram_error): Likewise.
8519
8520 2002-11-24 Paul Eggert <eggert@twinsun.com>
8521
8522 Version 1.75c.
8523
8524 * tests/actions.at (Actions after errors): Use an output format
8525 more similar to that of the Printers and Destructors test.
8526 Test the position of the ';' token too.
8527 (Printers and Destructors): Likewise.
8528 (Printers and Destructors: %glr-parser): Remove for now, to avoid
8529 unnecessarily alarming people when the test fails.
8530
8531 * data/yacc.c (yyerrlab1): Move this label down, so that the
8532 parser does not discard the lookahead token if the user code
8533 invokes YYERROR. This change is required for POSIX conformance.
8534
8535 * lib/error.c: Sync with gnulib.
8536
8537 2002-11-22 Paul Eggert <eggert@twinsun.com>
8538
8539 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
8540 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
8541 * lib/xmalloc.c: Likewise.
8542
8543 2002-11-20 Paul Eggert <eggert@twinsun.com>
8544
8545 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
8546
8547 2002-11-20 Paul Eggert <eggert@twinsun.com>
8548
8549 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
8550 should use `if (! x) abort ();' rather than `assert (x);', and
8551 anyway it's one less thing to worry about configuring.
8552
8553 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
8554 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
8555 and replace all instances of assert with abort.
8556 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8557 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
8558
8559 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
8560 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
8561 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
8562 hash_find_entry, hash_rehash, hash_insert): Likewise.
8563 * src/conflicts.c (resolve_sr_conflict): Likewise.
8564 * src/lalr.c (set_goto_map, map_goto): Likewise.
8565 * src/nullable.c (nullable_compute): Likewise.
8566 * src/output.c (prepare_rules, token_definitions_output): Likewise.
8567 * src/reader.c (packgram, reader): Likewise.
8568 * src/state.c (state_new, state_free, state_transitions_set,
8569 state_reduction_find): Likewise.
8570 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
8571 symbol_pack): Likewise.
8572 * src/tables.c (conflict_row, pack_vector): Likewise.
8573 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
8574 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
8575 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
8576 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
8577
8578 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
8579 (ARGMATCH_CONSTRAINT): New macro.
8580 (ARGMATCH_ASSERT): Use it.
8581
8582 * src/system.h (verify): New macro.
8583 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
8584 rather than assert.
8585 * src/tables.c (tables_generate): Likewise.
8586
8587 * src/struniq.c (struniq_assert): Now returns void, and aborts
8588 if the assertion is false.
8589 (struniq_assert_p): Remove.
8590 * src/struniq.h: Likewise.
8591
8592 2002-11-18 Paul Eggert <eggert@twinsun.com>
8593
8594 * data/glr.c (yygetLRActions): Replace `yyindex' with
8595 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
8596 This fixes the regression with Sun ONE Studio 7 cc that I reported in
8597 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
8598
8599 2002-11-18 Akim Demaille <akim@epita.fr>
8600
8601 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
8602 space.
8603 From Tim Van Holder.
8604
8605 2002-11-17 Paul Eggert <eggert@twinsun.com>
8606
8607 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
8608 to "SyntaxError" for consistency with my 2002-11-15 change.
8609
8610 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
8611 not define to {}, since this breaks the common use of `YYDPRINTF
8612 ((...));' if a single statement is desired (e.g. before `else').
8613 Work around GCC warnings by surrounding corresponding calls with
8614 {} if needed.
8615 (yyhasResolvedValue): Remove unused function.
8616 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
8617 loop body.
8618 (yyreportSyntaxError): Renamed from yyreportParseError.
8619 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
8620 All uses changed.
8621 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
8622 extern when possible. Remove unused initializations.
8623
8624 2002-11-16 Akim Demaille <akim@epita.fr>
8625
8626 Augment the similarity between GLR and LALR traces.
8627
8628 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
8629 (YY_REDUCE_PRINT): New.
8630 (yyparse): Use them.
8631 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
8632 YYDPRINT here.
8633 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
8634 state reached after the reduction/recovery, since...
8635 (yyparse, yyprocessOneStack): Report the state we are entering in.
8636
8637 2002-11-16 Akim Demaille <akim@epita.fr>
8638
8639 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
8640 Add support for --trace=skeleton.
8641 * src/scan-skel.l: %option debug.
8642 Scan strings of non-@ or \n instead of character by character.
8643 (scan_skel): Handle trace_skeleton.
8644 (QPUTS): New.
8645 (@output_parser_name@, @output_header_name@): ``Restore'' their
8646 support (used to be M4 macros).
8647 * data/yacc.c: Quote larger chunks, a la glr.c.
8648 * data/lalr1.cc: Likewise.
8649 The header guards are no longer available, so use some other
8650 string than `YYLSP_NEEDED'.
8651
8652 2002-11-16 Akim Demaille <akim@epita.fr>
8653
8654 Make the ``Printers and Destructors'' test more verbose, taking
8655 `yacc.c''s behavior as (possibly wrong) reference.
8656
8657 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
8658 instead of fprint on stdout.
8659 Set and report the last_line of the symbols.
8660 Consistently display values and locations.
8661
8662 2002-11-16 Paul Eggert <eggert@twinsun.com>
8663
8664 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
8665
8666 2002-11-15 Paul Eggert <eggert@twinsun.com>
8667
8668 * tests/actions.at (Actions after errors): New test case.
8669
8670 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
8671 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
8672 tests/action.at, tests/calc.at, tests/conflicts.at,
8673 tests/cxx-type.at, tests/regression.at:
8674 "parse error" -> "syntax error" for POSIX compatibility.
8675 "parsing stack overflow..." -> "parser stack overflow" so
8676 that code matches Bison documentation.
8677
8678 2002-11-15 Akim Demaille <akim@epita.fr>
8679
8680 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
8681 take two BRACED_CODE, not two string_content.
8682 Free the scanner's obstack when we are done.
8683 (code_content): New.
8684 * tests/calc.at: Adjust.
8685 * doc/bison.texinfo: Adjust.
8686 Also, make sure to include the `,' for these declarations.
8687
8688 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
8689
8690 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
8691 definition; avoids potential autoreconf problems.
8692
8693 2002-11-15 Akim Demaille <akim@epita.fr>
8694
8695 Always check the value returned by yyparse.
8696
8697 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
8698 returned by yyparse.
8699 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
8700 Adjust calls.
8701 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
8702 returned by yyparse.
8703
8704 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8705
8706 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
8707 on input.at test.
8708
8709 2002-11-14 Paul Eggert <eggert@twinsun.com>
8710
8711 * src/output.c (output_skeleton): Call xfopen instead of
8712 duplicating xfopen's body.
8713
8714 Fix bugs reported by Nelson H. F. Beebe in
8715 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
8716
8717 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
8718 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
8719 Group compiler. Instead, use "$CC -E bar.c". Include the .h
8720 file twice in the grammar, as an extra check.
8721
8722 * tests/input.at (Torturing the Scanner): Surround the
8723 backslash-newline tests with "#if 0", to make it less likely that
8724 we'll run into compiler bugs. Bring back solitary \ inside
8725 comment, but add a closing comment to work around HP C bug. Don't
8726 test backslash-newline in C character constant.
8727
8728 2002-11-14 Akim Demaille <akim@epita.fr>
8729
8730 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
8731 status of the compiler.
8732 Calling `exit 1' is no longer needed.
8733 Reported by Nelson H. F. Beebe.
8734
8735 2002-11-14 Akim Demaille <akim@epita.fr>
8736
8737 * tests/atlocal.in (CPPFLAGS): We have config.h.
8738 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
8739 New.
8740 * tests/actions.at, tests/calc.at, tests/conflicts.at,
8741 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
8742 * tests/regression.at, tests/torture.at: Use them for all the
8743 grammars that are to be compiled.
8744 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
8745 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
8746 * doc/bison.texinfo (GLR Parsers): Document `inline'.
8747
8748 2002-11-14 Akim Demaille <akim@epita.fr>
8749
8750 * doc/bison.texinfo: Various formatting changes (alignments in
8751 samples, additional @group/@end group, GCS in samples.
8752 Use @deffn instead of simple @table to define the directives,
8753 macros, variables etc.
8754
8755 2002-11-13 Paul Eggert <eggert@twinsun.com>
8756
8757 Fix some bugs reported by Albert Chin-A-Young in
8758 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
8759
8760 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8761 -o c"; the HP C compiler chatters during compilation.
8762 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
8763 * tests/headers.at (export YYLTYPE): Likewise.
8764
8765 * tests/input.at (Torturing the Scanner): Remove lines containing
8766 solitary backslashes, as they tickle a bug in the HP C compiler.
8767
8768 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
8769 comments, since they're not portable. Use GNU coding style.
8770
8771 2002-11-13 Akim Demaille <akim@epita.fr>
8772
8773 * data/yacc.c: Leave bigger chunks of quoted text.
8774 (YYDSYMPRINTF): New.
8775 Use it to report symbol activities.
8776 * data/glr.c (YYDSYMPRINTF): New.
8777 Use it.
8778
8779 2002-11-12 Paul Eggert <eggert@twinsun.com>
8780
8781 Version 1.75b.
8782
8783 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
8784 (yyglrReduce): Return yyok, not 0.
8785 This should avoid the enumerated-type warnings reported
8786 by Nelson H. F. Beebe in
8787 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
8788
8789 * lib/bbitset.h (BITSET_INLINE): Remove.
8790 * lib/bitset.h [! BITSET_INLINE]: Remove.
8791 (bitset_set, bitset_reset, bitset_test): Rename local vars
8792 to avoid shadowing warnings by GCC.
8793
8794 * data/glr.c (inline): Remove #define. It's the user's
8795 responsibility to #define it away, just like 'const'.
8796 This fixes one of the bugs reported by Nelson H. F. Beebe in
8797 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
8798
8799 * Makefile.maint (po-check): Scan .l and .y files instead of the
8800 .c and the .h files that they generate. This fixes the bug
8801 reported by Tim Van Holder in:
8802 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
8803 Look for N_ as well as for _. Try to avoid matching #define for
8804 N_ and _.
8805 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
8806 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
8807 * src/scan-gram.l: Revamp regular expressions so that " and '
8808 do not confuse xgettext.
8809
8810 * src/struniq.h (struniq_new): Do not declare the return type
8811 to be 'const'; this violates the C standard.
8812 * src/struniq.c (struniq_new): Likewise.
8813
8814 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
8815
8816 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
8817 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
8818 linker.
8819
8820 2002-11-12 Akim Demaille <akim@epita.fr>
8821
8822 * Makefile.maint: Sync with Autoconf:
8823 (local_updates): New.
8824
8825 2002-11-12 Akim Demaille <akim@epita.fr>
8826
8827 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
8828
8829 2002-11-12 Akim Demaille <akim@epita.fr>
8830
8831 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
8832 locations.
8833
8834 2002-11-12 Akim Demaille <akim@epita.fr>
8835
8836 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
8837 not yyvalue.
8838
8839 2002-11-12 Akim Demaille <akim@epita.fr>
8840
8841 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
8842 Use it to test the GLR parser.
8843
8844 2002-11-12 Akim Demaille <akim@epita.fr>
8845
8846 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
8847 defines it.
8848 * data/glr.c (yystos): New.
8849 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
8850 (YYDSYMPRINT): New.
8851 (yyval): Don't define it, it is handled via M4.
8852 (yyrecoverParseError): Free verbosely the discarded symbols.
8853 * data/yacc.c (yysymprint): Remove, rather...
8854 (b4_yysymprint_generate): invoke.
8855 * data/c.m4 (b4_yysymprint_generate): New.
8856 Accept pointers as arguments, as opposed to the version from
8857 yacc.c.
8858 (b4_yydestruct_generate): Likewise.
8859 * tests/cations.at (Printers and Destructors): Use Bison directives
8860 instead of CPP macros.
8861 Don't rely on internal details.
8862
8863 2002-11-12 Akim Demaille <akim@epita.fr>
8864
8865 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
8866 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
8867 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
8868 it against YYEMPTY and so forth), work on yytoken (i.e., set
8869 it to YYEMPTY etc.).
8870 (yydestruct): Replace with a b4_yydestruct_generate invocation.
8871 (b4_symbol_actions): Remove.
8872 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
8873 for 0, end-of-input.
8874
8875 2002-11-12 Akim Demaille <akim@epita.fr>
8876
8877 * doc/bison.texinfo (Destructor Decl): New.
8878
8879 2002-11-12 Akim Demaille <akim@epita.fr>
8880
8881 * src/tables.c (tables_generate): Use free for pointers that
8882 cannot be NULL, not XFREE.
8883 (pack_vector): Use assert, not fatal, for bound violations.
8884 * src/state.c (state_new): Likewise.
8885 * src/reader.c (reader): Likewise.
8886 * src/lalr.c (set_goto_map): Likewise.
8887 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
8888 the file name.
8889
8890 2002-11-12 Akim Demaille <akim@epita.fr>
8891
8892 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
8893 Restore.
8894 * src/scan-gram.l (last_string): Is global to the file, not to
8895 yylex.
8896 * src/parse-gram.y (input): Don't append the epilogue here,
8897 (epilogue.opt): do it here, and free the scanner's obstack.
8898 * src/reader.c (epilogue_set): Rename as...
8899 (epilogue_augment): this.
8900 * data/c.m4 (b4_epilogue): Defaults to empty.
8901
8902 2002-11-12 Akim Demaille <akim@epita.fr>
8903
8904 * src/getargs.c (long_options): Remove duplicates.
8905 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
8906 Remove.
8907 * doc/bison.rnh: Remove.
8908 * doc/bison.texinfo (VMS Invocation): Remove.
8909
8910 2002-11-12 Akim Demaille <akim@epita.fr>
8911
8912 * src/struniq.h, src/struniq.c (struniq_t): Is const.
8913 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
8914
8915 Use struniq for symbols.
8916
8917 * src/symtab.h (symbol_t): The tag member is a struniq.
8918 (symbol_type_set): Adjust.
8919 * src/symtab.c (symbol_new): Takes a struniq.
8920 (symbol_free): Don't free the tag member.
8921 (hash_compare_symbol_t, hash_symbol_t): Rename as...
8922 (hash_compare_symbol, hash_symbol): these.
8923 Use the fact that tags as struniqs.
8924 (symbol_get): Use struniq_new.
8925 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
8926 Returns a strniq.
8927 * src/reader.h (merger_list, grammar_currentmerge_set): The name
8928 and type members are struniqs.
8929 * src/reader.c (get_merge_function)
8930 (grammar_current_rule_merge_set): Adjust.
8931 (TYPE, current_type): Are struniq.
8932
8933 Use struniq for file names.
8934
8935 * src/files.h, src/files.c (infile): Split into...
8936 (grammar_file, current_file): these.
8937 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
8938 * src/reduce.c (reduce_print): Likewise.
8939 * src/getargs.c (getargs): Likewise.
8940 * src/complain.h, src/complain.c: Likewise.
8941 * src/main.c (main): Call struniqs_new early enough to use it for
8942 file names.
8943 Don't free the input file name.
8944
8945 2002-11-12 Akim Demaille <akim@epita.fr>
8946
8947 * src/symtab.c (symbol_free): Remove dead deactivated code:
8948 type_name are properly removed.
8949 Don't use XFREE to free items that cannot be NULL.
8950 * src/struniq.h, src/struniq.c: New.
8951 * src/main.c (main): Initialize/free struniqs.
8952 * src/parse-gram.y (%union): Add astruniq member.
8953 (yyprint): Adjust.
8954 * src/scan-gram.l (<{tag}>): Return a struniq.
8955 Free the obstack bit that used to store it.
8956 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
8957
8958 2002-11-11 Paul Eggert <eggert@twinsun.com>
8959
8960 Revamp to fix many (but not all) of the C- and M4-related quoting
8961 problems. Among other things, this fixes the Bison bug reported
8962 by Jan Hubicka when processing the Bash grammar; see:
8963 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
8964
8965 Use new @ escapes consistently. Represent brackets with @{ and @}
8966 rather than @<:@ and @:>@, since this works a bit better with dumb
8967 editors like vi. Represent @ with @@, since @ is now consistently
8968 an escape. Use @oline@ and @ofile@ rather than __oline__ and
8969 __ofile__, to avoid unexpected expansions. Similarly, use @output
8970 rather than #output.
8971
8972 * data/c.m4 (b4_copyright): Omit file name from comment, since
8973 the file name could contain "*/".
8974 (b4_synclines_flag): Don't quote the 2nd argument; it should already
8975 be quoted. All uses changed.
8976
8977 * data/glr.c: Use new @ escapes consistently.
8978 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
8979 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
8980 Remove, since they couldn't handle arbitrary characters in file
8981 names.
8982 * data/lalr1.cc: Likewise.
8983 * data/yacc.c: Likewise.
8984
8985 * src/files.c (output_infix): Remove; all uses removed.
8986 * src/files.h: Likewise.
8987
8988 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
8989 mishandled funny characters in file names, and anyway it isn't
8990 needed any more.
8991 * data/yacc.c: Likewise.
8992 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
8993
8994 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
8995 * data/yacc.c: Likewise.
8996
8997 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
8998 strings now.
8999 (muscle_init): Quote filename as a C string.
9000 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
9001 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
9002 * src/output.c (escaped_file_name_output): New function.
9003 (prepare_symbols): Quote tokens for M4.
9004 (prepare): Don't insert output_infix, output_prefix,
9005 output_parser_name, output_header_name; this is now down by scan-skel.
9006 Insert skeleton as a C string.
9007
9008 * src/output.c (user_actions_output, symbol_destructors_output,
9009 symbol_printers_output): Quote filenames for C and M4.
9010 * src/reader.c (prologue_augment, epilogue_set): Likewise.
9011
9012 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
9013 escapes other than \\ and \'; this simplifies the code.
9014 (<SC_STRING>): Likewise, for \\ and \".
9015 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
9016 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
9017 Use new escapes @{ and @} for [ and ].
9018
9019 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
9020 them with auto vars.
9021 Switch to new escape scheme, where @ is the escape character uniformly.
9022 Abort if a stray escape character is found. Avoid unbounded input
9023 buffer when parsing non-escaped text.
9024
9025 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
9026 __oline__, #output, $@, and @{ do not have unintended meanings.
9027
9028 2002-11-09 Paul Eggert <eggert@twinsun.com>
9029
9030 Fix the test failure due to GCC warnings described in
9031 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
9032 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
9033 evaluate to 0 if it's impossible for NINF to be in the respective
9034 table.
9035 (yygetLRActions, yyrecoverParseError): Use them.
9036
9037 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
9038 counted in the token inserted at end of file. Now takes
9039 location_t *, not location_t, so that the location can be
9040 adjusted. All uses changed.
9041
9042 * tests/regression.at (Invalid inputs): Adjust wording in
9043 diagnostic to match the new behavior.
9044
9045 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
9046 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
9047 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
9048 abort ();'. This reduces the runtime of the "Many lookaheads"
9049 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
9050 GCC 3.2.
9051
9052 2002-11-07 Paul Eggert <eggert@twinsun.com>
9053
9054 * src/parse-gram.y (CHARACTER): Remove unused token.
9055 All uses removed.
9056
9057 * src/scan-gram.l: Remove stack option. We no longer use the
9058 stack, since the stack was never deeper than 1; instead, use the
9059 new auto var c_context to record the stacked value.
9060
9061 Remove nounput option. At an unexpected end of file, we now unput
9062 the minimal input necessary to end cleanly; this simplifies the
9063 code.
9064
9065 Avoid unbounded token sizes where this is easy.
9066
9067 (unexpected_end_of_file): New function.
9068 Use it to systematize the error message on unexpected EOF.
9069 (last-string): Now auto, not static.
9070 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
9071 (scanner_last_string_free): Remove; not used.
9072 (percent_percent_count): Move decl to just before use.
9073 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
9074 not the (never otherwised-used) CHARACTER.
9075
9076 2002-11-07 Akim Demaille <akim@epita.fr>
9077
9078 Let yyerror always receive the msg as last argument, so that
9079 yyerror can be variadic.
9080
9081 * data/yacc.c (b4_yyerror_args): New.
9082 Use it when calling yyerror.
9083 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
9084 Use it when calling yyerror.
9085 * doc/bison.texinfo (Error Reporting): Adjust.
9086 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
9087 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
9088
9089 2002-11-06 Akim Demaille <akim@epita.fr>
9090
9091 #line should have quoted strings.
9092 Ideally, this should be done by m4_quotearg.
9093
9094 * src/scan-skel.l: Include quotearg.h.
9095 Quote __ofile__.
9096 * src/output.c (symbol_printers_output)
9097 (symbol_destructors_output): Quote the file name.
9098
9099 2002-11-06 Akim Demaille <akim@epita.fr>
9100
9101 * tests/regression.at (Invalid inputs): Adjust to the recent
9102 messages.
9103
9104 2002-11-06 Akim Demaille <akim@epita.fr>
9105
9106 Restore --no-lines.
9107 Reported by Jim Kent.
9108
9109 * data/c.m4 (b4_syncline): New.
9110 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
9111 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
9112 * src/output.c (user_actions_output): Likewise.
9113 (prepare): Define 'b4_synclines_flag'.
9114 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
9115
9116 2002-11-06 Akim Demaille <akim@epita.fr>
9117
9118 * src/main.c (main): Free `infile'.
9119 * src/scan-gram.l (handle_syncline): New.
9120 Recognize `#line'.
9121 * src/output.c (user_actions_output, symbol_destructors_output)
9122 (symbol_printers_output): Use the location's file name, not
9123 infile.
9124 * src/reader.c (prologue_augment, epilogue_set): Likewise.
9125
9126 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9127
9128 * src/tables.c (matching_state): Don't allow states to match if
9129 either has GLR conflict entries.
9130
9131 2002-11-05 Paul Eggert <eggert@twinsun.com>
9132
9133 * src/scan-gram.l: Use more accurate diagnostics, e.g.
9134 "integer out of range" rather than "invalid value".
9135 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
9136 accordingly.
9137
9138 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
9139 Also, remove one static variable in the scanner.
9140
9141 * src/scan-gram.l (braces_level): Now auto, not static.
9142 Initialize to zero if the compiler is being picky.
9143 (INITIAL): Clear braces_level instead of incrementing it.
9144 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
9145 as POSIX 1003.1-2001 requires.
9146 * src/system.h (IF_LINT): New macro, taken from coreutils.
9147 * configure.ac: Define "lint" if --enable-gcc-warnings.
9148
9149 2002-11-05 Akim Demaille <akim@epita.fr>
9150
9151 * src/scan-gram.l: When it starts with `%', complain about the
9152 whole directive, not just that `invalid character: %'.
9153
9154 2002-11-04 Akim Demaille <akim@epita.fr>
9155
9156 * Makefile.maint: Update from Autoconf.
9157 (update, cvs-update, po-update, do-po-update): New.
9158
9159 2002-11-04 Akim Demaille <akim@epita.fr>
9160
9161 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
9162 and yyerror.
9163 Have yyerror `use' its arguments.
9164 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
9165 returns true when location & yacc & pure & parse-param.
9166 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
9167
9168 2002-11-04 Akim Demaille <akim@epita.fr>
9169
9170 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
9171 clashes.
9172 * src/scan-gram.l: Use [\'] instead of ['] to pacify
9173 font-lock-mode.
9174 Use complain_at.
9175 Use quote, not quote_n since LOCATION_PRINT no longer uses the
9176 slot 0.
9177
9178 2002-11-03 Paul Eggert <eggert@twinsun.com>
9179
9180 * src/reader.c (get_merge_function, grammar_current_rule_check):
9181 Use consistent diagnostics for reporting type name clashes.
9182 Quote the types with <>, for consistency with Yacc.
9183 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
9184
9185 2002-11-03 Akim Demaille <akim@epita.fr>
9186
9187 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
9188 New.
9189 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
9190 (b4_parse_param): Remove.
9191 Use b4_identification.
9192 Propagate b4_pure_args where needed to pass them to yyerror.
9193 * data/glr.m4 (b4_parse_param): Remove.
9194 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
9195 (b4_lpure_formals): New.
9196 Use b4_identification.
9197 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
9198 b4_user_formals and b4_user_args.
9199 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
9200 (yyreportAmbiguity): When using a pure parser, also need
9201 the location, and the parse-params.
9202 Adjust callers.
9203 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
9204 When using a pure parser, also need the parse-params.
9205 Adjust callers.
9206 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
9207 (%pure-parser + %parse-param) LALR and GLR parsers.
9208 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
9209 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
9210 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
9211 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
9212 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
9213 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
9214 * doc/bison.texinfo: Untabify the whole file.
9215 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
9216 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
9217 (Error Reporting): Adjust to these new directives.
9218 Document %error-verbose, deprecate YYERROR_VERBOSE.
9219
9220 2002-11-03 Akim Demaille <akim@epita.fr>
9221
9222 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
9223 AT_CHECK_CALC_GLR invocations to use % directives, instead of
9224 command line options.
9225 * tests/cxx-type.at: Formatting changes.
9226
9227 2002-11-03 Paul Eggert <eggert@twinsun.com>
9228
9229 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
9230 to count columns correctly, and to check for invalid inputs.
9231
9232 Use mbsnwidth to count columns correctly. Account for tabs, too.
9233 Include mbswidth.h.
9234 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
9235 (extend_location): New function.
9236 (YY_LINES): Remove.
9237
9238 Handle CRLF in C code rather than in Lex code.
9239 (YY_INPUT): New macro.
9240 (no_cr_read): New function.
9241
9242 Scan UCNs, even though we don't fully handle them yet.
9243 (convert_ucn_to_byte): New function.
9244
9245 Handle backslash-newline correctly in C code.
9246 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
9247 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
9248 all uses changed.
9249 (tag, splice): New EREs. Do not allow NUL or newline in tags.
9250 Use {splice} wherever C allows backslash-newline.
9251 YY_STEP after space, newline, vertical-tab.
9252 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9253
9254 (letter, id): Don't assume ASCII; e.g., spell out a-z.
9255
9256 ({int}, handle_action_dollar, handle_action_at): Check for integer
9257 overflow.
9258
9259 (YY_STEP): Omit trailing semicolon, so that it's more like C.
9260
9261 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
9262 as well as \000. Check for UCHAR_MAX, not 255.
9263 Allow \x with an arbitrary positive number of digits, as in C.
9264 Check for overflow here.
9265 Allow \? and UCNs, for compatibility with C.
9266
9267 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
9268 with quote slot used by complain_at.
9269
9270 * tests/input.at: Add tests for backslash-newline, m4 quotes
9271 in symbols, long literals, and funny escapes in strings.
9272
9273 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
9274 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
9275 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
9276 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
9277 * m4/mbswidth.m4: New file, from GNU coreutils.
9278
9279 * doc/bison.texinfo (Grammar Outline): Document // comments.
9280 (Symbols): Document that trigraphs have no special meaning in Bison,
9281 nor is backslash-newline allowed.
9282 (Actions): Document that trigraphs have no special meaning.
9283
9284 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
9285 no longer used.
9286
9287 2002-11-02 Paul Eggert <eggert@twinsun.com>
9288
9289 * src/reader.c: Don't include quote.h; not needed.
9290 (get_merge_function): Reword warning to be consistent with
9291 type clash diagnostic in grammar_current_rule_check.
9292
9293 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
9294 bug in trigraph handling.
9295
9296 * src/output.c (prepare_symbols): When printing token names,
9297 escape "[" as "@<:@" and likewise for "]".
9298
9299 * src/system.h (errno): Remove declaration, as we are now
9300 assuming C89 or better, and C89 guarantees errno.
9301
9302 2002-10-30 Paul Eggert <eggert@twinsun.com>
9303
9304 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
9305 Check for close failures.
9306 * src/files.h (xfclose): Return void, not int, since it always
9307 returned zero.
9308 * src/files.c (xfclose): Likewise. Report I/O error if ferror
9309 indicates one.
9310 * src/output.c (output_skeleton): Use xfclose rather than fclose
9311 and ferror. xfclose now checks ferror.
9312
9313 * data/glr.c (YYLEFTMOST_STATE): Remove.
9314 (yyreportTree): Use a stack-based leftmost state. This avoids
9315 our continuing battles with bogus warnings about initializers.
9316
9317 2002-10-30 Akim Demaille <akim@epita.fr>
9318
9319 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
9320 #if.
9321
9322 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9323
9324 * tests/glr-regr1.at: New test for reported regressions.
9325 * tests/testsuite.at: Add glr-regr1.at test.
9326 * tests/Makefile.am: Add glr-regr1.at test.
9327
9328 2002-10-24 Paul Eggert <eggert@twinsun.com>
9329
9330 Version 1.75a.
9331
9332 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
9333 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
9334 we use malloc. Don't assume 'A' through 'Z' are contiguous.
9335 Don't assume strdup exists; POSIX says its an XSI extension.
9336 Check for buffer overflow on input.
9337
9338 2002-10-24 Akim Demaille <akim@epita.fr>
9339
9340 * src/output.c (output_skeleton): Don't disable M4sugar comments
9341 too soon: it results in comments being expanded.
9342 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
9343 first output.
9344
9345 2002-10-24 Akim Demaille <akim@epita.fr>
9346
9347 * data/yacc.c (m4_int_type): New.
9348 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
9349 char' as only yacc.c wants K&R portability.
9350 * data/glr.c (yysigned_char): Remove.
9351 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
9352 Reported by Quoc Peyrot.
9353
9354 2002-10-23 Paul Eggert <eggert@twinsun.com>
9355
9356 * src/main.c (main): With --trace=time, report times even if a
9357 non-fatal error occurs. Formerly, the times were reported in some
9358 such cases but not in others.
9359 * src/reader.c (reader): Just return if a complaint has been issued,
9360 instead of exiting, so that 'main' can report times.
9361
9362 2002-10-22 Akim Demaille <akim@epita.fr>
9363
9364 * src/system.h: Include sys/types.
9365 Reported by Bert Deknuydt.
9366
9367 2002-10-23 Paul Eggert <eggert@twinsun.com>
9368
9369 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
9370 Suggested by Art Haas.
9371
9372 2002-10-22 Paul Eggert <eggert@twinsun.com>
9373
9374 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
9375 decl; not needed any more.
9376 * src/main.c (main): Use return to exit, undoing yesterday's change.
9377 The last OS that we could find where this wouldn't work is
9378 SunOS 3.5, and that's too old to worry about now.
9379
9380 * data/glr.c (struct yyltype): Define members even when not
9381 doing locations. This is more consistent with yacc.c, and it
9382 works around the following bug reports:
9383 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
9384 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
9385
9386 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
9387 @acronym consistently. Standardize on "Yacc" instead of "YACC",
9388 "Algol" instead of "ALGOL". Give a bit more history about BNF.
9389
9390 2002-10-22 Akim Demaille <akim@epita.fr>
9391
9392 * data/README: New.
9393
9394 2002-10-21 Paul Eggert <eggert@twinsun.com>
9395
9396 Be consistent about 'bool'; the old code used an enum in one
9397 module and an int in another, and this violates the C standard.
9398 * m4/stdbool.m4: New file, from coreutils 4.5.3.
9399 * configure.ac (AC_HEADER_STDBOOL): Add.
9400 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
9401 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
9402 * src/symtab.c (hash_compare_symbol_t): Likewise.
9403 * src/system.h (bool, false, true): Use a definition consistent
9404 with ../lib/hash.c. All uses changed.
9405
9406 * src/complain.c (warning_issued): Renamed from warn_message_count,
9407 so that we needn't worry about integer overflow (!).
9408 Now of type bool. All uses changed.
9409 (complaint_issued): Renamed from complain_message_count; likewise.
9410
9411 * src/main.c (main): Use exit to exit with failure.
9412
9413 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
9414 rather than 1 and 0.
9415 * src/main.c (main): Likewise.
9416 * src/getargs.c (getargs): Likewise.
9417 * src/reader.c (reader): Likewise.
9418
9419 * src/getarg.c (getargs): Remove duplicate code for
9420 "Try `bison --help'".
9421
9422 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
9423 What was that "2" for?
9424
9425 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
9426 * src/getargs.c (usage): Likewise.
9427
9428 * src/getargs.c (getargs): When there are too few operands, report
9429 the last one. When there are too many, report the first extra
9430 one. This is how diffutils does it.
9431
9432 2002-10-20 Paul Eggert <eggert@twinsun.com>
9433
9434 Remove K&R vestiges.
9435 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
9436 * src/complain.c (VA_START): Remove. Assume prototypes.
9437 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
9438 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
9439 fatal): Assume prototypes.
9440 * src/complain.h: Assume prototypes.
9441 * src/system.h (PARAMS): Remove.
9442 Include <limits.h> unconditionally, since it's guaranteeed even
9443 for a freestanding C89 compiler.
9444 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
9445 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
9446
9447 2002-10-20 Akim Demaille <akim@epita.fr>
9448
9449 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
9450 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
9451 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
9452 (yyresolveStates, yyresolveAction, yyresolveStack)
9453 (yyprocessOneStack): Use them.
9454 (yy_reduce_print): New.
9455 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
9456
9457 2002-10-20 Akim Demaille <akim@epita.fr>
9458
9459 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
9460 arguments and output `void'.
9461 (b4_c_function): Rename as...
9462 (b4_c_function_def): this.
9463 (b4_c_function_decl, b4_c_ansi_function_def)
9464 (b4_c_ansi_function_decl): New.
9465 Change the interpretation of the arguments: before `int, foo', now
9466 `int foo, foo'.
9467 * data/yacc.c (yyparse): Prototype and define thanks to these.
9468 Adjust b4_c_function_def uses.
9469 * data/glr.c (yyparse): Likewise, but ANSI only.
9470
9471 2002-10-20 Akim Demaille <akim@epita.fr>
9472
9473 * src/output.c (prepare): Move the definition of `tokens_number',
9474 `nterms_number', `undef_token_number', `user_token_number_max'
9475 to...
9476 (prepare_tokens): Here.
9477 (prepare_tokens): Rename as...
9478 (prepare_symbols): this.
9479 (prepare): Move the definition of `rules_number' to...
9480 (prepare_rules): here.
9481 (prepare): Move the definition of `last', `final_state_number',
9482 `states_number' to...
9483 (prepare_states): here.
9484 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
9485
9486 2002-10-20 Akim Demaille <akim@epita.fr>
9487
9488 * src/tables.h, src/tables.c, src/output.c: Comment changes.
9489
9490 2002-10-20 Akim Demaille <akim@epita.fr>
9491
9492 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
9493 * data/c.m4: here.
9494
9495 2002-10-20 Akim Demaille <akim@epita.fr>
9496
9497 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
9498 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
9499 `pair'.
9500 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
9501 `name' to...
9502 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
9503 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
9504 These.
9505
9506 2002-10-19 Paul Eggert <eggert@twinsun.com>
9507
9508 Do not create a temporary file, as that involves security and
9509 cleanup headaches. Instead, use a pair of pipes.
9510 Derived from a suggestion by Florian Krohm.
9511 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
9512 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
9513 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
9514 (BISON_PREREQ_SUBPIPE): Add.
9515 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
9516 Add subpipe.h, subpipe.c.
9517 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
9518 * po/POTFILES.in: Add lib/subpipe.c.
9519 * src/output.c: Include "subpipe.h".
9520 (m4_invoke): Remove decl.
9521 (scan_skel): New decl.
9522 (output_skeleton): Use pipe rather than temporary file for m4 input.
9523 Check that m4sugar.m4 is readable, to avoid deadlock.
9524 Check for pipe I/O error.
9525 * src/scan-skel.l (readpipe): Remove decl.
9526 (scan_skel): New function, to be used in place of m4_invoke.
9527 Read from stream rather than file.
9528
9529 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
9530 float, as this generates a warning on Solaris 8 + GCC 3.2 with
9531 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
9532 this generates a more-accurate value anyway.
9533
9534 * lib/timevar.c (timervar_accumulate): Rename locals to
9535 avoid confusion with similarly-named more-global.
9536 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
9537
9538 * src/output.c (prepare): Use xstrdup to convert char const *
9539 to char *, to avoid GCC warning.
9540
9541 2002-10-19 Akim Demaille <akim@epita.fr>
9542
9543 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
9544 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
9545 Use them to have `calc.y' ready for %pure-parser.
9546 * data/yacc.c (YYLEX): Pass a yylex return type to
9547 b4_c_function_call.
9548
9549 2002-10-19 Akim Demaille <akim@epita.fr>
9550
9551 Prototype support of %lex-param and %parse-param.
9552
9553 * src/parse-gram.y: Add the definition of the %lex-param and
9554 %parse-param tokens, plus their rules.
9555 Drop the `_' version of %glr-parser.
9556 Add the "," token.
9557 * src/scan-gram.l (INITIAL): Scan them.
9558 * src/muscle_tab.c: Comment changes.
9559 (muscle_insert, muscle_find): Rename `pair' as `probe'.
9560 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
9561 (muscle_entry_s): The `value' member is no longer const.
9562 Adjust all dependencies.
9563 * src/muscle_tab.c (muscle_init): Adjust: use
9564 MUSCLE_INSERT_STRING.
9565 Initialize the obstack earlier.
9566 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
9567 (muscle_pair_list_grow): New.
9568 * data/c.m4 (b4_c_function_call, b4_c_args): New.
9569 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
9570 * tests/calc.at: Use %locations, not --locations.
9571 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
9572
9573 2002-10-19 Akim Demaille <akim@epita.fr>
9574
9575 * src/getargs.c (usage): Take status as argument and exit
9576 accordingly.
9577 Report the traditional `Try ... --help' message when status != 0.
9578 (usage, version): Don't take a FILE * as arg, it is pointless.
9579 (getargs): When there is an incorrect number of arguments, make it
9580 an error, and report it GNUlically thanks to `usage ()'.
9581
9582 2002-10-18 Paul Eggert <eggert@twinsun.com>
9583
9584 * data/glr.c (yyreportParseError): Don't assume that sprintf
9585 yields the length of the printed string, as this is not true
9586 on SunOS 4.1.4. Reported by Peter Klein.
9587
9588 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
9589 * tests/conflicts.at (%nonassoc and eof): Likewise.
9590 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
9591
9592 2002-10-17 Akim Demaille <akim@epita.fr>
9593
9594 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
9595 * src/getargs.c (trace_types, trace_args): Adjust.
9596 * src/reader.c (grammar_current_rule_prec_set)
9597 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
9598 Standardize error messages.
9599 And s/@prec/%prec/!
9600 (reader): Use trace_flag to enable scanner/parser debugging,
9601 instead of an adhoc scheme.
9602 * src/scan-gram.l: Remove trailing debugging code.
9603
9604 2002-10-16 Paul Eggert <eggert@twinsun.com>
9605
9606 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
9607 MUSCLE_TAB_H.
9608
9609 * NEWS: Officially drop support for building Bison with K&R C,
9610 since it didn't work anyway and it's not worth worrying about.
9611 * Makefile.maint (wget_files): Remove ansi2knr.c.
9612 (ansi2knr.c-url_prefix): Remove.
9613 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
9614 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9615 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9616
9617 2002-10-15 Paul Eggert <eggert@twinsun.com>
9618
9619 Stop using the "enum_" trick for K&R-style function definitions;
9620 it confused me, and I was the author! Instead, assume that people
9621 who want to use K&R C compilers (when using these modules in GCC,
9622 perhaps?) will run ansi2knr.
9623
9624 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
9625 All uses of "enum_" changed to "enum ".
9626 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9627 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
9628
9629 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
9630 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
9631 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
9632 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
9633 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
9634 abitset_not, abitset_ones, abitset_or, abitset_or_and,
9635 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
9636 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
9637 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
9638 Use function prototypes; this removes the need for declaring
9639 static functions simply to provide their prototypes.
9640 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
9641 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
9642 bitset_count_, bitset_create, bitset_dump, bitset_first,
9643 bitset_free, bitset_init, bitset_last, bitset_next,
9644 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
9645 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
9646 bitset_print, bitset_release_memory, bitset_toggle_,
9647 bitset_type_choose, bitset_type_get, bitset_type_name_get,
9648 debug_bitset): Likewise.
9649 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
9650 * lib/bitset_stats.c (bitset_log_histogram_print,
9651 bitset_percent_histogram_print, bitset_stats_and,
9652 bitset_stats_and_cmp, bitset_stats_and_or,
9653 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
9654 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
9655 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
9656 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
9657 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
9658 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
9659 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
9660 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
9661 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
9662 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
9663 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
9664 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
9665 bitset_stats_zero): Likewise.
9666 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9667 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9668 bitsetv_dump, debug_bitsetv): Likewise.
9669 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
9670 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
9671 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
9672 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
9673 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
9674 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
9675 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
9676 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
9677 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
9678 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
9679 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
9680 Likewise.
9681 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
9682 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
9683 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
9684 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
9685 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
9686 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
9687 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
9688 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
9689 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
9690 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
9691 lbitset_xor_cmp, lbitset_zero): Likewise.
9692
9693 2002-10-14 Akim Demaille <akim@epita.fr>
9694
9695 Version 1.75.
9696
9697 2002-10-14 Akim Demaille <akim@epita.fr>
9698
9699 * tests/Makefile.am (maintainer-check-posix): New.
9700
9701 2002-10-14 Akim Demaille <akim@epita.fr>
9702
9703 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
9704 member.
9705
9706 2002-10-14 Akim Demaille <akim@epita.fr>
9707
9708 * src/tables.c (table_ninf_remap): base -> tab.
9709 Reported by Matt Rosing.
9710
9711 2002-10-14 Paul Eggert <eggert@twinsun.com>
9712
9713 * tests/action.at, tests/calc.at, tests/conflicts.at,
9714 tests/cxx-type.at, tests/headers.at, tests/input.at,
9715 tests/regression.at, tests/synclines.at, tests/torture.at:
9716 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
9717 so that the tests still work even if POSIXLY_CORRECT is set.
9718 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
9719
9720 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
9721 for portability to K&R hosts. Fix typo: signed char is guaranteed
9722 only to 127, not to 128.
9723 * data/glr.c (yysigned_char): New type.
9724 * data/yacc.c (yysigned_char): Likewise.
9725 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
9726
9727 2002-10-13 Paul Eggert <eggert@twinsun.com>
9728
9729 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
9730 true due to limited range of data type" warning from GCC.
9731
9732 * data/c.m4 (b4_token_defines): Protect against double-inclusion
9733 by wrapping enum yytokentype's definition inside #ifndef
9734 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
9735
9736 2002-10-13 Akim Demaille <akim@epita.fr>
9737
9738 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
9739 Un yy- yyrhs to avoid the name clash with the global YYRHS.
9740
9741 2002-10-13 Akim Demaille <akim@epita.fr>
9742
9743 * Makefile.maint: Update from Autoconf 2.54.
9744 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
9745
9746 2002-10-13 Akim Demaille <akim@epita.fr>
9747
9748 * src/print.c (print_state): Separate the list of solved conflicts
9749 from the other items.
9750 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
9751
9752 2002-10-13 Akim Demaille <akim@epita.fr>
9753
9754 Let nondeterministic skeletons be usable with deterministic
9755 tables.
9756
9757 With the patch, GAWK compiled by GCC without -O2 passes its test
9758 suite using a GLR parser driven by LALR tables. It fails with -O2
9759 because `struct stat' gives two different answers on my machine:
9760 88 (definition of an auto var) and later 96 (memset on this var).
9761 Hence the stack is badly corrumpted. The headers inclusion is to
9762 blame: if I move the awk.h inclusion before GLR's system header
9763 inclusion, the two struct stat have the same size.
9764
9765 * src/tables.c (pack_table): Always create conflict_table.
9766 (token_actions): Always create conflict_list.
9767 * data/glr.c (YYFLAG): Remove, unused.
9768
9769 2002-10-13 Akim Demaille <akim@epita.fr>
9770
9771 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
9772 (O0FLAGS): New.
9773 (VALGRIND, GXX): New.
9774 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
9775 * tests/bison.in: Run $PREBISON a pre-command.
9776 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
9777 (maintainer-check-g++): New.
9778 * Makefile.am (maintainer-check): New.
9779
9780 2002-10-13 Akim Demaille <akim@epita.fr>
9781
9782 * data/glr.c: Formatting changes.
9783 Tweak some trace messages to match yacc.c's.
9784
9785 2002-10-13 Akim Demaille <akim@epita.fr>
9786
9787 GLR parsers sometimes raise parse errors instead of performing the
9788 default reduction.
9789 Reported by Charles-Henry de Boysson.
9790
9791 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
9792 check the length of the traces when %glr.
9793 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
9794 GLR's traces.
9795 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
9796 Test GLR parsers.
9797 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
9798 (yyltype): Remove the yy prefix from the member names.
9799 (yytable): Complete its comment.
9800 (yygetLRActions): Map error action number from YYTABLE from
9801 YYTABLE_NINF to 0.
9802 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
9803 (which was a bug: it should have been YYTABEL_NINF, and yet it was
9804 not satisfying as we could compare an YYACTION computed from
9805 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
9806 only value for error actions.
9807 (yyreportParseError): In verbose parse error messages, don't issue
9808 `error' in the list of expected tokens.
9809 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
9810 next action to perform to match glr.c's decoding.
9811 (yytable): Complete its comment.
9812
9813 2002-10-13 Paul Eggert <eggert@twinsun.com>
9814
9815 Fix problem reported by Henrik Grubbstroem in
9816 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
9817 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
9818 because the Bison parser reads the second action before reducing
9819 the first one.
9820 * src/scan-gram.l (rule_length): New static var.
9821 Use it to keep track of the rule length in the scanner, since
9822 we can't expect the parser to be in lock-step sync with the scanner.
9823 (handle_action_dollar, handle_action_at): Use this var.
9824 * tests/actions.at (Exotic Dollars): Test for the problem.
9825
9826 2002-10-12 Paul Eggert <eggert@twinsun.com>
9827
9828 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
9829 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
9830 Include <sys/time.h> when checking for clock_t and struct tms.
9831 Use same include order as source.
9832 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
9833 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
9834
9835 * lib/timevar.c: Update copyright date and clarify comments.
9836 (get_time) [IN_GCC]: Keep the GCC version for reference.
9837
9838 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
9839 GCC version as of today, then merge Bison's changes.
9840 Change "GCC" to "Bison" in copyright notice. timevar.def's
9841 author is Akim, so change that too.
9842
9843 * src/reader.c (grammar_current_rule_check):
9844 Don't worry about the default action if $$ is untyped.
9845 Prevents bogus warnings reported by Jim Gifford in
9846 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
9847
9848 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
9849 * data/glr.c, data/lalr1.cc, data/yacc.c:
9850 Output token definitions before the first part of user declarations.
9851 Fixes compatibility problem reported by Jim Gifford for kbd in
9852 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
9853
9854 2002-10-11 Paul Eggert <eggert@twinsun.com>
9855
9856 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
9857 (yyparse): here. This undoes some of the 2002-07-25 change.
9858 Compatibility problem reported by Ralf S. Engelschall with
9859 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
9860
9861 2002-10-11 Akim Demaille <akim@epita.fr>
9862
9863 * tests/regression.at Characters Escapes): New.
9864 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
9865 characters.
9866 Reported by Jan Nieuwenhuizen.
9867
9868 2002-10-11 Akim Demaille <akim@epita.fr>
9869
9870 * po/id.po: New.
9871
9872 2002-10-10 Paul Eggert <eggert@twinsun.com>
9873
9874 Portability fixes for bitsets; this also avoids several GCC
9875 warnings.
9876
9877 * lib/abitset.c: Include <stddef.h>, for offsetof.
9878 * lib/lbitset.c: Likewise.
9879
9880 * lib/abitset.c (abitset_bytes): Return a size that is aligned
9881 properly for vectors of objects. Do not assume that adding a
9882 header size to a multiple of a word size yields a value that is
9883 properly aligned for the whole union.
9884 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9885
9886 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
9887 unique names for structures.
9888 * lib/ebitset.c (ebitset_bytes): Likewise.
9889 * lib/lbitset.c (lbitset_bytes): Likewise.
9890
9891 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
9892 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
9893 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
9894 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
9895 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
9896 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
9897 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
9898 to improve the type-checking that GCC can do.
9899 * lib/bitset.c (bitset_op4_cmp): Likewise.
9900 * lib/bitset_stats.c (bitset_stats_count,
9901 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
9902 bitset_stats_copy, bitset_stats_disjoint_p,
9903 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
9904 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
9905 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
9906 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
9907 bitset_stats_and_or_cmp, bitset_stats_andn_or,
9908 bitset_stats_andn_or_cmp, bitset_stats_or_and,
9909 bitset_stats_or_and_cmp): Likewise.
9910 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
9911 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
9912 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
9913 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
9914
9915 * lib/abitset.h: Include bitset.h, not bbitset.h.
9916 * lib/ebitset.h: Likewise.
9917 * lib/lbitset.h: Likewise.
9918
9919 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
9920 All instances of parameters of type enum bitset_opts are now of
9921 type enum_bitset_opts, to conform to the C Standard, and similarly
9922 for enum_bitset_type.
9923 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9924 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
9925
9926 Do not use "struct bitset_struct" to mean different things in
9927 different modules. Not only is this confusing, it violates
9928 the C Standard, which requires that structure types in different
9929 modules must be compatible if one is to be passed to the other.
9930 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
9931 All instances of "struct bitset_struct *" replaced with "bitset".
9932 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
9933 (union bitset_union, struct abitset_struct, struct ebitset_struct,
9934 struct lbitset_struct, struct bitset_stats_struct): New types.
9935 All uses of struct bitset_struct changed to union bitset_union,
9936 etc.
9937 * lib/abitset.c (struct abitset_struct, abitset,
9938 struct bitset_struct): Remove.
9939 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
9940 struct bitset_struct): Remove.
9941 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
9942 bitset_struct): Remove.
9943 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
9944 Likewise.
9945
9946 Do not call a function of type T using a call that assumes the
9947 function is of a different type U. Standard C requires that a
9948 function must be called with a type that is compatible with its
9949 definition.
9950 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9951 New decls.
9952 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9953 New functions.
9954 * lib/ebitset.c (PFV): Remove.
9955 * lib/lbitset.c (PFV): Likewise.
9956 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
9957 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
9958 decls.
9959 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
9960 (ebitset_vtable): Use them.
9961 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
9962 lbitset_xor): New functions.
9963 (lbitset_vtable): Use them.
9964
9965 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
9966 Declare.
9967
9968 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
9969 GCC warning.
9970 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
9971 Use offsetof, for simplicity.
9972
9973 2002-10-06 Paul Eggert <eggert@twinsun.com>
9974
9975 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
9976 the same width as int. This reapplies a hunk of the 2002-08-12 patch
9977 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
9978 which was inadvertently undone by the 2002-09-30 patch.
9979 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
9980 the same width as int.
9981
9982 2002-10-04 Paul Eggert <eggert@twinsun.com>
9983
9984 Version 1.50.
9985
9986 * configure.ac (AC_INIT), NEWS: Increment version number.
9987
9988 * doc/bison.texinfo: Minor spelling, grammar, and white space
9989 fixes.
9990 (Symbols): Mention that any negative value returned from yylex
9991 signifies end-of-input. Warn about negative chars. Mention
9992 the portable Standard C character set.
9993
9994 The GNU coding standard says CFLAGS and YFLAGS are reserved
9995 for the installer to set.
9996 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
9997 * src/Makefile.am (AM_CFLAGS): Likewise.
9998 (AM_YFLAGS): Renamed from YFLAGS.
9999
10000 Fix some MAX and MIN problems.
10001 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
10002 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
10003 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
10004 * src/reader.c (reader): Use it.
10005
10006 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
10007 POSIX 1003.1-2001 has removed fgrep.
10008
10009 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
10010
10011 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
10012 interpreted as signed.
10013 * lib/ebitset.c (ebitset_list): Fix bug.
10014
10015 2002-10-01 Paul Eggert <eggert@twinsun.com>
10016
10017 More fixes for 64-bit hosts and large bitsets.
10018
10019 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
10020 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
10021 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
10022 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
10023 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
10024 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
10025 bitset_count_): Likewise.
10026 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
10027 bitset_first, bitset_last): Likewise.
10028 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
10029 bitset_stats_list_reverse, bitset_stats_size,
10030 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
10031 Likewise.
10032 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10033 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
10034 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
10035 bitsetv_reflexive_transitive_closure): Likewise.
10036 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
10037 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
10038 Likewise.
10039 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
10040 Likewise.
10041
10042 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
10043 Use size_t, not unsigned int, to count bytes.
10044 * lib/abitset.h (abitset_bytes): Likewise.
10045 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
10046 Likewise.
10047 * lib/bitset.h (bitset_bytes): Likewise.
10048 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
10049 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
10050 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10051 * lib/ebitset.c (ebitset_bytes): Likewise.
10052 * lib/ebitset.h (ebitset_bytes): Likewise.
10053 * lib/lbitset.c (lbitset_bytes): Likewise.
10054 * lib/lbitset.h (lbitset_bytes): Likewise.
10055
10056 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
10057 abitset_subset_p, abitset_disjoint_p, abitset_and,
10058 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
10059 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
10060 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
10061 abitset_or_and, abitset_or_and_cmp):
10062 Use bitset_windex instead of unsigned int.
10063 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
10064 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
10065 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
10066 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
10067 Likewise.
10068 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
10069
10070 * lib/bitset.c (bitset_print):
10071 Use proper printf formats for widths of integer types.
10072 * lib/bitset_stats.c (bitset_percent_histogram_print,
10073 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
10074 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10075 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
10076 * lib/lbitset.c (lbitset_bytes): Likewise.
10077
10078 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
10079 BITSET_SIZE_MAX): New macros.
10080 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
10081 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
10082 to BITSET_WINDEX_MAX.
10083
10084 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
10085 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
10086 since we now return the bitset_bindex type (not int).
10087
10088 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
10089 when computing sizes.
10090 * lib/ebitset.c (ebitset_elts_grow): Likewise.
10091
10092 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
10093 and avoid cast to unsigned.
10094
10095 2002-09-30 Akim Demaille <akim@epita.fr>
10096
10097 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10098 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
10099 Updates from Michael Hayes.
10100
10101 2002-09-30 Art Haas <ahaas@neosoft.com>
10102
10103 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
10104 invocations.
10105 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
10106 defined.
10107
10108 2002-09-27 Akim Demaille <akim@epita.fr>
10109
10110 Version 1.49c.
10111
10112 2002-09-27 Akim Demaille <akim@epita.fr>
10113
10114 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
10115 (Because of AC_LIBSOURCE).
10116
10117 2002-09-27 Akim Demaille <akim@epita.fr>
10118
10119 Playing with Autoscan.
10120
10121 * configure.ac: Remove the old LIBOBJ tweaks.
10122 (AC_REPLACE_FUNCS): Add strrchr and strtol.
10123 * lib/strrchr.c: New.
10124 * lib/strtol.c: New, from the Coreutils 4.5.1.
10125
10126 2002-09-27 Akim Demaille <akim@epita.fr>
10127
10128 Playing with Autoscan.
10129
10130 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
10131 * lib/Makefile.am (libbison_a_SOURCES): No longer include
10132 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
10133 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
10134 Coreutils 4.5.1.
10135
10136 2002-09-24 Akim Demaille <akim@epita.fr>
10137
10138 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
10139 (Frequently Asked Questions, Parser Stack Overflow): New.
10140
10141 2002-09-13 Akim Demaille <akim@epita.fr>
10142
10143 Playing with autoscan.
10144
10145 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
10146 * src/files.c (skeleton_find): Remove, unused.
10147 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
10148 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
10149
10150 2002-09-13 Akim Demaille <akim@epita.fr>
10151
10152 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
10153 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
10154
10155 2002-09-13 Akim Demaille <akim@epita.fr>
10156
10157 * configure.ac: Require 2.54.
10158 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
10159 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
10160 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
10161 Remove, provided by Autoconf macros.
10162
10163 2002-09-12 Akim Demaille <akim@epita.fr>
10164
10165 * m4/prereq.m4: Update, from Coreutils 4.5.1.
10166
10167 2002-09-12 Akim Demaille <akim@epita.fr>
10168
10169 * m4/prereq.m4: Update, from Fileutils 4.1.5.
10170 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
10171 Reported by Martin Mokrejs.
10172
10173 2002-09-10 Akim Demaille <akim@epita.fr>
10174
10175 * src/parse-gram.y: Associate a human readable string to each
10176 token type.
10177 * tests/regression.at (Invalid inputs): Adjust.
10178
10179 2002-09-10 Gary V. Vaughan <gary@gnu.org>
10180
10181 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
10182 with an Autoconf-2.5x style configure.ac.
10183
10184 2002-09-06 Paul Eggert <eggert@twinsun.com>
10185
10186 * doc/bison.texinfo (Conditions): Make explicit that the GPL
10187 exception applies only to yacc.c. This is a modification of a
10188 patch originally suggested by Akim Demaille.
10189
10190 2002-09-06 Akim Demaille <akim@epita.fr>
10191
10192 * data/c.m4 (b4_copyright): Move the GPL exception comment from
10193 here to...
10194 * data/yacc.c: here.
10195
10196 * data/lalr1.cc (struct yyltype): Don't define it, since we use
10197 LocationType.
10198 (b4_ltype): Default to yy::Location from location.hh.
10199
10200 2002-09-04 Jim Meyering <jim@meyering.net>
10201
10202 * data/yacc.c: Guard the declaration of yytoknum also with
10203 `#ifdef YYPRINT', so it is declared only when used.
10204
10205 2002-09-04 Akim Demaille <akim@epita.fr>
10206
10207 * configure.in: Rename as...
10208 * configure.ac: this.
10209 Bump to 1.49c.
10210
10211 2002-09-04 Akim Demaille <akim@epita.fr>
10212
10213 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
10214 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
10215 translate maintainer only messages.
10216
10217 2002-08-12 Paul Eggert <eggert@twinsun.com>
10218
10219 Version 1.49b.
10220
10221 * Makefile.am (SUBDIRS): Remove intl.
10222 (DISTCLEANFILES): Remove.
10223 * NEWS: Mention that GNU M4 is now required. Clarify what is
10224 meant by "larger grammars". Mention the pt_BR translation.
10225 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
10226 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
10227 Bump version from 0.11.2 to 0.11.5.
10228 (BISON_PREREQ_STAGE): Remove.
10229 (AM_GNU_GETTEXT): Use external gettext.
10230 (AC_OUTPUT): Remove intl/Makefile.
10231
10232 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
10233
10234 * data/glr.c: Include string.h, for strlen.
10235 (yyreportParseError): Use size_t for yysize.
10236 (yy_yypstack): No longer nested inside yypstates, as nested
10237 functions are not portable. Do not assume size_t is the
10238 same width as int.
10239 (yypstates): Do not assume that ptrdiff_t is the same width
10240 as int, and similarly for yyposn and YYINDEX.
10241
10242 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
10243
10244 * lib/Makefile.am (INCLUDES): Do not include from the intl
10245 directory, which has been removed.
10246 * src/Makefile.am (INCLUDES): Likewise.
10247
10248 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
10249 (bitsets_sources, additional_bitsets_sources, timevars_sources):
10250 New vars.
10251
10252 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
10253 * tests/Makefile.am (EXTRA_DIST): Likewise.
10254
10255 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
10256 Do not assume that bitset_windex is the same width as unsigned.
10257
10258 * lib/abitset.c (abitset_unused_clear): Do not assume that
10259 bitset_word is the same width as int.
10260 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
10261 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
10262 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
10263 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
10264 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
10265
10266 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
10267 portability to one's complement hosts!).
10268 * lib/ebitset.c (ebitset_op1): Likewise.
10269 * lib/lbitset.c (lbitset_op1): Likewise.
10270
10271 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
10272 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10273 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
10274 Sync with fileutils.
10275 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
10276 lib/gettext.h: Sync with diffutils.
10277
10278 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
10279 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
10280
10281 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
10282 PROTOTYPES to check for prototypes, and "defined __STDC__" to
10283 check for void *.
10284
10285 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
10286 size_t; the old version tried to do this but casted improperly.
10287 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
10288 (bitset_test): Now returns int, not unsigned long.
10289
10290 * lib/bitset_stats.c: Include "gettext.h".
10291 (_): New macro.
10292 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
10293 name locals "index", as it generates unnecessary warnings on some
10294 hosts that have an "index" function.
10295
10296 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
10297 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
10298 they need translation.
10299 * src/LR0.c (state_list_append, new_itemsets, get_state,
10300 append_states, generate_states): Likewise.
10301 * src/assoc.c (assoc_to_string): Likewise.
10302 * src/closure.c (print_closure, set_firsts, closure): Likewise.
10303 * src/gram.c (grammar_dump): Likewise.
10304 * src/injections.c (injections_compute): Likewise.
10305 * src/lalr.c (lookaheads_print): Likewise.
10306 * src/relation.c (relation_transpose): Likewise.
10307 * src/scan-gram.l: Likewise.
10308 * src/tables.c (table_grow, pack_vector): Likewise.
10309
10310 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
10311 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
10312 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
10313 * m4/mbstate_t.m4: Sync with fileutils.
10314 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
10315
10316 * po/LINGUAS: Add pt_BR.
10317 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
10318 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
10319 lib/timevar.c.
10320 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
10321 manual recommends.
10322 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
10323
10324 * src/complain.c (strerror_r): Remove decl; not needed.
10325 (strerror): Use same pattern as ../lib/error.c.
10326
10327 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
10328
10329 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
10330
10331 * src/main.c (main): Cast result of bindtextdomain and textdomain
10332 to void, to avoid a GCC warning when --disable-nls is in effect.
10333
10334 * src/scan-gram.l: Use strings rather than escapes when possible,
10335 to minimize the number of warnings from xgettext.
10336 (handle_action_dollar, handle_action_at): Don't use isdigit,
10337 as it mishandles negative chars and it may not work as expected
10338 outside the C locale.
10339
10340 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
10341 this is a GCC extension and is not portable to other compilers.
10342
10343 * src/system.h (alloca): Use same pattern as ../lib/error.c.
10344 Do not include <ctype.h>; no longer needed.
10345 Do not include <malloc.h>; no longer needed (and generates
10346 warnings on OpenBSD 3.0).
10347
10348 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
10349 it's not portable.
10350
10351 * tests/regression.at: Do not use 'cc -c input.c -o input';
10352 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
10353
10354 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
10355 exit status as failure, not just exit status 1. Sun C exits
10356 with status 2 sometimes.
10357
10358 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
10359 Use it for the two large tests.
10360
10361 2002-08-02 Akim Demaille <akim@epita.fr>
10362
10363 * src/conflicts.c (conflicts_output): Don't output rules never
10364 reduced here, since anyway that computation doesn't work.
10365 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
10366 (rule_useless_p, rule_never_reduced_p): New.
10367 (grammar_rules_partial_print): Use a filter instead of a range.
10368 Display the title only if needed.
10369 (grammar_rules_print): Adjust.
10370 (grammar_rules_never_reduced_report): New.
10371 * src/tables.c (action_row): Move the computation of rules never
10372 reduced to...
10373 (token_actions): here.
10374 * src/main.c (main): Make the parser before making the report, so
10375 that rules never reduced are computed.
10376 Call grammar_rules_never_reduced_report.
10377 * src/print.c (print_results): Report rules never reduced.
10378 * tests/conflicts.at, tests/reduce.at: Adjust.
10379
10380 2002-08-01 Akim Demaille <akim@epita.fr>
10381
10382 Instead of attaching lookaheads and duplicating the rules being
10383 reduced by a state, attach the lookaheads to the reductions.
10384
10385 * src/state.h (state_t): Remove the `lookaheads',
10386 `lookaheads_rule' member.
10387 (reductions_t): Add a `lookaheads' member.
10388 Use a regular array for the `rules'.
10389 * src/state.c (reductions_new): Initialize the lookaheads member
10390 to 0.
10391 (state_rule_lookaheads_print): Adjust.
10392 * src/state.h, src/state.c (state_reductions_find): New.
10393 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
10394 (count_rr_conflicts): Adjust.
10395 * src/lalr.c (LArule): Remove.
10396 (add_lookback_edge): Adjust.
10397 (state_lookaheads_count): New.
10398 (states_lookaheads_initialize): Merge into...
10399 (initialize_LA): this.
10400 (lalr_free): Adjust.
10401 * src/main.c (main): Don't free nullable and derives too early: it
10402 is used by --verbose.
10403 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
10404
10405 2002-08-01 Akim Demaille <akim@epita.fr>
10406
10407 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
10408 `rule_number_t**'.
10409 (set_derives, free_derives): Rename as...
10410 (derives_compute, derives_free): this.
10411 Adjust all dependencies.
10412 * src/nullable.c (set_nullable, free_nullable): Rename as...
10413 (nullable_compute, nullable_free): these.
10414 (rule_list_t): Store rule_t *, not rule_number_t.
10415 * src/state.c (state_rule_lookaheads_print): Directly compare rule
10416 pointers, instead of their numbers.
10417 * src/main.c (main): Call nullable_free, and derives_free earlier,
10418 as they were lo longer used.
10419
10420 2002-08-01 Akim Demaille <akim@epita.fr>
10421
10422 * lib/timevar.c (get_time): Include children time.
10423 * src/lalr.h (LA, LArule): Don't export them: used with the
10424 state_t.
10425 * src/lalr.c (LA, LArule): Static.
10426 * src/lalr.h, src/lalr.c (lalr_free): New.
10427 * src/main.c (main): Call it.
10428 * src/tables.c (pack_vector): Check whether loc is >= to the
10429 table_size, not >.
10430 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
10431 (tables_generate): do it, since that's also it which allocates
10432 them.
10433 Don't free LA and LArule, main does.
10434
10435 2002-07-31 Akim Demaille <akim@epita.fr>
10436
10437 Separate parser tables computation and output.
10438
10439 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
10440 (conflict_list, conflict_list_cnt, table, check, table_ninf)
10441 (yydefgoto, yydefact, high): Move to...
10442 * src/tables.h, src/tables.c: here.
10443 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
10444 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
10445 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
10446 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
10447 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
10448 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
10449 (action_row, save_row, token_actions, save_column, default_goto)
10450 (goto_actions, sort_actions, matching_state, pack_vector)
10451 (table_ninf_remap, pack_table, prepare_actions): Move to...
10452 * src/tables.c: here.
10453 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
10454 * src/output.c (token_actions, output_base, output_conflicts)
10455 (output_check): Merge into...
10456 (prepare_actions): this.
10457 (actions_output): Rename as...
10458 (user_actions_output): this.
10459 * src/main.c (main): Call tables_generate and tables_free.
10460
10461 2002-07-31 Akim Demaille <akim@epita.fr>
10462
10463 Steal GCC's --time-report support.
10464
10465 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
10466 stolen/adjusted from GCC.
10467 * m4/stage.m4: Remove time related checks.
10468 * m4/timevar.m4: New.
10469 * configure.in: Adjust.
10470 * src/system.h: Adjust to using timevar.h.
10471 * src/getargs.h, src/getargs.c: Support trace_time for
10472 --trace=time.
10473 * src/main.c (stage): Remove.
10474 (main): Replace `stage' invocations with timevar calls.
10475 * src/output.c: Insert pertinent timevar calls.
10476
10477 2002-07-31 Akim Demaille <akim@epita.fr>
10478
10479 Let --trace have arguments.
10480
10481 * src/getargs.h (enum trace_e): New.
10482 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
10483 (long_options, short_options): --trace/-T takes an optional
10484 argument.
10485 Change all the uses of trace_flag to reflect the new flags.
10486 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
10487
10488 Strengthen `stage' portability.
10489
10490 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
10491 * configure.in: Use it.
10492 Don't check for malloc.h and sys/times.h.
10493 * src/system.h: Include them when appropriate.
10494 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
10495 times and struct tms are available.
10496
10497 2002-07-30 Akim Demaille <akim@epita.fr>
10498
10499 In verbose parse error message, don't report `error' as an
10500 expected token.
10501 * tests/actions.at (Printers and Destructors): Adjust.
10502 * tests/calc.at (Calculator $1): Adjust.
10503 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
10504 error message, do not report the parser accepts the error token in
10505 that state.
10506
10507 2002-07-30 Akim Demaille <akim@epita.fr>
10508
10509 Normalize conflict related messages.
10510
10511 * src/complain.h, src/complain.c (warn, complain): New.
10512 * src/conflicts.c (conflicts_print): Use them.
10513 (conflict_report_yacc): New, extracted from...
10514 (conflicts_print): here.
10515 * tests/conflicts.at, tests/existing.at: Adjust.
10516
10517 2002-07-30 Akim Demaille <akim@epita.fr>
10518
10519 Report rules which are never reduced by the parser: those hidden
10520 by conflicts.
10521
10522 * src/LR0.c (save_reductions): Don't make the final state too
10523 different: save its reduction (accept) instead of having a state
10524 without any action (no shift or goto, no reduce).
10525 Note: the final state is now a ``regular'' state, i.e., the
10526 parsers now contain `reduce 0' as default reduction.
10527 Nevertheless, since they decide to `accept' when yystate =
10528 final_state, they still will not reduce rule 0.
10529 * src/print.c (print_actions, print_reduction): Adjust.
10530 * src/output.c (action_row): Track reduced rules.
10531 (token_actions): Report rules never reduced.
10532 * tests/conflicts.at, tests/regression.at: Adjust.
10533
10534 2002-07-30 Akim Demaille <akim@epita.fr>
10535
10536 `stage' was accidently included in a previous patch.
10537 Initiate its autoconfiscation.
10538
10539 * configure.in: Look for malloc.h and sys/times.h.
10540 * src/main.c (stage): Adjust.
10541 Report only when trace_flag.
10542
10543 2002-07-29 Akim Demaille <akim@epita.fr>
10544
10545 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
10546 state_number_t.
10547 (errs_t): symbol_t*, not symbol_number_t.
10548 (reductions_t): rule_t*, not rule_number_t.
10549 (FOR_EACH_SHIFT): New.
10550 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
10551 * src/print.c, src/print_graph.c: Adjust.
10552
10553 2002-07-29 Akim Demaille <akim@epita.fr>
10554
10555 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
10556
10557 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
10558 (endtoken, accept): these.
10559 * src/reader.c (reader): Set endtoken's default tag to "$end".
10560 Set undeftoken's tag to "$undefined" instead of "$undefined.".
10561 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
10562 Adjust.
10563
10564 2002-07-29 Akim Demaille <akim@epita.fr>
10565
10566 * src/reduce.c (reduce_grammar): When the language is empty,
10567 complain about the start symbol, not the axiom.
10568 Use its location.
10569 * tests/reduce.at (Empty Language): New.
10570
10571 2002-07-26 Akim Demaille <akim@epita.fr>
10572
10573 * src/reader.h, src/reader.c (gram_error): ... can't get
10574 yycontrol without making too strong assumptions on the parser
10575 itself.
10576 * src/output.c (prepare_tokens): Use the real 0th value of
10577 token_translations instead of `0'.
10578 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
10579 visible here.
10580 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
10581 for the time being: %locations ought to provide it to yyerror.
10582
10583 2002-07-25 Akim Demaille <akim@epita.fr>
10584
10585 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
10586 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
10587 * tests/regression.at (Web2c Actions): Adjust.
10588
10589 2002-07-25 Akim Demaille <akim@epita.fr>
10590
10591 Stop storing rules from 1 to nrules + 1.
10592
10593 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
10594 * src/nullable.c, src/output.c, src/print.c, src/reader.c
10595 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
10596 Iterate from 0 to nrules.
10597 Use rule_number_as_item_number and item_number_as_rule_number.
10598 Adjust to `derive' now containing possibly 0.
10599 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
10600 Handle the `- 1' part in rule numbers from/to item numbers.
10601 * src/conflicts.c (log_resolution): Fix the message which reversed
10602 shift and reduce.
10603 * src/output.c (action_row): Initialize default_rule to -1.
10604 (token_actions): Adjust.
10605 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
10606 expected output.
10607 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
10608
10609 2002-07-25 Akim Demaille <akim@epita.fr>
10610
10611 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
10612 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
10613 (b4_c_knr_arg_decl): New.
10614 * data/yacc.c: Use it to define yysymprint, yydestruct, and
10615 yyreport_parse_error.
10616
10617 2002-07-25 Akim Demaille <akim@epita.fr>
10618
10619 * data/yacc.c (yyreport_parse_error): New, extracted from...
10620 (yyparse): here.
10621 (yydestruct, yysymprint): Move above yyparse.
10622 Be K&R compliant.
10623
10624 2002-07-25 Akim Demaille <akim@epita.fr>
10625
10626 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
10627 replace...
10628 (b4_sint_type, b4_uint_type): these.
10629 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
10630 * tests/regression.at (Web2c Actions): Adjust.
10631
10632 2002-07-25 Akim Demaille <akim@epita.fr>
10633
10634 * src/gram.h (TIEM_NUMBER_MAX): New.
10635 (item_number_of_rule_number, rule_number_of_item_number): Rename
10636 as...
10637 (rule_number_as_item_number, item_number_as_rule_number): these.
10638 Adjust dependencies.
10639 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
10640 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
10641 (symbol_number_to_vector_number): New.
10642 (order): Of vector_number_t* type.
10643 (base_t, BASE_MAX, BASE_MIN): New.
10644 (froms, tos, width, pos, check): Of base_t type.
10645 (action_number_t, ACTION_MIN, ACTION_MAX): New.
10646 (actrow): Of action_number_t type.
10647 (conflrow): Of unsigned int type.
10648 (table_ninf, base_ninf): New.
10649 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
10650 (muscle_insert_int_table, muscle_insert_base_table)
10651 (muscle_insert_rule_number_table): New.
10652 (prepare_tokens): Output `toknum' as int_table.
10653 (action_row): Returns a rule_number_t.
10654 Use ACTION_MIN, not SHRT_MIN.
10655 (token_actions): yydefact is rule_number_t*.
10656 (table_ninf_remap): New.
10657 (pack_table): Use it for `base' and `table'.
10658 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
10659 replaced with...
10660 (YYPACT_NINF, YYTABLE_NINF): these.
10661 (yypact, yytable): Compute their types instead of hard-coded
10662 `short'.
10663 * tests/regression.at (Web2c Actions): Adjust.
10664
10665 2002-07-19 Akim Demaille <akim@epita.fr>
10666
10667 * src/scan-gram.l (id): Can start with an underscore.
10668
10669 2002-07-16 Akim Demaille <akim@epita.fr>
10670
10671 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
10672 Adjust all former `associativity' dependencies.
10673 * src/symtab.c (symbol_new): Default associativity is `undef', not
10674 `right'.
10675 (symbol_check_alias_consistence): Adjust.
10676
10677 2002-07-09 Akim Demaille <akim@epita.fr>
10678
10679 * doc/bison.texinfo: Properly set the ``header'' part.
10680 Use @dircategory ``GNU programming tools'' as per Texinfo's
10681 documentation.
10682 Use @copying.
10683
10684 2002-07-09 Akim Demaille <akim@epita.fr>
10685
10686 * lib/quotearg.h: Protect against multiple inclusions.
10687 * src/location.h (location_t): Add a `file' member.
10688 (LOCATION_RESET, LOCATION_PRINT): Adjust.
10689 * src/complain.c (warn_at, complain_at, fatal_at): Drop
10690 `error_one_per_line' support.
10691
10692 2002-07-09 Akim Demaille <akim@epita.fr>
10693
10694 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
10695 * src/reader.c (lineno): Remove.
10696 Adjust all dependencies.
10697 (get_merge_function): Take a location and use complain_at.
10698 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
10699 * tests/regression.at (Invalid inputs, Mixing %token styles):
10700 Adjust.
10701
10702 2002-07-09 Akim Demaille <akim@epita.fr>
10703
10704 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
10705 recovery rule, and forbid extensions when --yacc.
10706 (gram_error): Use complain_at.
10707 * src/reader.c (reader): Exit if there were parse errors.
10708
10709 2002-07-09 Akim Demaille <akim@epita.fr>
10710
10711 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
10712 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
10713 Reported by R Blake <blakers@mac.com>.
10714
10715 2002-07-09 Akim Demaille <akim@epita.fr>
10716
10717 * data/yacc.c: Output the copyright notive in the header.
10718
10719 2002-07-03 Akim Demaille <akim@epita.fr>
10720
10721 * src/output.c (froms, tos): Are state_number_t.
10722 (save_column): sp, sp1, and sp2 are state_number_t.
10723 (prepare): Rename `final' as `final_state_number', `nnts' as
10724 `nterms_number', `nrules' as `rules_number', `nstates' as
10725 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
10726 unused.
10727 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
10728 * data/lalr1.cc (nsym_): Remove, unused.
10729
10730 2002-07-03 Akim Demaille <akim@epita.fr>
10731
10732 * src/lalr.h, src/lalr.c (goto_number_t): New.
10733 * src/lalr.c (goto_list_t): New.
10734 Propagate them.
10735 * src/nullable.c (rule_list_t): New.
10736 Propagate.
10737 * src/types.h: Remove.
10738
10739 2002-07-03 Akim Demaille <akim@epita.fr>
10740
10741 * src/closure.c (print_fderives): Use rule_rhs_print.
10742 * src/derives.c (print_derives): Use rule_rhs_print.
10743 (rule_list_t): New, replaces `shorts'.
10744 (set_derives): Add comments.
10745 * tests/sets.at (Nullable, Firsts): Adjust.
10746
10747 2002-07-03 Akim Demaille <akim@epita.fr>
10748
10749 * src/output.c (prepare_actions): Free `tally' and `width'.
10750 (prepare_actions): Allocate and free `order'.
10751 * src/symtab.c (symbols_free): Free `symbols'.
10752 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
10753 * src/output.c (m4_invoke): Move to...
10754 * src/scan-skel.l: here.
10755 (<<EOF>>): Close yyout, and free its name.
10756
10757 2002-07-03 Akim Demaille <akim@epita.fr>
10758
10759 Fix some memory leaks, and fix a bug: state 0 was examined twice.
10760
10761 * src/LR0.c (new_state): Merge into...
10762 (state_list_append): this.
10763 (new_states): Merge into...
10764 (generate_states): here.
10765 (set_states): Don't ensure a proper `errs' state member here, do it...
10766 * src/conflicts.c (conflicts_solve): here.
10767 * src/state.h, src/state.c: Comment changes.
10768 (state_t): Rename member `shifts' as `transitions'.
10769 Adjust all dependencies.
10770 (errs_new): For consistency, also take the values as argument.
10771 (errs_dup): Remove.
10772 (state_errs_set): New.
10773 (state_reductions_set, state_transitions_set): Assert that no
10774 previous value was assigned.
10775 (state_free): New.
10776 (states_free): Use it.
10777 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
10778 temporary storage: use `errs' and `nerrs' as elsewhere.
10779 (set_conflicts): Allocate and free this `errs'.
10780
10781 2002-07-02 Akim Demaille <akim@epita.fr>
10782
10783 * lib/libiberty.h: New.
10784 * lib: Update the bitset implementation from upstream.
10785 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
10786 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
10787 * src/main.c: Adjust bitset stats calls.
10788
10789 2002-07-01 Paul Eggert <eggert@twinsun.com>
10790
10791 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
10792 char, so that negative chars don't collide with $.
10793
10794 2002-06-30 Akim Demaille <akim@epita.fr>
10795
10796 Have the GLR tests be `warning' checked, and fix the warnings.
10797
10798 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
10799 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
10800 (yyremoveDeletes): `yyi' and `yyj' are size_t.
10801 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
10802 (yyaddDeferredAction): static.
10803 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
10804 (yyreportParseError): yyprefix is const.
10805 yytokenp is used only when verbose.
10806 (yy__GNUC__): Replace with __GNUC__.
10807 (yypdumpstack): yyi is size_t.
10808 (yypreference): Un-yy local variables and arguments, to avoid
10809 clashes with `yyr1'. Anyway, we are not in the user name space.
10810 (yytname_size): be an int, as is compared with ints.
10811 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
10812 Use them.
10813 * tests/cxx-gram.at: Use quotation to protect $1.
10814 Use AT_COMPILE to enable warnings hunts.
10815 Prototype yylex and yyerror.
10816 `Use' argc.
10817 Include `string.h', not `strings.h'.
10818 Produce and prototype stmtMerge only when used.
10819 yylex takes a location.
10820
10821 2002-06-30 Akim Demaille <akim@epita.fr>
10822
10823 We spend a lot of time in quotearg, in particular when --verbose.
10824
10825 * src/symtab.c (symbol_get): Store a quoted version of the key.
10826 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
10827 Adjust all callers.
10828
10829 2002-06-30 Akim Demaille <akim@epita.fr>
10830
10831 * src/state.h (reductions_t): Rename member `nreds' as num.
10832 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
10833 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
10834
10835 2002-06-30 Akim Demaille <akim@epita.fr>
10836
10837 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
10838 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
10839 (shifts_to): Rename as...
10840 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
10841 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
10842 (TRANSITION_IS_DISABLED, transitions_to): these.
10843
10844 2002-06-30 Akim Demaille <akim@epita.fr>
10845
10846 * src/print.c (print_shifts, print_gotos): Merge into...
10847 (print_transitions): this.
10848 (print_transitions, print_errs, print_reductions): Align the
10849 lookaheads columns.
10850 (print_core, print_transitions, print_errs, print_state,
10851 print_grammar): Output empty lines separator before, not after.
10852 (state_default_rule_compute): Rename as...
10853 (state_default_rule): this.
10854 * tests/conflicts.at (Defaulted Conflicted Reduction),
10855 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
10856 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
10857
10858 2002-06-30 Akim Demaille <akim@epita.fr>
10859
10860 Display items as we display rules.
10861
10862 * src/gram.h, src/gram.c (rule_lhs_print): New.
10863 * src/gram.c (grammar_rules_partial_print): Use it.
10864 * src/print.c (print_core): Likewise.
10865 * tests/conflicts.at (Defaulted Conflicted Reduction),
10866 (Unresolved SR Conflicts): Adjust.
10867 (Unresolved SR Conflicts): Adjust and rename as...
10868 (Resolved SR Conflicts): this, as was meant.
10869 * tests/regression.at (Web2c Report): Adjust.
10870
10871 2002-06-30 Akim Demaille <akim@epita.fr>
10872
10873 * src/print.c (state_default_rule_compute): New, extracted from...
10874 (print_reductions): here.
10875 Pessimize, but clarify the code.
10876 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
10877
10878 2002-06-30 Akim Demaille <akim@epita.fr>
10879
10880 * src/output.c (action_row): Let default_rule be always a rule
10881 number.
10882
10883 2002-06-30 Akim Demaille <akim@epita.fr>
10884
10885 * src/closure.c (print_firsts, print_fderives, closure):
10886 Use BITSET_EXECUTE.
10887 * src/lalr.c (lookaheads_print): Likewise.
10888 * src/state.c (state_rule_lookaheads_print): Likewise.
10889 * src/print_graph.c (print_core): Likewise.
10890 * src/print.c (print_reductions): Likewise.
10891 * src/output.c (action_row): Likewise.
10892 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
10893
10894 2002-06-30 Akim Demaille <akim@epita.fr>
10895
10896 * src/print_graph.c: Use report_flag.
10897
10898 2002-06-30 Akim Demaille <akim@epita.fr>
10899
10900 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
10901 to...
10902 * src/relation.h, src/relation.c (traverse, relation_digraph)
10903 (relation_print, relation_transpose): New.
10904
10905 2002-06-30 Akim Demaille <akim@epita.fr>
10906
10907 * src/state.h, src/state.c (shifts_to): New.
10908 * src/lalr.c (build_relations): Use it.
10909
10910 2002-06-30 Akim Demaille <akim@epita.fr>
10911
10912 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
10913 (item_number_of_rule_number, rule_number_of_item_number): New.
10914 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
10915 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
10916 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
10917 Propagate their use.
10918 Much remains to be done, in particular wrt `shorts' from types.h.
10919
10920 2002-06-30 Akim Demaille <akim@epita.fr>
10921
10922 * src/symtab.c (symbol_new): Initialize the `printer' member.
10923
10924 2002-06-30 Akim Demaille <akim@epita.fr>
10925
10926 * src/LR0.c (save_reductions): Remove, replaced by...
10927 * src/state.h, src/state.c (state_reductions_set): New.
10928 (reductions, errs): Rename as...
10929 (reductions_t, errs_t): these.
10930 Adjust all dependencies.
10931
10932 2002-06-30 Akim Demaille <akim@epita.fr>
10933
10934 * src/LR0.c (state_list_t, state_list_append): New.
10935 (first_state, last_state): Now symbol_list_t.
10936 (this_state): Remove.
10937 (new_itemsets, append_states, save_reductions): Take a state_t as
10938 argument.
10939 (set_states, generate_states): Adjust.
10940 (save_shifts): Remove, replaced by...
10941 * src/state.h, src/state.c (state_shifts_set): New.
10942 (shifts): Rename as...
10943 (shifts_t): this.
10944 Adjust all dependencies.
10945 * src/state.h (state_t): Remove the `next' member.
10946
10947 2002-06-30 Akim Demaille <akim@epita.fr>
10948
10949 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
10950 escaped in slot 0.
10951
10952 2002-06-30 Akim Demaille <akim@epita.fr>
10953
10954 Use hash.h for the state hash table.
10955
10956 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
10957 (allocate_storage): Use state_hash_new.
10958 (free_storage): Use state_hash_free.
10959 (new_state, get_state): Adjust.
10960 * src/lalr.h, src/lalr.c (states): Move to...
10961 * src/states.h (state_t): Remove the `link' member, no longer
10962 used.
10963 * src/states.h, src/states.c: here.
10964 (state_hash_new, state_hash_free, state_hash_lookup)
10965 (state_hash_insert, states_free): New.
10966 * src/states.c (state_table, state_compare, state_hash): New.
10967 * src/output.c (output_actions): Do not free states now, since we
10968 still need to know the final_state number in `prepare', called
10969 afterwards. Do it...
10970 * src/main.c (main): here: call states_free after `output'.
10971
10972 2002-06-30 Akim Demaille <akim@epita.fr>
10973
10974 * src/state.h, src/state.c (state_new): New, extracted from...
10975 * src/LR0.c (new_state): here.
10976 * src/state.h (STATE_ALLOC): Move to...
10977 * src/state.c: here.
10978 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
10979 * src/state.h, src/state.c: here.
10980
10981 2002-06-30 Akim Demaille <akim@epita.fr>
10982
10983 * src/reader.c (gensym): Rename as...
10984 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
10985 (getsym): Rename as...
10986 (symbol_get): this.
10987
10988 2002-06-30 Akim Demaille <akim@epita.fr>
10989
10990 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
10991 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
10992 * src/output.c, src/print.c, src/print_graph.c: Propagate.
10993 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
10994
10995 2002-06-30 Akim Demaille <akim@epita.fr>
10996
10997 Make the test suite pass with warnings checked.
10998
10999 * tests/actions.at (Printers and Destructors): Improve.
11000 Avoid unsigned vs. signed issues.
11001 * tests/calc.at: Don't exercise the scanner here, do it...
11002 * tests/input.at (Torturing the Scanner): here.
11003
11004 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11005
11006 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
11007 reorganize first lines parallel to yacc.c.
11008
11009 2002-06-28 Akim Demaille <akim@epita.fr>
11010
11011 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
11012 (b4_token_enum, b4_token_defines): New, factored from...
11013 * data/lalr1.cc, data/yacc.c, glr.c: here.
11014
11015 2002-06-28 Akim Demaille <akim@epita.fr>
11016
11017 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
11018 unused variables.
11019 * src/output.c (merger_output): static.
11020
11021 2002-06-28 Akim Demaille <akim@epita.fr>
11022
11023 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
11024 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
11025 pacify GCC.
11026 * src/output.c (save_row): Initialize all the variables to pacify GCC.
11027
11028 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11029
11030 Accumulated changelog for new GLR parsing features.
11031
11032 * src/conflicts.c (count_total_conflicts): Change name to
11033 conflicts_total_count.
11034 * src/conflicts.h: Ditto.
11035 * src/output.c (token_actions): Use the new name.
11036 (output_conflicts): Change conflp => conflict_list_heads, and
11037 confl => conflict_list for better readability.
11038 * data/glr.c: Use the new names.
11039 * NEWS: Add self to GLR announcement.
11040
11041 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
11042
11043 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
11044 Akim Demaille.
11045
11046 * data/bison.glr: Change name to glr.c
11047 * data/glr.c: Renamed from bison.glr.
11048 * data/Makefile.am: Add glr.c
11049
11050 * src/getargs.c:
11051
11052 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
11053 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
11054
11055 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11056
11057 * data/bison.glr: Be sure to restore the
11058 current #line when returning to the skeleton contents after having
11059 exposed the input file's #line.
11060
11061 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11062
11063 * data/bison.glr: Bring up to date with changes to bison.simple.
11064
11065 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11066
11067 * data/bison.glr: Correct definitions that use b4_prefix.
11068 Various reformatting.
11069 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
11070 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
11071 yytokenp argument; now part of stack.
11072 (yychar): Define to behave as documented.
11073 (yyclearin): Ditto.
11074
11075 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11076
11077 * src/reader.h: Add declaration for free_merger_functions.
11078
11079 * src/reader.c (merge_functions): New variable.
11080 (get_merge_function): New function.
11081 (free_merger_functions): New function.
11082 (readgram): Check for %prec that is not followed by a symbol.
11083 Handle %dprec and %merge declarations.
11084 (packgram): Initialize dprec and merger fields in rules array.
11085
11086 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
11087 conflict_list_cnt, conflict_list_free): New variables.
11088 (table_grow): Also grow conflict_table.
11089 (prepare_rules): Output dprec and merger tables.
11090 (conflict_row): New function.
11091 (action_row): Output conflict lists for GLR parser. Don't use
11092 default reduction in conflicted states for GLR parser so that there
11093 are spaces for the conflict lists.
11094 (save_row): Also save conflict information.
11095 (token_actions): Allocate conflict list.
11096 (merger_output): New function.
11097 (pack_vector): Pack conflict table, too.
11098 (output_conflicts): New function to output yyconflp and yyconfl.
11099 (output_check): Allocate conflict_tos.
11100 (output_actions): Output conflict tables, also.
11101 (output_skeleton): Output b4_mergers definition.
11102 (prepare): Output b4_max_rhs_length definition.
11103 Use 'bison.glr' as default skeleton for GLR parsers.
11104
11105 * src/gram.c (glr_parser): New flag.
11106 (grammar_free): Call free_merger_functions.
11107
11108 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
11109 all pairs of conflicting reductions, rather than just all tokens
11110 causing conflicts. Needed to size conflict tables.
11111 (conflicts_output): Modify call to count_rr_conflicts for new
11112 interface.
11113 (conflicts_print): Ditto.
11114 (count_total_conflicts): New function.
11115
11116 * src/reader.h (merger_list): New type.
11117 (merge_functions): New variable.
11118
11119 * src/lex.h (tok_dprec, tok_merge): New token types.
11120
11121 * src/gram.h (rule_s): Add dprec and merger fields.
11122 (glr_parser): New flag.
11123
11124 * src/conflicts.h (count_total_conflicts): New function.
11125
11126 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
11127
11128 * doc/bison.texinfo (Generalized LR Parsing): New section.
11129 (GLR Parsers): New section.
11130 (Language and Grammar): Mention GLR parsing.
11131 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
11132 Correct typo ("tge" -> "the").
11133
11134 * data/bison.glr: New skeleton for GLR parsing.
11135
11136 * tests/cxx-gram.at: New tests for GLR parsing.
11137
11138 * tests/testsuite.at: Include cxx-gram.at.
11139
11140 * tests/Makefile.am: Add cxx-gram.at.
11141
11142 * src/parse-gram.y:
11143
11144 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
11145
11146 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
11147
11148 2002-06-27 Akim Demaille <akim@epita.fr>
11149
11150 * src/options.h, src/options.c: Remove.
11151 * src/getargs.c (short_options, long_options): New.
11152
11153 2002-06-27 Akim Demaille <akim@epita.fr>
11154
11155 * data/bison.simple, data/bison.c++: Rename as...
11156 * data/yacc.c, data/lalr1.cc: these.
11157 * doc/bison.texinfo (Environment Variables): Remove.
11158
11159 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
11160
11161 * src/getargs.c (report_argmatch): Initialize strtok().
11162
11163 2002-06-20 Akim Demaille <akim@epita.fr>
11164
11165 * data/bison.simple (b4_symbol_actions): New, replaces...
11166 (b4_symbol_destructor, b4_symbol_printer): these.
11167 (yysymprint): Be sure to call YYPRINT only for tokens, and using
11168 user token numbers.
11169
11170 2002-06-20 Akim Demaille <akim@epita.fr>
11171
11172 * data/bison.simple (yydestructor): Rename as...
11173 (yydestruct): this.
11174
11175 2002-06-20 Akim Demaille <akim@epita.fr>
11176
11177 * src/symtab.h, src/symtab.c (symbol_type_set)
11178 (symbol_destructor_set, symbol_precedence_set): The location is
11179 the last argument.
11180 Adjust all callers.
11181
11182 2002-06-20 Akim Demaille <akim@epita.fr>
11183
11184 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
11185 internals.
11186 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
11187 Takes a location.
11188 * src/symtab.h, src/symtab.c (symbol_class_set)
11189 (symbol_user_token_number_set): Likewise.
11190 Adjust all callers.
11191 Promote complain_at.
11192 * tests/input.at (Type Clashes): Adjust.
11193
11194 2002-06-20 Akim Demaille <akim@epita.fr>
11195
11196 * data/bison.simple (YYLEX): Fix the declaration when
11197 %pure-parser.
11198
11199 2002-06-20 Akim Demaille <akim@epita.fr>
11200
11201 * data/bison.simple (yysymprint): Don't print the token number,
11202 just its name.
11203 * tests/actions.at (Destructors): Rename as...
11204 (Printers and Destructors): this.
11205 Also exercise %printer.
11206
11207 2002-06-20 Akim Demaille <akim@epita.fr>
11208
11209 * data/bison.simple (YYDSYMPRINT): New.
11210 Use it to remove many of the #if YYDEBUG/if (yydebug).
11211
11212 2002-06-20 Akim Demaille <akim@epita.fr>
11213
11214 * src/symtab.h, src/symtab.c (symbol_t): printer and
11215 printer_location are new members.
11216 (symbol_printer_set): New.
11217 * src/parse-gram.y (PERCENT_PRINTER): New token.
11218 Handle its associated rule.
11219 * src/scan-gram.l: Adjust.
11220 (handle_destructor_at, handle_destructor_dollar): Rename as...
11221 (handle_symbol_code_at, handle_symbol_code_dollar): these.
11222 * src/output.c (symbol_printers_output): New.
11223 (output_skeleton): Call it.
11224 * data/bison.simple (yysymprint): New. Cannot be named yyprint
11225 since there are already many grammar files with a user `yyprint'.
11226 Replace the calls to YYPRINT to calls to yysymprint.
11227 * tests/calc.at: Adjust.
11228 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
11229 taking advantage of parser very internal details (stack size!).
11230
11231 2002-06-20 Akim Demaille <akim@epita.fr>
11232
11233 * src/scan-gram.l: Complete the scanner with the missing patterns
11234 to pacify Flex.
11235 Use `quote' and `symbol_tag_get' where appropriate.
11236
11237 2002-06-19 Akim Demaille <akim@epita.fr>
11238
11239 * tests/actions.at (Destructors): Augment to test locations.
11240 * data/bison.simple (yydestructor): Pass it the current location
11241 if locations are enabled.
11242 Prototype only when __STDC__ or C++.
11243 Change the argument names to move into the yy name space: there is
11244 user code here.
11245
11246 2002-06-19 Akim Demaille <akim@epita.fr>
11247
11248 * data/bison.simple (b4_pure_if): New.
11249 Use it instead of #ifdef YYPURE.
11250
11251 2002-06-19 Akim Demaille <akim@epita.fr>
11252
11253 * data/bison.simple (b4_location_if): New.
11254 Use it instead of #ifdef YYLSP_NEEDED.
11255
11256 2002-06-19 Akim Demaille <akim@epita.fr>
11257
11258 Prepare @$ in %destructor, but currently don't bind it in the
11259 skeleton, as %location use is not cleaned up yet.
11260
11261 * src/scan-gram.l (handle_dollar, handle_destructor_at)
11262 (handle_action_at): New.
11263 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
11264 a braced_code_t and a location as additional arguments.
11265 (handle_destructor_dollar): Instead of requiring `b4_eval', just
11266 unquote one when outputting `b4_dollar_dollar'.
11267 Adjust callers.
11268 * data/bison.simple (b4_eval): Remove.
11269 (b4_symbol_destructor): Adjust.
11270 * tests/input.at (Invalid @n): Adjust.
11271
11272 2002-06-19 Zack Weinberg <zack@codesourcery.com>
11273
11274 * doc/bison.texinfo: Document ability to have multiple
11275 prologue sections.
11276
11277 2002-06-18 Akim Demaille <akim@epita.fr>
11278
11279 * src/files.c (compute_base_names): When computing the output file
11280 names from the input file name, strip the directory part.
11281
11282 2002-06-18 Akim Demaille <akim@epita.fr>
11283
11284 * data/bison.simple.new: Comment changes.
11285 Reported by Andreas Schwab.
11286
11287 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
11288
11289 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
11290 there are no `label `yyoverflowlab' defined but not used' warnings
11291 when yyoverflow is defined.
11292
11293 2002-06-18 Akim Demaille <akim@epita.fr>
11294
11295 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
11296 new member.
11297 (symbol_destructor_set): Adjust.
11298 * src/output.c (symbol_destructors_output): Output the destructor
11299 locations.
11300 Output the symbol name.
11301 * data/bison.simple (b4_symbol_destructor): Adjust.
11302
11303 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
11304 and Akim Demaille <akim@epita.fr>
11305
11306 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
11307 what's left on the stack when the error recovery hits EOF.
11308 * tests/actions.at (Destructors): Complete to exercise this case.
11309
11310 2002-06-17 Akim Demaille <akim@epita.fr>
11311
11312 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
11313 arguments is really empty, not only equal to `[]'.
11314 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
11315 member.
11316 (symbol_destructor_set): New.
11317 * src/output.c (symbol_destructors_output): New.
11318 * src/reader.h (brace_code_t, current_braced_code): New.
11319 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
11320 (handle_dollar): Rename as...
11321 (handle_action_dollar): this.
11322 (handle_destructor_dollar): New.
11323 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
11324 (grammar_declaration): Use it.
11325 * data/bison.simple (yystos): Is always defined.
11326 (yydestructor): New.
11327 * tests/actions.at (Destructors): New.
11328 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
11329
11330 2002-06-17 Akim Demaille <akim@epita.fr>
11331
11332 * src/symlist.h, src/symlist.c (symbol_list_length): New.
11333 * src/scan-gram.l (handle_dollar, handle_at): Compute the
11334 rule_length only when needed.
11335 * src/output.c (actions_output, token_definitions_output): Output
11336 the full M4 block.
11337 * src/symtab.c: Don't access directly to the symbol tag, use
11338 symbol_tag_get.
11339 * src/parse-gram.y: Use symbol_list_free.
11340
11341 2002-06-17 Akim Demaille <akim@epita.fr>
11342
11343 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
11344 (symbol_list_prepend, get_type_name): Move to...
11345 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
11346 (symbol_list_prepend, symbol_list_n_type_name_get): here.
11347 Adjust all callers.
11348 (symbol_list_free): New.
11349 * src/scan-gram.l (handle_dollar): Takes a location.
11350 * tests/input.at (Invalid $n): Adjust.
11351
11352 2002-06-17 Akim Demaille <akim@epita.fr>
11353
11354 * src/reader.h, src/reader.c (symbol_list_new): Export it.
11355 (symbol_list_prepend): New.
11356 * src/parse-gram.y (%union): `list' is a new member.
11357 (symbols.1): New, replaces...
11358 (terms_to_prec.1, nterms_to_type.1): these.
11359 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
11360 Take a location as additional argument.
11361 Adjust all callers.
11362
11363 2002-06-15 Akim Demaille <akim@epita.fr>
11364
11365 * src/parse-gram.y: Move %token in the declaration section so that
11366 we don't depend upon CVS Bison.
11367
11368 2002-06-15 Akim Demaille <akim@epita.fr>
11369
11370 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
11371 * src/print.c (print_core): Use it.
11372
11373 2002-06-15 Akim Demaille <akim@epita.fr>
11374
11375 * src/conflicts.c (log_resolution): Accept the rule involved in
11376 the sr conflicts instead of the lookahead number that points to
11377 that rule.
11378 (flush_reduce): Accept the current lookahead vector as argument,
11379 instead of the index in LA.
11380 (resolve_sr_conflict): Accept the current number of lookahead
11381 bitset to consider for the STATE, instead of the index in LA.
11382 (set_conflicts): Adjust.
11383 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
11384
11385 2002-06-15 Akim Demaille <akim@epita.fr>
11386
11387 * src/state.h (state_t): Replace the `lookaheadsp' member, a
11388 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
11389 Adjust all dependencies.
11390 * src/lalr.c (initialize_lookaheads): Split into...
11391 (states_lookaheads_count, states_lookaheads_initialize): these.
11392 (lalr): Adjust.
11393
11394 2002-06-15 Akim Demaille <akim@epita.fr>
11395
11396 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
11397 out of...
11398 (grammar_rules_print): here.
11399 * src/reduce.c (reduce_output): Use it.
11400 * tests/reduce.at (Useless Rules, Reduced Automaton)
11401 (Underivable Rules): Adjust.
11402
11403 2002-06-15 Akim Demaille <akim@epita.fr>
11404
11405 Copy BYacc's nice way to report the grammar.
11406
11407 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
11408 New.
11409 Don't print the rules' location, it is confusing and useless.
11410 (rule_print): Use grammar_rhs_print.
11411 * src/print.c (print_grammar): Use grammar_rules_print.
11412
11413 2002-06-15 Akim Demaille <akim@epita.fr>
11414
11415 Complete and rationalize `useless thing' warnings.
11416
11417 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
11418 (symbol_tag_print): New.
11419 Use them everywhere in place of accessing directly the tag member.
11420 * src/gram.h, src/gram.c (rule_print): New.
11421 Use it where a rule used to be printed `by hand'.
11422 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
11423 (reduce_grammar_tables): Report the useless rules.
11424 (reduce_print): Useless things are a warning, not an error.
11425 Report it as such.
11426 * tests/reduce.at (Useless Nonterminals, Useless Rules):
11427 (Reduced Automaton, Underivable Rules): Adjust.
11428 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
11429 * tests/conflicts.at (Unresolved SR Conflicts)
11430 (Solved SR Conflicts): Adjust.
11431
11432 2002-06-15 Akim Demaille <akim@epita.fr>
11433
11434 Let symbols have a location.
11435
11436 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
11437 (getsym): Adjust.
11438 Adjust all callers.
11439 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
11440 Use location_t, not int.
11441 * src/symtab.c (symbol_check_defined): Take advantage of the
11442 location.
11443 * tests/regression.at (Invalid inputs): Adjust.
11444
11445 2002-06-15 Akim Demaille <akim@epita.fr>
11446
11447 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
11448 (input): Don't try to initialize yylloc here, do it in the
11449 scanner.
11450 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
11451 * src/gram.h (rule_t): Change line and action_line into location
11452 and action_location, of location_t type.
11453 Adjust all dependencies.
11454 * src/location.h, src/location.c (empty_location): New.
11455 * src/reader.h, src/reader.c (grammar_start_symbol_set)
11456 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
11457 (grammar_current_rule_symbol_append)
11458 (grammar_current_rule_action_append): Expect a location as argument.
11459 * src/reader.c (grammar_midrule_action): Adjust to attach an
11460 action's location as dummy symbol location.
11461 * src/symtab.h, src/symtab.c (startsymbol_location): New.
11462 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
11463 the line numbers.
11464
11465 2002-06-14 Akim Demaille <akim@epita.fr>
11466
11467 Grammar declarations may be found in the grammar section.
11468
11469 * src/parse-gram.y (rules_or_grammar_declaration): New.
11470 (declarations): Each declaration may end with a semicolon, not
11471 just...
11472 (grammar_declaration): `"%union"'.
11473 (grammar): Branch to rules_or_grammar_declaration.
11474
11475 2002-06-14 Akim Demaille <akim@epita.fr>
11476
11477 * src/main.c (main): Invoke scanner_free.
11478
11479 2002-06-14 Akim Demaille <akim@epita.fr>
11480
11481 * src/output.c (m4_invoke): Extracted from...
11482 (output_skeleton): here.
11483 Free tempfile.
11484
11485 2002-06-14 Akim Demaille <akim@epita.fr>
11486
11487 * src/parse-gram.y (directives, directive, gram)
11488 (grammar_directives, precedence_directives, precedence_directive):
11489 Rename as...
11490 (declarations, declaration, grammar, grammar_declaration)
11491 (precedence_declaration, precedence_declarator): these.
11492 (symbol_declaration): New.
11493
11494 2002-06-14 Akim Demaille <akim@epita.fr>
11495
11496 * src/files.c (action_obstack): Remove, unused.
11497 (output_obstack): Remove it, and all its dependencies, as it is no
11498 longer needed.
11499 * src/reader.c (epilogue_set): Build the epilogue in the
11500 muscle_obstack.
11501 * src/output.h, src/output.c (muscle_obstack): Move to...
11502 * src/muscle_tab.h, src/muscle_tab.h: here.
11503 (muscle_init): Initialize muscle_obstack.
11504 (muscle_free): New.
11505 * src/main.c (main): Call it.
11506
11507 2002-06-14 Akim Demaille <akim@epita.fr>
11508
11509 * src/location.h: New, extracted from...
11510 * src/reader.h: here.
11511 * src/Makefile.am (noinst_HEADERS): Merge into
11512 (bison_SOURCES): this.
11513 Add location.h.
11514 * src/parse-gram.y: Use location_t instead of Bison's.
11515 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
11516 Use location_t instead of ints.
11517
11518 2002-06-14 Akim Demaille <akim@epita.fr>
11519
11520 * data/bison.simple, data/bison.c++: Be sure to restore the
11521 current #line when returning to the skeleton contents after having
11522 exposed the input file's #line.
11523
11524 2002-06-12 Akim Demaille <akim@epita.fr>
11525
11526 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
11527 eager.
11528 * tests/actions.at (Exotic Dollars): New.
11529
11530 2002-06-12 Akim Demaille <akim@epita.fr>
11531
11532 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
11533 ['"/] too eagerly.
11534 * tests/input.at (Torturing the Scanner): New.
11535
11536 2002-06-11 Akim Demaille <akim@epita.fr>
11537
11538 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
11539 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
11540 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
11541 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
11542 * src/reader.c (reader): Use it.
11543
11544 2002-06-11 Akim Demaille <akim@epita.fr>
11545
11546 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
11547 Adjust all callers.
11548 (scanner_last_string_free): New.
11549
11550 2002-06-11 Akim Demaille <akim@epita.fr>
11551
11552 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
11553 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
11554 (last_string, YY_OBS_FREE): New.
11555 Use them when returning an ID.
11556
11557 2002-06-11 Akim Demaille <akim@epita.fr>
11558
11559 Have Bison grammars parsed by a Bison grammar.
11560
11561 * src/reader.c, src/reader.h (prologue_augment): New.
11562 * src/reader.c (copy_definition): Remove.
11563
11564 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
11565 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
11566 (grammar_current_rule_prec_set, grammar_current_rule_check)
11567 (grammar_current_rule_symbol_append)
11568 (grammar_current_rule_action_append): Export.
11569 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
11570 (symbol_list_action_append): Remove.
11571 Hook the routines from reader.
11572 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
11573 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
11574
11575 * src/reader.c (read_declarations): Remove, unused.
11576
11577 * src/parse-gram.y: Handle the epilogue.
11578 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
11579 (grammar_start_symbol_set): this.
11580 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
11581 * src/reader.c (readgram): Remove, unused.
11582 (reader): Adjust to insert eoftoken and axiom where appropriate.
11583
11584 * src/reader.c (copy_dollar): Replace with...
11585 * src/scan-gram.h (handle_dollar): this.
11586 * src/parse-gram.y: Remove `%thong'.
11587
11588 * src/reader.c (copy_at): Replace with...
11589 * src/scan-gram.h (handle_at): this.
11590
11591 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
11592 New.
11593
11594 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
11595 time being.
11596
11597 * src/reader.h, src/reader.c (grammar_rule_end): New.
11598
11599 * src/parse.y (current_type, current_class): New.
11600 Implement `%nterm', `%token' support.
11601 Merge `%term' into `%token'.
11602 (string_as_id): New.
11603 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
11604 type name.
11605
11606 * src/parse-gram.y: Be sure to handle properly the beginning of
11607 rules.
11608
11609 * src/parse-gram.y: Handle %type.
11610 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
11611
11612 * src/parse-gram.y: More directives support.
11613 * src/options.c: No longer handle source directives.
11614
11615 * src/parse-gram.y: Fix %output.
11616
11617 * src/parse-gram.y: Handle %union.
11618 Use the prologue locations.
11619 * src/reader.c (parse_union_decl): Remove.
11620
11621 * src/reader.h, src/reader.c (epilogue_set): New.
11622 * src/parse-gram.y: Use it.
11623
11624 * data/bison.simple, data/bison.c++: b4_stype is now either not
11625 defined, then default to int, or to the contents of %union,
11626 without `union' itself.
11627 Adjust.
11628 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
11629
11630 * src/output.c (actions_output): Don't output braces, as they are
11631 already handled by the scanner.
11632
11633 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
11634 characters to themselves.
11635
11636 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
11637 that the epilogue has a proper #line.
11638
11639 * src/parse-gram.y: Handle precedence/associativity.
11640
11641 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
11642 a terminal.
11643 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
11644 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
11645 at all to define terminals that cannot be emitted.
11646
11647 * src/scan-gram.l: Escape M4 characters.
11648
11649 * src/scan-gram.l: Working properly with escapes in user
11650 strings/characters.
11651
11652 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
11653 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
11654 grammar.
11655 Use more modest sizes, as for the time being the parser does not
11656 release memory, and therefore the process swallows a huge amount
11657 of memory.
11658
11659 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
11660 stricter %token grammar.
11661
11662 * src/symtab.h (associativity): Add `undef_assoc'.
11663 (symbol_precedence_set): Do nothing when passed an undef_assoc.
11664 * src/symtab.c (symbol_check_alias_consistence): Adjust.
11665
11666 * tests/regression.at (Invalid %directive): Remove, as it is now
11667 meaningless.
11668 (Invalid inputs): Adjust to the new error messages.
11669 (Token definitions): The new grammar doesn't allow too many
11670 eccentricities.
11671
11672 * src/lex.h, src/lex.c: Remove.
11673 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
11674 (copy_character, copy_string2, copy_string, copy_identifier)
11675 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
11676 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
11677 (parse_action): Remove.
11678 * po/POTFILES.in: Adjust.
11679
11680 2002-06-11 Akim Demaille <akim@epita.fr>
11681
11682 * src/reader.c (parse_action): Don't store directly into the
11683 rule's action member: return the action as a string.
11684 Don't require `rule_length' as an argument: compute it.
11685 (grammar_current_rule_symbol_append)
11686 (grammar_current_rule_action_append): New, eved out from
11687 (readgram): here.
11688 Remove `action_flag', `rulelength', unused now.
11689
11690 2002-06-11 Akim Demaille <akim@epita.fr>
11691
11692 * src/reader.c (grammar_current_rule_prec_set).
11693 (grammar_current_rule_check): New, eved out from...
11694 (readgram): here.
11695 Remove `xaction', `first_rhs': useless.
11696 * tests/input.at (Type clashes): New.
11697 * tests/existing.at (GNU Cim Grammar): Adjust.
11698
11699 2002-06-11 Akim Demaille <akim@epita.fr>
11700
11701 * src/reader.c (grammar_midrule_action): New, Eved out from
11702 (readgram): here.
11703
11704 2002-06-11 Akim Demaille <akim@epita.fr>
11705
11706 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
11707 New.
11708 (readgram): Use them as replacement of inlined code, crule and
11709 crule1.
11710
11711 2002-06-11 Akim Demaille <akim@epita.fr>
11712
11713 * src/reader.c (grammar_end, grammar_symbol_append): New.
11714 (readgram): Use them.
11715 Make the use of `p' as local as possible.
11716
11717 2002-06-10 Akim Demaille <akim@epita.fr>
11718
11719 GCJ's parser requires the tokens to be defined before the prologue.
11720
11721 * data/bison.simple: Output the token definition before the user's
11722 prologue.
11723 * tests/regression.at (Braces parsing, Duplicate string)
11724 (Mixing %token styles): Check the output from bison.
11725 (Early token definitions): New.
11726
11727 2002-06-10 Akim Demaille <akim@epita.fr>
11728
11729 * src/symtab.c (symbol_user_token_number_set): Don't complain when
11730 assigning twice the same user number to a token, so that we can
11731 use it in...
11732 * src/lex.c (lex): here.
11733 Also use `symbol_class_set' instead of hand written code.
11734 * src/reader.c (parse_assoc_decl): Likewise.
11735
11736 2002-06-10 Akim Demaille <akim@epita.fr>
11737
11738 * src/symtab.c, src/symtab.c (symbol_class_set)
11739 (symbol_user_token_number_set): New.
11740 * src/reader.c (parse_token_decl): Use them.
11741 Use a switch instead of ifs.
11742 Use a single argument.
11743
11744 2002-06-10 Akim Demaille <akim@epita.fr>
11745
11746 Remove `%thong' support as it is undocumented, unused, duplicates
11747 `%token's job, and creates useless e-mail traffic with people who
11748 want to know what it is, why it is undocumented, unused, and
11749 duplicates `%token's job.
11750
11751 * src/reader.c (parse_thong_decl): Remove.
11752 * src/options.c (option_table): Remove "thong".
11753 * src/lex.h (tok_thong): Remove.
11754
11755 2002-06-10 Akim Demaille <akim@epita.fr>
11756
11757 * src/symtab.c, src/symtab.c (symbol_type_set)
11758 (symbol_precedence_set): New.
11759 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
11760 (value_components_used): Remove, unused.
11761
11762 2002-06-09 Akim Demaille <akim@epita.fr>
11763
11764 Move symbols handling code out of the reader.
11765
11766 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
11767 (axiom): Move to...
11768 * src/symtab.h, src/symtab.c: here.
11769
11770 * src/gram.c (start_symbol): Remove: use startsymbol->number.
11771 * src/reader.c (startval): Rename as...
11772 * src/symtab.h, src/symtab.c (startsymbol): this.
11773 * src/reader.c: Adjust.
11774
11775 * src/reader.c (symbol_check_defined, symbol_make_alias)
11776 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11777 (token_translations_init)
11778 Move to...
11779 * src/symtab.c: here.
11780 * src/reader.c (packsymbols): Move to...
11781 * src/symtab.h, src/symtab.c (symbols_pack): here.
11782 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
11783 argument.
11784
11785 2002-06-03 Akim Demaille <akim@epita.fr>
11786
11787 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
11788 then statements.
11789
11790 2002-06-03 Akim Demaille <akim@epita.fr>
11791
11792 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
11793 structs with non literals.
11794 * src/scan-skel.l: never-interactive.
11795 * src/conflicts.c (enum conflict_resolution_e): No trailing
11796 comma.
11797 * src/getargs.c (usage): Split long literal strings.
11798 Reported by Hans Aberg.
11799
11800 2002-05-28 Akim Demaille <akim@epita.fr>
11801
11802 * data/bison.c++: Use C++ ostreams.
11803 (cdebug_): New member.
11804
11805 2002-05-28 Akim Demaille <akim@epita.fr>
11806
11807 * src/output.c (output_skeleton): Be sure to allocate enough room
11808 for `/' _and_ for `\0' in full_skeleton.
11809
11810 2002-05-28 Akim Demaille <akim@epita.fr>
11811
11812 * data/bison.c++: Catch up with bison.simple:
11813 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11814 and Paul Eggert <eggert@twinsun.com>: `error' handing.
11815 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
11816 and popping traces.
11817
11818 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11819
11820 * src/output.c (output_skeleton): Put an explicit path in front of
11821 the skeleton file name, rather than relying on the -I directory,
11822 to partially alleviate effects of having a skeleton file lying around
11823 in the current directory.
11824
11825 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11826
11827 * src/conflicts.c (log_resolution): Correct typo:
11828 obstack_printf should be obstack_fgrow1.
11829
11830 2002-05-26 Akim Demaille <akim@epita.fr>
11831
11832 * src/state.h (state_t): `solved_conflicts' is a new member.
11833 * src/LR0.c (new_state): Set it to 0.
11834 * src/conflicts.h, src/conflicts.c (print_conflicts)
11835 (free_conflicts, solve_conflicts): Rename as...
11836 (conflicts_print, conflicts_free, conflicts_solve): these.
11837 Adjust callers.
11838 * src/conflicts.c (enum conflict_resolution_e)
11839 (solved_conflicts_obstack): New, used by...
11840 (log_resolution): this.
11841 Adjust to attach the conflict resolution to each state.
11842 Complete the description with the precedence/associativity
11843 information.
11844 (resolve_sr_conflict): Adjust.
11845 * src/print.c (print_state): Output its solved_conflicts.
11846 * tests/conflicts.at (Unresolved SR Conflicts)
11847 (Solved SR Conflicts): Exercise --report=all.
11848
11849 2002-05-26 Akim Demaille <akim@epita.fr>
11850
11851 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
11852 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
11853 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
11854 (token_number_t, item_number_as_token_number)
11855 (token_number_as_item_number, muscle_insert_token_number_table):
11856 Rename as...
11857 (symbol_number_t, item_number_as_symbol_number)
11858 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
11859 these, since it is more appropriate.
11860
11861 2002-05-26 Akim Demaille <akim@epita.fr>
11862
11863 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
11864 `Error:' lines.
11865 * data/bison.simple (yystos) [YYDEBUG]: New.
11866 (yyparse) [YYDEBUG]: Display the symbols which are popped during
11867 error recovery.
11868 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
11869
11870 2002-05-25 Akim Demaille <akim@epita.fr>
11871
11872 * doc/bison.texinfo (Debugging): Split into...
11873 (Tracing): this new section, its former contents, and...
11874 (Understanding): this new section.
11875 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
11876 by...
11877 (report_flag): this.
11878 Adjust all dependencies.
11879 (report_args, report_types, report_argmatch): New.
11880 (usage, getargs): Report/support -r, --report.
11881 * src/options.h
11882 (struct option_table_struct): Rename as..,
11883 (struct option_table_s): this.
11884 Rename the `set_flag' member to `flag' to match with getopt_long's
11885 struct.
11886 * src/options.c (option_table): Split verbose into an entry for
11887 %verbose, and another for --verbose.
11888 Support --report/-r, so remove -r from the obsolete --raw.
11889 * src/print.c: Attach full item sets and lookaheads reports to
11890 report_flag instead of trace_flag.
11891 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
11892
11893 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11894 and Paul Eggert <eggert@twinsun.com>
11895
11896 * data/bison.simple (yyparse): Correct error handling to conform to
11897 POSIX and yacc. Specifically, after syntax error is discovered,
11898 do not reduce further before shifting the error token.
11899 Clean up the code a bit by removing the labels yyerrdefault,
11900 yyerrhandle, yyerrpop.
11901 * NEWS: Document the above.
11902
11903 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11904
11905 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
11906 type; it isn't always big enough, since it doesn't necessarily
11907 include non-terminals.
11908 (yytranslate): Expand definition of yy_token_number_type, so that
11909 the latter can be removed.
11910 (yy_token_number_type): Remove, only one use.
11911 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
11912 don't use TokenNumberType as element type.
11913
11914 * tests/regression.at: Modify expected output to agree with change
11915 to yyr1 and yytranslate.
11916
11917 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
11918
11919 * src/reader.c (parse_action): Use copy_character instead of
11920 obstack_1grow.
11921
11922 2002-05-13 Akim Demaille <akim@epita.fr>
11923
11924 * tests/regression.at (Token definitions): Prototype yylex and
11925 yyerror.
11926
11927 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11928
11929 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
11930 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
11931 32-bit arithmetic.
11932 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
11933
11934 2002-05-07 Akim Demaille <akim@epita.fr>
11935
11936 * tests/synclines.at: Be sure to prototype yylex and yyerror to
11937 avoid GCC warnings.
11938
11939 2002-05-07 Akim Demaille <akim@epita.fr>
11940
11941 Kill GCC warnings.
11942
11943 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
11944 over the RHS of each rule.
11945 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
11946 * src/state.h (state_t): Member `nitems' is unsigned short.
11947 * src/LR0.c (get_state): Adjust.
11948 * src/reader.c (packgram): Likewise.
11949 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
11950 `Type'.
11951 (muscle_insert_int_table): Remove, unused.
11952 (prepare_rules): Remove `max'.
11953
11954 2002-05-06 Akim Demaille <akim@epita.fr>
11955
11956 * src/closure.c (print_firsts): Display of the symbol tags.
11957 (bitmatrix_print): Move to...
11958 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
11959 here.
11960 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
11961
11962 2002-05-06 Akim Demaille <akim@epita.fr>
11963
11964 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
11965 hash_do_for_each.
11966
11967 2002-05-06 Akim Demaille <akim@epita.fr>
11968
11969 * src/LR0.c (new_state, get_state): Instead of using the global
11970 `kernel_size' and `kernel_base', have two new arguments:
11971 `core_size' and `core'.
11972 Adjust callers.
11973
11974 2002-05-06 Akim Demaille <akim@epita.fr>
11975
11976 * src/reader.c (packgram): No longer end `ritem' with a 0
11977 sentinel: it is not used.
11978
11979 2002-05-05 Akim Demaille <akim@epita.fr>
11980
11981 New experimental feature: display the lookaheads in the report and
11982 graph.
11983
11984 * src/print (print_core): When --trace-flag, display the rules
11985 lookaheads.
11986 * src/print_graph.c (print_core): Likewise.
11987 Swap the arguments.
11988 Adjust caller.
11989
11990 2002-05-05 Akim Demaille <akim@epita.fr>
11991
11992 * tests/torture.at (Many lookaheads): New test.
11993
11994 2002-05-05 Akim Demaille <akim@epita.fr>
11995
11996 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
11997 (GENERATE_MUSCLE_INSERT_TABLE): this.
11998 (output_int_table, output_unsigned_int_table, output_short_table)
11999 (output_token_number_table, output_item_number_table): Replace with...
12000 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
12001 (muscle_insert_short_table, muscle_insert_token_number_table)
12002 (muscle_insert_item_number_table): these.
12003 Adjust all callers.
12004 (prepare_tokens): Don't free `translations', since...
12005 * src/reader.h, src/reader.c (grammar_free): do it.
12006 Move to...
12007 * src/gram.h, src/gram.c (grammar_free): here.
12008 * data/bison.simple, data/bison.c++: b4_token_number_max is now
12009 b4_translate_max.
12010
12011 2002-05-05 Akim Demaille <akim@epita.fr>
12012
12013 * src/output.c (output_unsigned_int_table): New.
12014 (prepare_rules): `i' is unsigned.
12015 `prhs', `rline', `r2' are unsigned int.
12016 Rename muscle `rhs_number_max' as `rhs_max'.
12017 Output muscles `prhs_max', `rline_max', and `r2_max'.
12018 Free rline and r1.
12019 * data/bison.simple, data/bison.c++: Adjust to use these muscles
12020 to compute types instead of constant types.
12021 * tests/regression.at (Web2c Actions): Adjust.
12022
12023 2002-05-04 Akim Demaille <akim@epita.fr>
12024
12025 * src/symtab.h (SALIAS, SUNDEF): Rename as...
12026 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
12027 Adjust dependencies.
12028 * src/output.c (token_definitions_output): Be sure not to output a
12029 `#define 'a'' when fed with `%token 'a' "a"'.
12030 * tests/regression.at (Token definitions): New.
12031
12032 2002-05-03 Paul Eggert <eggert@twinsun.com>
12033
12034 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
12035 for K&R C.
12036
12037 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
12038
12039 * Makefile.am (SUBDIRS): Remove intl.
12040 (EXTRA_DIST): Add config/config.rpath.
12041
12042 2002-05-03 Akim Demaille <akim@epita.fr>
12043
12044 * data/bison.simple (m4_if): Don't output empty enums.
12045 And actually, output valid enum definitions :(.
12046
12047 2002-05-03 Akim Demaille <akim@epita.fr>
12048
12049 * configure.bat: Remove, completely obsolete.
12050 * Makefile.am (EXTRA_DIST): Adjust.
12051 Don't distribute config.rpath...
12052 * config/Makefile.am (EXTRA_DIST): Do it.
12053
12054 2002-05-03 Akim Demaille <akim@epita.fr>
12055
12056 * configure.in (GETTEXT_VERSION): New.
12057 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
12058
12059 2002-05-03 Akim Demaille <akim@epita.fr>
12060
12061 * data/bison.simple (b4_token_enum): New.
12062 (b4_token_defines): Use it to output tokens both as #define and
12063 enums.
12064 Suggested by Paul Eggert.
12065 * src/output.c (token_definitions_output): Don't output spurious
12066 white spaces.
12067
12068 2002-05-03 Akim Demaille <akim@epita.fr>
12069
12070 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12071
12072 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
12073
12074 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
12075 Update the stack class, give a try to deque as the default container.
12076
12077 2002-05-02 Akim Demaille <akim@epita.fr>
12078
12079 * data/bison.simple (yyparse): Do not implement @$ = @1.
12080 (YYLLOC_DEFAULT): Adjust to do it.
12081 * doc/bison.texinfo (Location Default Action): Fix.
12082
12083 2002-05-02 Akim Demaille <akim@epita.fr>
12084
12085 * src/reader.c (parse_braces): Merge into...
12086 (parse_action): this.
12087
12088 2002-05-02 Akim Demaille <akim@epita.fr>
12089
12090 * configure.in (ALL_LINGUAS): Remove.
12091 * po/LINGUAS, hr.po: New.
12092
12093 2002-05-02 Akim Demaille <akim@epita.fr>
12094
12095 Remove the so called hairy (semantic) parsers.
12096
12097 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
12098 * src/gram.h, src/gram.c (semantic_parser): Remove.
12099 (rule_t): Remove the guard and guard_line members.
12100 * src/lex.h (token_t): remove tok_guard.
12101 * src/options.c (option_table): Remove %guard and %semantic_parser
12102 support.
12103 * src/output.c, src/output.h (guards_output): Remove.
12104 (prepare): Adjust.
12105 (token_definitions_output): Don't output the `T'
12106 tokens (???).
12107 (output_skeleton): Don't output the guards.
12108 * src/files.c, src/files.c (attrsfile): Remove.
12109 * src/reader.c (symbol_list): Remove the guard and guard_line
12110 members.
12111 Adjust dependencies.
12112 (parse_guard): Remove.
12113 * data/bison.hairy: Remove.
12114 * doc/bison.texinfo (Environment Variables): Remove occurrences of
12115 BISON_HAIRY.
12116
12117 2002-05-02 Akim Demaille <akim@epita.fr>
12118
12119 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
12120 (parse_guard): Rename the formal argument `stack_offset' as
12121 `rule_length', which is more readable.
12122 Adjust callers.
12123 (copy_at, copy_dollar): Instead of outputting the hard coded
12124 values of $$, $n and so forth, output invocation to b4_lhs_value,
12125 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
12126 Note: this patch partially drops `semantic-parser' support: it
12127 always does `rule_length - n', where semantic parsers ought to
12128 always use `-n'.
12129 * data/bison.simple, data/bison.c++ (b4_lhs_value)
12130 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
12131
12132 2002-05-02 Akim Demaille <akim@epita.fr>
12133
12134 * configure.in (AC_INIT): Bump to 1.49b.
12135 (AM_INIT_AUTOMAKE): Short invocation.
12136
12137 2002-05-02 Akim Demaille <akim@epita.fr>
12138
12139 Version 1.49a.
12140
12141 2002-05-01 Akim Demaille <akim@epita.fr>
12142
12143 * src/skeleton.h: Remove.
12144
12145 2002-05-01 Akim Demaille <akim@epita.fr>
12146
12147 * src/skeleton.h: Fix the #endif.
12148 Reported by Magnus Fromreide.
12149
12150 2002-04-26 Paul Eggert <eggert@twinsun.com>
12151
12152 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
12153 Define if we define YYSTYPE and YYLTYPE, respectively.
12154 (YYCOPY): Fix [] quoting problem in the non-GCC case.
12155
12156 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
12157
12158 * src/scan-skel.l: Postprocess quadrigraphs.
12159
12160 * src/reader.c (copy_character): New function, used to output
12161 single characters while replacing `[' and `]' with quadrigraphs, to
12162 avoid troubles with M4 quotes.
12163 (copy_comment): Output characters with copy_character.
12164 (read_additionnal_code): Likewise.
12165 (copy_string2): Likewise.
12166 (copy_definition): Likewise.
12167
12168 * tests/calc.at: Exercise M4 quoting.
12169
12170 2002-04-25 Akim Demaille <akim@epita.fr>
12171
12172 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
12173 between `!' and the command.
12174 Reported by Paul Eggert.
12175
12176 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
12177
12178 * tests/calc.at: Exercise prologue splitting.
12179
12180 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
12181 `b4_post_prologue' instead of `b4_prologue'.
12182
12183 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
12184 muscles.
12185 (output): Free pre_prologue_obstack and post_prologue_obstack.
12186 * src/files.h, src/files.c (attrs_obstack): Remove.
12187 (pre_prologue_obstack, post_prologue_obstack): New.
12188 * src/reader.c (copy_definition): Add a parameter to specify the
12189 obstack to fill, instead of using attrs_obstack unconditionally.
12190 (read_declarations): Pass pre_prologue_obstack to copy_definition if
12191 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
12192
12193 2002-04-23 Paul Eggert <eggert@twinsun.com>
12194
12195 * data/bison.simple: Remove unnecessary commentary and white
12196 space differences from 1_29-branch.
12197 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
12198
12199 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
12200 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
12201 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
12202 constructors or destructors.
12203
12204 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
12205
12206 2002-04-23 Akim Demaille <akim@epita.fr>
12207
12208 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
12209 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
12210 location with columns.
12211 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
12212 All reported by Paul Eggert.
12213
12214 2002-04-22 Akim Demaille <akim@epita.fr>
12215
12216 * src/reduce.c (dump_grammar): Move to...
12217 * src/gram.h, src/gram.c (grammar_dump): here.
12218 Be sure to separate long item numbers.
12219 Don't read the members of a rule's prec if its nil.
12220
12221 2002-04-22 Akim Demaille <akim@epita.fr>
12222
12223 * src/output.c (table_size, table_grow): New.
12224 (MAXTABLE): Remove, replace uses with table_size.
12225 (pack_vector): Instead of dying when the table is too big, grow it.
12226
12227 2002-04-22 Akim Demaille <akim@epita.fr>
12228
12229 * data/bison.simple (yyr1): Its type is that of a token number.
12230 * data/bison.c++ (r1_): Likewise.
12231 * tests/regression.at (Web2c Actions): Adjust.
12232
12233 2002-04-22 Akim Demaille <akim@epita.fr>
12234
12235 * src/reader.c (token_translations_init): 256 is now the default
12236 value for the error token, i.e., it will be assigned another
12237 number if the user assigned 256 to one of her tokens.
12238 (reader): Don't force 256 to error.
12239 * doc/bison.texinfo (Symbols): Adjust.
12240 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
12241 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
12242 etc. instead of 10, 20, 30 (which was used to `jump' over error
12243 (256) and undefined (2)).
12244
12245 2002-04-22 Akim Demaille <akim@epita.fr>
12246
12247 Propagate more token_number_t.
12248
12249 * src/gram.h (token_number_as_item_number)
12250 (item_number_as_token_number): New.
12251 * src/output.c (GENERATE_OUTPUT_TABLE): New.
12252 Use it to create output_item_number_table and
12253 output_token_number_table.
12254 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
12255 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
12256 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
12257 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
12258
12259 2002-04-22 Akim Demaille <akim@epita.fr>
12260
12261 * src/output.h, src/output.c (get_lines_number): Remove.
12262
12263 2002-04-19 Akim Demaille <akim@epita.fr>
12264
12265 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
12266 as Lex/Flex'.
12267 (Debugging): More details about enabling the debugging features.
12268 (Table of Symbols): Describe $$, $n, @$, and @n.
12269 Suggested by Tim Josling.
12270
12271 2002-04-19 Akim Demaille <akim@epita.fr>
12272
12273 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
12274
12275 2002-04-10 Akim Demaille <akim@epita.fr>
12276
12277 * src/system.h: Rely on HAVE_LIMITS_H.
12278 Suggested by Paul Eggert.
12279
12280 2002-04-09 Akim Demaille <akim@epita.fr>
12281
12282 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
12283 full stderr, and strip it according to the bison options, instead
12284 of composing the error message from different bits.
12285 This makes it easier to check for several error messages.
12286 Adjust all the invocations.
12287 Add an invocation exercising the error token.
12288 Add an invocation demonstrating a stupid error message.
12289 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
12290 Adjust the tests.
12291 Error message are for stderr, not stdout.
12292
12293 2002-04-09 Akim Demaille <akim@epita.fr>
12294
12295 * src/gram.h, src/gram.c (error_token_number): Remove, use
12296 errtoken->number.
12297 * src/reader.c (reader): Don't specify the user token number (2)
12298 for $undefined, as it uselessly prevents using it.
12299 * src/gram.h (token_number_t): Move to...
12300 * src/symtab.h: here.
12301 (state_t.number): Is a token_number_t.
12302 * src/print.c, src/reader.c: Use undeftoken->number instead of
12303 hard coded 2.
12304 (Even though this 2 is not the same as above: the number of the
12305 undeftoken remains being 2, it is its user token number which
12306 might not be 2).
12307 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
12308 `user_token_number_max'.
12309 Output `undef_token_number'.
12310 * data/bison.simple, data/bison.c++: Use them.
12311 Be sure to map invalid yylex return values to
12312 `undef_token_number'. This saves us from gratuitous SEGV.
12313
12314 * tests/conflicts.at (Solved SR Conflicts)
12315 (Unresolved SR Conflicts): Adjust.
12316 * tests/regression.at (Web2c Actions): Adjust.
12317
12318 2002-04-08 Akim Demaille <akim@epita.fr>
12319
12320 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
12321 Adding #line.
12322 Remove the duplicate `typedefs'.
12323 (RhsNumberType): Fix the declaration and various other typos.
12324 Use __ofile__.
12325 * data/bison.simple: Use __ofile__.
12326 * src/scan-skel.l: Handle __ofile__.
12327
12328 2002-04-08 Akim Demaille <akim@epita.fr>
12329
12330 * src/gram.h (item_number_t): New, the type of item numbers in
12331 RITEM. Note that it must be able to code symbol numbers as
12332 positive number, and the negation of rule numbers as negative
12333 numbers.
12334 Adjust all dependencies (pretty many).
12335 * src/reduce.c (rule): Remove this `short *' pointer: use
12336 item_number_t.
12337 * src/system.h (MINSHORT, MAXSHORT): Remove.
12338 Include `limits.h'.
12339 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
12340 (shortcpy): Remove.
12341 (MAXTABLE): Move to...
12342 * src/output.c (MAXTABLE): here.
12343 (prepare_rules): Use output_int_table to output rhs.
12344 * data/bison.simple, data/bison.c++: Adjust.
12345 * tests/torture.at (Big triangle): Move the limit from 254 to
12346 500.
12347 * tests/regression.at (Web2c Actions): Ajust.
12348
12349 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
12350 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
12351 passes, but produces negative #line number, once fixed, GCC is
12352 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
12353 C), it passes.
12354 * src/state.h (state_h): Code input lines on ints, not shorts.
12355
12356 2002-04-08 Akim Demaille <akim@epita.fr>
12357
12358 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
12359 and then the grammar.
12360
12361 2002-04-08 Akim Demaille <akim@epita.fr>
12362
12363 * src/system.h: No longer using strndup.
12364
12365 2002-04-07 Akim Demaille <akim@epita.fr>
12366
12367 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
12368 * src/output.c (output_table_data): Return the longest number.
12369 (prepare_tokens): Output `token_number_max').
12370 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
12371 New.
12372 Use them to define yy_token_number_type/TokenNumberType.
12373 Use this type for yytranslate.
12374 * tests/torture.at (Big triangle): Push the limit from 124 to
12375 253.
12376 * tests/regression.at (Web2c Actions): Adjust.
12377
12378 2002-04-07 Akim Demaille <akim@epita.fr>
12379
12380 * tests/torture.at (Big triangle): New.
12381 (GNU AWK Grammar, GNU Cim Grammar): Move to...
12382 * tests/existing.at: here.
12383
12384 2002-04-07 Akim Demaille <akim@epita.fr>
12385
12386 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
12387 nritems.
12388 Adjust dependencies.
12389
12390 2002-04-07 Akim Demaille <akim@epita.fr>
12391
12392 * src/reader.c: Normalize increments to prefix form.
12393
12394 2002-04-07 Akim Demaille <akim@epita.fr>
12395
12396 * src/reader.c, symtab.c: Remove debugging code.
12397
12398 2002-04-07 Akim Demaille <akim@epita.fr>
12399
12400 Rename all the `bucket's as `symbol_t'.
12401
12402 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
12403 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
12404 * src/symtab.c, src/symtab.h (bucket): Rename as...
12405 (symbol_t): this.
12406 (symbol_list_new, bucket_check_defined, bucket_make_alias)
12407 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
12408 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
12409 (buckets_new, buckets_free, buckets_do): Rename as...
12410 (symbol_list_new, symbol_check_defined, symbol_make_alias)
12411 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
12412 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
12413 (symbols_new, symbols_free, symbols_do): these.
12414
12415 2002-04-07 Akim Demaille <akim@epita.fr>
12416
12417 Use lib/hash for the symbol table.
12418
12419 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
12420 EOF.
12421 * src/lex.c (lex): Set the `number' member of new terminals.
12422 * src/reader.c (bucket_check_defined, bucket_make_alias)
12423 (bucket_check_alias_consistence, bucket_translation): New.
12424 (reader, grammar_free, readgram, token_translations_init)
12425 (packsymbols): Adjust.
12426 (reader): Number the predefined tokens.
12427 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
12428 for predefined tokens.
12429 * src/symtab.h (bucket): Remove all the hash table related
12430 members.
12431 * src/symtab.c (symtab): Replace by...
12432 (bucket_table): this.
12433 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
12434 (buckets_new, buckets_do): New.
12435
12436 2002-04-07 Akim Demaille <akim@epita.fr>
12437
12438 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
12439 (start_symbol, max_user_token_number, semantic_parser)
12440 (error_token_number): Initialize.
12441 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
12442 Initialize.
12443 (reader): Don't.
12444 (errtoken, eoftoken, undeftoken, axiom): Extern.
12445
12446 2002-04-07 Akim Demaille <akim@epita.fr>
12447
12448 * src/gram.h (rule_s): prec and precsym are now pointers
12449 to the bucket giving the priority/associativity.
12450 Member `associativity' removed: useless.
12451 * src/reduce.c, src/conflicts.c: Adjust.
12452
12453 2002-04-07 Akim Demaille <akim@epita.fr>
12454
12455 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
12456 Properly escape the symbols' TAG when outputting them.
12457
12458 2002-04-07 Akim Demaille <akim@epita.fr>
12459
12460 * src/lalr.h (LA): Is a bitsetv, not bitset*.
12461
12462 2002-04-07 Akim Demaille <akim@epita.fr>
12463
12464 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
12465 (LArule): this, which is an array to rule_t*.
12466 * src/print.c, src/conflicts.c: Adjust.
12467
12468 2002-04-07 Akim Demaille <akim@epita.fr>
12469
12470 * src/gram.h (rule_t): Rename `number' as `user_number'.
12471 `number' is a new member.
12472 Adjust dependencies.
12473 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
12474
12475 2002-04-07 Akim Demaille <akim@epita.fr>
12476
12477 As a result of the previous patch, it is no longer needed
12478 to reorder ritem itself.
12479
12480 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
12481
12482 2002-04-07 Akim Demaille <akim@epita.fr>
12483
12484 Be sure never to walk through RITEMS, but use only data related to
12485 the rules themselves. RITEMS should be banished.
12486
12487 * src/output.c (output_token_translations): Rename as...
12488 (prepare_tokens): this.
12489 In addition to `translate', prepare the muscles `tname' and
12490 `toknum', which were handled by...
12491 (output_rule_data): this.
12492 Remove, and move the remainder of its outputs into...
12493 (prepare_rules): this new routines, which also merges content from
12494 (output_gram): this.
12495 (prepare_rules): Be sure never to walk through RITEMS.
12496 (output_stos): Rename as...
12497 (prepare_stos): this.
12498 (output): Always invoke prepare_states, after all, just don't use it
12499 in the output if you don't need it.
12500
12501 2002-04-07 Akim Demaille <akim@epita.fr>
12502
12503 * src/LR0.c (new_state): Display `nstates' as the name of the
12504 newly created state.
12505 Adjust to initialize first_state and last_state if needed.
12506 Be sure to distinguish the initial from the final state.
12507 (new_states): Create the itemset of the initial state, and use
12508 new_state.
12509 * src/closure.c (closure): Now that the initial state has its
12510 items properly set, there is no need for a special case when
12511 creating `ruleset'.
12512
12513 As a result, now the rule 0, reducing to $axiom, is visible in the
12514 outputs. Adjust the test suite.
12515
12516 * tests/conflicts.at (Solved SR Conflicts)
12517 (Unresolved SR Conflicts): Adjust.
12518 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
12519 * tests/conflicts.at (S/R in initial): New.
12520
12521 2002-04-07 Akim Demaille <akim@epita.fr>
12522
12523 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
12524 the RHS of the rules.
12525 * src/output.c (output_gram): Likewise.
12526
12527 2002-04-07 Akim Demaille <akim@epita.fr>
12528
12529 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
12530 bucket.
12531 Adjust all dependencies.
12532 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
12533 `number' of the buckets too.
12534 * src/gram.h: Include `symtab.h'.
12535 (associativity): Move to...
12536 * src/symtab.h: here.
12537 No longer include `gram.h'.
12538
12539 2002-04-07 Akim Demaille <akim@epita.fr>
12540
12541 * src/gram.h, src/gram.c (rules_rhs_length): New.
12542 (ritem_longest_rhs): Use it.
12543 * src/gram.h (rule_t): `number' is a new member.
12544 * src/reader.c (packgram): Set it.
12545 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
12546 the end of `rules', and count them out of `nrules'.
12547 (reduce_output, dump_grammar): Adjust.
12548 * src/print.c (print_grammar): It is no longer needed to check for
12549 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
12550 * tests/reduce.at (Reduced Automaton): New test.
12551
12552 2002-04-07 Akim Demaille <akim@epita.fr>
12553
12554 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
12555 lacking `+ 1' to nrules, Bison reported as useless a token if it
12556 was used solely to set the precedence of the last rule...
12557
12558 2002-04-07 Akim Demaille <akim@epita.fr>
12559
12560 * data/bison.c++, data/bison.simple: Don't output the current file
12561 name in #line, to avoid useless diffs between two identical
12562 outputs under different names.
12563
12564 2002-04-07 Akim Demaille <akim@epita.fr>
12565
12566 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
12567 Normalize loops to using `< nrules + 1', not `<= nrules'.
12568
12569 2002-04-07 Akim Demaille <akim@epita.fr>
12570
12571 * TODO: Update.
12572
12573 2002-04-07 Akim Demaille <akim@epita.fr>
12574
12575 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
12576 bucket.value as bucket.number.
12577
12578 2002-04-07 Akim Demaille <akim@epita.fr>
12579
12580 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
12581 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
12582 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
12583 RHS, instead of being an index in RITEMS.
12584
12585 2002-04-04 Paul Eggert <eggert@twinsun.com>
12586
12587 * doc/bison.texinfo: Update copyright date.
12588 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
12589 (Symbols): Warn about running Bison in one character set,
12590 but compiling and/or running in an incompatible one.
12591 Warn about character code 256, too.
12592
12593 2002-04-03 Paul Eggert <eggert@twinsun.com>
12594
12595 * src/bison.data (YYSTACK_ALLOC): Depend on whether
12596 YYERROR_VERBOSE is nonzero, not whether it is defined.
12597
12598 Merge changes from bison-1_29-branch.
12599
12600 2002-03-20 Paul Eggert <eggert@twinsun.com>
12601
12602 Merge fixes from Debian bison_1.34-1.diff.
12603
12604 * configure.in (AC_PREREQ): 2.53.
12605
12606 2002-03-20 Akim Demaille <akim@epita.fr>
12607
12608 * src/conflicts.c (log_resolution): Argument `resolution' is const.
12609
12610 2002-03-19 Paul Eggert <eggert@twinsun.com>
12611
12612 * src/bison.simple (YYCOPY): New macro.
12613 (YYSTACK_RELOCATE): Use it.
12614 Remove Type arg; no longer needed. All callers changed.
12615 (yymemcpy): Remove; no longer needed.
12616
12617 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
12618 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
12619
12620 2002-03-19 Akim Demaille <akim@epita.fr>
12621
12622 Test and fix the #line outputs.
12623
12624 * tests/atlocal.at (GCC): New.
12625 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
12626 (Prologue synch line, %union synch line, Postprologue synch line)
12627 (Action synch line, Epilogue synch line): New tests.
12628 * src/reader.c (parse_union_decl): Define the muscle stype_line.
12629 * data/bison.simple, data/bison.c++: Use it.
12630
12631 2002-03-19 Akim Demaille <akim@epita.fr>
12632
12633 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
12634 (Solved SR Conflicts, %expect not enough, %expect right)
12635 (%expect too much): Move to...
12636 * tests/conflicts.at: this new file.
12637
12638 2002-03-19 Akim Demaille <akim@epita.fr>
12639
12640 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12641 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
12642 that we can move to enums for instance.
12643 * src/output.c (token_definitions_output): Output a list of
12644 `token-name, token-number' instead of the #define.
12645 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
12646
12647 2002-03-14 Akim Demaille <akim@epita.fr>
12648
12649 Use Gettext 0.11.1.
12650
12651 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
12652
12653 * data/bison.c++: Make the user able to add members to the generated
12654 parser by subclassing.
12655
12656 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
12657
12658 * src/reader.c (read_additionnal_code): `c' should be an integer, not
12659 a character.
12660 Reported by Nicolas Tisserand and Nicolas Burrus.
12661
12662 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12663
12664 * src/reader.c: Warn about lacking semi-colons, do not complain.
12665
12666 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12667
12668 * data/bison.c++: Remove a debug line.
12669
12670 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12671
12672 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
12673 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
12674 provide a default implementation.
12675
12676 2002-03-04 Akim Demaille <akim@epita.fr>
12677
12678 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
12679 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
12680 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
12681 * tests/semantic.at (Parsing Guards): Similarly.
12682 * src/reader.at (readgram): Complain if the last rule is not ended
12683 with a semi-colon.
12684
12685 2002-03-04 Akim Demaille <akim@epita.fr>
12686
12687 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
12688 * src/closure.c: here.
12689 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
12690 RTC.
12691 * src/warshall.h, src/warshall.c: Remove.
12692 * tests/sets.at (Broken Closure): Adjust.
12693
12694 2002-03-04 Akim Demaille <akim@epita.fr>
12695
12696 * src/output.c (output_skeleton): tempdir is const.
12697 bytes_read is unused.
12698
12699 2002-03-04 Akim Demaille <akim@epita.fr>
12700
12701 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12702 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
12703 Update.
12704 From Michael Hayes.
12705
12706 2002-03-04 Akim Demaille <akim@epita.fr>
12707
12708 * src/closure.c (closure): `r' is unused.
12709
12710 2002-03-04 Akim Demaille <akim@epita.fr>
12711
12712 * tests/sets.at (Broken Closure): Add the ending `;'.
12713 * src/reader.at (readgram): Complain if a rule is not ended with a
12714 semi-colon.
12715
12716 2002-03-04 Akim Demaille <akim@epita.fr>
12717
12718 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
12719 (count_sr_conflicts): Use bitset_count.
12720 * src/reduce.c (inaccessable_symbols): Ditto.
12721 (bits_size): Remove.
12722 * src/warshall.h, src/warshall.c: Convert to bitsetv.
12723
12724 2002-03-04 Akim Demaille <akim@epita.fr>
12725
12726 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
12727 * src/reduce.c: Remove the `bitset_zero's following the
12728 `bitset_create's, as now it is performed by the latter.
12729
12730 2002-03-04 Akim Demaille <akim@epita.fr>
12731
12732 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
12733 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
12734 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
12735 latest sources from Michael.
12736
12737 2002-03-04 Akim Demaille <akim@epita.fr>
12738
12739 * src/output.c (output): Don't free the grammar.
12740 * src/reader.c (grammar_free): New.
12741 * src/main.c (main): Call it and don't free symtab here.
12742
12743 2002-03-04 Akim Demaille <akim@epita.fr>
12744
12745 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
12746 before returning.
12747 Reported by Benoit Perrot.
12748
12749 2002-03-04 Akim Demaille <akim@epita.fr>
12750
12751 Use bitset operations when possible, not loops over bits.
12752
12753 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
12754 bitset_or.
12755 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
12756 * src/reduce.c (useless_nonterminals): Formatting changes.
12757 * src/warshall.c (TC): Use bitset_or.
12758
12759 2002-03-04 Akim Demaille <akim@epita.fr>
12760
12761 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
12762 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
12763 Ditto.
12764
12765 2002-03-04 Akim Demaille <akim@epita.fr>
12766
12767 * src/lalr.c (F): Now a bitset*.
12768 Adjust all dependencies.
12769
12770 2002-03-04 Akim Demaille <akim@epita.fr>
12771
12772 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
12773 Adjust all dependencies.
12774
12775 2002-03-04 Akim Demaille <akim@epita.fr>
12776
12777 * src/L0.c, src/LR0.h (nstates): Be size_t.
12778 Adjust comparisons (signed vs unsigned).
12779 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
12780 bitset*.
12781 Adjust all dependencies.
12782
12783 2002-03-04 Akim Demaille <akim@epita.fr>
12784
12785 * src/closure.c (firsts): Now, also a bitset.
12786 Adjust all dependencies.
12787 (varsetsize): Remove, now unused.
12788 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
12789
12790 2002-03-04 Akim Demaille <akim@epita.fr>
12791
12792 * src/print.c: Convert to use bitset.h, not hand coded iterations
12793 over ints.
12794
12795 2002-03-04 Akim Demaille <akim@epita.fr>
12796
12797 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
12798
12799 2002-03-04 Akim Demaille <akim@epita.fr>
12800
12801 * src/closure.c (ruleset): Be a bitset.
12802 (rulesetsize): Remove.
12803
12804 2002-03-04 Akim Demaille <akim@epita.fr>
12805
12806 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12807 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
12808 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
12809 * src/closure.c (fderives): Be an array of bitsets.
12810
12811 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
12812
12813 * data/bison.c++: Merge the two generated headers. Insert a copyright
12814 notice in each output file.
12815
12816 2002-02-28 Akim Demaille <akim@epita.fr>
12817
12818 * data/bison.c++: Copy the prologue of bison.simple to fetch
12819 useful M4 definitions, such as b4_header_guard.
12820
12821 2002-02-25 Akim Demaille <akim@epita.fr>
12822
12823 * src/getargs.c (version): Give the name of the authors, and use a
12824 translator friendly scheme for the bgr
12825 copyright notice.
12826
12827 2002-02-25 Akim Demaille <akim@epita.fr>
12828
12829 * src/output.c (header_output): Remove, now handled completely via
12830 M4.
12831
12832 2002-02-25 Akim Demaille <akim@epita.fr>
12833
12834 * m4/m4.m4: New, from CVS Autoconf.
12835 * configure.in: Invoke it.
12836 * src/output.c (output_skeleton): Use its result instead of the
12837 hard coded name.
12838
12839 2002-02-25 Akim Demaille <akim@epita.fr>
12840
12841 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
12842 Fileutils 4.1.5.
12843 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
12844 * src/output.c (output_skeleton): Use mkstemp to create a real
12845 temporary file.
12846 Move the filling of `skeleton' and its muscle to...
12847 (prepare): here.
12848 (output): Move the definition of the prologue muscle to...
12849 (prepare): here.
12850 * src/system.h (DEFAULT_TMPDIR): New.
12851
12852 2002-02-14 Paul Eggert <eggert@twinsun.com>
12853
12854 Remove the support for C++ namespace cleanliness; it was
12855 causing more problems than it was curing, since it didn't work
12856 properly on some nonstandard C++ compilers. This can wait
12857 for a proper C++ parser.
12858
12859 * NEWS: Document this.
12860 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
12861 of C++, as it's treated like C now.
12862 * src/bison.simple (YYSTD): Remove.
12863 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
12864 Treat C++ just like Standard C instead of trying to support
12865 namespace cleanliness.
12866
12867 2002-02-14 Akim Demaille <akim@epita.fr>
12868
12869 * tests/regression.at (else): Adjust to Andreas' change.
12870
12871 2002-02-14 Akim Demaille <akim@epita.fr>
12872
12873 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
12874
12875 2002-02-13 Andreas Schwab <schwab@suse.de>
12876
12877 * src/output.c (output_rule_data): Don't output NULL, it might
12878 not be defined yet.
12879
12880 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
12881
12882 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
12883 (Copyright notice): Update.
12884
12885 2002-02-11 Akim Demaille <akim@epita.fr>
12886
12887 * tests/regression.at (%nonassoc and eof): Don't include
12888 nonportable headers.
12889
12890 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
12891
12892 * data/bison.c++: Correct error recovery. Make the user able to
12893 initialize the starting location.
12894
12895 2002-02-07 Akim Demaille <akim@epita.fr>
12896
12897 * tests/input.at: New.
12898
12899 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12900
12901 * data/bison.c++: Replace some direct m4 expansions by constants. Be
12902 more consistent when naming methods and variables. Put preprocessor
12903 directives around tables only needed for debugging.
12904
12905 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12906
12907 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
12908 C++ parsers.
12909 (yy::b4_name::parse): Use print_.
12910
12911 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12912
12913 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
12914
12915 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
12916
12917 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
12918 C++ parsers.
12919 (yy::b4_name::parse): Build verbose error messages, and use error_.
12920
12921 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
12922
12923 * data/bison.c++: Fix m4 quoting in comments.
12924
12925 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
12926
12927 * data/bison.c++: Adjust the parser code. Fix some muscles that were
12928 not expanded by m4.
12929
12930 2002-02-05 Akim Demaille <akim@epita.fr>
12931
12932 * data/bison.c++: Adjust to the M4 back end.
12933 More is certainly needed.
12934
12935 2002-02-05 Akim Demaille <akim@epita.fr>
12936
12937 Give a try to M4 as a back end.
12938
12939 * lib/readpipe.c: New, from wdiff.
12940 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
12941 BISON_HAIRY.
12942 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
12943 specific values. Now it is m4 that performs the lookup.
12944 * src/parse-skel.y: Remove.
12945 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
12946 * src/output.c (actions_output, guards_output)
12947 (token_definitions_output): No longer keeps track of the output
12948 line number, hence remove the second argument.
12949 (guards_output): Check against the guard member of a rule, not the
12950 action member.
12951 Adjust callers.
12952 (output_skeleton): Don't look for the skeleton location, let m4 do
12953 that.
12954 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
12955 file will be used.
12956 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
12957 (prepare): Given that for the time being changesyntax is not
12958 usable in M4, rename the muscles using `-' to `_'.
12959 Define `defines_flag', `output_parser_name' and `output_header_name'.
12960 * src/output.h (actions_output, guards_output)
12961 (token_definitions_output): Adjust prototypes.
12962 * src/scan-skel.l: Instead of scanning the skeletons, it now
12963 processes the output of m4: `__oline__' and `#output'.
12964 * data/bison.simple: Adjust to be used by M4(sugar).
12965 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
12966 to date.
12967 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
12968 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
12969 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
12970 shamelessly stolen from CVS Autoconf.
12971
12972 2002-02-05 Akim Demaille <akim@epita.fr>
12973
12974 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
12975 * configure.in: Check for the declarations of free and malloc.
12976 * src/muscle_tab.c: Adjust.
12977
12978 2002-02-05 Akim Demaille <akim@epita.fr>
12979
12980 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
12981 which have no values.
12982
12983 2002-02-05 Akim Demaille <akim@epita.fr>
12984
12985 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
12986 * data/: here.
12987
12988 2002-01-29 Paul Eggert <eggert@twinsun.com>
12989
12990 * src/bison.simple (YYSIZE_T): Do not define merely because
12991 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
12992 On some platforms, <alloca.h> does not declare YYSTD (size_t).
12993
12994 2002-01-27 Akim Demaille <akim@epita.fr>
12995
12996 Fix `%nonassoc and eof'.
12997
12998 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
12999 which were not properly copied! Replace
13000 memcpy (res->errs, src->errs, src->nerrs);
13001 with
13002 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
13003 !!!
13004 * tests/regression.at (%nonassoc and eof): Adjust to newest
13005 Autotest: `.' is not in the PATH.
13006
13007 2002-01-27 Akim Demaille <akim@epita.fr>
13008
13009 * tests/sets.at (AT_EXTRACT_SETS): New.
13010 (Nullable): Use it.
13011 (Firsts): New.
13012
13013 2002-01-26 Akim Demaille <akim@epita.fr>
13014
13015 * tests/actions.at, tests/calc.at, tests/headers.at,
13016 * tests/torture.at: Adjust to the newest Autotest which no longer
13017 forces `.' in the PATH.
13018
13019 2002-01-25 Akim Demaille <akim@epita.fr>
13020
13021 * tests/regression.at (%nonassoc and eof): New.
13022 Suggested by Robert Anisko.
13023
13024 2002-01-24 Akim Demaille <akim@epita.fr>
13025
13026 Bison dumps core when trying to complain about broken input files.
13027 Reported by Cris van Pelt.
13028
13029 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
13030 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
13031 into...
13032 (Invalid inputs): Strengthen: exercise parse_percent_token.
13033
13034 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
13035
13036 * src/Makefile.am: Add bison.c++.
13037 * src/bison.c++: New skeleton.
13038
13039 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
13040
13041 * po/it.po: New.
13042
13043 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
13044
13045 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
13046
13047 2002-01-20 Marc Autret <marc@gnu.org>
13048
13049 * src/files.c (compute_output_file_names): Fix
13050
13051 2002-01-20 Marc Autret <marc@gnu.org>
13052
13053 * tests/output.at: New test.
13054 * src/files.c (compute_base_names): Don't map extensions when
13055 the YACC flag is set, use defaults.
13056 Reported by Evgeny Stambulchik.
13057
13058 2002-01-20 Marc Autret <marc@gnu.org>
13059
13060 * src/system.h: Need to define __attribute__ away for non-GCC
13061 compilers as well (i.e., the vendor C compiler).
13062 Suggested by Albert Chin-A-Young.
13063
13064 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
13065
13066 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
13067 canonical definition.
13068 * src/system.h: Use the canonical definition for PARAMS (avoids
13069 a conflict with the macro from lib/hash.h).
13070
13071 2002-01-11 Akim Demaille <akim@epita.fr>
13072
13073 * configure.in: Use AC_FUNC_STRNLEN.
13074 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
13075
13076 2002-01-09 Akim Demaille <akim@epita.fr>
13077
13078 * src/files.c, src/files.h (output_infix): New.
13079 (tab_extension): Remove.
13080 (compute_base_names): Compute the former, drop the latter.
13081 * src/output.c (prepare): Insert the muscles `output-infix', and
13082 `output-suffix'.
13083 * src/parse-skel.y (string, string.1): New.
13084 (section.header): Use it.
13085 (section.yacc): Remove.
13086 (prefix): Remove too.
13087 * src/scan-skel.l: Adjust.
13088 * src/bison.simple, src/bison.hairy: Adjust.
13089
13090 2002-01-09 Akim Demaille <akim@epita.fr>
13091
13092 * configure.in (WERROR_CFLAGS): Compute it.
13093 * src/Makefile.am (CFLAGS): Pass it.
13094 * tests/atlocal.in (CFLAGS): Idem.
13095 * src/files.c: Fix a few warnings.
13096 (get_extension_index): Remove, unused.
13097
13098 2002-01-08 Akim Demaille <akim@epita.fr>
13099
13100 * src/getargs.c (AS_FILE_NAME): New.
13101 (getargs): Use it to convert DOSish file names.
13102 * src/files.c (base_name): Rename as full_base_name to avoid
13103 clashes with `base_name ()'.
13104 (filename_split): New.
13105 (compute_base_names): N-th rewrite, using filename_split.
13106
13107 2002-01-08 Akim Demaille <akim@epita.fr>
13108
13109 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
13110 New, stolen from the Fileutils 4.1.
13111 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
13112 * configure.in: Check for the presence of memrchr, and of its
13113 prototype.
13114
13115 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
13116
13117 * lib/hash.h (__P): Added definition for this macro.
13118 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
13119 BUILT_SOURCES, to ensure they are generated first.
13120 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
13121 %error-verbose to allow bootstrapping with bison 1.30x.
13122
13123 2002-01-06 Akim Demaille <akim@epita.fr>
13124
13125 * src/reader.c (parse_braces): Don't fetch the next char, the
13126 convention is to fetch on entry.
13127 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
13128 'switch' without a following semicolon.
13129 * tests/regression.at (braces parsing): New.
13130
13131 2002-01-06 Akim Demaille <akim@epita.fr>
13132
13133 Bison is dead wrong in its RR conflict reports.
13134
13135 * tests/torture.at (GNU Cim Grammar): New.
13136 * src/conflicts.c (count_rr_conflicts): Fix.
13137
13138 2002-01-06 Akim Demaille <akim@epita.fr>
13139
13140 Creating package.m4 from configure.ac causes too many problems.
13141
13142 * tests/Makefile.am (package.m4): Create it by hand,
13143 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
13144
13145 2002-01-06 Akim Demaille <akim@epita.fr>
13146
13147 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
13148 skeleton.h.
13149
13150 2002-01-04 Paul Eggert <eggert@twinsun.com>
13151
13152 * doc/bison.texinfo (Debugging):
13153 Remove YYSTDERR; it's no longer defined or used.
13154 Also, s/cstdio.h/cstdio/.
13155
13156 2002-01-03 Akim Demaille <akim@epita.fr>
13157
13158 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
13159
13160 2002-01-03 Akim Demaille <akim@epita.fr>
13161
13162 * src/parse-skel.y (process_skeleton): Don't bind the parser's
13163 tracing code to --trace, wait for a better --trace option, with
13164 args.
13165
13166 2002-01-03 Akim Demaille <akim@epita.fr>
13167
13168 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
13169 The ISO C++ standard is extremely clear about it: stderr is
13170 considered a macro, not a regular symbol (see table 94 `Header
13171 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
13172 Therefore std:: does not apply to it. It still does with fprintf.
13173 Also, s/cstdio.h/cstdio/.
13174
13175 2002-01-03 Akim Demaille <akim@epita.fr>
13176
13177 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
13178 for non system headers.
13179
13180 2002-01-02 Akim Demaille <akim@epita.fr>
13181
13182 Equip the skeleton chain with location tracking, runtime trace,
13183 pure parser and scanner.
13184
13185 * src/parse-skel.y: Request a pure parser, locations, and prefix
13186 renaming.
13187 (%union): Having several members with the same type does not help
13188 type mismatches, simplify.
13189 (YYPRINT, yyprint): New.
13190 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
13191 (skel_error): this.
13192 Handle locations.
13193 * src/scan-skel.l: Adjust to these changes.
13194 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
13195 (LOCATION_PRINT, skel_control_t): New.
13196
13197 2001-12-30 Akim Demaille <akim@epita.fr>
13198
13199 * src/parse-skel.y: Get rid of the shift/reduce conflict:
13200 replace `gb' with BLANKS.
13201 * src/scan-skel.l: Adjust.
13202
13203 2001-12-30 Akim Demaille <akim@epita.fr>
13204
13205 * src/system.h: We don't need nor want bcopy.
13206 Throw away MS-DOS crap: we don't need getpid.
13207 * configure.in: We don't need strndup. It was even causing
13208 problems: because Flex includes the headers *before* us,
13209 _GNU_SOURCE is not defined by config.h, and therefore strndup was
13210 not visible.
13211 * lib/xstrndup.c: New.
13212 * src/scan-skel.l: Use it.
13213 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
13214 * src/parse-skel.y: Use %directives instead of #defines.
13215
13216 2001-12-30 Akim Demaille <akim@epita.fr>
13217
13218 * src/skeleton.h: New.
13219 * src/output.c (output_parser, output_master_parser): Remove, dead
13220 code.
13221 * src/output.h (get_lines_number, actions_output, guards_output)
13222 (token_definitions_output): Prototype them.
13223 * src/parse-skel.y: Add the license notice.
13224 Include output.h and skeleton.h.
13225 (process_skeleton): Returns void, and takes a single parameter.
13226 * src/scan-skel.l: Add the license notice.
13227 Include skeleton.h.
13228 Don't use %option yylineno: it seems that then Flex imagines
13229 REJECT has been used, and therefore it won't reallocate its
13230 buffers (which makes no other sense to me than a bug). It results
13231 in warnings for `unused: yy_flex_realloc'.
13232
13233 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
13234
13235 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
13236 (MUSCLE_INSERT_PREFIX): ...to there.
13237 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
13238 (MUSCLE_INSERT_PREFIX): Move from here...
13239
13240 * src/bison.hairy: Add a section directive. Put braces around muscle
13241 names. This parser skeleton is still broken, but Bison should not
13242 choke on a bad muscle 'syntax'.
13243 * src/bison.simple: Add a section directive. Put braces around muscle
13244 names.
13245
13246 * src/files.h (strsuffix, stringappend): Add declarations.
13247 (tab_extension): Add declaration.
13248 (short_base_name): Add declaration.
13249
13250 * src/files.c (strsuffix, stringappend): No longer static. These
13251 functions are used in the skeleton parser.
13252 (tab_extension): New.
13253 (compute_base_names): Use the computations done in this function
13254 to guess if the generated parsers should have '.tab' in their
13255 names.
13256 (short_base_name): No longer static.
13257
13258 * src/output.c (output_skeleton): New.
13259 (output): Disable call to output_master_parser, and give a try to
13260 a new skeleton handling system.
13261 (guards_output, actions_output): No longer static.
13262 (token_definitions_output, get_lines_number): No longer static.
13263
13264 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
13265
13266 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
13267 parse-skel.y.
13268
13269 * src/parse-skel.y: New file.
13270 * src/scan-skel.l: New file.
13271
13272 2001-12-29 Akim Demaille <akim@epita.fr>
13273
13274 %name-prefix is broken.
13275
13276 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
13277 Adjust all dependencies.
13278 * tests/headers.at (export YYLTYPE): Strengthen this test: use
13279 %name-prefix.
13280
13281 Renaming yylval but not yylloc is not consistent. Now we do.
13282
13283 * src/bison.simple: Prefix yylloc if used.
13284 * doc/bison.texinfo (Decl Summary): Document that.
13285
13286 2001-12-29 Akim Demaille <akim@epita.fr>
13287
13288 * doc/bison.texinfo: Promote `%long-directive' over
13289 `%long_directive'.
13290 Remove all references to fixed-output-files, yacc is enough.
13291
13292 2001-12-29 Akim Demaille <akim@epita.fr>
13293
13294 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
13295 user prologue. These are defaults.
13296 * tests/actions.at (Mid-rule actions): Make sure the user can
13297 define YYDEBUG and YYERROR_VERBOSE.
13298
13299 2001-12-29 Akim Demaille <akim@epita.fr>
13300
13301 * src/output.c (header_output): Don't forget to export YYLTYPE and
13302 yylloc.
13303 * tests/headers.at (export YYLTYPE): New, make sure it does.
13304 * tests/regression.at (%union and --defines, Invalid CPP headers):
13305 Move to...
13306 * tests/headers.at: here.
13307
13308 2001-12-29 Akim Demaille <akim@epita.fr>
13309
13310 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
13311
13312 2001-12-29 Akim Demaille <akim@epita.fr>
13313
13314 * tests/actions.at (Mid-rule actions): Output on a single line
13315 instead of several.
13316
13317 2001-12-29 Akim Demaille <akim@epita.fr>
13318
13319 * doc/bison.texinfo: Formatting changes.
13320
13321 2001-12-29 Akim Demaille <akim@epita.fr>
13322
13323 Don't store the token defs in a muscle, just be ready to output it
13324 on command. Now possible via `symbols'. Fixes a memory leak.
13325
13326 * src/output.c (token_definitions_output): New.
13327 (output_parser, header_output): Use it.
13328 * src/reader.c (symbols_save): Remove.
13329
13330 2001-12-29 Akim Demaille <akim@epita.fr>
13331
13332 * src/bison.simple: Do not provide a default for YYSTYPE and
13333 YYLTYPE before the user's prologue. Otherwise it's hardly... a
13334 default.
13335
13336 2001-12-29 Akim Demaille <akim@epita.fr>
13337
13338 Mid-rule actions are simply... ignored!
13339
13340 * src/reader.c (readgram): Be sure to attach mid-rule actions to
13341 the empty-rule associated to the dummy symbol, not to the host
13342 rule.
13343 * tests/actions.at (Mid-rule actions): New.
13344
13345 2001-12-29 Akim Demaille <akim@epita.fr>
13346
13347 Memory leak.
13348
13349 * src/reader.c (reader): Free grammar.
13350
13351 2001-12-29 Akim Demaille <akim@epita.fr>
13352
13353 Memory leak.
13354
13355 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
13356 since it allocates it for each state, although only one is needed.
13357 (allocate_storage): Do it here.
13358
13359 2001-12-29 Akim Demaille <akim@epita.fr>
13360
13361 * src/options.h, src/options.c (create_long_option_table): Rename
13362 as...
13363 (long_option_table_new): this, with a clearer prototype.
13364 (percent_table): Remove, unused,
13365 * src/getargs.c (getargs): Adjust.
13366
13367 2001-12-29 Akim Demaille <akim@epita.fr>
13368
13369 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
13370 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
13371 as states.
13372
13373 2001-12-29 Akim Demaille <akim@epita.fr>
13374
13375 * src/lalr.c (build_relations): Rename `states' as `states1'.
13376 Sorry, I don't understand exactly what it is, no better name...
13377
13378 2001-12-29 Akim Demaille <akim@epita.fr>
13379
13380 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
13381 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
13382 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
13383 as rules.
13384
13385 2001-12-29 Akim Demaille <akim@epita.fr>
13386
13387 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
13388 ago.
13389
13390 2001-12-29 Akim Demaille <akim@epita.fr>
13391
13392 * src/reader.c, src/reader.h (user_toknums): Remove.
13393 Adjust all users to use symbols[i]->user_token_number.
13394
13395 2001-12-29 Akim Demaille <akim@epita.fr>
13396
13397 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
13398 Adjust all users to use symbols[i]->prec or ->assoc.
13399
13400 2001-12-29 Akim Demaille <akim@epita.fr>
13401
13402 * src/reader.c, src/reader.h (tags): Remove.
13403 Adjust all users to use symbols[i]->tag.
13404
13405 2001-12-29 Akim Demaille <akim@epita.fr>
13406
13407 * src/gram.h, src/gram.c (symbols): New, similar to state_table
13408 and rule_table.
13409 * src/reader.c (packsymbols): Fill this table.
13410 Drop sprec.
13411 * src/conflicts.c (resolve_sr_conflict): Adjust.
13412 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
13413 single table.
13414 Use symbols[i]->tag instead of tags[i].
13415
13416 2001-12-29 Akim Demaille <akim@epita.fr>
13417
13418 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
13419 In addition, put a comment in there, to replace...
13420 * tests/regression.at (%union and C comments): Remove.
13421
13422 2001-12-29 Akim Demaille <akim@epita.fr>
13423
13424 * tests/regression.at (Web2c Actions): Blindly move the actual
13425 output as expected output. The contents *seem* right to me, but I
13426 can't pretend reading perfectly parser tables... Nonetheless, all
13427 the other tests pass correctly, the table look OK, even though the
13428 presence of `$axiom' is to be noted: AFAICS it is useless (but
13429 harmless).
13430
13431 2001-12-29 Akim Demaille <akim@epita.fr>
13432
13433 * src/reader.c (readgram): Don't add the rule 0 if there were no
13434 rules read. In other words, add it _after_ having performed
13435 grammar sanity checks.
13436 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
13437
13438 2001-12-29 Akim Demaille <akim@epita.fr>
13439
13440 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
13441 visible, and some states have now a different number.
13442
13443 2001-12-29 Akim Demaille <akim@epita.fr>
13444
13445 * src/reader.c (readgram): Bind the initial rule's lineno to that
13446 of the first rule.
13447 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
13448 (Solved SR Conflicts): Adjust rule 0's line number.
13449
13450 2001-12-29 Akim Demaille <akim@epita.fr>
13451
13452 Fix the `GAWK Grammar' failure.
13453
13454 * src/LR0.c (final_state): Initialize to -1 so that we do compute
13455 the reductions of the first state which was mistakenly confused
13456 with the final state because precisely final_state was initialized
13457 to 0.
13458 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
13459 now noticed by Bison.
13460 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
13461 have a reduction on $default.
13462
13463 2001-12-29 Akim Demaille <akim@epita.fr>
13464
13465 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
13466 rule line numbers.
13467 * src/closure.c (print_closure): Likewise.
13468 * src/derives.c (print_derives): Likewise.
13469 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
13470 now.
13471
13472 2001-12-29 Akim Demaille <akim@epita.fr>
13473
13474 * src/lalr.c (lookaheads_print): New.
13475 (lalr): Call it when --trace-flag.
13476 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
13477 are dumped.
13478
13479 2001-12-29 Akim Demaille <akim@epita.fr>
13480
13481 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
13482 when walking through ritem, even via rule->rhs.
13483 * src/reduce.c (dump_grammar, useful_production, reduce_output)
13484 (useful_production, useless_nonterminals): Likewise.
13485 (reduce_grammar_tables): Likewise, plus update nritems.
13486 * src/nullable.c (set_nullable): Likewise.
13487 * src/lalr.c (build_relations): Likewise.
13488 * tests/sets.at (Nullable): Adjust.
13489 Fortunately, now, the $axiom is no longer nullable.
13490
13491 2001-12-29 Akim Demaille <akim@epita.fr>
13492
13493 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
13494 the 0-sentinel.
13495 * src/gram.c (ritem_longest_rhs): Likewise.
13496 * src/reduce.c (nonterminals_reduce): Likewise.
13497 * src/print_graph.c (print_graph): Likewise.
13498 * src/output.c (output_rule_data): Likewise.
13499 * src/nullable.c (set_nullable): Likewise.
13500
13501 2001-12-29 Akim Demaille <akim@epita.fr>
13502
13503 * src/output.c: Comment changes.
13504
13505 2001-12-27 Paul Eggert <eggert@twinsun.com>
13506
13507 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
13508 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
13509 Sparc, as they were causing more porting problems than the
13510 (minor) performance improvement was worth.
13511
13512 Also, catch up with 1.31's YYSTD.
13513
13514 2001-12-27 Akim Demaille <akim@epita.fr>
13515
13516 * src/output.c (output_gram): Rely on nritems, not the
13517 0-sentinel. See below.
13518 Use -1 as separator, not 0.
13519 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
13520 Rely on -1 as separator in yyrhs, instead of 0.
13521 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
13522 twice `Now at end of input', therefore there are two lines less to
13523 expect.
13524
13525 2001-12-27 Akim Demaille <akim@epita.fr>
13526
13527 * tests/regression.at (Unresolved SR Conflicts):
13528 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
13529 below.
13530
13531 2001-12-27 Akim Demaille <akim@epita.fr>
13532
13533 * src/LR0.c (new_state): Recognize the final state by the fact it
13534 is reached by eoftoken.
13535 (insert_start_shifting_state, insert_eof_shifting_state)
13536 (insert_accepting_state, augment_automaton): Remove, since now
13537 these states are automatically computed from the initial state.
13538 (generate_states): Adjust.
13539 * src/print.c: When reporting a rule number to the user, substract
13540 1, so that the axiom rule is rule 0, and the first user rule is 1.
13541 * src/reduce.c: Likewise.
13542 * src/print_graph.c (print_core): For the time being, just as for
13543 the report, depend upon --trace-flags to dump the full set of
13544 items.
13545 * src/reader.c (readgram): Once the grammar read, insert the rule
13546 0: `$axiom: START-SYMBOL $'.
13547 * tests/set.at: Adjust: rule 0 is now displayed, and since the
13548 number of the states has changed (the final state is no longer
13549 necessarily the last), catch up.
13550
13551 2001-12-27 Akim Demaille <akim@epita.fr>
13552
13553 Try to make the use of the eoftoken valid. Given that its value
13554 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
13555 is used instead of > 0 where appropriate, (ii), depend upon nritems
13556 instead of the 0-sentinel.
13557
13558 * src/gram.h, src/gram.c (nritems): New.
13559 Expected to be duplication of nitems, but for the time being...
13560 * src/reader.c (packgram): Assert nritems and nitems are equal.
13561 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
13562 * src/closure.c (print_closure, print_fderives): Likewise.
13563 * src/gram.c (ritem_print): Likewise.
13564 * src/print.c (print_core, print_grammar): Likewise.
13565 * src/print_graph.c: Likewise.
13566
13567 2001-12-27 Akim Demaille <akim@epita.fr>
13568
13569 * src/main.c (main): If there are complains after grammar
13570 reductions, then output the report anyway if requested, then die.
13571 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
13572 * src/reader.c (eoftoken): New.
13573 (parse_token_decl): If the token being defined has value `0', it
13574 is the eoftoken.
13575 (packsymbols): No longer hack `tags' to insert `$' by hand.
13576 Be sure to preserve the value of the eoftoken.
13577 (reader): Make sure eoftoken is defined.
13578 Initialize nsyms to 0: now eoftoken is created just like the others.
13579 * src/print.c (print_grammar): Don't special case the eof token.
13580 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
13581 lie anyway, albeit pleasant.
13582 * tests/calc.at: Exercise error messages with eoftoken.
13583 Change the grammar so that empty input is invalid.
13584 Adjust expectations.
13585 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
13586
13587 2001-12-27 Akim Demaille <akim@epita.fr>
13588
13589 * configure.in: Check the protos of strchr ans strspn.
13590 Replace strchr if needed.
13591 * src/system.h: Provide the protos of strchr, strspn and memchr if
13592 missing.
13593 * lib/strchr.c: New.
13594 * src/reader.c (symbols_save): Use strchr.
13595
13596 2001-12-27 Akim Demaille <akim@epita.fr>
13597
13598 * src/print.c, src/print_graph.c (escape): New.
13599 Use it to quote the TAGS outputs.
13600 * src/print_graph.c (print_state): Now errors are in red, and
13601 reductions in green.
13602 Prefer high to wide: output the state number on a line of its own.
13603
13604 2001-12-27 Akim Demaille <akim@epita.fr>
13605
13606 * src/state.h, src/state.c (reductions_new): New.
13607 * src/LR0.c (set_state_table): Let all the states have a
13608 `reductions', even if reduced to 0.
13609 (save_reductions): Adjust.
13610 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
13611 * src/print.c (print_reductions, print_actions): Adjust.
13612 * src/output.c (action_row): Adjust.
13613
13614 2001-12-27 Akim Demaille <akim@epita.fr>
13615
13616 * src/state.h, src/state.c (errs_new, errs_dup): New.
13617 * src/LR0.c (set_state_table): Let all the states have an errs,
13618 even if reduced to 0.
13619 * src/print.c (print_errs, print_reductions): Adjust.
13620 * src/output.c (output_actions, action_row): Adjust.
13621 * src/conflicts.c (resolve_sr_conflict): Adjust.
13622
13623 2001-12-27 Akim Demaille <akim@epita.fr>
13624
13625 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
13626
13627 2001-12-27 Akim Demaille <akim@epita.fr>
13628
13629 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
13630 * src/print.c: here.
13631 (lookaheadset, shiftset): New, used as additional storage by
13632 print_reductions.
13633 (print_results): Adjust.
13634 (print_shifts, print_gotos, print_errs): New, extracted from...
13635 (print_actions): here.
13636 * src/print_graph.c (print_actions): Remove dead code.
13637
13638 2001-12-27 Akim Demaille <akim@epita.fr>
13639
13640 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
13641 `$n' and `@n'.
13642
13643 2001-12-27 Akim Demaille <akim@epita.fr>
13644
13645 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
13646 (build_relations): Adjust.
13647
13648 2001-12-27 Akim Demaille <akim@epita.fr>
13649
13650 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
13651 duplication.
13652
13653 2001-12-27 Akim Demaille <akim@epita.fr>
13654
13655 * src/reader.c (packgram): Catch nitems overflows.
13656
13657 2001-12-27 Akim Demaille <akim@epita.fr>
13658
13659 * src/files.c, src/files.h (guard_obstack): Remove.
13660 * src/output.c (output): Adjust.
13661 * src/reader.c (parse_braces): New, factoring...
13662 (copy_action, copy_guard): these two which are renamed as...
13663 (parse_action, parse_guard): these.
13664 As a voluntary consequence, using braces around guards is now
13665 mandatory.
13666
13667 2001-12-27 Akim Demaille <akim@epita.fr>
13668
13669 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
13670 * src/reader.c (symbol_list): `guard' and `guard_line' are new
13671 members.
13672 (symbol_list_new): Adjust.
13673 (copy_action): action_line is the first line, not the last.
13674 (copy_guard): Just as for actions, store the `action' only, not
13675 the switch/case/break flesh.
13676 Don't parse the user action that might follow the guard, let...
13677 (readgram): do it, i.e., now, there can be an action after a
13678 guard.
13679 In other words the guard is just explicitly optional.
13680 (packgram): Adjust.
13681 * src/output.c (guards_output): New.
13682 (output_parser): Call it when needed.
13683 (output): Also free the guard and attrs obstacks.
13684 * src/files.c, src/files.h (obstack_save): Remove.
13685 (output_files): Remove.
13686 As a result, if one needs the former `.act' file, using an
13687 appropriate skeleton which requires actions and guards is now
13688 required.
13689 * src/main.c (main): Adjust.
13690 * tests/semantic.at: New.
13691 * tests/regression.at: Use `input.y' as input file name.
13692 Avoid 8+3 problems by requiring input.c when the test needs the
13693 parser.
13694
13695 2001-12-27 Akim Demaille <akim@epita.fr>
13696
13697 * src/reader.c (symbol_list_new): Be sure to initialize all the
13698 fields.
13699
13700 2001-12-27 Akim Demaille <akim@epita.fr>
13701
13702 All the hacks using a final pseudo state are now useless.
13703
13704 * src/LR0.c (set_state_table): state_table holds exactly nstates.
13705 * src/lalr.c (nLA): New.
13706 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
13707 instead of lookaheadsp from the pseudo state (nstate + 1).
13708
13709 2001-12-27 Akim Demaille <akim@epita.fr>
13710
13711 * src/output.c (action_row, token_actions): Use a state_t instead
13712 of a integer, and nlookaheads instead of the following state's
13713 lookaheadsp.
13714
13715 2001-12-27 Akim Demaille <akim@epita.fr>
13716
13717 * src/conflicts.c (log_resolution, flush_shift)
13718 (resolve_sr_conflict, set_conflicts, solve_conflicts)
13719 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
13720 (conflicts_print, print_reductions): Use a state_t instead of an
13721 integer when referring to a state.
13722 As much as possible, depend upon nlookaheads, instead of the
13723 `lookaheadsp' member of the following state (since lookaheads of
13724 successive states are successive, the difference between state n + 1
13725 and n served as the number of lookaheads for state n).
13726 * src/lalr.c (add_lookback_edge): Likewise.
13727 * src/print.c (print_core, print_actions, print_state)
13728 (print_results): Likewise.
13729 * src/print_graph.c (print_core, print_actions, print_state)
13730 (print_graph): Likewise.
13731 * src/conflicts.h: Adjust.
13732
13733 2001-12-27 Akim Demaille <akim@epita.fr>
13734
13735 * src/bison.hairy: Formatting/comment changes.
13736 ANSIfy.
13737 Remove `register' indications.
13738 Add plenty of `static'.
13739
13740 2001-12-27 Akim Demaille <akim@epita.fr>
13741
13742 * src/output.c (prepare): Drop the muscle `ntbase' which
13743 duplicates ntokens.
13744 * src/bison.simple: Formatting/comment changes.
13745 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
13746 is an undocumented synonym.
13747
13748 2001-12-22 Akim Demaille <akim@epita.fr>
13749
13750 * src/output.c (output_table_data): Change the prototype to use
13751 `int' for array ranges: some invocations do pass an int, not a
13752 short.
13753 Reported by Wayne Green.
13754
13755 2001-12-22 Akim Demaille <akim@epita.fr>
13756
13757 Some actions of web2c.y are improperly triggered.
13758 Reported by Mike Castle.
13759
13760 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
13761 * tests/regression.at (Web2c): Rename as...
13762 (Web2c Report): this.
13763 (Web2c Actions): New.
13764
13765 2001-12-22 Akim Demaille <akim@epita.fr>
13766
13767 Reductions in web2c.y are improperly reported.
13768 Reported by Mike Castle.
13769
13770 * src/conflicts.c (print_reductions): Fix.
13771 * tests/regression.at (Web2c): New.
13772
13773 2001-12-18 Akim Demaille <akim@epita.fr>
13774
13775 Some host fail on `assert (!"foo")', which expands to
13776 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
13777 Reported by Nelson Beebee.
13778
13779 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
13780 `#define it_succeeded 0' and `assert (it_succeeded)'.
13781
13782 2001-12-17 Marc Autret <autret_m@epita.fr>
13783
13784 * src/bison.simple: Don't hard code the skeleton line and filename.
13785 * src/output.c (output_parser): Rename 'line' as 'output_line'.
13786 New line counter 'skeleton_line' (skeleton-line muscle).
13787
13788 2001-12-17 Paul Eggert <eggert@twinsun.com>
13789
13790 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
13791 YYDEBUG must be defined to a nonzero value.
13792
13793 * src/bison.simple (yytname): Do not assume that the user defines
13794 YYDEBUG to a properly parenthesized expression.
13795
13796 2001-12-17 Akim Demaille <akim@epita.fr>
13797
13798 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
13799 nlookaheads is a new member.
13800 Adjust all users.
13801 * src/lalr.h (nlookaheads): Remove this orphan declaration.
13802 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
13803 state.
13804
13805 2001-12-17 Akim Demaille <akim@epita.fr>
13806
13807 * src/files.h, src/files.c (open_files, close_files): Remove.
13808 * src/main.c (main): Don't open/close files, nor invoke lex_free,
13809 let...
13810 * src/reader.c (reader): Do it.
13811
13812 2001-12-17 Akim Demaille <akim@epita.fr>
13813
13814 * src/conflicts.c (print_reductions): Formatting changes.
13815
13816 2001-12-17 Akim Demaille <akim@epita.fr>
13817
13818 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
13819 (flush_reduce): New.
13820 (resolve_sr_conflict): Adjust.
13821
13822 2001-12-17 Akim Demaille <akim@epita.fr>
13823
13824 * src/output.c (output_obstack): Be static and rename as...
13825 (format_obstack): this, to avoid any confusion with files.c's
13826 output_obstack.
13827 * src/reader.h (muscle_obstack): Move to...
13828 * src/output.h: here, since it's defined in output.c.
13829
13830 2001-12-17 Akim Demaille <akim@epita.fr>
13831
13832 * src/output.c (action_row, save_column, default_goto)
13833 (sort_actions, matching_state, pack_vector): Better variable
13834 locality.
13835
13836 2001-12-17 Akim Demaille <akim@epita.fr>
13837
13838 * src/output.c: Various formatting changes.
13839
13840 2001-12-17 Akim Demaille <akim@epita.fr>
13841
13842 * src/files.c (output_files): Free the output_obstack.
13843 * src/main.c (main): Call print and print_graph conditionally.
13844 * src/print.c (print): Work unconditionally.
13845 * src/print_graph.c (print_graph): Work unconditionally.
13846 * src/conflicts.c (log_resolution): Output only if verbose_flag.
13847
13848 2001-12-16 Marc Autret <autret_m@epita.fr>
13849
13850 * src/output.c (actions_output): Fix. When we use %no-lines,
13851 there is one less line per action.
13852
13853 2001-12-16 Marc Autret <autret_m@epita.fr>
13854
13855 * src/bison.simple: Remove a useless #line directive.
13856 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
13857 * src/output.c (get_lines_number): New.
13858 (output_parser): Adjust, now takes care about the lines of a
13859 output muscles.
13860 Fix line numbering.
13861 (actions_output): Computes the number of lines taken by actions.
13862 (output_master_parser): Insert new skeleton which is the name of
13863 the output parser file name.
13864
13865 2001-12-15 Marc Autret <autret_m@epita.fr>
13866
13867 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
13868
13869 2001-12-15 Marc Autret <autret_m@epita.fr>
13870
13871 * src/output.c (output_gram): Keep track of the hairy one.
13872
13873 2001-12-15 Akim Demaille <akim@epita.fr>
13874
13875 Make `make distcheck' work.
13876
13877 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
13878 system.h which uses libgettext.h.
13879
13880 2001-12-15 Akim Demaille <akim@epita.fr>
13881
13882 * src/nullable.c (set_nullable): Useless rules must be skipped,
13883 otherwise, since we range over their symbols, we might look at a
13884 nonterminal which no longer ``exists'', i.e., it is not counted in
13885 `nvars', hence we overflow our arrays.
13886
13887 2001-12-15 Akim Demaille <akim@epita.fr>
13888
13889 The header can also be produced directly, without any obstack!
13890 Yahoo!
13891
13892 * src/files.c, src/files.h (defines_obstack): Remove.
13893 (compute_header_macro): Global.
13894 (defines_obstack_save): Remove.
13895 * src/reader.c (parse_union_decl): No longer output to
13896 defines_obstack: its content can be found in the `stype' muscle
13897 anyway.
13898 (output_token_translations): Merge into...
13899 (symbols_output): this.
13900 Rename as...
13901 (symbols_save): this.
13902 (reader): Adjust.
13903 * src/output.c (header_output): New.
13904 (output): Call it.
13905
13906 2001-12-15 Akim Demaille <akim@epita.fr>
13907
13908 * src/reader.c (parse_union_decl): Instead of handling two obstack
13909 simultaneously, use one to define the `stype' muscle, and use the
13910 value of the latter to fill defines_obstack.
13911 (copy_comment): Remove.
13912 (copy_comment2): Work for a single obstack.
13913 Rename as...
13914 (copy_comment): this.
13915
13916 2001-12-15 Akim Demaille <akim@epita.fr>
13917
13918 * src/lex.c, src/lex.h (xgetc): No longer static.
13919 * src/reader.c (parse_union_decl): Revamp.
13920
13921 2001-12-15 Akim Demaille <akim@epita.fr>
13922
13923 Still making progress in separating Bison into (i) input, (ii)
13924 process, (iii) output: now we can directly output the parser file
13925 without using table_obstack at all.
13926
13927 * src/files.c, src/files.h (table_obstack): Bye bye.
13928 (parser_file_name): New.
13929 * src/files.c (compute_output_file_names): Compute it.
13930 * src/output.c (actions_output, output_parser)
13931 (output_master_parser): To a file instead of an obstack.
13932
13933 2001-12-15 Akim Demaille <akim@epita.fr>
13934
13935 Attach actions to rules, instead of pre-outputting them to
13936 actions_obstack.
13937
13938 * src/gram.h (rule_t): action and action_line are new members.
13939 * src/reader.c (symbol_list): Likewise.
13940 (copy_action): Save the actions within the rule.
13941 (packgram): Save them in rule_table.
13942 * src/output.c (actions_output): New.
13943 (output_parser): Use it on `%%actions'.
13944 (output_rule_data): Don't free rule_table.
13945 (output): Do it.
13946 (prepare): Don't save the `action' muscle.
13947 * src/bison.simple: s/%%action/%%actions/.
13948
13949 2001-12-15 Akim Demaille <akim@epita.fr>
13950
13951 * src/reader.c (copy_action): When --yacc, don't append a `;'
13952 to the user action: let it fail if lacking.
13953 Suggested by Arnold Robbins and Tom Tromey.
13954
13955 2001-12-14 Akim Demaille <akim@epita.fr>
13956
13957 * src/lex.c (literalchar): Simply return the char you decoded, non
13958 longer mess around with obstacks and int pointers.
13959 Adjust all callers.
13960
13961 2001-12-14 Akim Demaille <akim@epita.fr>
13962
13963 * src/lex.c (literalchar): Don't escape the special characters,
13964 just decode them, and keep them as char (before, eol was output as
13965 the 2 char string `\n' etc.).
13966 * src/output.c (output_rule_data): Use quotearg to output the
13967 token strings.
13968
13969 2001-12-13 Paul Eggert <eggert@twinsun.com>
13970
13971 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
13972 Do not infringe on the global user namespace when using C++.
13973 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
13974 All uses of `fprintf' and `stderr' changed.
13975
13976 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
13977
13978 2001-12-13 Akim Demaille <akim@epita.fr>
13979
13980 The computation of nullable is broken: it doesn't handle empty
13981 RHS's properly.
13982
13983 * tests/torture.at (GNU AWK Grammar): New.
13984 * tests/sets.at (Nullable): New.
13985 * src/nullable.c (set_nullable): Instead of blindly looping over
13986 `ritems', loop over the rules, and then over their rhs's.
13987
13988 Work around Autotest bugs.
13989
13990 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
13991 frame, because Autotest understand lines starting with a `+' as
13992 traces from the shell. Then, they are not processed properly.
13993 Admittedly an Autotest bug, but we don't have time to wait for
13994 Autotest to catch up.
13995 * tests/regression.at (Broken Closure): Adjust to the new table
13996 frames.
13997 Move to...
13998 * tests/sets.at: here.
13999
14000 2001-12-13 Akim Demaille <akim@epita.fr>
14001
14002 * src/closure.c (closure): Use nrules instead of playing tricks
14003 with BITS_PER_WORD.
14004
14005 2001-12-13 Akim Demaille <akim@epita.fr>
14006
14007 * src/print.c (print_actions): Output the handling of `$' as the
14008 traces do: shifting the token EOF. Before EOF was treated as a
14009 nonterminal.
14010 * tests/regression.at: Adjust some tests.
14011 * src/print_graph.c (print_core): Complete the set of items via
14012 closure. The next-to-final and final states are still unsatisfying,
14013 but that's to be addressed elsewhere.
14014 No longer output the rule numbers, but do output the state number.
14015 A single loop for the shifts + gotos is enough, but picked a
14016 distinct color for each.
14017 (print_graph): Initialize and finalize closure.
14018
14019 2001-12-13 Akim Demaille <akim@epita.fr>
14020
14021 * src/reader.c (readgram): Remove dead code, an strip useless
14022 braces.
14023 (get_type): Remove, unused.
14024
14025 2001-12-12 Akim Demaille <akim@epita.fr>
14026
14027 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
14028 on that of lib/error.c.
14029
14030 2001-12-12 Akim Demaille <akim@epita.fr>
14031
14032 Some hosts don't like `/' in includes.
14033
14034 * src/system.h: Include libgettext.h without qualifying the path.
14035 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
14036 $(top_srcdir).
14037
14038 2001-12-11 Marc Autret <autret_m@epita.fr>
14039
14040 * src/output.c (output_parser): Remove useless muscle.
14041
14042 2001-12-11 Marc Autret <autret_m@epita.fr>
14043
14044 * src/bison.simple: Remove #line just before %%epilogue. It
14045 is now handled in ...
14046 * src/reader.c (read_additionnal_code): Add the output of a
14047 #line for the epilogue.
14048
14049 2001-12-10 Marc Autret <autret_m@epita.fr>
14050
14051 * src/reader.c (copy_definition): Re-use CPP-outed code which
14052 replace precedent remove.
14053 * src/bison.simple: Remove #line before %%prologue because
14054 %%input-line is wrong at this time.
14055
14056 2001-12-10 Marc Autret <autret_m@epita.fr>
14057
14058 * src/reader.c (symbols_output): Clean up.
14059 * src/output.c (output_gram, output): Clean up.
14060
14061 2001-12-10 Akim Demaille <akim@epita.fr>
14062
14063 * src/lalr.c (initialize_lookaheads): New. Extracted from...
14064 * src/LR0.c (set_state_table): here.
14065 * src/lalr.c (lalr): Call it.
14066
14067 2001-12-10 Akim Demaille <akim@epita.fr>
14068
14069 * src/state.h (shifts): Remove the `number' member: shifts are
14070 attached to state, hence no longer need to be labelled with a
14071 state number.
14072
14073 2001-12-10 Akim Demaille <akim@epita.fr>
14074
14075 Now that states have a complete set of members, the linked list of
14076 shifts is useless: just fill directly the state's shifts member.
14077
14078 * src/state.h (shifts): Remove the `next' member.
14079 * src/LR0.c (first_state, last_state): Remove.
14080 Adjust the callers.
14081 (augment_automaton): Don't look for the shifts that must be added
14082 a shift on EOF: it is those of the state we looked for! But now,
14083 since shifts are attached, it is no longer needed to looking
14084 merely by its id: its number.
14085
14086 2001-12-10 Akim Demaille <akim@epita.fr>
14087
14088 * src/LR0.c (augment_automaton): Better variable locality.
14089 Remove an impossible branch: if there is a state corresponding to
14090 the start symbol being shifted, then there is shift for the start
14091 symbol from the initial state.
14092
14093 2001-12-10 Akim Demaille <akim@epita.fr>
14094
14095 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
14096 only when appropriate: when insert_start_shifting_state' is not
14097 invoked.
14098 * tests/regression.at (Rule Line Numbers): Adjust.
14099
14100 2001-12-10 Akim Demaille <akim@epita.fr>
14101
14102 * src/LR0.c (augment_automaton): Now that all states have shifts,
14103 merge the two cases addition shifts to the initial state.
14104
14105 2001-12-10 Akim Demaille <akim@epita.fr>
14106
14107 * src/lalr.c (set_state_table): Move to...
14108 * src/LR0.c: here.
14109 * src/lalr.c (lalr): Don't call it...
14110 * src/LR0.c (generate_states): do it.
14111 * src/LR0.h (first_state): Remove, only the table is used.
14112
14113 2001-12-10 Akim Demaille <akim@epita.fr>
14114
14115 * src/LR0.h (first_shift, first_reduction): Remove.
14116 * src/lalr.c: Don't use first_shift: find shifts through the
14117 states.
14118
14119 2001-12-10 Akim Demaille <akim@epita.fr>
14120
14121 * src/LR0.c: Attach shifts to states as soon as they are
14122 computed.
14123 * src/lalr.c (set_state_table): Instead of assigning shifts to
14124 state, just assert that the mapping was properly done.
14125
14126 2001-12-10 Akim Demaille <akim@epita.fr>
14127
14128 * src/LR0.c (insert_start_shift): Rename as...
14129 (insert_start_shifting_state): this.
14130 (insert_eof_shifting_state, insert_accepting_state): New.
14131 (augment_automaton): Adjust.
14132 Better locality of the variables.
14133 When looking if the start_symbol is shifted from the initial
14134 state, using `while (... symbol != start_symbol ...)' sounds
14135 better than `while (... symbol < start_symbol ...)': If fail
14136 to see how the order between symbols could be relevant!
14137
14138 2001-12-10 Akim Demaille <akim@epita.fr>
14139
14140 * src/getargs.h: Don't declare `spec_name_prefix' and
14141 `spec_file_prefix', declared by src/files.h.
14142 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
14143 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
14144 * src/output.c (prepare): Adjust.
14145 * src/reader.c (symbols_output): Likewise.
14146 * src/vmsgetargs.c: Vaguely adjust, but who cares?
14147
14148 2001-12-10 Akim Demaille <akim@epita.fr>
14149
14150 * src/muscle_tab.c (muscle_init): NULL is a better default than
14151 `"0"'.
14152
14153 2001-12-10 Akim Demaille <akim@epita.fr>
14154
14155 * src/reader.c (reader): Calling symbols_output once is enough.
14156
14157 2001-12-10 Akim Demaille <akim@epita.fr>
14158
14159 Now that states have a complete set of members, the linked list of
14160 reductions is useless: just fill directly the state's reductions
14161 member.
14162
14163 * src/state.h (struct reductions): Remove member `number' and
14164 `next'.
14165 * src/LR0.c (first_reduction, last_reduction): Remove.
14166 (save_reductions): Don't link the new reductions, store them in
14167 this_state.
14168 * src/lalr.c (set_state_table): No need to attach reductions to
14169 states, it's already done.
14170 * src/output.c (output_actions): No longer free the shifts, then
14171 the reductions, then the states: free all the states and their
14172 members.
14173
14174 2001-12-10 Akim Demaille <akim@epita.fr>
14175
14176 * src/options.c (OPTN, DRTV, BOTH): New.
14177 (option_table): Use them.
14178
14179 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
14180 the job of system.h.
14181 * src/options.c: Don't include stdio.h and xalloc.h for the same
14182 reasons.
14183
14184 2001-12-10 Akim Demaille <akim@epita.fr>
14185
14186 * src/output.c (output, prepare): Make sure the values of the
14187 muscles `action' and `prologue' are 0-terminated.
14188
14189 2001-12-10 Akim Demaille <akim@epita.fr>
14190
14191 Clean up GCC warnings.
14192
14193 * src/reader.c (copy_action): `buf' is not used.
14194 (parse_skel_decl): Be static.
14195 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
14196 * src/options.h (create_long_option_table): Have a real prototype.
14197 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
14198 (hash_delete_at): Return const void *.
14199 Adjust casts to preserve the const.
14200
14201 2001-12-10 Akim Demaille <akim@epita.fr>
14202
14203 * configure.in: Require 2.52g.
14204 M4 is not needed, but AUTOM4TE is.
14205 * m4/m4.m4: Remove.
14206 * tests/Makefile.am: Adjust.
14207
14208 2001-12-10 Akim Demaille <akim@epita.fr>
14209
14210 One structure for states is enough, even though theoretically
14211 there are LR(0) states and LALR(1) states.
14212
14213 * src/lalr.h (state_t): Remove.
14214 (state_table): Be state_t **, not state_t *.
14215 * src/state.h (core, CORE_ALLOC): Rename as...
14216 (state_t, STATE_ALLOC): this.
14217 Add the LALR(1) members: shifts, reductions, errs.
14218 * src/LR0.c (state_table): Rename as...
14219 (state_hash): this, to avoid name clashes with the global
14220 `state_table'.
14221 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
14222 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
14223
14224 2001-12-10 Akim Demaille <akim@epita.fr>
14225
14226 Bison dumps core on bash.y.
14227 Reported by Pascal Bart.
14228
14229 * src/warshall.c (bitmatrix_print): New.
14230 (TC): Use it.
14231 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
14232 j must be the outer loop.
14233 * tests/regression.at (Broken Closure): New.
14234
14235 2001-12-05 Akim Demaille <akim@epita.fr>
14236
14237 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
14238 its argument.
14239 Reported by Peter Hamorsky.
14240
14241 2001-12-05 Akim Demaille <akim@epita.fr>
14242
14243 * src/conflicts.c (err_table): Remove.
14244 (resolve_sr_conflict): Adjust.
14245 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
14246 Rename as...
14247 (state_t.reductions, state_t.shifts): this.
14248
14249 2001-12-05 Akim Demaille <akim@epita.fr>
14250
14251 * src/reduce.c (reduce_grammar_tables): No longer disable the
14252 removal of useless rules via CPP but via `if (0)', so that the
14253 compiler still check the code is valid.
14254 For instance, it should have noticed `rline' no longer exists: use
14255 the `line' member of rule_t.
14256 * src/gram.c (dummy, rline): Remove, unused.
14257
14258 2001-12-05 Akim Demaille <akim@epita.fr>
14259
14260 * src/output.c (pack_vector): Use assert, not berror.
14261 * src/main.c (berror): Remove, unused.
14262
14263 2001-12-05 Akim Demaille <akim@epita.fr>
14264
14265 New experimental feature: if --verbose --trace output all the
14266 items of a state, not only its kernel.
14267
14268 * src/print.c (print_core): If `trace_flag', then invoke closure
14269 before outputting the items of the state (print_core is no longer
14270 a correct name them).
14271 (print_results): Invoke new_closure/free_closure if needed.
14272
14273 2001-12-05 Akim Demaille <akim@epita.fr>
14274
14275 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
14276 * src/closure.c, src/closure.h (itemsetsize): Rename as...
14277 (nitemset): for consistency with the rest of the project.
14278
14279 2001-12-05 Akim Demaille <akim@epita.fr>
14280
14281 * src/closure.c (print_closure): Improve.
14282 (closure): Use it for printing input and output.
14283
14284 2001-12-05 Akim Demaille <akim@epita.fr>
14285
14286 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
14287 indexed by nonterminals.
14288
14289 2001-12-05 Akim Demaille <akim@epita.fr>
14290
14291 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
14292 what it was!).
14293 * src/warshall.h: Remove accidental duplication of the content.
14294
14295 2001-12-05 Akim Demaille <akim@epita.fr>
14296
14297 * src/closure.c (set_fderives): De-obfuscate.
14298
14299 2001-12-05 Akim Demaille <akim@epita.fr>
14300
14301 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
14302
14303 2001-12-05 Akim Demaille <akim@epita.fr>
14304
14305 * src/closure.c (set_firsts): De-obfuscate.
14306
14307 2001-12-05 Akim Demaille <akim@epita.fr>
14308
14309 * src/output.c (action_row): De-obfuscate
14310 using the good o' techniques: arrays not pointers, variable
14311 locality, BITISSET, RESETBIT etc.
14312
14313 2001-12-05 Akim Demaille <akim@epita.fr>
14314
14315 Pessimize the code to simplify it: from now on, all the states
14316 have a valid SHIFTS, which NSHIFTS is possibly 0.
14317
14318 * src/LR0.c (shifts_new): Be global and move to..
14319 * src/state.c, src/state.h: here.
14320 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
14321 * src/print_graph: Adjust.
14322
14323 2001-12-05 Akim Demaille <akim@epita.fr>
14324
14325 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
14326 * src/conflicts.c: Use it.
14327 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
14328 incorrectly ``simplified''.
14329
14330 2001-12-05 Akim Demaille <akim@epita.fr>
14331
14332 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
14333 using the good o' techniques: arrays not pointers, variable
14334 locality, BITISSET, RESETBIT etc.
14335
14336 2001-12-05 Akim Demaille <akim@epita.fr>
14337
14338 * src/state.h (SHIFT_SYMBOL): New.
14339 * src/conflicts.c: Use it to deobfuscate.
14340
14341 2001-12-05 Akim Demaille <akim@epita.fr>
14342
14343 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
14344 (print_reductions): De-obfuscate using the good o' techniques:
14345 arrays not pointers, variable locality, BITISSET.
14346
14347 2001-12-05 Akim Demaille <akim@epita.fr>
14348
14349 * src/conflicts.c (print_reductions): Arrays, not pointers.
14350 Use BITISSET.
14351
14352 2001-12-05 Akim Demaille <akim@epita.fr>
14353
14354 * src/conflicts.c (print_reductions): Pessimize, but clarify.
14355
14356 2001-12-05 Akim Demaille <akim@epita.fr>
14357
14358 * src/conflicts.c (print_reductions): Improve variable locality.
14359
14360 2001-12-05 Akim Demaille <akim@epita.fr>
14361
14362 * src/conflicts.c (print_reductions): Pessimize, but clarify.
14363
14364 2001-12-05 Akim Demaille <akim@epita.fr>
14365
14366 * src/conflicts.c (print_reductions): Improve variable locality.
14367
14368 2001-12-05 Akim Demaille <akim@epita.fr>
14369
14370 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
14371 * src/lalr.c: Use them.
14372
14373 2001-12-05 Akim Demaille <akim@epita.fr>
14374
14375 * src/LR0.c (augment_automaton): Formatting changes.
14376 Better variable locality.
14377
14378 2001-12-05 Akim Demaille <akim@epita.fr>
14379
14380 * src/lalr.c (matrix_print): New.
14381 (transpose): Use it.
14382 Use arrays instead of pointers.
14383
14384 2001-12-05 Akim Demaille <akim@epita.fr>
14385
14386 * src/lalr.c (maxrhs): Move to...
14387 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
14388 * src/lalr.c (build_relations): Adjust.
14389
14390 2001-12-05 Akim Demaille <akim@epita.fr>
14391
14392 * src/lalr.c (transpose): Free the memory allocated to the
14393 argument, as it is replaced by the results by the unique caller.
14394 (build_relations): Merely invoke transpose: it handles the memory
14395 deallocation.
14396 Improve variable locality.
14397 Avoid variables used as mere abbreviations.
14398 (compute_lookaheads): Use arrays instead of pointers.
14399
14400 2001-12-05 Akim Demaille <akim@epita.fr>
14401
14402 * src/lalr.c (initialize_F): Improve variable locality.
14403 Avoid variables used as mere abbreviations.
14404
14405 2001-12-05 Akim Demaille <akim@epita.fr>
14406
14407 * src/derives.c (print_derives): Display the ruleno.
14408 * src/lalr.c (initialize_F, transpose): Better variable locality
14409 to improve readability.
14410 Avoid variables used as mere abbreviations.
14411
14412 2001-12-05 Akim Demaille <akim@epita.fr>
14413
14414 * src/lalr.c (traverse): Use arrays instead of pointers.
14415
14416 2001-12-05 Akim Demaille <akim@epita.fr>
14417
14418 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
14419 the handling of squeue.
14420 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
14421
14422 2001-12-05 Akim Demaille <akim@epita.fr>
14423
14424 Because useless nonterminals are now kept alive (instead of being
14425 `destroyed'), we now sometimes examine them, and store information
14426 related to them. Hence we need to know their number, and adjust
14427 memory allocations.
14428
14429 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
14430 static.
14431 * src/LR0.c (allocate_itemsets): The memory allocated to
14432 `symbol_count' was used for two different purpose: once to count
14433 the number of occurrences of each symbol, and later reassigned to
14434 `shift_symbol', containing the symbol that can be shifted from a
14435 given state.
14436 Deobfuscate, i.e., allocate, use and free `symbol_count' here
14437 only, and...
14438 (new_itemsets): Allocate `shift_symbol' here.
14439 (allocate_itemsets): symbol_count includes useless nonterminals.
14440 Make room for them.
14441 (free_storage): Use `free', not `XFREE', for pointers that cannot
14442 be null.
14443
14444 2001-12-05 Akim Demaille <akim@epita.fr>
14445
14446 * src/nullable.c (set_nullable): Deobfuscate the handling of
14447 ritem.
14448 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
14449
14450 2001-12-05 Akim Demaille <akim@epita.fr>
14451
14452 * src/gram.c, src/gram.h (ritem_print): New.
14453 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
14454 (This useless function was defined only to work around VMS linkers
14455 that can't handle compilation units with variables only).
14456 * src/reduce.c (dump_grammar): Use it to trace the construction of
14457 ritem.
14458
14459 2001-12-04 Paul Eggert <eggert@twinsun.com>
14460
14461 * src/bison.simple (union yyalloc): Change member names
14462 to be the same as the stack names.
14463 (yyparse): yyptr is now union yyalloc *, not char *.
14464 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
14465 and may generate better code on some machines.
14466 (yystpcpy): Use prototype if __STDC__ is defined, not just
14467 if __cplusplus is defined.
14468
14469 2001-11-30 Akim Demaille <akim@epita.fr>
14470
14471 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
14472 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
14473 Gettext doesn't compile cleanly, and dies with -Werror.
14474 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
14475 Include WARNING_CFLAGS here.
14476 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
14477 before being defined.
14478
14479 2001-11-27 Paul Eggert <eggert@twinsun.com>
14480
14481 * lib/quotearg.h (quotearg_n, quotearg_n_style):
14482 First arg is int, not unsigned.
14483 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
14484 (SIZE_MAX, UINT_MAX): New macros.
14485 (quotearg_n_options): Abort if N is negative.
14486 Avoid overflow check on hosts where size_t is 64 bits and int
14487 is 32 bits, as overflow is impossible there.
14488 Fix off-by-one typo that caused unnecessary reallocation.
14489
14490 2001-11-29 Paul Eggert <eggert@twinsun.com>
14491
14492 Name space cleanup in generated parser.
14493
14494 * doc/bison.texinfo (Bison Parser): Discuss system headers
14495 and their effect on the user name space.
14496
14497 * src/bison.simple:
14498 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
14499 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
14500 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
14501
14502 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
14503 on user names when possible.
14504
14505 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
14506 Simplify test for whather <alloca.h> exists.
14507
14508 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
14509
14510 (<stdio.h>): Include if YYDEBUG.
14511
14512 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
14513 ! defined (yyoverflow) && ! defined (yymemcpy).
14514
14515 (yymemcpy, yyparse): Rename local variables as needed so that
14516 they all begin with 'yy'.
14517
14518 (yystrlen, yystpcpy): New functions.
14519
14520 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
14521 All uses changed.
14522
14523 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
14524 instead of relying on string.h functions. Use YYSTACK_ALLOC
14525 and YYSTACK_FREE instead of malloc and free.
14526
14527 2001-11-30 Akim Demaille <akim@epita.fr>
14528
14529 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
14530 before their first uses.
14531 (YYBISON, YYPURE): Move to the top of the output.
14532
14533 2001-11-30 Akim Demaille <akim@epita.fr>
14534
14535 * tests/reduce.at (Useless Nonterminals): Fix.
14536
14537 2001-11-30 Akim Demaille <akim@epita.fr>
14538
14539 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
14540 if body instead of `;' to pacify GCC's warnings.
14541
14542 2001-11-30 Akim Demaille <akim@epita.fr>
14543
14544 Instead of mapping the LHS of unused rules to -1, keep the LHS
14545 valid, but flag the rules as invalid.
14546
14547 * src/gram.h (rule_t): `useful' is a new member.
14548 * src/print.c (print_grammar): Adjust.
14549 * src/derives.c (set_derives): Likewise.
14550 * src/reader.c (packgram, reduce_output): Likewise.
14551 * src/reduce.c (reduce_grammar_tables): Likewise.
14552 * tests/reduce.at (Underivable Rules, Useless Rules): New.
14553
14554 2001-11-30 Akim Demaille <akim@epita.fr>
14555
14556 * src/reduce.c (reduce_output): Formatting changes.
14557 * src/print.c (print_results, print_grammar): Likewise.
14558 * tests/regression.at (Rule Line Numbers)
14559 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
14560
14561 2001-11-30 Akim Demaille <akim@epita.fr>
14562
14563 * src/reduce.c (nonterminals_reduce): Instead of throwing away
14564 useless nonterminals, move them at the end of the symbol arrays.
14565 (reduce_output): Adjust.
14566 * tests/reduce.at (Useless Nonterminals): Adjust.
14567
14568 2001-11-30 Akim Demaille <akim@epita.fr>
14569
14570 * src/reduce.c: Various comment/formatting changes.
14571 (nonterminals_reduce): New, extracted from...
14572 (reduce_grammar_tables): here.
14573 (reduce_grammar): Call nonterminals_reduce.
14574
14575 2001-11-29 Paul Eggert <eggert@twinsun.com>
14576
14577 * src/bison.simple (YYSTACK_REALLOC): Remove.
14578 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
14579 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
14580 New macros.
14581 (union yyalloc): New type.
14582 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
14583 an arbitrary restriction on hosts where size_t is wider than int.
14584
14585 (yyparse): Don't dump core if alloca or malloc fails; instead, report
14586 a parser stack overflow. Allocate just one block of memory for all
14587 three stacks, instead of allocating three blocks; this typically is
14588 faster and reduces fragmentation.
14589
14590 Do not limit the number of items in the stack to a value that fits
14591 in 'int', as this is an arbitrary limit on hosts with 64-bit
14592 size_t and 32-bit int.
14593
14594 2001-11-29 Marc Autret <autret_m@epita.fr>
14595
14596 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
14597 of defining YYERROR_VERBOSE.
14598 [AT_DATA]: $4 is now out of C declarations in the prologue.
14599
14600 2001-11-28 Marc Autret <autret_m@epita.fr>
14601
14602 * src/reader.c (parse_dquoted_param): New.
14603 (parse_skel_decl): Use it.
14604 * src/lex.h: Add its prototype.
14605 * src/lex.c (literalchar): Become not static.
14606
14607 2001-11-28 Marc Autret <autret_m@epita.fr>
14608
14609 * src/output.h: And put its extern declaration here.
14610 * src/output.c (error_verbose): Define here.
14611 (prepare): Echo name modification.
14612 * src/getargs.h: Clean its extern declaration.
14613 * src/getargs.c (error_verbose_flag): Remove.
14614 (getargs): Remove case 'e'.
14615 * src/options.c (option_table): 'error-verbose' is now seen as simple
14616 percent option.
14617 Include output.h.
14618
14619 * src/reader.c (read_declarations): Remove case tok_include.
14620 (parse_include_decl): Remove.
14621 * src/lex.h (token_t): Remove tok_include.
14622 * src/options.c (option_table): 'include' is now a simple command line
14623 option.
14624
14625 2001-11-28 Marc Autret <autret_m@epita.fr>
14626
14627 * src/bison.simple: Adjust muscle names.
14628 * src/muscle_tab.c (muscle_init): Also rename the muscles.
14629 * src/output.c (prepare): s/_/-/ for the muscles names.
14630 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
14631
14632 2001-11-28 Marc Autret <autret_m@epita.fr>
14633
14634 * src/bison.simple: Fix debug.
14635 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
14636
14637 2001-11-28 Akim Demaille <akim@epita.fr>
14638
14639 * src/LR0.c (shifts_new): New.
14640 (save_shifts, insert_start_shift, augment_automaton): Use it.
14641
14642 2001-11-28 Akim Demaille <akim@epita.fr>
14643
14644 * src/closure.c (closure): `b' and `ruleno' denote the same value:
14645 keep ruleno only.
14646
14647 2001-11-28 Akim Demaille <akim@epita.fr>
14648
14649 * src/closure.c (closure): Instead of looping over word in array
14650 then bits in words, loop over bits in array.
14651
14652 2001-11-28 Akim Demaille <akim@epita.fr>
14653
14654 * src/closure.c (closure): No longer optimize the special case
14655 where all the bits of `ruleset[r]' are set to 0, to make the code
14656 clearer.
14657
14658 2001-11-28 Akim Demaille <akim@epita.fr>
14659
14660 * src/closure.c (closure): `r' and `c' are new variables, used to
14661 de-obfuscate accesses to RULESET and CORE.
14662
14663 2001-11-28 Akim Demaille <akim@epita.fr>
14664
14665 * src/reduce.c (reduce_print): Use ngettext.
14666 (dump_grammar): Improve the trace accuracy.
14667
14668 2001-11-28 Akim Demaille <akim@epita.fr>
14669
14670 * src/reduce.c (dump_grammar): Don't translate trace messages.
14671
14672 2001-11-28 Akim Demaille <akim@epita.fr>
14673
14674 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
14675 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
14676 as all tags are free'ed afterwards.
14677 From Enrico Scholz.
14678
14679 2001-11-27 Paul Eggert <eggert@twinsun.com>
14680
14681 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
14682 use alloca when we didn't want to, and vice versa.
14683
14684 2001-11-27 Marc Autret <autret_m@epita.fr>
14685
14686 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
14687 initialization.
14688 * src/output.c (prepare): Remove its update.
14689
14690 2001-11-27 Marc Autret <autret_m@epita.fr>
14691
14692 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
14693 Use %error-verbose.
14694
14695 2001-11-27 Marc Autret <autret_m@epita.fr>
14696
14697 * src/bison.simple: Remove YYERROR_VERBOSE using.
14698 Use %%error_verbose.
14699 (yyparse): Likewise.
14700 * src/output.c (prepare): Give its final value.
14701 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
14702 * src/getargs.h: Add its extern declaration.
14703 * src/getargs.c (error_verbose_flag): New int.
14704 (getargs): Update to catch new case.
14705 * src/options.c (option_table): 'error-verbose' is a new option.
14706 (shortopts): Update.
14707
14708 2001-11-27 Akim Demaille <akim@epita.fr>
14709
14710 * src/system.h: Use intl/libgettext.h.
14711 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
14712
14713 2001-11-27 Akim Demaille <akim@epita.fr>
14714
14715 * tests/torture.at (Exploding the Stack Size with Malloc):
14716 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
14717
14718 2001-11-27 Akim Demaille <akim@epita.fr>
14719
14720 * src/files.c: Include error.h.
14721 Reported by Hans Aberg.
14722
14723 2001-11-26 Marc Autret <autret_m@epita.fr>
14724
14725 * src/reader.c (parse_include_decl): New, not yet implemented.
14726 (read_declarations): Add case tok_include.
14727 * src/getargs.h (include): Add its extern definition.
14728 * src/getargs.c (include): New const char *.
14729 (getargs): Add case '-I'.
14730 * src/options.c (option_table): Add include as command line and
14731 percent option.
14732 * src/lex.h (token_t): Add tok_include.
14733
14734 2001-11-26 Akim Demaille <akim@epita.fr>
14735
14736 * src/reader.c (readgram): Make sure rules for mid-rule actions
14737 have a lineno equal to that of their host rule.
14738 Reported by Hans Aberg.
14739 * tests/regression.at (Rule Line Numbers): New.
14740
14741 2001-11-26 Akim Demaille <akim@epita.fr>
14742
14743 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
14744 size_ts.
14745
14746 2001-11-26 Akim Demaille <akim@epita.fr>
14747
14748 * src/complain.c, src/complain.h (error): Remove, provided by
14749 lib/error.[ch].
14750
14751 2001-11-26 Akim Demaille <akim@epita.fr>
14752
14753 * src/reader.c (read_declarations): Don't abort on tok_illegal,
14754 issue an error message.
14755 * tests/regression.at (Invalid %directive): New.
14756 Reported by Hans Aberg.
14757
14758 2001-11-26 Akim Demaille <akim@epita.fr>
14759
14760 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
14761 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
14762
14763 2001-11-26 Akim Demaille <akim@epita.fr>
14764
14765 * src/conflicts.c (conflicts_print): Don't complain at all when
14766 there are no reduce/reduce conflicts, and as many shift/reduce
14767 conflicts as expected.
14768 * tests/regression.at (%expect right): Adjust.
14769
14770 2001-11-23 Akim Demaille <akim@epita.fr>
14771
14772 * lib/alloca.c: Update, from fileutils.
14773
14774 2001-11-23 Akim Demaille <akim@epita.fr>
14775
14776 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
14777
14778 2001-11-23 Akim Demaille <akim@epita.fr>
14779
14780 * src/system.h: Include alloca.h.
14781 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
14782
14783 2001-11-23 Akim Demaille <akim@epita.fr>
14784
14785 * src/print_graph.c (print_actions): Remove `rule', unused.
14786 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
14787 pacify GCC's signed < unsigned warnings.
14788 * src/closure.c (itemsetsize): Likewise.
14789 * src/reader.c (symbol_list_new): Static.
14790
14791 2001-11-23 Akim Demaille <akim@epita.fr>
14792
14793 Attaching lineno to buckets is stupid, since only one copy of each
14794 symbol is kept, only the line of the first occurrence is kept too.
14795
14796 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
14797 * src/reader.c (rline_allocated): Remove, unused.
14798 (symbol_list): Have a `line' member.
14799 (symbol_list_new): New.
14800 (readgram): Use it.
14801 * src/print.c (print_grammar): Output the rule line numbers.
14802 * tests/regression.at (Solved SR Conflicts)
14803 (Unresolved SR Conflicts): Adjust.
14804 Reported by Hans Aberg.
14805
14806 2001-11-22 Marc Autret <autret_m@epita.fr>
14807
14808 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
14809
14810 2001-11-22 Marc Autret <autret_m@epita.fr>
14811
14812 * src/muscle_tab.c (muscle_init): Remove initialization of
14813 skeleton muscle.
14814 * src/output.c (output_master_parser): Do it here.
14815
14816 2001-11-20 Akim Demaille <akim@epita.fr>
14817
14818 * po/sv.po: New.
14819 * configure.in (ALL_LINGUAS): Adjust.
14820 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
14821 longer contains strings to translate.
14822
14823 2001-11-19 Akim Demaille <akim@epita.fr>
14824
14825 * src/conflicts.c (conflicts_print): Add a missing \n.
14826
14827 2001-11-19 Akim Demaille <akim@epita.fr>
14828
14829 * src/nullable.c (nullable_print): New.
14830 (set_nullable): Call it when tracing.
14831 Better locality of variables.
14832
14833 2001-11-19 Akim Demaille <akim@epita.fr>
14834
14835 * src/print.c (print_actions): Better locality of variables.
14836
14837 2001-11-19 Akim Demaille <akim@epita.fr>
14838
14839 * src/derives.c (print_derives): Fix and enrich.
14840 * src/closure.c (print_fderives): Likewise.
14841
14842 2001-11-19 Akim Demaille <akim@epita.fr>
14843
14844 * src/closure.c (itemsetend): Remove, replaced with...
14845 (itemsetsize): new.
14846
14847 2001-11-19 Akim Demaille <akim@epita.fr>
14848
14849 * src/LR0.c (kernel_end): Remove, replaced with...
14850 (kernel_size): new.
14851
14852 2001-11-19 Akim Demaille <akim@epita.fr>
14853
14854 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
14855 to clarify.
14856
14857 2001-11-19 Akim Demaille <akim@epita.fr>
14858
14859 * src/closure.c (closure): Use arrays instead of pointers to clarify.
14860
14861 2001-11-19 Akim Demaille <akim@epita.fr>
14862
14863 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
14864 trace messages.
14865 * src/LR0.c: Likewise.
14866 (allocate_itemsets): Use arrays instead of pointers to clarify.
14867
14868 2001-11-19 Akim Demaille <akim@epita.fr>
14869
14870 * src/getargs.c (statistics_flag): Replace with...
14871 (trace_flag): New.
14872 (longopts): Accept --trace instead of --statistics.
14873 * src/getargs.h, src/options.c: Adjust.
14874 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
14875 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
14876
14877 2001-11-19 Akim Demaille <akim@epita.fr>
14878
14879 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
14880 pointers to clarify the code.
14881 (save_reductions, save_shifts): Factor common parts of alternatives.
14882
14883 2001-11-19 Akim Demaille <akim@epita.fr>
14884
14885 * src/LR0.c (new_state, get_state): Complete TRACE code.
14886 * src/closure.c: Include `reader.h' to get `tags', needed by the
14887 trace code.
14888 Rename the conditional DEBUG as TRACE.
14889 Output consistently TRACEs to stderr, not stdout.
14890 * src/derives.c: Likewise.
14891 * src/reduce.c: (inaccessable_symbols): Using if is better style
14892 than goto.
14893 Use `#if TRACE' instead of `#if 0' for tracing code.
14894
14895 2001-11-19 Akim Demaille <akim@epita.fr>
14896
14897 * src/system.h (LIST_FREE, shortcpy): New.
14898 * src/LR0.c: Use them.
14899 * src/output.c (free_itemsets, free_reductions, free_shifts):
14900 Remove, replaced by LIST_FREE.
14901
14902 2001-11-19 Akim Demaille <akim@epita.fr>
14903
14904 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
14905 (REDUCTIONS_ALLOC): New.
14906 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
14907 allocation.
14908
14909 2001-11-19 Akim Demaille <akim@epita.fr>
14910
14911 * src/LR0.c (new_state): Complete trace code.
14912 * src/nullable.c (set_nullable): Don't translate traces.
14913
14914 2001-11-19 Akim Demaille <akim@epita.fr>
14915
14916 * src/print_graph.c (print_core): Better locality of variables.
14917 * src/print.c (print_core): Likewise.
14918
14919 2001-11-19 Akim Demaille <akim@epita.fr>
14920
14921 * src/vcg.c: You do the output, so you are responsible of the
14922 handling of VCG syntax, in particular: use quotearg.
14923 * src/print_graph.c: Don't.
14924 (print_actions): Don't output the actions as part of the nodes,
14925 since that's the job of the edges.
14926 (print_state): Don't output by hand: fill the node description,
14927 and ask for its output.
14928
14929 2001-11-19 Akim Demaille <akim@epita.fr>
14930
14931 * src/bison.simple (yyparse): When verbosely reporting an error,
14932 no longer put additional quotes around token names.
14933 * tests/calc.at: Adjust.
14934
14935 2001-11-19 Akim Demaille <akim@epita.fr>
14936
14937 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
14938 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
14939 * src/output.c: Adjust.
14940
14941 2001-11-19 Akim Demaille <akim@epita.fr>
14942
14943 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
14944 (rule_t): this.
14945 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
14946
14947 2001-11-19 Akim Demaille <akim@epita.fr>
14948
14949 * src/gram.h (rule_t): New.
14950 (rule_table): New.
14951 (rrhs, rlhs): Remove, part of state_t.
14952 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
14953 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14954 * src/reader.c, src/reduce.c: Adjust.
14955
14956 2001-11-19 Akim Demaille <akim@epita.fr>
14957
14958 * src/reader.c (symbols_output): New, extracted from...
14959 (packsymbols): Here.
14960 (reader): Call it.
14961
14962 2001-11-19 Akim Demaille <akim@epita.fr>
14963
14964 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
14965 (maxrhs): this new function.
14966
14967 2001-11-19 Akim Demaille <akim@epita.fr>
14968
14969 * src/lalr.c (F): New macro to access the variable F.
14970 Adjust.
14971
14972 2001-11-19 Akim Demaille <akim@epita.fr>
14973
14974 * src/lalr.h (LA): New macro to access the variable LA.
14975 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14976 * src/lalr.c: Adjust.
14977
14978 2001-11-19 Akim Demaille <akim@epita.fr>
14979
14980 * src/lalr.c (initialize_LA): Only initialize LA. Let...
14981 (set_state_table): handle the `lookaheads' members.
14982
14983 2001-11-19 Akim Demaille <akim@epita.fr>
14984
14985 * src/lalr.h (lookaheads): Removed array, whose contents is now
14986 a member of...
14987 (state_t): this structure.
14988 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14989 Adjust.
14990
14991 2001-11-19 Akim Demaille <akim@epita.fr>
14992
14993 * src/lalr.h (consistent): Removed array, whose contents is now
14994 a member of...
14995 (state_t): this structure.
14996 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14997 Adjust.
14998
14999 2001-11-19 Akim Demaille <akim@epita.fr>
15000
15001 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
15002 contents are now members of...
15003 (state_t): this structure.
15004 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15005 Adjust.
15006
15007 2001-11-19 Akim Demaille <akim@epita.fr>
15008
15009 * src/lalr.h (state_t): New.
15010 (state_table): Be a state_t * instead of a core **.
15011 (accessing_symbol): Remove, part of state_t.
15012 * src/lalr.c: Adjust.
15013 (set_accessing_symbol): Merge into...
15014 (set_state_table): this.
15015 * src/print_graph.c, src/conflicts.c: Adjust.
15016
15017 2001-11-14 Akim Demaille <akim@epita.fr>
15018
15019 * tests/calc.at, tests/output.at, tests/regression.at,
15020 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
15021 now the tests are run in private dirs, therefore AC_CLEANUP and
15022 family can be simplified to 0-ary.
15023 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
15024 use abs. path to find config.h.
15025 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
15026 stderr, there can be way too much random noise.
15027 Instead pass -Werror to GCC and rely on the exit status.
15028 Reported by Wolfram Wagner.
15029
15030 2001-11-14 Akim Demaille <akim@epita.fr>
15031
15032 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
15033 defined only if yyoverflow is defined, to avoid `warning: unused
15034 variable `yyvs1''.
15035 Reported by The Test Suite.
15036
15037 2001-11-14 Akim Demaille <akim@epita.fr>
15038
15039 * src/print.c: Include reduce.h.
15040 Reported by Hans Aberg.
15041
15042 2001-11-14 Akim Demaille <akim@epita.fr>
15043
15044 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
15045 Revert a previous patch: these are really const.
15046 * src/conflicts.c (conflict_report): Additional useless pair of
15047 braces to pacify GCC's warnings for `if () if () {} else {}'.
15048 * src/lex.c (parse_percent_token): Replace equal_offset with
15049 arg_offset.
15050 arg is const.
15051 Be sure to strdup `arg' when used, since there is no reason for
15052 token_buffer not to change.
15053
15054 2001-11-14 Akim Demaille <akim@epita.fr>
15055
15056 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
15057 definition.
15058 * src/main.c (main): Use them.
15059 Suggested by Hans Aberg.
15060
15061 2001-11-12 Akim Demaille <akim@epita.fr>
15062
15063 * src/system.h (ngettext): Now that we use ngettext, be sure to
15064 provide a default definition when NLS are not used.
15065
15066 2001-11-12 Akim Demaille <akim@epita.fr>
15067
15068 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
15069 Use @kbd to denote user input.
15070 (Language and Grammar): ANSIfy the example.
15071 Adjust its layout for info/notinfo.
15072 (Location Tracking Calc): Output error messages to stderr.
15073 Output locations in a more GNUtically correct way.
15074 Fix a couple of Englishos.
15075 Adjust @group/@end group pairs.
15076
15077 2001-11-12 Akim Demaille <akim@epita.fr>
15078
15079 %expect was not functioning at all.
15080
15081 * src/conflicts.c (expected_conflicts): Set to -1.
15082 (conflict_report): Use ngettext.
15083 (conflicts_print): Check %expect and make its violation an error.
15084 * doc/bison.texinfo (Expect Decl): Adjust.
15085 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
15086 * tests/regression.at (%expect not enough, %expect right)
15087 (%expect too much): New.
15088
15089 2001-11-12 Akim Demaille <akim@epita.fr>
15090
15091 * tests/regression.at (Conflicts): Rename as...
15092 (Unresolved SR Conflicts): this.
15093 (Solved SR Conflicts): New.
15094
15095 2001-11-12 Akim Demaille <akim@epita.fr>
15096
15097 * src/reduce.c (print_results): Rename as...
15098 (reduce_output): This.
15099 Output to OUT, passed as argument, instead of output_obstack.
15100 (dump_grammar): Likewise.
15101 (reduce_free): New.
15102 Also free V1.
15103 (reduce_grammar): No longer call reduce_output, since...
15104 * src/print.c (print_results): do it.
15105 * src/main.c (main): Call reduce_free;
15106
15107 2001-11-12 Akim Demaille <akim@epita.fr>
15108
15109 * src/conflicts.c (print_reductions): Accept OUT as argument.
15110 Output to it, not to output_obstack.
15111 * src/print.c (print_actions): Adjust.
15112
15113 2001-11-12 Akim Demaille <akim@epita.fr>
15114
15115 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
15116 the result instead of using...
15117 (src_total, rrc_total, src_count, rrc_count): Remove.
15118 (any_conflicts): Remove.
15119 (print_conflicts): Split into...
15120 (conflicts_print, conflicts_output): New.
15121 * src/conflicts.h: Adjust.
15122 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
15123 * src/print.c (print_grammar): Issue `\n' between two rules.
15124 * tests/regression.at (Conflicts): New.
15125 Reported by Tom Lane.
15126
15127 2001-11-12 Akim Demaille <akim@epita.fr>
15128
15129 * tests/regression.at (Invalid input): Remove, duplicate with
15130 ``Invalid input: 1''.
15131
15132 2001-11-12 Akim Demaille <akim@epita.fr>
15133
15134 * tests/torture.at (AT_DATA_STACK_TORTURE)
15135 (Exploding the Stack Size with Alloca)
15136 (Exploding the Stack Size with Malloc): New.
15137
15138 2001-11-12 Akim Demaille <akim@epita.fr>
15139
15140 * src/bison.simple (YYSTACK_REALLOC): New.
15141 (yyparse) [!yyoverflow]: Use it and free the old stack.
15142 Reported by Per Allansson.
15143
15144 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
15145
15146 * src/bison.simple: Define type yystype instead of YYSTYPE, and
15147 define CPP macro, which substitute YYSTYPE by yystype.
15148 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
15149 with yyltype/YYLTYPE. This allows inclusion of the generated
15150 header within the parser if the compiler, such as GGC, accepts
15151 multiple equivalent #defines.
15152 From Akim.
15153
15154 2001-11-05 Akim Demaille <akim@epita.fr>
15155
15156 * src/reader.c (symbols_output): New, extracted from...
15157 (packsymbols): here.
15158 (reader): Adjust.
15159
15160 2001-11-05 Akim Demaille <akim@epita.fr>
15161
15162 * src/lex.c (parse_percent_token): s/quotearg/quote/.
15163
15164 2001-11-05 Akim Demaille <akim@epita.fr>
15165
15166 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
15167 pattern.
15168
15169 2001-11-05 Akim Demaille <akim@epita.fr>
15170
15171 * src/options.h (struct option_table_struct): set_flags is void*.
15172 * src/options.c (longopts): Support `--output' and `%output'.
15173 (usage): Adjust.
15174 * src/lex.h (tok_setopt): Remove, replaced with...
15175 (tok_intopt, tok_stropt): these new guys.
15176 * src/lex.c (getopt.h): Not needed.
15177 (token_buffer, unlexed_token_buffer): Not const.
15178 (percent_table): Promote `-' over `_' in directive names.
15179 Active `%name-prefix', `file-prefix', and `output'.
15180 (parse_percent_token): Accept possible arguments to directives.
15181 Promote `-' over `_' in directive names.
15182
15183 2001-11-04 Akim Demaille <akim@epita.fr>
15184
15185 * doc/bison.texinfo (Decl Summary): Split the list into
15186 `directives for grammars' and `directives for bison'.
15187 Sort'em.
15188 Add description of `%name-prefix', `file-prefix', and `output'.
15189 Promote `-' over `_' in directive names.
15190 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
15191 Simplify the description of `--name-prefix'.
15192 Promote `-' over `_' in directive names.
15193 Promote `--output' over `--output-file'.
15194 Fix the description of `--defines'.
15195 * tests/output.at: Exercise %file-prefix and %output.
15196
15197 2001-11-02 Akim Demaille <akim@epita.fr>
15198
15199 * doc/refcard.tex: Update.
15200
15201 2001-11-02 Akim Demaille <akim@epita.fr>
15202
15203 * src/symtab.h (SUNDEF): New.
15204 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
15205 stand for `uninitialized', instead of 0.
15206 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
15207 * src/lex.c (lex): Adjust.
15208
15209 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
15210 Number it 0.
15211 Let yylex return it instead of a plain 0.
15212 Reported by Dick Streefland.
15213
15214 2001-11-02 Akim Demaille <akim@epita.fr>
15215
15216 * tests/regression.at (Mixing %token styles): New test.
15217
15218 2001-11-02 Akim Demaille <akim@epita.fr>
15219
15220 * src/reader.c (parse_thong_decl): Formatting changes.
15221 (token_translations_init): New, extracted from...
15222 (packsymbols): Here.
15223 Adjust.
15224
15225 2001-11-01 Akim Demaille <akim@epita.fr>
15226
15227 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
15228 Check that `9foo.y' produces correct cpp guards.
15229 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
15230 guards.
15231 Reported by Wwp.
15232
15233 2001-11-01 Akim Demaille <akim@epita.fr>
15234
15235 * tests/regression.at (Invalid input: 2): New.
15236 * src/lex.c (unlexed_token_buffer): New.
15237 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
15238 too.
15239 Reported by Wwp.
15240
15241 2001-11-01 Akim Demaille <akim@epita.fr>
15242
15243 * tests/calc.at: Catch up with 1.30.
15244 * configure.in: Bump to 1.49a.
15245 Adjust to newer Autotest.
15246
15247 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
15248
15249 * src/conflicts.c: Move global variables rrc_total and src_total ...
15250 (print_conflicts): here.
15251 * src/output.c (output): Free global variable user_toknums.
15252 * src/lex.c (token_obstack): Become static.
15253
15254 2001-10-18 Akim Demaille <akim@epita.fr>
15255
15256 * tests/atlocal.in (GCC): Add.
15257 * tests/calc.at: s/m4_match/m4_bmatch/.
15258 s/m4_patsubst/m4_bpatsubst/.
15259 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
15260 * configure.in: AC_SUBST(GCC).
15261
15262 2001-10-14 Marc Autret <autret_m@epita.fr>
15263
15264 * src/options.c (create_long_option_table): Fix.
15265
15266 2001-10-10 Akim Demaille <akim@epita.fr>
15267
15268 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
15269
15270 2001-10-04 Akim Demaille <akim@epita.fr>
15271
15272 * src/reader.c (parse_union_decl): Push the caracters in
15273 union_obstack, not attrs_obstack.
15274
15275 2001-10-04 Akim Demaille <akim@epita.fr>
15276
15277 Merge in the branch 1.29.
15278
15279 * src/reader.c (packsymbols): Use a temporary obstack for
15280 `%%tokendef', since output_stack is already used elsewhere.
15281
15282 2001-10-02 Akim Demaille <akim@epita.fr>
15283
15284 Bump 1.29d.
15285
15286 2001-10-02 Akim Demaille <akim@epita.fr>
15287
15288 Version 1.29c.
15289
15290 2001-10-02 Akim Demaille <akim@epita.fr>
15291
15292 * tests/regression.at (Invalid CPP headers): New.
15293 From Alexander Belopolsky.
15294 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
15295
15296 2001-10-02 Akim Demaille <akim@epita.fr>
15297
15298 * tests/regression.at (Invalid input): New.
15299 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
15300 Reported by Shura.
15301
15302 2001-10-02 Akim Demaille <akim@epita.fr>
15303
15304 * tests/calc.at: Now that --debug works, the tests must be adjusted.
15305
15306 2001-10-02 Akim Demaille <akim@epita.fr>
15307
15308 * src/output.c (output_parser): Assert `skeleton'.
15309 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
15310 systems.
15311 From Shura.
15312
15313 2001-10-01 Marc Autret <autret_m@epita.fr>
15314
15315 * src/lex.h: Echo modifications.
15316 * src/lex.c (unlex): Parameter is now token_t.
15317 From Hans Aberg.
15318
15319 2001-10-01 Marc Autret <autret_m@epita.fr>
15320
15321 * src/main.c: Include lex.h.
15322 From Hans Aberg.
15323
15324 2001-09-29 Akim Demaille <akim@epita.fr>
15325
15326 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
15327
15328 2001-09-28 Akim Demaille <akim@epita.fr>
15329
15330 * tests/testsuite.at: Update to newer Autotest.
15331 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
15332
15333 2001-09-27 Akim Demaille <akim@epita.fr>
15334
15335 Position independent wrapper.
15336
15337 * tests/bison: Remove.
15338 * tests/bison.in: New.
15339 * configure.in: Adjust.
15340
15341 2001-09-27 Paul Eggert <eggert@twinsun.com>
15342
15343 Port quotearg fixes from tar 1.13.24.
15344
15345 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
15346 tm to be declared.
15347 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
15348 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
15349
15350 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
15351 * m4/mbrtowc.m4: New file.
15352 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
15353 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
15354
15355 2001-09-27 Akim Demaille <akim@epita.fr>
15356
15357 Bump to 1.29c.
15358
15359 2001-09-27 Akim Demaille <akim@epita.fr>
15360
15361 Version 1.29b.
15362
15363 2001-09-25 Akim Demaille <akim@epita.fr>
15364
15365 * src/system.h: Include `xalloc.h'.
15366 Remove it from the C files.
15367 * src/files.c (output_files): Free the obstacks.
15368 * src/lex.c (init_lex): Rename as...
15369 (lex_init): this.
15370 (lex_free): New.
15371 * src/main.c (main): Use it.
15372
15373 2001-09-24 Marc Autret <autret_m@epita.fr>
15374
15375 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
15376 to output informations in fout (FILE*).
15377 (open_graph, close_graph): Likewise.
15378 (output_graph, output_edge, output_node): Likewise.
15379 * src/vcg.h: Update function prototypes.
15380 * src/print_graph.c (print_graph): Open output graph file.
15381 (print_actions): Adjust.
15382 * src/files.h: Remove extern declaration.
15383 * src/files.c: Remove graph_obstack declaration.
15384 (open_files): Remove graph_obstack initialization.
15385 (output_files): Remove graph_obstack saving.
15386
15387 2001-09-24 Marc Autret <autret_m@epita.fr>
15388
15389 * src/files.c (compute_output_file_names): Fix.
15390
15391 2001-09-24 Marc Autret <autret_m@epita.fr>,
15392 Akim Demaille <akim@epita.fr>
15393
15394 * src/reader.c (reader): Remove call to free_symtab ().
15395 * src/main.c (main): Call it here.
15396 Include symtab.h.
15397 * src/conflicts.c (initialize_conflicts): Rename as...
15398 (solve_conflicts): this.
15399 * src/print.c (print_core, print_actions, print_state)
15400 (print_grammar): Dump to a file instead a `output_obstack'.
15401 (print_results): Dump `output_obstack', and then proceed with the
15402 FILE *.
15403 * src/files.c (compute_output_file_names, close_files): New.
15404 (output_files): Adjust.
15405 * src/main.c (main): Adjust.
15406
15407 2001-09-23 Marc Autret <autret_m@epita.fr>
15408
15409 * src/files.c (compute_header_macro): Computes header macro name
15410 from spec_defines_file when given.
15411
15412 2001-09-23 Marc Autret <autret_m@epita.fr>
15413
15414 * src/files.c (output_files): Add default extensions.
15415
15416 2001-09-22 Akim Demaille <akim@epita.fr>
15417
15418 * src/conflicts.c (finalize_conflicts): Rename as...
15419 (free_conflicts): this.
15420
15421 2001-09-22 Akim Demaille <akim@epita.fr>
15422
15423 * src/gram.c (gram_free): Rename back as...
15424 (dummy): this.
15425 (output_token_translations): Free `token_translations'.
15426 * src/symtab.c (free_symtab): Free the tag field.
15427
15428 2001-09-22 Akim Demaille <akim@epita.fr>
15429
15430 Remove `translations' as it is always set to true.
15431
15432 * src/gram.h: Adjust.
15433 * src/reader.c (packsymbols, parse_token_decl): Adjust
15434 * src/print.c (print_grammar): Adjust.
15435 * src/output.c (output_token_translations): Adjust.
15436 * src/lex.c (lex): Adjust.
15437 * src/gram.c: Be sure the set pointers to NULL.
15438 (dummy): Rename as...
15439 (gram_free): this.
15440
15441 2001-09-22 Akim Demaille <akim@epita.fr>
15442
15443 * configure.in: Invoke AM_LIB_DMALLOC.
15444 * src/system.h: Use dmalloc.
15445 * src/LR0.c: Be sure to have pointers initialized to NULL.
15446 (allocate_itemsets): Allocate kernel_items only if needed.
15447
15448 2001-09-22 Akim Demaille <akim@epita.fr>
15449
15450 * configure.in: Bump to 1.29b.
15451 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
15452 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
15453 need xmalloc.c in calc.y.
15454 From Pascal Bart.
15455
15456 2001-09-21 Akim Demaille <akim@epita.fr>
15457
15458 Version 1.29a.
15459 * Makefile.maint, config/config.guess, config/config.sub,
15460 * config/missing: Update from masters.
15461 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
15462 upon package.m4.
15463 * configure.in (ALL_LINGUAS): Add `tr'.
15464
15465 2001-09-21 Akim Demaille <akim@epita.fr>
15466
15467 * tests/Makefile.am (package.m4): Move to...
15468 ($(srcdir)/$(TESTSUITE)): here.
15469
15470 2001-09-20 Akim Demaille <akim@epita.fr>
15471
15472 * src/complain.c: No longer try to be standalone: use system.h.
15473 Don't assume __STDC__ is defined to 1. Just test if it is defined.
15474 * src/complain.h: Likewise.
15475 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
15476 Remove the unused variable `n'.
15477 From Albert Chin-A-Young.
15478
15479 2001-09-18 Marc Autret <autret_m@epita.fr>
15480
15481 * doc/bison.1: Update.
15482 * doc/bison.texinfo (Bison Options): Update --defines and --graph
15483 descriptions.
15484 (Option Cross Key): Update.
15485 Add --graph.
15486
15487 2001-09-18 Marc Autret <autret_m@epita.fr>
15488
15489 * tests/regression.at: New test (comment in %union).
15490
15491 2001-09-18 Marc Autret <autret_m@epita.fr>
15492
15493 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
15494 do that.
15495 Reported by Keith Browne.
15496
15497 2001-09-18 Marc Autret <autret_m@epita.fr>
15498
15499 * tests/output.at: Add tests for --defines and --graph.
15500
15501 2001-09-18 Marc Autret <autret_m@epita.fr>
15502
15503 * tests/output.at: Removes tests of %{header,src}_extension features.
15504
15505 2001-09-18 Akim Demaille <akim@epita.fr>
15506
15507 * tests/Makefile.am (package.m4): New.
15508 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
15509 (_AT_CHECK_CALC_ERROR): Likewise.
15510 Factor the `, ' part of verbose error messages.
15511
15512 2001-09-18 Marc Autret <autret_m@epita.fr>
15513
15514 * src/getargs.c (longopts): Declare --defines and --graph as options
15515 with optional arguments.
15516 * src/files.h: Add extern declarations.
15517 * src/files.c (spec_graph_file, spec_defines_file): New.
15518 (output_files): Update.
15519 Remove CPP-outed code.
15520
15521 2001-09-18 Marc Autret <autret_m@epita.fr>
15522
15523 Turn off %{source,header}_extension feature.
15524
15525 * src/files.c (compute_exts_from_gf): Update.
15526 (compute_exts_from_src): Update.
15527 (output_files): CPP-out useless code.
15528 * src/files.h: Remove {header,source}_extension extern declarations.
15529 * src/reader.c (parse_dquoted_param): CPP-out.
15530 (parse_header_extension_decl): Remove.
15531 (parse_source_extension_decl): Remove.
15532 (read_declarations): Remove cases tok_{hdrext,srcext}.
15533 * src/lex.c (percent_table): Remove {header,source}_extension entries.
15534 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
15535
15536 2001-09-10 Akim Demaille <akim@epita.fr>
15537
15538 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
15539 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
15540 (AT_CHECK_OUTPUT): this.
15541 Merely check ls' exit status, its output is useless.
15542
15543 2001-09-10 Akim Demaille <akim@epita.fr>
15544
15545 * tests/calc.at: Use m4_match.
15546 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
15547
15548 2001-09-10 Marc Autret <autret_m@epita.fr>,
15549 Akim Demaille <akim@epita.fr>
15550
15551 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
15552 enum color_e.
15553 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
15554 to `normal'.
15555 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
15556 * src/lex.h: Adjust prototype.
15557 (token_t): Add `tok_undef'.
15558 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
15559 (parse_percent_token): Now returns token_t.
15560 Add default statement in switch.
15561 (lex): Separate `c' as an input variable, from the token_t result
15562 part.
15563 (unlexed): Is a token_t.
15564
15565 2001-09-10 Akim Demaille <akim@epita.fr>
15566
15567 * configure.in: Bump to 1.29a.
15568
15569 2001-09-07 Akim Demaille <akim@epita.fr>
15570
15571 Version 1.29.
15572
15573 2001-08-30 Akim Demaille <akim@epita.fr>
15574
15575 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
15576 * m4/atconfig.m4: Remove.
15577 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
15578 * tests/bison: New.
15579 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
15580 m4_if, m4_patsubst, and m4_regexp.
15581 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
15582 `input' file instead of echo.
15583
15584 2001-08-29 Akim Demaille <akim@epita.fr>
15585
15586 Bump to 1.28e.
15587
15588 2001-08-29 Akim Demaille <akim@epita.fr>
15589
15590 Version 1.28d.
15591
15592 2001-08-29 Paul Eggert <eggert@twinsun.com>
15593
15594 * src/bison.simple (yyparse): Don't take the address of an
15595 item before the start of an array, as that doesn't conform to
15596 the C Standard.
15597
15598 2001-08-29 Robert Anisko <anisko_r@epita.fr>
15599
15600 * doc/bison.texinfo (Location Tracking Calc): New node.
15601
15602 2001-08-29 Paul Eggert <eggert@twinsun.com>
15603
15604 * src/output.c (output): Do not define const, as this now
15605 causes more problems than it cures.
15606
15607 2001-08-29 Akim Demaille <akim@epita.fr>
15608
15609 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
15610 the nodes.
15611 Be sure to tag the `detailmenu'.
15612
15613 2001-08-29 Akim Demaille <akim@epita.fr>
15614
15615 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
15616 download in a tmp dir.
15617
15618 2001-08-28 Marc Autret <autret_m@epita.fr>
15619
15620 * config/depcomp: New file.
15621
15622 2001-08-28 Marc Autret <autret_m@epita.fr>
15623
15624 * doc/bison.1 (mandoc): Adjust.
15625 From Juan Manuel Guerrero.
15626
15627 2001-08-28 Marc Autret <autret_m@epita.fr>
15628
15629 * src/print_graph.c (print_state): Fix.
15630
15631 2001-08-27 Marc Autret <autret_m@epita.fr>
15632
15633 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
15634 char * members.
15635 Echo modifications to the functions prototypes.
15636 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
15637
15638 2001-08-27 Marc Autret <autret_m@epita.fr>
15639
15640 * src/vcg.c: Include `xalloc.h'.
15641 (add_colorentry): New.
15642 (add_classname): New.
15643 (add_infoname): New.
15644 * src/vcg.h: Add new prototypes.
15645
15646 2001-08-27 Akim Demaille <akim@epita.fr>
15647
15648 * Makefile.maint: Sync. again with CVS Autoconf.
15649
15650 2001-08-27 Akim Demaille <akim@epita.fr>
15651
15652 * Makefile.maint: Formatting changes.
15653 (po-update, cvs-update, update): New targets.
15654 (AMTAR): Remove.
15655
15656 2001-08-27 Akim Demaille <akim@epita.fr>
15657
15658 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15659 * Makefile.maint: Sync. with CVS Autoconf.
15660
15661 2001-08-27 Marc Autret <autret_m@epita.fr>
15662
15663 * src/vcg.h (struct infoname_s): New.
15664 (struct colorentry_s): New.
15665 (graph_s): New fields {vertical,horizontal}_order in structure.
15666 Add `infoname' field.
15667 Add `colorentry' field;
15668 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
15669 (G_HORIZONTAL_ORDER): New.
15670 (G_INFONAME): New.
15671 (G_COLORENTRY): New.
15672 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
15673 Add output of `infoname'.
15674 Add output of `colorentry'.
15675
15676 2001-08-27 Marc Autret <autret_m@epita.fr>
15677
15678 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
15679 This one shadowed a global parameter.
15680
15681 2001-08-24 Marc Autret <autret_m@epita.fr>
15682
15683 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
15684 instead of `unsigned'.
15685 (print_state): Do not call obstack_object_size () in obstack_grow ()
15686 to avoid macro variables shadowing.
15687
15688 2001-08-23 Marc Autret <autret_m@epita.fr>
15689
15690 * src/lex.c (percent_table): Typo: s/naem/name/.
15691 Add graph option.
15692 Normalize new options declarations.
15693
15694 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
15695
15696 * tests/suite.at: Exercise %header_extension and %source_extension.
15697
15698 2001-08-16 Marc Autret <autret_m@epita.fr>
15699
15700 * src/reader.c (parse_dquoted_param): New.
15701 (parse_header_extension_decl): Use it.
15702 (parse_source_extension_decl): Likewise.
15703
15704 2001-08-16 Marc Autret <autret_m@epita.fr>
15705
15706 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
15707 (get_xxxx_str): Use assert () instead of complain ().
15708 Remove return invokations in default cases.
15709 (get_decision_str): Modify default behaviour. Remove second argument.
15710 Echo modifications on calls.
15711 (output_graph): Fix.
15712
15713 2001-08-16 Marc Autret <autret_m@epita.fr>
15714
15715 * src/getargs.c (usage): Update with ``-g, --graph''.
15716
15717 2001-08-16 Marc Autret <autret_m@epita.fr>
15718
15719 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
15720 (Option Cross Key): Likewise.
15721 * doc/bison.1: Update.
15722
15723 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
15724
15725 * src/output.c (output_master_parser): Don't finish action_obstack.
15726 (output_parser): Don't care about the muscle action, here.
15727 (prepare): Copy the action_obstack in the action muscle.
15728 (output): Free action_obstack.
15729
15730 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
15731
15732 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
15733 will contain `%union' declaration.
15734 (parse_union_decl): Delete #line directive output.
15735 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
15736 informations about %union.
15737 (parse_union_decl): Copy the union_obstack in the muscle stype.
15738 * src/bison.simple: Add new #line directive.
15739 Add typdef %%stype YYSTYPE.
15740
15741 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
15742
15743 * src/bison.simple: Add new `#line' directive.
15744
15745 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
15746
15747 * src/bison.simple: New `#line' directive.
15748 * src/output.c (output_parser): Support new dynamic muscle input_line.
15749
15750 2001-09-22 Marc Autret <autret_m@epita.fr>
15751
15752 * src/output.c (output_master_parser): New.
15753 (output_parser): Be more re-entrant.
15754
15755 2001-09-21 Marc Autret <autret_m@epita.fr>
15756
15757 * src/reader.c (copy_definition, parse_union_decl): Update and use
15758 `linef' muscle.
15759 (copy_action): Likewise.
15760 Use obstack_1grow ().
15761 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
15762
15763 2001-09-21 Marc Autret <autret_m@epita.fr>
15764
15765 * src/options.c (option_table): Adjust.
15766 * src/lex.c (parse_percent_token): Fix.
15767
15768 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
15769
15770 * src/options.c (symtab.h): Include it, need by lex.h.
15771
15772 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
15773
15774 * src/lex.c (parse_percent_token): Change type of variable `tx', which
15775 is now an option_table_struct*.
15776 (option_strcmp): New function option_strcmp.
15777 (parse_percent_token): Call option_strcmp.
15778 * src/getargs.c (xalloc.h, options.h): Include it.
15779 (getargs): Call create_long_option_table.
15780 (getargs): Free longopts at the end of the function.
15781 (shortopts): Move in options.c.
15782 * src/options.c (create_long_option_table): New function. Convert
15783 information from option_table to option structure.
15784 * src/reader.c (options.h): Include it.
15785
15786 * src/Makefile.am: Adjust.
15787 * src/options.c (option_table): Create from longopts and percent_table.
15788 * src/getargs.c (longopts): Delete.
15789 * src/lex.c (struct percent_table_struct): Delete.
15790 (percent_table): Delete.
15791 (options.h): Include it.
15792 * src/options.c: Create.
15793 * src/options.h: Create.
15794 Declare enum opt_access_e.
15795 Define struct option_table_struct.
15796
15797 2001-09-20 Marc Autret <autret_m@epita.fr>
15798
15799 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
15800 sections of Bison.
15801
15802 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
15803
15804 * src/bison.simple: s/%%filename/%%skeleton.
15805 * src/muscle_tab.c (getargs.h): Include it.
15806 (muscle_init): Insert new muscle skeleton.
15807
15808 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
15809
15810 * src/output.c (output_parser): Delete unused variable actions_dumped.
15811
15812 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
15813
15814 * src/output.c (output): Delete call to reader_output_yylsp.
15815 * src/reader.c (reader): Likewise.
15816 * src/reader.h: Delete declaration of reader_output_yylsp.
15817
15818 2001-09-02 Marc Autret <autret_m@epita.fr>
15819
15820 * src/reader.c: Include muscle_tab.h.
15821 (parse_union_decl): Update.
15822 (parse_macro_decl): Rename parse_muscle_decl.
15823 Update to use renamed functions and variable.
15824 (read_declarations, copy_action, read_additionnal_code, : Updated
15825 with correct variables and functions names.
15826 (packsymbols, reader): Likewise.
15827
15828 * src/reader.h (muscle_obstack): Extern declaration update.
15829
15830 * src/output.c: Include muscle_tab.h
15831 In all functions using macro_insert, change by using muscle_insert ().
15832 (macro_obstack): Rename muscle_obstack.
15833 Echo modifications in the whole file.
15834 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
15835 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
15836 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
15837
15838 * src/muscle_tab.h: Update double inclusion macros.
15839 (macro_entry_s): Rename muscle_entry_s.
15840 Update prototypes.
15841
15842 * src/muscle_tab.c: Include muscle_tab.h.
15843 Rename macro_tabble to muscle_table.
15844 (mhash1, mhash2, mcmp): Use muscle_entry.
15845 (macro_init): Rename muscle_init. Update.
15846 (macro_insert): Rename muscle_insert. Update.
15847 (macro_find): Rename muscle_find. Update.
15848
15849 * src/main.c: Include muscle_tab.h.
15850 (main): Call muscle_init ().
15851 * src/Makefile.am (bison_SOURCES): Echo modifications.
15852
15853 2001-09-02 Marc Autret <autret_m@epita.fr>
15854
15855 Now the files macro_tab.[ch] are named muscle_tab.[ch].
15856
15857 * src/muscle_tab.c, src/muscle_tab.h: Add files.
15858
15859 2001-09-02 Marc Autret <autret_m@epita.fr>
15860
15861 * src/macrotab.c, src/macrotab.h: Remove.
15862
15863 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
15864
15865 * src/reader.c (copy_guard): Use muscle to specify the `#line'
15866 filename.
15867
15868 2001-09-01 Marc Autret <autret_m@epita.fr>
15869
15870 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
15871 to an explicit value to activate the feature. We do it here.
15872
15873 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15874
15875 * src/output.c (prepare): Delete the `filename' muscule insertion.
15876 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
15877 (parse_union_decl): Likewise.
15878 * src/macrotab.c (macro_init): Initialize filename by infile.
15879
15880 2001-08-31 Marc Autret <autret_m@epita.fr>
15881
15882 * src/bison.simple (YYLSP_NEEDED): New definition.
15883 * src/output.c (prepare): Add macro insertion of `locations_flag'
15884
15885 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15886
15887 * src/output.c (prepare): Delete insertion of previous muscles,
15888 and insert the `prefix' muscles.
15889 * src/macrotab.c (macro_init): Likewise.
15890 (macro_init): Initialization prefix directive by `yy'.
15891 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
15892 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
15893 yylval, yydebug, yyerror, yynerrs and yyparse.
15894 New directive `#define' to substitute yydebug, ... with option
15895 name_prefix.
15896
15897 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15898
15899 * src/main.c (main): Standardize.
15900 * src/output.c (output_table_data, output_parser): Likewise.
15901 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
15902
15903 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
15904
15905 * src/reader.c (read_additionnal_code): Rename %%user_code to
15906 %%epilogue.
15907 * src/output.c (output): Rename %%declarations to %%prologue.
15908 * src/bison.simple: Echo modifications.
15909
15910 2001-08-31 Marc Autret <autret_m@epita.fr>
15911
15912 * src/reader.c (readgram): CleanUp.
15913 (output_token_defines): Likewise.
15914 (packsymbols): Likewise.
15915 (reader): Likewise.
15916 * src/output.c (output): CPP-out useless code.
15917
15918 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
15919
15920 * src/reader.c (reader): Delete obsolete call to function
15921 output_trailers and output_headers.
15922 * src/output.h: Remove obsolete functions prototypes of output_headers
15923 and output_trailers.
15924
15925 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
15926
15927 * src/main.c: Include macrotab.h.
15928 * src/macrotab.h (macro_entry_s): Constify fields.
15929 Adjust functions prototypes.
15930 * src/macrotab.c (macro_insert): Constify key and value.
15931 (macro_find): Constify key.
15932 (macro_insert): Include 'xalloc.h'
15933 (macro_insert): Use XMALLOC.
15934 (macro_find): Constify return value.
15935 * src/output.c (output_table_data): Rename table to table_data.
15936 (output_parser): Constify macro_key, macro_value.
15937
15938 2001-08-30 Marc Autret <autret_m@epita.fr>
15939
15940 * src/reader.c (parse_skel_decl): New.
15941 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
15942 * src/lex.h (token_t): New token `tok_skel'.
15943 * src/lex.c (percent_table): Add skeleton option entry.
15944 Standardize.
15945
15946 2001-08-29 Marc Autret <autret_m@epita.fr>
15947
15948 * src/bison.simple: Add %%user_code directive at the end.
15949 * src/reader.c (read_additionnal_code): New.
15950 (reader): Use it.
15951 * src/output.c (output_program): Remove.
15952 (output): Update.
15953
15954 2001-08-28 Marc Autret <autret_m@epita.fr>
15955
15956 * src/output.c (output_actions): Clean up.
15957 (output_gram): CPP-out useless code.
15958 * src/reader.c (reader): Clean up, CPP-out useless code.
15959
15960 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
15961
15962 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
15963 directive.
15964 * src/bison.simple: Add `%%definitions'.
15965
15966 2001-08-28 Marc Autret <autret_m@epita.fr>
15967
15968 * config/depcomp: New file.
15969
15970 2001-08-27 Paul Eggert <eggert@twinsun.com>
15971
15972 * src/bison.simple (yyparse): Don't take the address of an
15973 item before the start of an array, as that doesn't conform to
15974 the C Standard.
15975
15976 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
15977
15978 * src/output.c (output): Remove the initialization of the macro
15979 obstack. It was done too late here.
15980
15981 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
15982 completely wrong.
15983 (reader): Initialize the macro obstack here, since we need it to grow
15984 '%define' directives.
15985
15986 * src/reader.h: Declare the macro obstack as extern.
15987
15988 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
15989
15990 * src/output.c (output_parser): Fix. Store single '%' characters in
15991 the output obstack instead of throwing them away.
15992
15993 2001-08-27 Akim Demaille <akim@epita.fr>
15994
15995 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15996
15997 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
15998
15999 * lib/Makefile.am: Adjust.
16000
16001 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16002
16003 * src/bison.simple: Update and add '%%' directives.
16004
16005 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16006
16007 * src/reader.c (reader): Remove calls to 'output_headers' and
16008 'output_trailers'. Remove some C output.
16009 (readgram): Disable a piece of code that was writing a default
16010 definition for 'YYSTYPE'.
16011 (reader_output_yylsp): Remove.
16012 (packsymbols): Output token defintions to a macro.
16013 (copy_definition): Disable C output.
16014
16015 * src/reader.c (parse_macro_decl): New function used to parse macro
16016 declarations.
16017 (copy_string2): Put the body of copy_string into this new function.
16018 Add a parameter to let the caller choose whether he wants to copy the
16019 string delimiters or not.
16020 (copy_string): Be a simple call to copy_string2 with the last argument
16021 bound to true.
16022 (read_declarations): Add case for macro definition.
16023 (copy_identifier): New.
16024 (parse_macro_decl): Read macro identifiers using copy_identifier
16025 rather than lex.
16026
16027 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16028
16029 * src/output.c (prepare): Add prefixed names.
16030 (output_parser): Output semantic actions.
16031 (output_parser): Fix bug on '%%line' directives.
16032
16033 * src/output.c (output_headers): Remove. The C code printed by this
16034 function should now be in the skeletons.
16035 (output_trailers): Remove.
16036 (output): Disable call to 'reader_output_yylsp'.
16037 (output_rule_data): Do not output tables to the table obstack.
16038
16039 * src/output.c: Remove some C dedicated output.
16040 Improve the use of macro and output obstacks.
16041 (output_defines): Remove.
16042
16043 * src/output.c (output_token_translations): Associate 'translate'
16044 table with a macro. No output to the table obstack.
16045 (output_gram): Same for 'rhs' and 'prhs'.
16046 (output_stos): Same for 'stos'.
16047 (output_rule_data): Same for 'r1' and 'r2'.
16048 (token_actions): Same for 'defact'.
16049 (goto_actions): Same for 'defgoto'.
16050 (output_base): Same for 'pact' and 'pgoto'.
16051 (output_table): Same for 'table'.
16052 (output_check): Same for 'check'.
16053
16054 * src/output.c (output_table_data): New function.
16055 (output_short_table): Remove.
16056 (output_short_or_char_table): Remove.
16057
16058 * src/output.c (output_parser): Replace most of the skeleton copy code
16059 with something new. Skeletons are now processed character by character
16060 rather than line by line, and Bison looks for '%%' macros. This is the
16061 first step in making Bison's output process (a lot) more flexible.
16062 (output_parser): Use the macro table.
16063
16064 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16065
16066 * src/main.c (main): Initialize the macro table.
16067
16068 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16069
16070 * src/lex.c (percent_table): Add tok_define.
16071 * src/lex.h: Add tok_define.
16072
16073 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16074
16075 * src/macrotab.c: New file.
16076 * src/macrotab.h: New file.
16077 * src/Makefile.am: Update.
16078
16079 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16080
16081 * lib/hash.c: New file.
16082 * lib/hash.h: New file.
16083 * lib/Makefile.am: Update.
16084
16085 2001-08-15 Akim Demaille <akim@epita.fr>
16086
16087 Version 1.28c.
16088
16089 2001-08-15 Marc Autret <autret_m@epita.fr>
16090
16091 * src/reader.c (readgram): Indent output macro YYSTYPE.
16092 (packsymbols): Likewise.
16093 (output_token_defines): Likewise.
16094 * src/files.c: Standardize.
16095 (compute_header_macro): New.
16096 (defines_obstack_save): New. Use compute_header_macro.
16097 (output_files): Update. Use defines_obstack_save.
16098
16099 2001-08-15 Akim Demaille <akim@epita.fr>
16100
16101 * doc/bison.texinfo (Table of Symbols): Document
16102 YYSTACK_USE_ALLOCA.
16103
16104 2001-08-15 Akim Demaille <akim@epita.fr>
16105
16106 * missing: Update from CVS Automake.
16107 * config/config.guess, config/config.sub, config/texinfo.tex:
16108 Update from gnu.org.
16109
16110 2001-08-15 Akim Demaille <akim@epita.fr>
16111
16112 * Makefile.maint: Sync with CVS Autoconf.
16113
16114 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
16115
16116 * doc/bison.texinfo: Include GNU Free Documentation License from
16117 `fdl.texi'.
16118 * doc/fdl.texi: Add to package.
16119
16120 2001-08-14 Marc Autret <autret_m@epita.fr>
16121
16122 Turn on %{source,header}_extension features.
16123
16124 * src/lex.c (percent_table): Un-CPP out header_extension and
16125 source_extension.
16126 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
16127 (compute_exts_from_src): Remove conditions. It restores priorities
16128 between options.
16129
16130 2001-08-14 Marc Autret <autret_m@epita.fr>
16131
16132 * src/files.c (compute_base_names): Add extensions computing when
16133 `--file-prefix' used.
16134 Standardize function calls.
16135
16136 2001-08-13 Marc Autret <autret_m@epita.fr>
16137
16138 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
16139 defining it (defined but null disables alloca).
16140
16141 2001-08-13 Marc Autret <autret_m@epita.fr>
16142
16143 * src/bison.simple (_yy_memcpy): CPP reformat.
16144
16145 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
16146
16147 * tests/atconfig.in (CPPFLAGS): Fix.
16148
16149 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
16150
16151 * doc/bison.texinfo: Include GNU General Public License from
16152 `gpl.texi'.
16153 * doc/gpl.texi: Add to package.
16154
16155 2001-08-10 Marc Autret <autret_m@epita.fr>
16156
16157 * src/print_graph.h: Fix.
16158 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
16159
16160 2001-08-10 Akim Demaille <akim@epita.fr>
16161
16162 * src/system.h: Provide default declarations for stpcpy, strndup,
16163 and strnlen.
16164
16165 2001-08-10 Robert Anisko <anisko_r@epita.fr>
16166
16167 * doc/bison.texinfo (Locations): Update @$ stuff.
16168
16169 2001-08-09 Robert Anisko <anisko_r@epita.fr>
16170
16171 * src/bison.simple (YYLLOC_DEFAULT): Update.
16172 (yyparse): Adjust.
16173
16174 2001-08-08 Marc Autret <autret_m@epita.fr>
16175
16176 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
16177 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
16178 Reported by Fabrice Bauzac.
16179
16180 2001-08-08 Marc Autret <autret_m@epita.fr>
16181
16182 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
16183 * src/vcg.c (output_node): Fix.
16184 * src/vcg.h: Cleanup.
16185 * src/print_graph.c: Add comments.
16186 (node_output_size): New global variable. Simplify the formatting of
16187 the VCG graph output.
16188 (print_actions): Unused code is now used. It notifies the final state
16189 and no action states in the VCG graph. It also give the reduce actions.
16190 The `shift and goto' edges are red and the `go to state' edges are
16191 blue.
16192 Get the current node name and node_obstack by argument.
16193 (node_obstack): New variable.
16194 (print_state): Manage node_obstack.
16195 (print_core): Use node_obstack given by argument.
16196 A node is not only computed here but in print_actions also.
16197 (print_graph): CPP out useless code instead of commenting it.
16198
16199 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
16200
16201 * tests/atconfig.in (CPPFLAGS): Fix.
16202
16203 2001-08-07 Akim Demaille <akim@epita.fr>
16204
16205 * src/print_graph.c (quote): New.
16206 (print_core): Use it.
16207
16208 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
16209
16210 * src/vcg.c (complain.h): Include it.
16211 Unepitaize `return' invocations.
16212 [NDEBUG] (main): Remove.
16213 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
16214 * src/files.c (open_files): Initialize graph_obstack.
16215 * src/print_graph.c (print_actions): CPP out useless code.
16216 (print_core): Don't output the last `\n' in labels.
16217 Use `quote'.
16218 * src/files.c (output_files): Output the VCG file.
16219 * src/main.c (main): Invoke print_graph ();
16220
16221 2001-08-06 Marc Autret <autret_m@epita.fr>
16222
16223 Automaton VCG graph output.
16224 Using option ``-g'' or long option ``--graph'', you can generate
16225 a gram_filename.vcg file containing a VCG description of the LALR (1)
16226 automaton of your grammar.
16227
16228 * src/main.c: Call to print_graph() function.
16229 * src/getargs.h: Update.
16230 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
16231 (graph_flag): New flag.
16232 (longopts): Update.
16233 (getargs): Add case `g'.
16234 * src/files.c (graph_obstack): New obstack struct.
16235 (open_files): Initialize new obstack.
16236 (output_files): Saves graph_obstack if required.
16237 * src/files.h (graph_obstack): New extern declaration.
16238 * src/Makefile.am: Add new source files.
16239
16240 2001-08-06 Marc Autret <autret_m@epita.fr>
16241
16242 * src/print_graph.c, src/print_graph.h (graph): New.
16243 * src/vcg.h: New file.
16244 * src/vcg.c: New file, VCG graph handling.
16245
16246 2001-08-06 Marc Autret <autret_m@epita.fr>
16247
16248 Add of %source_extension and %header_extension which specify
16249 the source or/and the header output file extension.
16250
16251 * src/files.c (compute_base_names): Remove initialisation of
16252 src_extension and header_extension.
16253 (compute_exts_from_gf): Update.
16254 (compute_exts_from_src): Update.
16255 (output_files): Update.
16256 * src/reader.c (parse_header_extension_decl): New.
16257 (parse_source_extension_decl): New.
16258 (read_declarations): New case statements for the new tokens.
16259 * src/lex.c (percent_table): Add entries for %source_extension
16260 and %header_extension.
16261 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
16262
16263 2001-08-06 Marc Autret <autret_m@epita.fr>
16264
16265 * configure.in: Bump to 1.28c.
16266 * doc/bison.texinfo: Texinfo thingies.
16267
16268 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
16269
16270 * tests/atconfig.in (CPPFLAGS): Add.
16271 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
16272
16273 2001-08-03 Akim Demaille <akim@epita.fr>
16274
16275 Version 1.28b.
16276
16277 2001-08-03 Akim Demaille <akim@epita.fr>
16278
16279 * tests/Makefile.am (check-local): Ship testsuite.
16280 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
16281 Include `string.h'.
16282
16283 2001-08-03 Akim Demaille <akim@epita.fr>
16284
16285 * configure.in: Try using -Wformat when compiling.
16286
16287 2001-08-03 Akim Demaille <akim@epita.fr>
16288
16289 * configure.in: Bump to 1.28b.
16290
16291 2001-08-03 Akim Demaille <akim@epita.fr>
16292
16293 * src/complain.c: Adjust strerror_r portability issues.
16294
16295 2001-08-03 Akim Demaille <akim@epita.fr>
16296
16297 Version 1.28a.
16298
16299 2001-08-03 Akim Demaille <akim@epita.fr>
16300
16301 * src/getargs.c, src/getarg.h (skeleton)): Constify.
16302 * src/lex.c (literalchar): Avoid name clashes on `buf'.
16303 * src/getargs.c: Include complain.h.
16304 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
16305 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
16306
16307 2001-08-03 Akim Demaille <akim@epita.fr>
16308
16309 * src/reader.c (readgram): Display hidden chars in error messages.
16310
16311 2001-08-03 Akim Demaille <akim@epita.fr>
16312
16313 Update to gettext 0.10.39.
16314
16315 2001-08-03 Akim Demaille <akim@epita.fr>
16316
16317 * lib/strspn.c: New.
16318
16319 2001-08-01 Marc Autret <autret_m@epita.fr>
16320
16321 * doc/bison.texinfo: Update.
16322 * doc/bison.1 (mandoc): Update.
16323 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
16324 * src/files.c: Support output files extensions computing.
16325 (src_extension): New static variable.
16326 (header_extension): New static variable.
16327 (tr): New function.
16328 (get_extension_index): New function, gets the index of an extension
16329 filename in a string.
16330 (compute_exts_from_gf): New function, computes extensions from the
16331 grammar file extension.
16332 (compute_exts_from_src): New functions, computes extensions from the
16333 C source file extension, file given by ``-o'' option.
16334 (compute_base_names): Update.
16335 (output_files): Update.
16336
16337 2001-08-01 Robert Anisko <anisko_r@epita.fr>
16338
16339 * doc/bison.texi: Document @$.
16340 (Locations): New section.
16341
16342 2001-07-18 Akim Demaille <akim@epita.fr>
16343
16344 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
16345 * config/prev-version.txt, config/move-if-change: New.
16346 * Makefile.am: Adjust.
16347
16348 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
16349
16350 * src/bison.simple (yyparse): Suppress warning `comparaison
16351 between signed and unsigned'.
16352
16353 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
16354
16355 * src/getargs.h (raw_flag): Remove.
16356 * src/getargs.c: Die on `-r'/`--raw'.
16357 * src/lex.c (parse_percent_token): Die on `%raw'.
16358 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
16359 * tests/calc.at: Suppress test with option `--raw'.
16360
16361 2001-07-14 Akim Demaille <akim@epita.fr>
16362
16363 * config/: New.
16364 * configure.in: Require Autoconf 2.50.
16365 Update to gettext 0.10.38.
16366
16367 2001-03-16 Akim Demaille <akim@epita.fr>
16368
16369 * doc/bison.texinfo: ANSIfy the examples.
16370
16371 2001-03-16 Akim Demaille <akim@epita.fr>
16372
16373 * getargs.c (skeleton): New variable.
16374 (longopts): --skeleton is a new option.
16375 (shortopts, getargs): -S is a new option.
16376 * getargs.h: Declare skeleton.
16377 * output.c (output_parser): Use it.
16378
16379 2001-03-16 Akim Demaille <akim@epita.fr>
16380
16381 * m4/strerror_r.m4: New.
16382 * m4/error.m4: Run AC_FUNC_STRERROR_R.
16383 * lib/error.h, lib/error.c: Update.
16384
16385 2001-03-16 Akim Demaille <akim@epita.fr>
16386
16387 * src/getargs.c (longopts): Clean up.
16388
16389 2001-02-21 Akim Demaille <akim@epita.fr>
16390
16391 * src/reader.c (gensym): `gensym_count' is your own.
16392 Use a static buf to create the symbol name, as token_buffer is no
16393 longer a buffer.
16394
16395 2001-02-08 Akim Demaille <akim@epita.fr>
16396
16397 * src/conflicts.c (conflict_report): Be sure not to append to res
16398 between two calls, which could happen if both first sprintf were
16399 skipped, but not the first cp += strlen.
16400
16401 2001-02-08 Akim Demaille <akim@epita.fr>
16402
16403 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
16404 New, from fileutils 4.0.37.
16405 * configure.in: Require Autoconf 2.49c. I took some time before
16406 making this decision. This is the only way out for portability
16407 issues in Bison, it would mean way too much duplicate effort to
16408 import in Bison features implemented in 2.49c since 2.13.
16409 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
16410
16411 2001-02-02 Akim Demaille <akim@epita.fr>
16412
16413 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
16414 * lib/xalloc.h, lib/xmalloc.c: Update.
16415
16416 2001-01-19 Akim Demaille <akim@epita.fr>
16417
16418 Get rid of the ad hoc handling of token_buffer in the scanner: use
16419 the obstacks.
16420
16421 * src/lex.c (token_obstack): New.
16422 (init_lex): Initialize it. No longer call...
16423 (grow_token_buffer): this. Remove it.
16424 Adjust all the places which used it to use the obstack.
16425
16426 2001-01-19 Akim Demaille <akim@epita.fr>
16427
16428 * src/lex.h: Rename all the tokens:
16429 s/\bENDFILE\b/tok_eof/g;
16430 s/\bIDENTIFIER\b/tok_identifier/g;
16431 etc.
16432 Let them be enums, not #define, to ease debugging.
16433 Adjust all the code.
16434
16435 2001-01-18 Akim Demaille <akim@epita.fr>
16436
16437 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
16438 * src/lex.c (maxtoken, grow_token_buffer): Static.
16439
16440 2001-01-18 Akim Demaille <akim@epita.fr>
16441
16442 Since we now use obstacks, more % directives can be enabled.
16443
16444 * src/lex.c (percent_table): Also accept `%yacc',
16445 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
16446 `%debug'.
16447 Handle the actions for `%semantic_parser' and `%pure_parser' here,
16448 instead of returning a token.
16449 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
16450 * src/reader.c (read_declarations): Adjust.
16451 * src/files.c (open_files): Don't call `compute_base_names', don't
16452 compute `attrsfile' since they depend upon data which might be
16453 *in* the input file now.
16454 (output_files): Do it here.
16455 * src/output.c (output_headers): Document the fact that this patch
16456 introduces a guaranteed SEGV for semantic parsers.
16457 * doc/bison.texinfo: Document them.
16458 * tests/suite.at: Exercise these %options.
16459
16460 2000-12-20 Akim Demaille <akim@epita.fr>
16461
16462 Also handle the output file (--verbose) with obstacks.
16463
16464 * files.c (foutput): Remove.
16465 (output_obstack): New.
16466 Adjust all dependencies.
16467 * src/conflicts.c: Return a string.
16468 * src/system.h (obstack_grow_string): Rename as...
16469 (obstack_sgrow): this. Be ready to work with non literals.
16470 (obstack_fgrow4): New.
16471
16472 2000-12-20 Akim Demaille <akim@epita.fr>
16473
16474 * src/files.c (open_files): Fix the computation of short_base_name
16475 in the case of `-o foo.tab.c'.
16476
16477 2000-12-20 Akim Demaille <akim@epita.fr>
16478
16479 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
16480 (copy_dollar): Now that everything uses obstacks, get rid of the
16481 FILE * parameters.
16482
16483 2000-12-20 Akim Demaille <akim@epita.fr>
16484
16485 * src/files.c (open_files): Actually the `.output' file is based
16486 on the short_base_name, not base_name.
16487 * tests/suite.at (Checking output file names): Adjust.
16488
16489 2000-12-20 Akim Demaille <akim@epita.fr>
16490
16491 * src/bison.s1: Remove, we now use directly...
16492 * src/bison.simple: this.
16493 * src/Makefile.am: Use pkgdata instead of data.
16494
16495 2000-12-20 Akim Demaille <akim@epita.fr>
16496
16497 * src/files.c (guard_obstack): New.
16498 (open_files): Initialize it.
16499 (output_files): Dump it...
16500 * src/files.h: Export it.
16501 * src/reader.c (copy_guard): Use it.
16502
16503 2000-12-19 Akim Demaille <akim@epita.fr>
16504
16505 * src/files.c (outfile, defsfile, actfile): Removed as global
16506 vars.
16507 (open_files): Don't compute them.
16508 (output_files): Adjust.
16509 (base_name, short_base_name): Be global.
16510 Adjust dependencies.
16511
16512 2000-12-19 Akim Demaille <akim@epita.fr>
16513
16514 * src/files.c (strsuffix): New.
16515 (stringappend): Be just like strcat but allocate.
16516 (base_names): Eve out from open_files.
16517 Try to simplify the rather hairy computation of base_name and
16518 short_base_name.
16519 (open_files): Use it.
16520 * tests/suite.at (Checking output file names): New test.
16521
16522 2000-12-19 Akim Demaille <akim@epita.fr>
16523
16524 * src/system.h (obstack_grow_literal_string): Rename as...
16525 (obstack_grow_string): this.
16526 * src/output.c (output_parser): Recognize `%% actions' instead of
16527 `$'.
16528 * src/bison.s1: s/$/%% actions/.
16529 * src/bison.hairy: Likewise.
16530
16531 2000-12-19 Akim Demaille <akim@epita.fr>
16532
16533 * src/output.c (output_parser): Compute the `#line' lines when
16534 there are.
16535 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
16536 Suggested by Hans Aberg.
16537
16538 2000-12-19 Akim Demaille <akim@epita.fr>
16539
16540 Let the handling of the skeleton files be local to the procedures
16541 that use it.
16542
16543 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
16544 longer static.
16545 (fparser, open_extra_files): Remove.
16546 (open_files, output_files): Don't take care of fparser.
16547 * src/files.h: Adjust.
16548 * src/output.c (output_parser): Open and close the file to the
16549 skeleton.
16550 * src/reader.c (read_declarations): When %semantic_parser, open
16551 fguard.
16552
16553 2000-12-19 Akim Demaille <akim@epita.fr>
16554
16555 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
16556 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
16557
16558 2000-12-19 Akim Demaille <akim@epita.fr>
16559
16560 * src/files.c (open_files): Yipee! We no longer need all the code
16561 looking for `/tmp' since we have no tmp file.
16562
16563 2000-12-19 Akim Demaille <akim@epita.fr>
16564
16565 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
16566 New macros.
16567 * src/files.c (open_files): Less dependency on MSDOS etc.
16568
16569 2000-12-14 Akim Demaille <akim@epita.fr>
16570
16571 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
16572 Provide a default definition.
16573 Use it when executing the default @ action.
16574 * src/reader.c (reader_output_yylsp): No longer include
16575 `timestamp' and `text' in the default YYLTYPE.
16576
16577 2000-12-12 Akim Demaille <akim@epita.fr>
16578
16579 * src/reader.c (copy_definition, parse_union_decl, copy_action)
16580 (copy_guard): Quote the file names.
16581 Reported by Laurent Mascherpa.
16582
16583 2000-12-12 Akim Demaille <akim@epita.fr>
16584
16585 * src/output.c (output_headers, output_program, output): Be sure
16586 to escape special characters when outputting filenames.
16587 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
16588 (output_headers): Don't depend on them, Use ACTSTR.
16589
16590 2000-11-17 Akim Demaille <akim@epita.fr>
16591
16592 * lib/obstack.h: Formatting changes.
16593 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
16594 prevents type checking.
16595 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
16596 cast the value to (void *): assigning a `foo *' to a `void *'
16597 variable is valid.
16598 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
16599 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
16600 append characters.
16601
16602 2000-11-17 Akim Demaille <akim@epita.fr>
16603
16604 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
16605 as...
16606 (suite.m4, regression.m4, calc.m4): these.
16607 * tests/atgeneral.m4: Update from CVS Autoconf.
16608
16609 2000-11-17 Akim Demaille <akim@epita.fr>
16610
16611 * tests/regression.m4 (%union and --defines): New test,
16612 demonstrating a current bug in the obstack implementation.
16613
16614 2000-11-17 Akim Demaille <akim@epita.fr>
16615
16616 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
16617 macros.
16618 Use them to declare the variables which are global or local to
16619 `yyparse'.
16620
16621 2000-11-17 Akim Demaille <akim@epita.fr>
16622
16623 * acconfig.h: Remove, no longer used.
16624
16625 2000-11-07 Akim Demaille <akim@epita.fr>
16626
16627 * src: s/Copyright (C)/Copyright/g.
16628
16629 2000-11-07 Akim Demaille <akim@epita.fr>
16630
16631 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
16632 defining.
16633 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
16634
16635 2000-11-07 Akim Demaille <akim@epita.fr>
16636
16637 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
16638 Merge in a single CPP if/else.
16639
16640 2000-11-07 Akim Demaille <akim@epita.fr>
16641
16642 * src/output.c (output): Remove useless variables.
16643 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
16644 argument `data' for consistency with the prototypes.
16645 Qualify it `const'.
16646 (obstack_copy, obstack_copy0): Rename the second argument as
16647 `address' for consistency. Qualify it `const'.
16648 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
16649 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
16650 `const' their input argument (`data' or `address').
16651 Adjust the corresponding macros to include `const' in casts.
16652
16653 2000-11-03 Akim Demaille <akim@epita.fr>
16654
16655 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
16656 s/PFILE1/BISON_HAIRY/.
16657 Adjust dependencies.
16658
16659 2000-11-03 Akim Demaille <akim@epita.fr>
16660
16661 For some reason, this was not applied.
16662
16663 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16664 `unlink': it's no longer used.
16665
16666 2000-11-03 Akim Demaille <akim@epita.fr>
16667
16668 * src/files.c (skeleton_find): New function, eved out of...
16669 (open_files, open_extra_files): here.
16670
16671 2000-11-03 Akim Demaille <akim@epita.fr>
16672
16673 Don't use `atexit'.
16674
16675 * src/files.c (obstack_save): New function.
16676 (done): Rename as...
16677 (output_files): this.
16678 Use `obstack_save'.
16679 * src/main.c (main): Don't use `atexit' to register `done', since
16680 it no longer has to remove tmp files, just call `output_files'
16681 when there are no errors.
16682
16683 2000-11-02 Akim Demaille <akim@epita.fr>
16684
16685 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16686 `unlink': it's no longer used.
16687 * src/files.h: Formatting changes.
16688
16689 2000-11-02 Akim Demaille <akim@epita.fr>
16690
16691 Remove the last uses of mktemp and unlink/delete.
16692
16693 * src/files.c (fdefines, ftable): Removed.
16694 (defines_ostack, table_obstack): New.
16695 Adjust dependencies of the former into uses of the latter.
16696 * src/output.c (output_short_or_char_table, output_short_table):
16697 Convert to using obstacks.
16698 * src/reader.c (copy_comment2): Accept one FILE * and two
16699 obstacks.
16700 (output_token_defines, reader_output_yylsp): Use obstacks.
16701 * src/system.h (obstack_fgrow3): New.
16702 * po/POTFILES.in: Adjust.
16703
16704 2000-11-01 Akim Demaille <akim@epita.fr>
16705
16706 Change each use of `fattrs' into a use of `attrs_obstack'.
16707
16708 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
16709 * src/files.c (fattrs): Remove.
16710 (attrs_obstack): New.
16711 Adjust all dependencies.
16712 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
16713
16714 2000-11-01 Akim Demaille <akim@epita.fr>
16715
16716 Introduce obstacks.
16717 Change each use of `faction' into a use of `action_obstack'.
16718
16719 * lib/obstack.h, lib/obstack.c: New files.
16720 * src/files.c (faction): Remove.
16721 (action_obstack): New.
16722 Adjust all dependencies.
16723
16724 2000-10-20 Akim Demaille <akim@epita.fr>
16725
16726 * lib/quote.h (PARAMS): New macro. Use it.
16727
16728 2000-10-16 Akim Demaille <akim@epita.fr>
16729
16730 * src/output.c (output_short_or_char_table): New function.
16731 (output_short_table, output_token_translations): Use it.
16732 (goto_actions): Use output_short_table.
16733
16734 2000-10-16 Akim Demaille <akim@epita.fr>
16735
16736 * src/symtab.c (bucket_new): New function.
16737 (getsym): Use it.
16738
16739 * src/output.c (output_short_table): New argument to display the
16740 comment associated with the table.
16741 Adjust dependencies.
16742 (output_gram): Use it.
16743 (output_rule_data): Nicer output layout for YYTNAME.
16744
16745 2000-10-16 Akim Demaille <akim@epita.fr>
16746
16747 * src/lex.c (read_typename): New function.
16748 (lex): Use it.
16749 * src/reader.c (copy_dollar): Likewise.
16750
16751 2000-10-16 Akim Demaille <akim@epita.fr>
16752
16753 * src/reader.c (copy_comment2): Expect the input stream to be on
16754 the `/' which is suspected to open a comment, instead of being
16755 called after `//' or `/*' was read.
16756 (copy_comment, copy_definition, parse_union_decl, copy_action)
16757 (copy_guard): Adjust.
16758
16759 2000-10-16 Akim Demaille <akim@epita.fr>
16760
16761 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
16762 `read_signed_integer'.
16763
16764 2000-10-16 Akim Demaille <akim@epita.fr>
16765
16766 * src/reader.c (copy_dollar): New function.
16767 (copy_guard, copy_action): Use it.
16768
16769 2000-10-16 Akim Demaille <akim@epita.fr>
16770
16771 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
16772 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
16773 New files, from Fileutils 4.0.27.
16774 * src/main.c (printable_version): Remove.
16775 * src/lex.c, src/reader.c: Use `quote'.
16776
16777 2000-10-04 Akim Demaille <akim@epita.fr>
16778
16779 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
16780
16781 2000-10-04 Akim Demaille <akim@epita.fr>
16782
16783 * doc/bison.texinfo: Various typos spotted by Neil Booth.
16784
16785 2000-10-04 Akim Demaille <akim@epita.fr>
16786
16787 When a literal string is used to define two different tokens,
16788 `bison -v' segfaults.
16789 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
16790
16791 * tests/regression.m4: New file.
16792 Include the core of the sample provided by Piotr Gackiewicz.
16793 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
16794 properly.
16795
16796 2000-10-04 Akim Demaille <akim@epita.fr>
16797
16798 * src/reader.c (parse_expect_decl): Keep `count' within the size
16799 of `buffer'.
16800 From Neil Booth.
16801
16802 2000-10-02 Paul Eggert <eggert@twinsun.com>
16803
16804 * bison.s1 (yyparse): Assign the default value
16805 unconditionally, to avoid a GCC warning and make the parser a
16806 tad smaller.
16807
16808 2000-10-02 Akim Demaille <akim@epita.fr>
16809
16810 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
16811 options.
16812
16813 2000-10-02 Akim Demaille <akim@epita.fr>
16814
16815 * src/derives.c, src/print.c, src/reduce.c: To ease the
16816 translation, move some `\n' out of the translated strings.
16817
16818 2000-10-02 Akim Demaille <akim@epita.fr>
16819
16820 The location tracking mechanism is precious for parse error
16821 messages. Nevertheless, it is enabled only when `@n' is used in
16822 the grammar, which is a different issue (you can use it in error
16823 message, but not in the grammar per se). Therefore, there should
16824 be another means to enable it.
16825
16826 * src/getargs.c (getargs): Support `--locations'.
16827 (usage): Report it.
16828 * src/getargs.h (locationsflag): Export it.
16829 * src/lex.c (percent_table): Support `%locations'.
16830 * src/reader.c (yylsp_needed): Remove this variable, now replaced
16831 with `locationsflag'.
16832 * doc/bison.texinfo: Document `--locations' and `%locations'.
16833 Sort the options.
16834 * tests/calc.m4: Test it.
16835
16836 For regularity of the names, replace each
16837 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
16838 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
16839 In addition replace each `flag' with `_flag'.
16840
16841 2000-10-02 Akim Demaille <akim@epita.fr>
16842
16843 Also test parse error messages, including with YYERROR_VERBOSE.
16844
16845 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
16846 associative).
16847 Use it to check the computations.
16848 Use it to check `nonassoc' is honored.
16849 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
16850 `--yyerror-verbose'.
16851 (_AT_CHECK_CALC): Adjust to this option.
16852 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
16853
16854 2000-10-02 Akim Demaille <akim@epita.fr>
16855
16856 Test also `--verbose', `--defines' and `--name-prefix'. Testing
16857 the latter demonstrates a flaw in the handling of non debugging
16858 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
16859 was used in order to simplify:
16860
16861 #if YYDEBUG
16862 if (yydebug)
16863 {
16864 ...
16865 }
16866 #endif
16867
16868 into
16869
16870 if (yydebug)
16871 {
16872 ...
16873 }
16874
16875 unfortunately this leads to a CPP conflict when
16876 `--name-prefix=foo' is used since it produces `#define yydebug
16877 foodebug'.
16878
16879 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
16880 (YYDPRINTF): New macro.
16881 Spread its use.
16882 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
16883 the bison options.
16884 Also test `--verbose', `--defines' and `--name-prefix'.
16885
16886 2000-10-02 Akim Demaille <akim@epita.fr>
16887
16888 Improve the readability of the produced parsers.
16889
16890 * src/bison.s1: Formatting changes.
16891 Improve the comment related to the `$' mark.
16892 (yydefault): Don't fall through to `yyresume': `goto' there.
16893 * src/output.c (output_parser): When the `$' is met, skip the end
16894 of its line.
16895 New variable, `number_of_dollar_signs', to check there's exactly
16896 one `$' in the parser skeleton.
16897
16898 2000-10-02 Akim Demaille <akim@epita.fr>
16899
16900 * lib/xstrdup.c: New file, from the fileutils.
16901 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
16902 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
16903 instead of strlen + xmalloc + strcpy.
16904 * src/symtab.c (copys): Remove, use xstrdup instead.
16905
16906 2000-10-02 Akim Demaille <akim@epita.fr>
16907
16908 * src/gram.h (associativity): New enum type which replaces the
16909 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
16910 `right_assoc', `left_assoc' and `non_assoc'.
16911 Adjust all dependencies.
16912 * src/reader.c: Formatting changes.
16913 (LTYPESTR): Don't define it, use it as a literal in
16914 `reader_output_yylsp'.
16915 * src/symtab.h (symbol_class): New enum type which replaces the
16916 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
16917 `sunknown', `stoken and `snterm'.
16918
16919 2000-10-02 Akim Demaille <akim@epita.fr>
16920
16921 * src/getargs.c (fixed_outfiles): Rename as...
16922 (yaccflag): for consistency and accuracy.
16923 Adjust dependencies.
16924
16925 2000-10-02 Akim Demaille <akim@epita.fr>
16926
16927 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
16928 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
16929 difficult and introduced a lot of core dump. It turns out that
16930 Bison used an implementation of `xmalloc' based on `calloc', and
16931 at various places it does depend upon the initialization to 0. I
16932 have not tried to isolate the pertinent places, and all the former
16933 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
16934 someone should address this issue.
16935
16936 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
16937 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
16938 files.
16939 Adjust dependencies.
16940 * src/warshall.h: New file.
16941 Propagate.
16942
16943 2000-10-02 Akim Demaille <akim@epita.fr>
16944
16945 Various anti-`extern in *.c' changes.
16946
16947 * src/system.h: Include `assert.h'.
16948
16949 2000-10-02 Akim Demaille <akim@epita.fr>
16950
16951 * src/state.h (nstates, final_state, first_state, first_shift)
16952 (first_reduction): Move their exportation from here...
16953 * src/LR0.h: to here.
16954 Adjust dependencies.
16955 * src/getargs.c (statisticsflag): New variable.
16956 Add support for `--statistics'.
16957 Adjust dependencies.
16958
16959 Remove a lot of now useless `extern' statements in most files.
16960
16961 2000-10-02 Akim Demaille <akim@epita.fr>
16962
16963 * src/LR0.h: New file.
16964 Propagate its use.
16965
16966 2000-10-02 Akim Demaille <akim@epita.fr>
16967
16968 * src/print.h: New file.
16969 Propagate its use.
16970 * src/print.c: Formatting and ordering changes.
16971 (verbose, terse): Replace with...
16972 (print_results): this new function.
16973 Adjust dependencies.
16974
16975 2000-10-02 Akim Demaille <akim@epita.fr>
16976
16977 * src/conflicts.c (conflict_report): New function.
16978 (conflict_log, verbose_conflict_log): Replace with...
16979 (print_conflicts): this function.
16980 Adjust dependencies.
16981 * src/conflicts.h: New file.
16982 Propagate its inclusion.
16983
16984 2000-10-02 Akim Demaille <akim@epita.fr>
16985
16986 * src/nullable.h: New file.
16987 Propagate its inclusion.
16988 * src/nullable.c: Formatting changes.
16989
16990 2000-10-02 Akim Demaille <akim@epita.fr>
16991
16992 * src/reduce.h: New file.
16993 Propagate its inclusion.
16994 * src/reduce.c: Topological sort and other formatting changes.
16995 (bool, TRUE, FALSE): Move their definition to...
16996 * src/system.h: here.
16997
16998 2000-10-02 Akim Demaille <akim@epita.fr>
16999
17000 * src/files.c: Formatting changes.
17001 (tryopen, tryclose, openfiles): Rename as...
17002 (xfopen, xfclose, open_files): this.
17003 (stringappend): static.
17004 * src/files.h: Complete the list of exported symbols.
17005 Propagate its use.
17006
17007 2000-10-02 Akim Demaille <akim@epita.fr>
17008
17009 * src/reader.h: New file.
17010 Propagate its use instead of tedious list of `extern' and
17011 prototypes.
17012 * src/reader.c: Formatting changes, topological sort,
17013 s/register//.
17014
17015 2000-10-02 Akim Demaille <akim@epita.fr>
17016
17017 * src/lex.h: Prototype `lex.c' exported functions.
17018 * src/reader.c: Adjust.
17019 * src/lex.c: Formatting changes.
17020 (safegetc): Rename as...
17021 (xgetc): this.
17022
17023 2000-10-02 Akim Demaille <akim@epita.fr>
17024
17025 * src/lalr.h: New file.
17026 Propagate its inclusion instead of prototypes and `extern'.
17027 * src/lalr.c: Formatting changes, topological sorting etc.
17028
17029 2000-10-02 Akim Demaille <akim@epita.fr>
17030
17031 * src/output.c (token_actions): Introduce a temporary array,
17032 YYDEFACT, that makes it possible for this function to use
17033 output_short_table.
17034
17035 2000-10-02 Akim Demaille <akim@epita.fr>
17036
17037 `user_toknums' is output as a `short[]' in `output.c', while it is
17038 defined as a `int[]' in `reader.c'. For consistency with the
17039 other output tables, `user_toknums' is now defined as a table of
17040 shorts.
17041
17042 * src/reader.c (user_toknums): Be a short table instead of an int
17043 table.
17044 Adjust dependencies.
17045
17046 Factor the short table outputs.
17047
17048 * src/output.c (output_short_table): New function.
17049 * src/output.c (output_gram, output_stos, output_rule_data)
17050 (output_base, output_table, output_check): Use it.
17051
17052 2000-10-02 Akim Demaille <akim@epita.fr>
17053
17054 * src/output.c (output): Topological sort of the functions, in
17055 order to get rid of the `static' prototypes.
17056 No longer use `register'.
17057 * src/output.h: New file.
17058 Propagate its inclusion in files explicitly prototyping functions
17059 from output.c.
17060
17061 2000-09-21 Akim Demaille <akim@epita.fr>
17062
17063 * src/atgeneral.m4: Update from Autoconf.
17064
17065 2000-09-21 Akim Demaille <akim@epita.fr>
17066
17067 * src/closure.h: New file.
17068 * src/closure.c: Formatting changes, topological sort over the
17069 functions, use of closure.h.
17070 (initialize_closure, finalize_closure): Rename as...
17071 (new_closure, free_closure): these. Adjust dependencies.
17072 * src/LR0.c: Formatting changes, topological sort, use of
17073 cloture.h.
17074 (initialize_states): Rename as...
17075 (new_states): this.
17076 * src/Makefile.am (noinst_HEADERS): Adjust.
17077
17078 2000-09-20 Akim Demaille <akim@epita.fr>
17079
17080 * src/acconfig.h: Don't protect config.h against multiple
17081 inclusion.
17082 Don't define PARAMS.
17083 * src/system.h: Define PARAMS.
17084 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
17085 purpose of config.h. system.h must not try to fix wrong
17086 definitions in config.h.
17087
17088 2000-09-20 Akim Demaille <akim@epita.fr>
17089
17090 * src/derives.h: New file.
17091 * src/main.c, src/derives.h: Use it.
17092 Formatting changes.
17093 * src/Makefile.am (noinst_HEADERS): Adjust.
17094
17095 2000-09-20 Akim Demaille <akim@epita.fr>
17096
17097 * tests/atgeneral.m4: Update from Autoconf.
17098 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
17099 (AT_CHECK_CALC): New macros.
17100 Use these macros to test bison with options `', `--raw',
17101 `--debug', `--yacc', `--yacc --debug'.
17102
17103 2000-09-19 Akim Demaille <akim@epita.fr>
17104
17105 * src/output.c: Formatting changes.
17106 * src/machine.h: Remove, leaving its contents in...
17107 * src/system.h: here.
17108 Include stdio.h.
17109 Adjust all dependencies on stdio.h and machine.h.
17110 * src/getargs.h: New file.
17111 Let all `extern' declarations about getargs.c be replaced with
17112 inclusion of `getargs.h'.
17113 * src/Makefile.am (noinst_HEADERS): Adjust.
17114
17115 * tests/calc.m4 (yyin): Be initialized in main, not on the global
17116 scope.
17117 (yyerror): Returns void, not int.
17118 * doc/bison.texinfo: Formatting changes.
17119
17120 2000-09-19 Akim Demaille <akim@epita.fr>
17121
17122 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
17123 portable.
17124
17125 2000-09-18 Akim Demaille <akim@epita.fr>
17126
17127 * configure.in: Append WARNING_CFLAGS to CFLAGS.
17128 * src/Makefile.am (INCLUDES): Don't.
17129 Be ready to fetch headers in lib/.
17130
17131 2000-09-18 Akim Demaille <akim@epita.fr>
17132
17133 * doc/bison.texinfo: Update the copyright.
17134 ANSIfy and GNUify the examples.
17135 Remove the old menu.
17136
17137 2000-09-18 Akim Demaille <akim@epita.fr>
17138
17139 First set of tests: use the `calc' example from the documentation.
17140
17141 * src/bison.s1 (yyparse): Condition the code using `yytname' which
17142 is defined only when YYDEBUG is.
17143 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
17144 * src/files.c (tryopen, tryclose): Formatting changes.
17145 Move to the top and be static.
17146 * src/reader.c (read_signed_integer): Likewise.
17147 * tests/calc.m4: New file.
17148 * Makefile.am, suite.m4: Adjust.
17149 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
17150
17151 2000-09-18 Akim Demaille <akim@epita.fr>
17152
17153 Add support for an Autotest test suite for Bison.
17154
17155 * m4/m4.m4, m4/atconfig.m4: New files.
17156 * m4/Makefile.am (EXTRA_DIST): Adjust.
17157 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
17158 files.
17159 * src/getargs.c: Display a more standard --version message.
17160 * src/reader.c (reader): Formatting changes.
17161 No longer depend upon VERSION_STRING.
17162 * configure.in: No longer use `dnl'.
17163 Set up the test suite and the new directory `tests/.
17164 (VERSION_STRING): Remove.
17165
17166 2000-04-14 Akim Demaille <akim@epita.fr>
17167
17168 * src/reader.c (copy_comment2): New function, same as former
17169 `copy_comment', but outputs into two FILE *.
17170 (copy_comment): Use it.
17171 (parse_union_decl): Use it.
17172 (get_type, parse_start_decl): Use the same `invalid' message.
17173 (parse_start_decl, parse_union_decl): Use the same `multiple'
17174 message.
17175 (parse_union_decl, copy_guard, copy_action): Use the same
17176 `unmatched' message.
17177 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
17178
17179 2000-03-31 Akim Demaille <akim@epita.fr>
17180
17181 * src/files.c (tryopen, tryclose): Move to the top.
17182 Be static.
17183
17184 2000-03-31 Akim Demaille <akim@epita.fr>
17185
17186 * src/main.c (main): Don't call `done', exit does it.
17187
17188 2000-03-31 Akim Demaille <akim@epita.fr>
17189
17190 * allocate.c: s/return (foo)/return foo/.
17191 * lalr.c: Likewise.
17192 * LR0.c: Likewise.
17193 * output.c: Likewise.
17194 * reader.c: Likewise.
17195 * symtab.c: Likewise.
17196 * vmsgetargs.c: Likewise.
17197
17198 2000-03-31 Akim Demaille <akim@epita.fr>
17199
17200 Clean up the error reporting functions.
17201
17202 * src/report.c: New file.
17203 * src/report.h: Likewise.
17204 * src/Makefile.am: Adjust.
17205 * m4/error.m4: New file.
17206 * m4/Makefile.am: Adjust.
17207 * configure.in (jm_PREREQ_ERROR): Call it.
17208 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
17209 Remove.
17210 (fatal, fatals): Remove. All callers use complain.c::fatal.
17211 (warn, warni, warns, warnss, warnss): Remove. All callers use
17212 complain.c::complain.
17213 (toomany): Remove, use fatal instead.
17214 * src/files.c (done): No argument, use complain_message_count.
17215 * src/main.c (main): Register `done' to `atexit'.
17216
17217 * src/getargs.c (usage): More `fputs', less `fprintf'.
17218
17219 2000-03-28 Akim Demaille <akim@epita.fr>
17220
17221 * lib/: New directory.
17222 * Makefile.am (SUBDIRS): Adjust.
17223 * configure.in: Adjust.
17224 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
17225 useless.
17226 * src/alloca.c: Moved to lib/.
17227 * src/getopt.c: Likewise.
17228 * src/getopt1.c: Likewise.
17229 * src/getopt.h: Likewise.
17230 * src/ansi2knr.c: Likewise.
17231 * src/ansi2knr.1: Likewise.
17232 * src/Makefile.am: Adjust.
17233 * lib/Makefile.am: New file.
17234
17235 2000-03-28 Akim Demaille <akim@epita.fr>
17236
17237 * src/getargs.c (usage): Refresh the help message.
17238
17239 2000-03-17 Akim Demaille <akim@epita.fr>
17240
17241 * src/getopt1.c: Updated from textutils 2.0e
17242 * src/getopt.c: Likewise.
17243 * src/getopt.h: Likewise.
17244
17245 2000-03-17 Akim Demaille <akim@epita.fr>
17246
17247 * src/Makefile.am (bison.simple): Fix the awk program: quote only
17248 the file name, not the whole `#line LINE FILE'.
17249
17250 2000-03-17 Akim Demaille <akim@epita.fr>
17251
17252 On syntax errors, report the token on which we choked.
17253
17254 * src/bison.s1 (yyparse): In the label yyerrlab, when
17255 YYERROR_VERBOSE, add yychar in msg.
17256
17257 2000-03-17 Akim Demaille <akim@epita.fr>
17258
17259 * src/reader.c (copy_at): New function.
17260 (copy_guard): Use it.
17261 (copy_action): Use it.
17262
17263 2000-03-17 Akim Demaille <akim@epita.fr>
17264
17265 Be kind to translators, save some useless translations.
17266
17267 * src/main.c (banner): New function.
17268 (fatal_banner): Use it.
17269 (warn_banner): Use it.
17270
17271 2000-03-17 Akim Demaille <akim@epita.fr>
17272
17273 * src/reader.c (copy_definition): Use copy_string and
17274 copy_comment. Removed now unused `match', `ended',
17275 `cplus_comment'.
17276 (copy_comment, copy_string): Moved, to be visible from
17277 copy_definition.
17278
17279 2000-03-17 Akim Demaille <akim@epita.fr>
17280
17281 * src/reader.c (copy_string): Declare `static inline'. No
17282 problems with inline, since it is checked by configure.
17283 (copy_comment): Likewise.
17284
17285 2000-03-17 Akim Demaille <akim@epita.fr>
17286
17287 * src/reader.c (packsymbols): Formatting changes.
17288
17289 2000-03-17 Akim Demaille <akim@epita.fr>
17290
17291 * src/reader.c (copy_comment): New function, factored out from:
17292 (copy_action): Use it. Removed now unused `match', `ended',
17293 `cplus_comment'.
17294 (copy_guard): Likewise.
17295
17296 2000-03-17 Akim Demaille <akim@epita.fr>
17297
17298 * src/reader.c (copy_string): New function, factored out from:
17299 (copy_action): Use it.
17300 (copy_guard): Likewise.
17301
17302 2000-03-17 Akim Demaille <akim@epita.fr>
17303
17304 Change the handling of @s so that they behave exactly like $s.
17305 There is now a pseudo variable @$ (readble and writable), location
17306 of the lhs of the rule (by default ranging from the location of
17307 the first symbol of the rhs, to the location of the last symbol,
17308 or, if the rhs is empty, YYLLOC).
17309
17310 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
17311 yyval.
17312 (yyparse): When providing a default semantic action, provide a
17313 default location action.
17314 (after the $): No longer change `*YYLSP', just stack YYLOC the
17315 same way you stack YYVAL.
17316 * src/reader.c (read_declarations): Use warns.
17317 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
17318 (copy_action, case '@'): Likewise.
17319 Use a standard error message, to save useless work from
17320 translators.
17321
17322 2000-03-17 Akim Demaille <akim@epita.fr>
17323
17324 * src/bison.s1: Formatting and cosmetics changes.
17325 * src/reader.c: Likewise.
17326 Update the Copyright notice.
17327
17328 2000-03-17 Akim Demaille <akim@epita.fr>
17329
17330 * src/bison.s1 (#line): All set to `#line' only, since the
17331 Makefile now handles them.
17332
17333 2000-03-16 Akim Demaille <akim@epita.fr>
17334
17335 * src/output.c (output_rule_data): Output the documentation of
17336 some of the tables.
17337 (Copyright notice): Update.
17338 Formatting changes.
17339
17340 2000-03-16 Akim Demaille <akim@epita.fr>
17341
17342 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
17343 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
17344 One `#if YYDEBUG' remains, since it uses variables which are
17345 defined only if `YYDEBUG != 0'.
17346
17347 2000-03-16 Akim Demaille <akim@epita.fr>
17348
17349 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
17350 and related variables so that the similarities are highlighted.
17351
17352 2000-03-16 Akim Demaille <akim@epita.fr>
17353
17354 * src/bison.s1: Properly indent CPP directives.
17355
17356 2000-03-16 Akim Demaille <akim@epita.fr>
17357
17358 * src/bison.s1: Properly indent the `alloca' CPP section.
17359
17360 2000-03-16 Akim Demaille <akim@epita.fr>
17361
17362 Do not hard code values of directories in `configure.in'.
17363 Update the `configure' tool chain.
17364
17365 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
17366 src/makefile.am.
17367 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
17368 (AC_OUTPUT): Add m4/Makefile.
17369 Bump to bison 1.28a, 1.29 has never been released.
17370 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
17371 handled via src/Makefile.am.
17372 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
17373 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
17374 autoheader.
17375 * Makefile.am (SUBDIRS): Add m4.
17376 (ACLOCAL_AM_FLAGS): New variable.
17377 (AUTOMAKE_OPTIONS): Add check-news.
17378 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
17379 the proper line number and file name.
17380 (DEFS): Propagate the location of bison library files and of the
17381 locale files.
17382 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
17383 builddir.
17384 * acinclude.m4: Remove, replaced by the directory m4.
17385 * m4/Makefile.am (EXTRA_DIST): New variable.
17386 * m4/gettext.m4: New file, from the fileutils.
17387 * m4/lcmessage.m4: Likewise
17388 * m4/progtest.m4: Likewise.
17389 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
17390
17391 2000-03-10 Akim Demaille <akim@epita.fr>
17392
17393 * src/closure.c:
17394 Formatting changes of various comments.
17395 Respect the GNU coding standards at various places.
17396 Don't use `_()' when no translation is needed.
17397
17398 1999-12-13 Jesse Thilo <jthilo@gnu.org>
17399
17400 * src/files.c:
17401 OS/2 honors TMPDIR environment variable.
17402
17403 1999-12-13 Jesse Thilo <jthilo@gnu.org>
17404
17405 * doc/bison.texinfo: Tweaked spelling and grammar.
17406 Updated ISBN.
17407 Removed reference to price of printed copy.
17408 Mention BISON_SIMPLE and BISON_HAIRY.
17409
17410 1999-12-13 Jesse Thilo <jthilo@gnu.org>
17411
17412 * configure.in, NEWS:
17413 Bison 1.29 released.
17414
17415 1999-10-27 Jesse Thilo <jthilo@gnu.org>
17416
17417 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
17418 Added reference card.
17419
17420 1999-07-26 Jesse Thilo <jthilo@gnu.org>
17421
17422 * po/ru.po: Added Russian translation.
17423
17424 1999-07-26 Jesse Thilo <jthilo@gnu.org>
17425
17426 * configure.in: Added Russian translation.
17427
17428 1999-07-06 Jesse Thilo <jthilo@gnu.org>
17429
17430 * configure.in, NEWS, README:
17431 Released version 1.28.
17432
17433 1999-06-14 Jesse Thilo <jthilo@gnu.org>
17434
17435 * src/system.h:
17436 Squashed redefinition warning on some systems.
17437
17438 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
17439 Have configure build version string instead of relying on ANSI string
17440 concatentation.
17441
17442 1999-06-14 Jesse Thilo <jthilo@gnu.org>
17443
17444 * po/POTFILES.in: Got rid of version.c.
17445
17446 1999-06-14 Jesse Thilo <jthilo@gnu.org>
17447
17448 * acconfig.h, configure.in:
17449 Have configure build version string instead of relying on ANSI string
17450 concatentation.
17451
17452 1999-06-08 Jesse Thilo <jthilo@gnu.org>
17453
17454 * doc/bison.1:
17455 Dropped mention of `+' for long-named options.
17456
17457 1999-05-30 Jesse Thilo <jthilo@gnu.org>
17458
17459 * src/files.c: Added <unistd.h> for unlink().
17460
17461 * src/Makefile.am, src/system.h:
17462 I18n fixes.
17463
17464 1999-05-30 Jesse Thilo <jthilo@gnu.org>
17465
17466 * README: Added a FAQ list.
17467
17468 * configure.in, acconfig.h:
17469 I18n fixes.
17470
17471 1999-05-30 Jesse Thilo <jthilo@gnu.org>
17472
17473 * doc/FAQ, doc/Makefile.am:
17474 Added a FAQ list.
17475
17476 1999-05-19 Jesse Thilo <jthilo@gnu.org>
17477
17478 * src/alloc.h, src/symtab.h, src/version.c:
17479 Protected inclusion of "config.h" with HAVE_CONFIG_H.
17480
17481 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17482
17483 * src/.cvsignore, src/Makefile.am:
17484 Reorganized: sources in `src', documentation in `doc'.
17485
17486 * src/lex.c (literalchar):
17487 fixed the code for escaping double quotes (thanks
17488 Jonathan Czisny.)
17489
17490 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17491
17492 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
17493 Adjusted paths to reflect directory reorganization.
17494
17495 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17496
17497 * doc/.cvsignore, doc/Makefile.am:
17498 Reorganized: sources in `src', documentation in `doc'.
17499
17500 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17501
17502 * configure.in:
17503 Updated AC_INIT file to reflect directory reorganization.
17504
17505 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
17506 Reorganized: sources in `src', documentation in `doc'.
17507
17508 1999-04-13 Jesse Thilo <jthilo@gnu.org>
17509
17510 * src/allocate.c:
17511 Don't declare calloc() and realloc() if not necessary.
17512
17513 1999-04-13 Jesse Thilo <jthilo@gnu.org>
17514
17515 * configure.in, acconfig.h, acinclude.m4:
17516 Don't declare calloc() and realloc() if not necessary.
17517
17518 1999-03-23 Jesse Thilo <jthilo@gnu.org>
17519
17520 * po/.cvsignore: Added i18n support.
17521
17522 1999-03-23 Jesse Thilo <jthilo@gnu.org>
17523
17524 * acconfig.h, configure.in, Makefile.am:
17525 Added i18n support.
17526
17527 1999-03-22 Jesse Thilo <jthilo@gnu.org>
17528
17529 * src/bison.s1: Fixed #line numbers.
17530
17531 1999-03-15 Jesse Thilo <jthilo@gnu.org>
17532
17533 * po/es.po, po/fr.po, po/nl.po, po/de.po:
17534 Added PO files from Translation Project.
17535
17536 1999-03-03 Jesse Thilo <jthilo@gnu.org>
17537
17538 * Makefile.am:
17539 Added support for non-ANSI compilers (ansi2knr).
17540
17541 1999-02-16 Jesse Thilo <jthilo@gnu.org>
17542
17543 * configure.in: Bumped version number to 1.27.
17544
17545 * Makefile.am:
17546 Added `bison.simple' to list of files removed by `make distclean'.
17547
17548 1999-02-12 Jesse Thilo <jthilo@gnu.org>
17549
17550 * src/files.c, src/files.h:
17551 Defined locations of parser files in config.h instead of Makefile.
17552
17553 1999-02-12 Jesse Thilo <jthilo@gnu.org>
17554
17555 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
17556 Defined locations of parser files in config.h instead of Makefile.
17557
17558 1999-02-09 Jesse Thilo <jthilo@gnu.org>
17559
17560 * Makefile.am:
17561 Removed inappropriate use of $< macro.
17562
17563 1999-02-05 Jesse Thilo <jthilo@gnu.org>
17564
17565 * po/Makefile.in.in, po/POTFILES.in:
17566 Add `po' directory skeleton.
17567
17568 1999-01-27 Jesse Thilo <jthilo@gnu.org>
17569
17570 * README: Document help-bison list.
17571
17572 * configure.in: Add check for mkstemp().
17573
17574 1999-01-20 Jesse Thilo <jthilo@gnu.org>
17575
17576 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
17577 Hush a few compiler warnings.
17578
17579 * src/files.c:
17580 Add tryclose(), which verifies that fclose was successful.
17581 Hush a couple of compiler warnings.
17582
17583 1999-01-20 Jesse Thilo <jthilo@gnu.org>
17584
17585 * Makefile.am, OChangeLog:
17586 ChangeLog is now automatically generated. Include the old version as
17587 OChangeLog.
17588
17589 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17590
17591 * 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:
17592 Update FSF address.
17593
17594 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17595
17596 * doc/bison.texinfo: Fix formatting glitch.
17597
17598 * doc/bison.texinfo: Update FSF address.
17599
17600 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17601
17602 * acconfig.h: Update FSF address.
17603
17604 1999-01-08 Jesse Thilo <jthilo@gnu.org>
17605
17606 * src/system.h:
17607 Don't define PACKAGE here, since config.h defines it.
17608
17609 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17610
17611 * src/reader.c: Update copyright date.
17612
17613 * src/main.c:
17614 Ditch sprintf to statically-sized buffers in fatal/warn functions in
17615 favor of output directly to stderr (avoids buffer overruns).
17616
17617 * src/reader.c: Some checks for premature EOF.
17618
17619 * 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:
17620 Use prototypes if the compiler understands them.
17621
17622 * src/files.c: Honor TMPDIR on Unix hosts.
17623 Use prototypes if the compiler understands them.
17624
17625 * src/reader.c:
17626 Fix a couple of buffer overrun bugs.
17627 Use prototypes if the compiler understands them.
17628
17629 * src/system.h: Include unistd.h and ctype.h.
17630 Use #ifdef instead of #if for NLS symbols.
17631
17632 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17633
17634 * doc/bison.texinfo:
17635 Delete comment "consider using @set for edition number, etc..." since
17636 we now are doing so.
17637
17638 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17639
17640 * configure.in:
17641 Use prototypes if the compiler understands them.
17642
17643 * NEWS: Document 1.26 highlights.
17644
17645 * Makefile.am: Require Automake 1.3 or later.
17646
17647 * acconfig.h:
17648 Use prototypes if the compiler understands them.
17649
17650 1998-12-29 Jesse Thilo <jthilo@gnu.org>
17651
17652 * src/version.c:
17653 Use VERSION symbol from automake for version number.
17654
17655 1998-12-29 Jesse Thilo <jthilo@gnu.org>
17656
17657 * acconfig.h, configure.in, version.cin:
17658 Use VERSION symbol from automake for version number.
17659
17660 1998-11-28 Jesse Thilo <jthilo@gnu.org>
17661
17662 * Makefile.am:
17663 Distribute original version of simple parser (bison.s1), not built
17664 version (bison.simple).
17665
17666 1998-11-28 Jesse Thilo <jthilo@gnu.org>
17667
17668 * doc/bison.texinfo: Add info dir entry.
17669
17670 * doc/bison.texinfo:
17671 Let automake put version number into documentation.
17672
17673 1998-11-26 Jesse Thilo <jthilo@gnu.org>
17674
17675 * src/bison.cld, src/build.com, src/vmshlp.mar:
17676 Add non-RCS files from /gd/gnu/bison.
17677
17678 1998-11-26 Jesse Thilo <jthilo@gnu.org>
17679
17680 * doc/bison.1:
17681 Document the BISON_HAIRY and BISON_SIMPLE variables.
17682
17683 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17684
17685 * src/version.c: Build version.c automatically.
17686
17687 * src/reader.c:
17688 Fix token numbering (used to start at 258, not 257).
17689
17690 * src/system.h: Include config.h.
17691
17692 * src/getargs.c: Update bug report address.
17693
17694 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
17695 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
17696
17697 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17698
17699 * Makefile.am:
17700 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17701
17702 * configure.in, version.cin:
17703 Build version.c automatically.
17704
17705 * AUTHORS: Add AUTHORS file.
17706
17707 * README: Update bug report address.
17708
17709 * bison.simple:
17710 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17711
17712 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
17713 Add automake stuff.
17714
17715 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17716
17717 * doc/bison.texinfo: Clean up some formatting.
17718
17719 1998-05-05 Richard Stallman <rms@gnu.org>
17720
17721 * doc/bison.texinfo:
17722 Explain better why to make a pure parser.
17723
17724 1998-01-05 Richard Stallman <rms@gnu.org>
17725
17726 * src/files.c (openfiles):
17727 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
17728 find a temporary directory, if possible. Do not unlink files while
17729 they are open.
17730
17731 1997-08-25 Richard Stallman <rms@gnu.org>
17732
17733 * src/reader.c (stack_offset;):
17734 Change some warni to warns.
17735
17736 * src/lex.c (literalchar): Use warns, not warni.
17737
17738 1997-06-28 Richard Stallman <rms@gnu.org>
17739
17740 * src/bison.s1: Add a Bison version comment.
17741
17742 * src/main.c (fatal, warn, berror):
17743 Use program_name.
17744
17745 1997-06-28 Richard Stallman <rms@gnu.org>
17746
17747 * Makefile.in (bison_version): New variable.
17748 (dist): Use that variable.
17749 (bison.s1): Substitute the Bison version into bison.simple.
17750
17751 * bison.simple: Add a Bison version comment.
17752
17753 1997-06-18 Richard Stallman <rms@gnu.org>
17754
17755 * src/main.c (fatal, warn, berror):
17756 Make error messages standard.
17757 (toomany): Improve error message text.
17758
17759 * 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:
17760 new.h renamed to alloc.h.
17761
17762 1997-06-18 Richard Stallman <rms@gnu.org>
17763
17764 * Makefile.in: new.h renamed to alloc.h.
17765
17766 1997-05-24 Richard Stallman <rms@gnu.org>
17767
17768 * src/lex.c (literalchar):
17769 Fix the code for escaping \, " and '.
17770
17771 (lex): Avoid trouble when there are many chars
17772 to discard in a char literal with just several chars in it.
17773
17774 1997-05-17 Richard Stallman <rms@gnu.org>
17775
17776 * src/bison.s1:
17777 Use malloc, if using alloca is troublesome.
17778 (YYSTACK_USE_ALLOCA): New flag macro.
17779 Define it for some systems and compilers.
17780 (YYSTACK_ALLOC): New macro.
17781 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17782 If it was malloc'd, free it.
17783
17784 1997-05-17 Richard Stallman <rms@gnu.org>
17785
17786 * bison.simple:
17787 Use malloc, if using alloca is troublesome.
17788 (YYSTACK_USE_ALLOCA): New flag macro.
17789 Define it for some systems and compilers.
17790 (YYSTACK_ALLOC): New macro.
17791 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17792 If it was malloc'd, free it.
17793
17794 1997-04-23 Richard Stallman <rms@gnu.org>
17795
17796 * src/bison.s1:
17797 (alloca) [__hpux]: Always define as __builtin_alloca.
17798
17799 1997-04-23 Richard Stallman <rms@gnu.org>
17800
17801 * bison.simple:
17802 (alloca) [__hpux]: Always define as __builtin_alloca.
17803
17804 1997-04-22 Richard Stallman <rms@gnu.org>
17805
17806 * src/bison.s1:
17807 [__hpux]: Include alloca.h (right for HPUX 10)
17808 instead of declaring alloca (right for HPUX 9).
17809
17810 * src/bison.s1 (__yy_memcpy):
17811 Declare arg `count' as unsigned int.
17812 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17813
17814 1997-04-22 Richard Stallman <rms@gnu.org>
17815
17816 * bison.simple:
17817 [__hpux]: Include alloca.h (right for HPUX 10)
17818 instead of declaring alloca (right for HPUX 9).
17819
17820 * bison.simple (__yy_memcpy):
17821 Declare arg `count' as unsigned int.
17822 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17823
17824 1997-01-03 Richard Stallman <rms@gnu.org>
17825
17826 * src/allocate.c: [__STDC__ or _MSC_VER]:
17827 Declare calloc and realloc to return void *.
17828
17829 1997-01-02 Richard Stallman <rms@gnu.org>
17830
17831 * src/system.h:
17832 [_MSC_VER]: Include stdlib.h and process.h.
17833 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
17834
17835 * src/main.c (main): Return FAILURE as a value.
17836 (printable_version): Declare arg as int, not char.
17837
17838 1997-01-02 Richard Stallman <rms@gnu.org>
17839
17840 * Makefile.in (dist):
17841 Explicitly check for symlinks, and copy them.
17842
17843 1996-12-19 Richard Stallman <rms@gnu.org>
17844
17845 * src/files.c:
17846 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
17847
17848 1996-12-18 Paul Eggert <eggert@gnu.org>
17849
17850 * src/bison.s1 (yyparse):
17851 If __GNUC__ and YYPARSE_PARAM are both defined,
17852 declare yyparse to have a void * argument.
17853
17854 1996-12-18 Paul Eggert <eggert@gnu.org>
17855
17856 * bison.simple (yyparse):
17857 If __GNUC__ and YYPARSE_PARAM are both defined,
17858 declare yyparse to have a void * argument.
17859
17860 1996-12-17 Richard Stallman <rms@gnu.org>
17861
17862 * src/reduce.c (nbits): Add some casts.
17863
17864 1996-08-12 Richard Stallman <rms@gnu.org>
17865
17866 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
17867
17868 1996-08-12 Richard Stallman <rms@gnu.org>
17869
17870 * bison.simple: Test _MSDOS as well as _MSDOS_.
17871
17872 1996-07-31 Richard Stallman <rms@gnu.org>
17873
17874 * src/bison.s1:
17875 [__sun && __i386]: Include alloca.h.
17876
17877 1996-07-31 Richard Stallman <rms@gnu.org>
17878
17879 * bison.simple:
17880 [__sun && __i386]: Include alloca.h.
17881
17882 1996-07-30 Richard Stallman <rms@gnu.org>
17883
17884 * src/bison.s1: Comment change.
17885
17886 * src/bison.s1: Test _MSDOS_, not MSDOS.
17887
17888 1996-07-30 Richard Stallman <rms@gnu.org>
17889
17890 * bison.simple: Comment change.
17891
17892 * bison.simple: Test _MSDOS_, not MSDOS.
17893
17894 1996-06-01 Richard Stallman <rms@gnu.org>
17895
17896 * 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:
17897 Insert `_' macro around many string constants.
17898
17899 * src/main.c:
17900 Insert `_' macro around many string constants.
17901
17902 (main): Call setlocale, bindtextdomain and textdomain.
17903
17904 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
17905 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
17906 [ENABLE_NLS]: Include libintl.h.
17907 [ENABLE_NLS] (gettext): Define.
17908 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
17909 (N_, PACKAGE, LOCALEDIR): New macros.
17910
17911 1996-06-01 Richard Stallman <rms@gnu.org>
17912
17913 * POTFILES.in: New file.
17914
17915 * Makefile.in (allocate.o):
17916 Define target explicitly.
17917
17918 * Makefile.in (CFLAGS): Set to @CFLAGS@.
17919 (LDFLAGS): Set to @LDFLAGS@.
17920 (configure): Run autoconf only if preceding `cd' succeeds.
17921 (bison.s1): Redirect output to temporary file then move the
17922 temporary to the target, rather than redirecting directly to bison.s1.
17923 (clean): Remove config.status and config.log.
17924 (distclean): Don't remove config.status here.
17925
17926 1996-05-12 Richard Stallman <rms@gnu.org>
17927
17928 * src/bison.s1:
17929 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17930
17931 1996-05-12 Richard Stallman <rms@gnu.org>
17932
17933 * bison.simple:
17934 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17935
17936 1996-05-11 Richard Stallman <rms@gnu.org>
17937
17938 * src/bison.s1 (__yy_memcpy):
17939 Really reorder the args, as was supposedly done on Feb 14 1995.
17940 (yyparse): Calls changed accordingly.
17941
17942 1996-05-11 Richard Stallman <rms@gnu.org>
17943
17944 * Makefile.in (dist): Don't use $(srcdir).
17945
17946 * bison.simple (__yy_memcpy):
17947 Really reorder the args, as was supposedly done on Feb 14 1995.
17948 (yyparse): Calls changed accordingly.
17949
17950 1996-01-27 Richard Stallman <rms@gnu.org>
17951
17952 * src/output.c (output_rule_data):
17953 Test YYERROR_VERBOSE in the conditional
17954 around the definition of ttyname.
17955
17956 1995-12-29 Richard Stallman <rms@gnu.org>
17957
17958 * src/bison.s1:
17959 Fix line numbers in #line commands.
17960
17961 1995-12-29 Richard Stallman <rms@gnu.org>
17962
17963 * bison.simple:
17964 Fix line numbers in #line commands.
17965
17966 1995-12-27 Richard Stallman <rms@gnu.org>
17967
17968 * src/bison.s1 (YYPARSE_PARAM_DECL):
17969 In C++, make it always null.
17970 (YYPARSE_PARAM_ARG): New macro.
17971 (yyparse): Use YYPARSE_PARAM_ARG.
17972
17973 1995-12-27 Richard Stallman <rms@gnu.org>
17974
17975 * bison.simple (YYPARSE_PARAM_DECL):
17976 In C++, make it always null.
17977 (YYPARSE_PARAM_ARG): New macro.
17978 (yyparse): Use YYPARSE_PARAM_ARG.
17979
17980 1995-11-29 Richard Stallman <rms@gnu.org>
17981
17982 * doc/bison.texinfo:
17983 Describe literal string tokens, %raw, %no_lines, %token_table.
17984
17985 1995-11-29 Daniel Hagerty <hag@gnu.org>
17986
17987 * doc/bison.texinfo: Fixed update date
17988
17989 1995-10-16 Richard Stallman <rms@gnu.org>
17990
17991 * src/version.c: Version 1.25.
17992
17993 1995-10-16 Richard Stallman <rms@gnu.org>
17994
17995 * NEWS: *** empty log message ***
17996
17997 1995-10-16 Richard Stallman <rms@gnu.org>
17998
17999 * doc/bison.1, doc/bison.rnh:
18000 Add new options.
18001
18002 1995-10-15 Richard Stallman <rms@gnu.org>
18003
18004 * src/vmsgetargs.c, src/getargs.c:
18005 Added -n, -k, and -raw switches.
18006 (noparserflag, toknumflag, rawtoknumflag): New variables.
18007
18008 * src/symtab.h (SALIAS):
18009 New #define for adding aliases to %token.
18010 (struct bucket): Added `alias' field.
18011
18012 * src/reduce.c (reduce_grammar):
18013 Revise error message.
18014 (print_notices): Remove final `.' from error message.
18015
18016 * src/reader.c (reader_output_yylsp):
18017 New function.
18018 (readgram): Use `#if 0' around code that accepted %command
18019 inside grammar rules: The documentation doesn't allow it,
18020 and it will fail since the %command processors scan for the next %.
18021 (parse_token_decl): Extended the %token
18022 declaration to allow a multi-character symbol as an alias.
18023 (parse_thong_decl): New function.
18024 (read_declarations): Added %thong declarations.
18025 (read_declarations): Handle NOOP to deal with allowing
18026 % declarations as another means to specify the flags.
18027 (readgram): Allow %prec prior to semantics embedded in a rule.
18028 (skip_to_char, read_declarations, copy_definition)
18029 (parse_token_decl, parse_start_decl, parse_type_decl)
18030 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
18031 (get_type_name, copy_guard, copy_action, readgram)
18032 (get_type, packsymbols): Revised most error messages.
18033 Changed `fatal' to `warnxxx' to avoid aborting for error.
18034 Revised and use multiple warnxxx functions to avoid using VARARGS1.
18035 (read_declarations): Improve the error message for
18036 an invalid character. Do not abort.
18037 (read_declarations, copy_guard, copy_action): Use
18038 printable_version to avoid unprintable characters in printed output.
18039 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
18040 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
18041 Allow the type of a non-terminal can be given
18042 more than once, as long as all specifications give the same type.
18043
18044 * src/output.c:
18045 (output_headers, output_trailers, output, output_gram)
18046 (output_rule_data): Implement noparserflag variable.
18047 Implement toknumflag variable.
18048 (output): Call reader_output_yylsp to output LTYPESTR.
18049
18050 * src/main.c (main):
18051 If reader sees an error, don't process the grammar.
18052 (fatals): Updated to not use VARARGS1.
18053 (printable_version, int_to_string, warn, warni, warns, warnss)
18054 (warnsss): New error reporting functions. Avoid abort for error.
18055
18056 * src/lex.h:
18057 Added THONG and NOOP for alias processing.
18058 Added SETOPT for the new code that allows setting options with %flags.
18059
18060 * src/lex.c:
18061 Include getopt.h. Add some extern decls.
18062 (safegetc): New function to deal with EOF gracefully.
18063 (literalchar); new function to deal with reading \ escapes.
18064 (lex): Use literalchar.
18065 (lex): Implemented "..." tokens.
18066 (literalchar, lex, parse_percent_token): Made tokenbuffer
18067 always contain the token. This includes growing the token
18068 buffer while reading an integer.
18069 (parse_percent_token): Replaced if-else statement with percent_table.
18070 (parse_percent_token): Added % declarations as another
18071 way to specify the flags -n, -l, and -r. Also added hooks for
18072 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
18073 major changes to files.c.
18074 (lex) Retain in the incoming stream a character following
18075 an incorrect '/'.
18076 (skip_white_space, lex): Revised most error messages
18077 and changed fatal to warn to avoid aborting.
18078 (percent_table): Added %thong declarations.
18079
18080 * src/gram.h: Comment changes.
18081
18082 * src/files.c (openfiles, open_extra_files, done):
18083 Add faction flag
18084 and actfile file. Handle noparserflag. Both for -n switch.
18085
18086 * src/conflicts.c (resolve_sr_conflict):
18087 Remove use of alloca.
18088
18089 1995-06-01 Jim Meyering <meyering@gnu.org>
18090
18091 * doc/bison.texinfo: *** empty log message ***
18092
18093 1995-05-06 Richard Stallman <rms@gnu.org>
18094
18095 * src/bison.s1: Comment change.
18096
18097 1995-05-06 Richard Stallman <rms@gnu.org>
18098
18099 * bison.simple: Comment change.
18100
18101 1995-05-03 Richard Stallman <rms@gnu.org>
18102
18103 * src/version.c: Version now 1.24.
18104
18105 * src/bison.s1: Change distribution terms.
18106
18107 * src/version.c: Version now 1.23.
18108
18109 1995-05-03 Richard Stallman <rms@gnu.org>
18110
18111 * doc/bison.texinfo:
18112 Rewrite "Conditions for Using Bison".
18113 Update version to 1.24.
18114
18115 1995-05-03 Richard Stallman <rms@gnu.org>
18116
18117 * bison.simple: Change distribution terms.
18118
18119 1995-02-23 Richard Stallman <rms@gnu.org>
18120
18121 * src/files.c: Test __VMS_POSIX as well as VMS.
18122
18123 1995-02-14 Jim Meyering <meyering@gnu.org>
18124
18125 * src/bison.s1 (__yy_memcpy):
18126 Renamed from __yy_bcopy to avoid
18127 confusion. Reverse FROM and TO arguments to be consistent with
18128 those of memcpy.
18129
18130 1995-02-14 Jim Meyering <meyering@gnu.org>
18131
18132 * bison.simple (__yy_memcpy):
18133 Renamed from __yy_bcopy to avoid
18134 confusion. Reverse FROM and TO arguments to be consistent with
18135 those of memcpy.
18136
18137 1994-11-10 David J. MacKenzie <djm@gnu.org>
18138
18139 * NEWS: reformat
18140
18141 * NEWS: New file.
18142
18143 * Makefile.in (DISTFILES): Include NEWS.
18144
18145 * Makefile.in (DISTFILES):
18146 Include install-sh, not install.sh.
18147
18148 * configure.in: Update to Autoconf v2 macro names.
18149
18150 1994-10-05 David J. MacKenzie <djm@gnu.org>
18151
18152 * Makefile.in: fix typo
18153
18154 * Makefile.in (prefix, exec_prefix):
18155 Let configure set them.
18156
18157 1994-09-28 David J. MacKenzie <djm@gnu.org>
18158
18159 * Makefile.in: Set datadir to $(prefix)/share.
18160
18161 1994-09-15 Richard Stallman <rms@gnu.org>
18162
18163 * src/bison.s1:
18164 Update copyright notice and GPL version.
18165
18166 1994-09-15 Richard Stallman <rms@gnu.org>
18167
18168 * bison.simple:
18169 Update copyright notice and GPL version.
18170
18171 1994-07-12 Richard Stallman <rms@gnu.org>
18172
18173 * src/reduce.c, src/reader.c:
18174 entered into RCS
18175
18176 1994-05-05 David J. MacKenzie <djm@gnu.org>
18177
18178 * Makefile.in: entered into RCS
18179
18180 1994-03-26 Richard Stallman <rms@gnu.org>
18181
18182 * src/bison.s1: entered into RCS
18183
18184 1994-03-26 Richard Stallman <rms@gnu.org>
18185
18186 * bison.simple: entered into RCS
18187
18188 1994-03-25 Richard Stallman <rms@gnu.org>
18189
18190 * src/main.c: entered into RCS
18191
18192 1994-03-24 Richard Stallman <rms@gnu.org>
18193
18194 * src/conflicts.c: entered into RCS
18195
18196 1994-01-02 Richard Stallman <rms@gnu.org>
18197
18198 * Makefile.in: *** empty log message ***
18199
18200 1993-11-21 Richard Stallman <rms@gnu.org>
18201
18202 * src/bison.s1: *** empty log message ***
18203
18204 1993-11-21 Richard Stallman <rms@gnu.org>
18205
18206 * doc/bison.texinfo: entered into RCS
18207
18208 * doc/bison.texinfo: *** empty log message ***
18209
18210 1993-11-21 Richard Stallman <rms@gnu.org>
18211
18212 * bison.simple: *** empty log message ***
18213
18214 1993-10-25 David J. MacKenzie <djm@gnu.org>
18215
18216 * doc/bison.texinfo: *** empty log message ***
18217
18218 1993-10-19 Richard Stallman <rms@gnu.org>
18219
18220 * src/bison.s1: *** empty log message ***
18221
18222 1993-10-19 Richard Stallman <rms@gnu.org>
18223
18224 * bison.simple: *** empty log message ***
18225
18226 1993-10-14 Richard Stallman <rms@gnu.org>
18227
18228 * src/bison.s1: *** empty log message ***
18229
18230 1993-10-14 Richard Stallman <rms@gnu.org>
18231
18232 * bison.simple: *** empty log message ***
18233
18234 1993-09-14 David J. MacKenzie <djm@gnu.org>
18235
18236 * doc/bison.texinfo: *** empty log message ***
18237
18238 1993-09-13 Noah Friedman <friedman@gnu.org>
18239
18240 * Makefile.in: *** empty log message ***
18241
18242 1993-09-10 Richard Stallman <rms@gnu.org>
18243
18244 * src/conflicts.c: *** empty log message ***
18245
18246 * src/system.h: entered into RCS
18247
18248 1993-09-10 Richard Stallman <rms@gnu.org>
18249
18250 * doc/bison.1: entered into RCS
18251
18252 1993-09-06 Noah Friedman <friedman@gnu.org>
18253
18254 * src/version.c: entered into RCS
18255
18256 1993-09-06 Noah Friedman <friedman@gnu.org>
18257
18258 * Makefile.in: *** empty log message ***
18259
18260 1993-07-30 David J. MacKenzie <djm@gnu.org>
18261
18262 * Makefile.in: *** empty log message ***
18263
18264 1993-07-24 Richard Stallman <rms@gnu.org>
18265
18266 * src/bison.s1: *** empty log message ***
18267
18268 1993-07-24 Richard Stallman <rms@gnu.org>
18269
18270 * bison.simple: *** empty log message ***
18271
18272 1993-07-08 David J. MacKenzie <djm@gnu.org>
18273
18274 * Makefile.in: *** empty log message ***
18275
18276 1993-07-04 Richard Stallman <rms@gnu.org>
18277
18278 * src/bison.s1: *** empty log message ***
18279
18280 1993-07-04 Richard Stallman <rms@gnu.org>
18281
18282 * bison.simple: *** empty log message ***
18283
18284 1993-06-26 David J. MacKenzie <djm@gnu.org>
18285
18286 * src/getargs.c: entered into RCS
18287
18288 1993-06-26 David J. MacKenzie <djm@gnu.org>
18289
18290 * doc/bison.texinfo: *** empty log message ***
18291
18292 * doc/bison.1: New file.
18293
18294 1993-06-25 Richard Stallman <rms@gnu.org>
18295
18296 * src/getargs.c: New file.
18297
18298 1993-06-16 Richard Stallman <rms@gnu.org>
18299
18300 * src/bison.s1: *** empty log message ***
18301
18302 1993-06-16 Richard Stallman <rms@gnu.org>
18303
18304 * bison.simple: *** empty log message ***
18305
18306 1993-06-03 Richard Stallman <rms@gnu.org>
18307
18308 * src/bison.s1: New file.
18309
18310 1993-06-03 Richard Stallman <rms@gnu.org>
18311
18312 * doc/bison.texinfo: *** empty log message ***
18313
18314 1993-06-03 Richard Stallman <rms@gnu.org>
18315
18316 * bison.simple: New file.
18317
18318 1993-05-19 Richard Stallman <rms@gnu.org>
18319
18320 * doc/bison.texinfo: New file.
18321
18322 1993-05-07 Noah Friedman <friedman@gnu.org>
18323
18324 * Makefile.in: *** empty log message ***
18325
18326 1993-04-28 Noah Friedman <friedman@gnu.org>
18327
18328 * src/reader.c: *** empty log message ***
18329
18330 1993-04-23 Noah Friedman <friedman@gnu.org>
18331
18332 * src/alloc.h: entered into RCS
18333
18334 1993-04-20 David J. MacKenzie <djm@gnu.org>
18335
18336 * src/version.c: *** empty log message ***
18337
18338 * src/files.c, src/allocate.c:
18339 entered into RCS
18340
18341 * src/reader.c: *** empty log message ***
18342
18343 * src/lex.c: entered into RCS
18344
18345 * src/conflicts.c: New file.
18346
18347 * src/symtab.c: entered into RCS
18348
18349 * src/alloc.h: New file.
18350
18351 * src/LR0.c: entered into RCS
18352
18353 1993-04-18 Noah Friedman <friedman@gnu.org>
18354
18355 * src/reader.c: New file.
18356
18357 * src/version.c: *** empty log message ***
18358
18359 1993-04-18 Noah Friedman <friedman@gnu.org>
18360
18361 * Makefile.in: *** empty log message ***
18362
18363 1993-04-17 Noah Friedman <friedman@gnu.org>
18364
18365 * Makefile.in: *** empty log message ***
18366
18367 1993-04-15 Richard Stallman <rms@gnu.org>
18368
18369 * src/main.c, src/files.c:
18370 New file.
18371
18372 1993-04-15 Noah Friedman <friedman@gnu.org>
18373
18374 * configure.in: entered into RCS
18375
18376 * configure.in: *** empty log message ***
18377
18378 * configure.in: New file.
18379
18380 1993-04-14 Richard Stallman <rms@gnu.org>
18381
18382 * Makefile.in: New file.
18383
18384 1993-04-13 Richard Stallman <rms@gnu.org>
18385
18386 * src/version.c: New file.
18387
18388 1993-03-25 Richard Stallman <rms@gnu.org>
18389
18390 * src/output.c: entered into RCS
18391
18392 1992-09-25 Richard Stallman <rms@gnu.org>
18393
18394 * configure.bat: entered into RCS
18395
18396 1992-06-22 Richard Stallman <rms@gnu.org>
18397
18398 * src/vmsgetargs.c: entered into RCS
18399
18400 1992-06-22 Richard Stallman <rms@gnu.org>
18401
18402 * doc/bison.rnh: entered into RCS
18403
18404 1992-04-20 David J. MacKenzie <djm@gnu.org>
18405
18406 * README: entered into RCS
18407
18408 1992-01-22 Richard Stallman <rms@gnu.org>
18409
18410 * src/machine.h: entered into RCS
18411
18412 1991-12-21 Richard Stallman <rms@gnu.org>
18413
18414 * src/lalr.c, src/closure.c:
18415 entered into RCS
18416
18417 1991-12-20 Richard Stallman <rms@gnu.org>
18418
18419 * src/state.h: entered into RCS
18420
18421 1991-12-18 Richard Stallman <rms@gnu.org>
18422
18423 * src/print.c, src/nullable.c, src/derives.c:
18424 entered into RCS
18425
18426 1991-11-03 David J. MacKenzie <djm@gnu.org>
18427
18428 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
18429 entered into RCS
18430
18431 1988-09-09 Richard Stallman <rms@gnu.org>
18432
18433 * src/bison.hairy: entered into RCS
18434
18435 1987-12-16 Richard Stallman <rms@gnu.org>
18436
18437 * REFERENCES: entered into RCS
18438
18439
18440 -----
18441
18442 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
18443 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
18444 Free Software Foundation, Inc.
18445
18446 Copying and distribution of this file, with or without
18447 modification, are permitted provided the copyright notice and this
18448 notice are preserved.
18449
18450 $Id$