]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
Use the new code_props interface for rule actions.
[bison.git] / ChangeLog
... / ...
CommitLineData
12007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 Use the new code_props interface for rule actions.
4 * src/symlist.h (symbol_list): Replace action, action_location, and
5 used members with a code_props action_props member.
6 * src/reader.c (symbol_should_be_used, grammar_rule_check,
7 grammar_midrule_action, grammar_current_rule_merge_set,
8 grammar_current_rule_symbol_append, packgram): Update.
9 * src/scan-code.h (translate_rule_action): Remove, no longer used.
10 * src/scan-code.l (handle_action_dollar): Update.
11 (translate_rule_action): Remove, no longer used.
12 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
13
142007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
15
16 Use the new code_props interface in parse-gram.y.
17 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
18 Update all uses of translate_* functions to use the new code_props
19 interface and to use gram_scanner_last_string_free and
20 code_scanner_last_string_free where possible.
21 (grammar_declaration): symbol_list_destructor_set and
22 symbol_list_printer_set now perform the translation, so don't do it
23 here. Use gram_scanner_last_string_free where possible.
24 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
25 translate_code): Remove, no longer used.
26 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
27 symbol_list_printer_set): Perform code translation here rather than
28 depending on the caller to do so.
29
30 * src/symlist.h (struct symbol_list): Correct some documentation typos.
31 * src/scan-gram.h (gram_last_string): Remove declaration.
32 * src/scan-gram.l (last_string): Declare it static.
33
342007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
35
36 Encapsulate code properties and related functionality for the various
37 destructors, printers, and actions into a code_props structure and
38 interface. This patch merely implements code_props in scan-code.h and
39 scan-code.l. Future patches will rewrite other modules to use it.
40 Discussed starting at
41 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
42 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
43 consistently initialize const structs that have an empty location
44 field.
45 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
46 to ensure consistency.
47 * src/scan-code.h (code_props): New structure.
48 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
49 function, macro, and const global variable for initializing a
50 code_props with no code.
51 (code_props_plain_init, code_props_symbol_action_init,
52 code_props_rule_action_init, code_props_translate_code): The rest of
53 the new code_props functional interface. Among other things, the init
54 functions set the code_props kind field so that
55 code_props_translate_code will know whether to behave like
56 translate_symbol_action, translate_rule_action, or translate_code.
57 These old translate functions must remain until all other modules are
58 updated to use the new code_props interface.
59 (code_scanner_last_string_free): New function similar to
60 gram_scanner_last_string_free.
61 (code_scanner_free): Add documentation.
62 * src/scan-code.l: Implement the new interface.
63 (code_lex): Make it static, add a code_props* argument, and remove the
64 rule argument.
65 (last_string): New static global similar to the one in scan-gram.l.
66 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
67 instead of rule.
68 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
69 code_props since Bison may one day use this information for destructors
70 and printers.
71 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
72 (handle_action_dollar): Use symbol_list_n_get and set used flag
73 directly since symbol_list_n_used_set is removed.
74 (translate_action): Add a code_props* argument and remove the rule,
75 action, and location arguments. Pass the code_props* on to code_lex.
76 (translate_rule_action, translate_symbol_action, translate_code):
77 Rewrite as wrappers around the new code_props interface.
78 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
79 it would eventually need to break the encapsulation of code_props.
80
812007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
82
83 * etc/.cvsignore: New.
84
852007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
86
87 Add maintainer-push-check to run maintainer-check using push parsing in
88 place of pull parsing where available.
89 * Makefile.am (maintainer-push-check): New.
90 * data/bison.m4 (b4_use_push_for_pull_if): New.
91 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
92 appropriately based on their existing values.
93 (yypush_parse): Don't print push-parser-specific diagnostics if push
94 parsing is being used in place of pull parsing.
95 * data/yacc.c: If push parsing should replace pull parsing, redirect to
96 push.c.
97 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
98 variable, and insert b4_use_push_for_pull_flag into muscles.
99 * tests/Makefile.am (maintainer-push-check): New.
100
1012006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
102
103 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
104 (whether successful or failed) so that yypush_parse can be invoked
105 again to start a new parse using the same yypstate.
106 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
107 check multiple yypull_parse invocations on the same yypstate. For pull
108 mode, extend to check multiple yyparse invocations.
109 (Exploding the Stack Size with Alloca): Extend to try with
110 %push-pull-parser.
111 (Exploding the Stack Size with Malloc): Likewise.
112
113 * tests/calc.at (Simple LALR Calculator): Don't specify
114 %skeleton "push.c" since %push-pull-parser implies that now.
115 * tests/headers.at (export YYLTYPE): Don't check for the push
116 declarations. Otherwise, this test case can't be used to see if push
117 mode can truly emulate pull mode.
118 * tests/input.at (Torturing the Scanner): Likewise.
119 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
120 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
121 AT_YACC_IF, which now includes the case of push mode since %skeleton
122 need not be used for push mode. This will be more intuitive once
123 push.c is renamed to yacc.c.
124
1252006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
126
127 For push mode, convert yyparse from a macro to a function, invoke yylex
128 instead of passing a yylexp argument to yypull_parse, and don't
129 generate yypull_parse or yyparse unless %push-pull-parser is declared.
130 Discussed starting at
131 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
132 * data/bison.m4 (b4_pull_if): New.
133 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
134 * data/push.c: Improve M4 quoting a little.
135 (b4_generate_macro_args, b4_parenthesize): Remove.
136 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
137 any time a pull parser is requested.
138 Don't #define this as a wrapper around yypull_parse. Instead, when
139 both push and pull are requested, make it a function that does that
140 same thing.
141 (yypull_parse): If there's a b4_prefix, #define this to
142 b4_prefix[pull_parse] when both push and pull are requested.
143 Don't define this as a function unless both push and pull are
144 requested.
145 Remove the yylexp argument and hard-code yylex invocation instead.
146 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
147 %push-parser.
148 * src/getargs.c (pull_parser): New global initialized to true.
149 * getargs.h (pull_parser): extern it.
150 * src/output.c (prepare): Insert pull_flag muscle.
151 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
152 (prologue_declaration): Set both push_parser and pull_parser = true for
153 %push-pull-parser. Set push_parser = true and pull_parser = false for
154 %push-parser.
155 * src/scan-gram.l: Don't accept %push_parser as an alternative to
156 %push-parser since there's no backward-compatibility concern here.
157 Scan %push-pull-parser.
158 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
159 instead of %push-parser.
160 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
161 prototype it in the module that calls yyparse.
162 * tests/input.at (Torturing the Scanner): Likewise.
163 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
164
1652006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
166
167 Update etc/bench.pl. Optimize push mode a little (the yyn change
168 deserves most of the credit).
169 * Makefile.am (SUBDIRS): Add etc subdirectory.
170 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
171 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
172 yytoken, yyval, and yyloc declarations to...
173 (yyparse or yypush_parse): ... here to improve performance. For
174 yypush_parse invocations after the first, be sure to assign yyn its old
175 value again.
176 (yypstate_new): Don't bother initializing the yyresult field since the
177 initial value isn't used.
178 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
179 remove the #define that, in push mode, set it to yyps->NAME.
180 * etc/Makefile.am: New.
181 * etc/bench.pl: Remove and build it instead from...
182 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
183 "tests/bison" from the build directory by default rather than just
184 invoking "bison" from $PATH.
185 (calc_grammar): Update push parser code: don't declare yylval globally,
186 don't define yyparse_wrapper, and don't #define yyparse.
187 (bench_grammar): Update to check all working combinations of yacc.c,
188 push.c, impure, pure, pull, and push.
189
1902006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
191
192 For push mode, add pull wrappers around yypush_parse.
193 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
194 (yypull_parse): New function wrapping yypush_parse.
195 (yyparse): New #define wrapping yypull_parse.
196 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
197 is declared.
198 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
199 prototype yylex in the module that calls yyparse, and don't prototype
200 yyparse there. Otherwise, the yyparse expansion won't compile.
201 * tests/input.at (Torturing the Scanner): Likewise.
202
2032006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
204
205 Enable push parsers to operate in impure mode. Thus, %push-parser no
206 longer implies %pure-parser. The point of this change is to move
207 towards being able to test the push parser code by running the entire
208 test suite as if %push-parser had been declared.
209 * data/push.c (yypush_parse): For impure mode, remove the
210 yypushed_char, yypushed_val, and yypushed_loc arguments.
211 Instead, declare these as local variables initialized to the global
212 yychar, yylval, and yylloc.
213 For the first yypush_parse invocation only, restore the initial values
214 of these global variables when it's time to read a token since they
215 have been overwritten.
216 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
217 %push-parser.
218 * tests/calc.at (Simple LALR(1) Calculator): Always declare
219 %pure-parser along with %push-parser since this test case was designed
220 for pure push parsers.
221 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
222 (AT_YACC_OR_PUSH_IF): New.
223 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
224 add a note that it's still wrong for some cases (as it has been for a
225 while).
226 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
227 %push-parser no longer implies %pure-parser.
228
2292006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
230
231 Remove some unnecessary differences between the pull parser code and
232 the push parser code. This patch enables yynerrs in push mode.
233 * data/push.c: Reformat M4 a little.
234 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
235 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
236 because push mode is on. Instead, if pure mode is on, move yynerrs
237 to...
238 (b4_declare_parser_state_variables): ... here.
239 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
240 to yyps->NAME so it can be used in yypush_parse.
241 (yypush_parse): Don't omit uses of yynerrs in push mode.
242
2432006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
244
245 Fix bug such that the first pushed token's value and location are
246 sometimes overwritten (sometimes by %initial-action) before being used.
247 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
248 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
249 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
250 more closely mimic the pull parser logic.
251 Don't copy the pushed token to yychar, yylval, and yylloc until it's
252 time to read a token, which is after any initialization of yylval and
253 yylloc.
254 (gottoken): Rename label to...
255 (yyread_pushed_token): ... for clarity and to avoid infringing on the
256 user namespace.
257
2582006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
259
260 Rearrange initialization of the parser state variables so that the
261 skeleton doesn't have to have a copy for pull mode and another for push
262 mode. This patch also fixes at least a bug such that yylloc was not
263 initialized (with b4_location_initial_line and
264 b4_location_initial_column) upon calling yypush_parse. However, that
265 initialization now overwrites the first token's location;
266 %initial-action assigning @$ already did the same thing, and both bugs
267 will be fixed in a later patch.
268 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
269 (b4_declare_parser_state_variables): Remove initialization of yytoken,
270 yyss, yyvs, yyls, and yystacksize.
271 (yypstate_new): Remove initialization of some yypstate fields: yystate,
272 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
273 yylsp.
274 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
275 yyps->NAME so it can be used in yypush_parse.
276 (yyparse or yypush_parse): For yypush_parse, don't print the
277 "Starting parse" diagnostic for invocations after the first.
278 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
279 yypush_parse, only do it for the first invocation.
280 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
281 initialization to occur in yypush_parse but only on the first
282 invocation.
283
2842006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
285
286 * data/push.c: Add CPP guards around push parser declarations in both
287 the header and the code file.
288 In the code file, move the push parser declarations to the same place
289 they appear in the header file.
290 Clean up the M4 some, especially the inconsistent underquoting in
291 some b4_c_function_def and b4_c_function_decl uses.
292
2932006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
294
295 Encapsulate the push parser state variables into an M4 macro so the
296 push skeleton doesn't have to list them again for pull mode's yyparse.
297 For push mode, remove yypush_parse's local equivalents of these
298 variables to eliminate unnecessary copying between the two sets at
299 run-time. This patch also fixes at least a bug related to multiple
300 %initial-action invocations in push mode.
301 * data/push.c (b4_declare_parser_variables): Rename to...
302 (b4_declare_scanner_communication_variables): ... this for clarity and
303 update both uses.
304 (b4_declare_yyparse_variables): Remove and move its contents to the one
305 spot where it was invoked.
306 (b4_declare_parser_state_variables): New macro containing the parser
307 state variables required by push mode.
308 (struct yypstate): Replace all fields but yynew with
309 b4_declare_parser_state_variables.
310 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
311 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
312 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
313 (yyparse or yypush_parse): For yyparse in pull mode, replace local
314 parser state variable declarations with
315 b4_declare_parser_state_variables.
316 Don't initialize parser state variables when calling yypush_parse since
317 yypstate_new already does that.
318 Invoke the user's initial action only upon the first yypush_parse
319 invocation.
320 Remove all code that copies between the local parser state variables
321 and the yypstate.
322
3232006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
324
325 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
326 prevent a name collision in a future patch where these names will
327 sometimes be #define'd.
328 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
329 since it no longer has the same name as the existing argument.
330 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
331
3322006-12-19 Paolo Bonzini <bonzini@gnu.org>
333 and Joel E. Denny <jdenny@ces.clemson.edu>
334
335 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
336 that the argument is case-insensitive, and there's no `=' here.
337 For the %skeleton entry, mention that %language is better.
338 (Bison Options): Likewise for --language and --skeleton. Move the
339 --skeleton entry so that the `Tuning the parser' section is sorted
340 alphabetically on long options.
341 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
342 %language directive in detail here; cross-reference the %language
343 documentation instead.
344 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
345 `%require "2.3b"' so that the example is always up-to-date.
346 (Bison Symbols): Add entries for %language and %skeleton.
347 * examples/extexi (normalize): Instead of replacing every %require
348 argument with the current Bison version, just substitute for
349 `@value{VERSION}'. This guarantees that we're testing what actually
350 appears in the documentation.
351 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
352 rather than `@VERSION@'.
353
3542006-12-18 Paul Eggert <eggert@cs.ucla.edu>
355
356 * NEWS: Reword the %language news a bit, and put it earlier.
357
358 * src/getargs.c (skeleton_arg): Last arg is now location const *.
359 Rewrite to simplify the logic.
360 (language_argmatch): Likewise.
361 (program_name): We now own this var.
362 * src/getargs.h (struct bison_language): Use char[] rather than
363 const char *.
364
365 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
366 Java is supported.
367 * src/complain.c (program_name): Remove decl; no longer needed.
368 * src/main.c (program_name): Remove; now belongs to getargs.
369
3702006-12-18 Paolo Bonzini <bonzini@gnu.org>
371
372 * NEWS: Document %language.
373
374 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
375
376 * data/c-skel.m4, data/c++-skel.m4: New files.
377 * data/glr.c: Complain on push parsers.
378
379 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
380 over %skeleton.
381 (Directives): Document %language and %skeleton.
382 (Command line): Document -L.
383
384 * examples/extexi: Rewrite %require directive.
385 * examples/calc++/Makefile.am: Pass VERSION to extexi.
386
387 * src/files.c (compute_exts_from_gc): Look in language structure
388 for .y extension.
389 (compute_file_name_parts): Check whether .tab should be added.
390 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
391 (language, skeleton_arg, language_argmatch): New.
392 (long_options): Add --language.
393 (getargs): Use skeleton_arg, add -L/--language.
394 * src/getargs.h: Include location.h.
395 (struct bison_language, language, skeleton_arg, language_argmatch): New.
396 * src/output.c (prepare): Pick default skeleton from struct language.
397 Don't dispatch C skeletons here.
398 * src/parse-gram.y (PERCENT_LANGUAGE): New.
399 (prologue_declaration): Add "%language" rule, use skeleton_arg.
400 * src/scan-gram.l ("%language"): New rule.
401
402 * tests/calc.at: Test %skeleton and %language.
403 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
404 (AT_GLR_IF): Look for %skeleton "glr.cc".
405 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
406 (AT_YACC_IF): Reject %language.
407
4082006-12-18 Paul Eggert <eggert@cs.ucla.edu>
409
410 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
411 since it wasn't used; only the typedef name 'semantic_type' is needed.
412 Also, omit trailing white space.
413
414 * bootstrap: Sync from coreutils.
415 (gnulib_extra_files): Add build-aux/announce.gen.
416 (slurp): Adjust .gitignore files like .cvsignore files.
417 * build-aux/announce-gen: Remove from CVS, since bootstrap
418 now creates this.
419
4202006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
421
422 Make %push-parser imply %pure-parser. This fixes several bugs; see
423 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
424 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
425 pure_parser = true.
426 * data/push.c: Don't bother testing b4_push_if when deciding whether
427 to expand b4_declare_parser_variables globally.
428 (yypush_parse): Likewise in here.
429
430 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
431 (yy_reduce_print): Reformat M4 for readability.
432
4332006-12-15 Bob Rossi <bob@brasko.net>
434 and Joel Denny <jdenny@ces.clemson.edu>
435
436 * data/push.c (yypstate): Add typedef, and update all uses of
437 struct yypstate to just yypstate.
438 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
439
4402006-12-14 Bob Rossi <bob@brasko.net>
441
442 * data/push.c (yypush_parse): Declare prototype regardless of
443 %locations option.
444
4452006-12-14 Bob Rossi <bob@brasko.net>
446
447 * data/push.c (yyparse): Remove the prototype and the #define when in
448 push-parser mode.
449
4502006-12-13 Bob Rossi <bob@brasko.net>
451
452 * data/push.c (yypstate_init): Rename to...
453 (yypstate_new): ... this and use b4_c_function_def.
454 (yypstate_delete): New.
455 (yypush_parse): Change parameters yynval and yynlloc to be const.
456 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
457 yypstate_delete functions.
458
4592006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
460
461 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
462 strange test case titles. Reported by Bob Rossi.
463
4642006-12-13 Paul Eggert <eggert@cs.ucla.edu>
465
466 * TODO: Add pointer to Sylvain Schmitz's work on static detection
467 of potential ambiguities in GLR grammers.
468
4692006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
470
471 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
472 `bison ', use m4_index instead of m4_substr since chopping up a string
473 containing M4-special characters causes problems here.
474
475 Fix a couple of bugs related to special characters in user-specified
476 file names, and make it easier for skeletons to compute output file
477 names with the same file name prefix as Bison-computed output file
478 names.
479 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
480 b4_parser_file_name and b4_spec_defines_file instead of
481 @output_parser_name@ and @output_header_name@, which are now redundant.
482 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
483 b4_parser_file_name, b4_spec_defines_file, and the new
484 @basename(FILENAME@) instead of @output_parser_name@ and
485 @output_header_name@, which inappropriately escaped the file names as
486 C string literals.
487 * src/files.c (all_but_ext): Remove static qualifier.
488 (compute_output_file_names): Move `free (all_but_ext)' to...
489 (output_file_names_free): ... here since all_but_ext is needed later.
490 * src/files.h (all_but_ext): Extern.
491 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
492 exactly what MUSCLE_INSERT_STRING used to do.
493 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
494 characters are escaped properly.
495 * src/output.c (prepare): Define muscle file_name_all_but_ext as
496 all_but_ext.
497 For pkgdatadir muscle, maintain previous functionality by using
498 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
499 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
500 digraphs would never be expanded. Hopefully no one has M4-special
501 characters in his Bison installation path.
502 * src/scan-skel.l: Don't parse @output_header_name@ and
503 @output_parser_name@ anymore since they're now redundant.
504 In @output, use decode_at_digraphs.
505 Parse a new @basename command that invokes last_component.
506 (decode_at_digraphs): New.
507 (BASE_QPUTS): Remove unused.
508 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
509 (Output file name): New tests.
510
5112006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
512
513 Warn about output files that are generated by the skeletons and that
514 conflict with other output files.
515 * data/glr.c: Don't generate the header file here when glr.cc does.
516 * src/files.c (file_names, file_names_count): New static globals.
517 (compute_output_file_names): Invoke output_file_name_check for files
518 not generated by the skeletons and remove existing checks.
519 (output_file_name_check): New function that warns about conflicting
520 output file names.
521 (output_file_names_free): Free file_names.
522 * src/files.h (output_file_name_check): Declare.
523 * src/scan-skel.l: Invoke output_file_name_check for files generated by
524 the skeletons.
525 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
526 (Conflicting output files): New tests.
527
5282006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
529
530 * doc/bison.texinfo: Fix a couple of typos.
531
5322006-12-08 Bob Rossi <bob@brasko.net>
533
534 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
535 Rename to...
536 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
537 update all uses.
538 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
539 (yypush_parse): Rename yypvars argument to yyps and remove redundant
540 local pv.
541 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
542 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
543
5442006-12-07 Bob Rossi <bob@brasko.net>
545 and Joel Denny <jdenny@ces.clemson.edu>
546
547 * data/push.c (yypvarsinit): Change return type from void* to struct
548 yypvars*. No longer cast to void* on return.
549 (struct yypvars): Remove yylen since it need not be remembered between
550 yypushparse invocations.
551 (yypushparse): Don't copy between yylen and pv->yylen.
552
5532006-12-05 Bob Rossi <bob@brasko.net>
554
555 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
556 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
557 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
558 (struct yypvars): Remove b4_declare_parser_variables.
559 (yypvarsinit): Remove init code for removed variables.
560 (global scope): Do not declare b4_declare_parser_variables if
561 push or pure mode.
562 (yypushparse): Add b4_declare_parser_variables.
563 Init new local variables, and remove init code for removed
564 yypvars variables.
565 (yyparse): Delete.
566 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
567 and yyparse for other modes.
568 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
569 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
570 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
571 (AT_PURE_LEX_IF): True if pure or push parser.
572
5732006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
574
575 Document Yacc prologue alternatives and default %destructor's and
576 %printer's as experimental. Don't mention Java yet. Discussed at
577 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
578 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
579 (2.3a): Annotate this entry to say the old forms of these features were
580 also experimental.
581 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
582 Bison Symbols): Say they're experimental. Comment out any mention
583 of Java (we'll want this back eventually).
584
5852006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
586
587 Support a file name argument to %defines. Deprecate `=' in
588 %file-prefix, %name-prefix, and %output. Discussed at
589 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
590 * NEWS (2.3a+): Mention.
591 * doc/bison.texinfo (Decl Summary, Bison Symbols): Add entry for new
592 form of %defines, and remove `=' from entries for %file-prefix,
593 %name-prefix, and %output.
594 * src/parse-gram.y (prologue_declaration): Implement.
595 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
596 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
597 all but one occurrence of %name-prefix.
598 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
599 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
600 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
601 occurrence of each of %file-prefix and %output. Add check for %defines
602 with argument.
603 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
604 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
605 Remove the `=' from %output.
606
6072006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
608
609 Don't escape $ in test case titles since Autoconf 2.61 now does that
610 correctly.
611 * tests/actions.at (Default %printer and %destructor are not for error
612 or $undefined): Here.
613 (Default %printer and %destructor are not for $accept): Here.
614 * tests/input.at (Invalid $n and @n): Here.
615
6162006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
617
618 Rename <!> to <>. Discussed starting at
619 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
620 * NEWS (2.3a+): Update.
621 * doc/bison.texinfo (Freeing Discarded Symbols, Bison Symbols):
622 Update.
623 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
624 * src/scan-gram.l (INITIAL): Implement.
625 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
626 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
627 comment.
628 * tests/actions.at (Default tagless %printer and %destructor,
629 Default tagged and per-type %printer and %destructor,
630 Default %printer and %destructor are not for error or $undefined,
631 Default %printer and %destructor are not for $accept,
632 Default %printer and %destructor for mid-rule values): Update.
633 * tests/input.at (Default %printer and %destructor redeclared,
634 Unused values with default %destructor): Update.
635
6362006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
637
638 Don't let %prec take a nonterminal.
639 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
640 token.
641 * tests/input.at (%prec takes a token): New test checking that %prec
642 won't take a nonterminal.
643
6442006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
645
646 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
647 it was double-quoted.
648 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
649 grammar is maintained with Bison's highest standards.
650 * src/getargs.c: Fix some typos in Doxygen comments.
651
6522006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
653
654 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
655 later. Reported by Paul Eggert in
656 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
657 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
658 * src/scan-code.l (translate_action): Don't bother invoking
659 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
660 (code_scanner_free): Instead of invoking
661 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
662 which frees more.
663 * src/scan-gram.l (gram_scanner_free): Likewise.
664 * src/scan-skel.l (scan_skel): Likewise.
665
6662006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
667
668 * src/files.c (tr): Change return type to void.
669 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
670 has been called previously for the same key.
671 (muscle_find): Return storage instead of value so that
672 --enable-gcc-warnings doesn't produce warnings that the return discards
673 const. aver that the value and storage are the same since storage
674 could potentially be NULL when value is not.
675 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
676 same as 0.
677
6782006-11-08 Paul Eggert <eggert@cs.ucla.edu>
679
680 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
681 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
682 us a slightly cleaner distribution, and also works.
683 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
684 gnulib changes.
685
6862006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
687 and Paul Eggert <eggert@cs.ucla.edu>
688
689 Don't let Bison leak memory except when it complains.
690 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
691 (spec_defines_file, dir_prefix): Now char *, not const char *,
692 since they are freed.
693 * src/files.c: Likewise.
694 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
695 Likewise.
696 (tr): Now operates in-place. All uses changed.
697 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
698 values.
699 (compute_file_name_parts, compute_output_file_names): Don't store
700 read-only data in variables that will be freed.
701 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
702 src_extension, and header_extension.
703 (output_file_names_free): New public function to free
704 spec_verbose_file, spec_graph_file, spec_defines_file,
705 parser_file_name, and dir_prefix.
706 * src/getargs.c (getargs): Don't store read-only data in variables that
707 will be freed.
708 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
709 (which previously existed but was unused), and quotearg_free.
710 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
711 * src/muscle_tab.c: Likewise.
712 (muscle_entry): Make the value char const *,
713 and add a new storage member that is char * and can be freed.
714 (muscle_entry_free): New private function.
715 (muscle_init): Use it instead of free.
716 (muscle_insert, muscle_grow): Update and use new storage member.
717 (muscle_code_grow): Free the string passed to muscle_grow
718 since it's not needed anymore.
719 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
720 add a new `char *code' member.
721 ("{...}"): Declare semantic type as code.
722 * src/scan-code.h (translate_rule_action):
723 (translate_symbol_action, translate_code, translate_action): Return
724 `char const *' rather than `char *' since external code should not free
725 these strings.
726 * src/scan-code.l: Likewise.
727 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
728 which is "{...}" in the parser.
729 * tests/Makefile.am (maintainer-check-valgrind): Set
730 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
731 Valgrind.
732 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
733 complain.
734 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
735 expecting a non-zero exit status sets --leak-check=summary and
736 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
737 this case, and we don't want to hear about it.
738
7392006-11-08 Paul Eggert <eggert@cs.ucla.edu>
740
741 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
742 instead of from the template, to simplify configuration a bit.
743 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
744 and m4/wint_t.m4, as they are needed with the latest gnulib.
745
7462006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
747
748 Disable unset/unused mid-rule value warnings by default, and recognize
749 --warnings=midrule-values to enable them. Discussed starting at
750 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
751 * NEWS (2.3a+): Mention.
752 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
753 warnings): Add entry for midrule-values subargument.
754 * src/reader.c (symbol_should_be_used): Don't return true just because
755 the value is a set/used mid-rule value unless
756 --warnings=midrule-values was specified.
757 * tests/input.at (Unused values, Unused values before symbol
758 declarations): Run tests with and without --warnings=midrule-values.
759
760 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
761 than LIST_FREE directly.
762
7632006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
764
765 Finish implementing --warnings=error, which should not be implied by
766 --warnings=all (or by its synonyms -W and --warnings without
767 subarguments).
768 * src/complain.c (set_warning_issued): New function to report that
769 warnings are being treated as errors and to record an error if so.
770 Invoke...
771 (warn_at, warn): ... here.
772 * src/getargs.c (warnings_args, warnings_types): Reorder so that
773 "error - warnings are errors" does not appear above "all - all of the
774 above".
775 (getargs): For -W and --warnings without subarguments, don't let
776 FLAGS_ARGMATCH set warnings_error in warnings_flag.
777 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
778
7792006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
780
781 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
782 empty subargument list. For example: `bison --warnings= parser.y'.
783
7842006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
785
786 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
787 the parser header file so that gcc doesn't warn.
788
7892006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
790
791 Split the default %destructor/%printer into two kinds: <*> and <!>.
792 Discussed starting at
793 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
794 * NEWS (2.3a+): Mention.
795 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
796 previous change today related to mid-rules.
797 (Bison Symbols): Remove %symbol-default and add <*> and <!>.
798 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
799 (TYPE_TAG_ANY): Add as <*>.
800 (TYPE_TAG_NONE): Add as <!>.
801 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
802 for <*> and <!>.
803 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
804 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
805 * src/symlist.c (symbol_list_default_new): Split into tagged and
806 tagless versions.
807 (symbol_list_destructor_set, symbol_list_printer_set): Split
808 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
809 SYMLIST_DEFAULT_TAGLESS.
810 * src/symlist.h: Update symbol_list_default*_new prototypes.
811 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
812 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
813 * src/symtab.c (default_destructor, default_destructor_location,
814 default_printer, default_printer_location): Split each into tagged and
815 tagless versions.
816 (symbol_destructor_get, symbol_destructor_location_get,
817 symbol_printer_get, symbol_printer_location_get): Implement tagged
818 default and tagless default cases.
819 (default_destructor_set, default_printer_set): Split each into tagged
820 and tagless versions.
821 * src/symtab.h: Update prototypes.
822 * tests/actions.at (Default %printer and %destructor): Rename to...
823 (Default tagless %printer and %destructor): ... this, and extend.
824 (Per-type %printer and %destructor): Rename to...
825 (Default tagged and per-type %printer and %destructor): ... this, and
826 extend.
827 (Default %printer and %destructor for user-defined end token): Extend.
828 (Default %printer and %destructor are not for error or $undefined):
829 Update.
830 (Default %printer and %destructor are not for $accept): Update.
831 (Default %printer and %destructor for mid-rule values): Extend.
832 * tests/input.at (Default %printer and %destructor redeclared): Extend.
833 (Unused values with default %destructor): Extend.
834
8352006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
836
837 Don't apply the default %destructor/%printer to an unreferenced midrule
838 value. Mentioned at
839 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
840 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
841 like $@n instead of just @n so that the default %destructor/%printer
842 logic doesn't see them as user-defined symbols.
843 (symbol_is_dummy): Check for both forms of the name.
844 * src/reader.c (packgram): Remove the `$' from each midrule symbol
845 name for which the midrule value is referenced in any action.
846 * tests/actions.at (Default %printer and %destructor for mid-rule
847 values): New test.
848 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
849 for change to dummy symbol names.
850
8512006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
852
853 Warn about unset midrule $$ if the corresponding $n is used.
854 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
855 $n usage.
856 (packgram): Before invoking grammar_rule_check on any rule, make sure
857 all actions have already been scanned in order to set `used' flags.
858 Otherwise, checking that a midrule's $$ is set will not always work
859 properly because the midrule check must forward-reference the midrule's
860 parent rule.
861 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
862 warning.
863
8642006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
865
866 More improvements to the documentation of the prologue alternatives:
867 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
868 Bison manual.
869 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
870 some text to clarify the relative importance of the new directives and
871 to show how these directives may be viewed as code labels.
872
8732006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
874
875 Similar to the recently removed %before-header, add %code-top as the
876 alternative to the pre-prologue. Mentioned at
877 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
878 Also, let the prologue alternatives appear in the grammar section.
879 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
880 (prologue_declaration): Move the existing prologue alternatives to...
881 (grammar_declaration): ... here and add %code-top.
882 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
883
884 Clean up and extend documentation for the prologue alternatives.
885 * NEWS (2.3a+): Describe prologue alternatives.
886 * doc/bison.texinfo (Prologue): Move discussion of prologue
887 alternatives to...
888 (Prologue Alternatives): ... this new section, and extend it to discuss
889 all 4 directives in detail.
890 (Bison Symbols): Clean up discussion of prologue alternatives and add
891 %code-top.
892
8932006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
894
895 DJGPP specific issues.
896
897 * djgpp/config.bat: config.hin has been moved to lib. Adjust
898 config.bat accordingly.
899 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
900 * djgpp/config.site: Likewise.
901
9022006-10-16 Paolo Bonzini <bonzini@gnu.org>
903
904 Replace %*-header with %provides, %requires, %code. See discussion at
905 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
906
907 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
908 (b4_user_start_header): Remove.
909 * data/glr.c: Use new macros instead of b4_*start_header
910 and b4_*end_header.
911 * data/glr.cc: Likewise.
912 * data/lalr1.cc: Likewise.
913 * data/push.c: Likewise.
914 * data/yacc.c: Likewise.
915
916 * doc/bison.texinfo: Remove %before-header, rename
917 %{start,end,after}-header to %requires, %provides, %code.
918
919 * src/parse-gram.y: Likewise (also rename token names accordingly).
920 * src/scan-gram.l: Likewise.
921 * tests/actions.at: Likewise.
922
9232006-10-14 Paul Eggert <eggert@cs.ucla.edu>
924
925 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
926 Problem reported by Joel E. Denny.
927
9282006-10-14 Jim Meyering <jim@meyering.net>
929
930 (Sync from coreutils.)
931 Work also when the working directory (with e.g. coreutils sources)
932 is version controlled with git, rather than CVS.
933 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
934 rather than CVS.
935 In messages and comments, say e.g., "checked-out sources",
936 rather than "CVS sources".
937 (version_controlled_file): New function. Work for git as well as
938 for CVS. Don't use grep's -q option.
939 (slurp): Call it here, in place of CVS-specific code.
940
9412006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
942
943 Fix testsuite for ./configure --enable-gcc-warnings:
944 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
945 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
946 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
947 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
948 * test/regression.at (Diagnostic that expects two alternatives):
949 Likewise.
950
9512006-10-12 Paul Eggert <eggert@cs.ucla.edu>
952
953 * bootstrap.conf (gnulib_modules): Add config-h.
954 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
955 worry about HAVE_CONFIG_H.
956 * lib/abitset.c: Likewise.
957 * lib/bitset.c: Likewise.
958 * lib/bitset_stats.c: Likewise.
959 * lib/bitsetv-print.c: Likewise.
960 * lib/bitsetv.c: Likewise.
961 * lib/ebitset.c: Likewise.
962 * lib/get-errno.c: Likewise.
963 * lib/lbitset.c: Likewise.
964 * lib/subpipe.c: Likewise.
965 * lib/timevar.c: Likewise.
966 * lib/vbitset.c: Likewise.
967 * lib/bitset.c: Include "bitset.h" first, to test interface.
968 * lib/bitset_stats.c: Include "bitset_stats.h" first.
969 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
970 * lib/bitsetv.c: Include "bitsetv.h" first.
971 * lib/get-errno.c: Include "get-errno.h" first.
972 * m4/.cvsignore: Add config-h.m4.
973 * tests/actions.at (Default %printer and %destructor for ...):
974 Adjust expected line numbers in output to reflect removal of #if
975 HAVE_CONFIG_H lines.
976 * tests/glr-regression.at (Missed %merge type warnings when ...):
977 Likewise.
978 * tests/regression.at (Braced code in declaration in rules section):
979 Likewise.
980 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
981 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
982 Include <config.h> unconditionally.
983
984 * bootstrap: Sync from coreutils, as follows:
985
986 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
987
988 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
989 variable was sometimes used without being initialized. This
990 messed up the installation of the INSTALL file in some cases.
991
992 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
993
994 * bootstrap (usage, main program, symlink_to_gnulib): Add option
995 --copy. Inspired by a suggestion from Bruno Haible.
996
997 2006-10-03 Jim Meyering <jim@meyering.net>
998
999 * bootstrap: Undo last change to this file, since now gnulib-tool
1000 sticks with the automake default in generating dependencies.
1001
10022006-10-12 Paul Eggert <eggert@cs.ucla.edu>
1003
1004 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
1005 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
1006
1007 * doc/bison.1: Add copyright notice.
1008
1009 * data/glr.c: Don't include <stdarg.h>; not used.
1010
1011 * NEWS: The -g and --graph options now output graphs in Graphviz
1012 DOT format, not VCG format.
1013 * doc/bison.1: Likewise.
1014 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
1015 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
1016 of this change in
1017 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
1018 * TODO: Remove Graphviz entry.
1019 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
1020 remove vcg.c, vcg.h, vcg_defaults.h.
1021 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
1022 * src/graphviz.c, src/graphviz.h: New files.
1023 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
1024 * src/files.h: Make comment more generic.
1025 * src/main.c (main): Likewise.
1026 * src/print_graph.h: Likewise.
1027 * src/getargs.c (usage): Make usage description more generic.
1028 * src/print_graph.c: Include graphviz.h rather than vcg.h.
1029 (static_graph, fgraph): Remove. All uses changed to pass
1030 arguments instead of sharing a static var.
1031 (print_core, print_actions, print_state, print_graph):
1032 Output graphviz format rather than VCG format.
1033 * tests/.cvsignore: Remove *.vcg; add *.dot.
1034 * tests/output.at: Expect *.dot files, not *.vcg files.
1035
1036 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
1037 accommodates the 2006-10-08 change.
1038
10392006-10-11 Bob Rossi <bob@brasko.net>
1040
1041 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
1042 (b4_yyssa, b4_yyerror_range): New macros.
1043 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
1044 (yypvarsinit): Remove init of removed fields.
1045 (yypushparse): Remove use of removed fields; use new macros instead.
1046
10472006-10-11 Paul Eggert <eggert@cs.ucla.edu>
1048
1049 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
1050 in a push parser. Reindent slightly to match yacc.c better.
1051
10522006-10-11 Bob Rossi <bob@brasko.net>
1053
1054 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
1055 yymsg_alloc fields.
1056 (yypvarsinit, yypushparse): Remove init of removed fields.
1057 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
1058
10592006-10-09 Paul Eggert <eggert@cs.ucla.edu>
1060
1061 * THANKS: Add Paolo Bonzini and Bob Rossi.
1062
10632006-10-08 Paolo Bonzini <bonzini@gnu.org>
1064
1065 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
1066 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
1067 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
1068 b4_define_user_cde and uses): Remove.
1069 (b4_comment, b4_prefix, b4_sync_start): New.
1070 * data/bison.m4: New file, with most of the content removed from c.m4.
1071 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
1072 * src/output.c (output_skeleton): Pass bison.m4.
1073 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
1074 only if specified.
1075
10762006-10-05 Paul Eggert <eggert@cs.ucla.edu>
1077
1078 Fix test failure reported by Tom Lane in
1079 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
1080 and try to make such failures easier to catch in the future.
1081 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
1082 that's now the caller's responsibility.
1083 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
1084 Set yychar = YYEOF if it's negative.
1085 * tests/actions.at (yylex): Abort if asked to read past EOF.
1086 * tests/conflicts.at (yylex): Likewise.
1087 * tests/cxx-type.at (yylex): Likewise.
1088 * tests/glr-regression.at (yylex): Likewise.
1089 * tests/input.at (yylex): Likewise.
1090 * tests/regression.at (yylex): Likewise.
1091 * tests/torture.at (yylex): Likewise.
1092
10932006-10-01 Paul Eggert <eggert@cs.ucla.edu>
1094
1095 Fix problems with translating English-language diagnostics.
1096 * bootstrap: Fix bug introduced in recent bootstrap changes, with
1097 respect to bison-runtime pot generation. The YY_ stuff
1098 wasn't being captured.
1099 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
1100 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
1101 * runtime-po/POTFILES.in: Add data/push.c.
1102
11032006-09-29 Paul Eggert <eggert@cs.ucla.edu>
1104
1105 Merge bootstrap changes from coreutils.
1106
1107 2006-09-28 Jim Meyering <jim@meyering.net>
1108
1109 Automatically generated dependencies are important even
1110 when all of the sources in a directory come from gnulib.
1111 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
1112 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
1113
1114 2006-09-23 Jim Meyering <jim@meyering.net>
1115
1116 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
1117
1118 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1119
1120 * bootstrap: Add support for --force.
1121 (usage): New function. Describe usage less tersely.
1122 (CVS_only_file): New var.
1123
11242006-09-21 Paul Eggert <eggert@cs.ucla.edu>
1125
1126 * data/push.c (YYPUSH_MORE): Make it an enum instead.
1127 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
1128 Adjust white space and comments to match GNU style better.
1129
11302006-09-20 Bob Rossi <bob@brasko.net>
1131
1132 * data/push.c (yyresult_get): Remove function.
1133 (YYPUSH_MORE): Add #define.
1134 (yypushparse): Modify return value.
1135
11362006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1137
1138 * stamp-h.in: Remove; no longer needed.
1139 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
1140 Remove config.h, config.hin, intl (no longer created).
1141 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
1142 stamp-h1.
1143
1144 Sync bootstrap from coreutils, as follows:
1145
1146 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
1147
1148 * bootstrap (symlink_to_gnulib): New function.
1149 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
1150 to copies-of-gnulib.
1151 (cp_mark_as_generated, slurp, gnulib_files):
1152 Avoid making a copy if it's the same as the old version.
1153 (gnulib_files): Add support for this variable (used by Bison).
1154
11552006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1156
1157 * src/getargs.c (usage): Rework to use conventions similar to
1158 coreutils, to make translation a bit easier and the code a bit
1159 smaller. Problem reported by Tim Van Holder.
1160
11612006-09-15 Paul Eggert <eggert@cs.ucla.edu>
1162
1163 Use some of gnulib's new modules, taken from coreutils.
1164
1165 * bootstrap: Sync from coreutils, except add support for gnulib_files.
1166 * bootstrap.conf: New file.
1167 (gnulib_modules): Add configmake, inttypes, unistd.
1168 (XGETTEXT_OPTIONS): Add complain, complain_at,
1169 fatal, fatal_at, warn, warn_at, unexpected_end.
1170 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
1171 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
1172 (gl_EARLY): Add.
1173 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
1174 (gl_INIT): Add
1175 (GNULIB_AUTOCONF_SNIPPET): Remove.
1176 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
1177 the pickiest.
1178 * lib/.cvsignore: Add inttypes_.h.
1179 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
1180 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
1181 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
1182 no-longer-necessary initializations.
1183 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
1184 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
1185 use the unistd module.
1186 * src/system.h: Likewise.
1187 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
1188 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
1189 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
1190 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
1191 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
1192 * src/system.h: Include inttypes.h unconditionally, now that we
1193 use the inttypes module. Don't bother to include stdint.h, since
1194 inttypes.h now does that for us.
1195 (LOCALEDIR): Remove, now that we use the configmake module.
1196 * src/getargs.c: Include configmake.h.
1197 * src/main.c: Likewise.
1198 * src/output.c: Likewise.
1199 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
1200 not from $abs_top_builddir, since config.h moved.
1201
1202
1203 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
1204 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
1205
1206 * src/parse-gram.y (symbol_declaration): Don't put statements
1207 before declarations; it's not portable to C89.
1208 * src/scan-code.l (handle_action_at): Likewise.
1209
1210 * src/scan-code.l: Always initialize braces_level; the old code
1211 left it uninitialized and therefore had undefined behavior.
1212
1213 Don't attempt to redefine 'assert', since it runs afoul of
1214 systems where standard headers (mistakenly) include <assert.h>.
1215 Instead, define and use our own alternative, called 'aver'.
1216 * src/reader.c: Don't include assert.h, since we no longer
1217 use assert.
1218 * src/scan-code.l: Likewise.
1219 * src/system.h (assert): Remove, replacing with....
1220 (aver): New function, taking a bool arg. All uses changed.
1221 * src/tables.c (pack_vector): Ensure that aver arg is bool,
1222 not merely an integer.
1223
12242006-09-15 Bob Rossi <bob@brasko.net>
1225
1226 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
1227 * data/c.m4 (YYPUSH): New.
1228 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
1229 * src/getargs.c (push_parser): New var.
1230 * src/getargs.h (push_parser): New declaration.
1231 * src/output.c (prepare): Add macro insertion of `push_flag'.
1232 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
1233 (prologue_declaration): Parse %push-parser.
1234 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
1235 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
1236 list of removed lines from the traces observed.
1237 (AT_CHECK_CALC_LALR): Added push parser tests.
1238
12392006-09-13 Paul Eggert <eggert@cs.ucla.edu>
1240
1241 * NEWS: Version 2.3a.
1242 * configure.ac (AC_INIT): Likewise.
1243
1244 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
1245 "#define YYSTYPE int" that caused "make maintainer-check" to fail
1246 due to header ordering dependencies. I don't know why the #define
1247 was there.
1248
1249 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
1250 runtime cost when YYDEBUG is not defined, and so that some tests
1251 that used to fail now work. Problem and initial suggestion by
1252 Paolo Bonzini.
1253 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
1254 * data/glr.cc (b4_parser_class_name):
1255 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
1256 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
1257 (yydebug_) [YYDEBUG]: New member.
1258 (yycdebug_): Now defined only if YYDEBUG.
1259 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
1260 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
1261 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
1262 if YYYDEBUG.
1263 (debug_stream, set_debug_stream, debug_level, set_debug_level):
1264 Define only if YYDEBUG.
1265 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
1266 set_debug_level.
1267 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
1268 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
1269 AT_CHECK_CALC_GLR_CC that are working now.
1270
12712006-09-12 Paul Eggert <eggert@cs.ucla.edu>
1272
1273 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
1274 We don't need them in glr.cc, and glr.c defines them.
1275 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
1276 assumes that defining it to anything is the same as defining
1277 it to 1. Problem reported by Paolo Bonzini.
1278
12792006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
1280
1281 * data/c.m4 (b4_null, b4_case): Define.
1282 * src/output.c (prepare_symbols): Use b4_null.
1283 (user_actions_output): Use b4_case.
1284
12852006-09-11 Paul Eggert <eggert@cs.ucla.edu>
1286
1287 * data/glr.c (b4_shared_declarations): Put start-header first,
1288 before any #includes that we generate, so that feature-test
1289 macros work. Problem reported by Michael Deutschmann in
1290 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
1291 * data/lalr1.cc: Likewise.
1292 * doc/bison.texinfo (Prologue): Document that feature-test macros
1293 should be defined before any Bison declarations.
1294 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
1295 that depend on location.hh after, not before, Bison decls, since
1296 we now include location.hh after the first user prologue.
1297
1298 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
1299 Sander Brandenburg in
1300 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
1301 Also, fix minor white space and comment issues.
1302 (Prologue): Mention that it's better to define feature-test macros
1303 before Bison declarations. Problem reported by Michael Deutschmann.
1304
1305 * README-cvs: Fix typo: "&" should be "&&". Problem reported
1306 by Jim Meyering.
1307 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
1308 This adjusts to recent gnulib changes.
1309
13102006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
1311
1312 Finish implementation of per-type %destructor/%printer. Discussed
1313 starting at
1314 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
1315 and
1316 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
1317 * NEWS (2.3+): Add a description of this feature to the default
1318 %destructor/%printer description.
1319 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
1320 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
1321 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
1322 list node contains a semantic type.
1323 * src/symtab.c, src/symtab.h: Extend with a table that associates
1324 semantic types with their %destructor's and %printer's.
1325 (semantic_type_from_uniqstr, semantic_type_get,
1326 semantic_type_destructor_set, semantic_type_printer_set): New functions
1327 composing the public interface of that table.
1328 (symbol_destructor_get, symbol_destructor_location_get,
1329 symbol_printer_get, symbol_printer_location_get): If there's no
1330 per-symbol %destructor/%printer, look up the per-type before trying
1331 the default.
1332 * tests/actions.at (Per-type %printer and %destructor): New test case.
1333 * tests/input.at (Default %printer and %destructor redeclared):
1334 Extend to check that multiple occurrences of %symbol-default in a
1335 single %destructor/%printer declaration is an error.
1336 (Per-type %printer and %destructor redeclared, Unused values with
1337 per-type %destructor): New test cases.
1338
13392006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
1340
1341 Require default %destructor/%printer to be declared using
1342 %symbol-default instead of an empty symbol list, and start working on
1343 new per-type %destructor/%printer. Discussed at
1344 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
1345 * NEWS (2.3+): Add %symbol-default to example.
1346 * bison.texinfo (Freeing Discarded Symbols): Likewise.
1347 (Bison Symbols): Add entry for %symbol-default.
1348 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
1349 (generic_symlist, generic_symlist_item): New nonterminals for creating
1350 a list in which each item is a symbol, semantic type, or
1351 %symbol-default.
1352 (grammar_declaration): Use generic_symlist in %destructor and %printer
1353 declarations instead of symbols.1 or an empty list.
1354 (symbol_declaration, precedence_declaration, symbols.1): Update actions
1355 for changes to symbol_list.
1356 * src/reader.c: Update for changes to symbol_list.
1357 * src/scan-code.l: Likewise.
1358 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
1359 * src/symlist.c, src/symlist.h: Extend such that a list node may
1360 represent a semantic type or a %symbol-default in addition to just an
1361 ordinary symbol. Add switched functions for setting %destructor's and
1362 %printer's.
1363 * tests/actions.at, tests/input.at: Add %symbol-default to all default
1364 %destructor/%printer declarations.
1365
13662006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
1367
1368 Whether the default %destructor/%printer applies to a particular symbol
1369 isn't a question of whether the user *declares* that symbol (in %token,
1370 for example). It's a question of whether the user by any means
1371 *defines* the symbol at all (by simply using a char token, for
1372 example). $end is defined by Bison whereas any other token with token
1373 number 0 is defined by the user. The error token is always defined by
1374 Bison regardless of whether the user declares it with %token, but we
1375 may one day let the user define error as a nonterminal instead.
1376 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
1377 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
1378 the meaning of "user-defined".
1379 * tests/actions.at (Default %printer and %destructor for user-declared
1380 end token): Rename to...
1381 (Default %printer and %destructor for user-defined end token): ...
1382 this.
1383
1384 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
1385 computation of whether to apply the default, don't maintain a list of
1386 every Bison-defined symbol. Instead, just check for a first character
1387 of '$', which a user symbol cannot have, and check for the error token.
1388
13892006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
1390
1391 Don't apply the default %destructor or %printer to the error token,
1392 $undefined, or $accept. This change fits the general rule that the
1393 default %destructor and %printer are only for user-declared symbols,
1394 and it solves several difficulties that are described in the new test
1395 cases listed below.
1396 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
1397 * tests/actions.at (Default %printer and %destructor are not for error
1398 or $undefined, Default %printer and %destructor are not for $accept):
1399 New test cases.
1400
14012006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
1402
1403 Allow %start after the first rule.
1404 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
1405 when parsing the first rule.
1406 (check_and_convert_grammar): Search for it here after all grammar
1407 declarations have been parsed. Skip midrules, which have dummy LHS
1408 nonterminals.
1409 * src/symtab.c (symbol_is_dummy): New function.
1410 * src/symtab.h (symbol_is_dummy): Declare it.
1411 * tests/input.at (%start after first rule): New test.
1412
14132006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
1414
1415 Redo some of the previous commit: add back the ability to use
1416 non-aliased/undeclared string literals since it might be useful to
1417 those declaring %token-table.
1418 * src/reader.c (check_and_convert_grammar): Undo changes in previous
1419 commit: don't worry about complaints from symbols_pack.
1420 * src/symtab.c (symbol_new, symbol_class_set,
1421 symbol_check_alias_consistency): Undo changes in previous commit: count
1422 each string literal as a new symbol and token, assign it a symbol
1423 number, and don't complain about non-aliased string literals.
1424 (symbols_pack): Since symbol_make_alias still does not decrement symbol
1425 and token counts but does still set aliased tokens to the same number,
1426 symbol_pack_processor now leaves empty slots in the symbols array.
1427 Remove those slots.
1428 * tests/regression.at (Undeclared string literal): Remove test case
1429 added in previous commit since non-aliased string literals are allowed
1430 again.
1431 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
1432 remove unnecessary string literal declarations.
1433 * tests/sets.at (Firsts): Likewise.
1434
14352006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
1436
1437 Don't allow an undeclared string literal, but allow a string literal to
1438 be used before its declaration.
1439 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
1440 symbols_pack complained.
1441 * src/symtab.c (symbol_new): Don't count a string literal as a new
1442 symbol.
1443 (symbol_class_set): Don't count a string literal as a new token, and
1444 don't assign it a symbol number since symbol_make_alias does that.
1445 (symbol_make_alias): It's not necessary to decrement the symbol and
1446 token counts anymore. Don't assume that an alias declaration occurs
1447 before any uses of the identifier or string, and thus don't assert that
1448 one of them has the highest symbol number so far.
1449 (symbol_check_alias_consistency): Complain if there's a string literal
1450 that wasn't declared as an alias.
1451 (symbols_pack): Bail if symbol_check_alias_consistency failed since
1452 symbol_pack asserts that every token has been assigned a symbol number
1453 although undeclared string literals have not.
1454 * tests/regression.at (String alias declared after use, Undeclared
1455 string literal): New test cases.
1456 (Characters Escapes, Web2c Actions): Declare string literals as
1457 aliases.
1458 * tests/sets.at (Firsts): Likewise.
1459
14602006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
1461
1462 In the grammar scanner, STRING_FINISH unclosed constructs and return
1463 them to the parser in order to improve error messages.
1464 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
1465 SC_BRACED_CODE, SC_PROLOGUE): Implement.
1466 * tests/input.at (Unclosed constructs): New test case.
1467 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
1468 seen.
1469
1470 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
1471 unused global.
1472
14732006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
1474
1475 Handle string aliases for character tokens correctly.
1476 * src/symtab.c (symbol_user_token_number_set): If the token has an
1477 alias, check and set its alias's user token number instead of its own,
1478 which is set to indicate the alias. Previously, every occurrence of
1479 the character token in the grammar overwrote that alias indicator with
1480 the character code.
1481 * tests/input.at (String aliases for character tokens): New test.
1482
14832006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
1484
1485 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
1486
14872006-08-11 Paul Eggert <eggert@cs.ucla.edu>
1488
1489 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
1490 to prevent failures when building on older platforms.
1491 Check for autopoint failure.
1492 Set XGETTEXT_OPTIONS to values that check for C format strings,
1493 so that translators are warned about them (this also helps
1494 prevent core dumps).
1495
1496 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
1497 function, since it simplifies our code a bit.
1498
1499 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
1500 rather than -W, so we don't get bogus warnings about sign comparisons.
1501 Add -Wpointer-arith, since that warning is useful (it reports code
1502 that does not conform to C89 and that some compilers reject).
1503 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
1504 since it's no longer needed.
1505
15062006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
1507
1508 Clean up scanners a bit.
1509 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
1510 definitions so gcc won't warn when obstack_for_string is unused.
1511 * src/scan-code.l: config.h and system.h are already #include'd by
1512 scan-code-c.c, so get rid of them here.
1513 * src/scan-gram.l: Likewise.
1514 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
1515 definitions rather than duplicating the rest of it.
1516 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
1517
15182006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
1519
1520 Suppress signed/unsigned comparison warnings for yycheck.
1521 * data/c.m4 (b4_safest_int_type): New macro.
1522 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
1523 a signed int type, cast it to b4_safest_int_type first.
1524 * data/yacc.c: Likewise.
1525 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
1526 also overwritten.
1527
15282006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
1529
1530 * doc/bison.texinfo: Fix some typos.
1531
15322006-08-02 Paul Eggert <eggert@cs.ucla.edu>
1533
1534 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
1535 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
1536
1537 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
1538 the latest gnulib does this a different way.
1539 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
1540 translation was patched, so stop omitting it.
1541
15422006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1543
1544 Enable declaration of default %printer/%destructor. Make the parser
1545 use these for all user-declared grammar symbols for which the user does
1546 not declare a specific %printer/%destructor. Thus, the parser uses it
1547 for token 0 if the user declares it but not if Bison generates it as
1548 $end. Discussed starting at
1549 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
1550 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
1551 and
1552 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
1553 * NEWS (2.3+): Mention.
1554 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
1555 declare a %destructor for a mid-rule's semantic value. It's just
1556 impossible to declare one specific to it.
1557 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
1558 code. Describe default %destructor form.
1559 * src/parse-gram.y (grammar_declaration): Parse default
1560 %printer/%destructor declarations.
1561 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
1562 and symbol_destructor_location_get rather than accessing the destructor
1563 and destructor_location members of struct symbol.
1564 (symbol_printers_output): Likewise but for %printer's.
1565 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
1566 again.
1567 * src/symtab.c (default_destructor, default_destructor_location,
1568 default_printer, default_printer_location): New static global
1569 variables to record the default %destructor and %printer.
1570 (symbol_destructor_get, symbol_destructor_location_get,
1571 symbol_printer_get, symbol_printer_location_get): New functions to
1572 compute the appropriate %destructor and %printer for a symbol.
1573 (default_destructor_set, default_printer_set): New functions to set the
1574 default %destructor and %printer.
1575 * src/symtab.h: Prototype all those new functions.
1576 * tests/actions.at (Default %printer and %destructor): New test to
1577 check that the right %printer and %destructor are called, that they're
1578 not called for $end, and that $$ and @$ work correctly.
1579 (Default %printer and %destructor for user-declared end token): New
1580 test to check that the default %printer and %destructor are called for
1581 a user-declared end token.
1582 * tests/input.at (Default %printer and %destructor redeclared, Unused
1583 values with default %destructor): New tests to check related grammar
1584 warnings and errors.
1585
15862006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1587
1588 Clean up handling of %destructor for the end token (token 0).
1589 Discussed starting at
1590 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
1591 and
1592 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
1593
1594 Make the skeletons consistent in how they pop the end token and invoke
1595 its %destructor.
1596 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
1597 state, which has token number 0, since this would invoke the
1598 %destructor for the end token.
1599 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
1600 until after shifting the end token, or else it won't be popped.
1601 * data/yacc.c (yyparse): Likewise.
1602
1603 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
1604 it's the end token. Upon termination, destroy an unshifted lookahead
1605 even when it's the end token.
1606 * data/lalr1.cc (yy::parser::parse): Likewise.
1607 * data/yacc.c (yyparse): Likewise.
1608
1609 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
1610 value warnings for the end token when the user gives the end token a
1611 %destructor.
1612
1613 * tests/actions.at (Printers and Destructors): Test all the above.
1614
16152006-07-24 Paul Eggert <eggert@cs.ucla.edu>
1616
1617 Update to latest gnulib and gettext versions.
1618 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
1619 Add fopen-safer.
1620 (gnulib_files): Add m4/warning.m4. Don't worry about files
1621 overwritten by autopoint.
1622 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
1623 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
1624 rejects them.
1625 Don't use autoreconf; instead, invoke autopoint etc. by hand,
1626 so that we can remove the intl files at a better time.
1627 (intl_files_to_remove): Remove aclocal.m4, since it gets
1628 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
1629 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
1630 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
1631 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
1632 Remove datarootdir hack; no longer needed.
1633 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
1634 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
1635 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
1636 strdup.h.
1637 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
1638 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
1639
16402006-07-20 Paul Eggert <eggert@cs.ucla.edu>
1641
1642 * bootstrap: Adjust to today's change to gnulib-tool by invoking
1643 it with --assume-autoconf='latest-stable'.
1644
16452006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
1646
1647 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
1648 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
1649 YYSTYPE' and `{'.
1650 * src/muscle_tab.h (muscle_grow): Replace the header comments with
1651 those from muscle_tab.c since the old ones are misleading.
1652
16532006-07-13 Akim Demaille <akim@epita.fr>
1654
1655 Support %define "KEY" {VALUE}.
1656 * src/scan-code.h, src/scan-code.l (translate_action)
1657 (translate_rule_action, translate_symbol_action, translate_code):
1658 Return char *, not const char *.
1659 * src/parse-gram.y (declaration): Rename as...
1660 (prologue_declaration): this.
1661 (string_content): Remove this nonterminal, use STRING.
1662 (braceless, content, content.opt): New nonterminal.
1663 Use them.
1664 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
1665 as value.
1666 * src/scan-gram.l (getargs.h): Don't include it.
1667
16682006-07-12 Paul Eggert <eggert@cs.ucla.edu>
1669
1670 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
1671 rather than a for-loop that declares a local bool variable. This
1672 should work around a compatibility problem with a Cray x1e C++
1673 compiler reported by Hung Nguyen in
1674 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
1675 The for-loop was introduced in the 2004-11-17 change but I don't
1676 know why it was needed.
1677
16782006-07-12 Akim Demaille <akim@epita.fr>
1679
1680 * data/c.m4: Comment changes.
1681
16822006-07-10 Akim Demaille <akim@lrde.epita.fr>
1683
1684 * src/complain.c (error_message, ERROR_MESSAGE): New.
1685 To factor...
1686 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
1687 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
1688
16892006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1690
1691 * NEWS: Instead of %union, you can define and use your own union type
1692 YYSTYPE if your grammar contains at least one <type> tag.
1693 Your YYSTYPE need not be a macro; it can be a typedef.
1694 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
1695 (Union Decl, Decl Summary): Document this.
1696 * data/glr.c (YYSTYPE): Implement this.
1697 * data/glr.cc (YYSTYPE): Likewise.
1698 * data/lalr1.cc (YYSTYPE): Likewise.
1699 * data/yacc.c (YYSTYPE): Likewise.
1700 * src/output.c (prepare): Output tag_seen_flag.
1701 * src/parse-gram.y (declaration, grammar_declaration):
1702 Use 'union_seen' rather than 'typed' to determine whether
1703 %union has been seen, since grammars can now be typed without
1704 %union.
1705 (symbol_declaration, type.opt, symbol_def):
1706 Keep track of whether a tag has been seen.
1707 * src/reader.c (union_seen, tag_seen): New vars.
1708 (typed): remove.
1709 * src/reader.h (union_seen, tag_seen, typed): Likewise.
1710 * src/scan-code.l (untyped_var_seen): New variable.
1711 (handle_action_dollar): Adjust to above changes.
1712 (handle_action_dollar, handle_action_at):
1713 Improve overflow checking for outlandish numbers.
1714 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
1715 avoid new diagnostics generated by above changes.
1716 * tests/regression.at (YYSTYPE typedef): Add test to check
1717 for type tags without %union.
1718
1719 * src/symlist.c (symbol_list_length): Return int, not unsigned
1720 int, since callers expect int. This may need to get revisited
1721 once we have proper integer overflow checking.
1722
1723 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
1724 object is now static.
1725
1726 * src/getargs.c (flags_argmatch): Return void, not int,
1727 to pacify ./configure --enable-gcc-warnings.
1728
1729 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
1730 since last_string is already defined to FLEX_PREFIX (last_string).
1731
17322006-07-09 Akim Demaille <akim@lrde.epita.fr>
1733
1734 Implement --warnings/-W.
1735 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
1736 replaced by...
1737 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
1738 Adjust callers.
1739 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
1740 (warnings_args, warnings_types): New.
1741 (getargs, short_options, long_options): Accept -W/--warnings.
1742 Sort the options by alphabetical order, upper case letter right
1743 before its lower case.
1744
17452006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1746
1747 Change %merge result type clash warnings to errors. Discussed at
1748 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
1749 * src/reader.c (record_merge_function_type): Use complain_at.
1750 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1751 declared later): Update test case results.
1752
17532006-07-09 Akim Demaille <akim@lrde.epita.fr>
1754
1755 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
1756 to be in alphabetical order.
1757 (trace_args): Spelling fixes.
1758
17592006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1760
1761 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
1762 so they don't collide with user-defined macros.
1763 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
1764 this was never guaranteed, and now that we're using gnulib stdint,
1765 which defines int_fast16_t to long int, the problem is exposed.
1766
17672006-07-08 Paul Eggert <eggert@cs.ucla.edu>
1768
1769 * data/c.m4 (b4_basename): Simplify a bit, since we don't
1770 need the full POSIX semantics (and weren't implementing them
1771 anyway).
1772
1773 Adjust to Autoconf 2.60 and today's gnulib.
1774 * bootstrap (gnulib_modules): Add stdint.
1775 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
1776 no longer copies it.
1777 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
1778 since stdint needs the former and wcwidth (which is now required
1779 by mbswidth) needs the latter.
1780 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
1781 work around a compatibility glitch between gettext 0.14.6 and
1782 Autoconf 2.60.
1783 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
1784 Do not check for uintptr_t, since new stdint module does the right
1785 thing.
1786 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
1787 Add stdint.h, stdint_.h, wcwidth.h.
1788 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
1789 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
1790 stdint.m4, wchar_t.m4, wcwidth.m4.
1791 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
1792 usual order for ../lib/*.h files.
1793 (file_name_split): Use last_component, not base_name, to adjust
1794 to gnulib changes.
1795 * src/parse-gram.h: Include <strverscmp.h> in the usual order
1796 for ../lib/*.h files.
1797 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
1798 Define unconditionally, since we now assume the stdint module.
1799 * src/scan-skel.l: Include <dirname.h>.
1800 (BASE_QPUTS): Use last_component, not base_name.
1801 * src/system.h: Include <unlocked-io.h> in the usual order
1802 for ../lib/*.h files. Include <stdint.h> unconditionally,
1803 since we now use the stdint module.
1804 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
1805 HAVE_UINTPTR_T, since we now use the stdint module.
1806 (base_name): Remove decl, since files now include <dirname.h>
1807 to get the decl.
1808
18092006-07-08 Akim Demaille <akim@lrde.epita.fr>
1810
1811 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
1812 New, default to 1.
1813 * data/yacc.c, data/glr.c, data/location.cc: Use them.
1814 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
1815 default.
1816 * tests/calc.at: Adjust.
1817
18182006-07-08 Akim Demaille <akim@lrde.epita.fr>
1819
1820 * data/c.m4 (b4_basename): New.
1821 (b4_syncline): Also output the location of its invocation (from
1822 the skeleton).
1823 (b4_user_action, b4_define_user_action, b4_user_actions)
1824 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
1825 (b4_user_stype): New.
1826 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
1827
18282006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1829
1830 In the grammar file, the first column is 1 not 0 on the first line as
1831 on every other line.
1832 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
1833 * tests/input.at (Torturing the Scanner): Update output.
1834
1835 * src/scan-gram.l (scanner_cursor): Declare it static.
1836
18372006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1838
1839 In warnings, say "previous declaration" rather than "first
1840 declaration".
1841 * src/symtab.c (redeclaration): Do that here.
1842 * src/reader.c (record_merge_function_type): In the case of a result
1843 type clash, report the previous declaration rather than the very first
1844 one in the grammar file.
1845 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1846 declared later): Add a third declaration to check this behavior.
1847 * tests/input.at (Incompatible Aliases): Update output.
1848
18492006-06-27 Akim Demaille <akim@epita.fr>
1850
1851 * doc/Doxyfile.in: New.
1852 * doc/Makefile.am: Use it.
1853 * src/lalr.h, src/symtab.h: Initial doxygenation.
1854
18552006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1856
1857 Don't miss %merge result type warnings just because the LHS types are
1858 declared after the %merge. This continues the effort of the previous
1859 patch.
1860 * src/reader.c (get_merge_function): Don't set the merger type yet.
1861 (record_merge_function_type): New function for setting the merger type
1862 and checking for clashes.
1863 (grammar_current_rule_merge_set): Set the location of the %merge for
1864 the current rule.
1865 (packgram): Invoke record_merge_function_type for each rule now that
1866 all symbol type declarations have been parsed.
1867 * src/reader.h (merger_list.type_declaration_location): New member
1868 storing the location of the first %merge from which the type for this
1869 merging function was derived.
1870 * src/symlist.h (symbol_list.merger_declaration_location): New member
1871 storing the location of a rule's %merge, if any.
1872 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1873 declared later): New test to catch the error fixed by the above patch.
1874
18752006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1876
1877 Get action warnings (grammar_rule_check) right even when symbol
1878 declarations appear after the rules. Discussed at
1879 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
1880 and
1881 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
1882 Don't mistake the type of $$ in a midrule to be that of its parent
1883 rule's $$.
1884 * src/reader.c (grammar_current_rule_end): Don't invoke
1885 grammar_rule_check yet since not all symbol declarations may have been
1886 parsed yet.
1887 (grammar_midrule_action): Likewise.
1888 Don't record whether the midrule's $$ has been used yet since actions
1889 haven't been translated yet.
1890 Record the midrule's parent rule and its RHS index within the parent
1891 rule.
1892 (grammar_current_rule_action_append): Don't translate the action yet
1893 since not all symbol declarations may have been parsed yet and, thus,
1894 warnings about types for $$, $n, @$, and @n can't be reported yet.
1895 (packgram): Translate the action and invoke grammar_rule_check now that
1896 all symbol declarations have been parsed.
1897 * src/scan-code.l (handle_action_dollar): Now that this is invoked
1898 after parsing the entire grammar file, the symbol list here in the case
1899 of a midrule is actually the midrule's empty RHS, so reference its
1900 parent rule's RHS where necessary.
1901 On the other hand, now that you can already know it's a midrule, you
1902 aren't forced to think $$ has the same type as its parent rule's $$.
1903 (handle_action_at): In the case of a midrule, reference the parent rule
1904 where necessary.
1905 * src/symlist.c (symbol_list_new): Initialize new midrule-related
1906 members.
1907 (symbol_list_length): Now that this is invoked after all rules have
1908 been parsed, a NULL symbol (rather than a NULL symbol list node)
1909 terminates a rule. symbol_list_print already does this correctly.
1910 * src/symlist.h (symbol_list.midrule_parent_rule,
1911 symbol_list.midrule_parent_rhs_index): New members so that midrules can
1912 remember their relationships with their parents.
1913 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
1914 fixed by the above patch.
1915 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
1916 implementing...
1917 (Unused values): ... this old test case and...
1918 (Unused values before symbol declarations): ... this new test case.
1919 This one is the same as `Unused values' except that all symbol
1920 declarations appear after the rules in order to catch the rest of the
1921 errors fixed by the above patch.
1922
19232006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1924
1925 More cleanup.
1926 * src/reader.c (current_rule): Declare it static since it's no longer
1927 used outside this file.
1928 (grammar_current_rule_action_append): Remove redundant arguments from
1929 translate_rule_action invocation.
1930 * src/reader.h (current_rule): Remove this unused extern.
1931 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
1932 * src/scan-code.l (translate_rule_action): Likewise.
1933
19342006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
1935
1936 Clean up yesterday's patch.
1937 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
1938 to...
1939 * src/reader.c (grammar_current_rule_action_append): ... here for
1940 consistency with grammar_current_rule_symbol_append.
1941 * tests/regression.at (Braced code in declaration in rules section):
1942 Make yyerror and yylex static as usual.
1943
19442006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
1945
1946 Fix bug that mistakes braced code in a declaration in the rules section
1947 to be a rule action. Mentioned at
1948 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
1949 * src/scan-gram.l: Move midrule action detection from the start of the
1950 scanning of any braced code to...
1951 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
1952 action. For readability, use $2 and @2 rather than the equivalent
1953 global variables.
1954 * tests/regression.at (Braced code in declaration in rules section):
1955 New test to catch the error fixed by the above patch.
1956
1957 Work on code readability some.
1958 * src/scan-code.l (current_rule): Get rid of this misleading and
1959 redundant declaration: it's actually extern'ed in reader.h.
1960 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
1961 translate_action): Add a rule argument and use it instead of the global
1962 current_rule.
1963 (translate_rule_action): This already receives current_rule through an
1964 argument, so pass it on to translate_action instead of assigning
1965 current_rule to current_rule.
1966 (translate_symbol_action, translate_code): Pass rule = NULL to
1967 translate_action.
1968
19692006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
1970
1971 Rename %before-definitions to %start-header and %after-definitions to
1972 %end-header. Don't use these declarations to separate pre-prologue
1973 blocks from post-prologue blocks. Add new order-independent
1974 declarations %before-header and %after-header as alternatives to the
1975 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
1976 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
1977 * NEWS (2.3+): Update for these changes.
1978 * data/glr.c (b4_before_definitions): Update to...
1979 (b4_start_header): ... this.
1980 (b4_after_definitions): Update to...
1981 (b4_end_header): ... this.
1982 * data/glr.cc: Likewise.
1983 * data/lalr1.cc: Likewise.
1984 * data/yacc.c: Likewise.
1985 * doc/bison.texinfo (The prologue): Update names, and replace remaining
1986 prologue blocks with %*-header declarations.
1987 (Calc++ Parser): Likewise.
1988 (Bison Declaration Summary): Update names.
1989 (Bison Symbols): Update description.
1990 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
1991 (PERCENT_END_HEADER): ... this.
1992 (PERCENT_BEFORE_DEFINITIONS): Update to...
1993 (PERCENT_START_HEADER): ... this.
1994 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
1995 (declaration): Update token names and m4 macro names.
1996 When parsing %end-header and %start-header, invoke translate_code
1997 before muscle_code_grow, and no longer set global booleans to remember
1998 whether these declarations have been seen.
1999 Parse new %after-header and %before-header.
2000 * src/reader.c (before_definitions, after_definitions): Remove.
2001 (prologue_augment): Accept a new bool argument to specify whether to
2002 augment the pre-prologue or post-prologue.
2003 * src/reader.h (before_definitions, after_definitions): Remove these
2004 extern's.
2005 (prologue_augment): Add new bool argument.
2006 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
2007 (PERCENT_END_HEADER): ... this.
2008 (PERCENT_BEFORE_DEFINITIONS): Update to...
2009 (PERCENT_START_HEADER): ... this.
2010 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
2011 * tests/actions.at (Printers and Destructors): Update names.
2012
20132006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
2014
2015 Add comparison operators for C++ location classes. Discussed at
2016 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
2017 * data/c++.m4 (b4_define_location_comparison): New boolean %define
2018 declaration indicating whether filename_type has an operator==. If
2019 filename_type is `std::string', it defaults to `1', `0' otherwise.
2020 * data/location.cc: Iff b4_define_location_comparison is `1', add
2021 operator== and operator!= for class position and for class location.
2022
2023 Some minor fixes.
2024 * src/scan-action.l: Remove unused file.
2025 * src/symtab.c (symbol_printer_set): Use printer_location not
2026 destructor_location.
2027 * src/symtab.h (struct symbol): Replace incorrect source comment for
2028 printer members.
2029 * tests/input.at (Incompatible Aliases): Update output with correct
2030 printer location.
2031
20322006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
2033
2034 Don't put the pre-prologue in the header file. For the yacc.c code
2035 file and the glr.c header and code files, move the pre-prologue before
2036 the token definitions. Add new %before-definitions and
2037 %after-definitions to declare code that will go in both the header file
2038 and code file. Discussed at
2039 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
2040 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
2041 and
2042 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
2043 * NEWS (2.3+): Describe these changes.
2044 * data/glr.c (b4_pre_prologue): Move from within to before...
2045 (b4_shared_declarations): ... this.
2046 Add new b4_before_definitions before b4_token_enums.
2047 Add new b4_after_definitions at the end.
2048 * data/glr.cc (b4_pre_prologue): Replace with...
2049 (b4_before_definitions): ... this in the header file.
2050 (b4_after_definitions): New near the end of the header file.
2051 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
2052 code file right before including the header file.
2053 (b4_before_definitions): New in the previous position of
2054 b4_pre_prologue in the header file.
2055 (b4_after_definitions): New near the end of the header file.
2056 * data/yacc.c: Clean up some m4 quoting especially in the header file.
2057 (b4_token_enums_defines): In the code file, move to right before
2058 YYSTYPE for consistency with the header file.
2059 (b4_before_definitions): New right before b4_token_enums_defines in
2060 both the header and code file.
2061 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
2062 header and code file.
2063 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
2064 of prologues for %union dependencies.
2065 (Bison Declaration Summary): In %defines description, mention the
2066 effect of %before-definitions and %after-definitions on the header
2067 file.
2068 (Calc++ Parser): Forward declare driver in a %before-definitions rather
2069 than in the pre-prologue so that make check succeeds.
2070 (Bison Symbols): Add entries for %before-definitions and
2071 %after-definitions.
2072 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
2073 %before-definitions.
2074 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
2075 (declaration): Parse those declarations and append to
2076 b4_before_definitions and b4_after_definitions, respectively.
2077 * src/reader.c (before_definitions, after_definitions): New bools to
2078 track whether those declarations have been seen.
2079 (prologue_augment): Add to the post-prologue if %union,
2080 %before-definitions, or %after-definitions has been seen.
2081 * src/reader.h (before_definitions, after_definitions): New extern's.
2082 * src/scan-gram.l: Scan the new declarations.
2083 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
2084 prologue block in a %before-definitions or a %after-definitions based
2085 on whether the %union is declared.
2086 * tests/regression.at (Early token definitions with --yacc, Early token
2087 definitions without --yacc): Move tests for token definitions into the
2088 post-prologue since token names are no longer defined in the
2089 pre-prologue.
2090
20912006-06-20 Akim Demaille <akim@epita.fr>
2092
2093 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
2094 (symbol_get): Use it.
2095 * src/parse-gram.y: Use it.
2096
20972006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
2098
2099 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
2100 build succeeds when configured with --enable-gcc-warnings.
2101
21022006-06-19 Paul Eggert <eggert@cs.ucla.edu>
2103
2104 * src/parse-gram.y (char_name): New function.
2105 (CHAR, STRING, string_content): For %printer, properly escape.
2106 (ID): Prefer fputs to fprintf.
2107 (id): Reindent to be consistent with other rules.
2108 Properly quote char.
2109
2110 The Translation Project changed its way of publishing translations
2111 to maintainers. I haven't received any responses to my request
2112 for supporting the old way, or for documenting the new way. I
2113 have modified 'bootstrap' to use screen scraping
2114 (in this case, HTML scraping). This is unreliable and inelegant,
2115 but I don't see any better way. Yuck.
2116 * bootstrap (TP_URL, WGET_COMMAND): New vars.
2117 (get_translations): New function, which uses HTML scraping to
2118 deduce locations of latest translations.
2119 Use this function to grab both bison and bison-runtime .po files.
2120 Don't bother priming the pump for the runtime-po domain any more,
2121 as it's now translated better than bison is.
2122
21232006-06-19 Akim Demaille <akim@epita.fr>
2124
2125 * src/scan-gram.l: No longer "parse" things after `%union' until
2126 `{'. Rather, return a single "%union" token.
2127 No longer make symbols: return strings, and leave the conversion
2128 to symbols to the parser.
2129 (SC_PRE_CODE, token_type): Remove.
2130 * src/parse-gram.y (%union): New field `character'.
2131 Sort tokens.
2132 (CHAR): New token.
2133 (ID, ID_COLON): Now that the scanner no longer makes them
2134 identifiers, adjust all uses to invoke symbol_get.
2135 (id_colon): New, wraps the conversion from string to symbol.
2136 (%union): Accept a possible union_name.
2137 (symbol): Now can be a char.
2138 * data/c.m4 (b4_union_name): Leave a default value.
2139 * data/glr.c, data/yacc.c: Use it.
2140
21412006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
2142
2143 For associating token numbers with token names for "yacc.c", don't use
2144 #define statements unless `--yacc' is specified; always use enum
2145 yytokentype. Most important discussions start at:
2146 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
2147 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
2148 and
2149 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
2150 * NEWS (2.3+): Mention.
2151 * data/c.m4 (b4_yacc_if): New.
2152 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
2153 token #define's.
2154 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
2155 on token name definitions.
2156 * src/getargs.c (usage): Capitalize `Yacc' in English.
2157 * src/output.c (prepare): Define b4_yacc_flag.
2158 * tests/regression.at (Early token definitions): Test that tokens names
2159 are defined before the pre-prologue not just before the post-prologue.
2160 Remove this test case and copy to...
2161 (Early token definitions with --yacc): ... this to test #define's.
2162 (Early token definitions without --yacc): ... and this to test enums.
2163
21642006-06-11 Paul Eggert <eggert@cs.ucla.edu>
2165
2166 * NEWS: Reword the post-2.3 change to not be so optimistic about
2167 removing the old "look-ahead" spelling.
2168 Update previous look-ahead/lookahead change reports.
2169 * REFERENCES: look-ahead -> lookahead (since that's
2170 what he actually wrote).
2171 * doc/refcard.tex: look ahead -> lookahead,
2172 look-ahead -> lookahead
2173
21742006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
2175
2176 For consistency, use `lookahead' instead of `look-ahead' or
2177 `look_ahead'. Discussed starting at
2178 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
2179 and then at
2180 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
2181 * NEWS: For the next release, note the change to `--report'.
2182 * TODO, doc/bison.1: Update English.
2183 * doc/bison.texinfo: Update English.
2184 (Understanding Your Parser, Bison Options): Document as
2185 `--report=lookahead' rather than `--report=look-ahead'.
2186 * src/conflicts.c: Update English in comments.
2187 (lookahead_set): Rename from look_ahead_set.
2188 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
2189 (resolve_sr_conflict): Rename local look_ahead_tokens to
2190 lookahead_tokens, and update other uses.
2191 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
2192 count_rr_conflicts, conflicts_free): Update uses.
2193 * src/getargs.c (report_args): Move "lookahead" before alternate
2194 spellings.
2195 (report_types): Update uses.
2196 (usage): For `--report' usage description, state `lookahead' spelling
2197 rather than `look-ahead'.
2198 * src/getargs.h (report.report_lookahead_tokens): Rename from
2199 report_look_ahead_tokens.
2200 * src/lalr.c: Update English in comments.
2201 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
2202 (state_lookahead_tokens_count): Rename from
2203 state_look_ahead_tokens_count.
2204 Rename local n_look_ahead_tokens to n_lookahead_tokens.
2205 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
2206 Rename local n_look_ahead_tokens to n_lookahead_tokens.
2207 Update other uses.
2208 Update English in output.
2209 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
2210 * src/print.c: Update English in comments.
2211 (lookahead_set): Rename from look_ahead_set.
2212 (print_reduction): Rename argument lookahead_token from
2213 look_ahead_token.
2214 (print_core, state_default_rule, print_reductions, print_results):
2215 Update uses.
2216 * src/print_graph.c: Update English in comments.
2217 (print_core): Update uses.
2218 * src/state.c: Update English in comments.
2219 (reductions_new): Update uses.
2220 (state_rule_lookahead_tokens_print): Rename from
2221 state_rule_look_ahead_tokens_print, and update other uses.
2222 * src/state.h: Update English in comments.
2223 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
2224 (state_rule_lookahead_tokens_print): Rename from
2225 state_rule_look_ahead_tokens_print.
2226 * src/tables.c: Update English in comments.
2227 (conflict_row, action_row): Update uses.
2228 * tests/glr-regression.at
2229 (Incorrect lookahead during deterministic GLR,
2230 Incorrect lookahead during nondeterministic GLR): Rename
2231 print_look_ahead to print_lookahead.
2232 * tests/torture.at: Update English in comments.
2233 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
2234 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
2235 (Many lookahead tokens): Update uses.
2236 * data/glr.c: Update English in comments.
2237 * lalr1.cc: Likewise.
2238 * yacc.c: Likewise.
2239 * src/conflicts.h: Likewise.
2240 * src/lalr.h: Likewise.
2241 * src/main.c: Likewise.
2242 * src/output.c: Likewise.
2243 * src/parse-gram.c: Likewise.
2244 * src/tables.h: Likewise.
2245 * tests/calc.at: Likewise.
2246
22472006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
2248
2249 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
2250
22512006-06-07 Paul Eggert <eggert@cs.ucla.edu>
2252
2253 * TODO: Add request from Nelson H. F. Beebe to be able to install
2254 Bison without installing the yacc script.
2255
22562006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
2257
2258 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
2259 and yytext if they're already #define'd.
2260 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
2261 * src/scan-code-c.c: ... here.
2262 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
2263 <config.h>.
2264
22652006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
2266
2267 Get Bison to build again when configured with --enable-gcc-warnings.
2268 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
2269 missing #include's.
2270 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
2271 loc argument as it shadows a global.
2272 * src/scan-gram.l: Remove stray comma that prevents boundary_set
2273 invocation.
2274
2275 * src/.cvsignore: Add scan-code.c.
2276
22772006-06-07 Akim Demaille <akim@epita.fr>
2278
2279 * src/scan-gram.l: Move the "add a trailing ; to actions" code
2280 to...
2281 * src/scan-code.l: here.
2282 * tests/input.at (Torturing the Scanner): Fix another location
2283 error.
2284
22852006-06-07 Akim Demaille <akim@epita.fr>
2286
2287 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
2288
22892006-06-06 Akim Demaille <akim@epita.fr>
2290
2291 Extract the parsing of user actions from the grammar scanner.
2292 As a consequence, the relation between the grammar scanner and
2293 parser is much simpler. We can also split "composite tokens" back
2294 into simple tokens.
2295 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
2296 * src/scan-gram.l (add_column_width, adjust_location): Move to and
2297 rename as...
2298 * src/location.h, src/location.c (add_column_width)
2299 (location_compute): these.
2300 Fix the column count: the initial column is 0.
2301 (location_print): Be robust to ending column being 0.
2302 * src/location.h (boundary_set): New.
2303 * src/main.c: Adjust to scanner_free being renamed as
2304 gram_scanner_free.
2305 * src/output.c: Include scan-code.h.
2306 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
2307 Use boundary_set.
2308 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
2309 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
2310 which is now, again, a separate token.
2311 Adjust all dependencies.
2312 Whereever actions with $ and @ are used, use translate_code.
2313 (action): Remove this nonterminal which is now useless.
2314 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
2315 (grammar_current_rule_action_append): Use translate_code.
2316 (packgram): Bound check ruleno, itemno, and rule_length.
2317 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
2318 (last_string, last_braced_code_loc, max_left_semantic_context)
2319 (scanner_initialize, scanner_free, scanner_last_string_free)
2320 (gram_out, gram_lineno, YY_DECL_): Move to...
2321 * src/scan-gram.h: this new file.
2322 (YY_DECL): Rename as...
2323 (GRAM_DECL): this.
2324 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
2325 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
2326 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
2327 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
2328 Move these declarations, and...
2329 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
2330 these to...
2331 * src/flex-scanner.h: this new file.
2332 * src/scan-gram.l (rule_length, rule_length_overflow)
2333 (increment_rule_length): Remove.
2334 (last_braced_code_loc): Rename as...
2335 (gram_last_braced_code_loc): this.
2336 Adjust to the changes of the parser.
2337 Move all the handling of $ and @ into...
2338 * src/scan-code.l: here.
2339 * src/scan-gram.l (handle_dollar, handle_at): Remove.
2340 (handle_action_dollar, handle_action_at): Move to...
2341 * src/scan-code.l: here.
2342 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
2343 scan-code.h, scan-code-c.c, scan-gram.h.
2344 (EXTRA_bison_SOURCES): Add scan-code.l.
2345 (BUILT_SOURCES): Add scan-code.c.
2346 (yacc): Be robust to white spaces.
2347
2348 * tests/conflicts.at, tests/input.at, tests/reduce.at,
2349 * tests/regression.at: Adjust the column numbers.
2350 * tests/regression.at: Adjust the error message.
2351
23522006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
2353
2354 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
2355 Use Akim's wording from
2356 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
2357
23582006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
2359
2360 Between Bison releases, manually append `+' to the previous Bison
2361 release number, and use that as a signal to automatically print the
2362 ChangeLog's CVS Id keyword from --version. Discussed starting at
2363 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
2364 * ChangeLog: Add Id header.
2365 * configure.ac (AC_INIT): Append `+' to `2.3'.
2366 * src/.cvsignore: Add revision.c.
2367 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
2368 (BUILT_SOURCES): Add revision.c.
2369 (revision.c): New target rule. This file defines a new global variable
2370 named revision. It initializes it with either the Id from ChangeLog
2371 or, if VERSION doesn't contain `+', with the empty string.
2372 * src/getargs.c (version): Print the value of revision.
2373 * src/revision.h: Extern revision.
2374
23752006-06-05 Paul Eggert <eggert@cs.ucla.edu>
2376
2377 * NEWS: Version 2.3.
2378 * configure.ac (AC_INIT): Likewise.
2379
23802006-05-30 Paul Eggert <eggert@cs.ucla.edu>
2381
2382 * data/glr.c (YYRECOVERING): Define to be a function-like macro
2383 with no arguments, not as an object-like macro. This is for
2384 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
2385 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
2386 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
2387 Document this.
2388
23892006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
2390
2391 * src/getargs.c (usage): Back out yesterday's modification of the
2392 --help output so that we don't have to wait for translation before
2393 releasing 2.3.
2394
23952006-05-29 Paul Eggert <eggert@cs.ucla.edu>
2396
2397 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
2398 Problem reported by Akim Demaille.
2399
24002006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
2401
2402 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
2403
24042006-05-26 Paul Eggert <eggert@cs.ucla.edu>
2405
2406 * data/yacc.c (yy_reduce_print): Omit trailing white space in
2407 generated source code. Problem reported by Frans Englich in
2408 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
2409
24102006-05-22 Paul Eggert <eggert@cs.ucla.edu>
2411
2412 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
2413 shell, not within 'make', so that 'make' by an ordinary builder
2414 (using GNU make) does not worry about configuring gzip. This also
2415 works around a bug reported independently by Keith Thompson and by
2416 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
2417 stderr rather than stdout, messing up the build logs.
2418
24192006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
2420
2421 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
2422 to make sure that YYID will never be unused. This fixes a 'make
2423 maintainer-check' failure caused by the recent changes to the 'Trivial
2424 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
2425 not used.
2426 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
2427
24282006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
2429
2430 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
2431 state before an empty RHS is always resolved here. Only the location
2432 of that state is guaranteed to be resolved, and that's enough. This
2433 fixes the remaining bug reported by Derek M. Jones in
2434 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
2435 * tests/glr-regression.at (Uninitialized location when reporting
2436 ambiguity): Test the above case.
2437 Also, the embedded comments in this test case claim it checks the case
2438 of an empty RHS that has inherited the initial location. However, the
2439 corresponding LHS was already resolved, so yyresolveLocations didn't
2440 actually have reason to modify it. Fix this by forcing
2441 nondeterministic operation at the beginning of the parse.
2442
24432006-05-20 Paul Eggert <eggert@cs.ucla.edu>
2444
2445 * data/c.m4 (b4_yy_symbol_print_generate):
2446 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
2447 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
2448 of the bugs reported today by Derek M Jones in
2449 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
2450 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
2451 defined to be a type name without parens or brackets.
2452 (Location Type): Similarly for YYLTYPE.
2453 * tests/regression.at (Trivial grammars): Put in a test for this
2454 bug that will be caught by 'make maintainer-check' (though not,
2455 alas, by 'make check' unless your compiler is picky).
2456
24572006-05-19 Paul Eggert <eggert@cs.ucla.edu>
2458
2459 * NEWS: Version 2.2.
2460 * configure.ac (AC_INIT): Likewise.
2461
24622006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
2463
2464 * data/glr.c (yyreportTree): Make room in yystates for the state
2465 preceding the RHS. This fixes the segmentation fault reported by Derek
2466 M. Jones in
2467 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
2468 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
2469 to the user. Reported for yyreportTree by Derek M. Jones later in the
2470 same thread.
2471 * THANKS: Add Derek M. Jones.
2472 Update my email address.
2473 Fix typo in Steve Murphy's name.
2474
24752006-05-14 Paul Eggert <eggert@cs.ucla.edu>
2476
2477 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
2478 checking against YYLAST that caused the parser to miss a potential
2479 alternative in its diagnostic.
2480 Problem reported by Maria Jose Moron Fernandez in
2481 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
2482 * data/lalr1.cc (yysyntax_error_): Likewise.
2483 * data/yacc.c (yysyntax_error): Likewise.
2484 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
2485 tokens, in case we run into an older C compiler.
2486 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
2487 Use them to check for the off-by-one error fixed above.
2488
2489 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
2490 YYSIZE_T, not size_t.
2491 * tests/regression.at (Trivial grammars): New test, to catch
2492 the error fixed by the above patch.
2493
24942006-05-14 Akim Demaille <akim@lrde.epita.fr>
2495
2496 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
2497 scheme.
2498 Reported by Steve Murphy.
2499
25002006-05-14 Akim Demaille <akim@lrde.epita.fr>
2501
2502 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
2503 * data/glr.cc: b4_location_flag is now b4_locations_flag.
2504
25052006-05-14 Akim Demaille <akim@lrde.epita.fr>
2506
2507 Implement --trace=m4.
2508 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
2509 * src/output.c (output_skeleton): When set, pass -dV to m4.
2510
2511 Factor the handling of flags in m4.
2512 * src/output.c (prepare): Rename the muscle names debug, defines,
2513 error_verbose to debug_flag, defines_flag, error_verbose_flag.
2514 * data/c.m4: Adjust.
2515 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
2516 Use b4_define_flag_if to define other b4_FLAG_if macros.
2517 (b4_location_if): As a consequence, rename as...
2518 (b4_locations_if): this, for consistency.
2519 Adjust all the skeletons.
2520
25212006-05-14 Akim Demaille <akim@lrde.epita.fr>
2522
2523 * etc/bench.pm: Shorten bench names.
2524
25252006-05-14 Akim Demaille <akim@lrde.epita.fr>
2526
2527 * src/output.h, src/output.c (error_verbose): Move to...
2528 * src/getargs.h, src/getargs.c: here.
2529 Sort the flags.
2530 Adjust dependencies.
2531
25322006-05-13 Paul Eggert <eggert@cs.ucla.edu>
2533
2534 * data/c.m4 (b4_copyright): Put the special exception for Bison
2535 skeletons here, so we don't have to put it in each skeleton. All
2536 uses changed. Suggested by Akim Demaille. Also, wrap the
2537 copyright notice, in case it is longer than 80 columns. Replace
2538 comma by newline after title.
2539
25402006-05-11 Paul Eggert <eggert@cs.ucla.edu>
2541
2542 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
2543 incompatibility, not a bug. Mention that it wasn't fixed as of
2544 flex 2.5.33.
2545
25462006-05-11 Akim Demaille <akim@lrde.epita.fr>
2547
2548 * examples/extexi: Enforce the precedence of concatenation over
2549 >>.
2550 Reported by Tommy Nordgren.
2551
25522006-05-11 Akim Demaille <akim@lrde.epita.fr>
2553
2554 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
2555 with the member "token".
2556 Reported by Martin Nylin.
2557
25582006-05-08 Paul Eggert <eggert@cs.ucla.edu>
2559
2560 * data/glr.c: Switch to Bison 2.2 special-exception language in
2561 the copyright notice. Use more-regular format for titles and
2562 copyright notices.
2563 * data/glr.cc: Likewise.
2564 * data/location.cc: Likewise.
2565 * data/yacc.cc: Likewise.
2566 * doc/bison.texinfo (Conditions): Document this.
2567 * NEWS: likewise. Upgrade version to 2.2.
2568
25692006-04-27 Akim Demaille <akim@lrde.epita.fr>
2570
2571 * data/glr.cc: Remove dead code.
2572
25732006-04-25 Paul Eggert <eggert@cs.ucla.edu>
2574
2575 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
2576 that variable and the line breaks the bootstrap. Problem reported
2577 by Juan M. Guerrero.
2578
25792006-04-24 Akim Demaille <akim@lrde.epita.fr>
2580
2581 * doc/bison.texinfo (Multiple start-symbols): New.
2582
25832006-04-24 Akim Demaille <akim@lrde.epita.fr>
2584
2585 * etc/README, etc/bench.pl: New.
2586
25872006-04-03 Akim Demaille <akim@lrde.epita.fr>
2588
2589 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
2590 rule.
2591 Reported by Mickael Labau.
2592 * tests/input.at (Torturing the Scanner): Test it.
2593
25942006-03-16 Paul Eggert <eggert@cs.ucla.edu>
2595
2596 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
2597 Problem reported by Bob Rossi.
2598
25992006-03-13 Paul Eggert <eggert@cs.ucla.edu>
2600
2601 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
2602 and didn't really work.
2603 For the index, use @ifnotinfo, not @iftex.
2604 Minor cleanups of spacing and terminology.
2605
26062006-03-12 Akim Demaille <akim@lrde.epita.fr>
2607
2608 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
2609 of AT_NAME_PREFIX when %name-prefix is not used.
2610
26112006-03-12 Akim Demaille <akim@lrde.epita.fr>
2612
2613 Apply --prefix to C++ skeletons too: they change the namespace.
2614 The test suite already exercize these cases.
2615 * data/c++.m4 (b4_namespace): New.
2616 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
2617 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
2618 * data/yacc.c, data/glr.c: Remove a useless `[]'.
2619 * doc/bison.texinfo: Document it.
2620 (Option Cross Key): Use @multitable in all formats. It looks
2621 nicer, even in TeX outputs.
2622 (Rules): Use the same code whatever the output type is.
2623 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
2624 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
2625 * tests/calc.at: Use it, instead of hard coding `yy'.
2626
26272006-03-10 Akim Demaille <akim@lrde.epita.fr>
2628
2629 * TODO: Remove dead items.
2630
26312006-03-10 Akim Demaille <akim@lrde.epita.fr>
2632
2633 * doc/FAQ: Remove, merged into...
2634 * doc/bison.texinfo (FAQ): this.
2635 * doc/Makefile.am (EXTRA_DIST): Adjust.
2636
26372006-03-10 Akim Demaille <akim@lrde.epita.fr>
2638
2639 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
2640 even if empty.
2641 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
2642 * doc/bison.texinfo (Calc++ Scanner): Use it.
2643
26442006-03-09 Paul Eggert <eggert@cs.ucla.edu>
2645
2646 Fix two nits reported by twlevo, plus one more that I discovered.
2647
2648 * src/assoc.h (assoc_to_string): Give a name to the arg, as
2649 this is the usual Bison style.
2650 * src/location.h (location_print): Likewise.
2651
2652 * src/reader.h (token_name): Likewise.
2653
26542006-03-08 Paul Eggert <eggert@cs.ucla.edu>
2655
2656 Fix some nits reported by twlevo.
2657 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
2658 and "POSIX". Use more-modern syntax for URLs. Mention C++
2659 and ask for Java. Don't hardwire OS version numbers. Add
2660 copyright notice.
2661 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
2662 * src/conflicts.c (solved_conflicts_obstack): Now static.
2663
26642006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2665
2666 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
2667 page. Say "you can use it" not "you may use it" as on the web page;
2668 we're describing capabilities not granting permission.
2669
26702006-03-06 Paul Eggert <eggert@cs.ucla.edu>
2671
2672 * data/glr.c (yyresolveLocations): Rename local variables to avoid
2673 shadowing warnings. Use usual patter for iterating through RHS.
2674 * tests/glr-regression.at
2675 (Uninitialized location when reporting ambiguity):
2676 Modify yylex so that it uses its argument, rather than trying
2677 to rely on ARGSUSED (which doesn't work for gcc with warnings).
2678 const char -> char const.
2679
2680 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
2681 Don't use tabs inside commands; it messes up 'ps'.
2682 Problem reported by twlevo.
2683
26842006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
2685
2686 * tests/glr-regression.at (Uninitialized location when reporting
2687 ambiguity): New test case.
2688 * data/glr.c (yyresolveLocations): New function, which uses
2689 YYLLOC_DEFAULT.
2690 (yyresolveValue): Invoke yyresolveLocations before reporting an
2691 ambiguity.
2692 * doc/bison.texinfo (Default Action for Locations): Note
2693 YYLLOC_DEFAULT's usage for ambiguity locations.
2694 (GLR Semantic Actions): Cross-reference those notes.
2695
26962006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
2697
2698 * tests/glr-regression.at (Leaked semantic values when reporting
2699 ambiguity): Remove unnecessary union and type declarations.
2700 (Leaked lookahead after nondeterministic parse syntax error): New test
2701 case.
2702 * data/glr.c (yyparse): Check for zero stacks remaining before
2703 attempting to shift the lookahead so that you don't lose it.
2704
27052006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2706
2707 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
2708 * tests/glr-regression.at (Leaked semantic values when reporting
2709 ambiguity): New test case.
2710 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
2711 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
2712 now unnecessary yystackp parameter.
2713 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
2714 destructors can be called.
2715
2716 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
2717 in existing testcases.
2718
27192006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2720
2721 Don't leak semantic values for parent RHS when a user action cuts the
2722 parser, and clean up related code a bit.
2723 * tests/glr-regression.at (Leaked merged semantic value if user action
2724 cuts parse): Rename to...
2725 (Leaked semantic values if user action cuts parse): ... this. Add check
2726 for leaked parent RHS values.
2727 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
2728 between an unresolved state (non-empty chain of semantic options) and
2729 an incomplete one (signaled by an empty chain).
2730 (yyresolveStates): Document the interface. Move all manipulation of a
2731 successfully or unsuccessfully resolved yyGLRState to...
2732 (yyresolveValue): ... here so that yyresolveValue always leaves a
2733 yyGLRState with consistent data and thus is easier to understand.
2734 Remove the yyvalp and yylocp parameters since they are always just
2735 taken from the yys parameter. When reporting a discarded merged value
2736 in debugging output, note that it is incompletely merged. Document the
2737 interface.
2738 (yyresolveAction): If resolving any of the RHS states fails, destroy
2739 them all rather than leaking them. Thus, as long as user actions are
2740 written to clean up the RHS correctly, yyresolveAction always cleans up
2741 the RHS of a semantic option. Document the interface.
2742
27432006-02-27 Paul Eggert <eggert@cs.ucla.edu>
2744
2745 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
2746 led to a segmentation fault in GNU Pascal. Problem reported
2747 by Waldek Hebisch.
2748
27492006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
2750
2751 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
2752 mid-rule action inside a nonterminal symbol in order to declare a
2753 destructor for its semantic value.
2754
27552006-02-16 Paul Eggert <eggert@cs.ucla.edu>
2756
2757 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
2758 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
2759 __cplusplus && ! defined _STDLIB_H && !
2760 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
2761 defined free))]: Include <stdlib.h> rather than rolling our own
2762 declarations of malloc and free, to avoid problems with
2763 incompatible declarations (using 'throw') C++'s stdlib.h. This
2764 should fix Debian bug 340012
2765 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
2766 reported by Guillaume Melquiond.
2767
27682006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2769
2770 * NEWS: Clarify symbols versus types in unused-value warnings.
2771
2772 * configure.ac (AC_INIT): Bump version number.
2773
27742006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2775
2776 * NEWS: Version 2.1a.
2777 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
2778 since C99 requires this.
2779
27802006-02-11 Paul Eggert <eggert@cs.ucla.edu>
2781
2782 * m4/c-working.m4: New file.
2783 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
2784
27852006-02-10 Paul Eggert <eggert@cs.ucla.edu>
2786
2787 * Makefile.maint: Merge from coreutils.
2788
27892006-02-09 Paul Eggert <eggert@cs.ucla.edu>
2790
2791 More portability fixes for problems summarized by Nelson H. F. Beebe.
2792
2793 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
2794 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
2795 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
2796 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
2797 messes up because C++ code is compiled in 32-bit mode but linked
2798 in 64-bit mode.
2799
28002006-02-08 Paul Eggert <eggert@cs.ucla.edu>
2801
2802 More portability fixes for problems summarized by Nelson H. F. Beebe.
2803
2804 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
2805 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
2806
2807 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
2808 nodist_PROGRAMS, since we don't need to actually compile the
2809 example if we're just doing a plain 'make'. This avoids bothering
2810 the installer unnecessarily about problems due to weird C++
2811 compilers.
2812
28132006-02-06 Paul Eggert <eggert@cs.ucla.edu>
2814
2815 More portability fixes for problems summarized by Nelson H. F. Beebe.
2816
2817 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
2818 than #include "...", and compile with -I'.'. The old method was
2819 not portable, according to Posix and the C standard, and it does
2820 not work with Sun C 5.7, where previous #line directives affect
2821 the working directory used in later #include "..." directives.
2822
28232006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2824
2825 Various DJGGP specific issues in /djgpp
2826
28272006-02-02 Paul Eggert <eggert@cs.ucla.edu>
2828
2829 More portability fixes for problems summarized by Nelson H. F. Beebe.
2830
2831 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
2832 '#include <map>' works and that you can apply ++ to iterators.
2833
28342006-02-01 Paul Eggert <eggert@cs.ucla.edu>
2835
2836 Work around portability problems summarized by Nelson H. F. Beebe in
2837 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
2838
2839 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
2840 that '#include <string>' works.
2841
2842 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
2843 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
2844 "warning: sorry: semantics of inline function static data `const
2845 unsigned char translate_table[262]' are wrong (you'll wind up with
2846 multiple copies)".
2847
2848 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
2849 or, xor to not_, and_, or_, and xor_, respectively. This works
2850 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
2851 random system header somewhere that includes the equivalent of
2852 <iso646.h>.
2853
2854 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
2855 -E" works; it apparently doesn't work with PathScale EKO Compiler
2856 Suite Version 2.0.
2857
28582006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
2859
2860 During deterministic GLR operation, user actions should be able to
2861 influence the parse by changing yychar. To make this easier to fix and
2862 to make glr.c easier to evolve in general, don't maintain yytoken in
2863 parallel with yychar; just compute yytoken when needed.
2864 * tests/glr-regression.at (Incorrect lookahead during deterministic
2865 GLR): Check that setting yychar in a user action has the intended
2866 effect.
2867 * data/glr.c (yyGLRStack): Remove yytokenp member.
2868 (yyclearin): Don't set *yytokenp.
2869 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
2870 yychar rather than *yytokenp to determine the current lookahead.
2871 Compute yytoken locally when needed.
2872 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
2873 point to.
2874
2875 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
2876 after `--report' documentation.
2877
28782006-01-30 Paul Eggert <eggert@cs.ucla.edu>
2879
2880 * src/parse-gram.y (grammar_declaration): Location of printer
2881 symbol is @1, not list->location. Bug reported by twlevo.
2882 * tests/input.at (Incompatible Aliases): Adjust to above change.
2883
28842006-01-29 Paul Eggert <eggert@cs.ucla.edu>
2885
2886 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
2887 all the test at once. This makes the output easier to read in the
2888 normal case.
2889
2890 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
2891 got from <http://bro-ids.org/download.html>. The bug is that
2892 when two actions appeared in succession, the second one was
2893 scanned before the first one was added to the grammar rule
2894 as a midrule action. Bison then output the incorrect warning
2895 "parse.y:905.17-906.36: warning: unused value: $3".
2896 * src/parse-gram.y (BRACED_CODE, action): These are no longer
2897 associated with a value.
2898 (rhs): Don't invoke grammar_current_rule_action_append.
2899 (action): Invoke it here instead.
2900 * src/reader.c (grammar_midrule_action): Now extern.
2901 (grammar_current_rule_action_append): Don't invoke
2902 grammar_midrule_action; that is now the scanner's job.
2903 * src/reader.h (last_string, last_braced_code_loc):
2904 (grammar_midrule_action): New decls.
2905 * src/scan-gram.l (last_string): Now extern, sigh.
2906 (last_braced_code_loc): New extern variable.
2907 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
2908 rule already has an action.
2909 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
2910 * tests/input.at (AT_CHECK_UNUSED_VALUES):
2911 Add some tests to check that the above changes fixed the bug.
2912
29132006-01-27 Paul Eggert <eggert@cs.ucla.edu>
2914
2915 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
2916 All used changed. Check whether the symbol has a destructor,
2917 not whether it is typed.
2918 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
2919 that the values are still reported as unused. All line numbers
2920 adjusted.
2921
29222006-01-23 Paul Eggert <eggert@cs.ucla.edu>
2923
2924 Work around a bug in bro 0.8, which underparenthesizes its
2925 definition of YYLLOC_DEFAULT.
2926 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
2927 their arguments.
2928 * data/lalr1.cc: Likewise.
2929 * data/yacc.cc: Likewise.
2930
29312006-01-22 Paul Eggert <eggert@cs.ucla.edu>
2932
2933 Work around a bug in Pike 7.0, and give the Pike folks a
2934 better way to override the usual int widths.
2935 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
2936 user can override the types.
2937 (short): #undef, to work around a bug in Pike 7.0.
2938 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
2939 (union yyalloc.yyss): Use yytype_int16 rather than short.
2940 All uses changed.
2941 (yysigned_char): Remove.
2942 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
2943 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
2944 * tests/regression.at (Web2c Actions): Adjust to above changes.
2945
2946 * src/reader.c (check_and_convert_grammar): New function.
2947 (reader): Close the input file even if something went wrong during
2948 parsing. Minor file descriptor leak reported by twlevo.
2949
2950 * src/assoc.c (assoc_to_string): Use a default: abort (); case
2951 to pacify gcc -Wswitch-default.
2952 * src/scan-gram.l (adjust_location): Use a default: break; case
2953 to pacify gcc -Wswitch-default.
2954 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
2955 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
2956 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
2957 Move these decls to scan-skel.l, since they don't need to be
2958 visible elsewhere.
2959 * src/scan-skel.l: Accept the above decls.
2960 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
2961 is used.
2962
29632006-01-21 Paul Eggert <eggert@cs.ucla.edu>
2964
2965 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
2966 since we don't want to insist on a version number at the start
2967 of the changelog every time.
2968 * Makefile.maint: Sync from coreutils a bit better.
2969 (sc_trailing_blank): Renamed from sc_trailing_space.
2970 All uses changed.
2971 (sc_no_if_have_config_h, sc_require_config_h):
2972 (sc_prohibit_assert_without_use): New rules.
2973 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
2974 (sc_dd_max_sym_length): Fix leading spaces in rule.
2975 (sc_system_h_headers): Prefix with @.
2976 (sc_useless_cpp_parens, m4-check): Output line numbers.
2977 (changelog-check): Allow version only in head.
2978 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
2979 satisfy new Makefile.maint rule.
2980 * data/glr.c: Likewise.
2981 * data/glr.cc: Likewise.
2982 * data/lalr1.cc: Likewise.
2983 * data/yacc.c: Likewise.
2984 * lib/ebitsetv.c: Likewise.
2985 * lib/lbitset.c: Likewise.
2986 * lib/subpipe.c: Likewise.
2987 * lib/timevar.c: Likewise.
2988 * src/system.h: Likewise.
2989 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
2990 * djgpp/Makefile.maint: Add copyright notice.
2991 * djgpp/README.in: Likewise.
2992 * djgpp/config.bat: Likewise.
2993 * djgpp/config.site: Likewise.
2994 * djgpp/config_h.sed: Likewise.
2995 * djgpp/djunpack.bat: Likewise.
2996 * djgpp/config.sed: Fix copyright notice to match standard format.
2997 * djgpp/subpipe.h: Likewise.
2998 * lib/bitsetv-print.c: Likewise.
2999 * lib/bitsetv.c: Likewise.
3000 * lib/subpipe.h: Likewise.
3001 * lib/timevar.c: Likewise.
3002 * lib/timevar.h: Likewise.
3003 * djgpp/subpipe.c: Use standard recipe for config.h.
3004 * lib/abitset.c: Likewise.
3005 * lib/bitset.c: Likewise.
3006 * lib/bitset_stats.c: Likewise.
3007 * lib/bitsetv-print.c: Likewise.
3008 * lib/bitsetv.c: Likewise.
3009 * lib/ebitsetv.c: Likewise.
3010 * lib/get-errno.c: Likewise.
3011 * lib/lbitset.c: Likewise.
3012 * lib/subpipe.c: Likewise.
3013 * lib/timevar.c: Likewise.
3014 * lib/vbitset.c: Likewise.
3015 * tests/local.at: Likewise.
3016 * src/scan-gram.l: Don't include verify.h, since system.h does
3017 that for us.
3018 * .x-sc_require_config_h: New file.
3019 * .x-sc_unmarked_diagnostics: New file.
3020
30212006-01-20 Paul Eggert <eggert@cs.ucla.edu>
3022
3023 Be a bit more systematic about using 'abort'.
3024 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
3025 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
3026 Put 'default: abort ();' before some other case, to satisfy older
3027 pedantic compilers.
3028 * lib/bitset_stats.c (bitset_stats_init): Likewise.
3029 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
3030 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
3031 * src/conflicts.c (resolve_sr_conflict): Likewise.
3032 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
3033 (get_decision_str, get_orientation_str, get_node_alignment_str):
3034 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
3035 (get_linestyle_str, get_arrowstyle_str): Likewise.
3036 * src/conflicts.c (resolve_sr_conflict):
3037 Use a default case rather than one for the one remaining enum
3038 value, to catch invalid enum values as well.
3039 * src/lalr.c (set_goto_map, map_goto):
3040 Prefer "assert (FOO);" to "if (!FOO) abort ();".
3041 * src/nullable.c (nullable_compute, token_definitions_output):
3042 Likewise.
3043 * src/reader.c (packgram, reader): Likewise.
3044 * src/state.c (transitions_to, state_new, state_reduction_find):
3045 Likewise.
3046 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
3047 (symbol_pack): Likewise.
3048 * src/tables.c (conflict_row, pack_vector): Likewise.
3049 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
3050 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
3051 * src/system.h: Don't include <assert.h>.
3052 (assert): New macro.
3053
3054 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
3055 (Destructor Decl, Parser Function, Pure Calling):
3056 Describe rules for braces inside C code more carefully.
3057
30582006-01-19 Paul Eggert <eggert@cs.ucla.edu>
3059
3060 Fix some porting glitches found by Nelson H. F. Beebe.
3061 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
3062 compilers that don't understand that abort () does not return.
3063 * src/state.c (transitions_to): Likewise.
3064 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
3065 that '#include <cstdlib>' works.
3066 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
3067 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
3068 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
3069 for the benefit of some pre-C99 compilers.
3070
3071 * bootstrap: Undo changes to gnulib files that autoreconf made.
3072
3073 Minor fixups to get 'make maintainer-check' to work.
3074 * configure.ac: Don't use -Wnested-externs, as it's incompatible
3075 with the new verify.h implementation.
3076 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
3077 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
3078 * data/yacc.c (YYUSE): Likewise.
3079 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
3080 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
3081 * src/parse-gram.y (declaration): Don't pass a string constant
3082 to a function that expects char *, since GCC might complain
3083 about the constant value.
3084 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
3085 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
3086 before #defining them.
3087 * tests/glr-regression.at
3088 (Incorrectly initialized location for empty right-hand side in GLR):
3089 In yyerror, use the msg arg.
3090 (Corrupted semantic options if user action cuts parse):
3091 (Incorrect lookahead during deterministic GLR):
3092 (Incorrect lookahead during nondeterministic GLR):
3093 Don't name a local var 'index'; it shadows string.h's 'index'.
3094
30952006-01-19 Akim Demaille <akim@epita.fr>
3096
3097 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
3098 location, not just parts of it.
3099
31002006-01-18 Paul Eggert <eggert@cs.ucla.edu>
3101
3102 * NEWS: Document the fact that multiple %unions are now allowed.
3103 * doc/bison.texinfo (Union Decl): Likewise.
3104 * TODO: This feature is now implemented, so remove it from
3105 the wishlist.
3106
3107 * Makefile.maint: Merge with coreutils Makefile.maint.
3108 (CVS_LIST): Use build-aux version if available.
3109 (VERSION_REGEXP): New macro.
3110 (syntax-check-rules): Add sc_no_if_have_config_h,
3111 sc_prohibit_assert_without_use, sc_require_config_h,
3112 sc_useless_cpp_parens.
3113 (sc_obsolete_symbols): Check for O_NDELAY.
3114 (sc_dd_max_sym_length): Track coreutils.
3115 (sc_unmarked_diagnostics): Look in all files, not just *.c.
3116 (sc_useless_cpp_parens): New rule.
3117 (news-date-check): Look for version or today's date.
3118 (changelog-check): Don't require version number near head.
3119 (copyright-check): Use current year instead of hardwiring 2005.
3120 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
3121 (announcement): Add --gpg-key-ID.
3122
3123 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
3124 with "file system".
3125
3126 Avoid undefined behavior that addressed just before the start of an
3127 array. Problem reported by twlevo.
3128 * src/reader.c (packgram): Prepend a new sentinel before ritem.
3129 * src/lalr.c (build_relations): Rely on new sentinel.
3130 * src/gram.c (gram_free): Adjust to new sentinel.
3131
31322006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
3133
3134 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
3135 yylookaheadNeeds. All uses updated.
3136 (yysplitStack): Rename local yynewLookaheadStatuses to
3137 yynewLookaheadNeeds.
3138 * data/glr-regression.at (Incorrect lookahead during nondeterministic
3139 GLR): In comments, change `lookahead status' to `lookahead need'.
3140
31412006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3142
3143 * data/glr.c (yysplitStack): A little stylistic rewrite.
3144
31452006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3146
3147 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
3148
31492006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
3150
3151 * doc/bison.texinfo: Fix some typos.
3152 (GLR Semantic Actions): New subsection discussing special
3153 considerations because GLR semantic actions might be deferred.
3154 (Actions): Mention look-ahead usage of yylval.
3155 (Actions and Locations): Mention look-ahead usage of yylloc.
3156 (Special Features for Use in Actions): Add YYEOF entry and mention it
3157 in the yychar entry.
3158 In the yychar entry, remove mention of the local yychar case (pure
3159 parser) since this is irrelevant information when writing semantic
3160 actions and since it's already discussed in `Bison Symbols' where
3161 yychar is otherwise described as an external variable.
3162 In the yychar entry, don't call it the `current' look-ahead since it
3163 isn't when semantic actions are deferred.
3164 In the yychar and yyclearin entries, add note about deferred semantic
3165 actions.
3166 Add yylloc and yylval entries discussing look-ahead usage.
3167 (Look-Ahead Tokens): When discussing yychar, don't call it the
3168 `current' look-ahead, and do mention yylval and yylloc.
3169 (Error Recovery): Cross-reference `Action Features' when mentioning
3170 yyclearin.
3171 (Bison Symbols): In the yychar entry, don't call it the `current'
3172 look-ahead.
3173 In the yylloc and yylval entries, mention look-ahead usage.
3174
31752006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3176
3177 * tests/glr-regression.at: Update copyright year to 2006.
3178
31792006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3180
3181 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
3182 use during nondeterministic operation to track which stacks have
3183 actually needed the current lookahead.
3184 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
3185 Allocate, deallocate, resize, and otherwise shuffle space for
3186 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
3187 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
3188 appropriately during nondeterministic operation.
3189 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
3190 members to store the current lookahead to be used by the deferred
3191 user action.
3192 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
3193 from which the RHS is taken. Set the lookahead members of the new
3194 yySemanticOption according to the lookahead status for stack yyk.
3195 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
3196 yyaddDeferredAction.
3197 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
3198 members of yySemanticOption before invoking yyuserAction, and then set
3199 them back to their current values afterward.
3200 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
3201 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
3202 * tests/glr-regression.at: Remove `.' from the ends of recent test case
3203 titles for consistency.
3204 (Leaked merged semantic value if user action cuts parse): In order to
3205 suppress lint warnings, use arguments in merge function, and assign
3206 char value < 128 in main.
3207 (Incorrect lookahead during deterministic GLR): New test case.
3208 (Incorrect lookahead during nondeterministic GLR): New test case.
3209
32102006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3211
3212 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
3213 !yyvaluep as signal that no semantic value is available to print.
3214 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
3215 to print a semantic value.
3216
32172006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3218
3219 * tests/glr-regression.at: For consistency with my newer test cases,
3220 don't thank myself.
3221
32222006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
3223
3224 * data/glr.c (yyresolveValue): When merging semantic options, if at
3225 least one user action succeeds but a later one cuts the parse, then
3226 destroy the semantic value before returning rather than leaking it.
3227 (yyresolveStates): If a user action cuts the parse and thus
3228 yyresolveValue fails, ignore the (unset) semantic value rather than
3229 corrupting the yyGLRState, and empty the semantic options list since
3230 the user actions should have called all necessary destructors.
3231 Simplify code with YYCHK.
3232 * tests/glr-regression.at (Corrupted semantic options if user action
3233 cuts parse): New test case.
3234 (Undesirable destructors if user action cuts parse): New test case.
3235 Before applying any of this patch, this test case never actually failed
3236 for me... but only because the corrupted semantic options usually
3237 masked this bug.
3238 (Leaked merged semantic value if user action cuts parse): New test
3239 case.
3240
32412006-01-05 Akim Demaille <akim@epita.fr>
3242
3243 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
3244
32452006-01-04 Paul Eggert <eggert@cs.ucla.edu>
3246
3247 * data/c.m4 (b4_c_modern): New macro, with a new provision for
3248 _MSC_VER. Problem reported by Cenzato Marco.
3249 (b4_c_function_def): Use it.
3250 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
3251 b4_c_modern.
3252 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
3253 than rolling our own.
3254
32552006-01-04 Akim Demaille <akim@epita.fr>
3256
3257 Also warn about non-used mid-rule values.
3258 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
3259 member.
3260 (symbol_list_new): Adjust.
3261 * src/reader.c (symbol_typed_p): New.
3262 (grammar_rule_check): Use it.
3263 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
3264 Check its rule.
3265 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
3266 Use it.
3267 * tests/actions.at (Exotic Dollars): Adjust.
3268
32692006-01-04 Akim Demaille <akim@epita.fr>
3270
3271 * src/reader.c (grammar_midrule_action): If $$ is set in a
3272 mid-rule, move the `used' bit to its lhs.
3273 * tests/input.at (Unused values): New.
3274 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
3275
32762006-01-03 Paul Eggert <eggert@cs.ucla.edu>
3277
3278 * doc/bison.texinfo (Bison Options): Say more accurately what
3279 --yacc does.
3280 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
3281 about declarations in the grammar when in Yacc mode, as POSIX does
3282 not require a diagnostic when the grammar uses extensions.
3283
3284 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
3285
3286 Warn about dubious constructions like "%token T T".
3287 Reported by twlevo.
3288 * src/symtab.h (struct symbol.declared): New member.
3289 * src/symtab.c (symbol_new): Initialize it to false.
3290 (symbol_class_set): New arg DECLARING, specifying whether
3291 this is a declaration that we want to warn about, if there
3292 is more than one of them. All uses changed.
3293
3294 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
3295 Allow multiple %union directives, whose contents concatenate.
3296 * src/parse-gram.y (grammar_declaration): Likewise.
3297 Use muscle_code_grow, so that we don't need stype_line any more.
3298 All uses changed.
3299
3300 * src/muscle_tab.c (muscle_grow): Fix comment.
3301
3302 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
3303 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
3304 Update copyright year to 2006.
3305
33062006-01-03 Akim Demaille <akim@epita.fr>
3307
3308 Have glr.cc pass (some of) the calc.at tests.
3309 * data/glr.cc (b4_parse_param_orig): New.
3310 (b4_parse_param): Improve its definition, and bound it more
3311 clearly in the skeleton.
3312 (b4_epilogue): Append, instead of prepending, in order to keep
3313 #line consistency.
3314 Simplify the generation of auxiliary functions: locations and
3315 purity are mandated.
3316 (b4_global_tokens_and_yystype): Honor it.
3317 * data/location.cc (c++.m4): Don't include it.
3318 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
3319 and AT_SKEL_CC_IF.
3320 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
3321 AT_LALR1_CC_IF.
3322 Be sure to initialize the first position's filename.
3323 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
3324 mandated anyway.
3325 (AT_CHECK_CALC_GLR_CC): New.
3326 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
3327
33282006-01-02 Akim Demaille <akim@epita.fr>
3329
3330 * src/output.c (output_skeleton): Don't hard wire the inclusion of
3331 c.m4.
3332 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3333 * data/glr.cc: Do not include stack.hh.
3334
33352006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3336
3337 * data/glr.c: Reformat whitespace with tabs.
3338 (b4_lpure_formals): Remove this unused m4 macro.
3339 * tests/cxx-type.at: Reformat whitespace with tabs.
3340 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
3341 since it's a member. Rename type to isNterm for clarity.
3342
33432005-12-29 Akim <akim@sulaco.local>
3344
3345 Let glr.cc catch up with symbol_value_print.
3346 * data/glr.cc (b4_yysymprint_generate): Replace by...
3347 (b4_yy_symbol_print_generate): this.
3348 (yy_symbol_print, yy_symbol_value_print): Declare them.
3349
33502005-12-28 Paul Eggert <eggert@cs.ucla.edu>
3351
3352 * src/location.h (boundary): Note that a line or column equal
3353 to INT_MAX indicates an overflow.
3354 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
3355 (rule_length_overflow, increment_rule_length, add_column_width):
3356 New functions.
3357 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
3358 (<SC_BRACED_CODE>"}"):
3359 Use increment_rule_length rather than incrementing it by hand.
3360 (adjust_location, handle_syncline): Diagnose overflow.
3361 (handle_action_dollar, handle_action_at):
3362 Fix bug with monstrosities like $-2147483648.
3363 Remove now-unnecessary checks.
3364 (scan_integer): Verify assumptions and remove now-unnecessary checks.
3365 (convert_ucn_to_byte): Verify assumptions.
3366 (handle_syncline): New arg LOC. All callers changed.
3367 Don't store through a value derived from char const * pointer.
3368
3369 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
3370 GCC warnings.
3371
33722005-12-27 Paul Eggert <eggert@cs.ucla.edu>
3373
3374 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
3375 Remove unnecessary forward static decls.
3376
33772005-12-27 Akim Demaille <akim@epita.fr>
3378
3379 * src/reader.c (grammar_current_rule_check): Also check that $$
3380 is used.
3381 Take the rule to check as argument, hence rename as...
3382 (grammar_rule_check): this.
3383 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
3384 Rename as...
3385 (grammar_rule_begin, grammar_rule_end): these, for consistency.
3386 (grammar_midrule_action, grammar_symbol_append): Now static.
3387 * tests/torture.at (input): Don't rely on the default action
3388 being always performed.
3389 * tests/calc.at: "Set" $$ even when the action is "cut" with
3390 YYERROR or other.
3391 * tests/actions.at (Exotic Dollars): Instead of using unused
3392 values, check that the warning is issued.
3393
33942005-12-22 Paul Eggert <eggert@cs.ucla.edu>
3395
3396 * NEWS: Improve wording for unused-value warnings.
3397
33982005-12-22 Akim Demaille <akim@epita.fr>
3399
3400 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
3401 (b4_yysymprint_generate): Rename as...
3402 (b4_yy_symbol_print_generate): this.
3403 Generate yy_symbol_print instead of yysymprint.
3404 Generate also yy_symbol_value_print, and use it.
3405
34062005-12-22 Akim Demaille <akim@epita.fr>
3407
3408 * NEWS: Warn about unused values.
3409 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
3410 a `used' member.
3411 (symbol_list_n_get, symbol_list_n_used_set): New.
3412 (symbol_list_n_type_name_get): Use symbol_list_n_get.
3413 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
3414 * src/reader.c (grammar_current_rule_check): Check that values are
3415 used.
3416 * src/symtab.c (symbol_print): Accept 0.
3417 * tests/existing.at: Remove the type information.
3418 Empty the actions.
3419 Remove useless actions (beware of mid-rule actions: perl -000
3420 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
3421 * tests/actions.at (Exotic Dollars): Use unused values.
3422 * tests/calc.at: Likewise.
3423 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3424 Likewise.
3425
3426 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
3427 rule_useful_p.
3428
34292005-12-21 Paul Eggert <eggert@cs.ucla.edu>
3430
3431 Undo 2005-12-01 tentative license wording change. The wording is
3432 still being reviewed by the lawyers, and we don't want to wait for
3433 them before publishing a test release. For now, revert to the
3434 previous wording.
3435 * NEWS: Undo 2005-12-01 change.
3436 * data/glr.c: Revert to previous license wording.
3437 * data/glr.cc: Likewise.
3438 * data/lalr1.cc: Likewise.
3439 * data/location.cc: Likewise.
3440 * data/yacc.c: Likewise.
3441
3442 * NEWS: Reword %destructor vs YYABORT etc.
3443 * data/glr.c: Use American spacing, for consistency.
3444 * data/glr.cc: Likewise.
3445 * data/lalr1.cc: Likewise.
3446 * data/yacc.c: Likewise.
3447 * data/yacc.c: Reformat comments slightly.
3448 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
3449 for consistency. Fix some spelling errors and reword recently-included
3450 text slightly.
3451 * tests/cxx-type.at: Cast results of malloc, for C++.
3452
34532005-12-21 Joel E. Denny <address@hidden>
3454
3455 * tests/cxx-type.at: Construct a tree, count the parents of shared
3456 nodes, and free each node once and only once. Previously, the memory
3457 for semantic values was leaked instead.
3458
34592005-12-21 Joel E. Denny <address@hidden>
3460
3461 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
3462 (yylval, yylloc): If pure, #define to yystackp->yyval and
3463 yystackp->yyloc similar to yychar and yynerrs.
3464 (yyparse): If pure, remove local yylval and yylloc. Add local
3465 yystackp to accommodate pure definitions of yylval and yylloc.
3466 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
3467 yylvalp and yyllocp to &yylval and &yylloc.
3468 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
3469 namespace. Previously, nerrs and char were missing, but lval and lloc
3470 weren't necessary.
3471 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
3472 yylvalp and yyllocp parameters since, if pure, these are now always
3473 accessible through yystackp. If not pure, they are still accessible
3474 globally.
3475 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
3476 `if (YYID (N))' to pacify lint.
3477
34782005-12-21 Akim Demaille <akim@epita.fr>
3479
3480 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
3481 destroy the RHS symbols of a rule.
3482 * data/yacc.c (yylen): Initialize to 0.
3483 Keep its value to the number of items to possibly shift.
3484 In particular, a regular successful parse that ends on YYFINAL by
3485 a (internal) YYACCEPT must not have yylen != 0.
3486 (yyerrorlab, yyreturn): Pop the RHS.
3487 Reorder a bit to emphasize the `shifting' bits of code.
3488 (YYPOPSTACK): Now accept a number of items to pop.
3489 * data/lalr1.cc: Likewise.
3490 * data/glr.c: Formatting changes.
3491 Use goto instead of fall through.
3492 * doc/bison.texinfo (Destructor Decl): Complete.
3493
34942005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3495
3496 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3497 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
3498 * djgpp/config.bat: Replace every occurence of the file name
3499 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3500 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3501 * djgpp/config.sed: Replace every occurence of the file name
3502 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3503 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3504 * djgpp/djunpack.bat: DJGPP specific file.
3505 * djgpp/fnchange.lst: DJGPP specific file.
3506 * djgpp/README.in: Add new information about how to unpack the bison
3507 source on MSDOS and other systems which have 8.3 file name restrictions
3508 using djunpack.bat and fnchange.lst.
3509
35102005-12-12 Paul Eggert <eggert@cs.ucla.edu>
3511
3512 * bootstrap (build_cvs_prefix): Remove; unused.
3513 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
3514 when getting gnulib.
3515
35162005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
3517
3518 * data/glr.c: Reorder typedef declarations for structs to match order
3519 of struct declarations.
3520 Rename yystack everywhere to yystackp except in yyparse where it's not
3521 a pointer.
3522 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
3523 consistency.
3524 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
3525 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
3526 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
3527 lint.
3528
35292005-12-09 Paul Eggert <eggert@cs.ucla.edu>
3530
3531 * tests/sets.at (Accept): Fix typos in regular expression used to
3532 sed out the final state number.
3533
3534 Work around portability problem on Solaris 10: flex-generated
3535 files include <stdio.h> before <config.h>, which messes up
3536 because the latter defines __EXTENSIONS__. Address the problem
3537 by creating two new little files that include <config.h> first,
3538 then include the flex-generated files. Rewrite everyone else
3539 to include <config.h> first, as well.
3540 * lib/timevar.c: Always include "config.h".
3541 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
3542 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
3543 (EXTRA_bison_SOURCES): New macro.
3544 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
3545 * src/system.h: Don't include config.h.
3546 * src/LR0.c: Include <config.h> first.
3547 * src/assoc.c: Likewise.
3548 * src/closure.c: Likewise.
3549 * src/complain.c: Likewise.
3550 * src/conflicts.c: Likewise.
3551 * src/derives.c: Likewise.
3552 * src/files.c: Likewise.
3553 * src/getargs.c: Likewise.
3554 * src/gram.c: Likewise.
3555 * src/lalr.c: Likewise.
3556 * src/location.c: Likewise.
3557 * src/main.c: Likewise.
3558 * src/muscle_tab.c: Likewise.
3559 * src/nullable.c: Likewise.
3560 * src/output.c: Likewise.
3561 * src/parse-gram.y: Likewise.
3562 * src/print.c: Likewise.
3563 * src/print_graph.c: Likewise.
3564 * src/reader.c: Likewise.
3565 * src/reduce.c: Likewise.
3566 * src/relation.c: Likewise.
3567 * src/state.c: Likewise.
3568 * src/symlist.c: Likewise.
3569 * src/symtab.c: Likewise.
3570 * src/tables.c: Likewise.
3571 * src/uniqstr.c: Likewise.
3572 * src/vcg.c: Likewise.
3573
3574 * src/parse-gram.y: Fix minor problems uncovered by lint.
3575 (current_lhs, current_lhs_location): Now static.
3576 (current_assoc): Remove unused variable.
3577
3578 Cleanups so that Bison-generated parsers have less lint.
3579 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
3580 Prepend /*ARGSUSED*/, for lint's sake.
3581 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
3582 definition if 'lint' is defined.
3583 (YYID): New macro (or function, if lint).
3584 All uses of /*CONSTCOND*/0 replaced by YYID(0).
3585 * data/yacc.c: Likewise.
3586 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
3587 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
3588 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
3589 is C++ only.
3590 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
3591 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
3592 Use YYID(0) rather than 0, for lint.
3593 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
3594 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
3595
35962005-12-07 Paul Eggert <eggert@cs.ucla.edu>
3597
3598 * tests/glr-regression.at
3599 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
3600 Close memory leak reported by twlevo.
3601
36022005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
3603
3604 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
3605 all stacks.
3606 (yyparse): Iterate another stack in order to call user destructors.
3607 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3608 New test case.
3609 (Duplicated user destructor for lookahead): This test now is expected
3610 to succeed.
3611
36122005-12-01 Paul Eggert <eggert@cs.ucla.edu>
3613
3614 * NEWS: Document the following change.
3615 * data/yacc.c: Say "parser skeleton" rather than "file", since
3616 it's no longer just a file.
3617 * data/glr.c: Grant a special exception for C GLR parsers, that
3618 reads like the already-existing exception for C LALR(1) parsers.
3619 * data/glr.cc: Likewise.
3620 * data/lalr1.cc: Likewise.
3621 * data/location.cc: Likewise.
3622 * data/yacc.c: Reword the "written by" statement to clarify that
3623 it was the parser skeleton, not the entire output file.
3624 * data/glr.c: Written by Paul Hilfinger.
3625 * data/glr.cc: Written by Akim Demaille.
3626 * data/lalr1.cc: Likewise.
3627
36282005-11-18 Paul Eggert <eggert@cs.ucla.edu>
3629
3630 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
3631 Fix typos in previous change that broke 'make check'.
3632 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
3633 supported in C.
3634 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
3635 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
3636 We can revert this once things settle down.
3637
3638 * src/conflicts.c (conflicts_print): Don't print file name twice
3639 when %expect fails because there were no conflicts.
3640 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
3641 change.
3642 * tests/conflicts.at (%expect not enough, %expect too much):
3643 (%expect with reduce conflicts): Adjust to new behavior.
3644
36452005-11-18 Akim Demaille <akim@epita.fr>
3646
3647 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
3648 errors.
3649 * NEWS: Document this.
3650 * doc/bison.texinfo (Expect Decl): Likewise.
3651
36522005-11-16 Akim Demaille <akim@epita.fr>
3653
3654 Generalize the display of semantic values and locations in traces.
3655 * data/glr.c (yy_reduce_print): Fix indices (again).
3656 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
3657 literal integers.
3658 * data/lalr1.cc (yyreduce_print): Rename as...
3659 (yy_reduce_print): this.
3660 Display values and locations.
3661 * data/yacc.c (yy_reduce_print): Likewise.
3662 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
3663 (yysymprint): Move higher to be visible from yy_reduce_print).
3664 (yyparse): Adjust.
3665 * tests/calc.at: Adjust the expected length of the traces.
3666
36672005-11-14 Akim Demaille <akim@epita.fr>
3668
3669 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
3670 from 1 to N, while values and location start at 0.
3671 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
3672
36732005-11-14 Akim Demaille <akim@epita.fr>
3674
3675 * data/glr.c (yy_reduce_print): Fix the $ number.
3676
36772005-11-14 Akim Demaille <akim@epita.fr>
3678
3679 "Use" parse parameters.
3680 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
3681 * data/glr.c, data/glr.cc: Use them.
3682 * data/glr.c (YYUSE): Have a C++ definition that supports
3683 non-pointer types.
3684
36852005-11-14 Akim Demaille <akim@epita.fr>
3686
3687 * data/glr.c (yyexpandGLRStack): Declare only if defined.
3688
36892005-11-14 Akim Demaille <akim@epita.fr>
3690
3691 * data/glr.cc: New.
3692 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
3693
36942005-11-12 Akim Demaille <akim@epita.fr>
3695
3696 Let position and location be PODs.
3697 * data/location.cc (position::initialize, location::initialize): New.
3698 (position::position, location::location): Define only if
3699 b4_location_constructors is defined.
3700 * data/lalr1.cc (b4_location_constructors): Define it for backward
3701 compatibility.
3702 * doc/bison.texinfo (Initial Action Decl): Use initialize.
3703
37042005-11-12 Akim Demaille <akim@epita.fr>
3705
3706 * data/lalr1.cc: Move the body of the ctor and dtor into the
3707 parser file (instead of the header).
3708 Wrap the implementations in a "namespace yy".
3709
37102005-11-12 Akim Demaille <akim@epita.fr>
3711
3712 Have glr.c include its header file when created.
3713 * data/glr.c (b4_shared_declarations): New.
3714 Output them verbatim in the parser if !%defines, otherwise
3715 output then in the header file, and include it instead.
3716
37172005-11-11 Akim Demaille <akim@epita.fr>
3718
3719 * data/glr.c: Comment changes.
3720
37212005-11-11 Akim Demaille <akim@epita.fr>
3722
3723 When yydebug, report semantic and location values for reductions.
3724 * data/glr.c (yy_reduce_print): Report the semantic values and the
3725 locations.
3726 (YY_REDUCE_PRINT): Adjust.
3727 (yyglrReduce): Use them.
3728 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
3729 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
3730 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
3731 traces.
3732
37332005-11-10 Akim Demaille <akim@epita.fr>
3734
3735 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
3736 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
3737 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
3738
37392005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
3740
3741 * m4/cxx.m4, examples/Makefile.am: Don't build
3742 examples/calc++ if no C++ compiler is available. (trivial change)
3743
37442005-11-09 Akim Demaille <akim@epita.fr>
3745
3746 * src/scan-skel.l: Use a couple of asserts.
3747
37482005-11-03 Akim Demaille <akim@epita.fr>
3749
3750 In some (weird) cases, the final state number is incorrect.
3751 Reported by Alexandre Duret-Lutz.
3752 * src/LR0.c (state_list_append): Remove the computation of
3753 final_state.
3754 (save_reductions): Do it here.
3755 (get_state): Alpha conversion.
3756 (generate_states): Use a for loop.
3757 * src/gram.h (item_number_is_rule_number)
3758 (item_number_is_symbol_number): New.
3759 * src/state.c: Use assert.
3760 * src/system.h: Include assert.h.
3761 * tests/sets.at (Accept): New.
3762
37632005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3764
3765 * data/glr.c (yyfill): Adjust comment.
3766 (yyresolveAction): Initialize default location properly
3767 for empty right-hand sides.
3768 (yydoAction): Ditto.
3769 Add comment explaining apparently dead code.
3770 * tests/glr-regression.at
3771 (Incorrectly initialized location for empty right-hand side in GLR):
3772 New test.
3773
37742005-10-30 Paul Eggert <eggert@cs.ucla.edu>
3775
3776 * bootstrap (cleanup_gnulib): New function. Use it to clean up
3777 gnulib when interrupted. This fixes some race conditions and
3778 works around some portability problems (one noted by Paul
3779 Hilfinger).
3780
37812005-10-22 Akim <akim@epita.fr>
3782
3783 * Makefile.cfg: Adjust to config -> build-aux.
3784 Reported by twledo.
3785
37862005-10-21 Akim Demaille <akim@epita.fr>
3787
3788 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
3789 the %parse-params.
3790 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
3791 * data/yacc.c (b4_Pure_if): Rename as...
3792 (b4_yacc_pure_if): this.
3793 (YY_SYMBOL_PRINT, yyparse): Adjust.
3794 * doc/bison.texinfo: Formatting changes.
3795
37962005-10-21 Akim Demaille <akim@epita.fr>
3797
3798 Finish the transition config -> build-aux.
3799 * configure.ac, Makefile.am: Use build-aux.
3800 * config/prev-version, config/announce-gen, config/Makefile.am:
3801 Move to...
3802 * build-aux/prev-version, build-aux/announce-gen,
3803 * build-aux/Makefile.am: here.
3804
38052005-10-14 Akim Demaille <akim@epita.fr>
3806
3807 * examples/calc++/test: Use set -x only when VERBOSE.
3808
38092005-10-13 Paul Eggert <eggert@cs.ucla.edu>
3810
3811 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
3812 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
3813
38142005-10-13 Akim Demaille <akim@epita.fr>
3815
3816 * src/scan-skel.l: Output the base name parts of the parser and
3817 header file names.
3818 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
3819 additional checks.
3820 Use this to exercise C++ outputs in subdirs.
3821 Reported by Oleg Smolsky.
3822
38232005-10-12 Paul Eggert <eggert@cs.ucla.edu>
3824
3825 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
3826 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
3827 Problem reported by John P. Hartmann.
3828 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
3829 already defined it.
3830
38312005-10-12 Akim Demaille <akim@epita.fr>
3832
3833 * src/parse-gram.y (version_check): Exit 63 to please missing
3834 (stands for "version mismatch).
3835 * tests/input.at, doc/bison.texinfo: Adjust.
3836
38372005-10-10 Paul Eggert <eggert@cs.ucla.edu>
3838
3839 Work around portability problems with Visual Age C compiler
3840 (xlc and xlC_r) reported by John P. Hartmann.
3841 * data/location.cc (initial_column, initial_line): Remove.
3842 All uses replaced by 0 and 1.
3843 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
3844 that xlc complains about.
3845 * src/scan-skel.l (skel_wrap): Likewise.
3846 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
3847 as __STDC__.
3848 * data/yacc.c (YYMODERN_C): New macro, which also looks at
3849 __STDC_VERSION__. Use it everywhere instead of looking at
3850 __STDC__ and __cplusplus.
3851
38522005-10-10 Akim Demaille <akim@epita.fr>
3853
3854 * examples/calc++/test: Be quiet unless VERBOSE.
3855
38562005-10-05 Paul Eggert <eggert@cs.ucla.edu>
3857
3858 * data/c.m4 (yydestruct, yysymprint):
3859 Use YYUSE instead of casting to void.
3860 * data/glr.c (YYUSE): New macro.
3861 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3862 Use it instead of rolling our own.
3863 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3864 (YYCHK1):
3865 Use /*CONSTCOND*/ to suppress lint warnings.
3866 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3867 (YY_STACK_PRINT): Use 'false' not '0'.
3868 (YYUSE): New macro.
3869 (yysymprint_, yydestruct_): Use it instead of rolling our own.
3870 * data/yacc.c (YYUSE): New macro.
3871 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
3872 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
3873 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
3874
3875
3876 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
3877 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
3878
38792005-10-04 Paul Eggert <eggert@cs.ucla.edu>
3880
3881 Undo the parts of the unlocked-I/O change that substituted
3882 putc or puts for printf. This might hurt performance a bit,
3883 but some people prefer the printf style.
3884 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
3885 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
3886 All uses replaced by YYFPRINTF and YYDPRINTF.
3887 * data/yacc.c: Likewise.
3888 * lib/bitset.c (bitset_print): Likewise.
3889 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
3890 putc and puts.
3891 * lib/lbitset.c (debug_lbitset): Likewise.
3892 * src/closure.c (print_firsts, print_fderives): Likewise.
3893 * src/gram.c (grammar_dump): Likewise.
3894 * src/lalr.c (look_ahead_tokens_print): Likewise.
3895 * src/output.c (escaped_output): Likewise.
3896 (user_actions_output): Break apart two printfs.
3897 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
3898 * src/reduce.c (reduce_print): Likewise.
3899 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
3900 * src/system.h: Include unlocked-io.h rathe than stdio.h.
3901
3902 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3903 Use assignments rather than casts-to-void to suppress
3904 unused-variable warnings. This pacifies 'lint'.
3905 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
3906 unused-variable warnings.
3907
39082005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3909
3910 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3911
39122005-10-02 Paul Eggert <eggert@cs.ucla.edu>
3913
3914 Use unlocked I/O for a minor performance improvement on hosts like
3915 GNU/Linux and Solaris that support unlocked I/O. The basic idea
3916 is to use the gnlib unlocked-io module, and to prefer putc and
3917 puts to printf when either will work (since the latter doesn't
3918 come in an unlocked flavor).
3919 * bootstrap (gnulib_modules): Add unlocked-io.
3920 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
3921 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
3922 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
3923 and similarly for puts and putc and printf.
3924 * data/yacc.c: Likewise.
3925 * lib/bitset.c (bitset_print): Likewise.
3926 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
3927 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
3928 to printf.
3929 * lib/lbitset.c (debug_lbitset): Likewise.
3930 * src/closure.c (print_firsts, print_fderives): Likewise.
3931 * src/gram.c (grammar_dump): Likewise.
3932 * src/lalr.c (look_ahead_tokens_print): Likewise.
3933 * src/output.c (escaped_output): Likewise.
3934 (user_actions_output): Coalesce two printfs.
3935 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
3936 * src/reduce.c (reduce_print): Likewise.
3937 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
3938 * src/system.h: Include unlocked-io.h rather than stdio.h.
3939
3940 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
3941 this confuses xgettext.
3942
39432005-10-02 Akim Demaille <akim@epita.fr>
3944
3945 * bootstrap (gnulib_modules): Add strverscmp.
3946 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
3947 * m4/.cvsignore: Add strverscmp.m4.
3948 * src/parse-gram.y (%require): New token, new rule.
3949 (version_check): New.
3950 * src/scan-gram.l (%require): Adjust.
3951 * tests/input.at (AT_REQUIRE): New.
3952 Use it.
3953 * doc/bison.texinfo (Require Decl): New.
3954 (Calc++ Parser): Use %require.
3955
39562005-10-02 Akim Demaille <akim@epita.fr>
3957
3958 * data/location.cc: New.
3959
39602005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
3961 Akim Demaille <akim@epita.fr>
3962
3963 Make sure -odir/foo.cc creates dir/location.hh etc.
3964 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
3965 (spec_file_prefix, spec_verbose_file, spec_graph_file)
3966 (spec_defines_file): Now const.
3967 (dir_prefix): New.
3968 (short_base_name): Remove.
3969 * src/files.c: Adjust.
3970 (dirname.h): Include.
3971 (base_name): Don't prototype it.
3972 (finput): Remove, duplicates gram_in.
3973 (full_base_name, short_base_name): Replace by...
3974 (all_but_ext, all_but_tab_ext): these.
3975 (compute_base_names): Rename as...
3976 (compute_file_name_parts): this.
3977 Update to compute the new variables, including dir_prefix.
3978 Adjust dependencies.
3979 * src/output.c (prepare): Output them.
3980 * src/reader.c: Adjust to use gram_in, not finput.
3981 * src/scan-skel.l (@dir_prefix@): New.
3982
39832005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3984
3985 * lib/subpipe.c: New function end_of_output_subpipe() added
3986 to allow support for non-posix systems. This is a no-op function
3987 for posix systems.
3988
3989 * lib/subpipe.h: New function end_of_output_subpipe() added
3990 to allow support for non-posix systems. This is a no-op function
3991 for posix systems.
3992
3993 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
3994 handle the lack of pipe/fork functionality on non-posix systems.
3995
3996 * djgpp/Makefile.maint: DJGPP specific file.
3997
3998 * djgpp/README.in: DJGPP specific file.
3999
4000 * djgpp/config.bat: DJGPP specific configuration file.
4001
4002 * djgpp/config.sed: DJGPP specific configuration file.
4003
4004 * djgpp/config.site: DJGPP specific configuration file.
4005
4006 * djgpp/config_h.sed: DJGPP specific configuration file.
4007
4008 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
4009
4010 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
4011
40122005-10-02 Akim Demaille <akim@epita.fr>
4013
4014 * data/location.cc: New, extract from...
4015 * data/lalr1.cc: here.
4016 (location.hh): Include it after the user prologue, in case the
4017 filename type is defined by the user.
4018 Forward declation location and position before the pre-prologue.
4019 (yyresult_): Rename as...
4020 (yyresult): this, it's a local variable, not an attribute.
4021 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
4022
40232005-10-01 Akim Demaille <akim@epita.fr>
4024
4025 * examples/extexi: Restore the #line generation.
4026
40272005-09-30 Akim Demaille <akim@epita.fr>,
4028 Alexandre Duret-Lutz <adl@gnu.org>
4029
4030 Move the token type and YYSTYPE in the parser class.
4031 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
4032 (parser::token): New, from the moved free definition of tokens.
4033 (parser::semantic_value): Now a full definition instead of an
4034 indirection to YYSTYPE.
4035 (b4_post_prologue): No longer included in the header file, but
4036 in the implementation file.
4037 * doc/bison.texi (C+ Language Interface): Update.
4038 * src/parse-gram.y: Support unary %define.
4039 * tests/actions.at: Define global_tokens_and_yystype for backward
4040 compatibility until we update the tests.
4041 * tests/calc.at: Idem.
4042 (first_line, first_column, last_line, last_column): Define for lalr1.cc
4043 to simplify the code.
4044
40452005-09-29 Paul Eggert <eggert@cs.ucla.edu>
4046
4047 Port to SunOS 4.1.4, which lacks strtoul and strerror.
4048 Ah, the good old days! Problem reported by Peter Klein.
4049 * bootstrap (gnulib_modules): Add strerror, strtoul.
4050 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
4051 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
4052
40532005-09-29 Akim Demaille <akim@epita.fr>
4054
4055 * data/c.m4 (b4_error_verbose_if): New.
4056 * data/lalr1.cc: Use it.
4057 (YYERROR_VERBOSE_IF): Remove.
4058 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
4059 parser members, replaced by...
4060 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
4061 local variables.
4062 (yysyntax_error_): Takes the state number as argument.
4063 (yyreduce_print_): Use the argument yyrule, not the former
4064 attribute yyn_.
4065
40662005-09-26 Paul Eggert <eggert@cs.ucla.edu>
4067
4068 * bootstrap (gnulib_modules): Add verify.
4069 * lib/.cvsignore: Add verify.h.
4070 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
4071 * src/system.h (verify): Remove.
4072 Include verify.h instead.
4073 * src/tables.c (tables_generate): Use new API for 'verify'.
4074
40752005-09-21 Paul Eggert <eggert@cs.ucla.edu>
4076
4077 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
4078 local variables whose names begin with 'yy'.
4079 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
4080 Trivial changes from Joel E. Denny.
4081
4082 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
4083 it itself.
4084 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
4085 don't use alloca any more.
4086
4087 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
4088 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
4089 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
4090 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
4091 to match yacc.c, to test more hosts.
4092
40932005-09-20 Paul Eggert <eggert@cs.ucla.edu>
4094
4095 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
4096 doesn't affect behavior.
4097 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
4098 Solaris, AIX, MSC.
4099 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
4100 This works a bit better with glibc, if user code has already included
4101 stdlib.h.
4102 * doc/bison.texinfo (Bison Parser): Document that users can't
4103 arbitrarily use malloc and free for other purposes. Document
4104 that <alloca.h> and <malloc.h> might be included.
4105 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
4106 user must declare alloca.
4107
4108 * HACKING (release): Forwarn the Translation Project about
4109 stable releses.
4110
41112005-09-20 Akim Demaille <akim@epita.fr>
4112
4113 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
4114
41152005-09-19 Paul Eggert <eggert@cs.ucla.edu>
4116
4117 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
4118 (YYSTACK_ALLOC_MAXIMUM): Use it.
4119 (yysyntax_error): New function.
4120 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
4121 multiple syntax errors are reported, and alloca is being used.
4122 Instead, reallocate buffers twice as big each time, so that
4123 we waste at most half the allocated memory. Start with a small
4124 (128-byte) buffer that will suffice in most cases anyway.
4125 Use yysyntax_error to do most of the work.
4126
4127 * doc/bison.texinfo (Error Reporting, Table of Symbols):
4128 yynerrs is the number of errors reported, not the number of
4129 errors encountered.
4130
4131 * tests/glr-regression.at (Duplicated user destructor for lookahead):
4132 Mark it as expected to fail.
4133 Cast result of malloc; problem reported by twlevo@xs4all.nl.
4134 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
4135 Don't start user-code symbols with "yy", to avoid name space problems.
4136
41372005-09-19 Akim Demaille <akim@epita.fr>
4138
4139 Remove the traits, failed experiment.
4140 It never proved useful, and anyway because of the current
4141 definition, it was not possible to have several specialization of
4142 this traits, making it useless.
4143 * data/lalr1.cc (yy:traits): Remove.
4144 Inline its definitions in the parser class.
4145
41462005-09-19 Akim Demaille <akim@epita.fr>
4147
4148 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
4149 least Mac OSX with a /usr/local install of gettext.
4150
41512005-09-19 Akim Demaille <akim@epita.fr>
4152
4153 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
4154 and yytoken for similarity with the other skeletons.
4155
41562005-09-19 Akim Demaille <akim@epita.fr>
4157
4158 * NEWS, configure.ac: update version number to 2.1a.
4159
41602005-09-16 Paul Eggert <eggert@cs.ucla.edu>
4161
4162 * NEWS: Version 2.1.
4163
4164 * NEWS: Remove notice of yytname change, since it was never in an
4165 official release.
4166 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
4167 diagnostic.
4168 * src/output.c (prepare): Likewise.
4169 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
4170 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
4171 is not defined. This is an awful hack, but it's enough for now.
4172 All callers changed.
4173 * tests/glr-regression-at (make_value): Args are const pointers now,
4174 to avoid GCC warning.
4175 (Duplicated user destructor for lookahead): New test. Currently
4176 skipped. It fails on my host but I'm not sure it'll always fail.
4177
41782005-09-16 Akim Demaille <akim@epita.fr>
4179
4180 * src/symtab.h (struct symbol): Declare the printer and destructor
4181 as const, to avoid accidental calls to free.
4182 (symbol_destructor_set, symbol_printer_set): Adjust.
4183 * src/symtab.c: Adjust.
4184
41852005-09-16 Akim Demaille <akim@epita.fr>
4186
4187 * data/c.m4 (b4_token_enums): New.
4188 (b4_token_defines): Rename as...
4189 (b4_token_enums_defines): this.
4190 (b4_token_defines): New, output only the #defines.
4191 * data/yacc.c, data/glr.c: Adjust.
4192 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
4193 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
4194 as default values.
4195
41962005-09-16 Akim Demaille <akim@epita.fr>
4197
4198 * data/lalr1.cc (yylex_): Remove, inline its code.
4199 (yyreport_syntax_error_): Remove, replaced by...
4200 (yysyntax_error_): this which returns a string and leaves to the
4201 caller the call to the users' error function.
4202 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
4203 Move from members of the parser object...
4204 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
4205 to local variables of the parse function.
4206
42072005-09-16 Akim Demaille <akim@epita.fr>
4208
4209 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
4210 since it's in Bison's name space.
4211
42122005-09-15 Paul Eggert <eggert@cs.ucla.edu>
4213
4214 * data/glr.c (yyresolveValue): Add default case to pacify
4215 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
4216
4217 * NEWS: Document when yyparse started to return 2.
4218 * doc/bison.texinfo (Parser Function): Document when yyparse
4219 returns 2.
4220
4221 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
4222 (b4_filename_type): Renamed back from b4_file_name_type. All uses
4223 changed.
4224 (class position): file_name -> filename (reverting). All uses changed.
4225
42262005-09-14 Paul Eggert <eggert@cs.ucla.edu>
4227
4228 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
4229 do anything if $@ exists. This reverts part of the 2005-07-07
4230 patch.
4231
42322005-09-11 Paul Eggert <eggert@cs.ucla.edu>
4233
4234 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
4235 contains obsolete information and isn't worth distributing as a
4236 separate file anyway.
4237 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
4238 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
4239 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
4240 (yyparse): Abort if user code uses longjmp to throw an unexpected
4241 value.
4242
42432005-09-09 Paul Eggert <eggert@cs.ucla.edu>
4244
4245 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
4246 Suggested by twlevo@xs4all.nl.
4247
4248 * data/glr.c (YYCHK1): Do not assume YYE is in range.
4249 This avoids a diagnostic from gcc -Wswitch-enum.
4250 Problem reported by twlevo@xs4all.nl.
4251
4252 * doc/bison.texinfo: Don't use "filename", as per GNU coding
4253 standards. Use "file name" or "file" or "name", depending on
4254 the context.
4255 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
4256 not to hack/foo.tab.c.
4257 (Calc++ Top Level): 2nd arg of main is not const.
4258 * data/glr.c: b4_filename -> b4_file_name.
4259 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
4260 All uses changed.
4261 (class position): filename -> file_name. All uses changed.
4262 * data/yacc.c: b4_filename -> b4_file_name.
4263 * lib/bitset.h: filename -> file_name in local vars.
4264 * lib/bitset_stats.c: Likewise.
4265 * src/files.c: Likewise.
4266 * src/scan-skel.l ("@output ".*\n): Likewise.
4267 * src/files.c (file_name_split): Renamed from filename_split.
4268 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
4269
42702005-09-08 Paul Eggert <eggert@cs.ucla.edu>
4271
4272 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
4273 to accommodate latest gnulib.
4274
4275 * tests/glr-regression.at (Duplicate representation of merged trees):
4276 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
4277
4278 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
4279 needed.
4280
42812005-08-26 Paul Eggert <eggert@cs.ucla.edu>
4282
4283 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
4284 All uses changed. Invoke user destructor after an error during a
4285 split parse (trivial change from Joel E. Denny).
4286
4287 * tests/glr-regression.at
4288 (User destructor after an error during a split parse): New test case.
4289 Problem reported by Joel E. Denny in:
4290 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
4291
42922005-08-25 Paul Eggert <eggert@cs.ucla.edu>
4293
4294 * README-cvs: Give URLs for recommended tools.
4295 Mention Gzip version problem, and bootstrapping issues.
4296 Remove troubleshooting section, as it's somewhat obsolete.
4297
4298 * bootstrap (no_cache): New var, to accommodate different wget
4299 variants. Use it instead of '-C off'. Problem reported by
4300 twlevo@xs4all.nl.
4301
4302 * data/glr.c (yydestroyStackItem): New function.
4303 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
4304 debugging information. Problem reported by Joel E. Denny.
4305
43062005-08-25 Akim Demaille <akim@epita.fr>
4307
4308 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
4309
43102005-08-24 Paul Eggert <eggert@cs.ucla.edu>
4311
4312 * data/glr.c (yyrecoverSyntaxError, yyreturn):
4313 Don't invoke destructor on unresolved entries.
4314 * tests/glr-regression.at
4315 (User destructor for unresolved GLR semantic value): New test case.
4316 Problem reported by Joel E. Denny in:
4317 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
4318
43192005-08-21 Paul Eggert <eggert@cs.ucla.edu>
4320
4321 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
4322 Add strnlen.c.
4323 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
4324 lib-prefix.m4, po.m4.
4325
4326 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
4327 in yydestruct diagnostic, since it might not be an error.
4328 Problem reported by Joel Denny near end of
4329 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
4330 * data/lalr1.cc (yyerturn): Likewise.
4331 * data/yacc.c (yyreturn): Likewise.
4332 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
4333
4334 * src/files.c: Remove obsolete FIXME comment.
4335
4336 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
4337 with the other templates, and to fix bogus run-on messages such
4338 as the one reported at the end of
4339 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
4340 All callers changed to avoid the newline.
4341 (yyprocessOneStack): Output two lines rather than one, to accommodate
4342 the above change. This changes the debug output format slightly.
4343
4344 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
4345 reported by Joel E. Denny in
4346 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
4347 (trivial change).
4348 * tests/glr-regression.at (Duplicate representation of merged trees):
4349 New test, from Joel E. Denny in:
4350 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
4351 * THANKS: Add Joel E. Denny.
4352
4353 * configure.ac (AC_INIT): Bump to 2.0c.
4354
43552005-07-24 Paul Eggert <eggert@cs.ucla.edu>
4356
4357 * NEWS: Version 2.0b.
4358
4359 * Makefile.am (SUBDIRS): Put examples before tests, so that
4360 "make check" doesn't finish with "All 1 tests passed".
4361
4362 * tests/regression.at (Token definitions): Don't rely on
4363 AT_PARSER_CHECK for data that contains backslashes. It currently
4364 uses 'echo', and 'echo' isn't portable if its argument contains
4365 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
4366 that the byte '\0xff' is not printable in the C locale; it is,
4367 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
4368 not printable, so use '\0x81' to test.
4369
4370 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
4371 version of GCC, since the macro is used with non-GCC compilers.
4372
4373 Fix core dump reported by Pablo De Napoli in
4374 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
4375 * tests/regression.at (Invalid inputs with {}): New test.
4376 * src/parse-gram.y (token_name): Translate type before using
4377 it as an index.
4378
4379 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
4380 the user's name space. All uses changed to __attribute__
4381 ((__unused__)).
4382 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
4383 Add __attribute__ ((__noreturn__)).
4384
4385 * etc/clcommit: Remove. We weren't using it, and it failed
4386 "make maintainer-distcheck".
4387 * Makefile.maint: Merge from coreutils.
4388 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
4389 (syntax-check-rules): Change list of rules as described below.
4390 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
4391 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
4392 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
4393 (sc_trailing_space): New rules.
4394 (sc_xalloc_h_in_src): Remove.
4395 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
4396 (sc_space_tab, sc_error_exit_success, sc_changelog):
4397 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
4398 (makefile-check, po-check, author_mark_check):
4399 (makefile_path_separator_check, copyright-check):
4400 Use grep -n, to make it easier to find violations.
4401 Use CVS_LIST and CVS_LIST_EXCEPT.
4402 (header_regexp, h_re): Remove.
4403 (dd_c): New macro.
4404 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
4405 (my-distcheck): Use more-modern GCC flags.
4406 (signatures, %.asc): Remove.
4407 (rel-files, announcement): Remove signatures.
4408 Restore old updating code, even though we don't use it, so
4409 that we're the same as coreutils.
4410 (alpha, beta, major): Depend on news-date-check.
4411 Make the upload commands.
4412
4413 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
4414 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
4415 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
4416 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
4417 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
4418 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
4419 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
4420 * tests/sets.at: Likewise.
4421
4422 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
4423 we comment out the Autoconf version number.
4424 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
4425 it's error-prone and "make maintainer-distcheck" rejects it.
4426
4427 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
4428 Indent calls to "error" to pacify "make maintainer-distcheck",
4429 when the calls are not intended to be translated.
4430 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
4431
4432 * src/Makefile.am (DEFS): Use +=, to pacify
4433 "make maintainer-distcheck".
4434 (bison_SOURCES): Add scan-skel.h.
4435 (sc_tight_scope): New rule, from coreutils.
4436
4437 * src/files.c (src_extension, header_extension):
4438 Now static, not extern.
4439 * src/getargs.c (short_options): Likewise.
4440 * src/muscle_tab.c (muscle_table): Likewise.
4441 * src/parse-gram.y (current_class, current_type, current_prec):
4442 Likewise.
4443 * src/reader.c (grammar_end, previous_rule_end): Likewise.
4444 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
4445 * src/main.c (main): Cast bindtextdomain and textdomain calls to
4446 void, to avoid warning when NLS is disabled.
4447 * src/output.c: Include scan-skel.h.
4448 (scan_skel): Remove decl, since scan-skel.h does this.
4449 (output_skeleton):
4450 Indent calls to "error" to pacify "make maintainer-distcheck".
4451 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
4452 * src/reader.h (gram_end, gram_lineno): New decls to pacify
4453 "make maintainer-distcheck".
4454 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
4455 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
4456 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
4457 (skel_lex_destroy, scan_skel): Move these decls to...
4458 * src/scan-skel.h: New file.
4459 * src/uniqstr.c (uniqstr_assert):
4460 Indent calls to "error" to pacify "make maintainer-distcheck".
4461
4462 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
4463 not @VAR@.
4464
4465 * tests/torture.at: Revamp to avoid misuse of atoi that
4466 "make maintainer-distcheck" complained about.
4467
4468 * examples/extexi (message): Don't print a message more than once,
4469 and omit line-number decoration that makes Emacs compile think
4470 that informative messages are worth worrying about.
4471
44722005-07-22 Paul Eggert <eggert@cs.ucla.edu>
4473
4474 * configure.ac: Update version number.
4475
4476 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
4477 accidentally.
4478 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
4479 autogenerated by the maintainer.
4480 * examples/calc++/.cvsignore: Add *.yy.
4481
4482 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
4483 * lib/bitset_stats.c (bitset_stats_init): Likewise.
4484 * lib/bitsetv.c (bitsetv_alloc): Likewise.
4485
4486 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
4487
4488 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
4489 from maintainer-distcheck about casting the argument of 'free'.
4490
4491 * NEWS: Mention recent yytname changes.
4492 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
4493
4494 * bootstrap: For translations that have not yet been upgraded to
4495 the new runtime-po domain, prime the pump by extracting the
4496 relevant strings from the obsolete translations. This code can be
4497 removed once the bison-runtime domain has been translated by each
4498 team.
4499
4500 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
4501 now that token names are already quoted.
4502
4503 Fix problem reported by Anthony Heading.
4504 * data/glr.c (YYTOKEN_TABLE): New macro.
4505 (yytname): Define if YYTOKEN_TABLE.
4506 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
4507 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
4508 (YYERROR_VERBOSE): Define the same way the other skeletons do.
4509 * src/output.c (prepare_symbols): Output token_table_flag.
4510
45112005-07-21 Paul Eggert <eggert@cs.ucla.edu>
4512
4513 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
4514 again if the first call fails.
4515
4516 * data/glr.c (yytnamerr): New function.
4517 (yyreportSyntaxError): Use it to dequote most string literals.
4518 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
4519 with other skeletons. All uses changed.
4520 (yytnameerr_): New function.
4521 (yyreport_syntax_error): Use it to dequote most string literals.
4522 * data/yacc.c (yytnamerr): New function.
4523 (yyerrlab): Use it to decode most string literals.
4524 * doc/bison.texinfo (Decl Summary, Calling Convention):
4525 Clarify quoting convention of yytname.
4526 * src/output.c (prepare_symbols): Quote all names. This undoes
4527 the 2005-04-17 change, which is now accomplished (mostly) via
4528 changes in the parsers as described above.
4529 * tests/regression.at (Token definitions, Web2c Actions):
4530 Undo most 2005-04-17 change here, too.
4531
45322005-07-20 Paul Eggert <eggert@cs.ucla.edu>
4533
4534 Fix more problems reported by twlevo@xs4all.nl.
4535 * tests/cxx-type.at: Don't pipe output of ./types through sed to
4536 remove trailing spaces. This loses the exit status of ./types,
4537 and isn't needed since ./types shouldn't be emitting trailing
4538 spaces.
4539 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
4540 as the stack isn't valid in that case.
4541
4542 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4543 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4544 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4545 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
4546 is used.
4547 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
4548 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
4549 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
4550 Likewise.
4551
4552 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
4553 overly-picky compilers that reject 'char *foo = "bar";'.
4554
4555 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
4556 to FILE * parameter, not to stderr. This fixes a typo introduced
4557 in the 2005-07-12 change.
4558
4559 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
4560 warnings from GCC 4.
4561
4562 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
4563 (yyglrShiftDefer, yysplitStack):
4564 Remove unused parameters b4_pure_formals. All uses changed.
4565 (yyglrShift): Remove unused parameters b4_user_formals.
4566 All uses changed.
4567 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
4568
45692005-07-18 Paul Eggert <eggert@cs.ucla.edu>
4570
4571 Destructor cleanups and regularization among the three skeletons.
4572 * NEWS: Document the behavior changes.
4573 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
4574 stack before failing, as the cleanup code will do it for us now.
4575 * data/lalr1.cc (yyerrlab): Likewise.
4576 * data/glr.c (yyparse): Pop everything off the stack before
4577 freeing it, so that destructors get called properly.
4578 * data/lalr1.cc (yyreturn): Likewise.
4579 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
4580 This is more consistent.
4581 * doc/bison.texinfo (Destructor Decl): Mention more reasons
4582 why destructors might be called. 1.875 -> 2.1.
4583 (Destructor Decl, Decl Summary, Table of Symbols):
4584 Some English-language cleanups for %destructor.
4585 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
4586 Add output line for destructor of start symbol.
4587 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
4588 because of that same extra output line.
4589
4590 * NEWS: Document minor wording changes in diagnostics of
4591 Bison-generated parsers.
4592 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
4593 Remove unused formals. All uses changed.
4594 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
4595 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
4596 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
4597 Rename yyoverflowab to yyexhaustedlab.
4598 When memory exhaustion occurs during syntax-error reporting,
4599 report it separately rather than in a single diagnostic; this
4600 eases translation.
4601 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
4602 (Memory Exhausted): Renamed from Parser Stack Overflow.
4603 Revamp wording slightly to prefer "memory exhaustion".
4604 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
4605
4606 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
4607
4608 Add i18n support to the GLR skeleton. Partially fix the C++
4609 skeleton; a C++ expert needs to finish this. Remove debugging
4610 msgids; there's little point to having them translated, since they
4611 can be understood only by someone who can read the
4612 (English-language) source code.
4613
4614 Generate runtime-po/bison-runtime.pot automatically, so that we
4615 don't have to worry about garbage getting in that file. We'll
4616 make sure after the next official release that old msgids don't
4617 get lost. See
4618 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
4619
4620 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
4621 Now auto-generated.
4622 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
4623 Fix typos in explanations of the runtime file.
4624 * bootstrap: Change gettext keyword from YYI18N to YY_.
4625 Use standard Makefile.in.in in runtime-po, since we'll arrange
4626 for backward-compatible bison-runtime.po files in a different way.
4627 * data/glr.c (YY_): New macro, from yacc.c.
4628 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
4629 Translate messages intended for users.
4630 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
4631 the wording in the other skeletons. We don't know that the memory
4632 is virtual.
4633 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
4634 Use same method that yacc.c uses.
4635 Don't translate debugging messages.
4636 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
4637 it doesn't work (yet), and requires C++ expertise to fix.
4638 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
4639 Move defn to a more logical place, to be consistent with other
4640 skeletons.
4641 Don't translate debugging messages.
4642 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
4643 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
4644 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
4645 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
4646
4647 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
4648 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
4649 void, not int.
4650 * tests/glr-regression.at (Badly Collapsed GLR States):
4651 Likewise.
4652 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4653 yylex should return 0 at EOF rather than aborting.
4654
4655 Improve tests for stack overflow in GLR parser.
4656 Problem reported by twlevo@xs4all.nl.
4657 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
4658 All uses removed.
4659 (yyStackOverflow): Just longjmp, but with value 2 so that caller
4660 can handle the problem.
4661 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
4662 (yyparse): New local variable yyresult to record the result.
4663 Use result of setjmp to set it, rather than storing itinto
4664 struct.
4665 (yyDone): Remove label.
4666 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
4667 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
4668 if YYABORT is used).
4669 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
4670 yyparse status; put status > 1 into diagnostic.
4671 Check that status==2 works.
4672 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
4673 Use exit status 3 for failure to open (which shouldn't happen).
4674
46752005-07-17 Paul Eggert <eggert@cs.ucla.edu>
4676
4677 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
4678 1 on syntax error; just let yyparse do its thing.
4679 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
4680 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
4681 (Exploding the Stack Size with Alloca):
4682 (Exploding the Stack Size with Malloc):
4683 Expect exit status 2, not 1, since the parser is supposed to blow
4684 its stack. Problem reported by twlevo@xs4all.nl.
4685
4686 * data/glr.c (yyparse): Don't assume that the initial calls
4687 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
4688 Print a stack-overflow message and fail instead.
4689 Initialize the line-number information before creating the stack,
4690 so that the stack-overflow message can report line zero safely.
4691
46922005-07-14 Paul Eggert <eggert@cs.ucla.edu>
4693
4694 Fix problems reported by twlevo@xs4all.nl.
4695 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
4696 (yyuserMerge): Provide a default case if b4_mergers is empty.
4697 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
4698 * tests/glr-regression.at
4699 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4700 Add casts to pacify C++ compilers.
4701 * tests/glr-regression.at (Improper merging of GLR delayed action
4702 sets): Declare yylex before using it.
4703 * tests/Makefile.am (maintainer-check-g++): Fix a stray
4704 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
4705 test for valgrind; valgrind is independent of g++.
4706 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
4707 for compatibility with POSIX 1003.1-2001 (if running coreutils).
4708 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
4709 Use a destructor, so that we can expand the stack. Change
4710 YYSTYPE to char * so that we can free it. Cast result of malloc.
4711
47122005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4713
4714 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
4715 a valgrind failure. Problem reported by twlevo@xs4all.nl.
4716
47172005-07-13 Paul Eggert <eggert@cs.ucla.edu>
4718
4719 * PACKAGING: New file, suggested by Bruno Haible and taken from
4720 similar wording in gettext's PACKAGING file.
4721 * NEWS: Mention PACKAGING.
4722 * Makefile.am (EXTRA_DIST): Add PACKAGING.
4723
47242005-07-12 Paul Eggert <eggert@cs.ucla.edu>
4725
4726 * NEWS: Document recent i18n improvements.
4727 * bootstrap: Get runtime translations into runtime-po.
4728 Create runtime-po files automatically, if possible.
4729 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
4730 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
4731 does not infringe on the user's name space.
4732 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
4733 * doc/bison.texinfo (Internationalization): Revamp the English
4734 and Texinfo syntax a bit, to try to make it clearer.
4735 (Bison Options, Option Cross Key): Mention --print-localedir.
4736 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
4737 YYENABLE_NLS. Quote a bit more.
4738 * runtime-po/.cvsignore: New file.
4739 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
4740 * runtime-po/Rules-quot: Remove; now created by bootstrap.
4741 * runtime-po/quot.sed: Likewise.
4742 * runtime-po/boldquot.sed: Likewise.
4743 * runtime-po/en@quot.header: Likewise.
4744 * runtime-po/en@boldquot.header: Likewise.
4745 * runtime-po/insert-header.sin: Likewise.
4746 * runtime-po/remove-potcdate.sin: Likewise.
4747 * runtime-po/Makevars: Likewise.
4748 * runtime-po/LINGUAS: Likewise.
4749 * runtime-po/de.po: Likewise; we will rely on the translation project
4750 to maintain this, so "bootstrap" should get it.
4751 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
4752 its value.
4753 * src/main.c (main): Bind the bison-runtime domain, too.
4754
47552005-07-12 Bruno Haible <bruno@clisp.org>
4756
4757 * data/yacc.c: Include <libintl.h> when NLS is enabled.
4758 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
4759 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
4760 * runtime-po: New directory.
4761 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
4762 $(DOMAIN).pot-update rule, so that old messages are never dropped.
4763 * runtime-po/Rules-quot: New file, copied from po/.
4764 * runtime-po/quot.sed: Likewise.
4765 * runtime-po/boldquot.sed: Likewise.
4766 * runtime-po/en@quot.header: Likewise.
4767 * runtime-po/en@boldquot.header: Likewise.
4768 * runtime-po/insert-header.sin: Likewise.
4769 * runtime-po/remove-potcdate.sin: Likewise.
4770 * runtime-po/Makevars: New file.
4771 * runtime-po/POTFILES.in: New file.
4772 * runtime-po/LINGUAS: New file.
4773 * runtime-po/bison-runtime.pot: New file.
4774 * runtime-po/de.po: New file.
4775 * m4/bison.m4: New file.
4776 * Makefile.am (SUBDIRS): Add runtime-po.
4777 (aclocaldir, aclocal_DATA): New variables.
4778 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
4779 Define aclocaldir.
4780 * src/getargs.c (usage): Document --print-localedir option.
4781 (PRINT_LOCALEDIR_OPTION): New enum item.
4782 (long_options): Add --print-localedir option.
4783 (getargs): Handle --print-localedir option.
4784 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
4785 (Internationalization): New section.
4786
47872005-07-12 Akim Demaille <akim@epita.fr>
4788
4789 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
4790 for consistency with the rest of the code.
4791 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
4792 Add separators.
4793
47942005-07-12 Akim Demaille <akim@epita.fr>
4795
4796 * src/parse-gram.y: Use %printer instead of YYPRINT.
4797
47982005-07-12 Akim Demaille <akim@epita.fr>
4799
4800 * src/symtab.h, src/symtab.c (symbol_print): New.
4801 * src/symlist.h, src/symlist.c (symbol_list_print): New.
4802 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
4803
48042005-07-12 Akim Demaille <akim@epita.fr>
4805
4806 * data/glr.c (b4_syncline): Fix (swap) the definitions of
4807 b4_at_dollar and b4_dollar_dollar.
4808
48092005-07-11 Paul Eggert <eggert@cs.ucla.edu>
4810
4811 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
4812 and Pennello's paper.
4813
48142005-07-09 Paul Eggert <eggert@cs.ucla.edu>
4815
4816 * data/yacc.c (yyparse): Undo previous patch. Instead,
4817 set yylsp[0] and yyvsp[0] only if the initial action
4818 sets yylloc and yylval, respectively.
4819
4820 * data/yacc.c (yyparse): In the initial action, set
4821 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
4822 This avoids the use of undefined variables if the initial
4823 action does not set yylloc and/or yylval.
4824
48252005-07-07 Paul Eggert <eggert@cs.ucla.edu>
4826
4827 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
4828 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
4829 Remove from CVS. These files are automatically generated.
4830 * examples/extexi: Clarify that this file is now part of Bison,
4831 not GNU M4, and that it works with any POSIX-compatible Awk.
4832 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
4833 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
4834 so that we also get calc++-parser.yy. Geneate it.
4835 Use $(AWK), not gawk, since any conforming Awk will do.
4836 Put comment before action, since older 'make' can't handle comment
4837 in action.
4838 $(BUILT_SOURCES): List all built sources, not just some of them.
4839 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
4840 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
4841 $($(calc_sources_generated)): Remove unnecessary test for existence
4842 of target. (This had a shell syntax error anyway; a stray "x".)
4843 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
4844 calc++-parser.yy.
4845 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
4846
4847 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
4848 implied by the other modules.
4849
48502005-07-06 Akim Demaille <akim@epita.fr>
4851
4852 Bind examples/calc++ to the package.
4853 * examples/calc++/Makefile: Remove, replaced by...
4854 * examples/calc++/Makefile.am: ... this new file.
4855 * examples/calc++/test: Remove input.
4856 * examples/calc++/compile: Remove.
4857 * examples/Makefile.am: New.
4858 * configure.ac, Makefile.am: Adjust.
4859 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
4860
48612005-07-05 Paul Eggert <eggert@cs.ucla.edu>
4862
4863 * data/glr.c (yyFail): Drastically simplify; since the format argument
4864 never had any % directives, we can simply pass it to yyerror.
4865 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
4866 be modified later, as that is the usual style in glr.c.
4867 Problems reported by Paul Hilfinger.
4868
4869 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
4870 and size overflow errors.
4871 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
4872 in case the user prolog sets feature-test macros like _GNU_SOURCE.
4873 (YYSIZEMAX): New macro.
4874 (yystpcpy): New function, taken from yacc.c.
4875 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
4876 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
4877 so that we don't have to maintain their signatures.
4878 (yyFail): Check for buffer overflow, by using vsnprintf rather
4879 than vsprintf. Allocate a bigger buffer if possible.
4880 Report an error if buffer allocation fails.
4881 (yyStackOverflow): New function.
4882 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
4883 the initialization was successful. It might fail if storage was
4884 exhausted.
4885 (yyexpandGLRStack): Add more checks for storage allocation failure.
4886 Use yyStackOverflow to report failures.
4887 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
4888 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
4889 Don't assume stack number fits in int.
4890 (yysplitStack): Check for storage allocation failure.
4891 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
4892 can print diagnostics on storage allocation failure. All callers
4893 changed.
4894 (yyresolveValue): Use yybool for boolean.
4895 (yyreportSyntaxError): Check for size-calculation overflow.
4896 This code is taken from yacc.c.
4897 (yyparse): Check for storage allocation errors when allocating
4898 the initial stack.
4899
49002005-07-05 Akim Demaille <akim@epita.fr>
4901
4902 Extract calc++ from the documentation.
4903 * doc/bison.texinfo (Calc++): Add the extraction marks.
4904 * examples/extexi: New, from the aborted GNU Programming 2E.
4905 Separate the different paragraph of a file with empty lines.
4906 * examples/Makefile: Use it to extract the whole calc++ example.
4907
49082005-06-24 Akim Demaille <akim@epita.fr>
4909
4910 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
4911 class typedefs.
4912
49132005-06-22 Akim Demaille <akim@epita.fr>
4914
4915 * doc/bison.texinfo (C++ Language Interface): First stab.
4916 (C++ Parsers): Remove.
4917
49182005-06-22 Akim Demaille <akim@epita.fr>
4919
4920 * data/lalr1.cc (yylex_): Honor %lex-param.
4921
49222005-06-22 Akim Demaille <akim@epita.fr>
4923
4924 Start a set of simple examples.
4925 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
4926 * examples/calc++/calc++-driver.hh,
4927 * examples/calc++/calc++-parser.yy,
4928 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
4929 * examples/calc++/compile, examples/calc++/test: New.
4930
49312005-06-09 Paul Eggert <eggert@cs.ucla.edu>
4932
4933 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
4934 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
4935 which stems from the 2005-05-27 patch.
4936
49372005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4938
4939 * data/glr.c: Modify treatment of unused parameters to permit use
4940 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
4941
49422005-05-30 Paul Eggert <eggert@cs.ucla.edu>
4943
4944 Fix infringement on user name space reported by Janos Zoltan Szabo.
4945 * data/yacc.c (yyparse): strlen -> yystrlen.
4946
49472005-05-30 Akim Demaille <akim@epita.fr>
4948
4949 * data/lalr1.cc (_): New.
4950 Translate the various messages.
4951
49522005-05-27 Paul Eggert <eggert@cs.ucla.edu>
4953
4954 Fix infringement on user name space reported by Bruno Haible.
4955 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
4956 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
4957 the user's name space.
4958 (alloca): Include <stdlib.h> to get it, if it's not built in.
4959 (YYMALLOC, YYFREE): Define only if needed.
4960 (malloc, free): Declare, but only if needed, as this infringes on
4961 the user name space.
4962
49632005-05-25 Paul Eggert <eggert@cs.ucla.edu>
4964
4965 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
4966 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
4967 with %d format.
4968 * lib/ebitset.c (min, max): Undef before defining.
4969 * lib/vbitset.c (min, max): Likewise.
4970 * lib/subpipe.c (create_subpipe): Save local variables in case
4971 vfork clobbers them.
4972
49732005-05-24 Bruno Haible <bruno@clisp.org>
4974
4975 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
4976 error message syntax used by gcc-4.0.
4977
49782005-05-23 Paul Eggert <eggert@cs.ucla.edu>
4979
4980 * README: Mention m4 1.4.3. Remove obsolete advice about
4981 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
4982
4983 * bootstrap: Remove workaround for problem I encountered with
4984 gettext 0.14.1; it seems to be fixed now.
4985
49862005-05-22 Paul Eggert <eggert@cs.ucla.edu>
4987
4988 * NEWS: Version 2.0a.
4989
4990 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
4991 the previous change.
4992
4993 Various maintainer cleanups.
4994 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
4995 conftest*, for benefit of CVS commands run at the same time as
4996 "configure". Add build-aux, since "bootstrap" now creates it and
4997 its subfiles.
4998 * Makefile.cfg (move_if_change): Remove.
4999 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
5000 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
5001 (po_repo, do-po-update, po-update, wget_files, get-targets):
5002 (config.guess-url_prefix, config.sub-url_prefix):
5003 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
5004 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
5005 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
5006 Remove.
5007 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
5008 this is now the recommended name.
5009 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
5010 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
5011 ylwrap. These files now go into build-aux.
5012 * config/move-if-change: Remove.
5013 * config/prev-version.txt: Bump from 1.75 to 2.0.
5014
5015 * bootstrap: Add stdio-safer, unistd-safer modules.
5016 Remove m4/glibc2.m4 (introduced by latest gnulib, but
5017 we don't need it).
5018 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
5019 fopen-safer.c, stdio-safer.h, unistd-safer.h.
5020 * lib/subpipe.c: Include "unistd-safer.h".
5021 (create_subpipe): Make sure all the newly-created
5022 file descriptors are > 2, so that diagnostics don't
5023 get sent down them (which might cause Bison to hang, in theory).
5024 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
5025 * src/files.c (xfopen): Use fopen_safer, not fopen.
5026
5027 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
5028 yesterday's yacc.c fix.
5029
50302005-05-21 Paul Eggert <eggert@cs.ucla.edu>
5031
5032 * data/glr.c, data/lalr1.cc: Update copyright date.
5033
5034 Fix a destructor bug reported by Wolfgang Spraul in
5035 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
5036 * data/yacc.c (yyabortlab): Don't call destructor, and
5037 don't set yychar to EMPTY.
5038 (yyoverflowlab): Don't call destructor.
5039 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
5040 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
5041 since we no longer output the message "discarding lookahead token
5042 end of input ()".
5043
50442005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5045
5046 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
5047 fix a small glitch in debugging output.
5048 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
5049 after YY_SYMBOL_PRINT where needed.
5050
5051 (struct yyGLRState): Add some comments.
5052 (struct yySemanticOption): Add some comments.
5053 (union yyGLRStackItem): Add comment.
5054
5055 (yymergeOptionSets): Correct this to properly perform the union,
5056 avoiding infinite reported by Michael Rosien.
5057 Update comment.
5058
5059 * tests/glr-regression.at: Add test for GLR merging error reported
5060 by M. Rosien.
5061
50622005-05-13 Paul Eggert <eggert@cs.ucla.edu>
5063
5064 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
5065 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
5066 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
5067 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
5068 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
5069 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
5070 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
5071 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
5072 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
5073 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
5074 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
5075 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
5076 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
5077 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
5078 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
5079 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
5080 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
5081 src/derives.h, src/files.c, src/files.h, src/getargs.c,
5082 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
5083 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
5084 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
5085 src/output.h, src/parse-gram.c, src/parse-gram.h,
5086 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
5087 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
5088 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
5089 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
5090 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
5091 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
5092 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
5093 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
5094 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
5095 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
5096 tests/reduce.at, tests/regression.at, tests/sets.at,
5097 tests/synclines.at, tests/testsuite.at, tests/torture.at:
5098 Update FSF postal mail address.
5099
51002005-05-11 Paul Eggert <eggert@cs.ucla.edu>
5101
5102 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
5103 Problem reported by Ralf Menzel.
5104
51052005-05-01 Paul Eggert <eggert@cs.ucla.edu>
5106
5107 * tests/actions.at: Test that stack overflow invokes destructors.
5108 From Marcus Holland-Moritz.
5109 * data/yacc.c (yyerrlab): Move the code that destroys the stack
5110 from here....
5111 (yyreturn): to here. That way, destructors are called properly
5112 even if the stack overflows, or the user calls YYACCEPT or
5113 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
5114 (yyoverflowlab): Destroy the lookahead.
5115
51162005-04-24 Paul Eggert <eggert@cs.ucla.edu>
5117
5118 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
5119
51202005-04-17 Paul Eggert <eggert@cs.ucla.edu>
5121
5122 * NEWS: Bison-generated C parsers no longer quote literal strings
5123 associated with tokens.
5124 * src/output.c (prepare_symbols): Don't escape strings,
5125 since users don't want to see C escapes.
5126 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
5127 in diagnostics.
5128 * tests/input.at (Torturing the Scanner): Likewise.
5129 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
5130
51312005-04-16 Paul Eggert <eggert@cs.ucla.edu>
5132
5133 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
5134 the data size is known to be too small and we can't increase it.
5135 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
5136
51372005-04-15 Paul Eggert <eggert@cs.ucla.edu>
5138
5139 * src/parse-gram.y: Include quotearg.h.
5140 (string_as_id): Quote $1 before using it as a key, since the
5141 lexer no longer quotes it for us.
5142 (string_content): Don't strip quotes, since lexer no longer
5143 quotes it for us.
5144 * src/scan-gram.l: Include quotearg.h.
5145 ("\""): Omit quote.
5146 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
5147 a key, since the rest of the lexer doesn't quote it.
5148 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
5149 * tests/regression.at (Token definitions): Check for backslashes
5150 in token strings.
5151
5152 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
5153 (YYSIZE_T): Define to unsigned long int when using an older compiler.
5154 (yyparse): Revamp code to generate long syntax error message, to
5155 make it easier to translate, and to avoid problems with arithmetic
5156 overflow. Change "virtual memory" to "memory" in diagnostic, since
5157 we don't know whether the memory is virtual.
5158
51592005-04-13 Paul Eggert <eggert@cs.ucla.edu>
5160
5161 * NEWS: Bison-generated C parsers now use the _ macro to
5162 translate strings.
5163 * data/yacc.c (_) [!defined _]: New macro.
5164 All English strings wrapped inside this macro.
5165 * doc/bison.texinfo (Bison Parser): Document _.
5166 * po/POTFILES.in: Include src/parse-gram.c, since it now
5167 includes translateable strings that parse-gram.y doesn't.
5168
51692005-04-12 Paul Eggert <eggert@cs.ucla.edu>
5170
5171 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
5172 reverting the 2004-10-11 change to this function.
5173 (symbol_check_alias_consistency): Don't call symbol_type_set
5174 if the type name is already correct.
5175 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
5176
51772005-03-25 Paul Eggert <eggert@cs.ucla.edu>
5178
5179 * tests/regression.at (Token definitions): Don't use a token named
5180 c, as that generates a "#define c ..." that runs afoul of buggy
5181 stdlib.h that uses the identifier c as a member of struct
5182 drand48_data. Problem reported by Horst Wente.
5183
51842005-03-21 Paul Eggert <eggert@cs.ucla.edu>
5185
5186 * bootstrap: Change translation URL from
5187 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
5188 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
5189 redirection glitches. Problem reported by twlevo@xs4all.nl.
5190
51912005-03-20 Paul Eggert <eggert@cs.ucla.edu>
5192
5193 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
5194 after operands; POSIX says this isn't portable for the c99 command.
5195
51962005-03-18 Paul Eggert <eggert@cs.ucla.edu>
5197
5198 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
5199 immediately if a data overrun has occurred; this may help us track
5200 down what may be a spurious failure on MacOS.
5201
52022005-03-17 Paul Eggert <eggert@cs.ucla.edu>
5203
5204 Respond to problems reported by twlevo@xs4all.nl.
5205
5206 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
5207
5208 * src/vcg.h: Comment fix.
5209 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
5210 (G_CMAX): Change to -1 instead of INT_MAX.
5211
5212 * data/yacc.c (yyparse): Omit spaces before #line.
5213
52142005-03-15 Paul Eggert <eggert@cs.ucla.edu>
5215
5216 * src/tables.c (state_number_to_vector_number): Put it inside an
5217 "#if 0", since it's not currently used. Problem reported by
5218 Roland McGrath.
5219
52202005-03-06 Paul Eggert <eggert@cs.ucla.edu>
5221
5222 * src/output.c (escaped_output): Renamed from
5223 escaped_file_name_output, since we now use it for symbol tags as
5224 well. All uses changed.
5225 (symbol_destructors_output, symbol_printers_output):
5226 Escape symbol tags too.
5227 Problem reported by Matyas Forstner in
5228 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
5229
5230 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
5231 not needed.
5232 * src/output.c (user_actions_output, token_definitions_output,
5233 symbol_destructors_output, symbol_printers_output): Likewise.
5234 * src/reader.c (prologue_augment): Likewise.
5235 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
5236
5237 * src/vcg.c (output_edge): Don't quote linestyle arg.
5238 Problem reported by twlevo@xs4all.nl.
5239
52402005-02-28 Paul Eggert <eggert@cs.ucla.edu>
5241
5242 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
5243 example, reported by Derek M Jones. Also, make the example even
5244 more outrageous, to better illustrate how bad the problem is.
5245
52462005-02-24 Paul Eggert <eggert@cs.ucla.edu>
5247
5248 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
5249 putsym. Typo reported by Sebastian Piping.
5250
52512005-02-23 Paul Eggert <eggert@cs.ucla.edu>
5252
5253 * doc/bison.texinfo (Language and Grammar): some -> same
5254 (Epilogue): int he -> in the
5255 Typos reported by Sebastian Piping via Justin Pence.
5256
52572005-02-07 Paul Eggert <eggert@cs.ucla.edu>
5258
5259 * tests/glr-regression.at (Improper handling of embedded actions
5260 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
5261 embedded actions and $-N in GLR parsers", work around an Autoconf bug
5262 with dollar signs in test names.
5263 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
5264 for a similar reason.
5265
52662005-01-28 Paul Eggert <eggert@cs.ucla.edu>
5267
5268 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
5269 wants to redefine G_VIEW.
5270
52712005-01-27 Paul Eggert <eggert@cs.ucla.edu>
5272
5273 * src/vcg.c (get_view_str): Remove case for normal_view.
5274 Problem reported by twlevo@xs4all.nl.
5275
52762005-01-24 Paul Eggert <eggert@cs.ucla.edu>
5277
5278 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
5279 Problem reported by twlevo@xs4all.nl.
5280
5281 * doc/bison.texinfo: Change @dircategory from "GNU programming
5282 tools" to "Software development". Requested by Richard Stallman
5283 via Karl Berry.
5284
52852005-01-23 Paul Eggert <eggert@cs.ucla.edu>
5286
5287 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
5288 Problem reported by twlevo@xs4all.nl.
5289
52902005-01-21 Paul Eggert <eggert@cs.ucla.edu>
5291
5292 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
5293 keyword; it's not needed with modern compilers, and it doesn't
5294 affect correctness with older compilers. Suggested by
5295 twlevo@xs4all.nl.
5296
52972005-01-17 Paul Eggert <eggert@cs.ucla.edu>
5298
5299 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
5300 gcc -Wswitch-default.
5301 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
5302 * data/yacc.c (yyparse): Likewise.
5303
53042005-01-12 Paul Eggert <eggert@cs.ucla.edu>
5305
5306 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
5307 already. Let config.h define any nonstandard values.
5308
53092005-01-10 Paul Eggert <eggert@cs.ucla.edu>
5310
5311 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
5312 for the benefit of slower hosts. Problem reported by
5313 Nelson H. F. Beebe.
5314
53152005-01-07 Paul Eggert <eggert@cs.ucla.edu>
5316
5317 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
5318 being defined and not used.
5319 * data/lalr1.cc (yyparse): Likewise.
5320 Use "if (false)" rather than "if (0)".
5321
53222005-01-05 Paul Eggert <eggert@cs.ucla.edu>
5323
5324 * TODO: Mention that we should allow NUL bytes in tokens.
5325
53262005-01-02 Paul Eggert <eggert@cs.ucla.edu>
5327
5328 * src/scan-skel.l (<<EOF>>): Don't close standard output.
5329 Problem reported by Hans Aberg.
5330
53312005-01-01 Paul Eggert <eggert@cs.ucla.edu>
5332
5333 * src/getargs.c (version): Happy new year; update overall
5334 program copyright date from 2004 to 2005.
5335
5336 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
5337 Problem reported by Hans Aberg.
5338 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
5339 (Output file names.): Add a test for the case when standard output
5340 is closed.
5341
53422004-12-26 Paul Eggert <eggert@cs.ucla.edu>
5343
5344 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
5345 to fix an oversight in the Bison 2.0 manual.
5346
53472004-12-25 Paul Eggert <eggert@cs.ucla.edu>
5348
5349 * NEWS: Version 2.0. Reformat the existing news items since
5350 1.875, so that related items are grouped together.
5351 * configure.ac (AC_INIT): Bump version to 2.0.
5352 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
5353
5354 * tests/torture.at (Exploding the Stack Size with Alloca): Set
5355 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
5356 otherwise, we're not testing alloca. Unfortunately there's no
5357 simple way to consult HAVE_ALLOCA here.
5358
5359 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
5360 for yymsg, too.
5361
5362 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
5363 hand. This avoids a warning about comparing int to size_t when
5364 GCC warnings are enabled.
5365
53662004-12-22 Paul Eggert <eggert@cs.ucla.edu>
5367
5368 * NEWS: Bison-generated parsers no longer default to using the
5369 alloca function (when available) to extend the parser stack, due
5370 to widespread problems in unchecked stack-overflow detection.
5371 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
5372 responsibility to set it to a positive value. This lets the user
5373 specify a value that is not a preprocessor constant.
5374 * data/yacc.c (YYMAXDEPTH): Likewise.
5375 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
5376 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
5377 to be a compile-time constant. However, explain the constraints on it.
5378 Also, explain the constraints on YYINITDEPTH.
5379 (Table of Symbols): Explain that alloca is no longer the default.
5380 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
5381 to 1.
5382
5383 * doc/bison.texinfo (Location Default Action): Mention that n must
5384 be zero when k is zero. Suggested by Frank Heckenbach.
5385
53862004-12-22 Akim Demaille <akim@epita.fr>
5387
5388 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
5389 (parser::state_type, parser::semantic_type, parser::location_type):
5390 Private, not public.
5391 (parser::parse): Return ints, not bool.
5392 Returning a bool introduces a problem: 0 corresponds to false, and
5393 it seems weird to return false on success. Returning true changes
5394 the conventions for yyparse.
5395 Alternatively we could return void and send an exception.
5396 There is no clear consensus (yet?).
5397 (state_stack, semantic_stack, location_stack): Rename as...
5398 (state_stack_type, semantic_stack_type, location_stack_type): these.
5399 Private, not public.
5400 * tests/c++.at: New.
5401 * tests/testsuite.at, tests/Makefile.am: Adjust.
5402
54032004-12-21 Akim Demaille <akim@epita.fr>
5404
5405 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
5406
54072004-12-21 Akim Demaille <akim@epita.fr>
5408
5409 Don't impose std::string for filenames.
5410
5411 * data/lalr1.cc (b4_filename_type): New.
5412 (position::filename): Use it.
5413 (parser.hh): Move the inclusion of stack.hh and location.hh below
5414 the user code, so that needed headers for the filename type can be
5415 included first.
5416 Forward declare them before the user code.
5417 * tests/Makefile.am (check-local, installcheck-local): Pass
5418 TESTSUITEFLAGS to the TESTSUITE.
5419
54202004-12-20 Akim Demaille <akim@epita.fr>
5421
5422 Use more STL like names: my_class instead of MyClass.
5423
5424 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
5425 (SemanticStack, SemanticType, StateStack, StateType)
5426 (TokenNumberType, Stack, Slice, Traits, Parser::location)
5427 (Parser::value): Rename as...
5428 (location_stack, location_type, rhs_number_type, semantic_stack)
5429 (semantic_type, state_stack, state_type, token_number_type, stack)
5430 (slice, traits, parser::yylloc, parser::yylval): these.
5431
5432 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
5433
54342004-12-19 Paul Eggert <eggert@cs.ucla.edu>
5435
5436 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
5437 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
5438
54392004-12-17 Paul Eggert <eggert@cs.ucla.edu>
5440
5441 Remove uses of 'short int' and 'unsigned short int'. This raises
5442 some arbitrary limits. It uses more memory but nowadays that's
5443 not much of an issue.
5444
5445 This change does not affect the generated parsers; that's a different
5446 task, as some users will want to conserve memory there.
5447
5448 Ideally we should use size_t to represent all object counts, and
5449 something like ptrdiff_t to represent signed differences of object
5450 counts; but that will require more code-cleanup than I have the
5451 time to do right now.
5452
5453 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
5454 Use size_t, not int or short int, to count objects.
5455 * src/closure.c (nritemset, closure): Likewise.
5456 * src/closure.h (nritemset, closure): Likewise.
5457 * src/nullable.c (nullable_compute): Likewise.
5458 * src/print.c (print_core): Likewise.
5459 * src/print_graph.c (print_core): Likewise.
5460 * src/state.c (state_compare, state_hash): Likewise.
5461 * src/state.h (struct state): Likewise.
5462 * src/tables.c (default_goto, goto_actions): Likewise.
5463
5464 * src/gram.h (rule_number, rule): Use int, not short int.
5465 * src/output.c (prepare_rules): Likewise.
5466 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
5467 errs, reductions): Likewise.
5468 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
5469 Likewise.
5470 * src/tables.c (vector_number, tally, action_number,
5471 ACTION_NUMBER_MINIMUM): Likewise.
5472 * src/output.c (muscle_insert_short_int_table): Remove.
5473
54742004-12-17 Akim Demaille <akim@epita.fr>
5475
5476 * data/lalr1.cc: Extensive Doxygenation.
5477 (error_): Rename as...
5478 (error): this, since it is visible to the user.
5479 Adjust callers.
5480 (Parser::message): Now an automatic variable from...
5481 (Parser::yyreport_syntax_error_): here.
5482 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
5483 Parser::error.
5484 * tests/input.at: Escape $.
5485
54862004-12-16 Paul Eggert <eggert@cs.ucla.edu>
5487
5488 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
5489 Parenthesize rhs to avoid obscure problems with mistakes like
5490 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
5491 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5492 b4_rhs_location): Likewise.
5493 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5494 b4_rhs_location): Likewise.
5495
54962004-12-16 Akim Demaille <akim@epita.fr>
5497
5498 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
5499 yacc.c: be sure to stay within yycheck_.
5500 * tests/actions.at: Re-enable C++ tests.
5501
55022004-12-16 Akim Demaille <akim@epita.fr>
5503
5504 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
5505 real.
5506
55072004-12-16 Akim Demaille <akim@epita.fr>
5508
5509 Use #define to handle the %name-prefix.
5510
5511 * data/glr.c, data/yacc.c: Comment changes.
5512 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
5513 so that one can refer to yylex in the parser file, and have it
5514 renamed, as is the case with other skeletons.
5515
55162004-12-16 Akim Demaille <akim@epita.fr>
5517
5518 Move lalr1.cc internals into yy*.
5519
5520 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
5521 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
5522 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
5523 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
5524 (empty_, final_, terror_, errcode_, ntokens_)
5525 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
5526 (looka_, ilooka_, error_range_, nerrs_):
5527 Rename as...
5528 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
5529 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
5530 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
5531 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
5532 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
5533 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
5534 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
5535 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
5536 these.
5537
55382004-12-15 Paul Eggert <eggert@cs.ucla.edu>
5539
5540 Fix some problems reported by twlevo at xs4all.
5541 * src/symtab.c (symbol_new): Report an error if the input grammar
5542 contains too many symbols. This is better than calling abort() later.
5543 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
5544 (struct node, struct graph):
5545 Rename member expand to stretch. All uses changed.
5546 (struct graph): Remove member layoutalgorithm. All uses removed.
5547 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
5548 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
5549 All uses changed.
5550 (N_STRETCH): Rename from N_EXPAND. All uses changed.
5551
55522004-12-15 Akim Demaille <akim@epita.fr>
5553
5554 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
5555 Add more Doxygen comments.
5556 (symprint_, stack_print_, reduce_print_, destruct_, pop)
5557 (report_syntax_error_, translate_): Rename as...
5558 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
5559 (yypop_, yyreport_syntax_error_, yytranslate_): this.
5560
55612004-12-15 Akim Demaille <akim@epita.fr>
5562
5563 * data/lalr1.cc (lex_): Rename as...
5564 (yylex_): this.
5565 Move the trace here.
5566 Take the %name-prefix into account.
5567 Reported by Alexandre Duret-Lutz.
5568
55692004-12-15 Akim Demaille <akim@epita.fr>
5570
5571 Simplify the C++ parser constructor.
5572
5573 * data/lalr1.cc (debug_): Rename as...
5574 (yydebug_): so that the parser's internals are always in the yy*
5575 pseudo namespace.
5576 Adjust uses.
5577 (b4_parse_param_decl): Remove the leading comma as it is now only
5578 called as unique argument list.
5579 (Parser::Parser): Remove the constructor accepting a location and
5580 an initial debugging level.
5581 Remove from the other ctor the argument for the debugging level.
5582 (debug_level_type, debug_level, set_debug_level): New.
5583
5584 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
5585 constructor calls.
5586
55872004-12-15 Akim Demaille <akim@epita.fr>
5588
5589 Remove b4_root related material: failure experiment
5590 (which goal was to allow to derive from a class).
5591
5592 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
5593 definitions and uses.
5594
55952004-12-14 Paul Eggert <eggert@cs.ucla.edu>
5596
5597 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
5598 not 2, since it's not portable to subtract 1 from the start of an
5599 array. The new item 0 is never set or used. All uses changed.
5600
5601 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
5602 the default definition of YYLLOC_DEFAULT. Problem reported
5603 by Frank Heckenbach.
5604
56052004-12-12 Paul Eggert <eggert@cs.ucla.edu>
5606
5607 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
5608 the normal case and one for the error case. Just use the
5609 first one uniformly. Problem reported by Frank Heckenbach.
5610 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
5611 use exactly the same macro in both places.
5612 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
5613 so that the normal-case YYRHSLOC works for the error case too.
5614 All uses changed.
5615 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
5616 (YYLLOC_DEFAULT): Use the same macro as glr.c.
5617 * doc/bison.texinfo (Location Default Action): Don't claim that
5618 we have an array of locations. Use the same macro for both glr
5619 and lalr parsers. Mention YYRHSLOC. Mention what happens when
5620 the index is 0.
5621
56222004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5623
5624 * HACKING: Update email addresses to send announcements to.
5625
5626 * configure.ac (AC_INIT): Bump version to 1.875f.
5627
56282004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5629
5630 * NEWS: Version 1.875e.
5631 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
5632
5633 * src/scan-skel.l: Include "complain.h", for "fatal".
5634
5635 * src/relation.h (relation_print, relation_digraph):
5636 Relation sizes are of type relation_node, not size_t (this is
5637 merely a doc fix, since the two types are equivalent).
5638 (relation_transpose): Relation sizes are of type relation_node,
5639 not int.
5640 * src/relation.c: Likewise.
5641 (top, infinity): Now of type relation_node, not int.
5642 (traverse, relation_transpose): Use relation_node, not int.
5643
5644 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
5645 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
5646 (yyparse): Remove unused local introduced in 2004-10-25 patch.
5647
5648 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
5649 specifying whether the test should be skipped. Use it tp
5650 specify that the [%defines %skeleton "lalr1.cc"] tests currently
5651 fail on some hosts, and should be skipped.
5652
56532004-12-08 Paul Eggert <eggert@cs.ucla.edu>
5654
5655 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
5656 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
5657 unless otherwise specified below.
5658
5659 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
5660 to allocate kernel_base, kernel_items, kernel_size, since
5661 they needn't be initialized to 0.
5662 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
5663 * src/closure.c (new_closure): Likewise, for itemset.
5664 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
5665 * src/lalr.c (set_goto_map): Likewise, for temp_map.
5666 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
5667 (build_relations): Likewise for edge, states1, includes.
5668 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
5669 * src/reader.c (packgram): Likewise, for ritem, rules.
5670 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
5671 * src/relation.c (relation_digraph): Likewise for VERTICES.
5672 (relation_transpose): Likewise for new_R, end_R.
5673 * src/symtab.c (symbols_token_translations_init): Likewise for
5674 token_translations.
5675 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
5676 (token_actions): Likewise for yydefact, actrow, conflrow,
5677 conflict_list.
5678 (save_column): Likewise for froms[symno], tos[symno].
5679 (goto_actions): Likewise for state_count.
5680 (pack_table): Likewise for base, pos, check.
5681 (tables_generate): Likewise for width.
5682
5683 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
5684 for initial core. Just have a separate core, so we needn't worry
5685 about whether kernel_size and kernel_base are initialized.
5686
5687 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
5688 kernel_size, kernel_items): Remove unnecessary initialization.
5689 * src/conflicts.c (conflicts): Likewise.
5690 * src/derives.c (derives): Likewise.
5691 * src/muscle_tablc (muscle_insert): Likewise.
5692 * src/relation.c (relation_digraph): Likewise.
5693 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
5694 conflrow, conflict_table, conflict_list, table, check):
5695 Likewise.
5696
5697 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
5698 This is because all callers pass unsigned int.
5699 * src/closure.h (new_closure): Likewise.
5700
5701 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
5702 (build_relations): Initialize includes[i] in all cases.
5703 * src/reader.c (packgram): Always initialize rules[ruleno].prec
5704 and rules[ruleno].precsym. Initialize members in order.
5705 * src/relation.c (relation_transpose): Always initialize new_R[i]
5706 and end_R[i].
5707 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
5708
5709 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
5710 conflict_list[0] was always 0, but now it isn't initialized.
5711
5712 * src/table.c (table_grow): When conflict_table grew, the grown
5713 area wasn't cleared. Fix this.
5714
5715 * lib/.cvsignore: Add strdup.c, strdup.h.
5716 * m4/.cvsignore: Add strdup.m4.
5717
57182004-12-07 Paul Eggert <eggert@cs.ucla.edu>
5719
5720 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
5721 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
5722 GOTO_NUMBER_MAXIMUM, since we occasionally compute
5723 ngotos + 1 without checking for overflow.
5724 (build_relations): Use END_NODE, not -1, to denote end of edges.
5725 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
5726 build_relations): Use goto_number, not int, for goto numbers.
5727 * src/tables.c (save_column, default_goto): Likewise.
5728
57292004-11-23 Akim Demaille <akim@epita.fr>
5730
5731 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
5732 of #defining from yystype.
5733 Don't typedef yystype, C++ does not need it.
5734 This lets it possible to forward declare it as union.
5735
57362004-11-23 Paul Eggert <eggert@cs.ucla.edu>
5737
5738 * bootstrap (gnulib_modules): Add extensions.
5739 Problem reported by Jim Meyering.
5740
57412004-11-22 Paul Eggert <eggert@cs.ucla.edu>
5742
5743 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
5744 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
5745 src/system.h, src/tables.c: XFREE -> free, to accommodate
5746 recent change to gnulib xalloc.h.
5747 Problem reported by Jim Meyering.
5748
57492004-11-17 Akim Demaille <akim@epita.fr>
5750
5751 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
5752
57532004-11-17 Akim Demaille <akim@epita.fr>,
5754 Alexandre Duret-Lutz <adl@gnu.org>
5755
5756 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
5757 changes.
5758 (YYCDEBUG): Adjust.
5759 Use it instead of cdebug_.
5760 (Parser::debug_stream, Parser::set_debug_stream): New.
5761 (Parser::symprint_): Define cdebug_ for temporary backward
5762 compatibility.
5763 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
5764 debug_stream ().
5765
57662004-11-17 Akim Demaille <akim@epita.fr>
5767
5768 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
5769 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
5770 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
5771 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
5772
57732004-10-27 Paul Eggert <eggert@cs.ucla.edu>
5774
5775 * data/glr.c (yyloc_default): Remove; not used.
5776 Problem reported by Frank Heckenbach.
5777
57782004-10-25 Akim Demaille <akim@epita.fr>
5779
5780 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
5781 Introduce another definition to address simple location arrays.
5782 (yyGLRStack): New member: yyerror_range.
5783 (yyrecoverSyntaxError, yyparse): Update it.
5784 (yyrecoverSyntaxError): Use it when shifting the error token to
5785 have an accurate range, equivalent to the one computed by both
5786 yacc.c and lalr1.cc.
5787 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
5788 that column numbers start at column 0, as per GNU Coding
5789 Standards, the others tests, and the doc.
5790 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
5791 Adjust to the above change (first column is 0).
5792 And adjust the location of the "<error>", now covering the whole
5793 line.
5794
57952004-10-22 Akim Demaille <akim@epita.fr>
5796 and Paul Eggert <eggert@cs.ucla.edu>
5797
5798 Remove some arbitrary limits on goto numbers and relations.
5799 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
5800 initial values, since they're never used.
5801 (set_goto_map): ngotos is now unsigned, so test for overflow
5802 by seeing whether it wraps around to zero.
5803 * src/lalr.h (goto_number): Now size_t, not short int.
5804 (GOTO_NUMBER_MAXIMUM): Remove.
5805 * src/relation.c (relation_print, traverse, relation_transpose):
5806 Check for END_NODE rather than looking at sign.
5807 * src/relation.h (END_NODE): New macro.
5808 (relation_node): Now size_t, not short int.
5809
58102004-10-22 Paul Eggert <eggert@cs.ucla.edu>
5811
5812 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
5813 keyword, not an identifier. Problem reported by Baron Schwartz in
5814 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
5815
58162004-10-11 Akim Demaille <akim@epita.fr>
5817
5818 * src/symtab.c (symbol_check_alias_consistency): Also check
5819 type names, destructors, and printers.
5820 Reported by Alexandre Duret-Lutz.
5821 Recode the handling of associativity and precedence in terms
5822 of symbol_precedence_set.
5823 Accept no redeclaration at all, not even equal to the previous
5824 value.
5825 (redeclaration): New.
5826 Use it to factor redeclaration complaints.
5827 (symbol_make_alias): Don't set the type of the alias, let
5828 symbol_check_alias_consistency do it as for other features.
5829 * src/symtab.h (symbol): Add new member prec_location, and
5830 type_location.
5831 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
5832 * tests/input.at (Incompatible Aliases): New.
5833
58342004-10-09 Paul Eggert <eggert@cs.ucla.edu>
5835
5836 .cvsignore fixes to accommodate gnulib changes,
5837 and the practice of naming build directories "_build".
5838 * .cvsignore: Add "_*". Sort.
5839 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
5840 * m4/.cvsignore: Add "*_gl.m4".
5841
58422004-10-06 Akim Demaille <akim@epita.fr>
5843
5844 * src/parse-gram.y (add_param): Fix the truncation of trailing
5845 spaces.
5846
58472004-10-05 Akim Demaille <akim@epita.fr>
5848
5849 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
5850 whether the reducion was empty or not. This leaves room to
5851 improve the use of YYLLOC_DEFAULT in such a case.
5852 lalr1.cc is still experimental, so changing this is acceptable.
5853 And finally, there are probably not many users who changed the
5854 handling of locations in GLR, so changing is admissible too.
5855
5856 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
5857 empty reduction, set @$ to an empty location ending the previously
5858 stacked symbol.
5859 Adjust uses to make sure the code is triggered on empty
5860 reductions.
5861 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
5862 expected output: empty reductions have empty locations.
5863
58642004-09-29 Akim Demaille <akim@epita.fr>
5865
5866 * data/lalr1.cc: Move towards a more standard C++ coding style
5867 for templates: Class < T > -> Class<T>.
5868
58692004-09-29 Akim Demaille <akim@epita.fr>
5870
5871 * data/lalr1.cc: Reinstall the former ctor, for sake of
5872 compatibility, but warn it will be removed.
5873 Move towards a more standard C++ coding style (i.e., type *var ->
5874 type* var).
5875
58762004-09-27 Paul Eggert <eggert@cs.ucla.edu>
5877
5878 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
5879 since it's less likely to work if NULs are involved in the future.
5880
58812004-09-27 Akim Demaille <akim@epita.fr>
5882
5883 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
5884
58852004-09-27 Akim Demaille <akim@epita.fr>
5886
5887 * data/lalr1.cc (b4_parse_param_decl_1): New.
5888 (b4_parse_param_decl): Use it to have different names between attribute
5889 and argument names.
5890 (b4_cc_constructor_call): Likewise.
5891
58922004-09-24 Akim Demaille <akim@epita.fr>
5893
5894 * src/parse-gram.y (add_param): Strip the leading and trailing
5895 blanks from a formal argument declaration.
5896 (YY_LOCATION_PRINT): New.
5897
58982004-09-24 Akim Demaille <akim@epita.fr>
5899
5900 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
5901 after the location.
5902
59032004-09-24 Akim Demaille <akim@epita.fr>
5904
5905 * doc/bison.texinfo (Table of Symbols): Sort.
5906
59072004-09-21 Akim Demaille <akim@epita.fr>
5908
5909 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
5910 the useless parentheses.
5911 Suggested by Paul Eggert.
5912
59132004-09-20 Akim Demaille <akim@epita.fr>
5914
5915 Let the initial-action act on the look-ahead, and use it for the
5916 "initial push" (corresponding to an hypothetical beginning-of-file).
5917 And let lalr1.cc honor %initial-action.
5918
5919 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
5920 example.
5921 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
5922 (Parser::Parser): Remove the ctor that used to initialize it.
5923 (Parser::parse): Like in the other skeletons, issue the "starting
5924 parse" message before any action.
5925 Honor %initial-action.
5926 Initialize the stacks with the lookahead.
5927 * data/yacc.c: Let $$ and @$ in %initial-action designate the
5928 look-ahead.
5929 Push them in the stacks.
5930 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
5931
59322004-09-20 Akim Demaille <akim@epita.fr>
5933
5934 * doc/bison.texinfo (Initial Action Decl): New.
5935
59362004-09-20 Akim Demaille <akim@epita.fr>
5937
5938 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
5939 clearer criterion to define it.
5940 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
5941 When reducing on an empty RHS, use the latest stacked location as
5942 location.
5943 yylloc is not always available.
5944 * data/glr.c: Likewise.
5945 Also, honor initial-actions.
5946
59472004-09-20 Akim Demaille <akim@epita.fr>
5948
5949 * data/yacc.c (YY_LOCATION_PRINT): New.
5950 Define when we know YYLTYPE's structure, i.e., when the default
5951 YYLLOC_DEFAULT is used.
5952 * data/c.m4 (b4_yysymprint_generate): Use it.
5953 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
5954 value of the result.
5955 (error_start_): Replace with...
5956 (error_range_): this location array.
5957 This allows to replace code relying on the implementation of
5958 locations by portable code.
5959 * data/yacc.c (yylerrsp): Replace with...
5960 (yyerror_range): this.
5961 Every time a token is popped, update yyerror_range[0], to have an
5962 accurate location for the error token.
5963 * data/glr.c (YY_LOCATION_PRINT): New.
5964 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
5965 deference a pointer.
5966 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
5967 report the location in %printers.
5968
5969 * src/scan-skel.l: Instead of abort, report error messages to ease
5970 understanding skeleton scanning failures.
5971
59722004-09-16 Akim Demaille <akim@epita.fr>
5973
5974 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
5975 (iterator, const_iterator): these, to be more in the C++ spirit.
5976 Also, return reverse iterators so that when displaying the stack
5977 we display its bottom first.
5978 (Parser::stack_print_, Parser::reduce_print_): Match the messages
5979 from yacc.c.
5980 We should probably use vector here though.
5981
59822004-09-16 Akim Demaille <akim@epita.fr>
5983
5984 Have more complete shift traces.
5985
5986 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
5987 to report Shifts instead of ad hoc YYDPRINTF invocations,
5988 including for the error token.
5989 * data/lalr1.cc (symprint_): Output the location.
5990 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
5991 output the location within the %printer.
5992 Activate GLR tests, at least to make sure they compile properly.
5993 They still don't pass though.
5994 * tests/calc.at: Adjust expect verbose output, since now "Entering
5995 state..." is on a different line than the "Shifting" message.
5996
59972004-09-08 Akim Demaille <akim@epita.fr>
5998
5999 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
6000 Bison directive from the Bison file to the invocation of this
6001 macro, so that these directives are passed to
6002 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
6003 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
6004 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
6005 the extra Bison directives instead of the whole series.
6006 Change the grammar so that there are recoverable errors, and
6007 unrecoverable errors. Now we can have the parser give up before
6008 consuming the whole input. As a result we now can observe that
6009 the lookahead is freed when needed.
6010 Change the parser source to parse argv[1] instead of a hard coded
6011 string.
6012 Simplify yylex, and give a value and location to EOF.
6013 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
6014 passed directives already coded in the file.
6015 Add some tests to check the location of "error".
6016 For some tests, the C++ parser is correct, and not yacc.c.
6017 For other tests, they provide different, but unsatisfying, values,
6018 so keep the C++ value so that at least one parser is "correct"
6019 according to the test suite.
6020 (Actions after errors): Remove, this is subsumed by the
6021 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
6022
60232004-09-06 Akim Demaille <akim@epita.fr>
6024
6025 * data/lalr1.cc: Adjust the indentation of the labels.
6026 (Parser::pop): New.
6027 Use it.
6028
60292004-09-06 Akim Demaille <akim@epita.fr>
6030
6031 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
6032 argument, an informative message.
6033 Call YY_SYMBOL_PRINT.
6034 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
6035 * data/lalr1.cc (destruct_): Likewise.
6036 In addition, no longer depend on b4_yysymprint_generate and
6037 b4_yydestruct_generate to generate these functions, do it "by
6038 hand".
6039
60402004-09-03 Akim Demaille <akim@epita.fr>
6041
6042 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
6043 invoked, yydestruct the lookahead.
6044 * tests/calc.at (Calculator $1): Update the expected lengths of
6045 traces: there is an added line for the discarded lookahead.
6046 * doc/bison.texinfo (Destructor Decl): Some rewording.
6047 Define "discarded" symbols.
6048
60492004-09-02 Akim Demaille <akim@epita.fr>
6050
6051 * data/lalr1.cc (translate_, destruct_): No reason to be static.
6052
60532004-09-02 Akim Demaille <akim@epita.fr>
6054
6055 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
6056 (YYDSYMPRINTF): Rename as...
6057 (YY_SYMBOL_PRINT): this.
6058 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
6059 two.
6060 Use it instead of direct symprint_ calls.
6061 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
6062 one.
6063
60642004-09-02 Akim Demaille <akim@epita.fr>
6065
6066 * data/lalr1.cc (b4_yysymprint_generate): New.
6067 (symprint_): New member function, defined when YYDEBUG.
6068 Use it consistently instead of token/nterm debugging output by
6069 hand.
6070 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
6071 %printer calls to use cdebug_ when using lalr1.cc.
6072
60732004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
6074
6075 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
6076 with #ifdef YYDEBUG.
6077
60782004-08-26 Akim Demaille <akim@epita.fr>
6079
6080 * doc/bison.texinfo (Implementing Loops): Rename as...
6081 (Implementing Gotos/Loops): this.
6082
60832004-08-13 Paul Eggert <eggert@cs.ucla.edu>
6084
6085 Adjust to latest gnulib.
6086 * bootstrap (gnulib_modules): Add xalloc-die.
6087 Set LC_ALL=C so that file names sort consistently.
6088 Prefer the gnulib copies of gettext.m4, glibc21.m4,
6089 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
6090 uintmax_t.m4, ulonglong.m4.
6091 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
6092 po.m4 since we are now using _gl.m4 instead.
6093
60942004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
6095
6096 * src/scan-action.l: Remove. Scanning of semantic actions is
6097 handled in scan-gram.l.
6098
60992004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
6100
6101 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
6102
6103 * src/location.h (struct): The file member is a uniqstr.
6104 (equal_boundaries): Use UNIQSTR_EQ for comparison.
6105
61062004-07-22 Paul Eggert <eggert@cs.ucla.edu>
6107
6108 Fix bug with non-%union parsers that have printers or destructors,
6109 which led to a Bison core dump. Reported by Peter Fales in
6110 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
6111
6112 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
6113 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
6114 not to our own type.
6115 * src/output.c (symbol_destructors_output, symbol_printers_output):
6116 Don't assume %union.
6117 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
6118 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
6119 UNION-FLAG. All callers changed.
6120 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
6121 Use type char, not unsigned int, when declaring an array of char;
6122 this lets us remove a cast.
6123 (Printers and Destructors): Add non-%union test cases.
6124
61252004-06-21 Paul Eggert <eggert@cs.ucla.edu>
6126
6127 * doc/bison.texinfo: Minor editorial changes, mostly to the new
6128 GLR writeups. E.g., avoid frenchspacing and the future tense,
6129 change "lookahead" to "look-ahead", and change "wrt" to "with
6130 respect to".
6131
61322004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6133
6134 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
6135 New sections, split off from the GLR Parsers section. Put the new
6136 Simple GLR Parser near the start of the GLR section, for clarity.
6137 Rewrite connective text.
6138
61392004-06-21 Frank Heckenbach <frank@g-n-u.de>
6140
6141 * doc/bison.texinfo (Simple GLR Parsers): New section.
6142
61432004-06-21 Paul Eggert <eggert@cs.ucla.edu>
6144
6145 * NEWS, TODO, doc/bison.texinfo:
6146 Use "look-ahead" instead of "lookahead", to be consistent.
6147 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
6148 while we're fixing "look-ahead".
6149 * src/conflicts.c (shift_set): Renamed from shiftset.
6150 (look_ahead_set): Renamed from lookaheadset.
6151 * src/print.c: Likewise.
6152 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
6153 name for "lookahead".
6154 (report_types, usage): Likewise.
6155 * src/getargs.h (report_look_ahead_tokens): Renamed from
6156 report_lookaheads.
6157 * src/lalr.c (compute_look_ahead_tokens): Renamed from
6158 compute_lookaheads.
6159 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
6160 (look_ahead_tokens_print): Renamed from lookaheads_print.
6161 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
6162 state_rule_lookaheads_print.
6163 * src/state.h: Likewise.
6164 (reductions.look_ahead_tokens): Renamed from lookaheads.
6165 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
6166 AT_DATA_LOOKAHEADS_GRAMMAR.
6167
61682004-06-03 Paul Eggert <eggert@cs.ucla.edu>
6169
6170 * README: Update location of patched M4 distribution.
6171
61722004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
6173
6174 Don't assume the C++ compiler takes the same arguments as the C compiler
6175 (trivial change).
6176 * configure.ac (O0CXXFLAGS): New var.
6177 * tests/atlocal.in (CXXFLAGS): Use it.
6178
61792004-05-29 Paul Eggert <eggert@cs.ucla.edu>
6180
6181 Fix some "make check" problems with C++ reported by
6182 Albert Chin-A-Young for Tru64 C++ in this thread:
6183 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
6184
6185 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
6186 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6187 Output to a .cc file for C++, not to a .c file.
6188 * tests/calc.at (AT_CHECK_CALC): Likewise.
6189 * tests/regression.at (AT_CHECK_DANCER): Likewise.
6190 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
6191
61922004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
6193
6194 * tests/calc.at, tests/actions.at: Workaround for SGI
6195 C++ compiler. (trivial change)
6196
61972004-05-27 Paul Eggert <eggert@cs.ucla.edu>
6198
6199 Spent a few hours checking out which prerequisite versions the
6200 current sources actually require. I went all the way back to
6201 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
6202 a seemingly endless set of combinations of versions more recent
6203 than that. The bottom line is that the current sources require
6204 fairly recent versions of the build tools, and it'll be some work
6205 to change this.
6206 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
6207 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
6208 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
6209 Add comments explaining why those particular versions are
6210 currently needed.
6211
6212 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
6213 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
6214 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
6215
6216 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
6217 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
6218
62192004-05-26 Paul Eggert <eggert@cs.ucla.edu>
6220
6221 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
6222 0.11.5. Suggested by Bruno Haible.
6223 * bootstrap: Remove gettext version checking.
6224
6225 * doc/bison.texinfo (Decl Summary): Also mention that %union
6226 can depend on prerequisite types. Problem reported by Tim
6227 Van Holder.
6228
62292004-05-25 Paul Eggert <eggert@cs.ucla.edu>
6230
6231 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
6232 * README-alpha: Don't tell people not to package this.
6233
6234 * bootstrap: Don't assume $(...) works; use `...` instead.
6235 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
6236 gettext better.
6237
6238 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
6239 put into the -d output file, and mention what to do if YYSTYPE is
6240 defined as a macro.
6241
62422004-05-24 Paul Eggert <eggert@cs.ucla.edu>
6243
6244 Undo change made earlier today: it caused autopoint to not bring
6245 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
6246 autopoint's.
6247
6248 * bootstrap: Check that gettext version matches what's in
6249 configure.ac. Warn users to ignore robots.txt ERROR 404.
6250 * bootstrap: Undo today's earlier change (logged below).
6251 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
6252
6253 The gettext version checking is causing more trouble than it's
6254 curing; remove it. Problem reported by Paul Hilfinger.
6255
6256 * bootstrap: Issue a warning that one can expect a message
6257 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
6258 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
6259
62602004-05-23 Paul Eggert <eggert@cs.ucla.edu>
6261
6262 Ensure that the C++ compiler used for testing actually works on a
6263 simple test program; if not, skip the C++-related tests. Problem
6264 reported by Vin Shelton in:
6265 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
6266
6267 * m4/cxx.m4: New file.
6268 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
6269 * tests/atlocal.in (BISON_CXX_WORKS): Add.
6270 * tests/local.at (AT_COMPILE_CXX): Use it.
6271
62722004-05-21 Paul Eggert <eggert@cs.ucla.edu>
6273
6274 * data/glr.c (yylloc): Output this macro even if locations are not
6275 being generated, as the GLR parser needs it even in that case.
6276 Problem reported by Troy A. Johnson
6277 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
6278
6279 * configure.ac (AC_INIT): Update to 1.875e.
6280
62812004-05-21 Paul Eggert <eggert@cs.ucla.edu>
6282
6283 * NEWS: Version 1.875d.
6284 * configure.ac (AC_INIT): Likewise.
6285 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
6286
6287 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
6288 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
6289 lalr1.cc runs afoul of the first, and the last two are no longer
6290 supported by GCC 3.4.0.
6291 * README: Mention GNU m4 1.4 or later; mention m4 patches.
6292 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
6293
62942004-05-06 Paul Eggert <eggert@cs.ucla.edu>
6295
6296 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
6297 unsigned int, for compatibility with latest gnulib hash module.
6298 * src/state.c (state_hash, state_hasher): Likewise.
6299 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
6300 * src/uniqstr.c (hash_uniqstr): Likewise.
6301
63022004-05-03 Paul Eggert <eggert@cs.ucla.edu>
6303
6304 * NEWS: Unescaped newlines are no longer allowed in char & strings.
6305
6306 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
6307 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
6308 character and string literals.
6309 (unexpected_end): New function.
6310 (unexpected_eof): Use it.
6311 (unexpected_newline): New function.
6312 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
6313 actions.
6314
6315 * NEWS: Document %expect-rr.
6316
6317 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
6318 Fix typo by replacing $1 with $option.
6319 Remove more 'intl'-related files.
6320 Don't DEFUN AM_INTL_SUBDIR twice.
6321
6322 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
6323 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
6324 strtoul.c.
6325 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
6326 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
6327 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
6328 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
6329 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
6330 * src/.cvsignore: Add *.output.
6331
6332 * src/parse-gram.y: Put copyright notice inside %{ %} so it
6333 gets copied to the output file.
6334
63352004-04-28 Paul Eggert <eggert@twinsun.com>
6336
6337 Get files from the gnulib and po repositories, instead of relying
6338 on them being in our CVS. Upgrade to latest versions of gnulib
6339 and Automake.
6340
6341 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
6342 * bootstrap: Bootstrap from gnulib and po repositories.
6343 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
6344 * README-cvs: Document these changes. Remove version numbers from
6345 mentions of build tools, since they change so often. Mention Flex.
6346
6347 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
6348 (gl_USE_SYSTEM_EXTENSIONS): Add.
6349 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
6350 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
6351 does this for us.
6352 (AC_ISC_POSIX): Remove; we no longer support this
6353 ancient OS, as it gets in the way of latest Autoconf & gnulib.
6354 (AC_HEADER_STDC): Remove: we now assume C89 or better.
6355 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
6356 Do not check for C89 headers, except for locale.h which is used
6357 by the Yacc library and must port to K&R hosts.
6358 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
6359 Do not check for C89 functions, except for setlocale which is
6360 used by the Yacc library.
6361 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
6362 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
6363 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
6364 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
6365 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
6366 AM_GNU_GETTEXT): Remove; now done by:
6367 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
6368 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
6369 for us.
6370
6371 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
6372 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
6373 Define to empty, as gnulib.mk will do the rest for us.
6374 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
6375 for us.
6376 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
6377 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
6378
6379 * src/files.c: Include gnulib's xstrndup.h.
6380
6381 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
6382 (REALLOC): Use xnrealloc, for likewise.
6383 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
6384 (strnlen, memrchr): Remove decls; functions no longer used.
6385 Include <stpcpy.h>.
6386
6387 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
6388 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
6389 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
6390 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
6391 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
6392 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
6393 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
6394 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
6395 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
6396 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
6397 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
6398 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
6399 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
6400 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
6401 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
6402 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
6403 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
6404 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
6405 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
6406 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
6407 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
6408 Remove, as these files are now generated automatically
6409 by bootstrap or automake.
6410
6411 * po/ChangeLog: Remove: all but one entry was a duplicate
6412 of this file, and I moved that 2000-11-02 entry here.
6413
6414 * config/.cvsignore: Add Makefile, depcomp, install-sh.
6415 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
6416 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
6417 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
6418 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
6419 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
6420 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
6421 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
6422 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
6423 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
6424 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
6425 xstrndup.h.
6426 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
6427 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
6428 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
6429 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
6430 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
6431 * src/.cvsignore: Remove *_.c.
6432
6433
6434 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
6435 support it. (The latest stable gzip doesn't.)
6436
64372004-04-27 Paul Eggert <eggert@twinsun.com>
6438
6439 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
6440 case, as stos_ is now used by destructors due to the 2004-02-09
6441 change.
6442
6443 Remove more K&R C support.
6444 * lib/libiberty.y (PARAMS): Remove. All uses removed.
6445 * lib/subpipe.c (errno): Remove decl.
6446 Include <stdlib.h> unconditionally.
6447 (EXIT_FAILURE): Remove macro.
6448 * src/complain.c (vfprintf, strerror): Remove.
6449 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
6450 unconditionally.
6451 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
6452 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
6453 (strchr, strspn, memchr): Remove decls.
6454 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
6455 unconditionally. Do not declare perror.
6456 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
6457 unconditionally.
6458
6459 * src/complain.c (_): Remove useless defn, as system.h defines this.
6460
6461 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
6462 with latest obstack.h.
6463 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
6464 to procedure types, as obstack.h now does that for us.
6465 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
6466
6467 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
6468 so that this include file can stand alone.
6469 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
6470 does this now. Include subpipe.h first after config.h, to
6471 test whether it can stand alone.
6472
6473 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
6474 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
6475 unused declaration.
6476
6477 * tests/synclines.at (%union synch line): Put a dummy member in
6478 the union, because empty unions aren't allowed in C. Caught
6479 by GCC 3.4.0.
6480
64812004-04-13 Jim Meyering <jim@meyering.net>
6482
6483 * src/conflicts.c (conflicts_print): Correct format string typo:
6484 use `%%' to produce literal `%'. (trivial change)
6485
64862004-03-30 Paul Eggert <eggert@twinsun.com>
6487
6488 * src/getargs.c (version): Update copyright year to 2004.
6489
6490 * data/c.m4 (b4_int_type): Use 'short int' rather than
6491 'short', and similarly for 'long', 'unsigned', etc.
6492 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
6493 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
6494 yy_yypstack, yydumpstack): Likewise.
6495 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
6496 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
6497 Likewise.
6498 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
6499 yy_stack_print, yyparse): Likewise.
6500 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
6501 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
6502 * lib/bitset.c (bitset_print): Likewise.
6503 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
6504 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
6505 * lib/bitsetv.c (bitsetv_dump): Likewise.
6506 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
6507 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
6508 Likewise.
6509 * src/LR0.c (allocate_itemsets): Likewise.
6510 * src/gram.h (rule_number, rule): Likewise.
6511 * src/lalr.h (goto_number): Likewise.
6512 * src/nullable.c (nullable_compute): Likewise.
6513 * src/output.c (prepare_rules): Likewise.
6514 * src/relation.c (relation_print, relation_digraph): Likewise.
6515 * src/relation.h (relation_node): Likewise.
6516 * src/state.h (state_number, transitions, errs, reductions,
6517 struct state): Likewise.
6518 * src/symtab.h (symbol_number, struct symbol): Likewise.
6519 * src/tables.c (vector_number, tally, action_number,
6520 default_goto, goto_actions): Likewise.
6521 * tests/existing.at (GNU Cim Grammar): Likewise.
6522 * tests/regression.at (Web2c Actions): Likewise.
6523
6524 * src/output.c (muscle_insert_short_int_table): Renamed from
6525 muscle_insert_short_table. All uses changed.
6526
65272004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6528
6529 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
6530 (declaration): Replace expected_conflicts with expected_sr_conflicts.
6531 Add %expect-rr rule.
6532
6533 * src/scan-gram.l: Recognize %expect-rr.
6534
6535 * src/conflicts.h (expected_sr_conflicts): Rename from
6536 expected_conflicts.
6537 (expected_rr_conflicts): Declare.
6538
6539 * src/conflicts.c (expected_sr_conflicts): Rename from
6540 expected_conflicts.
6541 (expected_rr_conflicts): Define.
6542 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
6543 for GLR parsers.
6544 Use expected_sr_conflicts in place of expected_conflicts.
6545 Warn if expected_rr_conflicts used in non-GLR parser.
6546
6547 * doc/bison.texinfo: Add documentation for %expect-rr.
6548
65492004-03-08 Paul Eggert <eggert@gnu.org>
6550
6551 Add support for hex token numbers. Suggested by Odd Arild Olsen in
6552 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
6553
6554 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
6555 in lalr1.cc.
6556 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
6557 * src/scan-gram.l (scan_integer): New function.
6558 ({int}): Use it.
6559 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
6560 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
6561 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
6562 Say "long int", not "long", for uniformity with GNU style.
6563
65642004-02-25 Paul Eggert <eggert@twinsun.com>
6565
6566 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
6567 compilers. This fixes a problem with Intel's C++ compiler being
6568 chatty, reported by Guido Trentalancia in
6569 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
6570
65712004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
6572
6573 Support %destructor and merge error locations in lalr1.cc.
6574
6575 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
6576 (Parser::stos_): Define unconditionally.
6577 (Parser::destruct_): New method. Generate its body with
6578 b4_yydestruct_generate.
6579 (Parser::error_start_): New attribute.
6580 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
6581 token which are discarded.
6582 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
6583 error_start_ when erroneous token are discarded.
6584 (Parser::parse) <yyerrlab1>: Compute the location of the error
6585 token so that it covers all the discarded tokens.
6586 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
6587 it can be called with `%skeleton "lalr1.cc"', and do that.
6588
65892004-02-02 Paul Eggert <eggert@twinsun.com>
6590
6591 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
6592 $(top_srcdir)/lib and ../lib. This fixes a bug reported
6593 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
6594 There's no need to mention top_builddir since Automake does that
6595 for us.
6596 (INCLUDES): Remove, as Automake says it's obsolescent.
6597 Contents migrated into AM_CPPFLAGS as described above.
6598 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
6599
66002004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6601
6602 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
6603 (yyreportSyntaxError): Handle case where lookahead token is
6604 YYEMPTY.
6605
66062004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6607
6608 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
6609 resulting parsers are compilable with C++.
6610
66112003-12-23 Paul Eggert <eggert@twinsun.com>
6612
6613 * config/depcomp, config/install-sh: Sync with Automake 1.8.
6614 * src/output.c (output_skeleton): Rename local var.
6615 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
6616 Bison tokens, as this runs afoul of the 2003-10-07 change that
6617 disallowed NUL bytes in character constants or string literals.
6618
6619 * tests/local.at: Require Autoconf 2.59's Autotest.
6620 * tests/testsuite.at: Don't include local.at, since we now assume
6621 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
6622 including it.
6623 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
6624 multiple inclusion warnings.
6625
66262003-12-02 Akim Demaille <akim@epita.fr>
6627
6628 * doc/bison.texinfo (How Can I Reset the Parser): More about start
6629 conditions.
6630 From Bruno Haible.
6631
66322003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
6633
6634 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
6635
66362003-10-07 Paul Eggert <eggert@twinsun.com>
6637
6638 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
6639 if testsuite doesn't exist.
6640
6641 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
6642 literals, unfortunately.
6643 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
6644 Complain about NUL bytes in character constants or string literals.
6645
66462003-10-05 Paul Eggert <eggert@twinsun.com>
6647
6648 * NEWS: Don't document %no-default-prec, as it's still
6649 too experimental.
6650 * doc/bison.texinfo: Document %no-default-prec only if
6651 the defaultprec flag is set. Normally it's not.
6652
66532003-10-04 Paul Eggert <eggert@twinsun.com>
6654
6655 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
6656 non-modifiable lvalue, instead of a modifiable one.
6657 * doc/bison.texinfo (Actions): Document that $$ can
6658 be assigned to. Do not claim that $$ and $N are
6659 array element references: user code should not rely on this.
6660
66612003-10-01 Paul Eggert <eggert@twinsun.com>
6662
6663 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
6664 (grammar_declaration): Use it.
6665 * src/scan-gram.l: New token %no-default-prec.
6666 * tests/conflicts.at: Revamp tests to use %no-default-prec.
6667 * NEWS, doc/bison.texinfo: Document the above.
6668
66692003-10-01 Akim Demaille <akim@epita.fr>
6670
6671 VCG no longer supports long_straight_phase.
6672
6673 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
6674 * src/print_graph.c (print_graph): Adjust.
6675
66762003-09-30 Frank Heckenbach <frank@g-n-u.de>
6677 and Paul Eggert <eggert@twinsun.com>
6678
6679 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
6680 Table of Symbols): Document %default-prec.
6681 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
6682 (grammar_declaration): Set default_prec on %default-prec.
6683 * src/scan-gram.l (%default-prec): New token.
6684 * src/reader.h (default_prec): New flag.
6685 * src/reader.c: Likewise.
6686 (packgram): Handle it.
6687 * tests/conflicts.at (%default-prec without %prec,
6688 %default-prec with %prec, %default-prec 1): New tests.
6689
66902003-09-30 Paul Eggert <eggert@twinsun.com>
6691
6692 * tests/testsuite.at: Include local.at, not input.at, fixing
6693 a typo in the 2003-08-25 patch.
6694
66952003-08-27 Akim Demaille <akim@epita.fr>
6696
6697 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
6698 GCC warnings.
6699
67002003-08-26 Akim Demaille <akim@epita.fr>
6701
6702 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
6703 "<\#" to avoid magic from Gnus when posting parts of this script.
6704
67052003-08-26 Akim Demaille <akim@epita.fr>
6706
6707 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
6708 (Parser::parse): here.
6709 Adjust: nerrs and errstatus is now replaced by...
6710 (Parser::nerrs_, Parser::errstatus_): New.
6711
67122003-08-25 Akim Demaille <akim@epita.fr>
6713
6714 * config/announce-gen, Makefile.cfg: New.
6715 * Makefile.am: Adjust.
6716 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
6717 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
6718
67192003-08-25 Akim Demaille <akim@epita.fr>
6720
6721 When reducing initial empty rules, Bison parser read an initial
6722 location that is not defined. This results in garbage, and that
6723 affects Bison's own parser. Therefore we need (i) to extend Bison
6724 to support a means to initialize this location, and (ii) to use
6725 this CVS Bison to fix CVS Bison's parser.
6726
6727 * src/reader.h, reader.c (epilogue_augment): Remove, replace
6728 with...
6729 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
6730 * src/parse-gram.y: Adjust.
6731 (%initial-action): New.
6732 (%error-verbose): Since we require CVS Bison, there is no reason
6733 not to use it.
6734 * src/scan-gram.l: Adjust.
6735 * src/Makefile.am (YACC): New, to make sure we use our own parser.
6736 * data/yacc.c (yyparse): Use b4_initial_action.
6737
67382003-08-25 Akim Demaille <akim@epita.fr>
6739
6740 * doc/bison.texinfo: Don't promote stdout for error messages.
6741
67422003-08-25 Akim Demaille <akim@epita.fr>
6743
6744 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
6745 From Alexandre Duret-Lutz.
6746
67472003-08-25 Akim Demaille <akim@epita.fr>
6748
6749 Version 1.875c.
6750
67512003-08-25 Akim Demaille <akim@epita.fr>
6752
6753 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
6754 Use them.
6755
67562003-08-25 Akim Demaille <akim@epita.fr>
6757
6758 * data/lalr1.cc (Parser::reduce_print_): New.
6759 Use it.
6760
67612003-08-25 Akim Demaille <akim@epita.fr>
6762
6763 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
6764 error recovery loops. This patch is based on
6765 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
6766 Also, augment the similarity between lalr1.cc and yacc.c.
6767 Note: the locations of error recovery rules are not correct yet.
6768
6769 * data/lalr1.cc: Comment changes to augment the similarity between
6770 lalr1.cc and yacc.c.
6771 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
6772 (yyerrlab1): Remove, but where it used to be (now the bottom part of
6773 yyerrlab), when hitting EOF, pop the whole stack here instead of
6774 merely falling thru the default error handling mechanism.
6775 (yyerrorlab): New label, with the old contents of YYERROR,
6776 plus the following change: pop the stack of rhs corresponding
6777 to the production that invoked YYERROR. That is how Yacc
6778 behaves (required by POSIX).
6779 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
6780 fail.
6781
67822003-08-25 Akim Demaille <akim@epita.fr>
6783
6784 Tune local.at so that people can "autom4te -l autotest calc.at -o
6785 calc" for instance, to extract a sub test suite.
6786
6787 * tests/testsuite.at: Move the initialization, Autotest version
6788 requirement, and AT_TESTED invocation into...
6789 * tests/local.at: here.
6790 * tests/testsuite.at: Include it for compatibility with Autoconf
6791 2.57.
6792 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
6793 be ignore.
6794
67952003-08-04 Paul Eggert <eggert@twinsun.com>
6796
6797 Rework code slightly to avoid gcc -Wtraditional warnings.
6798 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
6799 The returned value is now stored in *YY0. All callers changed.
6800 * src/output.c (merge_output): Adjust to the above change.
6801
68022003-07-26 Paul Eggert <eggert@twinsun.com>
6803
6804 * data/glr.c (YYASSERT): New macro.
6805 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
6806 yyresolveStates, yyprocessOneStack):
6807 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
6808 Derived from a suggestion by Frank Heckenbach.
6809
68102003-07-25 Paul Eggert <eggert@twinsun.com>
6811
6812 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
6813 for portability to K&R C (after ansi2knr, presumably). See
6814 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
6815 by Frank Heckenbach, though I have omitted the structure-initialization
6816 part of his glr-knr.diff patch since I recall that the Portable
6817 C Compiler didn't require that change.
6818
6819 Let the user specify how to allocate and free memory.
6820 Derived from a suggestion by Frank Heckenbach in
6821 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
6822 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
6823 All uses of free, malloc, realloc changed to use these macros,
6824 and unnecessary casts removed.
6825 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
6826
68272003-07-06 Matthias Mann <MatthiasMann@gmx.de>
6828
6829 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
6830 use s.empty() rather than s == "" to test for empty string; see
6831 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
6832 (trivial change)
6833
68342003-06-25 Akim Demaille <akim@epita.fr>
6835
6836 * config/depcomp, config/install-sh: Update from masters.
6837
68382003-06-20 Paul Eggert <eggert@twinsun.com>
6839
6840 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
6841 and return properly parenthesized result.
6842 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
6843 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
6844 Remove unnecessary parentheses from uses.
6845 * doc/bison.texinfo (Location Default Action): Describe the
6846 conventions for parentheses.
6847
68482003-06-19 Paul Eggert <eggert@twinsun.com>
6849
6850 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
6851 yyreportTree): Do not assume that size_t is the same width as int,
6852 when printing sizes. Print sizes using an unsigned format.
6853 Problem reported by Frank Heckenbach in
6854 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
6855
6856 Port to Forte Developer 7 C compiler.
6857 * data/glr.c (struct YYLTYPE): If locations are not being used,
6858 declare a single dummy member, as empty structs do not conform
6859 to the C standard.
6860 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
6861 the Forte Developer 7 C compiler complains that end-of-loop
6862 code is not reached.
6863
68642003-06-17 Paul Eggert <eggert@twinsun.com>
6865
6866 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
6867 avoid warnings from picky compilers about redefinition of PARAMS.
6868
68692003-06-17 Paul Eggert <eggert@twinsun.com>
6870
6871 Version 1.875b.
6872
6873 * NEWS: Document 1.875b.
6874
6875 * lib/bbitset.h: Do not include config.h; that's the includer's job.
6876 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
6877 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
6878 Don't use 'index' in comments, as it's a builtin fn on some hosts.
6879 * lib/bitset_stats.c: Include gettext.h unconditionally, as
6880 per recent gettext manual's suggestion.
6881 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
6882 Use prototypes, not old-style definitions.
6883 * lib/lbitset.c (lbitset_unused_clear): Likewise.
6884 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
6885 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
6886 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
6887 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
6888 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
6889 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
6890 vbitset_or_and_cmp, vbitset_copy): Likewise.
6891
6892 * lib/libiberty.h: Do not include config.h; that's the includer's job.
6893 Do not include <stdlib.h>.
6894 (PARAMS): Define unconditionally for C89.
6895 (ATTRIBUTE_NORETURN): Remove.
6896 (ATTRIBUTE_UNUSED): Define unconditionally.
6897
6898 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
6899 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
6900 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
6901 * lib/vbitset.c, lib/vbitset.h: New files.
6902 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
6903 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
6904 from libbitset.
6905
6906 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
6907 `How Can I Reset @code{yyparse}', since texinfo does not allow
6908 arbitrary @ in node names.
6909
6910 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
6911 shouldn't be needed according to the gettext 0.12.1 documentation
6912 but which seem to be needed anyway: codeset.m4 glibc21.m4
6913 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
6914 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
6915 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
6916
6917 * lib/.cvsignore: Add stdbool.h.
6918 * m4/.cvsignore: Add nls.m4, po.m4.
6919
6920 Upgrade to CVS gnulib.
6921 * stdbool_.h: File renamed from stdbool.h.in.
6922 * configure.ac (AM_STDBOOL_H): Invoke this instead of
6923 AC_HEADER_STDBOOL.
6924 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
6925 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
6926 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
6927 (MOSTLYCLEANFILES): New var.
6928 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
6929 (stdbool.h): New rule.
6930 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
6931 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
6932 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
6933 m4/quote.m4: Upgrade to today's gnulib.
6934
6935 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
6936 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
6937 the tests right now.
6938 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
6939 yyerror are declared before use; C99 requires this.
6940
69412003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6942
6943 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
6944 first.
6945 (yyrecoverSyntaxError): Correct the logic for setting and testing
6946 yyerrState.
6947 Correct comment on handling EOF.
6948 Allow states with only a default reduction, rather than failing
6949 (I can't quite reconstruct why these were not allowed before).
6950
6951 Fixes to avoid problem that $-N rules in GLR parsers can cause
6952 buffer overruns, corrupting state.
6953
6954 * src/output.c (prepare_rules): Output max_left_semantic_context
6955 definition.
6956 * src/reader.h (max_left_semantic_context): New variable declaration.
6957 * src/scan-gram.l (max_left_semantic_context): Define.
6958 (handle_action_dollar): Update max_left_semantic_context.
6959 * data/glr.c (YYMAXLEFT): New definition.
6960 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
6961 (yyresolveAction): Ditto.
6962
6963 Fixes to problems with location handling in GLR parsers reported by
6964 Frank Heckenbach (2003/06/05).
6965
6966 * data/glr.c (YYLTYPE): Make trivial if locations not used.
6967 (YYRHSLOC): Add parentheses, and define only if locations used.
6968 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
6969 locations not used.
6970 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
6971 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
6972
6973 * tests/cxx-type.at: Exercise location information; update tests
6974 to differentiate output with and without locations.
6975 Remove forward declarations of yylex and yyerror---caused errors
6976 because default YYLTYPE not yet defined.
6977 Change semantic actions to compute strings, rather than printing
6978 them directly (to test proper passing of semantics values). Change
6979 output to prefix notation and update test data and expected results.
6980 (yylex): Track locations.
6981 (stmtMerge): Return value rather than printing, and include arguments
6982 in value.
6983
69842003-06-03 Paul Eggert <eggert@twinsun.com>
6985
6986 Avoid warnings generated by GCC 2.95.4 when Bison is
6987 configured with --enable-gcc-warnings.
6988 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
6989 yy::]b4_parser_class_name[::translate_,
6990 yy::Stack::operator[] (unsigned),
6991 yy::Stack::operator[] (unsigned) const,
6992 yy::Slice::operator[] (unsigned),
6993 yy::Slice::operator[] (unsigned) const):
6994 Rename local vars to avoid warnings.
6995 * tests/glr-regression.at (Improper handling of embedded actions
6996 and $-N in GLR parsers): Remove unused local variable from yylex.
6997 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
6998 (void) as arg when not pure, since we now assume C89 when building
6999 Bison. Pacify GCC by using parameter.
7000
70012003-06-02 Paul Eggert <eggert@twinsun.com>
7002
7003 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
7004 yy::Location::lines, yy::Location::columns): Rename arguments
7005 to avoid shadowing; this removes a warning generated by GCC 3.3.
7006
70072003-06-01 Paul Eggert <eggert@twinsun.com>
7008
7009 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
7010 to g++, as GCC 3.3 complains if you do it.
7011 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
7012 everything that WARNING_CFLAGS has, except omit warnings
7013 not suitable for C++.
7014 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
7015 * tests/atlocal.in (CXXFLAGS): New var.
7016 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
7017
7018 Fix a GLR parser bug I reported in February; see
7019 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
7020 The problem was that GLR parsers did not conform to the C standard,
7021 because actions like { $1 = $2 + $3; } expanded to expressions
7022 that invoked YYFILL in separate subexpressions, and YYFILL assigned
7023 to a local variable. The C standard says that expressions
7024 like (var = f ()) + (var = f ()) have undefined behavior.
7025 Another problem was that GCC sometimes issues warnings that
7026 yyfill and its parameters are unused.
7027
7028 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
7029 as possibly unused.
7030 (yyfill): New function.
7031 (YYFILL): Use it.
7032 (yyuserAction): Change type of yynormal to bool, so that it matches
7033 the new yyfill signature. Mark it as possibly unused.
7034
7035
7036 Follow up on a bug I reported in February, where a Bison-generated
7037 parser can loop. Provide a test case and a fix for yacc.c. I
7038 don't have a fix for lalr1.cc or for glr.c, unfortunately.
7039 The original bug report is in:
7040 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
7041
7042 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
7043 macro's size was becoming unwieldy.
7044 (yyerrlab): Do not discard an empty lookahead symbol, as this
7045 might destroy garbage.
7046 (yyerrorlab): New label, with the old contents of YYERROR,
7047 plus the following change: pop the stack of rhs corresponding
7048 to the production that invoked YYERROR. That is how Yacc
7049 behaves, and POSIX requires this behavior.
7050 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
7051 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
7052 Define 'alarm' to do nothing if unistd.h is not available.
7053 Add a new rule "exp: '-' error;" to test the above change to
7054 data/yacc.c. Use 'alarm' to abort any test taking longer than
7055 10 seconds, as it's probably looping.
7056 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
7057 Also, the new yacc.c generates two fewer diagnostics for an
7058 existing test.
7059
70602003-05-24 Paul Eggert <eggert@twinsun.com>
7061
7062 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
7063 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
7064 This fixes a problem reported by John Bowman when the Compaq/HP
7065 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
7066 -ansi -Wall -gall).
7067 * data/yacc.c (union yyalloc): Likewise.
7068 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
7069
7070 Switch from 'int' to 'bool' where that makes sense.
7071
7072 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
7073 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
7074 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
7075 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
7076 Return or accept bool, not int. All callers changed.
7077 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
7078 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
7079 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
7080 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
7081 bitset_or_and_cmp_): Likewise.
7082 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
7083 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
7084 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
7085 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
7086 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
7087 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
7088 bitset_stats_or_and_cmp): Likewise.
7089 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
7090 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
7091 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
7092 ebitset_xor_cmp): Likewise.
7093 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
7094 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
7095 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
7096 lbitset_xor_cmp): Likewise.
7097 * lib/bbitset.h: Include <stdbool.h>.
7098 (struct bitset_vtable): The following members now return bool, not
7099 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
7100 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
7101 or_and_cmp).
7102 * src/conflicts.c (count_rr_conflicts): Likewise.
7103 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
7104 All uses changed.
7105 * lib/ebitset.c (ebitset_obstack_init): Likewise.
7106 * lib/lbitset.c (lbitset_obstack_init): Likewise.
7107 * src/getargs.c (debug_flag, defines_flag, locations_flag,
7108 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
7109 graph_flag): Likewise.
7110 * src/getargs.h (debug_flag, defines_flag, locations_flag,
7111 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
7112 graph_flag): Likewise.
7113 * src/output.c (error_verbose): Likewise.
7114 * src/output.h (error_verbose): Likewise.
7115 * src/reader.c (start_flag, typed): Likewise.
7116 * src/reader.h (typed): Likewise.
7117 * src/getargs.c (LOCATIONS_OPTION): New constant.
7118 (long_options, getargs): Use it.
7119 * src/lalr.c (build_relations): Use bool, not int.
7120 * src/nullable.c (nullable_compute): Likewise.
7121 * src/print.c (print_reductions): Likewise.
7122 * src/tables.c (action_row, pack_vector): Likewise.
7123 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
7124 * src/output.c (prepare): Use it.
7125 * src/output.c (token_definitions_output,
7126 symbol_destructors_output, symbol_destructors_output): Use string,
7127 not boolean integer, to keep track of whether to output separator.
7128 * src/print_graph.c (print_core): Likewise.
7129 * src/state.c (state_rule_lookaheads_print): Likewise.
7130
7131 * config/install-sh: Sync from automake 1.7.5.
7132
71332003-05-14 Paul Eggert <eggert@twinsun.com>
7134
7135 * src/parse-gram.y (rules_or_grammar_declaration): Require a
7136 semicolon after a grammar declaration, in the interest of possible
7137 future changes to the Bison input language.
7138 Do not allow a stray semicolon at the start of the grammar.
7139 (rhses.1): Allow one or more semicolons after any rule, including
7140 just before "|" as required by POSIX.
7141 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
7142 grammar.
7143
71442003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
7145
7146 %parse-param support for lalr1.cc.
7147
7148 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
7149 b4_cc_constructor_calls, b4_cc_constructor_call,
7150 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
7151 definitions.
7152 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
7153 parse-param arguments.
7154 (yy::b4_parser_class_name): Declare instance variables to
7155 hold parse-param arguments.
7156 * tests/calc.at: s/value/semantic_value/ because value clashes
7157 with a member of yy::b4_parser_class_name. Adjust C++ code
7158 to handle %parse-param. Enable %parse-param test in C++.
7159
71602003-05-12 Paul Eggert <eggert@twinsun.com>
7161
7162 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
7163 English a bit. Fix fclose typo. Change "const char" to "char
7164 const", and use ANSI C rather than K&R for "main". Suggest
7165 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
7166 and suggest yy_switch_to_buffer.
7167
71682003-05-05 Paul Eggert <eggert@twinsun.com>
7169
7170 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
7171 C89. This avoids a diagnostic on compilers that define __STDC__
7172 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
7173 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
7174
71752003-05-03 Paul Eggert <eggert@twinsun.com>
7176
7177 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
7178 Do not overrun array bounds.
7179 This should fix a bug reported today by Olatunji Oluwabukunmi in
7180 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
7181
71822003-04-29 Akim Demaille <akim@epita.fr>
7183
7184 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
7185 * src/getargs.c, src/getargs.h: here, as bool, not int.
7186 (nondeterministic_parser): New.
7187 * src/parse-gram.y, src/scan-gram.l: Support
7188 %nondeterministic-parser.
7189 * src/output.c (prepare): Use nondeterministic_parser instead
7190 of glr_parser where appropriate.
7191 * src/tables.c (conflict_row, action_row, save_row)
7192 (token_actions, token_actions, pack_vector): Ditto.
7193
71942003-04-29 Akim Demaille <akim@epita.fr>
7195
7196 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
7197
71982003-04-29 Akim Demaille <akim@epita.fr>
7199
7200 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
7201 with %pure-parser and %locations to exercise the patch from Yakov
7202 Markovitch below.
7203
72042003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
7205
7206 * data/yacc.c: (b4_lex_param): Corrected for the case where
7207 %lex-param is provided and %pure-parser isn't.
7208
72092003-04-27 Paul Eggert <eggert@twinsun.com>
7210
7211 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
7212 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
7213 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
7214 if it is not defined.
7215 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
7216
72172003-04-26 Paul Eggert <eggert@twinsun.com>
7218
7219 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
7220 Declare to be of type suitable for the ninf value itself, not of
7221 type suitable for the corresponding table, since the latter might
7222 be unsigned but the ninf value might be negative. This fixes a
7223 bug reported by Alexandre Duret-Lutz in
7224 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
7225
7226 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
7227 invokes it. We shouldn't invoke it twice because it will attempt
7228 to put error.o in the archive twice. This fixes a glitch reported
7229 by Martin Mokrejs in
7230 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
7231
72322003-04-21 Paul Eggert <eggert@twinsun.com>
7233
7234 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
7235 to gnulib.
7236
72372003-04-21 Yakov Markovitch <Markovitch@iso.ru>
7238
7239 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
7240 Fix obvious typo that results in uncompilable GLR parsers
7241 when both %pure-parser and %locations are used. (trivial change)
7242
72432003-04-17 Paul Eggert <eggert@twinsun.com>
7244
7245 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
7246 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
7247 Do not insert the expected token via unput, as this runs afoul
7248 of a POSIX-compatibility bug in flex 2.5.31.
7249 All uses changed to BEGIN the parent state,
7250 since we no longer insert the expected token via unput.
7251 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
7252 that is no longer emitted after the above change.
7253
7254 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
7255 the first one. This change is from Paul Hilfinger, and it fixes
7256 regression reported by Werner Lemberg in
7257 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
7258
7259 (resolve_sr_conflict): Don't invoke state_errs_set
7260 unless one or more tokens have been explicitly made errors.
7261 Otherwise, the above change causes Bison to abort.
7262
7263 * tests/existing.at (GNU pic Grammar): New test case, taken from
7264 Lemberg's email.
7265
72662003-03-31 Akim Demaille <akim@epita.fr>
7267
7268 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
7269
72702003-03-31 Akim Demaille <akim@epita.fr>
7271
7272 * src/output.c (prepare_symbols): Avoid trailing spaces in the
7273 output.
7274
72752003-03-31 Akim Demaille <akim@epita.fr>
7276
7277 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
7278 From Paul Hilfinger.
7279
72802003-03-29 Akim Demaille <akim@epita.fr>
7281
7282 * m4/error.m4: Do not put under dynamic conditions some code which
7283 expansion is under static control.
7284
72852003-03-29 Akim Demaille <akim@epita.fr>
7286
7287 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
7288
72892003-03-29 Akim Demaille <akim@epita.fr>
7290
7291 * doc/bison.texinfo (Strings are Destroyed): New.
7292
72932003-03-13 Paul Eggert <eggert@twinsun.com>
7294
7295 * .cvsignore: Add configure.lineno.
7296 * src/.cvsignore: Add yacc.
7297 * tests/.cvsignore: Add testsuite.log.
7298 * doc/fdl.texi: Sync with latest FSF version.
7299
73002003-03-12 Paul Eggert <eggert@twinsun.com>
7301
7302 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
7303 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
7304 cursor, instead of leaving it undefined. This fixes a bug
7305 reported by Tim Van Holder in
7306 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
7307 * tests/input.at (Torturing the Scanner): Test the scanner on
7308 an empty input file, which was Tim Van Holder's test case.
7309
7310 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
7311 <sys/resource.h> can be included, include sys/time.h and
7312 sys/times.h first, if available. This works around the SunOS
7313 4.1.4 porting bug reported by Bruce Becker in
7314 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
7315
7316 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
7317 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
7318 AC_HEADER_SYS_WAIT.
7319
7320 Merge changes from gnulib. This was prompted because the CVS
7321 snapshot didn't build on Solaris 7 due to strnlen problems.
7322
7323 These changes need to be merged back into gnulib:
7324 * lib/hash.c: Include <stdbool.h> unconditionally.
7325 * m4/onceonly.m4 (m4_quote): New macro.
7326 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
7327 Quote AC_FOREACH variable-expansions properly.
7328 The 2003-01-03 obstack.h change also needs merging.
7329 {end of changes requiring merging}
7330
7331 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
7332 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
7333 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
7334 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
7335 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
7336 New files, imported from gnulib.
7337 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
7338 above.
7339
7340 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
7341 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
7342 gnulib sources.
7343
7344 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
7345 Add.
7346 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
7347 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
7348 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
7349 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
7350 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
7351 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
7352 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
7353 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
7354 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
7355 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
7356 (jm_PREREQ_ARGMATCH): Remove.
7357 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
7358 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
7359
7360 * src/system.h: Include <stdbool.h> unconditionally.
7361
7362 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
7363 assuming at least C89 in the bitset code for some time now.
7364
73652003-03-03 Akim Demaille <akim@epita.fr>
7366
7367 * ro.po: New.
7368
73692003-03-02 Akim Demaille <akim@epita.fr>
7370
7371 * doc/bison.texinfo (Table of Symbols): Reactivate the
7372 documentation for %lex-param, and %parse-param.
7373
73742003-03-02 Akim Demaille <akim@epita.fr>
7375
7376 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
7377 generate verbose error messages.
7378 Use the number of tokens as an upper bound in yytname, as it
7379 cannot be a non terminal.
7380
73812003-03-02 Akim Demaille <akim@epita.fr>
7382
7383 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
7384 message.
7385
73862003-03-02 Akim Demaille <akim@epita.fr>
7387
7388 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
7389 Use them to exercise yycheck overrun.
7390 Based on Andrew Suffield's grammar.
7391
73922003-03-02 Akim Demaille <akim@epita.fr>
7393
7394 Create tests/local.at for Bison generic testing macros.
7395
7396 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
7397 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
7398 This new file.
7399 * tests/calc.at (AT_CHECK_CALC): Adjust.
7400 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
7401 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
7402 * tests/local.at: here.
7403 (AT_COMPILE_CXX): Tags the tests using it as c++.
7404 Ignore the test if CXX is not functional.
7405
74062003-03-01 Paul Eggert <eggert@twinsun.com>
7407
7408 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
7409 not loc->end, since loc->end might contain garbage and this leads
7410 to undefined behavior on some platforms.
7411 (id_loc, token_start): Use (IF_LINTed) initial values that do not
7412 depend on *loc, so that the reader doesn't give the the false
7413 impression that *loc is initialized.
7414 (<INITIAL>"%%"): Do not bother setting code_start, since its value
7415 does not survive the return.
7416
74172003-03-01 Akim Demaille <akim@epita.fr>
7418
7419 * src/scan-gram.l (code_start): Always initialize it when entering
7420 into yylex, as SC_EPILOGUE is activated *before* the corresponding
7421 yylex invocation. An alternative would be making it static, but
7422 then it starts with the second %%'s beginning, instead of its end.
7423
74242003-02-28 Paul Eggert <eggert@twinsun.com>
7425
7426 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
7427 around a UnixWare 7.1.1 porting bug reported by John Hughes in
7428 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
7429
74302003-02-26 Paul Eggert <eggert@twinsun.com>
7431
7432 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
7433 Remove Sequent/Pyramid discussion (nobody uses them any more).
7434 Merge VMS and MS-DOS discussion; these ports may well be dead
7435 but let's keep mentioning them for now. Put <> around email
7436 addresses. Add copyright notice.
7437
74382003-02-24 Paul Eggert <eggert@twinsun.com>
7439
7440 * data/glr.c (yy_reduce_print): yylineno -> yylno,
7441 to avoid collision with flex use of yylineno.
7442 Problem reported by Bruce Lilly in
7443 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
7444 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
7445 * data/yacc.c (yy_reduce_print): Likewise.
7446
7447 * config/depcomp: Sync with Automake 1.7.3.
7448
74492003-02-21 Akim Demaille <akim@epita.fr>
7450
7451 * data/lalr1.cc: Use temporary variables instead of casts to
7452 change integer types.
7453 Suggested by Paul Eggert.
7454
74552003-02-21 Akim Demaille <akim@epita.fr>
7456
7457 * doc/bison.texinfo: Use "location" consistently to refer to @n,
7458 to avoid confusions with lalr1.cc's notion of Position.
7459 Suggested by Paul Eggert.
7460
74612003-02-20 Akim Demaille <akim@epita.fr>
7462
7463 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
7464 before initial_columns.
7465 (location.hh): Use consistent variable names when defining the
7466 operator<<.
7467 Use "last" so that we subtract from Positions, not from unsigned.
7468
74692003-02-20 Akim Demaille <akim@epita.fr>
7470
7471 * data/lalr1.cc (position.hh): New subfile, including the extended
7472 and Doxygen'ed documentation of class Position.
7473 (location.hh): Use it.
7474 Document a` la Doxygen.
7475 With the help of Benoit Perrot.
7476
74772003-02-20 Akim Demaille <akim@epita.fr>
7478
7479 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
7480 AT_YACC_IF.
7481 Redefine AT_YYERROR_SEES_LOC_IF using it.
7482 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
7483 not defined.
7484 Don't use the location in yy::Parser::error_ and
7485 yy::Parser::print_ when not %locations.
7486 Activate more lalr1.cc tests.
7487
74882003-02-19 Akim Demaille <akim@epita.fr>
7489
7490 * data/lalr1.cc: When displaying a line number, be sure to make it
7491 an int.
7492
74932003-02-19 Akim Demaille <akim@epita.fr>
7494
7495 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
7496 Remove, useless.
7497 (YYABORT, YYACCEPT, YYERROR): New.
7498 * tests/calc.at: Renable the lalr1.cc test.
7499
75002003-02-19 Akim Demaille <akim@epita.fr>
7501
7502 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
7503 error recovery, mixing with/without pops and discarding of the
7504 lookahead.
7505 Exercise YYERROR.
7506 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
7507
75082003-02-17 Paul Eggert <eggert@twinsun.com>
7509
7510 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
7511 * tests/testsuite.at (AT_COMPILE): Use them.
7512 This fixes the testsuite problem reported by Robert Lentz in
7513 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
7514
75152003-02-12 Paul Eggert <eggert@twinsun.com>
7516
7517 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
7518 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
7519 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
7520 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
7521 Check for malloc failure, for consistency with yacc.c.
7522 (yytname_size): Remove, for consistency with yacc.c.
7523
7524 The bug still remains in data/lalr1.cc, as I didn't have time
7525 to fix it there.
7526
75272003-02-06 Akim Demaille <akim@epita.fr>
7528
7529 * configure.ac (GXX): Rename as...
7530 (CXX): this, to keep the original Autoconf semantics.
7531 Require 2.57.
7532 * data/lalr1.cc: Fix b4_copyright invocations.
7533 If YYDEBUG is not defined, don't depend upon name_ being defined.
7534 (location.hh): Include string and iostream.
7535 (Position::filename): New member.
7536 (Position::Position ()): New.
7537 (operator<< (Position)): New.
7538 (operator- (Position, int)): New.
7539 (Location::first, Location::last): Rename as...
7540 (Location::begin, Location::end): these, to mock the conventional
7541 iterator names.
7542 (operator<< (Location)): New.
7543 * tests/atlocal.in (CXX): New.
7544 * tests/testsuite.at (AT_COMPILE_CXX): New.
7545 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
7546 locations in a more synthetic way.
7547 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
7548 lalr1.cc is used.
7549 Adjust the C locations to match those from Emacs: first column is
7550 column 0.
7551 Change all the expected results.
7552 Conform to the GCS: simplify the locations when applicable.
7553 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
7554 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
7555 these CPP macros with the m4 macros new defined by...
7556 (AT_CHECK_PUSHDEFS): this, i.e.:
7557 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
7558 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7559 New macros.
7560 (AT_CHECK_POPDEFS): Undefine them.
7561 (AT_CHECK_CALC_LALR1_CC): New.
7562 Use it for the first lalr1.cc test.
7563
75642003-02-04 Akim Demaille <akim@epita.fr>
7565
7566 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
7567 Location as is defined.
7568
75692003-02-04 Akim Demaille <akim@epita.fr>
7570
7571 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
7572 name_ being defined.
7573
75742003-02-03 Paul Eggert <eggert@twinsun.com>
7575
7576 * src/gram.h (start_symbol): Remove unused decl.
7577
7578 Use more-consistent naming conventions for local vars.
7579
7580 * src/derives.c (derives_compute): Change type of local var from
7581 int to rule_number.
7582 * src/gram.c (grammar_rules_partial_print): Likewise.
7583 * src/print.c (print_core): Likewise.
7584 * src/reduce.c (reduce_grammar_tables): Likewise.
7585
7586 * src/gram.c (grammar_dump): Change name of item_number *
7587 local var from r to rp.
7588 * src/nullable.c (nullable_compute): Likewise.
7589
7590 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
7591
7592 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
7593 for symbol or symbol_number var.
7594 * src/reader.c (grammar_start_symbol_set): Likewise.
7595 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
7596 Likewise.
7597 * src/state.c (transitions_to): Likewise.
7598 * src/state.h: Likewise.
7599 * src/tables.c (symbol_number_to_vector_number): Likewise.
7600
7601 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
7602 char * var.
7603
7604 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
7605 var.
7606
7607 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
7608 var.
7609
7610 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
7611 Use str, not s, for char * var. Use ch, not c, for character var.
7612 Use size for size var.
7613
7614 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
7615 char * var.
7616 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
7617 uniqstr var.
7618 * src/uniqstr.h: Likewise.
7619
7620 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
7621 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
7622 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
7623 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
7624 param to have same name as that of enum, so that we don't use
7625 "s" to stand for a non-state.
7626
76272003-02-02 Akim Demaille <akim@epita.fr>
7628
7629 * src/scan-skel.l: Scan more than one inert character per yylex
7630 invocation.
7631
76322003-02-01 Paul Eggert <eggert@twinsun.com>
7633
7634 Version 1.875a.
7635
7636 * po/LINGUAS: Add ms.
7637
76382003-01-30 Akim Demaille <akim@epita.fr>
7639
7640 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
7641
76422003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7643
7644 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
7645 of $1.
7646
7647 Changes in response to error report by S. Eken: GLR mode does not
7648 handle negative $ indices or $ indices in embedded rules correctly.
7649 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
7650
7651 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
7652 (b4_rhs_location): Ditto.
7653 (yyfill): New function to copy from stack tree into array
7654 incrementally.
7655 (yyuserAction): Modify to allow incremental move of semantic values
7656 to rhs array when in GLR mode.
7657 Define YYFILL to use in user-defined actions to fill semantic array
7658 as needed.
7659 Remove dummy use of yystack, as there is now a guaranteed use.
7660 (yydoAction): Modify to allow incremental move of semantic values
7661 to rhs array when in GLR mode.
7662 (yyresolveAction): Ditto.
7663 (yyglrShiftDefer): Update comment.
7664 (yyresolveStates): Use X == NULL for pointers, not !X.
7665 (yyglrReduce): Ditto.
7666 (yydoAction): Ditto
7667
7668 * tests/glr-regr1.at: Rename to ...
7669 * tests/glr-regression.at: Add new regression test for the problems
7670 described above (adapted from S. Eken).
7671 Update copyright notice.
7672 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
7673 * tests/Makefile.am: Ditto.
7674
76752003-01-28 Paul Eggert <eggert@twinsun.com>
7676
7677 * data/lalr1.cc: Do not use @output_header_name@ unless
7678 b4_defines_flag is set. This fixes two bugs reported by
7679 Tim Van Holder in
7680 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
7681 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
7682
76832003-01-21 Paul Eggert <eggert@twinsun.com>
7684
7685 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
7686 we don't need to worry about yyerrlab1 being reported as an
7687 "unused label" by non-GCC C compilers. The downside is that if
7688 locations are used then a couple of statements are duplicated each
7689 time YYERROR is invoked, but the upside is that the warnings
7690 should vanish.
7691 (yyerrlab1): Move code to YERROR.
7692 (yyerrlab2): Remove. Change uses back to yyerrlab1.
7693 This reverts some of the 2002-12-27 change.
7694
76952003-01-17 Paul Eggert <eggert@twinsun.com>
7696
7697 * src/output.c (symbol_printers_output): Fix typo that led
7698 to core dump. Problem reported by Antonio Rus in
7699 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
7700
77012003-01-13 Akim Demaille <akim@epita.fr>,
7702 Quoc Peyrot <chojin@lrde.epita.fr>,
7703 Robert Anisko <anisko_r@lrde.epita.fr>
7704
7705 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
7706 when the stacks contain one element, as the loop would otherwise
7707 free the last state, and then use the top state (the one we just
7708 popped). This means that the initial elements will not be freed
7709 explicitly, as is the case in yacc.c; it is not a problem, as
7710 these elements have fake values.
7711
77122003-01-11 Paul Eggert <eggert@twinsun.com>
7713
7714 * NEWS: %expect-violations are now just warnings, reverting
7715 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
7716 bootstrapping problem reported by Matthias Klose; see
7717 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
7718 * src/conflicts.c (conflicts_print): Likewise.
7719 * tests/conflicts.at (%expect not enough, %expect too much,
7720 %expect with reduce conflicts): Likewise.
7721 * doc/bison.texinfo (Expect Decl): Document this. Also mention
7722 that the warning is enabled if the number of conflicts changes
7723 (not necessarily increases).
7724
7725 * src/getargs.c (version): Update copyright year.
7726
77272003-01-09 Akim Demaille <akim@epita.fr>
7728
7729 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
7730
77312003-01-08 Paul Eggert <eggert@twinsun.com>
7732
7733 * Makefile.maint (WGETFLAGS):
7734 New macro, containing "-C off" to disable proxy caches.
7735 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
7736 (rel-check): Use $(WGET) instead of wget.
7737
77382003-01-06 Paul Eggert <eggert@twinsun.com>
7739
7740 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
7741 the GLR paper of Scott, Johnstone and Hussain.
7742
77432003-01-04 Paul Eggert <eggert@twinsun.com>
7744
7745 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
7746 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
7747 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
7748 (EXTRA_LIBRARIES): New var, for liby.a.
7749 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
7750 (EXTRA_SCRIPTS): New var, for yacc.
7751
7752 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
7753 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
7754 Problem reported by Nelson H. F. Beebe.
7755
77562003-01-03 Paul Eggert <eggert@twinsun.com>
7757
7758 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
7759 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7760 when compiling Bison 1.875's `bitset bset = obstack_alloc
7761 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
7762
7763 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
7764 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
7765 grow to a huge size with typical invocation.
7766
7767 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
7768 Use the pattern recommended by Autoconf 2.57, except also protect
7769 against double-definition.
7770 * src/system.h: Likewise.
7771 Portability issues reported by Nelson H. F. Beebe.
7772
7773 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
7774 All uses changed. Provide a definition in both C and C++.
7775 (yytrue, yyfalse): Define even if defined (__cplusplus).
7776
7777 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
7778 Reported by Nelson H. F. Beebe.
7779
7780 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
7781
77822003-01-02 Paul Eggert <eggert@twinsun.com>
7783
7784 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
7785 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
7786 Bug reported by Nelson H. F. Beebe.
7787
77882003-01-01 Paul Eggert <eggert@twinsun.com>
7789
7790 * Version 1.875.
7791
77922002-12-30 Paul Eggert <eggert@twinsun.com>
7793
7794 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
7795 Moved here from...
7796 (<INITIAL>","): Here. This causes stray "," to be treated
7797 more uniformly.
7798
7799 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
7800 last brace in braced code when not in Yacc mode, for compatibility
7801 with Bison 1.35. This resurrects the 2001-12-15 patch to
7802 src/reader.c.
7803
7804 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
7805 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
7806
78072002-12-28 Paul Eggert <eggert@twinsun.com>
7808
7809 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
7810 that of SYM's type. This fixes Debian bug 168069, reported by
7811 Thomas Olsson.
7812
78132002-12-28 Paul Eggert <eggert@twinsun.com>
7814
7815 Version 1.75f.
7816
7817 Switch back to the Yacc style of conflict reports, undoing some
7818 of the 2002-07-30 change.
7819 * doc/bison.texinfo (Understanding): Use Yacc style for
7820 conflict reports. Also, use new way of locating rules.
7821 * src/conflicts.c (conflict_report):
7822 Renamed from conflict_report_yacc, removing the old
7823 'conflict_report'. Translate the entire conflict report at once,
7824 so that we don't assume that "," has the same interpretation in
7825 all languages.
7826 (conflicts_output): Use Yacc-style conflict report for each state,
7827 instead of our more-complicated style.
7828 (conflicts_print): Use Yacc-style conflict report, except print
7829 the input file name when not emulating Yacc.
7830 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
7831 Conflicted Reduction, %expect not enough, %expect too much,
7832 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
7833 * tests/existing.at (GNU Cim Grammar): Likewise.
7834 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
7835
7836 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
7837 fatal): Don't invoke fflush; it's not needed and it might even be
7838 harmful for stdout, as stdout might not be open.
7839 * src/reduce.c (reduce_print): Likewise.
7840
78412002-12-27 Paul Eggert <eggert@twinsun.com>
7842
7843 Fix a bug where error locations were not being recorded correctly.
7844 This problem was originally reported by Paul Hilfinger in
7845 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
7846
7847 * data/yacc.c (yyparse): New local var yylerrsp, to record the
7848 top of the location stack's error locations.
7849 (yyerrlab): Set it. When discarding a token, push its location
7850 onto yylerrsp so that we don't lose track of the error's end.
7851 (yyerrlab1): Now is only the target of YYERROR, so that we can
7852 properly record the location of the action that failed. For GCC
7853 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
7854 GCC warning about yyerrlab1 being unused if YYERROR is unused.
7855 (yyerrlab2): New label, which yyerrlab now falls through to.
7856 Compute the error's location by applying YYLLOC_DEFAULT to
7857 the locations of all the symbols that went into the error.
7858 * doc/bison.texinfo (Location Default Action): Mention that
7859 YYLLOC_DEFAULT is also invoked for syntax errors.
7860 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7861 Error locations include the locations of all the tokens that were
7862 discarded, not just the last token.
7863
78642002-12-26 Paul Eggert <eggert@twinsun.com>
7865
7866 * src/files.c: Include quote.h.
7867 (compute_output_file_names): Warn if we detect conflicting
7868 outputs to the same file. This should catch the misunderstanding
7869 exemplified by Debian Bug 165349, reported by Bruce Stephens..
7870
7871 * src/conflicts.c (conflicts_print): If the user specifies
7872 "%expect N", report an error if there are any reduce/reduce
7873 conflicts. This is what the manual says should happen.
7874 This fixes Debian bug 130890, reported by Anthony DeRobertis.
7875 * tests/conflicts.at (%expect with reduce conflicts): New test.
7876
7877 Don't use m4_include on relative file names, as it doesn't work as
7878 desired if there happens to be a file with that name under ".".
7879
7880 * m4sugar/version.m4: Remove; it was included but it wasn't used.
7881 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
7882 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
7883 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
7884 * src/output.c (output_skeleton): Use full path names when
7885 specifying a file to include; don't rely on include path, as
7886 it's unreliable when the working file contains a file with
7887 that name.
7888
78892002-12-25 Paul Eggert <eggert@twinsun.com>
7890
7891 Remove obsolete references to bison.simple and bison.hairy.
7892 Problem mentioned by Aubin Mahe in
7893 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
7894 * data/glr.c: Comment fix.
7895 * doc/bison.1: Remove references. Also, mention "yacc".
7896
7897 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
7898 with -g option.
7899
7900 * src/parse-gram.y (declaration): Use enum "report_states" rather
7901 than its numeric value 1.
7902
7903 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
7904 opening a new one. This fixes Debian bug 165349, reported by
7905 Bruce Stephens.
7906
79072002-12-24 Paul Eggert <eggert@twinsun.com>
7908
7909 Version 1.75e.
7910
7911 * Makefile.maint (cvs-update): Don't assume that the shell
7912 supports $(...), as Solaris sh doesn't.
7913
7914 * src/parse-gram.y (lloc_default): Remove test for empty
7915 nonterminals at the end, since it didn't change the result.
7916
79172002-12-24 Paul Eggert <eggert@twinsun.com>
7918
7919 If the user does not define YYSTYPE as a macro, Bison now declares it
7920 using typedef instead of defining it as a macro. POSIX requires this.
7921 For consistency, YYLTYPE is also declared instead of defined.
7922
7923 %union directives can now have a tag before the `{', e.g., the
7924 directive `%union foo {...}' now generates the C code
7925 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
7926 The default union tag is `YYSTYPE', for compatibility with Solaris 9
7927 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
7928 instead of `yyltype'.
7929
7930 `yystype' and `yyltype' are now obsolescent macros instead of being
7931 typedefs or tags; they are no longer documented and will be
7932 withdrawn in a future release.
7933
7934 * data/glr.c (b4_location_type): Remove.
7935 (YYSTYPE): Renamed from yystype.
7936 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
7937 (struct YYLTYPE): Renamed from struct yyltype.
7938 (YYLTYPE): Renamed from yyltype.
7939 (yyltype, yystype): New (and obsolescent) macros,
7940 for backward compatibility.
7941 * data/yacc.c: Likewise.
7942
7943 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
7944 does not specify a union tag. This is for compatibility with
7945 Solaris 9 yacc.
7946
7947 * src/parse-gram.y (add_param): 2nd arg is now char * not char
7948 const *, since it is now modified by stripping surrounding { }.
7949 (current_braced_code): Remove.
7950 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
7951 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
7952 trailing " {...}". Now of type <chars>.
7953 (grammar_declaration): Adjust to bundled tokens.
7954 (code_content): Remove; stripping is now done by add_param.
7955 (print_token_value): Print contents of bundled tokens.
7956 (token_name): New function.
7957
7958 * src/reader.h (braced_code, current_braced_code): Remove.
7959 (token_name): New decl.
7960
7961 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
7962 token_type, not braced_code code_kind. All uses changed.
7963 (SC_PRE_CODE): New state, for scanning after a keyword that
7964 has (or usually has) an immediately-following braced code.
7965 (token_type): New local var, to keep track of which token type
7966 to return when scanning braced code.
7967 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
7968 <INITIAL>"%parse-param", <INITIAL>"%printer",
7969 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
7970 instead of returning a token type immediately.
7971 (<INITIAL>"{"): Set token type.
7972 (<SC_BRACED_CODE>"}"): Use it.
7973 (handle_action_dollar, handle_action_at): Now returns bool
7974 indicating success. Fail if ! current_rule; this prevents a core dump.
7975 (handle_symbol_code_dollar, handle_symbol_code_at):
7976 Remove; merge body into caller.
7977 (handle_dollar, handle_at): Complain in invalid contexts.
7978
7979 * NEWS, doc/bison.texinfo: Document the above.
7980 * NEWS: Fix years and program names in copyright notice.
7981
79822002-12-17 Paul Eggert <eggert@twinsun.com>
7983
7984 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
7985 Reporting, Table of Symbols): Omit mentions of %lex-param and
7986 %parse-param from the documentation for now.
7987
79882002-12-15 Paul Eggert <eggert@twinsun.com>
7989
7990 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
7991 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
7992 lookahead symbol, and which sets yychar in parser actions) and it
7993 disagreed with the Bison documentation. Bug
7994 reported by Andrew Walrond.
7995
7996 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
7997 as the caller now does that.
7998 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
7999 (YYEMPTY): Parenthesize right hand side, since others use it.
8000 (yyparse): Don't assume that our generated code is the only code
8001 that sets yychar.
8002
80032002-12-13 Paul Eggert <eggert@twinsun.com>
8004
8005 Version 1.75d.
8006
8007 POSIX requires a "yacc" command.
8008 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
8009 (MOSTLYCLEANFILES): Add yacc.
8010 (yacc): New rule.
8011 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
8012 as an alias for bison y.
8013
8014 * po/LINGUAS: Add da.
8015
8016 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
8017 problem with latest <getopt.h>.
8018 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
8019
8020 * doc/fdl.texi: Upgrade to 1.2.
8021 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
8022 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
8023 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
8024 gnulib.
8025 * config/install-sh: Sync with autotools.
8026
8027 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
8028 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
8029 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
8030 locations are requested.
8031 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
8032 locations are requested.
8033
80342002-12-12 Paul Eggert <eggert@twinsun.com>
8035
8036 Remove unportable casts and storage allocation tricks.
8037 While we're at it, remove almost all casts, since they
8038 usually aren't needed and are a sign of trouble.
8039
8040 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
8041
8042 * src/derives.c (derives_compute): Do not subtract NTOKENS from
8043 the pointer DSET returned by malloc; this isn't portable.
8044 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
8045 Similarly for DERIVES.
8046 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
8047 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
8048 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
8049
8050 * src/derives.c (derives_compute): Do not bother invoking
8051 int_of_rule_number, since rule numbers are integers.
8052
8053 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
8054 rather than XMALLOC (char, N).
8055
8056 * src/files.c (filename_split): Rewrite to avoid cast.
8057
8058 * src/gram.h (symbol_number_as_item_number,
8059 item_number_as_symbol_number, rule_number_as_item_number,
8060 item_number_as_rule_number):
8061 Now inline functions rather than macros, to avoid casts.
8062 * src/state.h (state_number_as_int): Likewise.
8063 * src/tables.c (state_number_to_vector_number,
8064 symbol_number_to_vector_number): Likewise.
8065
8066 * src/gram.h (int_of_rule_number): Remove; no longer used.
8067
8068 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
8069 since the resulting storage is always stored into.
8070
8071 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
8072 where it's needed.
8073
8074 * src/muscle_tab.c (muscle_m4_output):
8075 Now inline. Return bool, not int.
8076 * src/state.c (state_compare): Likewise.
8077 * src/symtab.c (symbol_check_defined,
8078 symbol_check_alias_consistency, symbol_pack, symbol_translation,
8079 hash_compare_symbol, hash_symbol):
8080 Likewise.
8081 * src/uniqstr.c (uniqstr_print): Likewise.
8082 * src/muscle_tab.c (muscle_m4_output_processor):
8083 New function, to avoid casts.
8084 * src/state.c (state_comparator, stage_hasher): Likewise.
8085 * src/symtab.c (symbol_check_defined_processor,
8086 symbol_check_alias_consistency_processor, symbol_pack_processor,
8087 symbol_translation_processor, hash_symbol_comparator,
8088 hash_symbol_hasher): Likewise.
8089 * src/uniqstr.c (uniqstr_print_processor): Likewise.
8090 * src/muscle_tab.c (muscles_m4_output):
8091 Use new functions instead of casting old functions unportably.
8092 * src/state.c (state_hash_new): Likewise.
8093 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
8094 symbols_token_translations_init):
8095 Likewise.
8096 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
8097
8098 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
8099 var instead of casting to long, to avoid casts.
8100 (prepare_states): Use MALLOC rather than alloca, so that we don't
8101 have to worry about alloca.
8102 * src/state.c (state_hash_lookup): Likewise.
8103
8104 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
8105 local var instead of casting to unsigned char, to avoid casts.
8106
8107 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
8108 STATE_ALLOC): Remove.
8109 (transitions_new, errs_new, reductions_new, state_new): Use malloc
8110 rather than calloc, and use offsetof to avoid allocating slightly
8111 too much storage.
8112 (state_new): Initialize all members.
8113
8114 * src/state.c (state_hash): Use unsigned accumulator, not signed.
8115
8116 * src/symtab.c (symbol_free): Remove; unused.
8117 (symbol_get): Remove cast in lhs of assignment.
8118 (symbols_do): Now static. Accept generic arguments, not
8119 hashing-related ones.
8120
8121 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
8122 (symbol_processor): Remove.
8123 (symbols_do): Remove decl; now static.
8124
8125 * src/system.h (alloca): Remove; decl no longer needed.
8126 (<stddef.h>): Include, for offsetof.
8127 (<inttypes.>, <stdint.h>): Include if available.
8128 (uintptr_t): New type, if system lacks it.
8129 (CALLOC, MALLOC, REALLOC): New macros.
8130 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
8131 new macros.
8132
8133 * src/tables.c (table_size): Now int, to pacify GCC.
8134 (table_grow, table_ninf_remap): Use signed table size.
8135 (save_row): Don't bother initializing locals when not needed.
8136 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
8137 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
8138
8139 * src/vcg.h: Correct misspellings.
8140
8141 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
8142
8143
8144 * src/getargs.c (getargs): Don't assume EOF == -1.
8145
81462002-12-09 Paul Eggert <eggert@twinsun.com>
8147
8148 Change identifier spellings to avoid collisions with names
8149 that are reserved by POSIX.
8150
8151 Don't use names ending in _t, since POSIX reserves them.
8152 For consistency, remove _e and _s endings -- they're weren't
8153 needed to remove ambiguity. All uses changed.
8154 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
8155 turn was just renamed from struniq_t.
8156 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
8157 which in turn was just renamed from struniq_processor_t.
8158 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
8159 in turn was renamed from hash_compare_struniq_t.
8160 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
8161 (state_list): Renamed from state_list_t.
8162 * src/assoc.h (assoc): Renamed from assoc_t.
8163 * src/conflicts.c (enum conflict_resolution): Renamed from
8164 enum conflict_resolution_e.
8165 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
8166 (rule_list): Renamed from rule_list_t.
8167 * src/getargs.h (enum trace): Renamed from enum trace_e.
8168 (enum report): Renamed from enum report_e.
8169 * src/gram.h (item_number): Renamed from item_number_t.
8170 (rule_number): Renamed from rule_number_t.
8171 (struct rule_s): Remove the "rule_s" part; not used.
8172 (rule): Renamed from rule_t.
8173 (rule_filter): Renamed from rule_filter_t.
8174 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
8175 (goto_list): Renamed from goto_list_t.
8176 * src/lalr.h (goto_number): Renamed from goto_number_t.
8177 * src/location.h (location): Renamed from location_t.
8178 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
8179 and moved here from:
8180 * src/muscle_tab.h (muscle_entry_t): here.
8181 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
8182 (rule_list): Renamed from rule_list_t.
8183 * src/print_graph.c (static_graph): Renamed from graph.
8184 * src/reader.h (braced_code): Renamed from braced_code_t.
8185 Remove brace_code_e tag.
8186 * src/relation.h (relation_node): Renamed from relation_node_t.
8187 (relation_nodes): Renamed from relation_nodes_t.
8188 (relation): Renamed from relation_t.
8189 * src/state.h (state_number): Renamed from state_number_t.
8190 (struct state): Renamed from struct state_s.
8191 (state): Renamed from state_t.
8192 (transitions): Renamed from transitions_t. Unused (and
8193 misspelled) transtion_s tag removed.
8194 (errs): Renamed from errs_t. Unused errs_s tag removed.
8195 (reductions): Renamed from reductions_t. Unused tag
8196 reductions_s removed.
8197 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
8198 (struct symbol_list): Renamed from struct symbol_list_s.
8199 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
8200 (struct symbol): Renamed from struct symbol_s.
8201 (symbol): Renamed from symbol_t.
8202 * src/tables.c (vector_number): Renamed from vector_number_t.
8203 (action_number): Renamed from action_t.
8204 * src/tables.h (base_number): Renamed from base_t.
8205 * src/vcg.h (enum color): Renamed from enum color_e.
8206 (enum textmode): Renamed from enum textmode_e.
8207 (enum shape): Renamed from enum shape_e.
8208 (struct colorentry): Renamed from struct colorentry_s.
8209 (struct classname): Renamed from struct classname_s.
8210 (struct infoname): Renamed from struct infoname_s.
8211 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
8212 (enum decision): Renamed from enum decision_e.
8213 (enum orientation): Renamed from enum orientation_e.
8214 (enum alignment): Renamed from enum alignment_e.
8215 (enum arrow_mode): Renamed from enum arrow_mode_e.
8216 (enum crossing_type): Renamed from enum crossing_type_e.
8217 (enum view): Renamed from enum view_e.
8218 (struct node): Renamed from struct node_s.
8219 (node): Renamed from node_t.
8220 (enum linestyle): Renamed from enum linestyle_e.
8221 (enum arrowstyle): Renamed from enum arrowstyle_e.
8222 (struct edge): Renamed from struct edge.
8223 (edge): Renamed from edge_t.
8224 (struct graph): Renamed from struct graph_s.
8225 (graph): Renamed from graph_t.
8226 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
8227 Rename value_t -> value.
8228 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
8229 value_t_as_yystype -> value_as_yystype.
8230
8231 Don't include <errno.h> in the mainstream code, since it
8232 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
8233 * lib/get-errno.c, lib/get-errno.h: New files.
8234 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
8235 get-errno.c.
8236 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
8237 * src/output.c (output_skeleton): Likewise.
8238 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
8239 instead of errno.
8240 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
8241 Likewise.
8242 (handle_action_dollar, handle_action_at): Likewise.
8243 * src/system.h: Do not include <errno.h>.
8244 (TAB_EXT): Renamed from EXT_TAB.
8245 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
8246
8247 Avoid str[a-z]*, since <string.h> reserves that name space.
8248 Change all instances of "struniq" in names to "uniqstr", and
8249 likewise for "STRUNIQ" and "UNIQSTR".
8250 * src/uniqstr.c: Renamed from src/struniq.c.
8251 * src/uniqstr.h: Renamed from src/struniq.h.
8252 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
8253 * src/files.c (strsuffix): Remove; unused.
8254 (concat2): Renamed from stringappend. Now static.
8255 * src/files.h (strsuffix, stringappend): Remove; unused.
8256 * src/parse-gram.y (<chars>): Renamed from <string>.
8257 (<uniqstr>): Renamed from <struniq>.
8258 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
8259 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
8260 (struct graph_s.expand): Renamed from struct graph_s.stretch.
8261 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
8262 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
8263 (N_EXPAND): Renamed from N_STRETCH.
8264
8265 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
8266 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
8267 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
8268 Remove; unused.
8269 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
8270 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
8271 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
8272 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
8273 (BASE_MAXIMUM): Renamed from BASE_MAX.
8274 (BASE_MINIMUM): Renamed from BASE_MIN.
8275 (ACTION_MAX): Remove; unused.
8276 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
8277 Unnecessary casts removed from above defines.
8278
8279
8280 Fix misspelling in names.
8281 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
8282 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
8283 G_NODE_ALIGNEMENT.
8284
8285
8286 * lib/timevar.c (timevar_report): Renamed from time_report,
8287 for consistency with other names.
8288 * lib/timevar.h (timevar_report): New decl.
8289 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
8290
8291
8292 Sort include-file uses.
8293
8294 Reorder all include files under src to be in the order "system.h".
8295 then the ../lib include files in angle brackets (alphabetized),
8296 then the . include files in double-quotes (alphabetized). Fix
8297 dependency breakages encountered in this process, as follows:
8298 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
8299 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
8300 * src/state.h: Include "symtab.h".
8301
83022002-12-08 Paul Eggert <eggert@twinsun.com>
8303
8304 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
8305 since this causes problems when __file__ contains character
8306 sequences like "@" that are treated specially by src/scan-skel.l.
8307 Instead, just use the file's basename. This fixes the bug
8308 reported by Martin Mokrejs in
8309 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
8310
83112002-12-06 Paul Eggert <eggert@twinsun.com>
8312
8313 Add support for rules that do not have trailing semicolons, as
8314 POSIX requires. Improve the quality of locations in Bison
8315 diagnostics.
8316
8317 * src/location.c: Include <quotearg.h>.
8318 (empty_location): Now const.
8319 (location_print): New function. Follow the recommendation of the
8320 GNU Coding Standards for locations that span file boundaries.
8321 * src/location.h: Do not include <quotearg.h>; no longer needed.
8322 (boundary): New type.
8323 (location_t): Use it. This allows locations to span file boundaries.
8324 All member uses changed: file -> start.file or end.file (as needed),
8325 first_line -> start.line, first_column -> start.column,
8326 last_line -> end.line, last_column -> end.column.
8327 (equal_boundaries): New function.
8328 (LOCATION_RESET, LOCATION_STEP): Remove.
8329 (LOCATION_PRINT): Remove. All callers changed to use location_print.
8330 (empty_location): Now const.
8331 (location_print): New decl.
8332 * src/parse-gram.y (lloc_default): New function, which handles
8333 empty locations more accurately.
8334 (YYLLOC_DEFAULT): Use it.
8335 (%token COLON): Remove.
8336 (%token ID_COLON): New token.
8337 (rules): Use it.
8338 (declarations, rules): Remove trailing semicolon.
8339 (declaration, rules_or_grammar_declaration):
8340 Allow empty (";") declaration.
8341 (symbol_def): Remove empty actions; no longer needed.
8342 (rules_or_grammar_declaration): Remove trailing semicolon.
8343 (semi_colon.opt): Remove.
8344 * src/reader.h: Include location.h.
8345 (scanner_cursor): New decl.
8346 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
8347 rolling our own.
8348 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
8349 of *loc.
8350 (STEP): Remove. No longer needed, now that adjust_location does
8351 the work. All uses removed.
8352 (scanner_cursor): New var.
8353 (adjust_location): Renamed from extend_location. It now sets
8354 *loc and adjusts the scanner cursor. All uses changed.
8355 Don't bother testing for CR.
8356 (handle_syncline): Remove location arg; now updates scanner cursor.
8357 All callers changed.
8358 (unexpected_end_of_file): Now accepts start boundary of token or
8359 comment, not location. All callers changed. Update scanner cursor,
8360 not the location.
8361 (SC_AFTER_IDENTIFIER): New state.
8362 (context_state): Renamed from c_context. All uses changed.
8363 (id_loc, code_start, token_start): New local vars.
8364 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
8365 processing of Yacc white space and equivalents here.
8366 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
8367 instead of returning ID immediately, since we need to search for
8368 a subsequent colon.
8369 (<INITIAL>"'", "\""): Save token_start.
8370 (<INITIAL>"%{", "{", "%%"): Save code_start.
8371 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
8372 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
8373 BEGIN context_state at end, not INITIAL.
8374 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
8375 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
8376 Return correct token start.
8377 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
8378 the start of a character, string or multiline comment is found.
8379 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
8380 Reduction): Adjust reported locations to match the more-precise
8381 results now expected.
8382 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
8383 * tests/reduce.at (Useless Rules, Reduced Automaton,
8384 Underivable Rules): Likewise.
8385 * tests/regression.at (Invalid inputs): No longer `expecting ";"
8386 or "|"' now that so many other tokens are allowed by the new grammar.
8387
8388 * src/complain.h (current_file): Remove duplicate decl;
8389 current_file is now owned by files.h.
8390 * src/complain.c, src/scan-gram.l: Include files.h.
8391
83922002-12-06 Paul Eggert <eggert@twinsun.com>
8393
8394 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
8395 promotes to int; it might be unsigned int.
8396 * data/yacc.c (yy_reduce_print): Likewise.
8397
8398 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
8399 be #defined in the prologue, not in the Bison declarations.
8400 This fixes Debian Bug 102878, reported by Shaul Karl.
8401
84022002-12-02 Paul Eggert <eggert@twinsun.com>
8403
8404 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
8405 * lib/strtoul.c: New file, from gnulib.
8406 This fixes a porting bug reported by Peter Klein in
8407 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
8408
84092002-11-30 Paul Eggert <eggert@twinsun.com>
8410
8411 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
8412 and put only a forward declaration in the prologue. This is for
8413 consistency with the other scanner helper functions.
8414
8415 Type clashes now generate warnings, not errors, since it
8416 appears that POSIX may allow some grammars with type clashes.
8417 * src/reader.c (grammar_current_rule_check): Warn about
8418 type clashes instead of complaining.
8419 * tests/input.at (Type Clashes): Expect warnings, not complaints.
8420
8421 Add Yacc library, since POSIX requires it.
8422 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
8423 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
8424 * lib/main.c, lib/yyerror.c: New files.
8425
8426 gram_error can be static; it need not be extern.
8427 * src/reader.h (gram_error): Remove decl.
8428 * src/parse-gram.y (gram_error): Now static. Add static decl.
8429 (print_token_value): Omit parameter names from forward decl,
8430 for consistency.
8431
84322002-11-29 Paul Eggert <eggert@twinsun.com>
8433
8434 * doc/bison.texinfo: Emphasize that yylex and yyerror must
8435 be declared before being used. E.g., one should typically
8436 declare them in the prologue. Use GNU coding style in examples.
8437 Put "const" consistently after the type it modifies. Mention
8438 that C99 supports "inline". Mention that yyerror traditionally
8439 returns "int".
8440
8441 %parse-param and %lex-param now take just one argument, the
8442 declaration; the argument name is deduced from the declaration.
8443
8444 * doc/bison.texinfo (Parser Function, Pure Calling, Error
8445 Reporting, Table of Symbols): Document this.
8446 * src/parse-gram.y (add_param): New function.
8447 (COMMA): Remove.
8448 (declaration): Implement new rule for %parse-param and %lex-param.
8449 * src/scan-gram.l: "," now elicits a warning, rather than being
8450 a token; this is more compatible with byacc.
8451 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
8452
84532002-11-27 Paul Eggert <eggert@twinsun.com>
8454
8455 Rename identifiers to avoid real and potential collisions.
8456
8457 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
8458 to avoid collision with lex macro described by Bruce Lilly in
8459 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
8460 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
8461 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
8462 * src/parse-gram.y (print_token_value): Renamed from yyprint.
8463 All uses changed.
8464 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
8465 The name "yycontrol" violates the name space rules, and this stuff
8466 wasn't being used anyway.
8467 (input): Remove action; this stuff wasn't being used.
8468 (gram_error): Rename local variable yylloc -> loc.
8469 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
8470 (YY_DECL): Don't use "yy" at start of local variables.
8471 All uses changed, e.g., yylloc -> loc.
8472 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
8473 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
8474 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
8475 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
8476
8477 * src/parse-gram.y (gram_error): loc is now const *.
8478 * src/reader.h (gram_error): Likewise.
8479
84802002-11-24 Paul Eggert <eggert@twinsun.com>
8481
8482 Version 1.75c.
8483
8484 * tests/actions.at (Actions after errors): Use an output format
8485 more similar to that of the Printers and Destructors test.
8486 Test the position of the ';' token too.
8487 (Printers and Destructors): Likewise.
8488 (Printers and Destructors: %glr-parser): Remove for now, to avoid
8489 unnecessarily alarming people when the test fails.
8490
8491 * data/yacc.c (yyerrlab1): Move this label down, so that the
8492 parser does not discard the lookahead token if the user code
8493 invokes YYERROR. This change is required for POSIX conformance.
8494
8495 * lib/error.c: Sync with gnulib.
8496
84972002-11-22 Paul Eggert <eggert@twinsun.com>
8498
8499 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
8500 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
8501 * lib/xmalloc.c: Likewise.
8502
85032002-11-20 Paul Eggert <eggert@twinsun.com>
8504
8505 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
8506
85072002-11-20 Paul Eggert <eggert@twinsun.com>
8508
8509 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
8510 should use `if (! x) abort ();' rather than `assert (x);', and
8511 anyway it's one less thing to worry about configuring.
8512
8513 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
8514 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
8515 and replace all instances of assert with abort.
8516 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8517 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
8518
8519 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
8520 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
8521 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
8522 hash_find_entry, hash_rehash, hash_insert): Likewise.
8523 * src/conflicts.c (resolve_sr_conflict): Likewise.
8524 * src/lalr.c (set_goto_map, map_goto): Likewise.
8525 * src/nullable.c (nullable_compute): Likewise.
8526 * src/output.c (prepare_rules, token_definitions_output): Likewise.
8527 * src/reader.c (packgram, reader): Likewise.
8528 * src/state.c (state_new, state_free, state_transitions_set,
8529 state_reduction_find): Likewise.
8530 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
8531 symbol_pack): Likewise.
8532 * src/tables.c (conflict_row, pack_vector): Likewise.
8533 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
8534 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
8535 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
8536 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
8537
8538 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
8539 (ARGMATCH_CONSTRAINT): New macro.
8540 (ARGMATCH_ASSERT): Use it.
8541
8542 * src/system.h (verify): New macro.
8543 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
8544 rather than assert.
8545 * src/tables.c (tables_generate): Likewise.
8546
8547 * src/struniq.c (struniq_assert): Now returns void, and aborts
8548 if the assertion is false.
8549 (struniq_assert_p): Remove.
8550 * src/struniq.h: Likewise.
8551
85522002-11-18 Paul Eggert <eggert@twinsun.com>
8553
8554 * data/glr.c (yygetLRActions): Replace `yyindex' with
8555 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
8556 This fixes the regression with Sun ONE Studio 7 cc that I reported in
8557 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
8558
85592002-11-18 Akim Demaille <akim@epita.fr>
8560
8561 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
8562 space.
8563 From Tim Van Holder.
8564
85652002-11-17 Paul Eggert <eggert@twinsun.com>
8566
8567 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
8568 to "SyntaxError" for consistency with my 2002-11-15 change.
8569
8570 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
8571 not define to {}, since this breaks the common use of `YYDPRINTF
8572 ((...));' if a single statement is desired (e.g. before `else').
8573 Work around GCC warnings by surrounding corresponding calls with
8574 {} if needed.
8575 (yyhasResolvedValue): Remove unused function.
8576 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
8577 loop body.
8578 (yyreportSyntaxError): Renamed from yyreportParseError.
8579 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
8580 All uses changed.
8581 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
8582 extern when possible. Remove unused initializations.
8583
85842002-11-16 Akim Demaille <akim@epita.fr>
8585
8586 Augment the similarity between GLR and LALR traces.
8587
8588 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
8589 (YY_REDUCE_PRINT): New.
8590 (yyparse): Use them.
8591 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
8592 YYDPRINT here.
8593 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
8594 state reached after the reduction/recovery, since...
8595 (yyparse, yyprocessOneStack): Report the state we are entering in.
8596
85972002-11-16 Akim Demaille <akim@epita.fr>
8598
8599 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
8600 Add support for --trace=skeleton.
8601 * src/scan-skel.l: %option debug.
8602 Scan strings of non-@ or \n instead of character by character.
8603 (scan_skel): Handle trace_skeleton.
8604 (QPUTS): New.
8605 (@output_parser_name@, @output_header_name@): ``Restore'' their
8606 support (used to be M4 macros).
8607 * data/yacc.c: Quote larger chunks, a la glr.c.
8608 * data/lalr1.cc: Likewise.
8609 The header guards are no longer available, so use some other
8610 string than `YYLSP_NEEDED'.
8611
86122002-11-16 Akim Demaille <akim@epita.fr>
8613
8614 Make the ``Printers and Destructors'' test more verbose, taking
8615 `yacc.c''s behavior as (possibly wrong) reference.
8616
8617 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
8618 instead of fprint on stdout.
8619 Set and report the last_line of the symbols.
8620 Consistently display values and locations.
8621
86222002-11-16 Paul Eggert <eggert@twinsun.com>
8623
8624 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
8625
86262002-11-15 Paul Eggert <eggert@twinsun.com>
8627
8628 * tests/actions.at (Actions after errors): New test case.
8629
8630 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
8631 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
8632 tests/action.at, tests/calc.at, tests/conflicts.at,
8633 tests/cxx-type.at, tests/regression.at:
8634 "parse error" -> "syntax error" for POSIX compatibility.
8635 "parsing stack overflow..." -> "parser stack overflow" so
8636 that code matches Bison documentation.
8637
86382002-11-15 Akim Demaille <akim@epita.fr>
8639
8640 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
8641 take two BRACED_CODE, not two string_content.
8642 Free the scanner's obstack when we are done.
8643 (code_content): New.
8644 * tests/calc.at: Adjust.
8645 * doc/bison.texinfo: Adjust.
8646 Also, make sure to include the `,' for these declarations.
8647
86482002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
8649
8650 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
8651 definition; avoids potential autoreconf problems.
8652
86532002-11-15 Akim Demaille <akim@epita.fr>
8654
8655 Always check the value returned by yyparse.
8656
8657 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
8658 returned by yyparse.
8659 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
8660 Adjust calls.
8661 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
8662 returned by yyparse.
8663
86642002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8665
8666 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
8667 on input.at test.
8668
86692002-11-14 Paul Eggert <eggert@twinsun.com>
8670
8671 * src/output.c (output_skeleton): Call xfopen instead of
8672 duplicating xfopen's body.
8673
8674 Fix bugs reported by Nelson H. F. Beebe in
8675 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
8676
8677 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
8678 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
8679 Group compiler. Instead, use "$CC -E bar.c". Include the .h
8680 file twice in the grammar, as an extra check.
8681
8682 * tests/input.at (Torturing the Scanner): Surround the
8683 backslash-newline tests with "#if 0", to make it less likely that
8684 we'll run into compiler bugs. Bring back solitary \ inside
8685 comment, but add a closing comment to work around HP C bug. Don't
8686 test backslash-newline in C character constant.
8687
86882002-11-14 Akim Demaille <akim@epita.fr>
8689
8690 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
8691 status of the compiler.
8692 Calling `exit 1' is no longer needed.
8693 Reported by Nelson H. F. Beebe.
8694
86952002-11-14 Akim Demaille <akim@epita.fr>
8696
8697 * tests/atlocal.in (CPPFLAGS): We have config.h.
8698 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
8699 New.
8700 * tests/actions.at, tests/calc.at, tests/conflicts.at,
8701 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
8702 * tests/regression.at, tests/torture.at: Use them for all the
8703 grammars that are to be compiled.
8704 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
8705 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
8706 * doc/bison.texinfo (GLR Parsers): Document `inline'.
8707
87082002-11-14 Akim Demaille <akim@epita.fr>
8709
8710 * doc/bison.texinfo: Various formatting changes (alignments in
8711 samples, additional @group/@end group, GCS in samples.
8712 Use @deffn instead of simple @table to define the directives,
8713 macros, variables etc.
8714
87152002-11-13 Paul Eggert <eggert@twinsun.com>
8716
8717 Fix some bugs reported by Albert Chin-A-Young in
8718 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
8719
8720 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8721 -o c"; the HP C compiler chatters during compilation.
8722 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
8723 * tests/headers.at (export YYLTYPE): Likewise.
8724
8725 * tests/input.at (Torturing the Scanner): Remove lines containing
8726 solitary backslashes, as they tickle a bug in the HP C compiler.
8727
8728 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
8729 comments, since they're not portable. Use GNU coding style.
8730
87312002-11-13 Akim Demaille <akim@epita.fr>
8732
8733 * data/yacc.c: Leave bigger chunks of quoted text.
8734 (YYDSYMPRINTF): New.
8735 Use it to report symbol activities.
8736 * data/glr.c (YYDSYMPRINTF): New.
8737 Use it.
8738
87392002-11-12 Paul Eggert <eggert@twinsun.com>
8740
8741 Version 1.75b.
8742
8743 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
8744 (yyglrReduce): Return yyok, not 0.
8745 This should avoid the enumerated-type warnings reported
8746 by Nelson H. F. Beebe in
8747 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
8748
8749 * lib/bbitset.h (BITSET_INLINE): Remove.
8750 * lib/bitset.h [! BITSET_INLINE]: Remove.
8751 (bitset_set, bitset_reset, bitset_test): Rename local vars
8752 to avoid shadowing warnings by GCC.
8753
8754 * data/glr.c (inline): Remove #define. It's the user's
8755 responsibility to #define it away, just like 'const'.
8756 This fixes one of the bugs reported by Nelson H. F. Beebe in
8757 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
8758
8759 * Makefile.maint (po-check): Scan .l and .y files instead of the
8760 .c and the .h files that they generate. This fixes the bug
8761 reported by Tim Van Holder in:
8762 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
8763 Look for N_ as well as for _. Try to avoid matching #define for
8764 N_ and _.
8765 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
8766 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
8767 * src/scan-gram.l: Revamp regular expressions so that " and '
8768 do not confuse xgettext.
8769
8770 * src/struniq.h (struniq_new): Do not declare the return type
8771 to be 'const'; this violates the C standard.
8772 * src/struniq.c (struniq_new): Likewise.
8773
87742002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
8775
8776 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
8777 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
8778 linker.
8779
87802002-11-12 Akim Demaille <akim@epita.fr>
8781
8782 * Makefile.maint: Sync with Autoconf:
8783 (local_updates): New.
8784
87852002-11-12 Akim Demaille <akim@epita.fr>
8786
8787 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
8788
87892002-11-12 Akim Demaille <akim@epita.fr>
8790
8791 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
8792 locations.
8793
87942002-11-12 Akim Demaille <akim@epita.fr>
8795
8796 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
8797 not yyvalue.
8798
87992002-11-12 Akim Demaille <akim@epita.fr>
8800
8801 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
8802 Use it to test the GLR parser.
8803
88042002-11-12 Akim Demaille <akim@epita.fr>
8805
8806 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
8807 defines it.
8808 * data/glr.c (yystos): New.
8809 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
8810 (YYDSYMPRINT): New.
8811 (yyval): Don't define it, it is handled via M4.
8812 (yyrecoverParseError): Free verbosely the discarded symbols.
8813 * data/yacc.c (yysymprint): Remove, rather...
8814 (b4_yysymprint_generate): invoke.
8815 * data/c.m4 (b4_yysymprint_generate): New.
8816 Accept pointers as arguments, as opposed to the version from
8817 yacc.c.
8818 (b4_yydestruct_generate): Likewise.
8819 * tests/cations.at (Printers and Destructors): Use Bison directives
8820 instead of CPP macros.
8821 Don't rely on internal details.
8822
88232002-11-12 Akim Demaille <akim@epita.fr>
8824
8825 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
8826 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
8827 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
8828 it against YYEMPTY and so forth), work on yytoken (i.e., set
8829 it to YYEMPTY etc.).
8830 (yydestruct): Replace with a b4_yydestruct_generate invocation.
8831 (b4_symbol_actions): Remove.
8832 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
8833 for 0, end-of-input.
8834
88352002-11-12 Akim Demaille <akim@epita.fr>
8836
8837 * doc/bison.texinfo (Destructor Decl): New.
8838
88392002-11-12 Akim Demaille <akim@epita.fr>
8840
8841 * src/tables.c (tables_generate): Use free for pointers that
8842 cannot be NULL, not XFREE.
8843 (pack_vector): Use assert, not fatal, for bound violations.
8844 * src/state.c (state_new): Likewise.
8845 * src/reader.c (reader): Likewise.
8846 * src/lalr.c (set_goto_map): Likewise.
8847 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
8848 the file name.
8849
88502002-11-12 Akim Demaille <akim@epita.fr>
8851
8852 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
8853 Restore.
8854 * src/scan-gram.l (last_string): Is global to the file, not to
8855 yylex.
8856 * src/parse-gram.y (input): Don't append the epilogue here,
8857 (epilogue.opt): do it here, and free the scanner's obstack.
8858 * src/reader.c (epilogue_set): Rename as...
8859 (epilogue_augment): this.
8860 * data/c.m4 (b4_epilogue): Defaults to empty.
8861
88622002-11-12 Akim Demaille <akim@epita.fr>
8863
8864 * src/getargs.c (long_options): Remove duplicates.
8865 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
8866 Remove.
8867 * doc/bison.rnh: Remove.
8868 * doc/bison.texinfo (VMS Invocation): Remove.
8869
88702002-11-12 Akim Demaille <akim@epita.fr>
8871
8872 * src/struniq.h, src/struniq.c (struniq_t): Is const.
8873 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
8874
8875 Use struniq for symbols.
8876
8877 * src/symtab.h (symbol_t): The tag member is a struniq.
8878 (symbol_type_set): Adjust.
8879 * src/symtab.c (symbol_new): Takes a struniq.
8880 (symbol_free): Don't free the tag member.
8881 (hash_compare_symbol_t, hash_symbol_t): Rename as...
8882 (hash_compare_symbol, hash_symbol): these.
8883 Use the fact that tags as struniqs.
8884 (symbol_get): Use struniq_new.
8885 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
8886 Returns a strniq.
8887 * src/reader.h (merger_list, grammar_currentmerge_set): The name
8888 and type members are struniqs.
8889 * src/reader.c (get_merge_function)
8890 (grammar_current_rule_merge_set): Adjust.
8891 (TYPE, current_type): Are struniq.
8892
8893 Use struniq for file names.
8894
8895 * src/files.h, src/files.c (infile): Split into...
8896 (grammar_file, current_file): these.
8897 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
8898 * src/reduce.c (reduce_print): Likewise.
8899 * src/getargs.c (getargs): Likewise.
8900 * src/complain.h, src/complain.c: Likewise.
8901 * src/main.c (main): Call struniqs_new early enough to use it for
8902 file names.
8903 Don't free the input file name.
8904
89052002-11-12 Akim Demaille <akim@epita.fr>
8906
8907 * src/symtab.c (symbol_free): Remove dead deactivated code:
8908 type_name are properly removed.
8909 Don't use XFREE to free items that cannot be NULL.
8910 * src/struniq.h, src/struniq.c: New.
8911 * src/main.c (main): Initialize/free struniqs.
8912 * src/parse-gram.y (%union): Add astruniq member.
8913 (yyprint): Adjust.
8914 * src/scan-gram.l (<{tag}>): Return a struniq.
8915 Free the obstack bit that used to store it.
8916 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
8917
89182002-11-11 Paul Eggert <eggert@twinsun.com>
8919
8920 Revamp to fix many (but not all) of the C- and M4-related quoting
8921 problems. Among other things, this fixes the Bison bug reported
8922 by Jan Hubicka when processing the Bash grammar; see:
8923 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
8924
8925 Use new @ escapes consistently. Represent brackets with @{ and @}
8926 rather than @<:@ and @:>@, since this works a bit better with dumb
8927 editors like vi. Represent @ with @@, since @ is now consistently
8928 an escape. Use @oline@ and @ofile@ rather than __oline__ and
8929 __ofile__, to avoid unexpected expansions. Similarly, use @output
8930 rather than #output.
8931
8932 * data/c.m4 (b4_copyright): Omit file name from comment, since
8933 the file name could contain "*/".
8934 (b4_synclines_flag): Don't quote the 2nd argument; it should already
8935 be quoted. All uses changed.
8936
8937 * data/glr.c: Use new @ escapes consistently.
8938 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
8939 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
8940 Remove, since they couldn't handle arbitrary characters in file
8941 names.
8942 * data/lalr1.cc: Likewise.
8943 * data/yacc.c: Likewise.
8944
8945 * src/files.c (output_infix): Remove; all uses removed.
8946 * src/files.h: Likewise.
8947
8948 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
8949 mishandled funny characters in file names, and anyway it isn't
8950 needed any more.
8951 * data/yacc.c: Likewise.
8952 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
8953
8954 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
8955 * data/yacc.c: Likewise.
8956
8957 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
8958 strings now.
8959 (muscle_init): Quote filename as a C string.
8960 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
8961 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
8962 * src/output.c (escaped_file_name_output): New function.
8963 (prepare_symbols): Quote tokens for M4.
8964 (prepare): Don't insert output_infix, output_prefix,
8965 output_parser_name, output_header_name; this is now down by scan-skel.
8966 Insert skeleton as a C string.
8967
8968 * src/output.c (user_actions_output, symbol_destructors_output,
8969 symbol_printers_output): Quote filenames for C and M4.
8970 * src/reader.c (prologue_augment, epilogue_set): Likewise.
8971
8972 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
8973 escapes other than \\ and \'; this simplifies the code.
8974 (<SC_STRING>): Likewise, for \\ and \".
8975 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
8976 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
8977 Use new escapes @{ and @} for [ and ].
8978
8979 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
8980 them with auto vars.
8981 Switch to new escape scheme, where @ is the escape character uniformly.
8982 Abort if a stray escape character is found. Avoid unbounded input
8983 buffer when parsing non-escaped text.
8984
8985 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
8986 __oline__, #output, $@, and @{ do not have unintended meanings.
8987
89882002-11-09 Paul Eggert <eggert@twinsun.com>
8989
8990 Fix the test failure due to GCC warnings described in
8991 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
8992 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
8993 evaluate to 0 if it's impossible for NINF to be in the respective
8994 table.
8995 (yygetLRActions, yyrecoverParseError): Use them.
8996
8997 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
8998 counted in the token inserted at end of file. Now takes
8999 location_t *, not location_t, so that the location can be
9000 adjusted. All uses changed.
9001
9002 * tests/regression.at (Invalid inputs): Adjust wording in
9003 diagnostic to match the new behavior.
9004
9005 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
9006 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
9007 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
9008 abort ();'. This reduces the runtime of the "Many lookaheads"
9009 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
9010 GCC 3.2.
9011
90122002-11-07 Paul Eggert <eggert@twinsun.com>
9013
9014 * src/parse-gram.y (CHARACTER): Remove unused token.
9015 All uses removed.
9016
9017 * src/scan-gram.l: Remove stack option. We no longer use the
9018 stack, since the stack was never deeper than 1; instead, use the
9019 new auto var c_context to record the stacked value.
9020
9021 Remove nounput option. At an unexpected end of file, we now unput
9022 the minimal input necessary to end cleanly; this simplifies the
9023 code.
9024
9025 Avoid unbounded token sizes where this is easy.
9026
9027 (unexpected_end_of_file): New function.
9028 Use it to systematize the error message on unexpected EOF.
9029 (last-string): Now auto, not static.
9030 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
9031 (scanner_last_string_free): Remove; not used.
9032 (percent_percent_count): Move decl to just before use.
9033 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
9034 not the (never otherwised-used) CHARACTER.
9035
90362002-11-07 Akim Demaille <akim@epita.fr>
9037
9038 Let yyerror always receive the msg as last argument, so that
9039 yyerror can be variadic.
9040
9041 * data/yacc.c (b4_yyerror_args): New.
9042 Use it when calling yyerror.
9043 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
9044 Use it when calling yyerror.
9045 * doc/bison.texinfo (Error Reporting): Adjust.
9046 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
9047 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
9048
90492002-11-06 Akim Demaille <akim@epita.fr>
9050
9051 #line should have quoted strings.
9052 Ideally, this should be done by m4_quotearg.
9053
9054 * src/scan-skel.l: Include quotearg.h.
9055 Quote __ofile__.
9056 * src/output.c (symbol_printers_output)
9057 (symbol_destructors_output): Quote the file name.
9058
90592002-11-06 Akim Demaille <akim@epita.fr>
9060
9061 * tests/regression.at (Invalid inputs): Adjust to the recent
9062 messages.
9063
90642002-11-06 Akim Demaille <akim@epita.fr>
9065
9066 Restore --no-lines.
9067 Reported by Jim Kent.
9068
9069 * data/c.m4 (b4_syncline): New.
9070 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
9071 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
9072 * src/output.c (user_actions_output): Likewise.
9073 (prepare): Define 'b4_synclines_flag'.
9074 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
9075
90762002-11-06 Akim Demaille <akim@epita.fr>
9077
9078 * src/main.c (main): Free `infile'.
9079 * src/scan-gram.l (handle_syncline): New.
9080 Recognize `#line'.
9081 * src/output.c (user_actions_output, symbol_destructors_output)
9082 (symbol_printers_output): Use the location's file name, not
9083 infile.
9084 * src/reader.c (prologue_augment, epilogue_set): Likewise.
9085
90862002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9087
9088 * src/tables.c (matching_state): Don't allow states to match if
9089 either has GLR conflict entries.
9090
90912002-11-05 Paul Eggert <eggert@twinsun.com>
9092
9093 * src/scan-gram.l: Use more accurate diagnostics, e.g.
9094 "integer out of range" rather than "invalid value".
9095 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
9096 accordingly.
9097
9098 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
9099 Also, remove one static variable in the scanner.
9100
9101 * src/scan-gram.l (braces_level): Now auto, not static.
9102 Initialize to zero if the compiler is being picky.
9103 (INITIAL): Clear braces_level instead of incrementing it.
9104 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
9105 as POSIX 1003.1-2001 requires.
9106 * src/system.h (IF_LINT): New macro, taken from coreutils.
9107 * configure.ac: Define "lint" if --enable-gcc-warnings.
9108
91092002-11-05 Akim Demaille <akim@epita.fr>
9110
9111 * src/scan-gram.l: When it starts with `%', complain about the
9112 whole directive, not just that `invalid character: %'.
9113
91142002-11-04 Akim Demaille <akim@epita.fr>
9115
9116 * Makefile.maint: Update from Autoconf.
9117 (update, cvs-update, po-update, do-po-update): New.
9118
91192002-11-04 Akim Demaille <akim@epita.fr>
9120
9121 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
9122 and yyerror.
9123 Have yyerror `use' its arguments.
9124 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
9125 returns true when location & yacc & pure & parse-param.
9126 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
9127
91282002-11-04 Akim Demaille <akim@epita.fr>
9129
9130 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
9131 clashes.
9132 * src/scan-gram.l: Use [\'] instead of ['] to pacify
9133 font-lock-mode.
9134 Use complain_at.
9135 Use quote, not quote_n since LOCATION_PRINT no longer uses the
9136 slot 0.
9137
91382002-11-03 Paul Eggert <eggert@twinsun.com>
9139
9140 * src/reader.c (get_merge_function, grammar_current_rule_check):
9141 Use consistent diagnostics for reporting type name clashes.
9142 Quote the types with <>, for consistency with Yacc.
9143 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
9144
91452002-11-03 Akim Demaille <akim@epita.fr>
9146
9147 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
9148 New.
9149 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
9150 (b4_parse_param): Remove.
9151 Use b4_identification.
9152 Propagate b4_pure_args where needed to pass them to yyerror.
9153 * data/glr.m4 (b4_parse_param): Remove.
9154 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
9155 (b4_lpure_formals): New.
9156 Use b4_identification.
9157 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
9158 b4_user_formals and b4_user_args.
9159 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
9160 (yyreportAmbiguity): When using a pure parser, also need
9161 the location, and the parse-params.
9162 Adjust callers.
9163 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
9164 When using a pure parser, also need the parse-params.
9165 Adjust callers.
9166 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
9167 (%pure-parser + %parse-param) LALR and GLR parsers.
9168 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
9169 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
9170 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
9171 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
9172 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
9173 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
9174 * doc/bison.texinfo: Untabify the whole file.
9175 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
9176 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
9177 (Error Reporting): Adjust to these new directives.
9178 Document %error-verbose, deprecate YYERROR_VERBOSE.
9179
91802002-11-03 Akim Demaille <akim@epita.fr>
9181
9182 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
9183 AT_CHECK_CALC_GLR invocations to use % directives, instead of
9184 command line options.
9185 * tests/cxx-type.at: Formatting changes.
9186
91872002-11-03 Paul Eggert <eggert@twinsun.com>
9188
9189 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
9190 to count columns correctly, and to check for invalid inputs.
9191
9192 Use mbsnwidth to count columns correctly. Account for tabs, too.
9193 Include mbswidth.h.
9194 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
9195 (extend_location): New function.
9196 (YY_LINES): Remove.
9197
9198 Handle CRLF in C code rather than in Lex code.
9199 (YY_INPUT): New macro.
9200 (no_cr_read): New function.
9201
9202 Scan UCNs, even though we don't fully handle them yet.
9203 (convert_ucn_to_byte): New function.
9204
9205 Handle backslash-newline correctly in C code.
9206 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
9207 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
9208 all uses changed.
9209 (tag, splice): New EREs. Do not allow NUL or newline in tags.
9210 Use {splice} wherever C allows backslash-newline.
9211 YY_STEP after space, newline, vertical-tab.
9212 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9213
9214 (letter, id): Don't assume ASCII; e.g., spell out a-z.
9215
9216 ({int}, handle_action_dollar, handle_action_at): Check for integer
9217 overflow.
9218
9219 (YY_STEP): Omit trailing semicolon, so that it's more like C.
9220
9221 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
9222 as well as \000. Check for UCHAR_MAX, not 255.
9223 Allow \x with an arbitrary positive number of digits, as in C.
9224 Check for overflow here.
9225 Allow \? and UCNs, for compatibility with C.
9226
9227 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
9228 with quote slot used by complain_at.
9229
9230 * tests/input.at: Add tests for backslash-newline, m4 quotes
9231 in symbols, long literals, and funny escapes in strings.
9232
9233 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
9234 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
9235 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
9236 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
9237 * m4/mbswidth.m4: New file, from GNU coreutils.
9238
9239 * doc/bison.texinfo (Grammar Outline): Document // comments.
9240 (Symbols): Document that trigraphs have no special meaning in Bison,
9241 nor is backslash-newline allowed.
9242 (Actions): Document that trigraphs have no special meaning.
9243
9244 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
9245 no longer used.
9246
92472002-11-02 Paul Eggert <eggert@twinsun.com>
9248
9249 * src/reader.c: Don't include quote.h; not needed.
9250 (get_merge_function): Reword warning to be consistent with
9251 type clash diagnostic in grammar_current_rule_check.
9252
9253 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
9254 bug in trigraph handling.
9255
9256 * src/output.c (prepare_symbols): When printing token names,
9257 escape "[" as "@<:@" and likewise for "]".
9258
9259 * src/system.h (errno): Remove declaration, as we are now
9260 assuming C89 or better, and C89 guarantees errno.
9261
92622002-10-30 Paul Eggert <eggert@twinsun.com>
9263
9264 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
9265 Check for close failures.
9266 * src/files.h (xfclose): Return void, not int, since it always
9267 returned zero.
9268 * src/files.c (xfclose): Likewise. Report I/O error if ferror
9269 indicates one.
9270 * src/output.c (output_skeleton): Use xfclose rather than fclose
9271 and ferror. xfclose now checks ferror.
9272
9273 * data/glr.c (YYLEFTMOST_STATE): Remove.
9274 (yyreportTree): Use a stack-based leftmost state. This avoids
9275 our continuing battles with bogus warnings about initializers.
9276
92772002-10-30 Akim Demaille <akim@epita.fr>
9278
9279 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
9280 #if.
9281
92822002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9283
9284 * tests/glr-regr1.at: New test for reported regressions.
9285 * tests/testsuite.at: Add glr-regr1.at test.
9286 * tests/Makefile.am: Add glr-regr1.at test.
9287
92882002-10-24 Paul Eggert <eggert@twinsun.com>
9289
9290 Version 1.75a.
9291
9292 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
9293 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
9294 we use malloc. Don't assume 'A' through 'Z' are contiguous.
9295 Don't assume strdup exists; POSIX says its an XSI extension.
9296 Check for buffer overflow on input.
9297
92982002-10-24 Akim Demaille <akim@epita.fr>
9299
9300 * src/output.c (output_skeleton): Don't disable M4sugar comments
9301 too soon: it results in comments being expanded.
9302 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
9303 first output.
9304
93052002-10-24 Akim Demaille <akim@epita.fr>
9306
9307 * data/yacc.c (m4_int_type): New.
9308 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
9309 char' as only yacc.c wants K&R portability.
9310 * data/glr.c (yysigned_char): Remove.
9311 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
9312 Reported by Quoc Peyrot.
9313
93142002-10-23 Paul Eggert <eggert@twinsun.com>
9315
9316 * src/main.c (main): With --trace=time, report times even if a
9317 non-fatal error occurs. Formerly, the times were reported in some
9318 such cases but not in others.
9319 * src/reader.c (reader): Just return if a complaint has been issued,
9320 instead of exiting, so that 'main' can report times.
9321
93222002-10-22 Akim Demaille <akim@epita.fr>
9323
9324 * src/system.h: Include sys/types.
9325 Reported by Bert Deknuydt.
9326
93272002-10-23 Paul Eggert <eggert@twinsun.com>
9328
9329 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
9330 Suggested by Art Haas.
9331
93322002-10-22 Paul Eggert <eggert@twinsun.com>
9333
9334 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
9335 decl; not needed any more.
9336 * src/main.c (main): Use return to exit, undoing yesterday's change.
9337 The last OS that we could find where this wouldn't work is
9338 SunOS 3.5, and that's too old to worry about now.
9339
9340 * data/glr.c (struct yyltype): Define members even when not
9341 doing locations. This is more consistent with yacc.c, and it
9342 works around the following bug reports:
9343 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
9344 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
9345
9346 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
9347 @acronym consistently. Standardize on "Yacc" instead of "YACC",
9348 "Algol" instead of "ALGOL". Give a bit more history about BNF.
9349
93502002-10-22 Akim Demaille <akim@epita.fr>
9351
9352 * data/README: New.
9353
93542002-10-21 Paul Eggert <eggert@twinsun.com>
9355
9356 Be consistent about 'bool'; the old code used an enum in one
9357 module and an int in another, and this violates the C standard.
9358 * m4/stdbool.m4: New file, from coreutils 4.5.3.
9359 * configure.ac (AC_HEADER_STDBOOL): Add.
9360 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
9361 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
9362 * src/symtab.c (hash_compare_symbol_t): Likewise.
9363 * src/system.h (bool, false, true): Use a definition consistent
9364 with ../lib/hash.c. All uses changed.
9365
9366 * src/complain.c (warning_issued): Renamed from warn_message_count,
9367 so that we needn't worry about integer overflow (!).
9368 Now of type bool. All uses changed.
9369 (complaint_issued): Renamed from complain_message_count; likewise.
9370
9371 * src/main.c (main): Use exit to exit with failure.
9372
9373 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
9374 rather than 1 and 0.
9375 * src/main.c (main): Likewise.
9376 * src/getargs.c (getargs): Likewise.
9377 * src/reader.c (reader): Likewise.
9378
9379 * src/getarg.c (getargs): Remove duplicate code for
9380 "Try `bison --help'".
9381
9382 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
9383 What was that "2" for?
9384
9385 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
9386 * src/getargs.c (usage): Likewise.
9387
9388 * src/getargs.c (getargs): When there are too few operands, report
9389 the last one. When there are too many, report the first extra
9390 one. This is how diffutils does it.
9391
93922002-10-20 Paul Eggert <eggert@twinsun.com>
9393
9394 Remove K&R vestiges.
9395 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
9396 * src/complain.c (VA_START): Remove. Assume prototypes.
9397 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
9398 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
9399 fatal): Assume prototypes.
9400 * src/complain.h: Assume prototypes.
9401 * src/system.h (PARAMS): Remove.
9402 Include <limits.h> unconditionally, since it's guaranteeed even
9403 for a freestanding C89 compiler.
9404 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
9405 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
9406
94072002-10-20 Akim Demaille <akim@epita.fr>
9408
9409 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
9410 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
9411 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
9412 (yyresolveStates, yyresolveAction, yyresolveStack)
9413 (yyprocessOneStack): Use them.
9414 (yy_reduce_print): New.
9415 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
9416
94172002-10-20 Akim Demaille <akim@epita.fr>
9418
9419 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
9420 arguments and output `void'.
9421 (b4_c_function): Rename as...
9422 (b4_c_function_def): this.
9423 (b4_c_function_decl, b4_c_ansi_function_def)
9424 (b4_c_ansi_function_decl): New.
9425 Change the interpretation of the arguments: before `int, foo', now
9426 `int foo, foo'.
9427 * data/yacc.c (yyparse): Prototype and define thanks to these.
9428 Adjust b4_c_function_def uses.
9429 * data/glr.c (yyparse): Likewise, but ANSI only.
9430
94312002-10-20 Akim Demaille <akim@epita.fr>
9432
9433 * src/output.c (prepare): Move the definition of `tokens_number',
9434 `nterms_number', `undef_token_number', `user_token_number_max'
9435 to...
9436 (prepare_tokens): Here.
9437 (prepare_tokens): Rename as...
9438 (prepare_symbols): this.
9439 (prepare): Move the definition of `rules_number' to...
9440 (prepare_rules): here.
9441 (prepare): Move the definition of `last', `final_state_number',
9442 `states_number' to...
9443 (prepare_states): here.
9444 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
9445
94462002-10-20 Akim Demaille <akim@epita.fr>
9447
9448 * src/tables.h, src/tables.c, src/output.c: Comment changes.
9449
94502002-10-20 Akim Demaille <akim@epita.fr>
9451
9452 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
9453 * data/c.m4: here.
9454
94552002-10-20 Akim Demaille <akim@epita.fr>
9456
9457 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
9458 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
9459 `pair'.
9460 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
9461 `name' to...
9462 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
9463 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
9464 These.
9465
94662002-10-19 Paul Eggert <eggert@twinsun.com>
9467
9468 Do not create a temporary file, as that involves security and
9469 cleanup headaches. Instead, use a pair of pipes.
9470 Derived from a suggestion by Florian Krohm.
9471 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
9472 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
9473 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
9474 (BISON_PREREQ_SUBPIPE): Add.
9475 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
9476 Add subpipe.h, subpipe.c.
9477 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
9478 * po/POTFILES.in: Add lib/subpipe.c.
9479 * src/output.c: Include "subpipe.h".
9480 (m4_invoke): Remove decl.
9481 (scan_skel): New decl.
9482 (output_skeleton): Use pipe rather than temporary file for m4 input.
9483 Check that m4sugar.m4 is readable, to avoid deadlock.
9484 Check for pipe I/O error.
9485 * src/scan-skel.l (readpipe): Remove decl.
9486 (scan_skel): New function, to be used in place of m4_invoke.
9487 Read from stream rather than file.
9488
9489 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
9490 float, as this generates a warning on Solaris 8 + GCC 3.2 with
9491 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
9492 this generates a more-accurate value anyway.
9493
9494 * lib/timevar.c (timervar_accumulate): Rename locals to
9495 avoid confusion with similarly-named more-global.
9496 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
9497
9498 * src/output.c (prepare): Use xstrdup to convert char const *
9499 to char *, to avoid GCC warning.
9500
95012002-10-19 Akim Demaille <akim@epita.fr>
9502
9503 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
9504 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
9505 Use them to have `calc.y' ready for %pure-parser.
9506 * data/yacc.c (YYLEX): Pass a yylex return type to
9507 b4_c_function_call.
9508
95092002-10-19 Akim Demaille <akim@epita.fr>
9510
9511 Prototype support of %lex-param and %parse-param.
9512
9513 * src/parse-gram.y: Add the definition of the %lex-param and
9514 %parse-param tokens, plus their rules.
9515 Drop the `_' version of %glr-parser.
9516 Add the "," token.
9517 * src/scan-gram.l (INITIAL): Scan them.
9518 * src/muscle_tab.c: Comment changes.
9519 (muscle_insert, muscle_find): Rename `pair' as `probe'.
9520 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
9521 (muscle_entry_s): The `value' member is no longer const.
9522 Adjust all dependencies.
9523 * src/muscle_tab.c (muscle_init): Adjust: use
9524 MUSCLE_INSERT_STRING.
9525 Initialize the obstack earlier.
9526 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
9527 (muscle_pair_list_grow): New.
9528 * data/c.m4 (b4_c_function_call, b4_c_args): New.
9529 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
9530 * tests/calc.at: Use %locations, not --locations.
9531 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
9532
95332002-10-19 Akim Demaille <akim@epita.fr>
9534
9535 * src/getargs.c (usage): Take status as argument and exit
9536 accordingly.
9537 Report the traditional `Try ... --help' message when status != 0.
9538 (usage, version): Don't take a FILE * as arg, it is pointless.
9539 (getargs): When there is an incorrect number of arguments, make it
9540 an error, and report it GNUlically thanks to `usage ()'.
9541
95422002-10-18 Paul Eggert <eggert@twinsun.com>
9543
9544 * data/glr.c (yyreportParseError): Don't assume that sprintf
9545 yields the length of the printed string, as this is not true
9546 on SunOS 4.1.4. Reported by Peter Klein.
9547
9548 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
9549 * tests/conflicts.at (%nonassoc and eof): Likewise.
9550 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
9551
95522002-10-17 Akim Demaille <akim@epita.fr>
9553
9554 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
9555 * src/getargs.c (trace_types, trace_args): Adjust.
9556 * src/reader.c (grammar_current_rule_prec_set)
9557 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
9558 Standardize error messages.
9559 And s/@prec/%prec/!
9560 (reader): Use trace_flag to enable scanner/parser debugging,
9561 instead of an adhoc scheme.
9562 * src/scan-gram.l: Remove trailing debugging code.
9563
95642002-10-16 Paul Eggert <eggert@twinsun.com>
9565
9566 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
9567 MUSCLE_TAB_H.
9568
9569 * NEWS: Officially drop support for building Bison with K&R C,
9570 since it didn't work anyway and it's not worth worrying about.
9571 * Makefile.maint (wget_files): Remove ansi2knr.c.
9572 (ansi2knr.c-url_prefix): Remove.
9573 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
9574 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9575 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9576
95772002-10-15 Paul Eggert <eggert@twinsun.com>
9578
9579 Stop using the "enum_" trick for K&R-style function definitions;
9580 it confused me, and I was the author! Instead, assume that people
9581 who want to use K&R C compilers (when using these modules in GCC,
9582 perhaps?) will run ansi2knr.
9583
9584 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
9585 All uses of "enum_" changed to "enum ".
9586 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9587 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
9588
9589 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
9590 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
9591 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
9592 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
9593 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
9594 abitset_not, abitset_ones, abitset_or, abitset_or_and,
9595 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
9596 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
9597 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
9598 Use function prototypes; this removes the need for declaring
9599 static functions simply to provide their prototypes.
9600 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
9601 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
9602 bitset_count_, bitset_create, bitset_dump, bitset_first,
9603 bitset_free, bitset_init, bitset_last, bitset_next,
9604 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
9605 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
9606 bitset_print, bitset_release_memory, bitset_toggle_,
9607 bitset_type_choose, bitset_type_get, bitset_type_name_get,
9608 debug_bitset): Likewise.
9609 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
9610 * lib/bitset_stats.c (bitset_log_histogram_print,
9611 bitset_percent_histogram_print, bitset_stats_and,
9612 bitset_stats_and_cmp, bitset_stats_and_or,
9613 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
9614 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
9615 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
9616 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
9617 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
9618 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
9619 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
9620 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
9621 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
9622 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
9623 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
9624 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
9625 bitset_stats_zero): Likewise.
9626 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9627 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9628 bitsetv_dump, debug_bitsetv): Likewise.
9629 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
9630 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
9631 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
9632 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
9633 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
9634 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
9635 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
9636 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
9637 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
9638 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
9639 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
9640 Likewise.
9641 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
9642 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
9643 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
9644 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
9645 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
9646 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
9647 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
9648 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
9649 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
9650 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
9651 lbitset_xor_cmp, lbitset_zero): Likewise.
9652
96532002-10-14 Akim Demaille <akim@epita.fr>
9654
9655 Version 1.75.
9656
96572002-10-14 Akim Demaille <akim@epita.fr>
9658
9659 * tests/Makefile.am (maintainer-check-posix): New.
9660
96612002-10-14 Akim Demaille <akim@epita.fr>
9662
9663 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
9664 member.
9665
96662002-10-14 Akim Demaille <akim@epita.fr>
9667
9668 * src/tables.c (table_ninf_remap): base -> tab.
9669 Reported by Matt Rosing.
9670
96712002-10-14 Paul Eggert <eggert@twinsun.com>
9672
9673 * tests/action.at, tests/calc.at, tests/conflicts.at,
9674 tests/cxx-type.at, tests/headers.at, tests/input.at,
9675 tests/regression.at, tests/synclines.at, tests/torture.at:
9676 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
9677 so that the tests still work even if POSIXLY_CORRECT is set.
9678 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
9679
9680 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
9681 for portability to K&R hosts. Fix typo: signed char is guaranteed
9682 only to 127, not to 128.
9683 * data/glr.c (yysigned_char): New type.
9684 * data/yacc.c (yysigned_char): Likewise.
9685 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
9686
96872002-10-13 Paul Eggert <eggert@twinsun.com>
9688
9689 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
9690 true due to limited range of data type" warning from GCC.
9691
9692 * data/c.m4 (b4_token_defines): Protect against double-inclusion
9693 by wrapping enum yytokentype's definition inside #ifndef
9694 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
9695
96962002-10-13 Akim Demaille <akim@epita.fr>
9697
9698 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
9699 Un yy- yyrhs to avoid the name clash with the global YYRHS.
9700
97012002-10-13 Akim Demaille <akim@epita.fr>
9702
9703 * Makefile.maint: Update from Autoconf 2.54.
9704 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
9705
97062002-10-13 Akim Demaille <akim@epita.fr>
9707
9708 * src/print.c (print_state): Separate the list of solved conflicts
9709 from the other items.
9710 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
9711
97122002-10-13 Akim Demaille <akim@epita.fr>
9713
9714 Let nondeterministic skeletons be usable with deterministic
9715 tables.
9716
9717 With the patch, GAWK compiled by GCC without -O2 passes its test
9718 suite using a GLR parser driven by LALR tables. It fails with -O2
9719 because `struct stat' gives two different answers on my machine:
9720 88 (definition of an auto var) and later 96 (memset on this var).
9721 Hence the stack is badly corrumpted. The headers inclusion is to
9722 blame: if I move the awk.h inclusion before GLR's system header
9723 inclusion, the two struct stat have the same size.
9724
9725 * src/tables.c (pack_table): Always create conflict_table.
9726 (token_actions): Always create conflict_list.
9727 * data/glr.c (YYFLAG): Remove, unused.
9728
97292002-10-13 Akim Demaille <akim@epita.fr>
9730
9731 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
9732 (O0FLAGS): New.
9733 (VALGRIND, GXX): New.
9734 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
9735 * tests/bison.in: Run $PREBISON a pre-command.
9736 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
9737 (maintainer-check-g++): New.
9738 * Makefile.am (maintainer-check): New.
9739
97402002-10-13 Akim Demaille <akim@epita.fr>
9741
9742 * data/glr.c: Formatting changes.
9743 Tweak some trace messages to match yacc.c's.
9744
97452002-10-13 Akim Demaille <akim@epita.fr>
9746
9747 GLR parsers sometimes raise parse errors instead of performing the
9748 default reduction.
9749 Reported by Charles-Henry de Boysson.
9750
9751 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
9752 check the length of the traces when %glr.
9753 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
9754 GLR's traces.
9755 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
9756 Test GLR parsers.
9757 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
9758 (yyltype): Remove the yy prefix from the member names.
9759 (yytable): Complete its comment.
9760 (yygetLRActions): Map error action number from YYTABLE from
9761 YYTABLE_NINF to 0.
9762 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
9763 (which was a bug: it should have been YYTABEL_NINF, and yet it was
9764 not satisfying as we could compare an YYACTION computed from
9765 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
9766 only value for error actions.
9767 (yyreportParseError): In verbose parse error messages, don't issue
9768 `error' in the list of expected tokens.
9769 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
9770 next action to perform to match glr.c's decoding.
9771 (yytable): Complete its comment.
9772
97732002-10-13 Paul Eggert <eggert@twinsun.com>
9774
9775 Fix problem reported by Henrik Grubbstroem in
9776 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
9777 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
9778 because the Bison parser reads the second action before reducing
9779 the first one.
9780 * src/scan-gram.l (rule_length): New static var.
9781 Use it to keep track of the rule length in the scanner, since
9782 we can't expect the parser to be in lock-step sync with the scanner.
9783 (handle_action_dollar, handle_action_at): Use this var.
9784 * tests/actions.at (Exotic Dollars): Test for the problem.
9785
97862002-10-12 Paul Eggert <eggert@twinsun.com>
9787
9788 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
9789 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
9790 Include <sys/time.h> when checking for clock_t and struct tms.
9791 Use same include order as source.
9792 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
9793 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
9794
9795 * lib/timevar.c: Update copyright date and clarify comments.
9796 (get_time) [IN_GCC]: Keep the GCC version for reference.
9797
9798 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
9799 GCC version as of today, then merge Bison's changes.
9800 Change "GCC" to "Bison" in copyright notice. timevar.def's
9801 author is Akim, so change that too.
9802
9803 * src/reader.c (grammar_current_rule_check):
9804 Don't worry about the default action if $$ is untyped.
9805 Prevents bogus warnings reported by Jim Gifford in
9806 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
9807
9808 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
9809 * data/glr.c, data/lalr1.cc, data/yacc.c:
9810 Output token definitions before the first part of user declarations.
9811 Fixes compatibility problem reported by Jim Gifford for kbd in
9812 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
9813
98142002-10-11 Paul Eggert <eggert@twinsun.com>
9815
9816 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
9817 (yyparse): here. This undoes some of the 2002-07-25 change.
9818 Compatibility problem reported by Ralf S. Engelschall with
9819 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
9820
98212002-10-11 Akim Demaille <akim@epita.fr>
9822
9823 * tests/regression.at Characters Escapes): New.
9824 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
9825 characters.
9826 Reported by Jan Nieuwenhuizen.
9827
98282002-10-11 Akim Demaille <akim@epita.fr>
9829
9830 * po/id.po: New.
9831
98322002-10-10 Paul Eggert <eggert@twinsun.com>
9833
9834 Portability fixes for bitsets; this also avoids several GCC
9835 warnings.
9836
9837 * lib/abitset.c: Include <stddef.h>, for offsetof.
9838 * lib/lbitset.c: Likewise.
9839
9840 * lib/abitset.c (abitset_bytes): Return a size that is aligned
9841 properly for vectors of objects. Do not assume that adding a
9842 header size to a multiple of a word size yields a value that is
9843 properly aligned for the whole union.
9844 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9845
9846 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
9847 unique names for structures.
9848 * lib/ebitset.c (ebitset_bytes): Likewise.
9849 * lib/lbitset.c (lbitset_bytes): Likewise.
9850
9851 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
9852 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
9853 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
9854 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
9855 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
9856 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
9857 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
9858 to improve the type-checking that GCC can do.
9859 * lib/bitset.c (bitset_op4_cmp): Likewise.
9860 * lib/bitset_stats.c (bitset_stats_count,
9861 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
9862 bitset_stats_copy, bitset_stats_disjoint_p,
9863 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
9864 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
9865 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
9866 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
9867 bitset_stats_and_or_cmp, bitset_stats_andn_or,
9868 bitset_stats_andn_or_cmp, bitset_stats_or_and,
9869 bitset_stats_or_and_cmp): Likewise.
9870 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
9871 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
9872 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
9873 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
9874
9875 * lib/abitset.h: Include bitset.h, not bbitset.h.
9876 * lib/ebitset.h: Likewise.
9877 * lib/lbitset.h: Likewise.
9878
9879 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
9880 All instances of parameters of type enum bitset_opts are now of
9881 type enum_bitset_opts, to conform to the C Standard, and similarly
9882 for enum_bitset_type.
9883 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9884 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
9885
9886 Do not use "struct bitset_struct" to mean different things in
9887 different modules. Not only is this confusing, it violates
9888 the C Standard, which requires that structure types in different
9889 modules must be compatible if one is to be passed to the other.
9890 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
9891 All instances of "struct bitset_struct *" replaced with "bitset".
9892 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
9893 (union bitset_union, struct abitset_struct, struct ebitset_struct,
9894 struct lbitset_struct, struct bitset_stats_struct): New types.
9895 All uses of struct bitset_struct changed to union bitset_union,
9896 etc.
9897 * lib/abitset.c (struct abitset_struct, abitset,
9898 struct bitset_struct): Remove.
9899 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
9900 struct bitset_struct): Remove.
9901 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
9902 bitset_struct): Remove.
9903 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
9904 Likewise.
9905
9906 Do not call a function of type T using a call that assumes the
9907 function is of a different type U. Standard C requires that a
9908 function must be called with a type that is compatible with its
9909 definition.
9910 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9911 New decls.
9912 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9913 New functions.
9914 * lib/ebitset.c (PFV): Remove.
9915 * lib/lbitset.c (PFV): Likewise.
9916 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
9917 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
9918 decls.
9919 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
9920 (ebitset_vtable): Use them.
9921 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
9922 lbitset_xor): New functions.
9923 (lbitset_vtable): Use them.
9924
9925 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
9926 Declare.
9927
9928 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
9929 GCC warning.
9930 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
9931 Use offsetof, for simplicity.
9932
99332002-10-06 Paul Eggert <eggert@twinsun.com>
9934
9935 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
9936 the same width as int. This reapplies a hunk of the 2002-08-12 patch
9937 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
9938 which was inadvertently undone by the 2002-09-30 patch.
9939 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
9940 the same width as int.
9941
99422002-10-04 Paul Eggert <eggert@twinsun.com>
9943
9944 Version 1.50.
9945
9946 * configure.ac (AC_INIT), NEWS: Increment version number.
9947
9948 * doc/bison.texinfo: Minor spelling, grammar, and white space
9949 fixes.
9950 (Symbols): Mention that any negative value returned from yylex
9951 signifies end-of-input. Warn about negative chars. Mention
9952 the portable Standard C character set.
9953
9954 The GNU coding standard says CFLAGS and YFLAGS are reserved
9955 for the installer to set.
9956 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
9957 * src/Makefile.am (AM_CFLAGS): Likewise.
9958 (AM_YFLAGS): Renamed from YFLAGS.
9959
9960 Fix some MAX and MIN problems.
9961 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
9962 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
9963 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
9964 * src/reader.c (reader): Use it.
9965
9966 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
9967 POSIX 1003.1-2001 has removed fgrep.
9968
99692002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
9970
9971 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
9972 interpreted as signed.
9973 * lib/ebitset.c (ebitset_list): Fix bug.
9974
99752002-10-01 Paul Eggert <eggert@twinsun.com>
9976
9977 More fixes for 64-bit hosts and large bitsets.
9978
9979 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
9980 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
9981 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
9982 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
9983 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
9984 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
9985 bitset_count_): Likewise.
9986 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
9987 bitset_first, bitset_last): Likewise.
9988 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
9989 bitset_stats_list_reverse, bitset_stats_size,
9990 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
9991 Likewise.
9992 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9993 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9994 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9995 bitsetv_reflexive_transitive_closure): Likewise.
9996 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
9997 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
9998 Likewise.
9999 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
10000 Likewise.
10001
10002 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
10003 Use size_t, not unsigned int, to count bytes.
10004 * lib/abitset.h (abitset_bytes): Likewise.
10005 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
10006 Likewise.
10007 * lib/bitset.h (bitset_bytes): Likewise.
10008 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
10009 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
10010 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10011 * lib/ebitset.c (ebitset_bytes): Likewise.
10012 * lib/ebitset.h (ebitset_bytes): Likewise.
10013 * lib/lbitset.c (lbitset_bytes): Likewise.
10014 * lib/lbitset.h (lbitset_bytes): Likewise.
10015
10016 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
10017 abitset_subset_p, abitset_disjoint_p, abitset_and,
10018 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
10019 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
10020 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
10021 abitset_or_and, abitset_or_and_cmp):
10022 Use bitset_windex instead of unsigned int.
10023 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
10024 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
10025 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
10026 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
10027 Likewise.
10028 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
10029
10030 * lib/bitset.c (bitset_print):
10031 Use proper printf formats for widths of integer types.
10032 * lib/bitset_stats.c (bitset_percent_histogram_print,
10033 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
10034 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10035 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
10036 * lib/lbitset.c (lbitset_bytes): Likewise.
10037
10038 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
10039 BITSET_SIZE_MAX): New macros.
10040 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
10041 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
10042 to BITSET_WINDEX_MAX.
10043
10044 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
10045 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
10046 since we now return the bitset_bindex type (not int).
10047
10048 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
10049 when computing sizes.
10050 * lib/ebitset.c (ebitset_elts_grow): Likewise.
10051
10052 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
10053 and avoid cast to unsigned.
10054
100552002-09-30 Akim Demaille <akim@epita.fr>
10056
10057 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10058 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
10059 Updates from Michael Hayes.
10060
100612002-09-30 Art Haas <ahaas@neosoft.com>
10062
10063 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
10064 invocations.
10065 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
10066 defined.
10067
100682002-09-27 Akim Demaille <akim@epita.fr>
10069
10070 Version 1.49c.
10071
100722002-09-27 Akim Demaille <akim@epita.fr>
10073
10074 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
10075 (Because of AC_LIBSOURCE).
10076
100772002-09-27 Akim Demaille <akim@epita.fr>
10078
10079 Playing with Autoscan.
10080
10081 * configure.ac: Remove the old LIBOBJ tweaks.
10082 (AC_REPLACE_FUNCS): Add strrchr and strtol.
10083 * lib/strrchr.c: New.
10084 * lib/strtol.c: New, from the Coreutils 4.5.1.
10085
100862002-09-27 Akim Demaille <akim@epita.fr>
10087
10088 Playing with Autoscan.
10089
10090 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
10091 * lib/Makefile.am (libbison_a_SOURCES): No longer include
10092 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
10093 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
10094 Coreutils 4.5.1.
10095
100962002-09-24 Akim Demaille <akim@epita.fr>
10097
10098 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
10099 (Frequently Asked Questions, Parser Stack Overflow): New.
10100
101012002-09-13 Akim Demaille <akim@epita.fr>
10102
10103 Playing with autoscan.
10104
10105 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
10106 * src/files.c (skeleton_find): Remove, unused.
10107 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
10108 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
10109
101102002-09-13 Akim Demaille <akim@epita.fr>
10111
10112 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
10113 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
10114
101152002-09-13 Akim Demaille <akim@epita.fr>
10116
10117 * configure.ac: Require 2.54.
10118 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
10119 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
10120 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
10121 Remove, provided by Autoconf macros.
10122
101232002-09-12 Akim Demaille <akim@epita.fr>
10124
10125 * m4/prereq.m4: Update, from Coreutils 4.5.1.
10126
101272002-09-12 Akim Demaille <akim@epita.fr>
10128
10129 * m4/prereq.m4: Update, from Fileutils 4.1.5.
10130 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
10131 Reported by Martin Mokrejs.
10132
101332002-09-10 Akim Demaille <akim@epita.fr>
10134
10135 * src/parse-gram.y: Associate a human readable string to each
10136 token type.
10137 * tests/regression.at (Invalid inputs): Adjust.
10138
101392002-09-10 Gary V. Vaughan <gary@gnu.org>
10140
10141 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
10142 with an Autoconf-2.5x style configure.ac.
10143
101442002-09-06 Paul Eggert <eggert@twinsun.com>
10145
10146 * doc/bison.texinfo (Conditions): Make explicit that the GPL
10147 exception applies only to yacc.c. This is a modification of a
10148 patch originally suggested by Akim Demaille.
10149
101502002-09-06 Akim Demaille <akim@epita.fr>
10151
10152 * data/c.m4 (b4_copyright): Move the GPL exception comment from
10153 here to...
10154 * data/yacc.c: here.
10155
10156 * data/lalr1.cc (struct yyltype): Don't define it, since we use
10157 LocationType.
10158 (b4_ltype): Default to yy::Location from location.hh.
10159
101602002-09-04 Jim Meyering <jim@meyering.net>
10161
10162 * data/yacc.c: Guard the declaration of yytoknum also with
10163 `#ifdef YYPRINT', so it is declared only when used.
10164
101652002-09-04 Akim Demaille <akim@epita.fr>
10166
10167 * configure.in: Rename as...
10168 * configure.ac: this.
10169 Bump to 1.49c.
10170
101712002-09-04 Akim Demaille <akim@epita.fr>
10172
10173 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
10174 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
10175 translate maintainer only messages.
10176
101772002-08-12 Paul Eggert <eggert@twinsun.com>
10178
10179 Version 1.49b.
10180
10181 * Makefile.am (SUBDIRS): Remove intl.
10182 (DISTCLEANFILES): Remove.
10183 * NEWS: Mention that GNU M4 is now required. Clarify what is
10184 meant by "larger grammars". Mention the pt_BR translation.
10185 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
10186 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
10187 Bump version from 0.11.2 to 0.11.5.
10188 (BISON_PREREQ_STAGE): Remove.
10189 (AM_GNU_GETTEXT): Use external gettext.
10190 (AC_OUTPUT): Remove intl/Makefile.
10191
10192 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
10193
10194 * data/glr.c: Include string.h, for strlen.
10195 (yyreportParseError): Use size_t for yysize.
10196 (yy_yypstack): No longer nested inside yypstates, as nested
10197 functions are not portable. Do not assume size_t is the
10198 same width as int.
10199 (yypstates): Do not assume that ptrdiff_t is the same width
10200 as int, and similarly for yyposn and YYINDEX.
10201
10202 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
10203
10204 * lib/Makefile.am (INCLUDES): Do not include from the intl
10205 directory, which has been removed.
10206 * src/Makefile.am (INCLUDES): Likewise.
10207
10208 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
10209 (bitsets_sources, additional_bitsets_sources, timevars_sources):
10210 New vars.
10211
10212 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
10213 * tests/Makefile.am (EXTRA_DIST): Likewise.
10214
10215 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
10216 Do not assume that bitset_windex is the same width as unsigned.
10217
10218 * lib/abitset.c (abitset_unused_clear): Do not assume that
10219 bitset_word is the same width as int.
10220 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
10221 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
10222 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
10223 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
10224 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
10225
10226 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
10227 portability to one's complement hosts!).
10228 * lib/ebitset.c (ebitset_op1): Likewise.
10229 * lib/lbitset.c (lbitset_op1): Likewise.
10230
10231 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
10232 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10233 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
10234 Sync with fileutils.
10235 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
10236 lib/gettext.h: Sync with diffutils.
10237
10238 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
10239 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
10240
10241 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
10242 PROTOTYPES to check for prototypes, and "defined __STDC__" to
10243 check for void *.
10244
10245 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
10246 size_t; the old version tried to do this but casted improperly.
10247 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
10248 (bitset_test): Now returns int, not unsigned long.
10249
10250 * lib/bitset_stats.c: Include "gettext.h".
10251 (_): New macro.
10252 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
10253 name locals "index", as it generates unnecessary warnings on some
10254 hosts that have an "index" function.
10255
10256 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
10257 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
10258 they need translation.
10259 * src/LR0.c (state_list_append, new_itemsets, get_state,
10260 append_states, generate_states): Likewise.
10261 * src/assoc.c (assoc_to_string): Likewise.
10262 * src/closure.c (print_closure, set_firsts, closure): Likewise.
10263 * src/gram.c (grammar_dump): Likewise.
10264 * src/injections.c (injections_compute): Likewise.
10265 * src/lalr.c (lookaheads_print): Likewise.
10266 * src/relation.c (relation_transpose): Likewise.
10267 * src/scan-gram.l: Likewise.
10268 * src/tables.c (table_grow, pack_vector): Likewise.
10269
10270 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
10271 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
10272 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
10273 * m4/mbstate_t.m4: Sync with fileutils.
10274 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
10275
10276 * po/LINGUAS: Add pt_BR.
10277 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
10278 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
10279 lib/timevar.c.
10280 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
10281 manual recommends.
10282 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
10283
10284 * src/complain.c (strerror_r): Remove decl; not needed.
10285 (strerror): Use same pattern as ../lib/error.c.
10286
10287 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
10288
10289 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
10290
10291 * src/main.c (main): Cast result of bindtextdomain and textdomain
10292 to void, to avoid a GCC warning when --disable-nls is in effect.
10293
10294 * src/scan-gram.l: Use strings rather than escapes when possible,
10295 to minimize the number of warnings from xgettext.
10296 (handle_action_dollar, handle_action_at): Don't use isdigit,
10297 as it mishandles negative chars and it may not work as expected
10298 outside the C locale.
10299
10300 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
10301 this is a GCC extension and is not portable to other compilers.
10302
10303 * src/system.h (alloca): Use same pattern as ../lib/error.c.
10304 Do not include <ctype.h>; no longer needed.
10305 Do not include <malloc.h>; no longer needed (and generates
10306 warnings on OpenBSD 3.0).
10307
10308 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
10309 it's not portable.
10310
10311 * tests/regression.at: Do not use 'cc -c input.c -o input';
10312 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
10313
10314 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
10315 exit status as failure, not just exit status 1. Sun C exits
10316 with status 2 sometimes.
10317
10318 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
10319 Use it for the two large tests.
10320
103212002-08-02 Akim Demaille <akim@epita.fr>
10322
10323 * src/conflicts.c (conflicts_output): Don't output rules never
10324 reduced here, since anyway that computation doesn't work.
10325 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
10326 (rule_useless_p, rule_never_reduced_p): New.
10327 (grammar_rules_partial_print): Use a filter instead of a range.
10328 Display the title only if needed.
10329 (grammar_rules_print): Adjust.
10330 (grammar_rules_never_reduced_report): New.
10331 * src/tables.c (action_row): Move the computation of rules never
10332 reduced to...
10333 (token_actions): here.
10334 * src/main.c (main): Make the parser before making the report, so
10335 that rules never reduced are computed.
10336 Call grammar_rules_never_reduced_report.
10337 * src/print.c (print_results): Report rules never reduced.
10338 * tests/conflicts.at, tests/reduce.at: Adjust.
10339
103402002-08-01 Akim Demaille <akim@epita.fr>
10341
10342 Instead of attaching lookaheads and duplicating the rules being
10343 reduced by a state, attach the lookaheads to the reductions.
10344
10345 * src/state.h (state_t): Remove the `lookaheads',
10346 `lookaheads_rule' member.
10347 (reductions_t): Add a `lookaheads' member.
10348 Use a regular array for the `rules'.
10349 * src/state.c (reductions_new): Initialize the lookaheads member
10350 to 0.
10351 (state_rule_lookaheads_print): Adjust.
10352 * src/state.h, src/state.c (state_reductions_find): New.
10353 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
10354 (count_rr_conflicts): Adjust.
10355 * src/lalr.c (LArule): Remove.
10356 (add_lookback_edge): Adjust.
10357 (state_lookaheads_count): New.
10358 (states_lookaheads_initialize): Merge into...
10359 (initialize_LA): this.
10360 (lalr_free): Adjust.
10361 * src/main.c (main): Don't free nullable and derives too early: it
10362 is used by --verbose.
10363 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
10364
103652002-08-01 Akim Demaille <akim@epita.fr>
10366
10367 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
10368 `rule_number_t**'.
10369 (set_derives, free_derives): Rename as...
10370 (derives_compute, derives_free): this.
10371 Adjust all dependencies.
10372 * src/nullable.c (set_nullable, free_nullable): Rename as...
10373 (nullable_compute, nullable_free): these.
10374 (rule_list_t): Store rule_t *, not rule_number_t.
10375 * src/state.c (state_rule_lookaheads_print): Directly compare rule
10376 pointers, instead of their numbers.
10377 * src/main.c (main): Call nullable_free, and derives_free earlier,
10378 as they were lo longer used.
10379
103802002-08-01 Akim Demaille <akim@epita.fr>
10381
10382 * lib/timevar.c (get_time): Include children time.
10383 * src/lalr.h (LA, LArule): Don't export them: used with the
10384 state_t.
10385 * src/lalr.c (LA, LArule): Static.
10386 * src/lalr.h, src/lalr.c (lalr_free): New.
10387 * src/main.c (main): Call it.
10388 * src/tables.c (pack_vector): Check whether loc is >= to the
10389 table_size, not >.
10390 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
10391 (tables_generate): do it, since that's also it which allocates
10392 them.
10393 Don't free LA and LArule, main does.
10394
103952002-07-31 Akim Demaille <akim@epita.fr>
10396
10397 Separate parser tables computation and output.
10398
10399 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
10400 (conflict_list, conflict_list_cnt, table, check, table_ninf)
10401 (yydefgoto, yydefact, high): Move to...
10402 * src/tables.h, src/tables.c: here.
10403 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
10404 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
10405 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
10406 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
10407 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
10408 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
10409 (action_row, save_row, token_actions, save_column, default_goto)
10410 (goto_actions, sort_actions, matching_state, pack_vector)
10411 (table_ninf_remap, pack_table, prepare_actions): Move to...
10412 * src/tables.c: here.
10413 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
10414 * src/output.c (token_actions, output_base, output_conflicts)
10415 (output_check): Merge into...
10416 (prepare_actions): this.
10417 (actions_output): Rename as...
10418 (user_actions_output): this.
10419 * src/main.c (main): Call tables_generate and tables_free.
10420
104212002-07-31 Akim Demaille <akim@epita.fr>
10422
10423 Steal GCC's --time-report support.
10424
10425 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
10426 stolen/adjusted from GCC.
10427 * m4/stage.m4: Remove time related checks.
10428 * m4/timevar.m4: New.
10429 * configure.in: Adjust.
10430 * src/system.h: Adjust to using timevar.h.
10431 * src/getargs.h, src/getargs.c: Support trace_time for
10432 --trace=time.
10433 * src/main.c (stage): Remove.
10434 (main): Replace `stage' invocations with timevar calls.
10435 * src/output.c: Insert pertinent timevar calls.
10436
104372002-07-31 Akim Demaille <akim@epita.fr>
10438
10439 Let --trace have arguments.
10440
10441 * src/getargs.h (enum trace_e): New.
10442 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
10443 (long_options, short_options): --trace/-T takes an optional
10444 argument.
10445 Change all the uses of trace_flag to reflect the new flags.
10446 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
10447
10448 Strengthen `stage' portability.
10449
10450 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
10451 * configure.in: Use it.
10452 Don't check for malloc.h and sys/times.h.
10453 * src/system.h: Include them when appropriate.
10454 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
10455 times and struct tms are available.
10456
104572002-07-30 Akim Demaille <akim@epita.fr>
10458
10459 In verbose parse error message, don't report `error' as an
10460 expected token.
10461 * tests/actions.at (Printers and Destructors): Adjust.
10462 * tests/calc.at (Calculator $1): Adjust.
10463 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
10464 error message, do not report the parser accepts the error token in
10465 that state.
10466
104672002-07-30 Akim Demaille <akim@epita.fr>
10468
10469 Normalize conflict related messages.
10470
10471 * src/complain.h, src/complain.c (warn, complain): New.
10472 * src/conflicts.c (conflicts_print): Use them.
10473 (conflict_report_yacc): New, extracted from...
10474 (conflicts_print): here.
10475 * tests/conflicts.at, tests/existing.at: Adjust.
10476
104772002-07-30 Akim Demaille <akim@epita.fr>
10478
10479 Report rules which are never reduced by the parser: those hidden
10480 by conflicts.
10481
10482 * src/LR0.c (save_reductions): Don't make the final state too
10483 different: save its reduction (accept) instead of having a state
10484 without any action (no shift or goto, no reduce).
10485 Note: the final state is now a ``regular'' state, i.e., the
10486 parsers now contain `reduce 0' as default reduction.
10487 Nevertheless, since they decide to `accept' when yystate =
10488 final_state, they still will not reduce rule 0.
10489 * src/print.c (print_actions, print_reduction): Adjust.
10490 * src/output.c (action_row): Track reduced rules.
10491 (token_actions): Report rules never reduced.
10492 * tests/conflicts.at, tests/regression.at: Adjust.
10493
104942002-07-30 Akim Demaille <akim@epita.fr>
10495
10496 `stage' was accidently included in a previous patch.
10497 Initiate its autoconfiscation.
10498
10499 * configure.in: Look for malloc.h and sys/times.h.
10500 * src/main.c (stage): Adjust.
10501 Report only when trace_flag.
10502
105032002-07-29 Akim Demaille <akim@epita.fr>
10504
10505 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
10506 state_number_t.
10507 (errs_t): symbol_t*, not symbol_number_t.
10508 (reductions_t): rule_t*, not rule_number_t.
10509 (FOR_EACH_SHIFT): New.
10510 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
10511 * src/print.c, src/print_graph.c: Adjust.
10512
105132002-07-29 Akim Demaille <akim@epita.fr>
10514
10515 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
10516
10517 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
10518 (endtoken, accept): these.
10519 * src/reader.c (reader): Set endtoken's default tag to "$end".
10520 Set undeftoken's tag to "$undefined" instead of "$undefined.".
10521 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
10522 Adjust.
10523
105242002-07-29 Akim Demaille <akim@epita.fr>
10525
10526 * src/reduce.c (reduce_grammar): When the language is empty,
10527 complain about the start symbol, not the axiom.
10528 Use its location.
10529 * tests/reduce.at (Empty Language): New.
10530
105312002-07-26 Akim Demaille <akim@epita.fr>
10532
10533 * src/reader.h, src/reader.c (gram_error): ... can't get
10534 yycontrol without making too strong assumptions on the parser
10535 itself.
10536 * src/output.c (prepare_tokens): Use the real 0th value of
10537 token_translations instead of `0'.
10538 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
10539 visible here.
10540 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
10541 for the time being: %locations ought to provide it to yyerror.
10542
105432002-07-25 Akim Demaille <akim@epita.fr>
10544
10545 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
10546 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
10547 * tests/regression.at (Web2c Actions): Adjust.
10548
105492002-07-25 Akim Demaille <akim@epita.fr>
10550
10551 Stop storing rules from 1 to nrules + 1.
10552
10553 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
10554 * src/nullable.c, src/output.c, src/print.c, src/reader.c
10555 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
10556 Iterate from 0 to nrules.
10557 Use rule_number_as_item_number and item_number_as_rule_number.
10558 Adjust to `derive' now containing possibly 0.
10559 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
10560 Handle the `- 1' part in rule numbers from/to item numbers.
10561 * src/conflicts.c (log_resolution): Fix the message which reversed
10562 shift and reduce.
10563 * src/output.c (action_row): Initialize default_rule to -1.
10564 (token_actions): Adjust.
10565 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
10566 expected output.
10567 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
10568
105692002-07-25 Akim Demaille <akim@epita.fr>
10570
10571 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
10572 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
10573 (b4_c_knr_arg_decl): New.
10574 * data/yacc.c: Use it to define yysymprint, yydestruct, and
10575 yyreport_parse_error.
10576
105772002-07-25 Akim Demaille <akim@epita.fr>
10578
10579 * data/yacc.c (yyreport_parse_error): New, extracted from...
10580 (yyparse): here.
10581 (yydestruct, yysymprint): Move above yyparse.
10582 Be K&R compliant.
10583
105842002-07-25 Akim Demaille <akim@epita.fr>
10585
10586 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
10587 replace...
10588 (b4_sint_type, b4_uint_type): these.
10589 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
10590 * tests/regression.at (Web2c Actions): Adjust.
10591
105922002-07-25 Akim Demaille <akim@epita.fr>
10593
10594 * src/gram.h (TIEM_NUMBER_MAX): New.
10595 (item_number_of_rule_number, rule_number_of_item_number): Rename
10596 as...
10597 (rule_number_as_item_number, item_number_as_rule_number): these.
10598 Adjust dependencies.
10599 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
10600 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
10601 (symbol_number_to_vector_number): New.
10602 (order): Of vector_number_t* type.
10603 (base_t, BASE_MAX, BASE_MIN): New.
10604 (froms, tos, width, pos, check): Of base_t type.
10605 (action_number_t, ACTION_MIN, ACTION_MAX): New.
10606 (actrow): Of action_number_t type.
10607 (conflrow): Of unsigned int type.
10608 (table_ninf, base_ninf): New.
10609 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
10610 (muscle_insert_int_table, muscle_insert_base_table)
10611 (muscle_insert_rule_number_table): New.
10612 (prepare_tokens): Output `toknum' as int_table.
10613 (action_row): Returns a rule_number_t.
10614 Use ACTION_MIN, not SHRT_MIN.
10615 (token_actions): yydefact is rule_number_t*.
10616 (table_ninf_remap): New.
10617 (pack_table): Use it for `base' and `table'.
10618 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
10619 replaced with...
10620 (YYPACT_NINF, YYTABLE_NINF): these.
10621 (yypact, yytable): Compute their types instead of hard-coded
10622 `short'.
10623 * tests/regression.at (Web2c Actions): Adjust.
10624
106252002-07-19 Akim Demaille <akim@epita.fr>
10626
10627 * src/scan-gram.l (id): Can start with an underscore.
10628
106292002-07-16 Akim Demaille <akim@epita.fr>
10630
10631 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
10632 Adjust all former `associativity' dependencies.
10633 * src/symtab.c (symbol_new): Default associativity is `undef', not
10634 `right'.
10635 (symbol_check_alias_consistence): Adjust.
10636
106372002-07-09 Akim Demaille <akim@epita.fr>
10638
10639 * doc/bison.texinfo: Properly set the ``header'' part.
10640 Use @dircategory ``GNU programming tools'' as per Texinfo's
10641 documentation.
10642 Use @copying.
10643
106442002-07-09 Akim Demaille <akim@epita.fr>
10645
10646 * lib/quotearg.h: Protect against multiple inclusions.
10647 * src/location.h (location_t): Add a `file' member.
10648 (LOCATION_RESET, LOCATION_PRINT): Adjust.
10649 * src/complain.c (warn_at, complain_at, fatal_at): Drop
10650 `error_one_per_line' support.
10651
106522002-07-09 Akim Demaille <akim@epita.fr>
10653
10654 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
10655 * src/reader.c (lineno): Remove.
10656 Adjust all dependencies.
10657 (get_merge_function): Take a location and use complain_at.
10658 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
10659 * tests/regression.at (Invalid inputs, Mixing %token styles):
10660 Adjust.
10661
106622002-07-09 Akim Demaille <akim@epita.fr>
10663
10664 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
10665 recovery rule, and forbid extensions when --yacc.
10666 (gram_error): Use complain_at.
10667 * src/reader.c (reader): Exit if there were parse errors.
10668
106692002-07-09 Akim Demaille <akim@epita.fr>
10670
10671 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
10672 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
10673 Reported by R Blake <blakers@mac.com>.
10674
106752002-07-09 Akim Demaille <akim@epita.fr>
10676
10677 * data/yacc.c: Output the copyright notive in the header.
10678
106792002-07-03 Akim Demaille <akim@epita.fr>
10680
10681 * src/output.c (froms, tos): Are state_number_t.
10682 (save_column): sp, sp1, and sp2 are state_number_t.
10683 (prepare): Rename `final' as `final_state_number', `nnts' as
10684 `nterms_number', `nrules' as `rules_number', `nstates' as
10685 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
10686 unused.
10687 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
10688 * data/lalr1.cc (nsym_): Remove, unused.
10689
106902002-07-03 Akim Demaille <akim@epita.fr>
10691
10692 * src/lalr.h, src/lalr.c (goto_number_t): New.
10693 * src/lalr.c (goto_list_t): New.
10694 Propagate them.
10695 * src/nullable.c (rule_list_t): New.
10696 Propagate.
10697 * src/types.h: Remove.
10698
106992002-07-03 Akim Demaille <akim@epita.fr>
10700
10701 * src/closure.c (print_fderives): Use rule_rhs_print.
10702 * src/derives.c (print_derives): Use rule_rhs_print.
10703 (rule_list_t): New, replaces `shorts'.
10704 (set_derives): Add comments.
10705 * tests/sets.at (Nullable, Firsts): Adjust.
10706
107072002-07-03 Akim Demaille <akim@epita.fr>
10708
10709 * src/output.c (prepare_actions): Free `tally' and `width'.
10710 (prepare_actions): Allocate and free `order'.
10711 * src/symtab.c (symbols_free): Free `symbols'.
10712 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
10713 * src/output.c (m4_invoke): Move to...
10714 * src/scan-skel.l: here.
10715 (<<EOF>>): Close yyout, and free its name.
10716
107172002-07-03 Akim Demaille <akim@epita.fr>
10718
10719 Fix some memory leaks, and fix a bug: state 0 was examined twice.
10720
10721 * src/LR0.c (new_state): Merge into...
10722 (state_list_append): this.
10723 (new_states): Merge into...
10724 (generate_states): here.
10725 (set_states): Don't ensure a proper `errs' state member here, do it...
10726 * src/conflicts.c (conflicts_solve): here.
10727 * src/state.h, src/state.c: Comment changes.
10728 (state_t): Rename member `shifts' as `transitions'.
10729 Adjust all dependencies.
10730 (errs_new): For consistency, also take the values as argument.
10731 (errs_dup): Remove.
10732 (state_errs_set): New.
10733 (state_reductions_set, state_transitions_set): Assert that no
10734 previous value was assigned.
10735 (state_free): New.
10736 (states_free): Use it.
10737 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
10738 temporary storage: use `errs' and `nerrs' as elsewhere.
10739 (set_conflicts): Allocate and free this `errs'.
10740
107412002-07-02 Akim Demaille <akim@epita.fr>
10742
10743 * lib/libiberty.h: New.
10744 * lib: Update the bitset implementation from upstream.
10745 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
10746 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
10747 * src/main.c: Adjust bitset stats calls.
10748
107492002-07-01 Paul Eggert <eggert@twinsun.com>
10750
10751 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
10752 char, so that negative chars don't collide with $.
10753
107542002-06-30 Akim Demaille <akim@epita.fr>
10755
10756 Have the GLR tests be `warning' checked, and fix the warnings.
10757
10758 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
10759 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
10760 (yyremoveDeletes): `yyi' and `yyj' are size_t.
10761 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
10762 (yyaddDeferredAction): static.
10763 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
10764 (yyreportParseError): yyprefix is const.
10765 yytokenp is used only when verbose.
10766 (yy__GNUC__): Replace with __GNUC__.
10767 (yypdumpstack): yyi is size_t.
10768 (yypreference): Un-yy local variables and arguments, to avoid
10769 clashes with `yyr1'. Anyway, we are not in the user name space.
10770 (yytname_size): be an int, as is compared with ints.
10771 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
10772 Use them.
10773 * tests/cxx-gram.at: Use quotation to protect $1.
10774 Use AT_COMPILE to enable warnings hunts.
10775 Prototype yylex and yyerror.
10776 `Use' argc.
10777 Include `string.h', not `strings.h'.
10778 Produce and prototype stmtMerge only when used.
10779 yylex takes a location.
10780
107812002-06-30 Akim Demaille <akim@epita.fr>
10782
10783 We spend a lot of time in quotearg, in particular when --verbose.
10784
10785 * src/symtab.c (symbol_get): Store a quoted version of the key.
10786 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
10787 Adjust all callers.
10788
107892002-06-30 Akim Demaille <akim@epita.fr>
10790
10791 * src/state.h (reductions_t): Rename member `nreds' as num.
10792 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
10793 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
10794
107952002-06-30 Akim Demaille <akim@epita.fr>
10796
10797 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
10798 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
10799 (shifts_to): Rename as...
10800 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
10801 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
10802 (TRANSITION_IS_DISABLED, transitions_to): these.
10803
108042002-06-30 Akim Demaille <akim@epita.fr>
10805
10806 * src/print.c (print_shifts, print_gotos): Merge into...
10807 (print_transitions): this.
10808 (print_transitions, print_errs, print_reductions): Align the
10809 lookaheads columns.
10810 (print_core, print_transitions, print_errs, print_state,
10811 print_grammar): Output empty lines separator before, not after.
10812 (state_default_rule_compute): Rename as...
10813 (state_default_rule): this.
10814 * tests/conflicts.at (Defaulted Conflicted Reduction),
10815 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
10816 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
10817
108182002-06-30 Akim Demaille <akim@epita.fr>
10819
10820 Display items as we display rules.
10821
10822 * src/gram.h, src/gram.c (rule_lhs_print): New.
10823 * src/gram.c (grammar_rules_partial_print): Use it.
10824 * src/print.c (print_core): Likewise.
10825 * tests/conflicts.at (Defaulted Conflicted Reduction),
10826 (Unresolved SR Conflicts): Adjust.
10827 (Unresolved SR Conflicts): Adjust and rename as...
10828 (Resolved SR Conflicts): this, as was meant.
10829 * tests/regression.at (Web2c Report): Adjust.
10830
108312002-06-30 Akim Demaille <akim@epita.fr>
10832
10833 * src/print.c (state_default_rule_compute): New, extracted from...
10834 (print_reductions): here.
10835 Pessimize, but clarify the code.
10836 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
10837
108382002-06-30 Akim Demaille <akim@epita.fr>
10839
10840 * src/output.c (action_row): Let default_rule be always a rule
10841 number.
10842
108432002-06-30 Akim Demaille <akim@epita.fr>
10844
10845 * src/closure.c (print_firsts, print_fderives, closure):
10846 Use BITSET_EXECUTE.
10847 * src/lalr.c (lookaheads_print): Likewise.
10848 * src/state.c (state_rule_lookaheads_print): Likewise.
10849 * src/print_graph.c (print_core): Likewise.
10850 * src/print.c (print_reductions): Likewise.
10851 * src/output.c (action_row): Likewise.
10852 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
10853
108542002-06-30 Akim Demaille <akim@epita.fr>
10855
10856 * src/print_graph.c: Use report_flag.
10857
108582002-06-30 Akim Demaille <akim@epita.fr>
10859
10860 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
10861 to...
10862 * src/relation.h, src/relation.c (traverse, relation_digraph)
10863 (relation_print, relation_transpose): New.
10864
108652002-06-30 Akim Demaille <akim@epita.fr>
10866
10867 * src/state.h, src/state.c (shifts_to): New.
10868 * src/lalr.c (build_relations): Use it.
10869
108702002-06-30 Akim Demaille <akim@epita.fr>
10871
10872 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
10873 (item_number_of_rule_number, rule_number_of_item_number): New.
10874 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
10875 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
10876 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
10877 Propagate their use.
10878 Much remains to be done, in particular wrt `shorts' from types.h.
10879
108802002-06-30 Akim Demaille <akim@epita.fr>
10881
10882 * src/symtab.c (symbol_new): Initialize the `printer' member.
10883
108842002-06-30 Akim Demaille <akim@epita.fr>
10885
10886 * src/LR0.c (save_reductions): Remove, replaced by...
10887 * src/state.h, src/state.c (state_reductions_set): New.
10888 (reductions, errs): Rename as...
10889 (reductions_t, errs_t): these.
10890 Adjust all dependencies.
10891
108922002-06-30 Akim Demaille <akim@epita.fr>
10893
10894 * src/LR0.c (state_list_t, state_list_append): New.
10895 (first_state, last_state): Now symbol_list_t.
10896 (this_state): Remove.
10897 (new_itemsets, append_states, save_reductions): Take a state_t as
10898 argument.
10899 (set_states, generate_states): Adjust.
10900 (save_shifts): Remove, replaced by...
10901 * src/state.h, src/state.c (state_shifts_set): New.
10902 (shifts): Rename as...
10903 (shifts_t): this.
10904 Adjust all dependencies.
10905 * src/state.h (state_t): Remove the `next' member.
10906
109072002-06-30 Akim Demaille <akim@epita.fr>
10908
10909 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
10910 escaped in slot 0.
10911
109122002-06-30 Akim Demaille <akim@epita.fr>
10913
10914 Use hash.h for the state hash table.
10915
10916 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
10917 (allocate_storage): Use state_hash_new.
10918 (free_storage): Use state_hash_free.
10919 (new_state, get_state): Adjust.
10920 * src/lalr.h, src/lalr.c (states): Move to...
10921 * src/states.h (state_t): Remove the `link' member, no longer
10922 used.
10923 * src/states.h, src/states.c: here.
10924 (state_hash_new, state_hash_free, state_hash_lookup)
10925 (state_hash_insert, states_free): New.
10926 * src/states.c (state_table, state_compare, state_hash): New.
10927 * src/output.c (output_actions): Do not free states now, since we
10928 still need to know the final_state number in `prepare', called
10929 afterwards. Do it...
10930 * src/main.c (main): here: call states_free after `output'.
10931
109322002-06-30 Akim Demaille <akim@epita.fr>
10933
10934 * src/state.h, src/state.c (state_new): New, extracted from...
10935 * src/LR0.c (new_state): here.
10936 * src/state.h (STATE_ALLOC): Move to...
10937 * src/state.c: here.
10938 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
10939 * src/state.h, src/state.c: here.
10940
109412002-06-30 Akim Demaille <akim@epita.fr>
10942
10943 * src/reader.c (gensym): Rename as...
10944 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
10945 (getsym): Rename as...
10946 (symbol_get): this.
10947
109482002-06-30 Akim Demaille <akim@epita.fr>
10949
10950 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
10951 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
10952 * src/output.c, src/print.c, src/print_graph.c: Propagate.
10953 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
10954
109552002-06-30 Akim Demaille <akim@epita.fr>
10956
10957 Make the test suite pass with warnings checked.
10958
10959 * tests/actions.at (Printers and Destructors): Improve.
10960 Avoid unsigned vs. signed issues.
10961 * tests/calc.at: Don't exercise the scanner here, do it...
10962 * tests/input.at (Torturing the Scanner): here.
10963
109642002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10965
10966 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
10967 reorganize first lines parallel to yacc.c.
10968
109692002-06-28 Akim Demaille <akim@epita.fr>
10970
10971 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
10972 (b4_token_enum, b4_token_defines): New, factored from...
10973 * data/lalr1.cc, data/yacc.c, glr.c: here.
10974
109752002-06-28 Akim Demaille <akim@epita.fr>
10976
10977 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
10978 unused variables.
10979 * src/output.c (merger_output): static.
10980
109812002-06-28 Akim Demaille <akim@epita.fr>
10982
10983 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
10984 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
10985 pacify GCC.
10986 * src/output.c (save_row): Initialize all the variables to pacify GCC.
10987
109882002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10989
10990 Accumulated changelog for new GLR parsing features.
10991
10992 * src/conflicts.c (count_total_conflicts): Change name to
10993 conflicts_total_count.
10994 * src/conflicts.h: Ditto.
10995 * src/output.c (token_actions): Use the new name.
10996 (output_conflicts): Change conflp => conflict_list_heads, and
10997 confl => conflict_list for better readability.
10998 * data/glr.c: Use the new names.
10999 * NEWS: Add self to GLR announcement.
11000
11001 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
11002
11003 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
11004 Akim Demaille.
11005
11006 * data/bison.glr: Change name to glr.c
11007 * data/glr.c: Renamed from bison.glr.
11008 * data/Makefile.am: Add glr.c
11009
11010 * src/getargs.c:
11011
11012 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
11013 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
11014
11015 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11016
11017 * data/bison.glr: Be sure to restore the
11018 current #line when returning to the skeleton contents after having
11019 exposed the input file's #line.
11020
11021 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11022
11023 * data/bison.glr: Bring up to date with changes to bison.simple.
11024
11025 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11026
11027 * data/bison.glr: Correct definitions that use b4_prefix.
11028 Various reformatting.
11029 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
11030 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
11031 yytokenp argument; now part of stack.
11032 (yychar): Define to behave as documented.
11033 (yyclearin): Ditto.
11034
11035 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11036
11037 * src/reader.h: Add declaration for free_merger_functions.
11038
11039 * src/reader.c (merge_functions): New variable.
11040 (get_merge_function): New function.
11041 (free_merger_functions): New function.
11042 (readgram): Check for %prec that is not followed by a symbol.
11043 Handle %dprec and %merge declarations.
11044 (packgram): Initialize dprec and merger fields in rules array.
11045
11046 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
11047 conflict_list_cnt, conflict_list_free): New variables.
11048 (table_grow): Also grow conflict_table.
11049 (prepare_rules): Output dprec and merger tables.
11050 (conflict_row): New function.
11051 (action_row): Output conflict lists for GLR parser. Don't use
11052 default reduction in conflicted states for GLR parser so that there
11053 are spaces for the conflict lists.
11054 (save_row): Also save conflict information.
11055 (token_actions): Allocate conflict list.
11056 (merger_output): New function.
11057 (pack_vector): Pack conflict table, too.
11058 (output_conflicts): New function to output yyconflp and yyconfl.
11059 (output_check): Allocate conflict_tos.
11060 (output_actions): Output conflict tables, also.
11061 (output_skeleton): Output b4_mergers definition.
11062 (prepare): Output b4_max_rhs_length definition.
11063 Use 'bison.glr' as default skeleton for GLR parsers.
11064
11065 * src/gram.c (glr_parser): New flag.
11066 (grammar_free): Call free_merger_functions.
11067
11068 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
11069 all pairs of conflicting reductions, rather than just all tokens
11070 causing conflicts. Needed to size conflict tables.
11071 (conflicts_output): Modify call to count_rr_conflicts for new
11072 interface.
11073 (conflicts_print): Ditto.
11074 (count_total_conflicts): New function.
11075
11076 * src/reader.h (merger_list): New type.
11077 (merge_functions): New variable.
11078
11079 * src/lex.h (tok_dprec, tok_merge): New token types.
11080
11081 * src/gram.h (rule_s): Add dprec and merger fields.
11082 (glr_parser): New flag.
11083
11084 * src/conflicts.h (count_total_conflicts): New function.
11085
11086 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
11087
11088 * doc/bison.texinfo (Generalized LR Parsing): New section.
11089 (GLR Parsers): New section.
11090 (Language and Grammar): Mention GLR parsing.
11091 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
11092 Correct typo ("tge" -> "the").
11093
11094 * data/bison.glr: New skeleton for GLR parsing.
11095
11096 * tests/cxx-gram.at: New tests for GLR parsing.
11097
11098 * tests/testsuite.at: Include cxx-gram.at.
11099
11100 * tests/Makefile.am: Add cxx-gram.at.
11101
11102 * src/parse-gram.y:
11103
11104 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
11105
11106 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
11107
111082002-06-27 Akim Demaille <akim@epita.fr>
11109
11110 * src/options.h, src/options.c: Remove.
11111 * src/getargs.c (short_options, long_options): New.
11112
111132002-06-27 Akim Demaille <akim@epita.fr>
11114
11115 * data/bison.simple, data/bison.c++: Rename as...
11116 * data/yacc.c, data/lalr1.cc: these.
11117 * doc/bison.texinfo (Environment Variables): Remove.
11118
111192002-06-25 Raja R Harinath <harinath@cs.umn.edu>
11120
11121 * src/getargs.c (report_argmatch): Initialize strtok().
11122
111232002-06-20 Akim Demaille <akim@epita.fr>
11124
11125 * data/bison.simple (b4_symbol_actions): New, replaces...
11126 (b4_symbol_destructor, b4_symbol_printer): these.
11127 (yysymprint): Be sure to call YYPRINT only for tokens, and using
11128 user token numbers.
11129
111302002-06-20 Akim Demaille <akim@epita.fr>
11131
11132 * data/bison.simple (yydestructor): Rename as...
11133 (yydestruct): this.
11134
111352002-06-20 Akim Demaille <akim@epita.fr>
11136
11137 * src/symtab.h, src/symtab.c (symbol_type_set)
11138 (symbol_destructor_set, symbol_precedence_set): The location is
11139 the last argument.
11140 Adjust all callers.
11141
111422002-06-20 Akim Demaille <akim@epita.fr>
11143
11144 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
11145 internals.
11146 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
11147 Takes a location.
11148 * src/symtab.h, src/symtab.c (symbol_class_set)
11149 (symbol_user_token_number_set): Likewise.
11150 Adjust all callers.
11151 Promote complain_at.
11152 * tests/input.at (Type Clashes): Adjust.
11153
111542002-06-20 Akim Demaille <akim@epita.fr>
11155
11156 * data/bison.simple (YYLEX): Fix the declaration when
11157 %pure-parser.
11158
111592002-06-20 Akim Demaille <akim@epita.fr>
11160
11161 * data/bison.simple (yysymprint): Don't print the token number,
11162 just its name.
11163 * tests/actions.at (Destructors): Rename as...
11164 (Printers and Destructors): this.
11165 Also exercise %printer.
11166
111672002-06-20 Akim Demaille <akim@epita.fr>
11168
11169 * data/bison.simple (YYDSYMPRINT): New.
11170 Use it to remove many of the #if YYDEBUG/if (yydebug).
11171
111722002-06-20 Akim Demaille <akim@epita.fr>
11173
11174 * src/symtab.h, src/symtab.c (symbol_t): printer and
11175 printer_location are new members.
11176 (symbol_printer_set): New.
11177 * src/parse-gram.y (PERCENT_PRINTER): New token.
11178 Handle its associated rule.
11179 * src/scan-gram.l: Adjust.
11180 (handle_destructor_at, handle_destructor_dollar): Rename as...
11181 (handle_symbol_code_at, handle_symbol_code_dollar): these.
11182 * src/output.c (symbol_printers_output): New.
11183 (output_skeleton): Call it.
11184 * data/bison.simple (yysymprint): New. Cannot be named yyprint
11185 since there are already many grammar files with a user `yyprint'.
11186 Replace the calls to YYPRINT to calls to yysymprint.
11187 * tests/calc.at: Adjust.
11188 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
11189 taking advantage of parser very internal details (stack size!).
11190
111912002-06-20 Akim Demaille <akim@epita.fr>
11192
11193 * src/scan-gram.l: Complete the scanner with the missing patterns
11194 to pacify Flex.
11195 Use `quote' and `symbol_tag_get' where appropriate.
11196
111972002-06-19 Akim Demaille <akim@epita.fr>
11198
11199 * tests/actions.at (Destructors): Augment to test locations.
11200 * data/bison.simple (yydestructor): Pass it the current location
11201 if locations are enabled.
11202 Prototype only when __STDC__ or C++.
11203 Change the argument names to move into the yy name space: there is
11204 user code here.
11205
112062002-06-19 Akim Demaille <akim@epita.fr>
11207
11208 * data/bison.simple (b4_pure_if): New.
11209 Use it instead of #ifdef YYPURE.
11210
112112002-06-19 Akim Demaille <akim@epita.fr>
11212
11213 * data/bison.simple (b4_location_if): New.
11214 Use it instead of #ifdef YYLSP_NEEDED.
11215
112162002-06-19 Akim Demaille <akim@epita.fr>
11217
11218 Prepare @$ in %destructor, but currently don't bind it in the
11219 skeleton, as %location use is not cleaned up yet.
11220
11221 * src/scan-gram.l (handle_dollar, handle_destructor_at)
11222 (handle_action_at): New.
11223 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
11224 a braced_code_t and a location as additional arguments.
11225 (handle_destructor_dollar): Instead of requiring `b4_eval', just
11226 unquote one when outputting `b4_dollar_dollar'.
11227 Adjust callers.
11228 * data/bison.simple (b4_eval): Remove.
11229 (b4_symbol_destructor): Adjust.
11230 * tests/input.at (Invalid @n): Adjust.
11231
112322002-06-19 Zack Weinberg <zack@codesourcery.com>
11233
11234 * doc/bison.texinfo: Document ability to have multiple
11235 prologue sections.
11236
112372002-06-18 Akim Demaille <akim@epita.fr>
11238
11239 * src/files.c (compute_base_names): When computing the output file
11240 names from the input file name, strip the directory part.
11241
112422002-06-18 Akim Demaille <akim@epita.fr>
11243
11244 * data/bison.simple.new: Comment changes.
11245 Reported by Andreas Schwab.
11246
112472002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
11248
11249 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
11250 there are no `label `yyoverflowlab' defined but not used' warnings
11251 when yyoverflow is defined.
11252
112532002-06-18 Akim Demaille <akim@epita.fr>
11254
11255 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
11256 new member.
11257 (symbol_destructor_set): Adjust.
11258 * src/output.c (symbol_destructors_output): Output the destructor
11259 locations.
11260 Output the symbol name.
11261 * data/bison.simple (b4_symbol_destructor): Adjust.
11262
112632002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
11264 and Akim Demaille <akim@epita.fr>
11265
11266 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
11267 what's left on the stack when the error recovery hits EOF.
11268 * tests/actions.at (Destructors): Complete to exercise this case.
11269
112702002-06-17 Akim Demaille <akim@epita.fr>
11271
11272 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
11273 arguments is really empty, not only equal to `[]'.
11274 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
11275 member.
11276 (symbol_destructor_set): New.
11277 * src/output.c (symbol_destructors_output): New.
11278 * src/reader.h (brace_code_t, current_braced_code): New.
11279 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
11280 (handle_dollar): Rename as...
11281 (handle_action_dollar): this.
11282 (handle_destructor_dollar): New.
11283 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
11284 (grammar_declaration): Use it.
11285 * data/bison.simple (yystos): Is always defined.
11286 (yydestructor): New.
11287 * tests/actions.at (Destructors): New.
11288 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
11289
112902002-06-17 Akim Demaille <akim@epita.fr>
11291
11292 * src/symlist.h, src/symlist.c (symbol_list_length): New.
11293 * src/scan-gram.l (handle_dollar, handle_at): Compute the
11294 rule_length only when needed.
11295 * src/output.c (actions_output, token_definitions_output): Output
11296 the full M4 block.
11297 * src/symtab.c: Don't access directly to the symbol tag, use
11298 symbol_tag_get.
11299 * src/parse-gram.y: Use symbol_list_free.
11300
113012002-06-17 Akim Demaille <akim@epita.fr>
11302
11303 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
11304 (symbol_list_prepend, get_type_name): Move to...
11305 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
11306 (symbol_list_prepend, symbol_list_n_type_name_get): here.
11307 Adjust all callers.
11308 (symbol_list_free): New.
11309 * src/scan-gram.l (handle_dollar): Takes a location.
11310 * tests/input.at (Invalid $n): Adjust.
11311
113122002-06-17 Akim Demaille <akim@epita.fr>
11313
11314 * src/reader.h, src/reader.c (symbol_list_new): Export it.
11315 (symbol_list_prepend): New.
11316 * src/parse-gram.y (%union): `list' is a new member.
11317 (symbols.1): New, replaces...
11318 (terms_to_prec.1, nterms_to_type.1): these.
11319 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
11320 Take a location as additional argument.
11321 Adjust all callers.
11322
113232002-06-15 Akim Demaille <akim@epita.fr>
11324
11325 * src/parse-gram.y: Move %token in the declaration section so that
11326 we don't depend upon CVS Bison.
11327
113282002-06-15 Akim Demaille <akim@epita.fr>
11329
11330 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
11331 * src/print.c (print_core): Use it.
11332
113332002-06-15 Akim Demaille <akim@epita.fr>
11334
11335 * src/conflicts.c (log_resolution): Accept the rule involved in
11336 the sr conflicts instead of the lookahead number that points to
11337 that rule.
11338 (flush_reduce): Accept the current lookahead vector as argument,
11339 instead of the index in LA.
11340 (resolve_sr_conflict): Accept the current number of lookahead
11341 bitset to consider for the STATE, instead of the index in LA.
11342 (set_conflicts): Adjust.
11343 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
11344
113452002-06-15 Akim Demaille <akim@epita.fr>
11346
11347 * src/state.h (state_t): Replace the `lookaheadsp' member, a
11348 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
11349 Adjust all dependencies.
11350 * src/lalr.c (initialize_lookaheads): Split into...
11351 (states_lookaheads_count, states_lookaheads_initialize): these.
11352 (lalr): Adjust.
11353
113542002-06-15 Akim Demaille <akim@epita.fr>
11355
11356 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
11357 out of...
11358 (grammar_rules_print): here.
11359 * src/reduce.c (reduce_output): Use it.
11360 * tests/reduce.at (Useless Rules, Reduced Automaton)
11361 (Underivable Rules): Adjust.
11362
113632002-06-15 Akim Demaille <akim@epita.fr>
11364
11365 Copy BYacc's nice way to report the grammar.
11366
11367 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
11368 New.
11369 Don't print the rules' location, it is confusing and useless.
11370 (rule_print): Use grammar_rhs_print.
11371 * src/print.c (print_grammar): Use grammar_rules_print.
11372
113732002-06-15 Akim Demaille <akim@epita.fr>
11374
11375 Complete and rationalize `useless thing' warnings.
11376
11377 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
11378 (symbol_tag_print): New.
11379 Use them everywhere in place of accessing directly the tag member.
11380 * src/gram.h, src/gram.c (rule_print): New.
11381 Use it where a rule used to be printed `by hand'.
11382 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
11383 (reduce_grammar_tables): Report the useless rules.
11384 (reduce_print): Useless things are a warning, not an error.
11385 Report it as such.
11386 * tests/reduce.at (Useless Nonterminals, Useless Rules):
11387 (Reduced Automaton, Underivable Rules): Adjust.
11388 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
11389 * tests/conflicts.at (Unresolved SR Conflicts)
11390 (Solved SR Conflicts): Adjust.
11391
113922002-06-15 Akim Demaille <akim@epita.fr>
11393
11394 Let symbols have a location.
11395
11396 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
11397 (getsym): Adjust.
11398 Adjust all callers.
11399 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
11400 Use location_t, not int.
11401 * src/symtab.c (symbol_check_defined): Take advantage of the
11402 location.
11403 * tests/regression.at (Invalid inputs): Adjust.
11404
114052002-06-15 Akim Demaille <akim@epita.fr>
11406
11407 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
11408 (input): Don't try to initialize yylloc here, do it in the
11409 scanner.
11410 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
11411 * src/gram.h (rule_t): Change line and action_line into location
11412 and action_location, of location_t type.
11413 Adjust all dependencies.
11414 * src/location.h, src/location.c (empty_location): New.
11415 * src/reader.h, src/reader.c (grammar_start_symbol_set)
11416 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
11417 (grammar_current_rule_symbol_append)
11418 (grammar_current_rule_action_append): Expect a location as argument.
11419 * src/reader.c (grammar_midrule_action): Adjust to attach an
11420 action's location as dummy symbol location.
11421 * src/symtab.h, src/symtab.c (startsymbol_location): New.
11422 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
11423 the line numbers.
11424
114252002-06-14 Akim Demaille <akim@epita.fr>
11426
11427 Grammar declarations may be found in the grammar section.
11428
11429 * src/parse-gram.y (rules_or_grammar_declaration): New.
11430 (declarations): Each declaration may end with a semicolon, not
11431 just...
11432 (grammar_declaration): `"%union"'.
11433 (grammar): Branch to rules_or_grammar_declaration.
11434
114352002-06-14 Akim Demaille <akim@epita.fr>
11436
11437 * src/main.c (main): Invoke scanner_free.
11438
114392002-06-14 Akim Demaille <akim@epita.fr>
11440
11441 * src/output.c (m4_invoke): Extracted from...
11442 (output_skeleton): here.
11443 Free tempfile.
11444
114452002-06-14 Akim Demaille <akim@epita.fr>
11446
11447 * src/parse-gram.y (directives, directive, gram)
11448 (grammar_directives, precedence_directives, precedence_directive):
11449 Rename as...
11450 (declarations, declaration, grammar, grammar_declaration)
11451 (precedence_declaration, precedence_declarator): these.
11452 (symbol_declaration): New.
11453
114542002-06-14 Akim Demaille <akim@epita.fr>
11455
11456 * src/files.c (action_obstack): Remove, unused.
11457 (output_obstack): Remove it, and all its dependencies, as it is no
11458 longer needed.
11459 * src/reader.c (epilogue_set): Build the epilogue in the
11460 muscle_obstack.
11461 * src/output.h, src/output.c (muscle_obstack): Move to...
11462 * src/muscle_tab.h, src/muscle_tab.h: here.
11463 (muscle_init): Initialize muscle_obstack.
11464 (muscle_free): New.
11465 * src/main.c (main): Call it.
11466
114672002-06-14 Akim Demaille <akim@epita.fr>
11468
11469 * src/location.h: New, extracted from...
11470 * src/reader.h: here.
11471 * src/Makefile.am (noinst_HEADERS): Merge into
11472 (bison_SOURCES): this.
11473 Add location.h.
11474 * src/parse-gram.y: Use location_t instead of Bison's.
11475 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
11476 Use location_t instead of ints.
11477
114782002-06-14 Akim Demaille <akim@epita.fr>
11479
11480 * data/bison.simple, data/bison.c++: Be sure to restore the
11481 current #line when returning to the skeleton contents after having
11482 exposed the input file's #line.
11483
114842002-06-12 Akim Demaille <akim@epita.fr>
11485
11486 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
11487 eager.
11488 * tests/actions.at (Exotic Dollars): New.
11489
114902002-06-12 Akim Demaille <akim@epita.fr>
11491
11492 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
11493 ['"/] too eagerly.
11494 * tests/input.at (Torturing the Scanner): New.
11495
114962002-06-11 Akim Demaille <akim@epita.fr>
11497
11498 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
11499 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
11500 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
11501 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
11502 * src/reader.c (reader): Use it.
11503
115042002-06-11 Akim Demaille <akim@epita.fr>
11505
11506 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
11507 Adjust all callers.
11508 (scanner_last_string_free): New.
11509
115102002-06-11 Akim Demaille <akim@epita.fr>
11511
11512 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
11513 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
11514 (last_string, YY_OBS_FREE): New.
11515 Use them when returning an ID.
11516
115172002-06-11 Akim Demaille <akim@epita.fr>
11518
11519 Have Bison grammars parsed by a Bison grammar.
11520
11521 * src/reader.c, src/reader.h (prologue_augment): New.
11522 * src/reader.c (copy_definition): Remove.
11523
11524 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
11525 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
11526 (grammar_current_rule_prec_set, grammar_current_rule_check)
11527 (grammar_current_rule_symbol_append)
11528 (grammar_current_rule_action_append): Export.
11529 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
11530 (symbol_list_action_append): Remove.
11531 Hook the routines from reader.
11532 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
11533 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
11534
11535 * src/reader.c (read_declarations): Remove, unused.
11536
11537 * src/parse-gram.y: Handle the epilogue.
11538 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
11539 (grammar_start_symbol_set): this.
11540 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
11541 * src/reader.c (readgram): Remove, unused.
11542 (reader): Adjust to insert eoftoken and axiom where appropriate.
11543
11544 * src/reader.c (copy_dollar): Replace with...
11545 * src/scan-gram.h (handle_dollar): this.
11546 * src/parse-gram.y: Remove `%thong'.
11547
11548 * src/reader.c (copy_at): Replace with...
11549 * src/scan-gram.h (handle_at): this.
11550
11551 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
11552 New.
11553
11554 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
11555 time being.
11556
11557 * src/reader.h, src/reader.c (grammar_rule_end): New.
11558
11559 * src/parse.y (current_type, current_class): New.
11560 Implement `%nterm', `%token' support.
11561 Merge `%term' into `%token'.
11562 (string_as_id): New.
11563 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
11564 type name.
11565
11566 * src/parse-gram.y: Be sure to handle properly the beginning of
11567 rules.
11568
11569 * src/parse-gram.y: Handle %type.
11570 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
11571
11572 * src/parse-gram.y: More directives support.
11573 * src/options.c: No longer handle source directives.
11574
11575 * src/parse-gram.y: Fix %output.
11576
11577 * src/parse-gram.y: Handle %union.
11578 Use the prologue locations.
11579 * src/reader.c (parse_union_decl): Remove.
11580
11581 * src/reader.h, src/reader.c (epilogue_set): New.
11582 * src/parse-gram.y: Use it.
11583
11584 * data/bison.simple, data/bison.c++: b4_stype is now either not
11585 defined, then default to int, or to the contents of %union,
11586 without `union' itself.
11587 Adjust.
11588 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
11589
11590 * src/output.c (actions_output): Don't output braces, as they are
11591 already handled by the scanner.
11592
11593 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
11594 characters to themselves.
11595
11596 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
11597 that the epilogue has a proper #line.
11598
11599 * src/parse-gram.y: Handle precedence/associativity.
11600
11601 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
11602 a terminal.
11603 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
11604 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
11605 at all to define terminals that cannot be emitted.
11606
11607 * src/scan-gram.l: Escape M4 characters.
11608
11609 * src/scan-gram.l: Working properly with escapes in user
11610 strings/characters.
11611
11612 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
11613 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
11614 grammar.
11615 Use more modest sizes, as for the time being the parser does not
11616 release memory, and therefore the process swallows a huge amount
11617 of memory.
11618
11619 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
11620 stricter %token grammar.
11621
11622 * src/symtab.h (associativity): Add `undef_assoc'.
11623 (symbol_precedence_set): Do nothing when passed an undef_assoc.
11624 * src/symtab.c (symbol_check_alias_consistence): Adjust.
11625
11626 * tests/regression.at (Invalid %directive): Remove, as it is now
11627 meaningless.
11628 (Invalid inputs): Adjust to the new error messages.
11629 (Token definitions): The new grammar doesn't allow too many
11630 eccentricities.
11631
11632 * src/lex.h, src/lex.c: Remove.
11633 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
11634 (copy_character, copy_string2, copy_string, copy_identifier)
11635 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
11636 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
11637 (parse_action): Remove.
11638 * po/POTFILES.in: Adjust.
11639
116402002-06-11 Akim Demaille <akim@epita.fr>
11641
11642 * src/reader.c (parse_action): Don't store directly into the
11643 rule's action member: return the action as a string.
11644 Don't require `rule_length' as an argument: compute it.
11645 (grammar_current_rule_symbol_append)
11646 (grammar_current_rule_action_append): New, eved out from
11647 (readgram): here.
11648 Remove `action_flag', `rulelength', unused now.
11649
116502002-06-11 Akim Demaille <akim@epita.fr>
11651
11652 * src/reader.c (grammar_current_rule_prec_set).
11653 (grammar_current_rule_check): New, eved out from...
11654 (readgram): here.
11655 Remove `xaction', `first_rhs': useless.
11656 * tests/input.at (Type clashes): New.
11657 * tests/existing.at (GNU Cim Grammar): Adjust.
11658
116592002-06-11 Akim Demaille <akim@epita.fr>
11660
11661 * src/reader.c (grammar_midrule_action): New, Eved out from
11662 (readgram): here.
11663
116642002-06-11 Akim Demaille <akim@epita.fr>
11665
11666 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
11667 New.
11668 (readgram): Use them as replacement of inlined code, crule and
11669 crule1.
11670
116712002-06-11 Akim Demaille <akim@epita.fr>
11672
11673 * src/reader.c (grammar_end, grammar_symbol_append): New.
11674 (readgram): Use them.
11675 Make the use of `p' as local as possible.
11676
116772002-06-10 Akim Demaille <akim@epita.fr>
11678
11679 GCJ's parser requires the tokens to be defined before the prologue.
11680
11681 * data/bison.simple: Output the token definition before the user's
11682 prologue.
11683 * tests/regression.at (Braces parsing, Duplicate string)
11684 (Mixing %token styles): Check the output from bison.
11685 (Early token definitions): New.
11686
116872002-06-10 Akim Demaille <akim@epita.fr>
11688
11689 * src/symtab.c (symbol_user_token_number_set): Don't complain when
11690 assigning twice the same user number to a token, so that we can
11691 use it in...
11692 * src/lex.c (lex): here.
11693 Also use `symbol_class_set' instead of hand written code.
11694 * src/reader.c (parse_assoc_decl): Likewise.
11695
116962002-06-10 Akim Demaille <akim@epita.fr>
11697
11698 * src/symtab.c, src/symtab.c (symbol_class_set)
11699 (symbol_user_token_number_set): New.
11700 * src/reader.c (parse_token_decl): Use them.
11701 Use a switch instead of ifs.
11702 Use a single argument.
11703
117042002-06-10 Akim Demaille <akim@epita.fr>
11705
11706 Remove `%thong' support as it is undocumented, unused, duplicates
11707 `%token's job, and creates useless e-mail traffic with people who
11708 want to know what it is, why it is undocumented, unused, and
11709 duplicates `%token's job.
11710
11711 * src/reader.c (parse_thong_decl): Remove.
11712 * src/options.c (option_table): Remove "thong".
11713 * src/lex.h (tok_thong): Remove.
11714
117152002-06-10 Akim Demaille <akim@epita.fr>
11716
11717 * src/symtab.c, src/symtab.c (symbol_type_set)
11718 (symbol_precedence_set): New.
11719 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
11720 (value_components_used): Remove, unused.
11721
117222002-06-09 Akim Demaille <akim@epita.fr>
11723
11724 Move symbols handling code out of the reader.
11725
11726 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
11727 (axiom): Move to...
11728 * src/symtab.h, src/symtab.c: here.
11729
11730 * src/gram.c (start_symbol): Remove: use startsymbol->number.
11731 * src/reader.c (startval): Rename as...
11732 * src/symtab.h, src/symtab.c (startsymbol): this.
11733 * src/reader.c: Adjust.
11734
11735 * src/reader.c (symbol_check_defined, symbol_make_alias)
11736 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11737 (token_translations_init)
11738 Move to...
11739 * src/symtab.c: here.
11740 * src/reader.c (packsymbols): Move to...
11741 * src/symtab.h, src/symtab.c (symbols_pack): here.
11742 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
11743 argument.
11744
117452002-06-03 Akim Demaille <akim@epita.fr>
11746
11747 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
11748 then statements.
11749
117502002-06-03 Akim Demaille <akim@epita.fr>
11751
11752 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
11753 structs with non literals.
11754 * src/scan-skel.l: never-interactive.
11755 * src/conflicts.c (enum conflict_resolution_e): No trailing
11756 comma.
11757 * src/getargs.c (usage): Split long literal strings.
11758 Reported by Hans Aberg.
11759
117602002-05-28 Akim Demaille <akim@epita.fr>
11761
11762 * data/bison.c++: Use C++ ostreams.
11763 (cdebug_): New member.
11764
117652002-05-28 Akim Demaille <akim@epita.fr>
11766
11767 * src/output.c (output_skeleton): Be sure to allocate enough room
11768 for `/' _and_ for `\0' in full_skeleton.
11769
117702002-05-28 Akim Demaille <akim@epita.fr>
11771
11772 * data/bison.c++: Catch up with bison.simple:
11773 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11774 and Paul Eggert <eggert@twinsun.com>: `error' handing.
11775 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
11776 and popping traces.
11777
117782002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11779
11780 * src/output.c (output_skeleton): Put an explicit path in front of
11781 the skeleton file name, rather than relying on the -I directory,
11782 to partially alleviate effects of having a skeleton file lying around
11783 in the current directory.
11784
117852002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11786
11787 * src/conflicts.c (log_resolution): Correct typo:
11788 obstack_printf should be obstack_fgrow1.
11789
117902002-05-26 Akim Demaille <akim@epita.fr>
11791
11792 * src/state.h (state_t): `solved_conflicts' is a new member.
11793 * src/LR0.c (new_state): Set it to 0.
11794 * src/conflicts.h, src/conflicts.c (print_conflicts)
11795 (free_conflicts, solve_conflicts): Rename as...
11796 (conflicts_print, conflicts_free, conflicts_solve): these.
11797 Adjust callers.
11798 * src/conflicts.c (enum conflict_resolution_e)
11799 (solved_conflicts_obstack): New, used by...
11800 (log_resolution): this.
11801 Adjust to attach the conflict resolution to each state.
11802 Complete the description with the precedence/associativity
11803 information.
11804 (resolve_sr_conflict): Adjust.
11805 * src/print.c (print_state): Output its solved_conflicts.
11806 * tests/conflicts.at (Unresolved SR Conflicts)
11807 (Solved SR Conflicts): Exercise --report=all.
11808
118092002-05-26 Akim Demaille <akim@epita.fr>
11810
11811 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
11812 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
11813 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
11814 (token_number_t, item_number_as_token_number)
11815 (token_number_as_item_number, muscle_insert_token_number_table):
11816 Rename as...
11817 (symbol_number_t, item_number_as_symbol_number)
11818 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
11819 these, since it is more appropriate.
11820
118212002-05-26 Akim Demaille <akim@epita.fr>
11822
11823 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
11824 `Error:' lines.
11825 * data/bison.simple (yystos) [YYDEBUG]: New.
11826 (yyparse) [YYDEBUG]: Display the symbols which are popped during
11827 error recovery.
11828 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
11829
118302002-05-25 Akim Demaille <akim@epita.fr>
11831
11832 * doc/bison.texinfo (Debugging): Split into...
11833 (Tracing): this new section, its former contents, and...
11834 (Understanding): this new section.
11835 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
11836 by...
11837 (report_flag): this.
11838 Adjust all dependencies.
11839 (report_args, report_types, report_argmatch): New.
11840 (usage, getargs): Report/support -r, --report.
11841 * src/options.h
11842 (struct option_table_struct): Rename as..,
11843 (struct option_table_s): this.
11844 Rename the `set_flag' member to `flag' to match with getopt_long's
11845 struct.
11846 * src/options.c (option_table): Split verbose into an entry for
11847 %verbose, and another for --verbose.
11848 Support --report/-r, so remove -r from the obsolete --raw.
11849 * src/print.c: Attach full item sets and lookaheads reports to
11850 report_flag instead of trace_flag.
11851 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
11852
118532002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11854 and Paul Eggert <eggert@twinsun.com>
11855
11856 * data/bison.simple (yyparse): Correct error handling to conform to
11857 POSIX and yacc. Specifically, after syntax error is discovered,
11858 do not reduce further before shifting the error token.
11859 Clean up the code a bit by removing the labels yyerrdefault,
11860 yyerrhandle, yyerrpop.
11861 * NEWS: Document the above.
11862
118632002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11864
11865 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
11866 type; it isn't always big enough, since it doesn't necessarily
11867 include non-terminals.
11868 (yytranslate): Expand definition of yy_token_number_type, so that
11869 the latter can be removed.
11870 (yy_token_number_type): Remove, only one use.
11871 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
11872 don't use TokenNumberType as element type.
11873
11874 * tests/regression.at: Modify expected output to agree with change
11875 to yyr1 and yytranslate.
11876
118772002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
11878
11879 * src/reader.c (parse_action): Use copy_character instead of
11880 obstack_1grow.
11881
118822002-05-13 Akim Demaille <akim@epita.fr>
11883
11884 * tests/regression.at (Token definitions): Prototype yylex and
11885 yyerror.
11886
118872002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11888
11889 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
11890 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
11891 32-bit arithmetic.
11892 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
11893
118942002-05-07 Akim Demaille <akim@epita.fr>
11895
11896 * tests/synclines.at: Be sure to prototype yylex and yyerror to
11897 avoid GCC warnings.
11898
118992002-05-07 Akim Demaille <akim@epita.fr>
11900
11901 Kill GCC warnings.
11902
11903 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
11904 over the RHS of each rule.
11905 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
11906 * src/state.h (state_t): Member `nitems' is unsigned short.
11907 * src/LR0.c (get_state): Adjust.
11908 * src/reader.c (packgram): Likewise.
11909 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
11910 `Type'.
11911 (muscle_insert_int_table): Remove, unused.
11912 (prepare_rules): Remove `max'.
11913
119142002-05-06 Akim Demaille <akim@epita.fr>
11915
11916 * src/closure.c (print_firsts): Display of the symbol tags.
11917 (bitmatrix_print): Move to...
11918 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
11919 here.
11920 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
11921
119222002-05-06 Akim Demaille <akim@epita.fr>
11923
11924 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
11925 hash_do_for_each.
11926
119272002-05-06 Akim Demaille <akim@epita.fr>
11928
11929 * src/LR0.c (new_state, get_state): Instead of using the global
11930 `kernel_size' and `kernel_base', have two new arguments:
11931 `core_size' and `core'.
11932 Adjust callers.
11933
119342002-05-06 Akim Demaille <akim@epita.fr>
11935
11936 * src/reader.c (packgram): No longer end `ritem' with a 0
11937 sentinel: it is not used.
11938
119392002-05-05 Akim Demaille <akim@epita.fr>
11940
11941 New experimental feature: display the lookaheads in the report and
11942 graph.
11943
11944 * src/print (print_core): When --trace-flag, display the rules
11945 lookaheads.
11946 * src/print_graph.c (print_core): Likewise.
11947 Swap the arguments.
11948 Adjust caller.
11949
119502002-05-05 Akim Demaille <akim@epita.fr>
11951
11952 * tests/torture.at (Many lookaheads): New test.
11953
119542002-05-05 Akim Demaille <akim@epita.fr>
11955
11956 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
11957 (GENERATE_MUSCLE_INSERT_TABLE): this.
11958 (output_int_table, output_unsigned_int_table, output_short_table)
11959 (output_token_number_table, output_item_number_table): Replace with...
11960 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
11961 (muscle_insert_short_table, muscle_insert_token_number_table)
11962 (muscle_insert_item_number_table): these.
11963 Adjust all callers.
11964 (prepare_tokens): Don't free `translations', since...
11965 * src/reader.h, src/reader.c (grammar_free): do it.
11966 Move to...
11967 * src/gram.h, src/gram.c (grammar_free): here.
11968 * data/bison.simple, data/bison.c++: b4_token_number_max is now
11969 b4_translate_max.
11970
119712002-05-05 Akim Demaille <akim@epita.fr>
11972
11973 * src/output.c (output_unsigned_int_table): New.
11974 (prepare_rules): `i' is unsigned.
11975 `prhs', `rline', `r2' are unsigned int.
11976 Rename muscle `rhs_number_max' as `rhs_max'.
11977 Output muscles `prhs_max', `rline_max', and `r2_max'.
11978 Free rline and r1.
11979 * data/bison.simple, data/bison.c++: Adjust to use these muscles
11980 to compute types instead of constant types.
11981 * tests/regression.at (Web2c Actions): Adjust.
11982
119832002-05-04 Akim Demaille <akim@epita.fr>
11984
11985 * src/symtab.h (SALIAS, SUNDEF): Rename as...
11986 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
11987 Adjust dependencies.
11988 * src/output.c (token_definitions_output): Be sure not to output a
11989 `#define 'a'' when fed with `%token 'a' "a"'.
11990 * tests/regression.at (Token definitions): New.
11991
119922002-05-03 Paul Eggert <eggert@twinsun.com>
11993
11994 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
11995 for K&R C.
11996
119972002-05-03 gettextize <bug-gnu-gettext@gnu.org>
11998
11999 * Makefile.am (SUBDIRS): Remove intl.
12000 (EXTRA_DIST): Add config/config.rpath.
12001
120022002-05-03 Akim Demaille <akim@epita.fr>
12003
12004 * data/bison.simple (m4_if): Don't output empty enums.
12005 And actually, output valid enum definitions :(.
12006
120072002-05-03 Akim Demaille <akim@epita.fr>
12008
12009 * configure.bat: Remove, completely obsolete.
12010 * Makefile.am (EXTRA_DIST): Adjust.
12011 Don't distribute config.rpath...
12012 * config/Makefile.am (EXTRA_DIST): Do it.
12013
120142002-05-03 Akim Demaille <akim@epita.fr>
12015
12016 * configure.in (GETTEXT_VERSION): New.
12017 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
12018
120192002-05-03 Akim Demaille <akim@epita.fr>
12020
12021 * data/bison.simple (b4_token_enum): New.
12022 (b4_token_defines): Use it to output tokens both as #define and
12023 enums.
12024 Suggested by Paul Eggert.
12025 * src/output.c (token_definitions_output): Don't output spurious
12026 white spaces.
12027
120282002-05-03 Akim Demaille <akim@epita.fr>
12029
12030 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12031
120322002-05-02 Robert Anisko <robert@lrde.epita.fr>
12033
12034 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
12035 Update the stack class, give a try to deque as the default container.
12036
120372002-05-02 Akim Demaille <akim@epita.fr>
12038
12039 * data/bison.simple (yyparse): Do not implement @$ = @1.
12040 (YYLLOC_DEFAULT): Adjust to do it.
12041 * doc/bison.texinfo (Location Default Action): Fix.
12042
120432002-05-02 Akim Demaille <akim@epita.fr>
12044
12045 * src/reader.c (parse_braces): Merge into...
12046 (parse_action): this.
12047
120482002-05-02 Akim Demaille <akim@epita.fr>
12049
12050 * configure.in (ALL_LINGUAS): Remove.
12051 * po/LINGUAS, hr.po: New.
12052
120532002-05-02 Akim Demaille <akim@epita.fr>
12054
12055 Remove the so called hairy (semantic) parsers.
12056
12057 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
12058 * src/gram.h, src/gram.c (semantic_parser): Remove.
12059 (rule_t): Remove the guard and guard_line members.
12060 * src/lex.h (token_t): remove tok_guard.
12061 * src/options.c (option_table): Remove %guard and %semantic_parser
12062 support.
12063 * src/output.c, src/output.h (guards_output): Remove.
12064 (prepare): Adjust.
12065 (token_definitions_output): Don't output the `T'
12066 tokens (???).
12067 (output_skeleton): Don't output the guards.
12068 * src/files.c, src/files.c (attrsfile): Remove.
12069 * src/reader.c (symbol_list): Remove the guard and guard_line
12070 members.
12071 Adjust dependencies.
12072 (parse_guard): Remove.
12073 * data/bison.hairy: Remove.
12074 * doc/bison.texinfo (Environment Variables): Remove occurrences of
12075 BISON_HAIRY.
12076
120772002-05-02 Akim Demaille <akim@epita.fr>
12078
12079 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
12080 (parse_guard): Rename the formal argument `stack_offset' as
12081 `rule_length', which is more readable.
12082 Adjust callers.
12083 (copy_at, copy_dollar): Instead of outputting the hard coded
12084 values of $$, $n and so forth, output invocation to b4_lhs_value,
12085 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
12086 Note: this patch partially drops `semantic-parser' support: it
12087 always does `rule_length - n', where semantic parsers ought to
12088 always use `-n'.
12089 * data/bison.simple, data/bison.c++ (b4_lhs_value)
12090 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
12091
120922002-05-02 Akim Demaille <akim@epita.fr>
12093
12094 * configure.in (AC_INIT): Bump to 1.49b.
12095 (AM_INIT_AUTOMAKE): Short invocation.
12096
120972002-05-02 Akim Demaille <akim@epita.fr>
12098
12099 Version 1.49a.
12100
121012002-05-01 Akim Demaille <akim@epita.fr>
12102
12103 * src/skeleton.h: Remove.
12104
121052002-05-01 Akim Demaille <akim@epita.fr>
12106
12107 * src/skeleton.h: Fix the #endif.
12108 Reported by Magnus Fromreide.
12109
121102002-04-26 Paul Eggert <eggert@twinsun.com>
12111
12112 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
12113 Define if we define YYSTYPE and YYLTYPE, respectively.
12114 (YYCOPY): Fix [] quoting problem in the non-GCC case.
12115
121162002-04-25 Robert Anisko <robert@lrde.epita.fr>
12117
12118 * src/scan-skel.l: Postprocess quadrigraphs.
12119
12120 * src/reader.c (copy_character): New function, used to output
12121 single characters while replacing `[' and `]' with quadrigraphs, to
12122 avoid troubles with M4 quotes.
12123 (copy_comment): Output characters with copy_character.
12124 (read_additionnal_code): Likewise.
12125 (copy_string2): Likewise.
12126 (copy_definition): Likewise.
12127
12128 * tests/calc.at: Exercise M4 quoting.
12129
121302002-04-25 Akim Demaille <akim@epita.fr>
12131
12132 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
12133 between `!' and the command.
12134 Reported by Paul Eggert.
12135
121362002-04-24 Robert Anisko <robert@lrde.epita.fr>
12137
12138 * tests/calc.at: Exercise prologue splitting.
12139
12140 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
12141 `b4_post_prologue' instead of `b4_prologue'.
12142
12143 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
12144 muscles.
12145 (output): Free pre_prologue_obstack and post_prologue_obstack.
12146 * src/files.h, src/files.c (attrs_obstack): Remove.
12147 (pre_prologue_obstack, post_prologue_obstack): New.
12148 * src/reader.c (copy_definition): Add a parameter to specify the
12149 obstack to fill, instead of using attrs_obstack unconditionally.
12150 (read_declarations): Pass pre_prologue_obstack to copy_definition if
12151 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
12152
121532002-04-23 Paul Eggert <eggert@twinsun.com>
12154
12155 * data/bison.simple: Remove unnecessary commentary and white
12156 space differences from 1_29-branch.
12157 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
12158
12159 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
12160 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
12161 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
12162 constructors or destructors.
12163
12164 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
12165
121662002-04-23 Akim Demaille <akim@epita.fr>
12167
12168 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
12169 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
12170 location with columns.
12171 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
12172 All reported by Paul Eggert.
12173
121742002-04-22 Akim Demaille <akim@epita.fr>
12175
12176 * src/reduce.c (dump_grammar): Move to...
12177 * src/gram.h, src/gram.c (grammar_dump): here.
12178 Be sure to separate long item numbers.
12179 Don't read the members of a rule's prec if its nil.
12180
121812002-04-22 Akim Demaille <akim@epita.fr>
12182
12183 * src/output.c (table_size, table_grow): New.
12184 (MAXTABLE): Remove, replace uses with table_size.
12185 (pack_vector): Instead of dying when the table is too big, grow it.
12186
121872002-04-22 Akim Demaille <akim@epita.fr>
12188
12189 * data/bison.simple (yyr1): Its type is that of a token number.
12190 * data/bison.c++ (r1_): Likewise.
12191 * tests/regression.at (Web2c Actions): Adjust.
12192
121932002-04-22 Akim Demaille <akim@epita.fr>
12194
12195 * src/reader.c (token_translations_init): 256 is now the default
12196 value for the error token, i.e., it will be assigned another
12197 number if the user assigned 256 to one of her tokens.
12198 (reader): Don't force 256 to error.
12199 * doc/bison.texinfo (Symbols): Adjust.
12200 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
12201 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
12202 etc. instead of 10, 20, 30 (which was used to `jump' over error
12203 (256) and undefined (2)).
12204
122052002-04-22 Akim Demaille <akim@epita.fr>
12206
12207 Propagate more token_number_t.
12208
12209 * src/gram.h (token_number_as_item_number)
12210 (item_number_as_token_number): New.
12211 * src/output.c (GENERATE_OUTPUT_TABLE): New.
12212 Use it to create output_item_number_table and
12213 output_token_number_table.
12214 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
12215 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
12216 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
12217 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
12218
122192002-04-22 Akim Demaille <akim@epita.fr>
12220
12221 * src/output.h, src/output.c (get_lines_number): Remove.
12222
122232002-04-19 Akim Demaille <akim@epita.fr>
12224
12225 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
12226 as Lex/Flex'.
12227 (Debugging): More details about enabling the debugging features.
12228 (Table of Symbols): Describe $$, $n, @$, and @n.
12229 Suggested by Tim Josling.
12230
122312002-04-19 Akim Demaille <akim@epita.fr>
12232
12233 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
12234
122352002-04-10 Akim Demaille <akim@epita.fr>
12236
12237 * src/system.h: Rely on HAVE_LIMITS_H.
12238 Suggested by Paul Eggert.
12239
122402002-04-09 Akim Demaille <akim@epita.fr>
12241
12242 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
12243 full stderr, and strip it according to the bison options, instead
12244 of composing the error message from different bits.
12245 This makes it easier to check for several error messages.
12246 Adjust all the invocations.
12247 Add an invocation exercising the error token.
12248 Add an invocation demonstrating a stupid error message.
12249 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
12250 Adjust the tests.
12251 Error message are for stderr, not stdout.
12252
122532002-04-09 Akim Demaille <akim@epita.fr>
12254
12255 * src/gram.h, src/gram.c (error_token_number): Remove, use
12256 errtoken->number.
12257 * src/reader.c (reader): Don't specify the user token number (2)
12258 for $undefined, as it uselessly prevents using it.
12259 * src/gram.h (token_number_t): Move to...
12260 * src/symtab.h: here.
12261 (state_t.number): Is a token_number_t.
12262 * src/print.c, src/reader.c: Use undeftoken->number instead of
12263 hard coded 2.
12264 (Even though this 2 is not the same as above: the number of the
12265 undeftoken remains being 2, it is its user token number which
12266 might not be 2).
12267 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
12268 `user_token_number_max'.
12269 Output `undef_token_number'.
12270 * data/bison.simple, data/bison.c++: Use them.
12271 Be sure to map invalid yylex return values to
12272 `undef_token_number'. This saves us from gratuitous SEGV.
12273
12274 * tests/conflicts.at (Solved SR Conflicts)
12275 (Unresolved SR Conflicts): Adjust.
12276 * tests/regression.at (Web2c Actions): Adjust.
12277
122782002-04-08 Akim Demaille <akim@epita.fr>
12279
12280 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
12281 Adding #line.
12282 Remove the duplicate `typedefs'.
12283 (RhsNumberType): Fix the declaration and various other typos.
12284 Use __ofile__.
12285 * data/bison.simple: Use __ofile__.
12286 * src/scan-skel.l: Handle __ofile__.
12287
122882002-04-08 Akim Demaille <akim@epita.fr>
12289
12290 * src/gram.h (item_number_t): New, the type of item numbers in
12291 RITEM. Note that it must be able to code symbol numbers as
12292 positive number, and the negation of rule numbers as negative
12293 numbers.
12294 Adjust all dependencies (pretty many).
12295 * src/reduce.c (rule): Remove this `short *' pointer: use
12296 item_number_t.
12297 * src/system.h (MINSHORT, MAXSHORT): Remove.
12298 Include `limits.h'.
12299 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
12300 (shortcpy): Remove.
12301 (MAXTABLE): Move to...
12302 * src/output.c (MAXTABLE): here.
12303 (prepare_rules): Use output_int_table to output rhs.
12304 * data/bison.simple, data/bison.c++: Adjust.
12305 * tests/torture.at (Big triangle): Move the limit from 254 to
12306 500.
12307 * tests/regression.at (Web2c Actions): Ajust.
12308
12309 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
12310 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
12311 passes, but produces negative #line number, once fixed, GCC is
12312 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
12313 C), it passes.
12314 * src/state.h (state_h): Code input lines on ints, not shorts.
12315
123162002-04-08 Akim Demaille <akim@epita.fr>
12317
12318 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
12319 and then the grammar.
12320
123212002-04-08 Akim Demaille <akim@epita.fr>
12322
12323 * src/system.h: No longer using strndup.
12324
123252002-04-07 Akim Demaille <akim@epita.fr>
12326
12327 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
12328 * src/output.c (output_table_data): Return the longest number.
12329 (prepare_tokens): Output `token_number_max').
12330 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
12331 New.
12332 Use them to define yy_token_number_type/TokenNumberType.
12333 Use this type for yytranslate.
12334 * tests/torture.at (Big triangle): Push the limit from 124 to
12335 253.
12336 * tests/regression.at (Web2c Actions): Adjust.
12337
123382002-04-07 Akim Demaille <akim@epita.fr>
12339
12340 * tests/torture.at (Big triangle): New.
12341 (GNU AWK Grammar, GNU Cim Grammar): Move to...
12342 * tests/existing.at: here.
12343
123442002-04-07 Akim Demaille <akim@epita.fr>
12345
12346 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
12347 nritems.
12348 Adjust dependencies.
12349
123502002-04-07 Akim Demaille <akim@epita.fr>
12351
12352 * src/reader.c: Normalize increments to prefix form.
12353
123542002-04-07 Akim Demaille <akim@epita.fr>
12355
12356 * src/reader.c, symtab.c: Remove debugging code.
12357
123582002-04-07 Akim Demaille <akim@epita.fr>
12359
12360 Rename all the `bucket's as `symbol_t'.
12361
12362 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
12363 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
12364 * src/symtab.c, src/symtab.h (bucket): Rename as...
12365 (symbol_t): this.
12366 (symbol_list_new, bucket_check_defined, bucket_make_alias)
12367 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
12368 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
12369 (buckets_new, buckets_free, buckets_do): Rename as...
12370 (symbol_list_new, symbol_check_defined, symbol_make_alias)
12371 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
12372 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
12373 (symbols_new, symbols_free, symbols_do): these.
12374
123752002-04-07 Akim Demaille <akim@epita.fr>
12376
12377 Use lib/hash for the symbol table.
12378
12379 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
12380 EOF.
12381 * src/lex.c (lex): Set the `number' member of new terminals.
12382 * src/reader.c (bucket_check_defined, bucket_make_alias)
12383 (bucket_check_alias_consistence, bucket_translation): New.
12384 (reader, grammar_free, readgram, token_translations_init)
12385 (packsymbols): Adjust.
12386 (reader): Number the predefined tokens.
12387 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
12388 for predefined tokens.
12389 * src/symtab.h (bucket): Remove all the hash table related
12390 members.
12391 * src/symtab.c (symtab): Replace by...
12392 (bucket_table): this.
12393 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
12394 (buckets_new, buckets_do): New.
12395
123962002-04-07 Akim Demaille <akim@epita.fr>
12397
12398 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
12399 (start_symbol, max_user_token_number, semantic_parser)
12400 (error_token_number): Initialize.
12401 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
12402 Initialize.
12403 (reader): Don't.
12404 (errtoken, eoftoken, undeftoken, axiom): Extern.
12405
124062002-04-07 Akim Demaille <akim@epita.fr>
12407
12408 * src/gram.h (rule_s): prec and precsym are now pointers
12409 to the bucket giving the priority/associativity.
12410 Member `associativity' removed: useless.
12411 * src/reduce.c, src/conflicts.c: Adjust.
12412
124132002-04-07 Akim Demaille <akim@epita.fr>
12414
12415 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
12416 Properly escape the symbols' TAG when outputting them.
12417
124182002-04-07 Akim Demaille <akim@epita.fr>
12419
12420 * src/lalr.h (LA): Is a bitsetv, not bitset*.
12421
124222002-04-07 Akim Demaille <akim@epita.fr>
12423
12424 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
12425 (LArule): this, which is an array to rule_t*.
12426 * src/print.c, src/conflicts.c: Adjust.
12427
124282002-04-07 Akim Demaille <akim@epita.fr>
12429
12430 * src/gram.h (rule_t): Rename `number' as `user_number'.
12431 `number' is a new member.
12432 Adjust dependencies.
12433 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
12434
124352002-04-07 Akim Demaille <akim@epita.fr>
12436
12437 As a result of the previous patch, it is no longer needed
12438 to reorder ritem itself.
12439
12440 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
12441
124422002-04-07 Akim Demaille <akim@epita.fr>
12443
12444 Be sure never to walk through RITEMS, but use only data related to
12445 the rules themselves. RITEMS should be banished.
12446
12447 * src/output.c (output_token_translations): Rename as...
12448 (prepare_tokens): this.
12449 In addition to `translate', prepare the muscles `tname' and
12450 `toknum', which were handled by...
12451 (output_rule_data): this.
12452 Remove, and move the remainder of its outputs into...
12453 (prepare_rules): this new routines, which also merges content from
12454 (output_gram): this.
12455 (prepare_rules): Be sure never to walk through RITEMS.
12456 (output_stos): Rename as...
12457 (prepare_stos): this.
12458 (output): Always invoke prepare_states, after all, just don't use it
12459 in the output if you don't need it.
12460
124612002-04-07 Akim Demaille <akim@epita.fr>
12462
12463 * src/LR0.c (new_state): Display `nstates' as the name of the
12464 newly created state.
12465 Adjust to initialize first_state and last_state if needed.
12466 Be sure to distinguish the initial from the final state.
12467 (new_states): Create the itemset of the initial state, and use
12468 new_state.
12469 * src/closure.c (closure): Now that the initial state has its
12470 items properly set, there is no need for a special case when
12471 creating `ruleset'.
12472
12473 As a result, now the rule 0, reducing to $axiom, is visible in the
12474 outputs. Adjust the test suite.
12475
12476 * tests/conflicts.at (Solved SR Conflicts)
12477 (Unresolved SR Conflicts): Adjust.
12478 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
12479 * tests/conflicts.at (S/R in initial): New.
12480
124812002-04-07 Akim Demaille <akim@epita.fr>
12482
12483 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
12484 the RHS of the rules.
12485 * src/output.c (output_gram): Likewise.
12486
124872002-04-07 Akim Demaille <akim@epita.fr>
12488
12489 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
12490 bucket.
12491 Adjust all dependencies.
12492 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
12493 `number' of the buckets too.
12494 * src/gram.h: Include `symtab.h'.
12495 (associativity): Move to...
12496 * src/symtab.h: here.
12497 No longer include `gram.h'.
12498
124992002-04-07 Akim Demaille <akim@epita.fr>
12500
12501 * src/gram.h, src/gram.c (rules_rhs_length): New.
12502 (ritem_longest_rhs): Use it.
12503 * src/gram.h (rule_t): `number' is a new member.
12504 * src/reader.c (packgram): Set it.
12505 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
12506 the end of `rules', and count them out of `nrules'.
12507 (reduce_output, dump_grammar): Adjust.
12508 * src/print.c (print_grammar): It is no longer needed to check for
12509 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
12510 * tests/reduce.at (Reduced Automaton): New test.
12511
125122002-04-07 Akim Demaille <akim@epita.fr>
12513
12514 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
12515 lacking `+ 1' to nrules, Bison reported as useless a token if it
12516 was used solely to set the precedence of the last rule...
12517
125182002-04-07 Akim Demaille <akim@epita.fr>
12519
12520 * data/bison.c++, data/bison.simple: Don't output the current file
12521 name in #line, to avoid useless diffs between two identical
12522 outputs under different names.
12523
125242002-04-07 Akim Demaille <akim@epita.fr>
12525
12526 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
12527 Normalize loops to using `< nrules + 1', not `<= nrules'.
12528
125292002-04-07 Akim Demaille <akim@epita.fr>
12530
12531 * TODO: Update.
12532
125332002-04-07 Akim Demaille <akim@epita.fr>
12534
12535 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
12536 bucket.value as bucket.number.
12537
125382002-04-07 Akim Demaille <akim@epita.fr>
12539
12540 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
12541 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
12542 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
12543 RHS, instead of being an index in RITEMS.
12544
125452002-04-04 Paul Eggert <eggert@twinsun.com>
12546
12547 * doc/bison.texinfo: Update copyright date.
12548 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
12549 (Symbols): Warn about running Bison in one character set,
12550 but compiling and/or running in an incompatible one.
12551 Warn about character code 256, too.
12552
125532002-04-03 Paul Eggert <eggert@twinsun.com>
12554
12555 * src/bison.data (YYSTACK_ALLOC): Depend on whether
12556 YYERROR_VERBOSE is nonzero, not whether it is defined.
12557
12558 Merge changes from bison-1_29-branch.
12559
125602002-03-20 Paul Eggert <eggert@twinsun.com>
12561
12562 Merge fixes from Debian bison_1.34-1.diff.
12563
12564 * configure.in (AC_PREREQ): 2.53.
12565
125662002-03-20 Akim Demaille <akim@epita.fr>
12567
12568 * src/conflicts.c (log_resolution): Argument `resolution' is const.
12569
125702002-03-19 Paul Eggert <eggert@twinsun.com>
12571
12572 * src/bison.simple (YYCOPY): New macro.
12573 (YYSTACK_RELOCATE): Use it.
12574 Remove Type arg; no longer needed. All callers changed.
12575 (yymemcpy): Remove; no longer needed.
12576
12577 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
12578 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
12579
125802002-03-19 Akim Demaille <akim@epita.fr>
12581
12582 Test and fix the #line outputs.
12583
12584 * tests/atlocal.at (GCC): New.
12585 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
12586 (Prologue synch line, %union synch line, Postprologue synch line)
12587 (Action synch line, Epilogue synch line): New tests.
12588 * src/reader.c (parse_union_decl): Define the muscle stype_line.
12589 * data/bison.simple, data/bison.c++: Use it.
12590
125912002-03-19 Akim Demaille <akim@epita.fr>
12592
12593 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
12594 (Solved SR Conflicts, %expect not enough, %expect right)
12595 (%expect too much): Move to...
12596 * tests/conflicts.at: this new file.
12597
125982002-03-19 Akim Demaille <akim@epita.fr>
12599
12600 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12601 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
12602 that we can move to enums for instance.
12603 * src/output.c (token_definitions_output): Output a list of
12604 `token-name, token-number' instead of the #define.
12605 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
12606
126072002-03-14 Akim Demaille <akim@epita.fr>
12608
12609 Use Gettext 0.11.1.
12610
126112002-03-09 Robert Anisko <robert@lrde.epita.fr>
12612
12613 * data/bison.c++: Make the user able to add members to the generated
12614 parser by subclassing.
12615
126162002-03-05 Robert Anisko <robert@lrde.epita.fr>
12617
12618 * src/reader.c (read_additionnal_code): `c' should be an integer, not
12619 a character.
12620 Reported by Nicolas Tisserand and Nicolas Burrus.
12621
126222002-03-04 Robert Anisko <robert@lrde.epita.fr>
12623
12624 * src/reader.c: Warn about lacking semi-colons, do not complain.
12625
126262002-03-04 Robert Anisko <robert@lrde.epita.fr>
12627
12628 * data/bison.c++: Remove a debug line.
12629
126302002-03-04 Robert Anisko <robert@lrde.epita.fr>
12631
12632 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
12633 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
12634 provide a default implementation.
12635
126362002-03-04 Akim Demaille <akim@epita.fr>
12637
12638 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
12639 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
12640 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
12641 * tests/semantic.at (Parsing Guards): Similarly.
12642 * src/reader.at (readgram): Complain if the last rule is not ended
12643 with a semi-colon.
12644
126452002-03-04 Akim Demaille <akim@epita.fr>
12646
12647 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
12648 * src/closure.c: here.
12649 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
12650 RTC.
12651 * src/warshall.h, src/warshall.c: Remove.
12652 * tests/sets.at (Broken Closure): Adjust.
12653
126542002-03-04 Akim Demaille <akim@epita.fr>
12655
12656 * src/output.c (output_skeleton): tempdir is const.
12657 bytes_read is unused.
12658
126592002-03-04 Akim Demaille <akim@epita.fr>
12660
12661 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12662 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
12663 Update.
12664 From Michael Hayes.
12665
126662002-03-04 Akim Demaille <akim@epita.fr>
12667
12668 * src/closure.c (closure): `r' is unused.
12669
126702002-03-04 Akim Demaille <akim@epita.fr>
12671
12672 * tests/sets.at (Broken Closure): Add the ending `;'.
12673 * src/reader.at (readgram): Complain if a rule is not ended with a
12674 semi-colon.
12675
126762002-03-04 Akim Demaille <akim@epita.fr>
12677
12678 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
12679 (count_sr_conflicts): Use bitset_count.
12680 * src/reduce.c (inaccessable_symbols): Ditto.
12681 (bits_size): Remove.
12682 * src/warshall.h, src/warshall.c: Convert to bitsetv.
12683
126842002-03-04 Akim Demaille <akim@epita.fr>
12685
12686 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
12687 * src/reduce.c: Remove the `bitset_zero's following the
12688 `bitset_create's, as now it is performed by the latter.
12689
126902002-03-04 Akim Demaille <akim@epita.fr>
12691
12692 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
12693 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
12694 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
12695 latest sources from Michael.
12696
126972002-03-04 Akim Demaille <akim@epita.fr>
12698
12699 * src/output.c (output): Don't free the grammar.
12700 * src/reader.c (grammar_free): New.
12701 * src/main.c (main): Call it and don't free symtab here.
12702
127032002-03-04 Akim Demaille <akim@epita.fr>
12704
12705 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
12706 before returning.
12707 Reported by Benoit Perrot.
12708
127092002-03-04 Akim Demaille <akim@epita.fr>
12710
12711 Use bitset operations when possible, not loops over bits.
12712
12713 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
12714 bitset_or.
12715 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
12716 * src/reduce.c (useless_nonterminals): Formatting changes.
12717 * src/warshall.c (TC): Use bitset_or.
12718
127192002-03-04 Akim Demaille <akim@epita.fr>
12720
12721 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
12722 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
12723 Ditto.
12724
127252002-03-04 Akim Demaille <akim@epita.fr>
12726
12727 * src/lalr.c (F): Now a bitset*.
12728 Adjust all dependencies.
12729
127302002-03-04 Akim Demaille <akim@epita.fr>
12731
12732 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
12733 Adjust all dependencies.
12734
127352002-03-04 Akim Demaille <akim@epita.fr>
12736
12737 * src/L0.c, src/LR0.h (nstates): Be size_t.
12738 Adjust comparisons (signed vs unsigned).
12739 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
12740 bitset*.
12741 Adjust all dependencies.
12742
127432002-03-04 Akim Demaille <akim@epita.fr>
12744
12745 * src/closure.c (firsts): Now, also a bitset.
12746 Adjust all dependencies.
12747 (varsetsize): Remove, now unused.
12748 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
12749
127502002-03-04 Akim Demaille <akim@epita.fr>
12751
12752 * src/print.c: Convert to use bitset.h, not hand coded iterations
12753 over ints.
12754
127552002-03-04 Akim Demaille <akim@epita.fr>
12756
12757 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
12758
127592002-03-04 Akim Demaille <akim@epita.fr>
12760
12761 * src/closure.c (ruleset): Be a bitset.
12762 (rulesetsize): Remove.
12763
127642002-03-04 Akim Demaille <akim@epita.fr>
12765
12766 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12767 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
12768 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
12769 * src/closure.c (fderives): Be an array of bitsets.
12770
127712002-02-28 Robert Anisko <robert@lrde.epita.fr>
12772
12773 * data/bison.c++: Merge the two generated headers. Insert a copyright
12774 notice in each output file.
12775
127762002-02-28 Akim Demaille <akim@epita.fr>
12777
12778 * data/bison.c++: Copy the prologue of bison.simple to fetch
12779 useful M4 definitions, such as b4_header_guard.
12780
127812002-02-25 Akim Demaille <akim@epita.fr>
12782
12783 * src/getargs.c (version): Give the name of the authors, and use a
12784 translator friendly scheme for the bgr
12785 copyright notice.
12786
127872002-02-25 Akim Demaille <akim@epita.fr>
12788
12789 * src/output.c (header_output): Remove, now handled completely via
12790 M4.
12791
127922002-02-25 Akim Demaille <akim@epita.fr>
12793
12794 * m4/m4.m4: New, from CVS Autoconf.
12795 * configure.in: Invoke it.
12796 * src/output.c (output_skeleton): Use its result instead of the
12797 hard coded name.
12798
127992002-02-25 Akim Demaille <akim@epita.fr>
12800
12801 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
12802 Fileutils 4.1.5.
12803 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
12804 * src/output.c (output_skeleton): Use mkstemp to create a real
12805 temporary file.
12806 Move the filling of `skeleton' and its muscle to...
12807 (prepare): here.
12808 (output): Move the definition of the prologue muscle to...
12809 (prepare): here.
12810 * src/system.h (DEFAULT_TMPDIR): New.
12811
128122002-02-14 Paul Eggert <eggert@twinsun.com>
12813
12814 Remove the support for C++ namespace cleanliness; it was
12815 causing more problems than it was curing, since it didn't work
12816 properly on some nonstandard C++ compilers. This can wait
12817 for a proper C++ parser.
12818
12819 * NEWS: Document this.
12820 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
12821 of C++, as it's treated like C now.
12822 * src/bison.simple (YYSTD): Remove.
12823 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
12824 Treat C++ just like Standard C instead of trying to support
12825 namespace cleanliness.
12826
128272002-02-14 Akim Demaille <akim@epita.fr>
12828
12829 * tests/regression.at (else): Adjust to Andreas' change.
12830
128312002-02-14 Akim Demaille <akim@epita.fr>
12832
12833 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
12834
128352002-02-13 Andreas Schwab <schwab@suse.de>
12836
12837 * src/output.c (output_rule_data): Don't output NULL, it might
12838 not be defined yet.
12839
128402002-02-11 Robert Anisko <robert@lrde.epita.fr>
12841
12842 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
12843 (Copyright notice): Update.
12844
128452002-02-11 Akim Demaille <akim@epita.fr>
12846
12847 * tests/regression.at (%nonassoc and eof): Don't include
12848 nonportable headers.
12849
128502002-02-08 Robert Anisko <robert@lrde.epita.fr>
12851
12852 * data/bison.c++: Correct error recovery. Make the user able to
12853 initialize the starting location.
12854
128552002-02-07 Akim Demaille <akim@epita.fr>
12856
12857 * tests/input.at: New.
12858
128592002-02-07 Robert Anisko <robert@lrde.epita.fr>
12860
12861 * data/bison.c++: Replace some direct m4 expansions by constants. Be
12862 more consistent when naming methods and variables. Put preprocessor
12863 directives around tables only needed for debugging.
12864
128652002-02-07 Robert Anisko <robert@lrde.epita.fr>
12866
12867 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
12868 C++ parsers.
12869 (yy::b4_name::parse): Use print_.
12870
128712002-02-07 Robert Anisko <robert@lrde.epita.fr>
12872
12873 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
12874
128752002-02-07 Robert Anisko <robert@lrde.epita.fr>
12876
12877 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
12878 C++ parsers.
12879 (yy::b4_name::parse): Build verbose error messages, and use error_.
12880
128812002-02-06 Robert Anisko <robert@lrde.epita.fr>
12882
12883 * data/bison.c++: Fix m4 quoting in comments.
12884
128852002-02-06 Robert Anisko <robert@lrde.epita.fr>
12886
12887 * data/bison.c++: Adjust the parser code. Fix some muscles that were
12888 not expanded by m4.
12889
128902002-02-05 Akim Demaille <akim@epita.fr>
12891
12892 * data/bison.c++: Adjust to the M4 back end.
12893 More is certainly needed.
12894
128952002-02-05 Akim Demaille <akim@epita.fr>
12896
12897 Give a try to M4 as a back end.
12898
12899 * lib/readpipe.c: New, from wdiff.
12900 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
12901 BISON_HAIRY.
12902 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
12903 specific values. Now it is m4 that performs the lookup.
12904 * src/parse-skel.y: Remove.
12905 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
12906 * src/output.c (actions_output, guards_output)
12907 (token_definitions_output): No longer keeps track of the output
12908 line number, hence remove the second argument.
12909 (guards_output): Check against the guard member of a rule, not the
12910 action member.
12911 Adjust callers.
12912 (output_skeleton): Don't look for the skeleton location, let m4 do
12913 that.
12914 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
12915 file will be used.
12916 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
12917 (prepare): Given that for the time being changesyntax is not
12918 usable in M4, rename the muscles using `-' to `_'.
12919 Define `defines_flag', `output_parser_name' and `output_header_name'.
12920 * src/output.h (actions_output, guards_output)
12921 (token_definitions_output): Adjust prototypes.
12922 * src/scan-skel.l: Instead of scanning the skeletons, it now
12923 processes the output of m4: `__oline__' and `#output'.
12924 * data/bison.simple: Adjust to be used by M4(sugar).
12925 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
12926 to date.
12927 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
12928 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
12929 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
12930 shamelessly stolen from CVS Autoconf.
12931
129322002-02-05 Akim Demaille <akim@epita.fr>
12933
12934 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
12935 * configure.in: Check for the declarations of free and malloc.
12936 * src/muscle_tab.c: Adjust.
12937
129382002-02-05 Akim Demaille <akim@epita.fr>
12939
12940 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
12941 which have no values.
12942
129432002-02-05 Akim Demaille <akim@epita.fr>
12944
12945 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
12946 * data/: here.
12947
129482002-01-29 Paul Eggert <eggert@twinsun.com>
12949
12950 * src/bison.simple (YYSIZE_T): Do not define merely because
12951 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
12952 On some platforms, <alloca.h> does not declare YYSTD (size_t).
12953
129542002-01-27 Akim Demaille <akim@epita.fr>
12955
12956 Fix `%nonassoc and eof'.
12957
12958 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
12959 which were not properly copied! Replace
12960 memcpy (res->errs, src->errs, src->nerrs);
12961 with
12962 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
12963 !!!
12964 * tests/regression.at (%nonassoc and eof): Adjust to newest
12965 Autotest: `.' is not in the PATH.
12966
129672002-01-27 Akim Demaille <akim@epita.fr>
12968
12969 * tests/sets.at (AT_EXTRACT_SETS): New.
12970 (Nullable): Use it.
12971 (Firsts): New.
12972
129732002-01-26 Akim Demaille <akim@epita.fr>
12974
12975 * tests/actions.at, tests/calc.at, tests/headers.at,
12976 * tests/torture.at: Adjust to the newest Autotest which no longer
12977 forces `.' in the PATH.
12978
129792002-01-25 Akim Demaille <akim@epita.fr>
12980
12981 * tests/regression.at (%nonassoc and eof): New.
12982 Suggested by Robert Anisko.
12983
129842002-01-24 Akim Demaille <akim@epita.fr>
12985
12986 Bison dumps core when trying to complain about broken input files.
12987 Reported by Cris van Pelt.
12988
12989 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
12990 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
12991 into...
12992 (Invalid inputs): Strengthen: exercise parse_percent_token.
12993
129942002-01-24 Robert Anisko <robert.anisko@epita.fr>
12995
12996 * src/Makefile.am: Add bison.c++.
12997 * src/bison.c++: New skeleton.
12998
129992002-01-21 Paolo Bonzini <bonzini@gnu.org>
13000
13001 * po/it.po: New.
13002
130032002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
13004
13005 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
13006
130072002-01-20 Marc Autret <marc@gnu.org>
13008
13009 * src/files.c (compute_output_file_names): Fix
13010
130112002-01-20 Marc Autret <marc@gnu.org>
13012
13013 * tests/output.at: New test.
13014 * src/files.c (compute_base_names): Don't map extensions when
13015 the YACC flag is set, use defaults.
13016 Reported by Evgeny Stambulchik.
13017
130182002-01-20 Marc Autret <marc@gnu.org>
13019
13020 * src/system.h: Need to define __attribute__ away for non-GCC
13021 compilers as well (i.e., the vendor C compiler).
13022 Suggested by Albert Chin-A-Young.
13023
130242002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
13025
13026 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
13027 canonical definition.
13028 * src/system.h: Use the canonical definition for PARAMS (avoids
13029 a conflict with the macro from lib/hash.h).
13030
130312002-01-11 Akim Demaille <akim@epita.fr>
13032
13033 * configure.in: Use AC_FUNC_STRNLEN.
13034 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
13035
130362002-01-09 Akim Demaille <akim@epita.fr>
13037
13038 * src/files.c, src/files.h (output_infix): New.
13039 (tab_extension): Remove.
13040 (compute_base_names): Compute the former, drop the latter.
13041 * src/output.c (prepare): Insert the muscles `output-infix', and
13042 `output-suffix'.
13043 * src/parse-skel.y (string, string.1): New.
13044 (section.header): Use it.
13045 (section.yacc): Remove.
13046 (prefix): Remove too.
13047 * src/scan-skel.l: Adjust.
13048 * src/bison.simple, src/bison.hairy: Adjust.
13049
130502002-01-09 Akim Demaille <akim@epita.fr>
13051
13052 * configure.in (WERROR_CFLAGS): Compute it.
13053 * src/Makefile.am (CFLAGS): Pass it.
13054 * tests/atlocal.in (CFLAGS): Idem.
13055 * src/files.c: Fix a few warnings.
13056 (get_extension_index): Remove, unused.
13057
130582002-01-08 Akim Demaille <akim@epita.fr>
13059
13060 * src/getargs.c (AS_FILE_NAME): New.
13061 (getargs): Use it to convert DOSish file names.
13062 * src/files.c (base_name): Rename as full_base_name to avoid
13063 clashes with `base_name ()'.
13064 (filename_split): New.
13065 (compute_base_names): N-th rewrite, using filename_split.
13066
130672002-01-08 Akim Demaille <akim@epita.fr>
13068
13069 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
13070 New, stolen from the Fileutils 4.1.
13071 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
13072 * configure.in: Check for the presence of memrchr, and of its
13073 prototype.
13074
130752002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
13076
13077 * lib/hash.h (__P): Added definition for this macro.
13078 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
13079 BUILT_SOURCES, to ensure they are generated first.
13080 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
13081 %error-verbose to allow bootstrapping with bison 1.30x.
13082
130832002-01-06 Akim Demaille <akim@epita.fr>
13084
13085 * src/reader.c (parse_braces): Don't fetch the next char, the
13086 convention is to fetch on entry.
13087 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
13088 'switch' without a following semicolon.
13089 * tests/regression.at (braces parsing): New.
13090
130912002-01-06 Akim Demaille <akim@epita.fr>
13092
13093 Bison is dead wrong in its RR conflict reports.
13094
13095 * tests/torture.at (GNU Cim Grammar): New.
13096 * src/conflicts.c (count_rr_conflicts): Fix.
13097
130982002-01-06 Akim Demaille <akim@epita.fr>
13099
13100 Creating package.m4 from configure.ac causes too many problems.
13101
13102 * tests/Makefile.am (package.m4): Create it by hand,
13103 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
13104
131052002-01-06 Akim Demaille <akim@epita.fr>
13106
13107 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
13108 skeleton.h.
13109
131102002-01-04 Paul Eggert <eggert@twinsun.com>
13111
13112 * doc/bison.texinfo (Debugging):
13113 Remove YYSTDERR; it's no longer defined or used.
13114 Also, s/cstdio.h/cstdio/.
13115
131162002-01-03 Akim Demaille <akim@epita.fr>
13117
13118 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
13119
131202002-01-03 Akim Demaille <akim@epita.fr>
13121
13122 * src/parse-skel.y (process_skeleton): Don't bind the parser's
13123 tracing code to --trace, wait for a better --trace option, with
13124 args.
13125
131262002-01-03 Akim Demaille <akim@epita.fr>
13127
13128 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
13129 The ISO C++ standard is extremely clear about it: stderr is
13130 considered a macro, not a regular symbol (see table 94 `Header
13131 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
13132 Therefore std:: does not apply to it. It still does with fprintf.
13133 Also, s/cstdio.h/cstdio/.
13134
131352002-01-03 Akim Demaille <akim@epita.fr>
13136
13137 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
13138 for non system headers.
13139
131402002-01-02 Akim Demaille <akim@epita.fr>
13141
13142 Equip the skeleton chain with location tracking, runtime trace,
13143 pure parser and scanner.
13144
13145 * src/parse-skel.y: Request a pure parser, locations, and prefix
13146 renaming.
13147 (%union): Having several members with the same type does not help
13148 type mismatches, simplify.
13149 (YYPRINT, yyprint): New.
13150 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
13151 (skel_error): this.
13152 Handle locations.
13153 * src/scan-skel.l: Adjust to these changes.
13154 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
13155 (LOCATION_PRINT, skel_control_t): New.
13156
131572001-12-30 Akim Demaille <akim@epita.fr>
13158
13159 * src/parse-skel.y: Get rid of the shift/reduce conflict:
13160 replace `gb' with BLANKS.
13161 * src/scan-skel.l: Adjust.
13162
131632001-12-30 Akim Demaille <akim@epita.fr>
13164
13165 * src/system.h: We don't need nor want bcopy.
13166 Throw away MS-DOS crap: we don't need getpid.
13167 * configure.in: We don't need strndup. It was even causing
13168 problems: because Flex includes the headers *before* us,
13169 _GNU_SOURCE is not defined by config.h, and therefore strndup was
13170 not visible.
13171 * lib/xstrndup.c: New.
13172 * src/scan-skel.l: Use it.
13173 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
13174 * src/parse-skel.y: Use %directives instead of #defines.
13175
131762001-12-30 Akim Demaille <akim@epita.fr>
13177
13178 * src/skeleton.h: New.
13179 * src/output.c (output_parser, output_master_parser): Remove, dead
13180 code.
13181 * src/output.h (get_lines_number, actions_output, guards_output)
13182 (token_definitions_output): Prototype them.
13183 * src/parse-skel.y: Add the license notice.
13184 Include output.h and skeleton.h.
13185 (process_skeleton): Returns void, and takes a single parameter.
13186 * src/scan-skel.l: Add the license notice.
13187 Include skeleton.h.
13188 Don't use %option yylineno: it seems that then Flex imagines
13189 REJECT has been used, and therefore it won't reallocate its
13190 buffers (which makes no other sense to me than a bug). It results
13191 in warnings for `unused: yy_flex_realloc'.
13192
131932001-12-30 Robert Anisko <robert.anisko@epita.fr>
13194
13195 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
13196 (MUSCLE_INSERT_PREFIX): ...to there.
13197 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
13198 (MUSCLE_INSERT_PREFIX): Move from here...
13199
13200 * src/bison.hairy: Add a section directive. Put braces around muscle
13201 names. This parser skeleton is still broken, but Bison should not
13202 choke on a bad muscle 'syntax'.
13203 * src/bison.simple: Add a section directive. Put braces around muscle
13204 names.
13205
13206 * src/files.h (strsuffix, stringappend): Add declarations.
13207 (tab_extension): Add declaration.
13208 (short_base_name): Add declaration.
13209
13210 * src/files.c (strsuffix, stringappend): No longer static. These
13211 functions are used in the skeleton parser.
13212 (tab_extension): New.
13213 (compute_base_names): Use the computations done in this function
13214 to guess if the generated parsers should have '.tab' in their
13215 names.
13216 (short_base_name): No longer static.
13217
13218 * src/output.c (output_skeleton): New.
13219 (output): Disable call to output_master_parser, and give a try to
13220 a new skeleton handling system.
13221 (guards_output, actions_output): No longer static.
13222 (token_definitions_output, get_lines_number): No longer static.
13223
13224 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
13225
13226 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
13227 parse-skel.y.
13228
13229 * src/parse-skel.y: New file.
13230 * src/scan-skel.l: New file.
13231
132322001-12-29 Akim Demaille <akim@epita.fr>
13233
13234 %name-prefix is broken.
13235
13236 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
13237 Adjust all dependencies.
13238 * tests/headers.at (export YYLTYPE): Strengthen this test: use
13239 %name-prefix.
13240
13241 Renaming yylval but not yylloc is not consistent. Now we do.
13242
13243 * src/bison.simple: Prefix yylloc if used.
13244 * doc/bison.texinfo (Decl Summary): Document that.
13245
132462001-12-29 Akim Demaille <akim@epita.fr>
13247
13248 * doc/bison.texinfo: Promote `%long-directive' over
13249 `%long_directive'.
13250 Remove all references to fixed-output-files, yacc is enough.
13251
132522001-12-29 Akim Demaille <akim@epita.fr>
13253
13254 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
13255 user prologue. These are defaults.
13256 * tests/actions.at (Mid-rule actions): Make sure the user can
13257 define YYDEBUG and YYERROR_VERBOSE.
13258
132592001-12-29 Akim Demaille <akim@epita.fr>
13260
13261 * src/output.c (header_output): Don't forget to export YYLTYPE and
13262 yylloc.
13263 * tests/headers.at (export YYLTYPE): New, make sure it does.
13264 * tests/regression.at (%union and --defines, Invalid CPP headers):
13265 Move to...
13266 * tests/headers.at: here.
13267
132682001-12-29 Akim Demaille <akim@epita.fr>
13269
13270 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
13271
132722001-12-29 Akim Demaille <akim@epita.fr>
13273
13274 * tests/actions.at (Mid-rule actions): Output on a single line
13275 instead of several.
13276
132772001-12-29 Akim Demaille <akim@epita.fr>
13278
13279 * doc/bison.texinfo: Formatting changes.
13280
132812001-12-29 Akim Demaille <akim@epita.fr>
13282
13283 Don't store the token defs in a muscle, just be ready to output it
13284 on command. Now possible via `symbols'. Fixes a memory leak.
13285
13286 * src/output.c (token_definitions_output): New.
13287 (output_parser, header_output): Use it.
13288 * src/reader.c (symbols_save): Remove.
13289
132902001-12-29 Akim Demaille <akim@epita.fr>
13291
13292 * src/bison.simple: Do not provide a default for YYSTYPE and
13293 YYLTYPE before the user's prologue. Otherwise it's hardly... a
13294 default.
13295
132962001-12-29 Akim Demaille <akim@epita.fr>
13297
13298 Mid-rule actions are simply... ignored!
13299
13300 * src/reader.c (readgram): Be sure to attach mid-rule actions to
13301 the empty-rule associated to the dummy symbol, not to the host
13302 rule.
13303 * tests/actions.at (Mid-rule actions): New.
13304
133052001-12-29 Akim Demaille <akim@epita.fr>
13306
13307 Memory leak.
13308
13309 * src/reader.c (reader): Free grammar.
13310
133112001-12-29 Akim Demaille <akim@epita.fr>
13312
13313 Memory leak.
13314
13315 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
13316 since it allocates it for each state, although only one is needed.
13317 (allocate_storage): Do it here.
13318
133192001-12-29 Akim Demaille <akim@epita.fr>
13320
13321 * src/options.h, src/options.c (create_long_option_table): Rename
13322 as...
13323 (long_option_table_new): this, with a clearer prototype.
13324 (percent_table): Remove, unused,
13325 * src/getargs.c (getargs): Adjust.
13326
133272001-12-29 Akim Demaille <akim@epita.fr>
13328
13329 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
13330 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
13331 as states.
13332
133332001-12-29 Akim Demaille <akim@epita.fr>
13334
13335 * src/lalr.c (build_relations): Rename `states' as `states1'.
13336 Sorry, I don't understand exactly what it is, no better name...
13337
133382001-12-29 Akim Demaille <akim@epita.fr>
13339
13340 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
13341 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
13342 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
13343 as rules.
13344
133452001-12-29 Akim Demaille <akim@epita.fr>
13346
13347 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
13348 ago.
13349
133502001-12-29 Akim Demaille <akim@epita.fr>
13351
13352 * src/reader.c, src/reader.h (user_toknums): Remove.
13353 Adjust all users to use symbols[i]->user_token_number.
13354
133552001-12-29 Akim Demaille <akim@epita.fr>
13356
13357 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
13358 Adjust all users to use symbols[i]->prec or ->assoc.
13359
133602001-12-29 Akim Demaille <akim@epita.fr>
13361
13362 * src/reader.c, src/reader.h (tags): Remove.
13363 Adjust all users to use symbols[i]->tag.
13364
133652001-12-29 Akim Demaille <akim@epita.fr>
13366
13367 * src/gram.h, src/gram.c (symbols): New, similar to state_table
13368 and rule_table.
13369 * src/reader.c (packsymbols): Fill this table.
13370 Drop sprec.
13371 * src/conflicts.c (resolve_sr_conflict): Adjust.
13372 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
13373 single table.
13374 Use symbols[i]->tag instead of tags[i].
13375
133762001-12-29 Akim Demaille <akim@epita.fr>
13377
13378 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
13379 In addition, put a comment in there, to replace...
13380 * tests/regression.at (%union and C comments): Remove.
13381
133822001-12-29 Akim Demaille <akim@epita.fr>
13383
13384 * tests/regression.at (Web2c Actions): Blindly move the actual
13385 output as expected output. The contents *seem* right to me, but I
13386 can't pretend reading perfectly parser tables... Nonetheless, all
13387 the other tests pass correctly, the table look OK, even though the
13388 presence of `$axiom' is to be noted: AFAICS it is useless (but
13389 harmless).
13390
133912001-12-29 Akim Demaille <akim@epita.fr>
13392
13393 * src/reader.c (readgram): Don't add the rule 0 if there were no
13394 rules read. In other words, add it _after_ having performed
13395 grammar sanity checks.
13396 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
13397
133982001-12-29 Akim Demaille <akim@epita.fr>
13399
13400 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
13401 visible, and some states have now a different number.
13402
134032001-12-29 Akim Demaille <akim@epita.fr>
13404
13405 * src/reader.c (readgram): Bind the initial rule's lineno to that
13406 of the first rule.
13407 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
13408 (Solved SR Conflicts): Adjust rule 0's line number.
13409
134102001-12-29 Akim Demaille <akim@epita.fr>
13411
13412 Fix the `GAWK Grammar' failure.
13413
13414 * src/LR0.c (final_state): Initialize to -1 so that we do compute
13415 the reductions of the first state which was mistakenly confused
13416 with the final state because precisely final_state was initialized
13417 to 0.
13418 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
13419 now noticed by Bison.
13420 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
13421 have a reduction on $default.
13422
134232001-12-29 Akim Demaille <akim@epita.fr>
13424
13425 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
13426 rule line numbers.
13427 * src/closure.c (print_closure): Likewise.
13428 * src/derives.c (print_derives): Likewise.
13429 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
13430 now.
13431
134322001-12-29 Akim Demaille <akim@epita.fr>
13433
13434 * src/lalr.c (lookaheads_print): New.
13435 (lalr): Call it when --trace-flag.
13436 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
13437 are dumped.
13438
134392001-12-29 Akim Demaille <akim@epita.fr>
13440
13441 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
13442 when walking through ritem, even via rule->rhs.
13443 * src/reduce.c (dump_grammar, useful_production, reduce_output)
13444 (useful_production, useless_nonterminals): Likewise.
13445 (reduce_grammar_tables): Likewise, plus update nritems.
13446 * src/nullable.c (set_nullable): Likewise.
13447 * src/lalr.c (build_relations): Likewise.
13448 * tests/sets.at (Nullable): Adjust.
13449 Fortunately, now, the $axiom is no longer nullable.
13450
134512001-12-29 Akim Demaille <akim@epita.fr>
13452
13453 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
13454 the 0-sentinel.
13455 * src/gram.c (ritem_longest_rhs): Likewise.
13456 * src/reduce.c (nonterminals_reduce): Likewise.
13457 * src/print_graph.c (print_graph): Likewise.
13458 * src/output.c (output_rule_data): Likewise.
13459 * src/nullable.c (set_nullable): Likewise.
13460
134612001-12-29 Akim Demaille <akim@epita.fr>
13462
13463 * src/output.c: Comment changes.
13464
134652001-12-27 Paul Eggert <eggert@twinsun.com>
13466
13467 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
13468 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
13469 Sparc, as they were causing more porting problems than the
13470 (minor) performance improvement was worth.
13471
13472 Also, catch up with 1.31's YYSTD.
13473
134742001-12-27 Akim Demaille <akim@epita.fr>
13475
13476 * src/output.c (output_gram): Rely on nritems, not the
13477 0-sentinel. See below.
13478 Use -1 as separator, not 0.
13479 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
13480 Rely on -1 as separator in yyrhs, instead of 0.
13481 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
13482 twice `Now at end of input', therefore there are two lines less to
13483 expect.
13484
134852001-12-27 Akim Demaille <akim@epita.fr>
13486
13487 * tests/regression.at (Unresolved SR Conflicts):
13488 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
13489 below.
13490
134912001-12-27 Akim Demaille <akim@epita.fr>
13492
13493 * src/LR0.c (new_state): Recognize the final state by the fact it
13494 is reached by eoftoken.
13495 (insert_start_shifting_state, insert_eof_shifting_state)
13496 (insert_accepting_state, augment_automaton): Remove, since now
13497 these states are automatically computed from the initial state.
13498 (generate_states): Adjust.
13499 * src/print.c: When reporting a rule number to the user, substract
13500 1, so that the axiom rule is rule 0, and the first user rule is 1.
13501 * src/reduce.c: Likewise.
13502 * src/print_graph.c (print_core): For the time being, just as for
13503 the report, depend upon --trace-flags to dump the full set of
13504 items.
13505 * src/reader.c (readgram): Once the grammar read, insert the rule
13506 0: `$axiom: START-SYMBOL $'.
13507 * tests/set.at: Adjust: rule 0 is now displayed, and since the
13508 number of the states has changed (the final state is no longer
13509 necessarily the last), catch up.
13510
135112001-12-27 Akim Demaille <akim@epita.fr>
13512
13513 Try to make the use of the eoftoken valid. Given that its value
13514 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
13515 is used instead of > 0 where appropriate, (ii), depend upon nritems
13516 instead of the 0-sentinel.
13517
13518 * src/gram.h, src/gram.c (nritems): New.
13519 Expected to be duplication of nitems, but for the time being...
13520 * src/reader.c (packgram): Assert nritems and nitems are equal.
13521 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
13522 * src/closure.c (print_closure, print_fderives): Likewise.
13523 * src/gram.c (ritem_print): Likewise.
13524 * src/print.c (print_core, print_grammar): Likewise.
13525 * src/print_graph.c: Likewise.
13526
135272001-12-27 Akim Demaille <akim@epita.fr>
13528
13529 * src/main.c (main): If there are complains after grammar
13530 reductions, then output the report anyway if requested, then die.
13531 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
13532 * src/reader.c (eoftoken): New.
13533 (parse_token_decl): If the token being defined has value `0', it
13534 is the eoftoken.
13535 (packsymbols): No longer hack `tags' to insert `$' by hand.
13536 Be sure to preserve the value of the eoftoken.
13537 (reader): Make sure eoftoken is defined.
13538 Initialize nsyms to 0: now eoftoken is created just like the others.
13539 * src/print.c (print_grammar): Don't special case the eof token.
13540 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
13541 lie anyway, albeit pleasant.
13542 * tests/calc.at: Exercise error messages with eoftoken.
13543 Change the grammar so that empty input is invalid.
13544 Adjust expectations.
13545 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
13546
135472001-12-27 Akim Demaille <akim@epita.fr>
13548
13549 * configure.in: Check the protos of strchr ans strspn.
13550 Replace strchr if needed.
13551 * src/system.h: Provide the protos of strchr, strspn and memchr if
13552 missing.
13553 * lib/strchr.c: New.
13554 * src/reader.c (symbols_save): Use strchr.
13555
135562001-12-27 Akim Demaille <akim@epita.fr>
13557
13558 * src/print.c, src/print_graph.c (escape): New.
13559 Use it to quote the TAGS outputs.
13560 * src/print_graph.c (print_state): Now errors are in red, and
13561 reductions in green.
13562 Prefer high to wide: output the state number on a line of its own.
13563
135642001-12-27 Akim Demaille <akim@epita.fr>
13565
13566 * src/state.h, src/state.c (reductions_new): New.
13567 * src/LR0.c (set_state_table): Let all the states have a
13568 `reductions', even if reduced to 0.
13569 (save_reductions): Adjust.
13570 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
13571 * src/print.c (print_reductions, print_actions): Adjust.
13572 * src/output.c (action_row): Adjust.
13573
135742001-12-27 Akim Demaille <akim@epita.fr>
13575
13576 * src/state.h, src/state.c (errs_new, errs_dup): New.
13577 * src/LR0.c (set_state_table): Let all the states have an errs,
13578 even if reduced to 0.
13579 * src/print.c (print_errs, print_reductions): Adjust.
13580 * src/output.c (output_actions, action_row): Adjust.
13581 * src/conflicts.c (resolve_sr_conflict): Adjust.
13582
135832001-12-27 Akim Demaille <akim@epita.fr>
13584
13585 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
13586
135872001-12-27 Akim Demaille <akim@epita.fr>
13588
13589 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
13590 * src/print.c: here.
13591 (lookaheadset, shiftset): New, used as additional storage by
13592 print_reductions.
13593 (print_results): Adjust.
13594 (print_shifts, print_gotos, print_errs): New, extracted from...
13595 (print_actions): here.
13596 * src/print_graph.c (print_actions): Remove dead code.
13597
135982001-12-27 Akim Demaille <akim@epita.fr>
13599
13600 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
13601 `$n' and `@n'.
13602
136032001-12-27 Akim Demaille <akim@epita.fr>
13604
13605 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
13606 (build_relations): Adjust.
13607
136082001-12-27 Akim Demaille <akim@epita.fr>
13609
13610 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
13611 duplication.
13612
136132001-12-27 Akim Demaille <akim@epita.fr>
13614
13615 * src/reader.c (packgram): Catch nitems overflows.
13616
136172001-12-27 Akim Demaille <akim@epita.fr>
13618
13619 * src/files.c, src/files.h (guard_obstack): Remove.
13620 * src/output.c (output): Adjust.
13621 * src/reader.c (parse_braces): New, factoring...
13622 (copy_action, copy_guard): these two which are renamed as...
13623 (parse_action, parse_guard): these.
13624 As a voluntary consequence, using braces around guards is now
13625 mandatory.
13626
136272001-12-27 Akim Demaille <akim@epita.fr>
13628
13629 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
13630 * src/reader.c (symbol_list): `guard' and `guard_line' are new
13631 members.
13632 (symbol_list_new): Adjust.
13633 (copy_action): action_line is the first line, not the last.
13634 (copy_guard): Just as for actions, store the `action' only, not
13635 the switch/case/break flesh.
13636 Don't parse the user action that might follow the guard, let...
13637 (readgram): do it, i.e., now, there can be an action after a
13638 guard.
13639 In other words the guard is just explicitly optional.
13640 (packgram): Adjust.
13641 * src/output.c (guards_output): New.
13642 (output_parser): Call it when needed.
13643 (output): Also free the guard and attrs obstacks.
13644 * src/files.c, src/files.h (obstack_save): Remove.
13645 (output_files): Remove.
13646 As a result, if one needs the former `.act' file, using an
13647 appropriate skeleton which requires actions and guards is now
13648 required.
13649 * src/main.c (main): Adjust.
13650 * tests/semantic.at: New.
13651 * tests/regression.at: Use `input.y' as input file name.
13652 Avoid 8+3 problems by requiring input.c when the test needs the
13653 parser.
13654
136552001-12-27 Akim Demaille <akim@epita.fr>
13656
13657 * src/reader.c (symbol_list_new): Be sure to initialize all the
13658 fields.
13659
136602001-12-27 Akim Demaille <akim@epita.fr>
13661
13662 All the hacks using a final pseudo state are now useless.
13663
13664 * src/LR0.c (set_state_table): state_table holds exactly nstates.
13665 * src/lalr.c (nLA): New.
13666 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
13667 instead of lookaheadsp from the pseudo state (nstate + 1).
13668
136692001-12-27 Akim Demaille <akim@epita.fr>
13670
13671 * src/output.c (action_row, token_actions): Use a state_t instead
13672 of a integer, and nlookaheads instead of the following state's
13673 lookaheadsp.
13674
136752001-12-27 Akim Demaille <akim@epita.fr>
13676
13677 * src/conflicts.c (log_resolution, flush_shift)
13678 (resolve_sr_conflict, set_conflicts, solve_conflicts)
13679 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
13680 (conflicts_print, print_reductions): Use a state_t instead of an
13681 integer when referring to a state.
13682 As much as possible, depend upon nlookaheads, instead of the
13683 `lookaheadsp' member of the following state (since lookaheads of
13684 successive states are successive, the difference between state n + 1
13685 and n served as the number of lookaheads for state n).
13686 * src/lalr.c (add_lookback_edge): Likewise.
13687 * src/print.c (print_core, print_actions, print_state)
13688 (print_results): Likewise.
13689 * src/print_graph.c (print_core, print_actions, print_state)
13690 (print_graph): Likewise.
13691 * src/conflicts.h: Adjust.
13692
136932001-12-27 Akim Demaille <akim@epita.fr>
13694
13695 * src/bison.hairy: Formatting/comment changes.
13696 ANSIfy.
13697 Remove `register' indications.
13698 Add plenty of `static'.
13699
137002001-12-27 Akim Demaille <akim@epita.fr>
13701
13702 * src/output.c (prepare): Drop the muscle `ntbase' which
13703 duplicates ntokens.
13704 * src/bison.simple: Formatting/comment changes.
13705 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
13706 is an undocumented synonym.
13707
137082001-12-22 Akim Demaille <akim@epita.fr>
13709
13710 * src/output.c (output_table_data): Change the prototype to use
13711 `int' for array ranges: some invocations do pass an int, not a
13712 short.
13713 Reported by Wayne Green.
13714
137152001-12-22 Akim Demaille <akim@epita.fr>
13716
13717 Some actions of web2c.y are improperly triggered.
13718 Reported by Mike Castle.
13719
13720 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
13721 * tests/regression.at (Web2c): Rename as...
13722 (Web2c Report): this.
13723 (Web2c Actions): New.
13724
137252001-12-22 Akim Demaille <akim@epita.fr>
13726
13727 Reductions in web2c.y are improperly reported.
13728 Reported by Mike Castle.
13729
13730 * src/conflicts.c (print_reductions): Fix.
13731 * tests/regression.at (Web2c): New.
13732
137332001-12-18 Akim Demaille <akim@epita.fr>
13734
13735 Some host fail on `assert (!"foo")', which expands to
13736 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
13737 Reported by Nelson Beebee.
13738
13739 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
13740 `#define it_succeeded 0' and `assert (it_succeeded)'.
13741
137422001-12-17 Marc Autret <autret_m@epita.fr>
13743
13744 * src/bison.simple: Don't hard code the skeleton line and filename.
13745 * src/output.c (output_parser): Rename 'line' as 'output_line'.
13746 New line counter 'skeleton_line' (skeleton-line muscle).
13747
137482001-12-17 Paul Eggert <eggert@twinsun.com>
13749
13750 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
13751 YYDEBUG must be defined to a nonzero value.
13752
13753 * src/bison.simple (yytname): Do not assume that the user defines
13754 YYDEBUG to a properly parenthesized expression.
13755
137562001-12-17 Akim Demaille <akim@epita.fr>
13757
13758 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
13759 nlookaheads is a new member.
13760 Adjust all users.
13761 * src/lalr.h (nlookaheads): Remove this orphan declaration.
13762 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
13763 state.
13764
137652001-12-17 Akim Demaille <akim@epita.fr>
13766
13767 * src/files.h, src/files.c (open_files, close_files): Remove.
13768 * src/main.c (main): Don't open/close files, nor invoke lex_free,
13769 let...
13770 * src/reader.c (reader): Do it.
13771
137722001-12-17 Akim Demaille <akim@epita.fr>
13773
13774 * src/conflicts.c (print_reductions): Formatting changes.
13775
137762001-12-17 Akim Demaille <akim@epita.fr>
13777
13778 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
13779 (flush_reduce): New.
13780 (resolve_sr_conflict): Adjust.
13781
137822001-12-17 Akim Demaille <akim@epita.fr>
13783
13784 * src/output.c (output_obstack): Be static and rename as...
13785 (format_obstack): this, to avoid any confusion with files.c's
13786 output_obstack.
13787 * src/reader.h (muscle_obstack): Move to...
13788 * src/output.h: here, since it's defined in output.c.
13789
137902001-12-17 Akim Demaille <akim@epita.fr>
13791
13792 * src/output.c (action_row, save_column, default_goto)
13793 (sort_actions, matching_state, pack_vector): Better variable
13794 locality.
13795
137962001-12-17 Akim Demaille <akim@epita.fr>
13797
13798 * src/output.c: Various formatting changes.
13799
138002001-12-17 Akim Demaille <akim@epita.fr>
13801
13802 * src/files.c (output_files): Free the output_obstack.
13803 * src/main.c (main): Call print and print_graph conditionally.
13804 * src/print.c (print): Work unconditionally.
13805 * src/print_graph.c (print_graph): Work unconditionally.
13806 * src/conflicts.c (log_resolution): Output only if verbose_flag.
13807
138082001-12-16 Marc Autret <autret_m@epita.fr>
13809
13810 * src/output.c (actions_output): Fix. When we use %no-lines,
13811 there is one less line per action.
13812
138132001-12-16 Marc Autret <autret_m@epita.fr>
13814
13815 * src/bison.simple: Remove a useless #line directive.
13816 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
13817 * src/output.c (get_lines_number): New.
13818 (output_parser): Adjust, now takes care about the lines of a
13819 output muscles.
13820 Fix line numbering.
13821 (actions_output): Computes the number of lines taken by actions.
13822 (output_master_parser): Insert new skeleton which is the name of
13823 the output parser file name.
13824
138252001-12-15 Marc Autret <autret_m@epita.fr>
13826
13827 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
13828
138292001-12-15 Marc Autret <autret_m@epita.fr>
13830
13831 * src/output.c (output_gram): Keep track of the hairy one.
13832
138332001-12-15 Akim Demaille <akim@epita.fr>
13834
13835 Make `make distcheck' work.
13836
13837 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
13838 system.h which uses libgettext.h.
13839
138402001-12-15 Akim Demaille <akim@epita.fr>
13841
13842 * src/nullable.c (set_nullable): Useless rules must be skipped,
13843 otherwise, since we range over their symbols, we might look at a
13844 nonterminal which no longer ``exists'', i.e., it is not counted in
13845 `nvars', hence we overflow our arrays.
13846
138472001-12-15 Akim Demaille <akim@epita.fr>
13848
13849 The header can also be produced directly, without any obstack!
13850 Yahoo!
13851
13852 * src/files.c, src/files.h (defines_obstack): Remove.
13853 (compute_header_macro): Global.
13854 (defines_obstack_save): Remove.
13855 * src/reader.c (parse_union_decl): No longer output to
13856 defines_obstack: its content can be found in the `stype' muscle
13857 anyway.
13858 (output_token_translations): Merge into...
13859 (symbols_output): this.
13860 Rename as...
13861 (symbols_save): this.
13862 (reader): Adjust.
13863 * src/output.c (header_output): New.
13864 (output): Call it.
13865
138662001-12-15 Akim Demaille <akim@epita.fr>
13867
13868 * src/reader.c (parse_union_decl): Instead of handling two obstack
13869 simultaneously, use one to define the `stype' muscle, and use the
13870 value of the latter to fill defines_obstack.
13871 (copy_comment): Remove.
13872 (copy_comment2): Work for a single obstack.
13873 Rename as...
13874 (copy_comment): this.
13875
138762001-12-15 Akim Demaille <akim@epita.fr>
13877
13878 * src/lex.c, src/lex.h (xgetc): No longer static.
13879 * src/reader.c (parse_union_decl): Revamp.
13880
138812001-12-15 Akim Demaille <akim@epita.fr>
13882
13883 Still making progress in separating Bison into (i) input, (ii)
13884 process, (iii) output: now we can directly output the parser file
13885 without using table_obstack at all.
13886
13887 * src/files.c, src/files.h (table_obstack): Bye bye.
13888 (parser_file_name): New.
13889 * src/files.c (compute_output_file_names): Compute it.
13890 * src/output.c (actions_output, output_parser)
13891 (output_master_parser): To a file instead of an obstack.
13892
138932001-12-15 Akim Demaille <akim@epita.fr>
13894
13895 Attach actions to rules, instead of pre-outputting them to
13896 actions_obstack.
13897
13898 * src/gram.h (rule_t): action and action_line are new members.
13899 * src/reader.c (symbol_list): Likewise.
13900 (copy_action): Save the actions within the rule.
13901 (packgram): Save them in rule_table.
13902 * src/output.c (actions_output): New.
13903 (output_parser): Use it on `%%actions'.
13904 (output_rule_data): Don't free rule_table.
13905 (output): Do it.
13906 (prepare): Don't save the `action' muscle.
13907 * src/bison.simple: s/%%action/%%actions/.
13908
139092001-12-15 Akim Demaille <akim@epita.fr>
13910
13911 * src/reader.c (copy_action): When --yacc, don't append a `;'
13912 to the user action: let it fail if lacking.
13913 Suggested by Arnold Robbins and Tom Tromey.
13914
139152001-12-14 Akim Demaille <akim@epita.fr>
13916
13917 * src/lex.c (literalchar): Simply return the char you decoded, non
13918 longer mess around with obstacks and int pointers.
13919 Adjust all callers.
13920
139212001-12-14 Akim Demaille <akim@epita.fr>
13922
13923 * src/lex.c (literalchar): Don't escape the special characters,
13924 just decode them, and keep them as char (before, eol was output as
13925 the 2 char string `\n' etc.).
13926 * src/output.c (output_rule_data): Use quotearg to output the
13927 token strings.
13928
139292001-12-13 Paul Eggert <eggert@twinsun.com>
13930
13931 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
13932 Do not infringe on the global user namespace when using C++.
13933 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
13934 All uses of `fprintf' and `stderr' changed.
13935
13936 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
13937
139382001-12-13 Akim Demaille <akim@epita.fr>
13939
13940 The computation of nullable is broken: it doesn't handle empty
13941 RHS's properly.
13942
13943 * tests/torture.at (GNU AWK Grammar): New.
13944 * tests/sets.at (Nullable): New.
13945 * src/nullable.c (set_nullable): Instead of blindly looping over
13946 `ritems', loop over the rules, and then over their rhs's.
13947
13948 Work around Autotest bugs.
13949
13950 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
13951 frame, because Autotest understand lines starting with a `+' as
13952 traces from the shell. Then, they are not processed properly.
13953 Admittedly an Autotest bug, but we don't have time to wait for
13954 Autotest to catch up.
13955 * tests/regression.at (Broken Closure): Adjust to the new table
13956 frames.
13957 Move to...
13958 * tests/sets.at: here.
13959
139602001-12-13 Akim Demaille <akim@epita.fr>
13961
13962 * src/closure.c (closure): Use nrules instead of playing tricks
13963 with BITS_PER_WORD.
13964
139652001-12-13 Akim Demaille <akim@epita.fr>
13966
13967 * src/print.c (print_actions): Output the handling of `$' as the
13968 traces do: shifting the token EOF. Before EOF was treated as a
13969 nonterminal.
13970 * tests/regression.at: Adjust some tests.
13971 * src/print_graph.c (print_core): Complete the set of items via
13972 closure. The next-to-final and final states are still unsatisfying,
13973 but that's to be addressed elsewhere.
13974 No longer output the rule numbers, but do output the state number.
13975 A single loop for the shifts + gotos is enough, but picked a
13976 distinct color for each.
13977 (print_graph): Initialize and finalize closure.
13978
139792001-12-13 Akim Demaille <akim@epita.fr>
13980
13981 * src/reader.c (readgram): Remove dead code, an strip useless
13982 braces.
13983 (get_type): Remove, unused.
13984
139852001-12-12 Akim Demaille <akim@epita.fr>
13986
13987 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
13988 on that of lib/error.c.
13989
139902001-12-12 Akim Demaille <akim@epita.fr>
13991
13992 Some hosts don't like `/' in includes.
13993
13994 * src/system.h: Include libgettext.h without qualifying the path.
13995 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
13996 $(top_srcdir).
13997
139982001-12-11 Marc Autret <autret_m@epita.fr>
13999
14000 * src/output.c (output_parser): Remove useless muscle.
14001
140022001-12-11 Marc Autret <autret_m@epita.fr>
14003
14004 * src/bison.simple: Remove #line just before %%epilogue. It
14005 is now handled in ...
14006 * src/reader.c (read_additionnal_code): Add the output of a
14007 #line for the epilogue.
14008
140092001-12-10 Marc Autret <autret_m@epita.fr>
14010
14011 * src/reader.c (copy_definition): Re-use CPP-outed code which
14012 replace precedent remove.
14013 * src/bison.simple: Remove #line before %%prologue because
14014 %%input-line is wrong at this time.
14015
140162001-12-10 Marc Autret <autret_m@epita.fr>
14017
14018 * src/reader.c (symbols_output): Clean up.
14019 * src/output.c (output_gram, output): Clean up.
14020
140212001-12-10 Akim Demaille <akim@epita.fr>
14022
14023 * src/lalr.c (initialize_lookaheads): New. Extracted from...
14024 * src/LR0.c (set_state_table): here.
14025 * src/lalr.c (lalr): Call it.
14026
140272001-12-10 Akim Demaille <akim@epita.fr>
14028
14029 * src/state.h (shifts): Remove the `number' member: shifts are
14030 attached to state, hence no longer need to be labelled with a
14031 state number.
14032
140332001-12-10 Akim Demaille <akim@epita.fr>
14034
14035 Now that states have a complete set of members, the linked list of
14036 shifts is useless: just fill directly the state's shifts member.
14037
14038 * src/state.h (shifts): Remove the `next' member.
14039 * src/LR0.c (first_state, last_state): Remove.
14040 Adjust the callers.
14041 (augment_automaton): Don't look for the shifts that must be added
14042 a shift on EOF: it is those of the state we looked for! But now,
14043 since shifts are attached, it is no longer needed to looking
14044 merely by its id: its number.
14045
140462001-12-10 Akim Demaille <akim@epita.fr>
14047
14048 * src/LR0.c (augment_automaton): Better variable locality.
14049 Remove an impossible branch: if there is a state corresponding to
14050 the start symbol being shifted, then there is shift for the start
14051 symbol from the initial state.
14052
140532001-12-10 Akim Demaille <akim@epita.fr>
14054
14055 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
14056 only when appropriate: when insert_start_shifting_state' is not
14057 invoked.
14058 * tests/regression.at (Rule Line Numbers): Adjust.
14059
140602001-12-10 Akim Demaille <akim@epita.fr>
14061
14062 * src/LR0.c (augment_automaton): Now that all states have shifts,
14063 merge the two cases addition shifts to the initial state.
14064
140652001-12-10 Akim Demaille <akim@epita.fr>
14066
14067 * src/lalr.c (set_state_table): Move to...
14068 * src/LR0.c: here.
14069 * src/lalr.c (lalr): Don't call it...
14070 * src/LR0.c (generate_states): do it.
14071 * src/LR0.h (first_state): Remove, only the table is used.
14072
140732001-12-10 Akim Demaille <akim@epita.fr>
14074
14075 * src/LR0.h (first_shift, first_reduction): Remove.
14076 * src/lalr.c: Don't use first_shift: find shifts through the
14077 states.
14078
140792001-12-10 Akim Demaille <akim@epita.fr>
14080
14081 * src/LR0.c: Attach shifts to states as soon as they are
14082 computed.
14083 * src/lalr.c (set_state_table): Instead of assigning shifts to
14084 state, just assert that the mapping was properly done.
14085
140862001-12-10 Akim Demaille <akim@epita.fr>
14087
14088 * src/LR0.c (insert_start_shift): Rename as...
14089 (insert_start_shifting_state): this.
14090 (insert_eof_shifting_state, insert_accepting_state): New.
14091 (augment_automaton): Adjust.
14092 Better locality of the variables.
14093 When looking if the start_symbol is shifted from the initial
14094 state, using `while (... symbol != start_symbol ...)' sounds
14095 better than `while (... symbol < start_symbol ...)': If fail
14096 to see how the order between symbols could be relevant!
14097
140982001-12-10 Akim Demaille <akim@epita.fr>
14099
14100 * src/getargs.h: Don't declare `spec_name_prefix' and
14101 `spec_file_prefix', declared by src/files.h.
14102 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
14103 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
14104 * src/output.c (prepare): Adjust.
14105 * src/reader.c (symbols_output): Likewise.
14106 * src/vmsgetargs.c: Vaguely adjust, but who cares?
14107
141082001-12-10 Akim Demaille <akim@epita.fr>
14109
14110 * src/muscle_tab.c (muscle_init): NULL is a better default than
14111 `"0"'.
14112
141132001-12-10 Akim Demaille <akim@epita.fr>
14114
14115 * src/reader.c (reader): Calling symbols_output once is enough.
14116
141172001-12-10 Akim Demaille <akim@epita.fr>
14118
14119 Now that states have a complete set of members, the linked list of
14120 reductions is useless: just fill directly the state's reductions
14121 member.
14122
14123 * src/state.h (struct reductions): Remove member `number' and
14124 `next'.
14125 * src/LR0.c (first_reduction, last_reduction): Remove.
14126 (save_reductions): Don't link the new reductions, store them in
14127 this_state.
14128 * src/lalr.c (set_state_table): No need to attach reductions to
14129 states, it's already done.
14130 * src/output.c (output_actions): No longer free the shifts, then
14131 the reductions, then the states: free all the states and their
14132 members.
14133
141342001-12-10 Akim Demaille <akim@epita.fr>
14135
14136 * src/options.c (OPTN, DRTV, BOTH): New.
14137 (option_table): Use them.
14138
14139 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
14140 the job of system.h.
14141 * src/options.c: Don't include stdio.h and xalloc.h for the same
14142 reasons.
14143
141442001-12-10 Akim Demaille <akim@epita.fr>
14145
14146 * src/output.c (output, prepare): Make sure the values of the
14147 muscles `action' and `prologue' are 0-terminated.
14148
141492001-12-10 Akim Demaille <akim@epita.fr>
14150
14151 Clean up GCC warnings.
14152
14153 * src/reader.c (copy_action): `buf' is not used.
14154 (parse_skel_decl): Be static.
14155 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
14156 * src/options.h (create_long_option_table): Have a real prototype.
14157 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
14158 (hash_delete_at): Return const void *.
14159 Adjust casts to preserve the const.
14160
141612001-12-10 Akim Demaille <akim@epita.fr>
14162
14163 * configure.in: Require 2.52g.
14164 M4 is not needed, but AUTOM4TE is.
14165 * m4/m4.m4: Remove.
14166 * tests/Makefile.am: Adjust.
14167
141682001-12-10 Akim Demaille <akim@epita.fr>
14169
14170 One structure for states is enough, even though theoretically
14171 there are LR(0) states and LALR(1) states.
14172
14173 * src/lalr.h (state_t): Remove.
14174 (state_table): Be state_t **, not state_t *.
14175 * src/state.h (core, CORE_ALLOC): Rename as...
14176 (state_t, STATE_ALLOC): this.
14177 Add the LALR(1) members: shifts, reductions, errs.
14178 * src/LR0.c (state_table): Rename as...
14179 (state_hash): this, to avoid name clashes with the global
14180 `state_table'.
14181 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
14182 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
14183
141842001-12-10 Akim Demaille <akim@epita.fr>
14185
14186 Bison dumps core on bash.y.
14187 Reported by Pascal Bart.
14188
14189 * src/warshall.c (bitmatrix_print): New.
14190 (TC): Use it.
14191 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
14192 j must be the outer loop.
14193 * tests/regression.at (Broken Closure): New.
14194
141952001-12-05 Akim Demaille <akim@epita.fr>
14196
14197 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
14198 its argument.
14199 Reported by Peter Hamorsky.
14200
142012001-12-05 Akim Demaille <akim@epita.fr>
14202
14203 * src/conflicts.c (err_table): Remove.
14204 (resolve_sr_conflict): Adjust.
14205 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
14206 Rename as...
14207 (state_t.reductions, state_t.shifts): this.
14208
142092001-12-05 Akim Demaille <akim@epita.fr>
14210
14211 * src/reduce.c (reduce_grammar_tables): No longer disable the
14212 removal of useless rules via CPP but via `if (0)', so that the
14213 compiler still check the code is valid.
14214 For instance, it should have noticed `rline' no longer exists: use
14215 the `line' member of rule_t.
14216 * src/gram.c (dummy, rline): Remove, unused.
14217
142182001-12-05 Akim Demaille <akim@epita.fr>
14219
14220 * src/output.c (pack_vector): Use assert, not berror.
14221 * src/main.c (berror): Remove, unused.
14222
142232001-12-05 Akim Demaille <akim@epita.fr>
14224
14225 New experimental feature: if --verbose --trace output all the
14226 items of a state, not only its kernel.
14227
14228 * src/print.c (print_core): If `trace_flag', then invoke closure
14229 before outputting the items of the state (print_core is no longer
14230 a correct name them).
14231 (print_results): Invoke new_closure/free_closure if needed.
14232
142332001-12-05 Akim Demaille <akim@epita.fr>
14234
14235 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
14236 * src/closure.c, src/closure.h (itemsetsize): Rename as...
14237 (nitemset): for consistency with the rest of the project.
14238
142392001-12-05 Akim Demaille <akim@epita.fr>
14240
14241 * src/closure.c (print_closure): Improve.
14242 (closure): Use it for printing input and output.
14243
142442001-12-05 Akim Demaille <akim@epita.fr>
14245
14246 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
14247 indexed by nonterminals.
14248
142492001-12-05 Akim Demaille <akim@epita.fr>
14250
14251 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
14252 what it was!).
14253 * src/warshall.h: Remove accidental duplication of the content.
14254
142552001-12-05 Akim Demaille <akim@epita.fr>
14256
14257 * src/closure.c (set_fderives): De-obfuscate.
14258
142592001-12-05 Akim Demaille <akim@epita.fr>
14260
14261 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
14262
142632001-12-05 Akim Demaille <akim@epita.fr>
14264
14265 * src/closure.c (set_firsts): De-obfuscate.
14266
142672001-12-05 Akim Demaille <akim@epita.fr>
14268
14269 * src/output.c (action_row): De-obfuscate
14270 using the good o' techniques: arrays not pointers, variable
14271 locality, BITISSET, RESETBIT etc.
14272
142732001-12-05 Akim Demaille <akim@epita.fr>
14274
14275 Pessimize the code to simplify it: from now on, all the states
14276 have a valid SHIFTS, which NSHIFTS is possibly 0.
14277
14278 * src/LR0.c (shifts_new): Be global and move to..
14279 * src/state.c, src/state.h: here.
14280 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
14281 * src/print_graph: Adjust.
14282
142832001-12-05 Akim Demaille <akim@epita.fr>
14284
14285 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
14286 * src/conflicts.c: Use it.
14287 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
14288 incorrectly ``simplified''.
14289
142902001-12-05 Akim Demaille <akim@epita.fr>
14291
14292 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
14293 using the good o' techniques: arrays not pointers, variable
14294 locality, BITISSET, RESETBIT etc.
14295
142962001-12-05 Akim Demaille <akim@epita.fr>
14297
14298 * src/state.h (SHIFT_SYMBOL): New.
14299 * src/conflicts.c: Use it to deobfuscate.
14300
143012001-12-05 Akim Demaille <akim@epita.fr>
14302
14303 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
14304 (print_reductions): De-obfuscate using the good o' techniques:
14305 arrays not pointers, variable locality, BITISSET.
14306
143072001-12-05 Akim Demaille <akim@epita.fr>
14308
14309 * src/conflicts.c (print_reductions): Arrays, not pointers.
14310 Use BITISSET.
14311
143122001-12-05 Akim Demaille <akim@epita.fr>
14313
14314 * src/conflicts.c (print_reductions): Pessimize, but clarify.
14315
143162001-12-05 Akim Demaille <akim@epita.fr>
14317
14318 * src/conflicts.c (print_reductions): Improve variable locality.
14319
143202001-12-05 Akim Demaille <akim@epita.fr>
14321
14322 * src/conflicts.c (print_reductions): Pessimize, but clarify.
14323
143242001-12-05 Akim Demaille <akim@epita.fr>
14325
14326 * src/conflicts.c (print_reductions): Improve variable locality.
14327
143282001-12-05 Akim Demaille <akim@epita.fr>
14329
14330 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
14331 * src/lalr.c: Use them.
14332
143332001-12-05 Akim Demaille <akim@epita.fr>
14334
14335 * src/LR0.c (augment_automaton): Formatting changes.
14336 Better variable locality.
14337
143382001-12-05 Akim Demaille <akim@epita.fr>
14339
14340 * src/lalr.c (matrix_print): New.
14341 (transpose): Use it.
14342 Use arrays instead of pointers.
14343
143442001-12-05 Akim Demaille <akim@epita.fr>
14345
14346 * src/lalr.c (maxrhs): Move to...
14347 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
14348 * src/lalr.c (build_relations): Adjust.
14349
143502001-12-05 Akim Demaille <akim@epita.fr>
14351
14352 * src/lalr.c (transpose): Free the memory allocated to the
14353 argument, as it is replaced by the results by the unique caller.
14354 (build_relations): Merely invoke transpose: it handles the memory
14355 deallocation.
14356 Improve variable locality.
14357 Avoid variables used as mere abbreviations.
14358 (compute_lookaheads): Use arrays instead of pointers.
14359
143602001-12-05 Akim Demaille <akim@epita.fr>
14361
14362 * src/lalr.c (initialize_F): Improve variable locality.
14363 Avoid variables used as mere abbreviations.
14364
143652001-12-05 Akim Demaille <akim@epita.fr>
14366
14367 * src/derives.c (print_derives): Display the ruleno.
14368 * src/lalr.c (initialize_F, transpose): Better variable locality
14369 to improve readability.
14370 Avoid variables used as mere abbreviations.
14371
143722001-12-05 Akim Demaille <akim@epita.fr>
14373
14374 * src/lalr.c (traverse): Use arrays instead of pointers.
14375
143762001-12-05 Akim Demaille <akim@epita.fr>
14377
14378 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
14379 the handling of squeue.
14380 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
14381
143822001-12-05 Akim Demaille <akim@epita.fr>
14383
14384 Because useless nonterminals are now kept alive (instead of being
14385 `destroyed'), we now sometimes examine them, and store information
14386 related to them. Hence we need to know their number, and adjust
14387 memory allocations.
14388
14389 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
14390 static.
14391 * src/LR0.c (allocate_itemsets): The memory allocated to
14392 `symbol_count' was used for two different purpose: once to count
14393 the number of occurrences of each symbol, and later reassigned to
14394 `shift_symbol', containing the symbol that can be shifted from a
14395 given state.
14396 Deobfuscate, i.e., allocate, use and free `symbol_count' here
14397 only, and...
14398 (new_itemsets): Allocate `shift_symbol' here.
14399 (allocate_itemsets): symbol_count includes useless nonterminals.
14400 Make room for them.
14401 (free_storage): Use `free', not `XFREE', for pointers that cannot
14402 be null.
14403
144042001-12-05 Akim Demaille <akim@epita.fr>
14405
14406 * src/nullable.c (set_nullable): Deobfuscate the handling of
14407 ritem.
14408 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
14409
144102001-12-05 Akim Demaille <akim@epita.fr>
14411
14412 * src/gram.c, src/gram.h (ritem_print): New.
14413 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
14414 (This useless function was defined only to work around VMS linkers
14415 that can't handle compilation units with variables only).
14416 * src/reduce.c (dump_grammar): Use it to trace the construction of
14417 ritem.
14418
144192001-12-04 Paul Eggert <eggert@twinsun.com>
14420
14421 * src/bison.simple (union yyalloc): Change member names
14422 to be the same as the stack names.
14423 (yyparse): yyptr is now union yyalloc *, not char *.
14424 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
14425 and may generate better code on some machines.
14426 (yystpcpy): Use prototype if __STDC__ is defined, not just
14427 if __cplusplus is defined.
14428
144292001-11-30 Akim Demaille <akim@epita.fr>
14430
14431 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
14432 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
14433 Gettext doesn't compile cleanly, and dies with -Werror.
14434 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
14435 Include WARNING_CFLAGS here.
14436 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
14437 before being defined.
14438
144392001-11-27 Paul Eggert <eggert@twinsun.com>
14440
14441 * lib/quotearg.h (quotearg_n, quotearg_n_style):
14442 First arg is int, not unsigned.
14443 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
14444 (SIZE_MAX, UINT_MAX): New macros.
14445 (quotearg_n_options): Abort if N is negative.
14446 Avoid overflow check on hosts where size_t is 64 bits and int
14447 is 32 bits, as overflow is impossible there.
14448 Fix off-by-one typo that caused unnecessary reallocation.
14449
144502001-11-29 Paul Eggert <eggert@twinsun.com>
14451
14452 Name space cleanup in generated parser.
14453
14454 * doc/bison.texinfo (Bison Parser): Discuss system headers
14455 and their effect on the user name space.
14456
14457 * src/bison.simple:
14458 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
14459 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
14460 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
14461
14462 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
14463 on user names when possible.
14464
14465 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
14466 Simplify test for whather <alloca.h> exists.
14467
14468 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
14469
14470 (<stdio.h>): Include if YYDEBUG.
14471
14472 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
14473 ! defined (yyoverflow) && ! defined (yymemcpy).
14474
14475 (yymemcpy, yyparse): Rename local variables as needed so that
14476 they all begin with 'yy'.
14477
14478 (yystrlen, yystpcpy): New functions.
14479
14480 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
14481 All uses changed.
14482
14483 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
14484 instead of relying on string.h functions. Use YYSTACK_ALLOC
14485 and YYSTACK_FREE instead of malloc and free.
14486
144872001-11-30 Akim Demaille <akim@epita.fr>
14488
14489 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
14490 before their first uses.
14491 (YYBISON, YYPURE): Move to the top of the output.
14492
144932001-11-30 Akim Demaille <akim@epita.fr>
14494
14495 * tests/reduce.at (Useless Nonterminals): Fix.
14496
144972001-11-30 Akim Demaille <akim@epita.fr>
14498
14499 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
14500 if body instead of `;' to pacify GCC's warnings.
14501
145022001-11-30 Akim Demaille <akim@epita.fr>
14503
14504 Instead of mapping the LHS of unused rules to -1, keep the LHS
14505 valid, but flag the rules as invalid.
14506
14507 * src/gram.h (rule_t): `useful' is a new member.
14508 * src/print.c (print_grammar): Adjust.
14509 * src/derives.c (set_derives): Likewise.
14510 * src/reader.c (packgram, reduce_output): Likewise.
14511 * src/reduce.c (reduce_grammar_tables): Likewise.
14512 * tests/reduce.at (Underivable Rules, Useless Rules): New.
14513
145142001-11-30 Akim Demaille <akim@epita.fr>
14515
14516 * src/reduce.c (reduce_output): Formatting changes.
14517 * src/print.c (print_results, print_grammar): Likewise.
14518 * tests/regression.at (Rule Line Numbers)
14519 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
14520
145212001-11-30 Akim Demaille <akim@epita.fr>
14522
14523 * src/reduce.c (nonterminals_reduce): Instead of throwing away
14524 useless nonterminals, move them at the end of the symbol arrays.
14525 (reduce_output): Adjust.
14526 * tests/reduce.at (Useless Nonterminals): Adjust.
14527
145282001-11-30 Akim Demaille <akim@epita.fr>
14529
14530 * src/reduce.c: Various comment/formatting changes.
14531 (nonterminals_reduce): New, extracted from...
14532 (reduce_grammar_tables): here.
14533 (reduce_grammar): Call nonterminals_reduce.
14534
145352001-11-29 Paul Eggert <eggert@twinsun.com>
14536
14537 * src/bison.simple (YYSTACK_REALLOC): Remove.
14538 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
14539 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
14540 New macros.
14541 (union yyalloc): New type.
14542 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
14543 an arbitrary restriction on hosts where size_t is wider than int.
14544
14545 (yyparse): Don't dump core if alloca or malloc fails; instead, report
14546 a parser stack overflow. Allocate just one block of memory for all
14547 three stacks, instead of allocating three blocks; this typically is
14548 faster and reduces fragmentation.
14549
14550 Do not limit the number of items in the stack to a value that fits
14551 in 'int', as this is an arbitrary limit on hosts with 64-bit
14552 size_t and 32-bit int.
14553
145542001-11-29 Marc Autret <autret_m@epita.fr>
14555
14556 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
14557 of defining YYERROR_VERBOSE.
14558 [AT_DATA]: $4 is now out of C declarations in the prologue.
14559
145602001-11-28 Marc Autret <autret_m@epita.fr>
14561
14562 * src/reader.c (parse_dquoted_param): New.
14563 (parse_skel_decl): Use it.
14564 * src/lex.h: Add its prototype.
14565 * src/lex.c (literalchar): Become not static.
14566
145672001-11-28 Marc Autret <autret_m@epita.fr>
14568
14569 * src/output.h: And put its extern declaration here.
14570 * src/output.c (error_verbose): Define here.
14571 (prepare): Echo name modification.
14572 * src/getargs.h: Clean its extern declaration.
14573 * src/getargs.c (error_verbose_flag): Remove.
14574 (getargs): Remove case 'e'.
14575 * src/options.c (option_table): 'error-verbose' is now seen as simple
14576 percent option.
14577 Include output.h.
14578
14579 * src/reader.c (read_declarations): Remove case tok_include.
14580 (parse_include_decl): Remove.
14581 * src/lex.h (token_t): Remove tok_include.
14582 * src/options.c (option_table): 'include' is now a simple command line
14583 option.
14584
145852001-11-28 Marc Autret <autret_m@epita.fr>
14586
14587 * src/bison.simple: Adjust muscle names.
14588 * src/muscle_tab.c (muscle_init): Also rename the muscles.
14589 * src/output.c (prepare): s/_/-/ for the muscles names.
14590 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
14591
145922001-11-28 Marc Autret <autret_m@epita.fr>
14593
14594 * src/bison.simple: Fix debug.
14595 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
14596
145972001-11-28 Akim Demaille <akim@epita.fr>
14598
14599 * src/LR0.c (shifts_new): New.
14600 (save_shifts, insert_start_shift, augment_automaton): Use it.
14601
146022001-11-28 Akim Demaille <akim@epita.fr>
14603
14604 * src/closure.c (closure): `b' and `ruleno' denote the same value:
14605 keep ruleno only.
14606
146072001-11-28 Akim Demaille <akim@epita.fr>
14608
14609 * src/closure.c (closure): Instead of looping over word in array
14610 then bits in words, loop over bits in array.
14611
146122001-11-28 Akim Demaille <akim@epita.fr>
14613
14614 * src/closure.c (closure): No longer optimize the special case
14615 where all the bits of `ruleset[r]' are set to 0, to make the code
14616 clearer.
14617
146182001-11-28 Akim Demaille <akim@epita.fr>
14619
14620 * src/closure.c (closure): `r' and `c' are new variables, used to
14621 de-obfuscate accesses to RULESET and CORE.
14622
146232001-11-28 Akim Demaille <akim@epita.fr>
14624
14625 * src/reduce.c (reduce_print): Use ngettext.
14626 (dump_grammar): Improve the trace accuracy.
14627
146282001-11-28 Akim Demaille <akim@epita.fr>
14629
14630 * src/reduce.c (dump_grammar): Don't translate trace messages.
14631
146322001-11-28 Akim Demaille <akim@epita.fr>
14633
14634 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
14635 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
14636 as all tags are free'ed afterwards.
14637 From Enrico Scholz.
14638
146392001-11-27 Paul Eggert <eggert@twinsun.com>
14640
14641 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
14642 use alloca when we didn't want to, and vice versa.
14643
146442001-11-27 Marc Autret <autret_m@epita.fr>
14645
14646 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
14647 initialization.
14648 * src/output.c (prepare): Remove its update.
14649
146502001-11-27 Marc Autret <autret_m@epita.fr>
14651
14652 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
14653 Use %error-verbose.
14654
146552001-11-27 Marc Autret <autret_m@epita.fr>
14656
14657 * src/bison.simple: Remove YYERROR_VERBOSE using.
14658 Use %%error_verbose.
14659 (yyparse): Likewise.
14660 * src/output.c (prepare): Give its final value.
14661 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
14662 * src/getargs.h: Add its extern declaration.
14663 * src/getargs.c (error_verbose_flag): New int.
14664 (getargs): Update to catch new case.
14665 * src/options.c (option_table): 'error-verbose' is a new option.
14666 (shortopts): Update.
14667
146682001-11-27 Akim Demaille <akim@epita.fr>
14669
14670 * src/system.h: Use intl/libgettext.h.
14671 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
14672
146732001-11-27 Akim Demaille <akim@epita.fr>
14674
14675 * tests/torture.at (Exploding the Stack Size with Malloc):
14676 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
14677
146782001-11-27 Akim Demaille <akim@epita.fr>
14679
14680 * src/files.c: Include error.h.
14681 Reported by Hans Aberg.
14682
146832001-11-26 Marc Autret <autret_m@epita.fr>
14684
14685 * src/reader.c (parse_include_decl): New, not yet implemented.
14686 (read_declarations): Add case tok_include.
14687 * src/getargs.h (include): Add its extern definition.
14688 * src/getargs.c (include): New const char *.
14689 (getargs): Add case '-I'.
14690 * src/options.c (option_table): Add include as command line and
14691 percent option.
14692 * src/lex.h (token_t): Add tok_include.
14693
146942001-11-26 Akim Demaille <akim@epita.fr>
14695
14696 * src/reader.c (readgram): Make sure rules for mid-rule actions
14697 have a lineno equal to that of their host rule.
14698 Reported by Hans Aberg.
14699 * tests/regression.at (Rule Line Numbers): New.
14700
147012001-11-26 Akim Demaille <akim@epita.fr>
14702
14703 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
14704 size_ts.
14705
147062001-11-26 Akim Demaille <akim@epita.fr>
14707
14708 * src/complain.c, src/complain.h (error): Remove, provided by
14709 lib/error.[ch].
14710
147112001-11-26 Akim Demaille <akim@epita.fr>
14712
14713 * src/reader.c (read_declarations): Don't abort on tok_illegal,
14714 issue an error message.
14715 * tests/regression.at (Invalid %directive): New.
14716 Reported by Hans Aberg.
14717
147182001-11-26 Akim Demaille <akim@epita.fr>
14719
14720 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
14721 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
14722
147232001-11-26 Akim Demaille <akim@epita.fr>
14724
14725 * src/conflicts.c (conflicts_print): Don't complain at all when
14726 there are no reduce/reduce conflicts, and as many shift/reduce
14727 conflicts as expected.
14728 * tests/regression.at (%expect right): Adjust.
14729
147302001-11-23 Akim Demaille <akim@epita.fr>
14731
14732 * lib/alloca.c: Update, from fileutils.
14733
147342001-11-23 Akim Demaille <akim@epita.fr>
14735
14736 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
14737
147382001-11-23 Akim Demaille <akim@epita.fr>
14739
14740 * src/system.h: Include alloca.h.
14741 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
14742
147432001-11-23 Akim Demaille <akim@epita.fr>
14744
14745 * src/print_graph.c (print_actions): Remove `rule', unused.
14746 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
14747 pacify GCC's signed < unsigned warnings.
14748 * src/closure.c (itemsetsize): Likewise.
14749 * src/reader.c (symbol_list_new): Static.
14750
147512001-11-23 Akim Demaille <akim@epita.fr>
14752
14753 Attaching lineno to buckets is stupid, since only one copy of each
14754 symbol is kept, only the line of the first occurrence is kept too.
14755
14756 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
14757 * src/reader.c (rline_allocated): Remove, unused.
14758 (symbol_list): Have a `line' member.
14759 (symbol_list_new): New.
14760 (readgram): Use it.
14761 * src/print.c (print_grammar): Output the rule line numbers.
14762 * tests/regression.at (Solved SR Conflicts)
14763 (Unresolved SR Conflicts): Adjust.
14764 Reported by Hans Aberg.
14765
147662001-11-22 Marc Autret <autret_m@epita.fr>
14767
14768 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
14769
147702001-11-22 Marc Autret <autret_m@epita.fr>
14771
14772 * src/muscle_tab.c (muscle_init): Remove initialization of
14773 skeleton muscle.
14774 * src/output.c (output_master_parser): Do it here.
14775
147762001-11-20 Akim Demaille <akim@epita.fr>
14777
14778 * po/sv.po: New.
14779 * configure.in (ALL_LINGUAS): Adjust.
14780 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
14781 longer contains strings to translate.
14782
147832001-11-19 Akim Demaille <akim@epita.fr>
14784
14785 * src/conflicts.c (conflicts_print): Add a missing \n.
14786
147872001-11-19 Akim Demaille <akim@epita.fr>
14788
14789 * src/nullable.c (nullable_print): New.
14790 (set_nullable): Call it when tracing.
14791 Better locality of variables.
14792
147932001-11-19 Akim Demaille <akim@epita.fr>
14794
14795 * src/print.c (print_actions): Better locality of variables.
14796
147972001-11-19 Akim Demaille <akim@epita.fr>
14798
14799 * src/derives.c (print_derives): Fix and enrich.
14800 * src/closure.c (print_fderives): Likewise.
14801
148022001-11-19 Akim Demaille <akim@epita.fr>
14803
14804 * src/closure.c (itemsetend): Remove, replaced with...
14805 (itemsetsize): new.
14806
148072001-11-19 Akim Demaille <akim@epita.fr>
14808
14809 * src/LR0.c (kernel_end): Remove, replaced with...
14810 (kernel_size): new.
14811
148122001-11-19 Akim Demaille <akim@epita.fr>
14813
14814 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
14815 to clarify.
14816
148172001-11-19 Akim Demaille <akim@epita.fr>
14818
14819 * src/closure.c (closure): Use arrays instead of pointers to clarify.
14820
148212001-11-19 Akim Demaille <akim@epita.fr>
14822
14823 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
14824 trace messages.
14825 * src/LR0.c: Likewise.
14826 (allocate_itemsets): Use arrays instead of pointers to clarify.
14827
148282001-11-19 Akim Demaille <akim@epita.fr>
14829
14830 * src/getargs.c (statistics_flag): Replace with...
14831 (trace_flag): New.
14832 (longopts): Accept --trace instead of --statistics.
14833 * src/getargs.h, src/options.c: Adjust.
14834 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
14835 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
14836
148372001-11-19 Akim Demaille <akim@epita.fr>
14838
14839 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
14840 pointers to clarify the code.
14841 (save_reductions, save_shifts): Factor common parts of alternatives.
14842
148432001-11-19 Akim Demaille <akim@epita.fr>
14844
14845 * src/LR0.c (new_state, get_state): Complete TRACE code.
14846 * src/closure.c: Include `reader.h' to get `tags', needed by the
14847 trace code.
14848 Rename the conditional DEBUG as TRACE.
14849 Output consistently TRACEs to stderr, not stdout.
14850 * src/derives.c: Likewise.
14851 * src/reduce.c: (inaccessable_symbols): Using if is better style
14852 than goto.
14853 Use `#if TRACE' instead of `#if 0' for tracing code.
14854
148552001-11-19 Akim Demaille <akim@epita.fr>
14856
14857 * src/system.h (LIST_FREE, shortcpy): New.
14858 * src/LR0.c: Use them.
14859 * src/output.c (free_itemsets, free_reductions, free_shifts):
14860 Remove, replaced by LIST_FREE.
14861
148622001-11-19 Akim Demaille <akim@epita.fr>
14863
14864 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
14865 (REDUCTIONS_ALLOC): New.
14866 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
14867 allocation.
14868
148692001-11-19 Akim Demaille <akim@epita.fr>
14870
14871 * src/LR0.c (new_state): Complete trace code.
14872 * src/nullable.c (set_nullable): Don't translate traces.
14873
148742001-11-19 Akim Demaille <akim@epita.fr>
14875
14876 * src/print_graph.c (print_core): Better locality of variables.
14877 * src/print.c (print_core): Likewise.
14878
148792001-11-19 Akim Demaille <akim@epita.fr>
14880
14881 * src/vcg.c: You do the output, so you are responsible of the
14882 handling of VCG syntax, in particular: use quotearg.
14883 * src/print_graph.c: Don't.
14884 (print_actions): Don't output the actions as part of the nodes,
14885 since that's the job of the edges.
14886 (print_state): Don't output by hand: fill the node description,
14887 and ask for its output.
14888
148892001-11-19 Akim Demaille <akim@epita.fr>
14890
14891 * src/bison.simple (yyparse): When verbosely reporting an error,
14892 no longer put additional quotes around token names.
14893 * tests/calc.at: Adjust.
14894
148952001-11-19 Akim Demaille <akim@epita.fr>
14896
14897 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
14898 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
14899 * src/output.c: Adjust.
14900
149012001-11-19 Akim Demaille <akim@epita.fr>
14902
14903 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
14904 (rule_t): this.
14905 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
14906
149072001-11-19 Akim Demaille <akim@epita.fr>
14908
14909 * src/gram.h (rule_t): New.
14910 (rule_table): New.
14911 (rrhs, rlhs): Remove, part of state_t.
14912 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
14913 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14914 * src/reader.c, src/reduce.c: Adjust.
14915
149162001-11-19 Akim Demaille <akim@epita.fr>
14917
14918 * src/reader.c (symbols_output): New, extracted from...
14919 (packsymbols): Here.
14920 (reader): Call it.
14921
149222001-11-19 Akim Demaille <akim@epita.fr>
14923
14924 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
14925 (maxrhs): this new function.
14926
149272001-11-19 Akim Demaille <akim@epita.fr>
14928
14929 * src/lalr.c (F): New macro to access the variable F.
14930 Adjust.
14931
149322001-11-19 Akim Demaille <akim@epita.fr>
14933
14934 * src/lalr.h (LA): New macro to access the variable LA.
14935 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14936 * src/lalr.c: Adjust.
14937
149382001-11-19 Akim Demaille <akim@epita.fr>
14939
14940 * src/lalr.c (initialize_LA): Only initialize LA. Let...
14941 (set_state_table): handle the `lookaheads' members.
14942
149432001-11-19 Akim Demaille <akim@epita.fr>
14944
14945 * src/lalr.h (lookaheads): Removed array, whose contents is now
14946 a member of...
14947 (state_t): this structure.
14948 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14949 Adjust.
14950
149512001-11-19 Akim Demaille <akim@epita.fr>
14952
14953 * src/lalr.h (consistent): Removed array, whose contents is now
14954 a member of...
14955 (state_t): this structure.
14956 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14957 Adjust.
14958
149592001-11-19 Akim Demaille <akim@epita.fr>
14960
14961 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
14962 contents are now members of...
14963 (state_t): this structure.
14964 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14965 Adjust.
14966
149672001-11-19 Akim Demaille <akim@epita.fr>
14968
14969 * src/lalr.h (state_t): New.
14970 (state_table): Be a state_t * instead of a core **.
14971 (accessing_symbol): Remove, part of state_t.
14972 * src/lalr.c: Adjust.
14973 (set_accessing_symbol): Merge into...
14974 (set_state_table): this.
14975 * src/print_graph.c, src/conflicts.c: Adjust.
14976
149772001-11-14 Akim Demaille <akim@epita.fr>
14978
14979 * tests/calc.at, tests/output.at, tests/regression.at,
14980 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
14981 now the tests are run in private dirs, therefore AC_CLEANUP and
14982 family can be simplified to 0-ary.
14983 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
14984 use abs. path to find config.h.
14985 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
14986 stderr, there can be way too much random noise.
14987 Instead pass -Werror to GCC and rely on the exit status.
14988 Reported by Wolfram Wagner.
14989
149902001-11-14 Akim Demaille <akim@epita.fr>
14991
14992 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
14993 defined only if yyoverflow is defined, to avoid `warning: unused
14994 variable `yyvs1''.
14995 Reported by The Test Suite.
14996
149972001-11-14 Akim Demaille <akim@epita.fr>
14998
14999 * src/print.c: Include reduce.h.
15000 Reported by Hans Aberg.
15001
150022001-11-14 Akim Demaille <akim@epita.fr>
15003
15004 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
15005 Revert a previous patch: these are really const.
15006 * src/conflicts.c (conflict_report): Additional useless pair of
15007 braces to pacify GCC's warnings for `if () if () {} else {}'.
15008 * src/lex.c (parse_percent_token): Replace equal_offset with
15009 arg_offset.
15010 arg is const.
15011 Be sure to strdup `arg' when used, since there is no reason for
15012 token_buffer not to change.
15013
150142001-11-14 Akim Demaille <akim@epita.fr>
15015
15016 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
15017 definition.
15018 * src/main.c (main): Use them.
15019 Suggested by Hans Aberg.
15020
150212001-11-12 Akim Demaille <akim@epita.fr>
15022
15023 * src/system.h (ngettext): Now that we use ngettext, be sure to
15024 provide a default definition when NLS are not used.
15025
150262001-11-12 Akim Demaille <akim@epita.fr>
15027
15028 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
15029 Use @kbd to denote user input.
15030 (Language and Grammar): ANSIfy the example.
15031 Adjust its layout for info/notinfo.
15032 (Location Tracking Calc): Output error messages to stderr.
15033 Output locations in a more GNUtically correct way.
15034 Fix a couple of Englishos.
15035 Adjust @group/@end group pairs.
15036
150372001-11-12 Akim Demaille <akim@epita.fr>
15038
15039 %expect was not functioning at all.
15040
15041 * src/conflicts.c (expected_conflicts): Set to -1.
15042 (conflict_report): Use ngettext.
15043 (conflicts_print): Check %expect and make its violation an error.
15044 * doc/bison.texinfo (Expect Decl): Adjust.
15045 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
15046 * tests/regression.at (%expect not enough, %expect right)
15047 (%expect too much): New.
15048
150492001-11-12 Akim Demaille <akim@epita.fr>
15050
15051 * tests/regression.at (Conflicts): Rename as...
15052 (Unresolved SR Conflicts): this.
15053 (Solved SR Conflicts): New.
15054
150552001-11-12 Akim Demaille <akim@epita.fr>
15056
15057 * src/reduce.c (print_results): Rename as...
15058 (reduce_output): This.
15059 Output to OUT, passed as argument, instead of output_obstack.
15060 (dump_grammar): Likewise.
15061 (reduce_free): New.
15062 Also free V1.
15063 (reduce_grammar): No longer call reduce_output, since...
15064 * src/print.c (print_results): do it.
15065 * src/main.c (main): Call reduce_free;
15066
150672001-11-12 Akim Demaille <akim@epita.fr>
15068
15069 * src/conflicts.c (print_reductions): Accept OUT as argument.
15070 Output to it, not to output_obstack.
15071 * src/print.c (print_actions): Adjust.
15072
150732001-11-12 Akim Demaille <akim@epita.fr>
15074
15075 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
15076 the result instead of using...
15077 (src_total, rrc_total, src_count, rrc_count): Remove.
15078 (any_conflicts): Remove.
15079 (print_conflicts): Split into...
15080 (conflicts_print, conflicts_output): New.
15081 * src/conflicts.h: Adjust.
15082 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
15083 * src/print.c (print_grammar): Issue `\n' between two rules.
15084 * tests/regression.at (Conflicts): New.
15085 Reported by Tom Lane.
15086
150872001-11-12 Akim Demaille <akim@epita.fr>
15088
15089 * tests/regression.at (Invalid input): Remove, duplicate with
15090 ``Invalid input: 1''.
15091
150922001-11-12 Akim Demaille <akim@epita.fr>
15093
15094 * tests/torture.at (AT_DATA_STACK_TORTURE)
15095 (Exploding the Stack Size with Alloca)
15096 (Exploding the Stack Size with Malloc): New.
15097
150982001-11-12 Akim Demaille <akim@epita.fr>
15099
15100 * src/bison.simple (YYSTACK_REALLOC): New.
15101 (yyparse) [!yyoverflow]: Use it and free the old stack.
15102 Reported by Per Allansson.
15103
151042001-11-12 Pascal Bart <pascal.bart@epita.fr>
15105
15106 * src/bison.simple: Define type yystype instead of YYSTYPE, and
15107 define CPP macro, which substitute YYSTYPE by yystype.
15108 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
15109 with yyltype/YYLTYPE. This allows inclusion of the generated
15110 header within the parser if the compiler, such as GGC, accepts
15111 multiple equivalent #defines.
15112 From Akim.
15113
151142001-11-05 Akim Demaille <akim@epita.fr>
15115
15116 * src/reader.c (symbols_output): New, extracted from...
15117 (packsymbols): here.
15118 (reader): Adjust.
15119
151202001-11-05 Akim Demaille <akim@epita.fr>
15121
15122 * src/lex.c (parse_percent_token): s/quotearg/quote/.
15123
151242001-11-05 Akim Demaille <akim@epita.fr>
15125
15126 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
15127 pattern.
15128
151292001-11-05 Akim Demaille <akim@epita.fr>
15130
15131 * src/options.h (struct option_table_struct): set_flags is void*.
15132 * src/options.c (longopts): Support `--output' and `%output'.
15133 (usage): Adjust.
15134 * src/lex.h (tok_setopt): Remove, replaced with...
15135 (tok_intopt, tok_stropt): these new guys.
15136 * src/lex.c (getopt.h): Not needed.
15137 (token_buffer, unlexed_token_buffer): Not const.
15138 (percent_table): Promote `-' over `_' in directive names.
15139 Active `%name-prefix', `file-prefix', and `output'.
15140 (parse_percent_token): Accept possible arguments to directives.
15141 Promote `-' over `_' in directive names.
15142
151432001-11-04 Akim Demaille <akim@epita.fr>
15144
15145 * doc/bison.texinfo (Decl Summary): Split the list into
15146 `directives for grammars' and `directives for bison'.
15147 Sort'em.
15148 Add description of `%name-prefix', `file-prefix', and `output'.
15149 Promote `-' over `_' in directive names.
15150 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
15151 Simplify the description of `--name-prefix'.
15152 Promote `-' over `_' in directive names.
15153 Promote `--output' over `--output-file'.
15154 Fix the description of `--defines'.
15155 * tests/output.at: Exercise %file-prefix and %output.
15156
151572001-11-02 Akim Demaille <akim@epita.fr>
15158
15159 * doc/refcard.tex: Update.
15160
151612001-11-02 Akim Demaille <akim@epita.fr>
15162
15163 * src/symtab.h (SUNDEF): New.
15164 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
15165 stand for `uninitialized', instead of 0.
15166 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
15167 * src/lex.c (lex): Adjust.
15168
15169 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
15170 Number it 0.
15171 Let yylex return it instead of a plain 0.
15172 Reported by Dick Streefland.
15173
151742001-11-02 Akim Demaille <akim@epita.fr>
15175
15176 * tests/regression.at (Mixing %token styles): New test.
15177
151782001-11-02 Akim Demaille <akim@epita.fr>
15179
15180 * src/reader.c (parse_thong_decl): Formatting changes.
15181 (token_translations_init): New, extracted from...
15182 (packsymbols): Here.
15183 Adjust.
15184
151852001-11-01 Akim Demaille <akim@epita.fr>
15186
15187 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
15188 Check that `9foo.y' produces correct cpp guards.
15189 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
15190 guards.
15191 Reported by Wwp.
15192
151932001-11-01 Akim Demaille <akim@epita.fr>
15194
15195 * tests/regression.at (Invalid input: 2): New.
15196 * src/lex.c (unlexed_token_buffer): New.
15197 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
15198 too.
15199 Reported by Wwp.
15200
152012001-11-01 Akim Demaille <akim@epita.fr>
15202
15203 * tests/calc.at: Catch up with 1.30.
15204 * configure.in: Bump to 1.49a.
15205 Adjust to newer Autotest.
15206
152072001-10-19 Pascal Bart <pascal.bart@epita.fr>
15208
15209 * src/conflicts.c: Move global variables rrc_total and src_total ...
15210 (print_conflicts): here.
15211 * src/output.c (output): Free global variable user_toknums.
15212 * src/lex.c (token_obstack): Become static.
15213
152142001-10-18 Akim Demaille <akim@epita.fr>
15215
15216 * tests/atlocal.in (GCC): Add.
15217 * tests/calc.at: s/m4_match/m4_bmatch/.
15218 s/m4_patsubst/m4_bpatsubst/.
15219 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
15220 * configure.in: AC_SUBST(GCC).
15221
152222001-10-14 Marc Autret <autret_m@epita.fr>
15223
15224 * src/options.c (create_long_option_table): Fix.
15225
152262001-10-10 Akim Demaille <akim@epita.fr>
15227
15228 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
15229
152302001-10-04 Akim Demaille <akim@epita.fr>
15231
15232 * src/reader.c (parse_union_decl): Push the caracters in
15233 union_obstack, not attrs_obstack.
15234
152352001-10-04 Akim Demaille <akim@epita.fr>
15236
15237 Merge in the branch 1.29.
15238
15239 * src/reader.c (packsymbols): Use a temporary obstack for
15240 `%%tokendef', since output_stack is already used elsewhere.
15241
15242 2001-10-02 Akim Demaille <akim@epita.fr>
15243
15244 Bump 1.29d.
15245
15246 2001-10-02 Akim Demaille <akim@epita.fr>
15247
15248 Version 1.29c.
15249
15250 2001-10-02 Akim Demaille <akim@epita.fr>
15251
15252 * tests/regression.at (Invalid CPP headers): New.
15253 From Alexander Belopolsky.
15254 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
15255
15256 2001-10-02 Akim Demaille <akim@epita.fr>
15257
15258 * tests/regression.at (Invalid input): New.
15259 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
15260 Reported by Shura.
15261
15262 2001-10-02 Akim Demaille <akim@epita.fr>
15263
15264 * tests/calc.at: Now that --debug works, the tests must be adjusted.
15265
15266 2001-10-02 Akim Demaille <akim@epita.fr>
15267
15268 * src/output.c (output_parser): Assert `skeleton'.
15269 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
15270 systems.
15271 From Shura.
15272
15273 2001-10-01 Marc Autret <autret_m@epita.fr>
15274
15275 * src/lex.h: Echo modifications.
15276 * src/lex.c (unlex): Parameter is now token_t.
15277 From Hans Aberg.
15278
15279 2001-10-01 Marc Autret <autret_m@epita.fr>
15280
15281 * src/main.c: Include lex.h.
15282 From Hans Aberg.
15283
15284 2001-09-29 Akim Demaille <akim@epita.fr>
15285
15286 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
15287
15288 2001-09-28 Akim Demaille <akim@epita.fr>
15289
15290 * tests/testsuite.at: Update to newer Autotest.
15291 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
15292
15293 2001-09-27 Akim Demaille <akim@epita.fr>
15294
15295 Position independent wrapper.
15296
15297 * tests/bison: Remove.
15298 * tests/bison.in: New.
15299 * configure.in: Adjust.
15300
15301 2001-09-27 Paul Eggert <eggert@twinsun.com>
15302
15303 Port quotearg fixes from tar 1.13.24.
15304
15305 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
15306 tm to be declared.
15307 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
15308 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
15309
15310 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
15311 * m4/mbrtowc.m4: New file.
15312 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
15313 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
15314
15315 2001-09-27 Akim Demaille <akim@epita.fr>
15316
15317 Bump to 1.29c.
15318
15319 2001-09-27 Akim Demaille <akim@epita.fr>
15320
15321 Version 1.29b.
15322
15323 2001-09-25 Akim Demaille <akim@epita.fr>
15324
15325 * src/system.h: Include `xalloc.h'.
15326 Remove it from the C files.
15327 * src/files.c (output_files): Free the obstacks.
15328 * src/lex.c (init_lex): Rename as...
15329 (lex_init): this.
15330 (lex_free): New.
15331 * src/main.c (main): Use it.
15332
15333 2001-09-24 Marc Autret <autret_m@epita.fr>
15334
15335 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
15336 to output informations in fout (FILE*).
15337 (open_graph, close_graph): Likewise.
15338 (output_graph, output_edge, output_node): Likewise.
15339 * src/vcg.h: Update function prototypes.
15340 * src/print_graph.c (print_graph): Open output graph file.
15341 (print_actions): Adjust.
15342 * src/files.h: Remove extern declaration.
15343 * src/files.c: Remove graph_obstack declaration.
15344 (open_files): Remove graph_obstack initialization.
15345 (output_files): Remove graph_obstack saving.
15346
15347 2001-09-24 Marc Autret <autret_m@epita.fr>
15348
15349 * src/files.c (compute_output_file_names): Fix.
15350
15351 2001-09-24 Marc Autret <autret_m@epita.fr>,
15352 Akim Demaille <akim@epita.fr>
15353
15354 * src/reader.c (reader): Remove call to free_symtab ().
15355 * src/main.c (main): Call it here.
15356 Include symtab.h.
15357 * src/conflicts.c (initialize_conflicts): Rename as...
15358 (solve_conflicts): this.
15359 * src/print.c (print_core, print_actions, print_state)
15360 (print_grammar): Dump to a file instead a `output_obstack'.
15361 (print_results): Dump `output_obstack', and then proceed with the
15362 FILE *.
15363 * src/files.c (compute_output_file_names, close_files): New.
15364 (output_files): Adjust.
15365 * src/main.c (main): Adjust.
15366
15367 2001-09-23 Marc Autret <autret_m@epita.fr>
15368
15369 * src/files.c (compute_header_macro): Computes header macro name
15370 from spec_defines_file when given.
15371
15372 2001-09-23 Marc Autret <autret_m@epita.fr>
15373
15374 * src/files.c (output_files): Add default extensions.
15375
15376 2001-09-22 Akim Demaille <akim@epita.fr>
15377
15378 * src/conflicts.c (finalize_conflicts): Rename as...
15379 (free_conflicts): this.
15380
15381 2001-09-22 Akim Demaille <akim@epita.fr>
15382
15383 * src/gram.c (gram_free): Rename back as...
15384 (dummy): this.
15385 (output_token_translations): Free `token_translations'.
15386 * src/symtab.c (free_symtab): Free the tag field.
15387
15388 2001-09-22 Akim Demaille <akim@epita.fr>
15389
15390 Remove `translations' as it is always set to true.
15391
15392 * src/gram.h: Adjust.
15393 * src/reader.c (packsymbols, parse_token_decl): Adjust
15394 * src/print.c (print_grammar): Adjust.
15395 * src/output.c (output_token_translations): Adjust.
15396 * src/lex.c (lex): Adjust.
15397 * src/gram.c: Be sure the set pointers to NULL.
15398 (dummy): Rename as...
15399 (gram_free): this.
15400
15401 2001-09-22 Akim Demaille <akim@epita.fr>
15402
15403 * configure.in: Invoke AM_LIB_DMALLOC.
15404 * src/system.h: Use dmalloc.
15405 * src/LR0.c: Be sure to have pointers initialized to NULL.
15406 (allocate_itemsets): Allocate kernel_items only if needed.
15407
15408 2001-09-22 Akim Demaille <akim@epita.fr>
15409
15410 * configure.in: Bump to 1.29b.
15411 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
15412 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
15413 need xmalloc.c in calc.y.
15414 From Pascal Bart.
15415
15416 2001-09-21 Akim Demaille <akim@epita.fr>
15417
15418 Version 1.29a.
15419 * Makefile.maint, config/config.guess, config/config.sub,
15420 * config/missing: Update from masters.
15421 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
15422 upon package.m4.
15423 * configure.in (ALL_LINGUAS): Add `tr'.
15424
15425 2001-09-21 Akim Demaille <akim@epita.fr>
15426
15427 * tests/Makefile.am (package.m4): Move to...
15428 ($(srcdir)/$(TESTSUITE)): here.
15429
15430 2001-09-20 Akim Demaille <akim@epita.fr>
15431
15432 * src/complain.c: No longer try to be standalone: use system.h.
15433 Don't assume __STDC__ is defined to 1. Just test if it is defined.
15434 * src/complain.h: Likewise.
15435 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
15436 Remove the unused variable `n'.
15437 From Albert Chin-A-Young.
15438
15439 2001-09-18 Marc Autret <autret_m@epita.fr>
15440
15441 * doc/bison.1: Update.
15442 * doc/bison.texinfo (Bison Options): Update --defines and --graph
15443 descriptions.
15444 (Option Cross Key): Update.
15445 Add --graph.
15446
15447 2001-09-18 Marc Autret <autret_m@epita.fr>
15448
15449 * tests/regression.at: New test (comment in %union).
15450
15451 2001-09-18 Marc Autret <autret_m@epita.fr>
15452
15453 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
15454 do that.
15455 Reported by Keith Browne.
15456
15457 2001-09-18 Marc Autret <autret_m@epita.fr>
15458
15459 * tests/output.at: Add tests for --defines and --graph.
15460
15461 2001-09-18 Marc Autret <autret_m@epita.fr>
15462
15463 * tests/output.at: Removes tests of %{header,src}_extension features.
15464
15465 2001-09-18 Akim Demaille <akim@epita.fr>
15466
15467 * tests/Makefile.am (package.m4): New.
15468 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
15469 (_AT_CHECK_CALC_ERROR): Likewise.
15470 Factor the `, ' part of verbose error messages.
15471
15472 2001-09-18 Marc Autret <autret_m@epita.fr>
15473
15474 * src/getargs.c (longopts): Declare --defines and --graph as options
15475 with optional arguments.
15476 * src/files.h: Add extern declarations.
15477 * src/files.c (spec_graph_file, spec_defines_file): New.
15478 (output_files): Update.
15479 Remove CPP-outed code.
15480
15481 2001-09-18 Marc Autret <autret_m@epita.fr>
15482
15483 Turn off %{source,header}_extension feature.
15484
15485 * src/files.c (compute_exts_from_gf): Update.
15486 (compute_exts_from_src): Update.
15487 (output_files): CPP-out useless code.
15488 * src/files.h: Remove {header,source}_extension extern declarations.
15489 * src/reader.c (parse_dquoted_param): CPP-out.
15490 (parse_header_extension_decl): Remove.
15491 (parse_source_extension_decl): Remove.
15492 (read_declarations): Remove cases tok_{hdrext,srcext}.
15493 * src/lex.c (percent_table): Remove {header,source}_extension entries.
15494 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
15495
15496 2001-09-10 Akim Demaille <akim@epita.fr>
15497
15498 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
15499 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
15500 (AT_CHECK_OUTPUT): this.
15501 Merely check ls' exit status, its output is useless.
15502
15503 2001-09-10 Akim Demaille <akim@epita.fr>
15504
15505 * tests/calc.at: Use m4_match.
15506 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
15507
15508 2001-09-10 Marc Autret <autret_m@epita.fr>,
15509 Akim Demaille <akim@epita.fr>
15510
15511 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
15512 enum color_e.
15513 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
15514 to `normal'.
15515 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
15516 * src/lex.h: Adjust prototype.
15517 (token_t): Add `tok_undef'.
15518 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
15519 (parse_percent_token): Now returns token_t.
15520 Add default statement in switch.
15521 (lex): Separate `c' as an input variable, from the token_t result
15522 part.
15523 (unlexed): Is a token_t.
15524
15525 2001-09-10 Akim Demaille <akim@epita.fr>
15526
15527 * configure.in: Bump to 1.29a.
15528
15529 2001-09-07 Akim Demaille <akim@epita.fr>
15530
15531 Version 1.29.
15532
15533 2001-08-30 Akim Demaille <akim@epita.fr>
15534
15535 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
15536 * m4/atconfig.m4: Remove.
15537 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
15538 * tests/bison: New.
15539 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
15540 m4_if, m4_patsubst, and m4_regexp.
15541 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
15542 `input' file instead of echo.
15543
15544 2001-08-29 Akim Demaille <akim@epita.fr>
15545
15546 Bump to 1.28e.
15547
15548 2001-08-29 Akim Demaille <akim@epita.fr>
15549
15550 Version 1.28d.
15551
15552 2001-08-29 Paul Eggert <eggert@twinsun.com>
15553
15554 * src/bison.simple (yyparse): Don't take the address of an
15555 item before the start of an array, as that doesn't conform to
15556 the C Standard.
15557
15558 2001-08-29 Robert Anisko <anisko_r@epita.fr>
15559
15560 * doc/bison.texinfo (Location Tracking Calc): New node.
15561
15562 2001-08-29 Paul Eggert <eggert@twinsun.com>
15563
15564 * src/output.c (output): Do not define const, as this now
15565 causes more problems than it cures.
15566
15567 2001-08-29 Akim Demaille <akim@epita.fr>
15568
15569 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
15570 the nodes.
15571 Be sure to tag the `detailmenu'.
15572
15573 2001-08-29 Akim Demaille <akim@epita.fr>
15574
15575 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
15576 download in a tmp dir.
15577
15578 2001-08-28 Marc Autret <autret_m@epita.fr>
15579
15580 * config/depcomp: New file.
15581
15582 2001-08-28 Marc Autret <autret_m@epita.fr>
15583
15584 * doc/bison.1 (mandoc): Adjust.
15585 From Juan Manuel Guerrero.
15586
15587 2001-08-28 Marc Autret <autret_m@epita.fr>
15588
15589 * src/print_graph.c (print_state): Fix.
15590
15591 2001-08-27 Marc Autret <autret_m@epita.fr>
15592
15593 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
15594 char * members.
15595 Echo modifications to the functions prototypes.
15596 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
15597
15598 2001-08-27 Marc Autret <autret_m@epita.fr>
15599
15600 * src/vcg.c: Include `xalloc.h'.
15601 (add_colorentry): New.
15602 (add_classname): New.
15603 (add_infoname): New.
15604 * src/vcg.h: Add new prototypes.
15605
15606 2001-08-27 Akim Demaille <akim@epita.fr>
15607
15608 * Makefile.maint: Sync. again with CVS Autoconf.
15609
15610 2001-08-27 Akim Demaille <akim@epita.fr>
15611
15612 * Makefile.maint: Formatting changes.
15613 (po-update, cvs-update, update): New targets.
15614 (AMTAR): Remove.
15615
15616 2001-08-27 Akim Demaille <akim@epita.fr>
15617
15618 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15619 * Makefile.maint: Sync. with CVS Autoconf.
15620
15621 2001-08-27 Marc Autret <autret_m@epita.fr>
15622
15623 * src/vcg.h (struct infoname_s): New.
15624 (struct colorentry_s): New.
15625 (graph_s): New fields {vertical,horizontal}_order in structure.
15626 Add `infoname' field.
15627 Add `colorentry' field;
15628 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
15629 (G_HORIZONTAL_ORDER): New.
15630 (G_INFONAME): New.
15631 (G_COLORENTRY): New.
15632 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
15633 Add output of `infoname'.
15634 Add output of `colorentry'.
15635
15636 2001-08-27 Marc Autret <autret_m@epita.fr>
15637
15638 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
15639 This one shadowed a global parameter.
15640
15641 2001-08-24 Marc Autret <autret_m@epita.fr>
15642
15643 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
15644 instead of `unsigned'.
15645 (print_state): Do not call obstack_object_size () in obstack_grow ()
15646 to avoid macro variables shadowing.
15647
15648 2001-08-23 Marc Autret <autret_m@epita.fr>
15649
15650 * src/lex.c (percent_table): Typo: s/naem/name/.
15651 Add graph option.
15652 Normalize new options declarations.
15653
15654 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
15655
15656 * tests/suite.at: Exercise %header_extension and %source_extension.
15657
15658 2001-08-16 Marc Autret <autret_m@epita.fr>
15659
15660 * src/reader.c (parse_dquoted_param): New.
15661 (parse_header_extension_decl): Use it.
15662 (parse_source_extension_decl): Likewise.
15663
15664 2001-08-16 Marc Autret <autret_m@epita.fr>
15665
15666 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
15667 (get_xxxx_str): Use assert () instead of complain ().
15668 Remove return invokations in default cases.
15669 (get_decision_str): Modify default behaviour. Remove second argument.
15670 Echo modifications on calls.
15671 (output_graph): Fix.
15672
15673 2001-08-16 Marc Autret <autret_m@epita.fr>
15674
15675 * src/getargs.c (usage): Update with ``-g, --graph''.
15676
15677 2001-08-16 Marc Autret <autret_m@epita.fr>
15678
15679 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
15680 (Option Cross Key): Likewise.
15681 * doc/bison.1: Update.
15682
156832001-09-25 Pascal Bart <pascal.bart@epita.fr>
15684
15685 * src/output.c (output_master_parser): Don't finish action_obstack.
15686 (output_parser): Don't care about the muscle action, here.
15687 (prepare): Copy the action_obstack in the action muscle.
15688 (output): Free action_obstack.
15689
156902001-09-23 Pascal Bart <pascal.bart@epita.fr>
15691
15692 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
15693 will contain `%union' declaration.
15694 (parse_union_decl): Delete #line directive output.
15695 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
15696 informations about %union.
15697 (parse_union_decl): Copy the union_obstack in the muscle stype.
15698 * src/bison.simple: Add new #line directive.
15699 Add typdef %%stype YYSTYPE.
15700
157012001-09-23 Pascal Bart <pascal.bart@epita.fr>
15702
15703 * src/bison.simple: Add new `#line' directive.
15704
157052001-09-22 Pascal Bart <pascal.bart@epita.fr>
15706
15707 * src/bison.simple: New `#line' directive.
15708 * src/output.c (output_parser): Support new dynamic muscle input_line.
15709
157102001-09-22 Marc Autret <autret_m@epita.fr>
15711
15712 * src/output.c (output_master_parser): New.
15713 (output_parser): Be more re-entrant.
15714
157152001-09-21 Marc Autret <autret_m@epita.fr>
15716
15717 * src/reader.c (copy_definition, parse_union_decl): Update and use
15718 `linef' muscle.
15719 (copy_action): Likewise.
15720 Use obstack_1grow ().
15721 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
15722
157232001-09-21 Marc Autret <autret_m@epita.fr>
15724
15725 * src/options.c (option_table): Adjust.
15726 * src/lex.c (parse_percent_token): Fix.
15727
157282001-09-20 Pascal Bart <pascal.bart@epita.fr>
15729
15730 * src/options.c (symtab.h): Include it, need by lex.h.
15731
157322001-09-20 Pascal Bart <pascal.bart@epita.fr>
15733
15734 * src/lex.c (parse_percent_token): Change type of variable `tx', which
15735 is now an option_table_struct*.
15736 (option_strcmp): New function option_strcmp.
15737 (parse_percent_token): Call option_strcmp.
15738 * src/getargs.c (xalloc.h, options.h): Include it.
15739 (getargs): Call create_long_option_table.
15740 (getargs): Free longopts at the end of the function.
15741 (shortopts): Move in options.c.
15742 * src/options.c (create_long_option_table): New function. Convert
15743 information from option_table to option structure.
15744 * src/reader.c (options.h): Include it.
15745
15746 * src/Makefile.am: Adjust.
15747 * src/options.c (option_table): Create from longopts and percent_table.
15748 * src/getargs.c (longopts): Delete.
15749 * src/lex.c (struct percent_table_struct): Delete.
15750 (percent_table): Delete.
15751 (options.h): Include it.
15752 * src/options.c: Create.
15753 * src/options.h: Create.
15754 Declare enum opt_access_e.
15755 Define struct option_table_struct.
15756
157572001-09-20 Marc Autret <autret_m@epita.fr>
15758
15759 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
15760 sections of Bison.
15761
157622001-09-19 Pascal Bart <pascal.bart@epita.fr>
15763
15764 * src/bison.simple: s/%%filename/%%skeleton.
15765 * src/muscle_tab.c (getargs.h): Include it.
15766 (muscle_init): Insert new muscle skeleton.
15767
157682001-09-18 Pascal Bart <pascal.bart@epita.fr>
15769
15770 * src/output.c (output_parser): Delete unused variable actions_dumped.
15771
157722001-09-07 Pascal Bart <pascal.bart@epita.fr>
15773
15774 * src/output.c (output): Delete call to reader_output_yylsp.
15775 * src/reader.c (reader): Likewise.
15776 * src/reader.h: Delete declaration of reader_output_yylsp.
15777
157782001-09-02 Marc Autret <autret_m@epita.fr>
15779
15780 * src/reader.c: Include muscle_tab.h.
15781 (parse_union_decl): Update.
15782 (parse_macro_decl): Rename parse_muscle_decl.
15783 Update to use renamed functions and variable.
15784 (read_declarations, copy_action, read_additionnal_code, : Updated
15785 with correct variables and functions names.
15786 (packsymbols, reader): Likewise.
15787
15788 * src/reader.h (muscle_obstack): Extern declaration update.
15789
15790 * src/output.c: Include muscle_tab.h
15791 In all functions using macro_insert, change by using muscle_insert ().
15792 (macro_obstack): Rename muscle_obstack.
15793 Echo modifications in the whole file.
15794 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
15795 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
15796 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
15797
15798 * src/muscle_tab.h: Update double inclusion macros.
15799 (macro_entry_s): Rename muscle_entry_s.
15800 Update prototypes.
15801
15802 * src/muscle_tab.c: Include muscle_tab.h.
15803 Rename macro_tabble to muscle_table.
15804 (mhash1, mhash2, mcmp): Use muscle_entry.
15805 (macro_init): Rename muscle_init. Update.
15806 (macro_insert): Rename muscle_insert. Update.
15807 (macro_find): Rename muscle_find. Update.
15808
15809 * src/main.c: Include muscle_tab.h.
15810 (main): Call muscle_init ().
15811 * src/Makefile.am (bison_SOURCES): Echo modifications.
15812
158132001-09-02 Marc Autret <autret_m@epita.fr>
15814
15815 Now the files macro_tab.[ch] are named muscle_tab.[ch].
15816
15817 * src/muscle_tab.c, src/muscle_tab.h: Add files.
15818
158192001-09-02 Marc Autret <autret_m@epita.fr>
15820
15821 * src/macrotab.c, src/macrotab.h: Remove.
15822
158232001-09-01 Pascal Bart <pascal.bart@epita.fr>
15824
15825 * src/reader.c (copy_guard): Use muscle to specify the `#line'
15826 filename.
15827
158282001-09-01 Marc Autret <autret_m@epita.fr>
15829
15830 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
15831 to an explicit value to activate the feature. We do it here.
15832
158332001-08-31 Pascal Bart <pascal.bart@epita.fr>
15834
15835 * src/output.c (prepare): Delete the `filename' muscule insertion.
15836 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
15837 (parse_union_decl): Likewise.
15838 * src/macrotab.c (macro_init): Initialize filename by infile.
15839
158402001-08-31 Marc Autret <autret_m@epita.fr>
15841
15842 * src/bison.simple (YYLSP_NEEDED): New definition.
15843 * src/output.c (prepare): Add macro insertion of `locations_flag'
15844
158452001-08-31 Pascal Bart <pascal.bart@epita.fr>
15846
15847 * src/output.c (prepare): Delete insertion of previous muscles,
15848 and insert the `prefix' muscles.
15849 * src/macrotab.c (macro_init): Likewise.
15850 (macro_init): Initialization prefix directive by `yy'.
15851 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
15852 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
15853 yylval, yydebug, yyerror, yynerrs and yyparse.
15854 New directive `#define' to substitute yydebug, ... with option
15855 name_prefix.
15856
158572001-08-31 Pascal Bart <pascal.bart@epita.fr>
15858
15859 * src/main.c (main): Standardize.
15860 * src/output.c (output_table_data, output_parser): Likewise.
15861 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
15862
158632001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
15864
15865 * src/reader.c (read_additionnal_code): Rename %%user_code to
15866 %%epilogue.
15867 * src/output.c (output): Rename %%declarations to %%prologue.
15868 * src/bison.simple: Echo modifications.
15869
158702001-08-31 Marc Autret <autret_m@epita.fr>
15871
15872 * src/reader.c (readgram): CleanUp.
15873 (output_token_defines): Likewise.
15874 (packsymbols): Likewise.
15875 (reader): Likewise.
15876 * src/output.c (output): CPP-out useless code.
15877
158782001-08-31 Pascal Bart <pascal.bart@epita.fr>
15879
15880 * src/reader.c (reader): Delete obsolete call to function
15881 output_trailers and output_headers.
15882 * src/output.h: Remove obsolete functions prototypes of output_headers
15883 and output_trailers.
15884
158852001-08-30 Pascal Bart <pascal.bart@epita.fr>
15886
15887 * src/main.c: Include macrotab.h.
15888 * src/macrotab.h (macro_entry_s): Constify fields.
15889 Adjust functions prototypes.
15890 * src/macrotab.c (macro_insert): Constify key and value.
15891 (macro_find): Constify key.
15892 (macro_insert): Include 'xalloc.h'
15893 (macro_insert): Use XMALLOC.
15894 (macro_find): Constify return value.
15895 * src/output.c (output_table_data): Rename table to table_data.
15896 (output_parser): Constify macro_key, macro_value.
15897
158982001-08-30 Marc Autret <autret_m@epita.fr>
15899
15900 * src/reader.c (parse_skel_decl): New.
15901 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
15902 * src/lex.h (token_t): New token `tok_skel'.
15903 * src/lex.c (percent_table): Add skeleton option entry.
15904 Standardize.
15905
159062001-08-29 Marc Autret <autret_m@epita.fr>
15907
15908 * src/bison.simple: Add %%user_code directive at the end.
15909 * src/reader.c (read_additionnal_code): New.
15910 (reader): Use it.
15911 * src/output.c (output_program): Remove.
15912 (output): Update.
15913
159142001-08-28 Marc Autret <autret_m@epita.fr>
15915
15916 * src/output.c (output_actions): Clean up.
15917 (output_gram): CPP-out useless code.
15918 * src/reader.c (reader): Clean up, CPP-out useless code.
15919
159202001-08-28 Pascal Bart <pascal.bart@epita.fr>
15921
15922 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
15923 directive.
15924 * src/bison.simple: Add `%%definitions'.
15925
159262001-08-28 Marc Autret <autret_m@epita.fr>
15927
15928 * config/depcomp: New file.
15929
159302001-08-27 Paul Eggert <eggert@twinsun.com>
15931
15932 * src/bison.simple (yyparse): Don't take the address of an
15933 item before the start of an array, as that doesn't conform to
15934 the C Standard.
15935
159362001-08-27 Robert Anisko <robert.anisko@epita.fr>
15937
15938 * src/output.c (output): Remove the initialization of the macro
15939 obstack. It was done too late here.
15940
15941 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
15942 completely wrong.
15943 (reader): Initialize the macro obstack here, since we need it to grow
15944 '%define' directives.
15945
15946 * src/reader.h: Declare the macro obstack as extern.
15947
159482001-08-27 Robert Anisko <robert.anisko@epita.fr>
15949
15950 * src/output.c (output_parser): Fix. Store single '%' characters in
15951 the output obstack instead of throwing them away.
15952
159532001-08-27 Akim Demaille <akim@epita.fr>
15954
15955 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15956
159572001-08-25 Robert Anisko <robert.anisko@epita.fr>
15958
15959 * lib/Makefile.am: Adjust.
15960
159612001-08-25 Robert Anisko <robert.anisko@epita.fr>
15962
15963 * src/bison.simple: Update and add '%%' directives.
15964
159652001-08-25 Robert Anisko <robert.anisko@epita.fr>
15966
15967 * src/reader.c (reader): Remove calls to 'output_headers' and
15968 'output_trailers'. Remove some C output.
15969 (readgram): Disable a piece of code that was writing a default
15970 definition for 'YYSTYPE'.
15971 (reader_output_yylsp): Remove.
15972 (packsymbols): Output token defintions to a macro.
15973 (copy_definition): Disable C output.
15974
15975 * src/reader.c (parse_macro_decl): New function used to parse macro
15976 declarations.
15977 (copy_string2): Put the body of copy_string into this new function.
15978 Add a parameter to let the caller choose whether he wants to copy the
15979 string delimiters or not.
15980 (copy_string): Be a simple call to copy_string2 with the last argument
15981 bound to true.
15982 (read_declarations): Add case for macro definition.
15983 (copy_identifier): New.
15984 (parse_macro_decl): Read macro identifiers using copy_identifier
15985 rather than lex.
15986
159872001-08-25 Robert Anisko <robert.anisko@epita.fr>
15988
15989 * src/output.c (prepare): Add prefixed names.
15990 (output_parser): Output semantic actions.
15991 (output_parser): Fix bug on '%%line' directives.
15992
15993 * src/output.c (output_headers): Remove. The C code printed by this
15994 function should now be in the skeletons.
15995 (output_trailers): Remove.
15996 (output): Disable call to 'reader_output_yylsp'.
15997 (output_rule_data): Do not output tables to the table obstack.
15998
15999 * src/output.c: Remove some C dedicated output.
16000 Improve the use of macro and output obstacks.
16001 (output_defines): Remove.
16002
16003 * src/output.c (output_token_translations): Associate 'translate'
16004 table with a macro. No output to the table obstack.
16005 (output_gram): Same for 'rhs' and 'prhs'.
16006 (output_stos): Same for 'stos'.
16007 (output_rule_data): Same for 'r1' and 'r2'.
16008 (token_actions): Same for 'defact'.
16009 (goto_actions): Same for 'defgoto'.
16010 (output_base): Same for 'pact' and 'pgoto'.
16011 (output_table): Same for 'table'.
16012 (output_check): Same for 'check'.
16013
16014 * src/output.c (output_table_data): New function.
16015 (output_short_table): Remove.
16016 (output_short_or_char_table): Remove.
16017
16018 * src/output.c (output_parser): Replace most of the skeleton copy code
16019 with something new. Skeletons are now processed character by character
16020 rather than line by line, and Bison looks for '%%' macros. This is the
16021 first step in making Bison's output process (a lot) more flexible.
16022 (output_parser): Use the macro table.
16023
160242001-08-25 Robert Anisko <robert.anisko@epita.fr>
16025
16026 * src/main.c (main): Initialize the macro table.
16027
160282001-08-25 Robert Anisko <robert.anisko@epita.fr>
16029
16030 * src/lex.c (percent_table): Add tok_define.
16031 * src/lex.h: Add tok_define.
16032
160332001-08-25 Robert Anisko <robert.anisko@epita.fr>
16034
16035 * src/macrotab.c: New file.
16036 * src/macrotab.h: New file.
16037 * src/Makefile.am: Update.
16038
160392001-08-25 Robert Anisko <robert.anisko@epita.fr>
16040
16041 * lib/hash.c: New file.
16042 * lib/hash.h: New file.
16043 * lib/Makefile.am: Update.
16044
160452001-08-15 Akim Demaille <akim@epita.fr>
16046
16047 Version 1.28c.
16048
160492001-08-15 Marc Autret <autret_m@epita.fr>
16050
16051 * src/reader.c (readgram): Indent output macro YYSTYPE.
16052 (packsymbols): Likewise.
16053 (output_token_defines): Likewise.
16054 * src/files.c: Standardize.
16055 (compute_header_macro): New.
16056 (defines_obstack_save): New. Use compute_header_macro.
16057 (output_files): Update. Use defines_obstack_save.
16058
160592001-08-15 Akim Demaille <akim@epita.fr>
16060
16061 * doc/bison.texinfo (Table of Symbols): Document
16062 YYSTACK_USE_ALLOCA.
16063
160642001-08-15 Akim Demaille <akim@epita.fr>
16065
16066 * missing: Update from CVS Automake.
16067 * config/config.guess, config/config.sub, config/texinfo.tex:
16068 Update from gnu.org.
16069
160702001-08-15 Akim Demaille <akim@epita.fr>
16071
16072 * Makefile.maint: Sync with CVS Autoconf.
16073
160742001-08-14 Pascal Bart <pascal.bart@epita.fr>
16075
16076 * doc/bison.texinfo: Include GNU Free Documentation License from
16077 `fdl.texi'.
16078 * doc/fdl.texi: Add to package.
16079
160802001-08-14 Marc Autret <autret_m@epita.fr>
16081
16082 Turn on %{source,header}_extension features.
16083
16084 * src/lex.c (percent_table): Un-CPP out header_extension and
16085 source_extension.
16086 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
16087 (compute_exts_from_src): Remove conditions. It restores priorities
16088 between options.
16089
160902001-08-14 Marc Autret <autret_m@epita.fr>
16091
16092 * src/files.c (compute_base_names): Add extensions computing when
16093 `--file-prefix' used.
16094 Standardize function calls.
16095
160962001-08-13 Marc Autret <autret_m@epita.fr>
16097
16098 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
16099 defining it (defined but null disables alloca).
16100
161012001-08-13 Marc Autret <autret_m@epita.fr>
16102
16103 * src/bison.simple (_yy_memcpy): CPP reformat.
16104
161052001-08-13 Pascal Bart <pascal.bart@epita.fr>
16106
16107 * tests/atconfig.in (CPPFLAGS): Fix.
16108
161092001-08-10 Pascal Bart <pascal.bart@epita.fr>
16110
16111 * doc/bison.texinfo: Include GNU General Public License from
16112 `gpl.texi'.
16113 * doc/gpl.texi: Add to package.
16114
161152001-08-10 Marc Autret <autret_m@epita.fr>
16116
16117 * src/print_graph.h: Fix.
16118 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
16119
161202001-08-10 Akim Demaille <akim@epita.fr>
16121
16122 * src/system.h: Provide default declarations for stpcpy, strndup,
16123 and strnlen.
16124
161252001-08-10 Robert Anisko <anisko_r@epita.fr>
16126
16127 * doc/bison.texinfo (Locations): Update @$ stuff.
16128
161292001-08-09 Robert Anisko <anisko_r@epita.fr>
16130
16131 * src/bison.simple (YYLLOC_DEFAULT): Update.
16132 (yyparse): Adjust.
16133
161342001-08-08 Marc Autret <autret_m@epita.fr>
16135
16136 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
16137 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
16138 Reported by Fabrice Bauzac.
16139
161402001-08-08 Marc Autret <autret_m@epita.fr>
16141
16142 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
16143 * src/vcg.c (output_node): Fix.
16144 * src/vcg.h: Cleanup.
16145 * src/print_graph.c: Add comments.
16146 (node_output_size): New global variable. Simplify the formatting of
16147 the VCG graph output.
16148 (print_actions): Unused code is now used. It notifies the final state
16149 and no action states in the VCG graph. It also give the reduce actions.
16150 The `shift and goto' edges are red and the `go to state' edges are
16151 blue.
16152 Get the current node name and node_obstack by argument.
16153 (node_obstack): New variable.
16154 (print_state): Manage node_obstack.
16155 (print_core): Use node_obstack given by argument.
16156 A node is not only computed here but in print_actions also.
16157 (print_graph): CPP out useless code instead of commenting it.
16158
161592001-08-07 Pascal Bart <pascal.bart@epita.fr>
16160
16161 * tests/atconfig.in (CPPFLAGS): Fix.
16162
161632001-08-07 Akim Demaille <akim@epita.fr>
16164
16165 * src/print_graph.c (quote): New.
16166 (print_core): Use it.
16167
161682001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
16169
16170 * src/vcg.c (complain.h): Include it.
16171 Unepitaize `return' invocations.
16172 [NDEBUG] (main): Remove.
16173 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
16174 * src/files.c (open_files): Initialize graph_obstack.
16175 * src/print_graph.c (print_actions): CPP out useless code.
16176 (print_core): Don't output the last `\n' in labels.
16177 Use `quote'.
16178 * src/files.c (output_files): Output the VCG file.
16179 * src/main.c (main): Invoke print_graph ();
16180
161812001-08-06 Marc Autret <autret_m@epita.fr>
16182
16183 Automaton VCG graph output.
16184 Using option ``-g'' or long option ``--graph'', you can generate
16185 a gram_filename.vcg file containing a VCG description of the LALR (1)
16186 automaton of your grammar.
16187
16188 * src/main.c: Call to print_graph() function.
16189 * src/getargs.h: Update.
16190 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
16191 (graph_flag): New flag.
16192 (longopts): Update.
16193 (getargs): Add case `g'.
16194 * src/files.c (graph_obstack): New obstack struct.
16195 (open_files): Initialize new obstack.
16196 (output_files): Saves graph_obstack if required.
16197 * src/files.h (graph_obstack): New extern declaration.
16198 * src/Makefile.am: Add new source files.
16199
162002001-08-06 Marc Autret <autret_m@epita.fr>
16201
16202 * src/print_graph.c, src/print_graph.h (graph): New.
16203 * src/vcg.h: New file.
16204 * src/vcg.c: New file, VCG graph handling.
16205
162062001-08-06 Marc Autret <autret_m@epita.fr>
16207
16208 Add of %source_extension and %header_extension which specify
16209 the source or/and the header output file extension.
16210
16211 * src/files.c (compute_base_names): Remove initialisation of
16212 src_extension and header_extension.
16213 (compute_exts_from_gf): Update.
16214 (compute_exts_from_src): Update.
16215 (output_files): Update.
16216 * src/reader.c (parse_header_extension_decl): New.
16217 (parse_source_extension_decl): New.
16218 (read_declarations): New case statements for the new tokens.
16219 * src/lex.c (percent_table): Add entries for %source_extension
16220 and %header_extension.
16221 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
16222
162232001-08-06 Marc Autret <autret_m@epita.fr>
16224
16225 * configure.in: Bump to 1.28c.
16226 * doc/bison.texinfo: Texinfo thingies.
16227
162282001-08-04 Pascal Bart <pascal.bart@epita.fr>
16229
16230 * tests/atconfig.in (CPPFLAGS): Add.
16231 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
16232
162332001-08-03 Akim Demaille <akim@epita.fr>
16234
16235 Version 1.28b.
16236
162372001-08-03 Akim Demaille <akim@epita.fr>
16238
16239 * tests/Makefile.am (check-local): Ship testsuite.
16240 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
16241 Include `string.h'.
16242
162432001-08-03 Akim Demaille <akim@epita.fr>
16244
16245 * configure.in: Try using -Wformat when compiling.
16246
162472001-08-03 Akim Demaille <akim@epita.fr>
16248
16249 * configure.in: Bump to 1.28b.
16250
162512001-08-03 Akim Demaille <akim@epita.fr>
16252
16253 * src/complain.c: Adjust strerror_r portability issues.
16254
162552001-08-03 Akim Demaille <akim@epita.fr>
16256
16257 Version 1.28a.
16258
162592001-08-03 Akim Demaille <akim@epita.fr>
16260
16261 * src/getargs.c, src/getarg.h (skeleton)): Constify.
16262 * src/lex.c (literalchar): Avoid name clashes on `buf'.
16263 * src/getargs.c: Include complain.h.
16264 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
16265 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
16266
162672001-08-03 Akim Demaille <akim@epita.fr>
16268
16269 * src/reader.c (readgram): Display hidden chars in error messages.
16270
162712001-08-03 Akim Demaille <akim@epita.fr>
16272
16273 Update to gettext 0.10.39.
16274
162752001-08-03 Akim Demaille <akim@epita.fr>
16276
16277 * lib/strspn.c: New.
16278
162792001-08-01 Marc Autret <autret_m@epita.fr>
16280
16281 * doc/bison.texinfo: Update.
16282 * doc/bison.1 (mandoc): Update.
16283 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
16284 * src/files.c: Support output files extensions computing.
16285 (src_extension): New static variable.
16286 (header_extension): New static variable.
16287 (tr): New function.
16288 (get_extension_index): New function, gets the index of an extension
16289 filename in a string.
16290 (compute_exts_from_gf): New function, computes extensions from the
16291 grammar file extension.
16292 (compute_exts_from_src): New functions, computes extensions from the
16293 C source file extension, file given by ``-o'' option.
16294 (compute_base_names): Update.
16295 (output_files): Update.
16296
162972001-08-01 Robert Anisko <anisko_r@epita.fr>
16298
16299 * doc/bison.texi: Document @$.
16300 (Locations): New section.
16301
163022001-07-18 Akim Demaille <akim@epita.fr>
16303
16304 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
16305 * config/prev-version.txt, config/move-if-change: New.
16306 * Makefile.am: Adjust.
16307
163082001-07-08 Pascal Bart <pascal.bart@epita.fr>
16309
16310 * src/bison.simple (yyparse): Suppress warning `comparaison
16311 between signed and unsigned'.
16312
163132001-07-05 Pascal Bart <pascal.bart@epita.fr>
16314
16315 * src/getargs.h (raw_flag): Remove.
16316 * src/getargs.c: Die on `-r'/`--raw'.
16317 * src/lex.c (parse_percent_token): Die on `%raw'.
16318 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
16319 * tests/calc.at: Suppress test with option `--raw'.
16320
163212001-07-14 Akim Demaille <akim@epita.fr>
16322
16323 * config/: New.
16324 * configure.in: Require Autoconf 2.50.
16325 Update to gettext 0.10.38.
16326
163272001-03-16 Akim Demaille <akim@epita.fr>
16328
16329 * doc/bison.texinfo: ANSIfy the examples.
16330
163312001-03-16 Akim Demaille <akim@epita.fr>
16332
16333 * getargs.c (skeleton): New variable.
16334 (longopts): --skeleton is a new option.
16335 (shortopts, getargs): -S is a new option.
16336 * getargs.h: Declare skeleton.
16337 * output.c (output_parser): Use it.
16338
163392001-03-16 Akim Demaille <akim@epita.fr>
16340
16341 * m4/strerror_r.m4: New.
16342 * m4/error.m4: Run AC_FUNC_STRERROR_R.
16343 * lib/error.h, lib/error.c: Update.
16344
163452001-03-16 Akim Demaille <akim@epita.fr>
16346
16347 * src/getargs.c (longopts): Clean up.
16348
163492001-02-21 Akim Demaille <akim@epita.fr>
16350
16351 * src/reader.c (gensym): `gensym_count' is your own.
16352 Use a static buf to create the symbol name, as token_buffer is no
16353 longer a buffer.
16354
163552001-02-08 Akim Demaille <akim@epita.fr>
16356
16357 * src/conflicts.c (conflict_report): Be sure not to append to res
16358 between two calls, which could happen if both first sprintf were
16359 skipped, but not the first cp += strlen.
16360
163612001-02-08 Akim Demaille <akim@epita.fr>
16362
16363 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
16364 New, from fileutils 4.0.37.
16365 * configure.in: Require Autoconf 2.49c. I took some time before
16366 making this decision. This is the only way out for portability
16367 issues in Bison, it would mean way too much duplicate effort to
16368 import in Bison features implemented in 2.49c since 2.13.
16369 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
16370
163712001-02-02 Akim Demaille <akim@epita.fr>
16372
16373 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
16374 * lib/xalloc.h, lib/xmalloc.c: Update.
16375
163762001-01-19 Akim Demaille <akim@epita.fr>
16377
16378 Get rid of the ad hoc handling of token_buffer in the scanner: use
16379 the obstacks.
16380
16381 * src/lex.c (token_obstack): New.
16382 (init_lex): Initialize it. No longer call...
16383 (grow_token_buffer): this. Remove it.
16384 Adjust all the places which used it to use the obstack.
16385
163862001-01-19 Akim Demaille <akim@epita.fr>
16387
16388 * src/lex.h: Rename all the tokens:
16389 s/\bENDFILE\b/tok_eof/g;
16390 s/\bIDENTIFIER\b/tok_identifier/g;
16391 etc.
16392 Let them be enums, not #define, to ease debugging.
16393 Adjust all the code.
16394
163952001-01-18 Akim Demaille <akim@epita.fr>
16396
16397 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
16398 * src/lex.c (maxtoken, grow_token_buffer): Static.
16399
164002001-01-18 Akim Demaille <akim@epita.fr>
16401
16402 Since we now use obstacks, more % directives can be enabled.
16403
16404 * src/lex.c (percent_table): Also accept `%yacc',
16405 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
16406 `%debug'.
16407 Handle the actions for `%semantic_parser' and `%pure_parser' here,
16408 instead of returning a token.
16409 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
16410 * src/reader.c (read_declarations): Adjust.
16411 * src/files.c (open_files): Don't call `compute_base_names', don't
16412 compute `attrsfile' since they depend upon data which might be
16413 *in* the input file now.
16414 (output_files): Do it here.
16415 * src/output.c (output_headers): Document the fact that this patch
16416 introduces a guaranteed SEGV for semantic parsers.
16417 * doc/bison.texinfo: Document them.
16418 * tests/suite.at: Exercise these %options.
16419
164202000-12-20 Akim Demaille <akim@epita.fr>
16421
16422 Also handle the output file (--verbose) with obstacks.
16423
16424 * files.c (foutput): Remove.
16425 (output_obstack): New.
16426 Adjust all dependencies.
16427 * src/conflicts.c: Return a string.
16428 * src/system.h (obstack_grow_string): Rename as...
16429 (obstack_sgrow): this. Be ready to work with non literals.
16430 (obstack_fgrow4): New.
16431
164322000-12-20 Akim Demaille <akim@epita.fr>
16433
16434 * src/files.c (open_files): Fix the computation of short_base_name
16435 in the case of `-o foo.tab.c'.
16436
164372000-12-20 Akim Demaille <akim@epita.fr>
16438
16439 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
16440 (copy_dollar): Now that everything uses obstacks, get rid of the
16441 FILE * parameters.
16442
164432000-12-20 Akim Demaille <akim@epita.fr>
16444
16445 * src/files.c (open_files): Actually the `.output' file is based
16446 on the short_base_name, not base_name.
16447 * tests/suite.at (Checking output file names): Adjust.
16448
164492000-12-20 Akim Demaille <akim@epita.fr>
16450
16451 * src/bison.s1: Remove, we now use directly...
16452 * src/bison.simple: this.
16453 * src/Makefile.am: Use pkgdata instead of data.
16454
164552000-12-20 Akim Demaille <akim@epita.fr>
16456
16457 * src/files.c (guard_obstack): New.
16458 (open_files): Initialize it.
16459 (output_files): Dump it...
16460 * src/files.h: Export it.
16461 * src/reader.c (copy_guard): Use it.
16462
164632000-12-19 Akim Demaille <akim@epita.fr>
16464
16465 * src/files.c (outfile, defsfile, actfile): Removed as global
16466 vars.
16467 (open_files): Don't compute them.
16468 (output_files): Adjust.
16469 (base_name, short_base_name): Be global.
16470 Adjust dependencies.
16471
164722000-12-19 Akim Demaille <akim@epita.fr>
16473
16474 * src/files.c (strsuffix): New.
16475 (stringappend): Be just like strcat but allocate.
16476 (base_names): Eve out from open_files.
16477 Try to simplify the rather hairy computation of base_name and
16478 short_base_name.
16479 (open_files): Use it.
16480 * tests/suite.at (Checking output file names): New test.
16481
164822000-12-19 Akim Demaille <akim@epita.fr>
16483
16484 * src/system.h (obstack_grow_literal_string): Rename as...
16485 (obstack_grow_string): this.
16486 * src/output.c (output_parser): Recognize `%% actions' instead of
16487 `$'.
16488 * src/bison.s1: s/$/%% actions/.
16489 * src/bison.hairy: Likewise.
16490
164912000-12-19 Akim Demaille <akim@epita.fr>
16492
16493 * src/output.c (output_parser): Compute the `#line' lines when
16494 there are.
16495 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
16496 Suggested by Hans Aberg.
16497
164982000-12-19 Akim Demaille <akim@epita.fr>
16499
16500 Let the handling of the skeleton files be local to the procedures
16501 that use it.
16502
16503 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
16504 longer static.
16505 (fparser, open_extra_files): Remove.
16506 (open_files, output_files): Don't take care of fparser.
16507 * src/files.h: Adjust.
16508 * src/output.c (output_parser): Open and close the file to the
16509 skeleton.
16510 * src/reader.c (read_declarations): When %semantic_parser, open
16511 fguard.
16512
165132000-12-19 Akim Demaille <akim@epita.fr>
16514
16515 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
16516 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
16517
165182000-12-19 Akim Demaille <akim@epita.fr>
16519
16520 * src/files.c (open_files): Yipee! We no longer need all the code
16521 looking for `/tmp' since we have no tmp file.
16522
165232000-12-19 Akim Demaille <akim@epita.fr>
16524
16525 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
16526 New macros.
16527 * src/files.c (open_files): Less dependency on MSDOS etc.
16528
165292000-12-14 Akim Demaille <akim@epita.fr>
16530
16531 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
16532 Provide a default definition.
16533 Use it when executing the default @ action.
16534 * src/reader.c (reader_output_yylsp): No longer include
16535 `timestamp' and `text' in the default YYLTYPE.
16536
165372000-12-12 Akim Demaille <akim@epita.fr>
16538
16539 * src/reader.c (copy_definition, parse_union_decl, copy_action)
16540 (copy_guard): Quote the file names.
16541 Reported by Laurent Mascherpa.
16542
165432000-12-12 Akim Demaille <akim@epita.fr>
16544
16545 * src/output.c (output_headers, output_program, output): Be sure
16546 to escape special characters when outputting filenames.
16547 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
16548 (output_headers): Don't depend on them, Use ACTSTR.
16549
165502000-11-17 Akim Demaille <akim@epita.fr>
16551
16552 * lib/obstack.h: Formatting changes.
16553 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
16554 prevents type checking.
16555 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
16556 cast the value to (void *): assigning a `foo *' to a `void *'
16557 variable is valid.
16558 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
16559 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
16560 append characters.
16561
165622000-11-17 Akim Demaille <akim@epita.fr>
16563
16564 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
16565 as...
16566 (suite.m4, regression.m4, calc.m4): these.
16567 * tests/atgeneral.m4: Update from CVS Autoconf.
16568
165692000-11-17 Akim Demaille <akim@epita.fr>
16570
16571 * tests/regression.m4 (%union and --defines): New test,
16572 demonstrating a current bug in the obstack implementation.
16573
165742000-11-17 Akim Demaille <akim@epita.fr>
16575
16576 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
16577 macros.
16578 Use them to declare the variables which are global or local to
16579 `yyparse'.
16580
165812000-11-17 Akim Demaille <akim@epita.fr>
16582
16583 * acconfig.h: Remove, no longer used.
16584
165852000-11-07 Akim Demaille <akim@epita.fr>
16586
16587 * src: s/Copyright (C)/Copyright/g.
16588
165892000-11-07 Akim Demaille <akim@epita.fr>
16590
16591 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
16592 defining.
16593 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
16594
165952000-11-07 Akim Demaille <akim@epita.fr>
16596
16597 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
16598 Merge in a single CPP if/else.
16599
166002000-11-07 Akim Demaille <akim@epita.fr>
16601
16602 * src/output.c (output): Remove useless variables.
16603 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
16604 argument `data' for consistency with the prototypes.
16605 Qualify it `const'.
16606 (obstack_copy, obstack_copy0): Rename the second argument as
16607 `address' for consistency. Qualify it `const'.
16608 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
16609 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
16610 `const' their input argument (`data' or `address').
16611 Adjust the corresponding macros to include `const' in casts.
16612
166132000-11-03 Akim Demaille <akim@epita.fr>
16614
16615 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
16616 s/PFILE1/BISON_HAIRY/.
16617 Adjust dependencies.
16618
166192000-11-03 Akim Demaille <akim@epita.fr>
16620
16621 For some reason, this was not applied.
16622
16623 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16624 `unlink': it's no longer used.
16625
166262000-11-03 Akim Demaille <akim@epita.fr>
16627
16628 * src/files.c (skeleton_find): New function, eved out of...
16629 (open_files, open_extra_files): here.
16630
166312000-11-03 Akim Demaille <akim@epita.fr>
16632
16633 Don't use `atexit'.
16634
16635 * src/files.c (obstack_save): New function.
16636 (done): Rename as...
16637 (output_files): this.
16638 Use `obstack_save'.
16639 * src/main.c (main): Don't use `atexit' to register `done', since
16640 it no longer has to remove tmp files, just call `output_files'
16641 when there are no errors.
16642
166432000-11-02 Akim Demaille <akim@epita.fr>
16644
16645 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16646 `unlink': it's no longer used.
16647 * src/files.h: Formatting changes.
16648
166492000-11-02 Akim Demaille <akim@epita.fr>
16650
16651 Remove the last uses of mktemp and unlink/delete.
16652
16653 * src/files.c (fdefines, ftable): Removed.
16654 (defines_ostack, table_obstack): New.
16655 Adjust dependencies of the former into uses of the latter.
16656 * src/output.c (output_short_or_char_table, output_short_table):
16657 Convert to using obstacks.
16658 * src/reader.c (copy_comment2): Accept one FILE * and two
16659 obstacks.
16660 (output_token_defines, reader_output_yylsp): Use obstacks.
16661 * src/system.h (obstack_fgrow3): New.
16662 * po/POTFILES.in: Adjust.
16663
166642000-11-01 Akim Demaille <akim@epita.fr>
16665
16666 Change each use of `fattrs' into a use of `attrs_obstack'.
16667
16668 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
16669 * src/files.c (fattrs): Remove.
16670 (attrs_obstack): New.
16671 Adjust all dependencies.
16672 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
16673
166742000-11-01 Akim Demaille <akim@epita.fr>
16675
16676 Introduce obstacks.
16677 Change each use of `faction' into a use of `action_obstack'.
16678
16679 * lib/obstack.h, lib/obstack.c: New files.
16680 * src/files.c (faction): Remove.
16681 (action_obstack): New.
16682 Adjust all dependencies.
16683
166842000-10-20 Akim Demaille <akim@epita.fr>
16685
16686 * lib/quote.h (PARAMS): New macro. Use it.
16687
166882000-10-16 Akim Demaille <akim@epita.fr>
16689
16690 * src/output.c (output_short_or_char_table): New function.
16691 (output_short_table, output_token_translations): Use it.
16692 (goto_actions): Use output_short_table.
16693
166942000-10-16 Akim Demaille <akim@epita.fr>
16695
16696 * src/symtab.c (bucket_new): New function.
16697 (getsym): Use it.
16698
16699 * src/output.c (output_short_table): New argument to display the
16700 comment associated with the table.
16701 Adjust dependencies.
16702 (output_gram): Use it.
16703 (output_rule_data): Nicer output layout for YYTNAME.
16704
167052000-10-16 Akim Demaille <akim@epita.fr>
16706
16707 * src/lex.c (read_typename): New function.
16708 (lex): Use it.
16709 * src/reader.c (copy_dollar): Likewise.
16710
167112000-10-16 Akim Demaille <akim@epita.fr>
16712
16713 * src/reader.c (copy_comment2): Expect the input stream to be on
16714 the `/' which is suspected to open a comment, instead of being
16715 called after `//' or `/*' was read.
16716 (copy_comment, copy_definition, parse_union_decl, copy_action)
16717 (copy_guard): Adjust.
16718
167192000-10-16 Akim Demaille <akim@epita.fr>
16720
16721 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
16722 `read_signed_integer'.
16723
167242000-10-16 Akim Demaille <akim@epita.fr>
16725
16726 * src/reader.c (copy_dollar): New function.
16727 (copy_guard, copy_action): Use it.
16728
167292000-10-16 Akim Demaille <akim@epita.fr>
16730
16731 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
16732 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
16733 New files, from Fileutils 4.0.27.
16734 * src/main.c (printable_version): Remove.
16735 * src/lex.c, src/reader.c: Use `quote'.
16736
167372000-10-04 Akim Demaille <akim@epita.fr>
16738
16739 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
16740
167412000-10-04 Akim Demaille <akim@epita.fr>
16742
16743 * doc/bison.texinfo: Various typos spotted by Neil Booth.
16744
167452000-10-04 Akim Demaille <akim@epita.fr>
16746
16747 When a literal string is used to define two different tokens,
16748 `bison -v' segfaults.
16749 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
16750
16751 * tests/regression.m4: New file.
16752 Include the core of the sample provided by Piotr Gackiewicz.
16753 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
16754 properly.
16755
167562000-10-04 Akim Demaille <akim@epita.fr>
16757
16758 * src/reader.c (parse_expect_decl): Keep `count' within the size
16759 of `buffer'.
16760 From Neil Booth.
16761
167622000-10-02 Paul Eggert <eggert@twinsun.com>
16763
16764 * bison.s1 (yyparse): Assign the default value
16765 unconditionally, to avoid a GCC warning and make the parser a
16766 tad smaller.
16767
167682000-10-02 Akim Demaille <akim@epita.fr>
16769
16770 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
16771 options.
16772
167732000-10-02 Akim Demaille <akim@epita.fr>
16774
16775 * src/derives.c, src/print.c, src/reduce.c: To ease the
16776 translation, move some `\n' out of the translated strings.
16777
167782000-10-02 Akim Demaille <akim@epita.fr>
16779
16780 The location tracking mechanism is precious for parse error
16781 messages. Nevertheless, it is enabled only when `@n' is used in
16782 the grammar, which is a different issue (you can use it in error
16783 message, but not in the grammar per se). Therefore, there should
16784 be another means to enable it.
16785
16786 * src/getargs.c (getargs): Support `--locations'.
16787 (usage): Report it.
16788 * src/getargs.h (locationsflag): Export it.
16789 * src/lex.c (percent_table): Support `%locations'.
16790 * src/reader.c (yylsp_needed): Remove this variable, now replaced
16791 with `locationsflag'.
16792 * doc/bison.texinfo: Document `--locations' and `%locations'.
16793 Sort the options.
16794 * tests/calc.m4: Test it.
16795
16796 For regularity of the names, replace each
16797 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
16798 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
16799 In addition replace each `flag' with `_flag'.
16800
168012000-10-02 Akim Demaille <akim@epita.fr>
16802
16803 Also test parse error messages, including with YYERROR_VERBOSE.
16804
16805 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
16806 associative).
16807 Use it to check the computations.
16808 Use it to check `nonassoc' is honored.
16809 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
16810 `--yyerror-verbose'.
16811 (_AT_CHECK_CALC): Adjust to this option.
16812 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
16813
168142000-10-02 Akim Demaille <akim@epita.fr>
16815
16816 Test also `--verbose', `--defines' and `--name-prefix'. Testing
16817 the latter demonstrates a flaw in the handling of non debugging
16818 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
16819 was used in order to simplify:
16820
16821 #if YYDEBUG
16822 if (yydebug)
16823 {
16824 ...
16825 }
16826 #endif
16827
16828 into
16829
16830 if (yydebug)
16831 {
16832 ...
16833 }
16834
16835 unfortunately this leads to a CPP conflict when
16836 `--name-prefix=foo' is used since it produces `#define yydebug
16837 foodebug'.
16838
16839 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
16840 (YYDPRINTF): New macro.
16841 Spread its use.
16842 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
16843 the bison options.
16844 Also test `--verbose', `--defines' and `--name-prefix'.
16845
168462000-10-02 Akim Demaille <akim@epita.fr>
16847
16848 Improve the readability of the produced parsers.
16849
16850 * src/bison.s1: Formatting changes.
16851 Improve the comment related to the `$' mark.
16852 (yydefault): Don't fall through to `yyresume': `goto' there.
16853 * src/output.c (output_parser): When the `$' is met, skip the end
16854 of its line.
16855 New variable, `number_of_dollar_signs', to check there's exactly
16856 one `$' in the parser skeleton.
16857
168582000-10-02 Akim Demaille <akim@epita.fr>
16859
16860 * lib/xstrdup.c: New file, from the fileutils.
16861 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
16862 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
16863 instead of strlen + xmalloc + strcpy.
16864 * src/symtab.c (copys): Remove, use xstrdup instead.
16865
168662000-10-02 Akim Demaille <akim@epita.fr>
16867
16868 * src/gram.h (associativity): New enum type which replaces the
16869 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
16870 `right_assoc', `left_assoc' and `non_assoc'.
16871 Adjust all dependencies.
16872 * src/reader.c: Formatting changes.
16873 (LTYPESTR): Don't define it, use it as a literal in
16874 `reader_output_yylsp'.
16875 * src/symtab.h (symbol_class): New enum type which replaces the
16876 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
16877 `sunknown', `stoken and `snterm'.
16878
168792000-10-02 Akim Demaille <akim@epita.fr>
16880
16881 * src/getargs.c (fixed_outfiles): Rename as...
16882 (yaccflag): for consistency and accuracy.
16883 Adjust dependencies.
16884
168852000-10-02 Akim Demaille <akim@epita.fr>
16886
16887 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
16888 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
16889 difficult and introduced a lot of core dump. It turns out that
16890 Bison used an implementation of `xmalloc' based on `calloc', and
16891 at various places it does depend upon the initialization to 0. I
16892 have not tried to isolate the pertinent places, and all the former
16893 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
16894 someone should address this issue.
16895
16896 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
16897 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
16898 files.
16899 Adjust dependencies.
16900 * src/warshall.h: New file.
16901 Propagate.
16902
169032000-10-02 Akim Demaille <akim@epita.fr>
16904
16905 Various anti-`extern in *.c' changes.
16906
16907 * src/system.h: Include `assert.h'.
16908
169092000-10-02 Akim Demaille <akim@epita.fr>
16910
16911 * src/state.h (nstates, final_state, first_state, first_shift)
16912 (first_reduction): Move their exportation from here...
16913 * src/LR0.h: to here.
16914 Adjust dependencies.
16915 * src/getargs.c (statisticsflag): New variable.
16916 Add support for `--statistics'.
16917 Adjust dependencies.
16918
16919 Remove a lot of now useless `extern' statements in most files.
16920
169212000-10-02 Akim Demaille <akim@epita.fr>
16922
16923 * src/LR0.h: New file.
16924 Propagate its use.
16925
169262000-10-02 Akim Demaille <akim@epita.fr>
16927
16928 * src/print.h: New file.
16929 Propagate its use.
16930 * src/print.c: Formatting and ordering changes.
16931 (verbose, terse): Replace with...
16932 (print_results): this new function.
16933 Adjust dependencies.
16934
169352000-10-02 Akim Demaille <akim@epita.fr>
16936
16937 * src/conflicts.c (conflict_report): New function.
16938 (conflict_log, verbose_conflict_log): Replace with...
16939 (print_conflicts): this function.
16940 Adjust dependencies.
16941 * src/conflicts.h: New file.
16942 Propagate its inclusion.
16943
169442000-10-02 Akim Demaille <akim@epita.fr>
16945
16946 * src/nullable.h: New file.
16947 Propagate its inclusion.
16948 * src/nullable.c: Formatting changes.
16949
169502000-10-02 Akim Demaille <akim@epita.fr>
16951
16952 * src/reduce.h: New file.
16953 Propagate its inclusion.
16954 * src/reduce.c: Topological sort and other formatting changes.
16955 (bool, TRUE, FALSE): Move their definition to...
16956 * src/system.h: here.
16957
169582000-10-02 Akim Demaille <akim@epita.fr>
16959
16960 * src/files.c: Formatting changes.
16961 (tryopen, tryclose, openfiles): Rename as...
16962 (xfopen, xfclose, open_files): this.
16963 (stringappend): static.
16964 * src/files.h: Complete the list of exported symbols.
16965 Propagate its use.
16966
169672000-10-02 Akim Demaille <akim@epita.fr>
16968
16969 * src/reader.h: New file.
16970 Propagate its use instead of tedious list of `extern' and
16971 prototypes.
16972 * src/reader.c: Formatting changes, topological sort,
16973 s/register//.
16974
169752000-10-02 Akim Demaille <akim@epita.fr>
16976
16977 * src/lex.h: Prototype `lex.c' exported functions.
16978 * src/reader.c: Adjust.
16979 * src/lex.c: Formatting changes.
16980 (safegetc): Rename as...
16981 (xgetc): this.
16982
169832000-10-02 Akim Demaille <akim@epita.fr>
16984
16985 * src/lalr.h: New file.
16986 Propagate its inclusion instead of prototypes and `extern'.
16987 * src/lalr.c: Formatting changes, topological sorting etc.
16988
169892000-10-02 Akim Demaille <akim@epita.fr>
16990
16991 * src/output.c (token_actions): Introduce a temporary array,
16992 YYDEFACT, that makes it possible for this function to use
16993 output_short_table.
16994
169952000-10-02 Akim Demaille <akim@epita.fr>
16996
16997 `user_toknums' is output as a `short[]' in `output.c', while it is
16998 defined as a `int[]' in `reader.c'. For consistency with the
16999 other output tables, `user_toknums' is now defined as a table of
17000 shorts.
17001
17002 * src/reader.c (user_toknums): Be a short table instead of an int
17003 table.
17004 Adjust dependencies.
17005
17006 Factor the short table outputs.
17007
17008 * src/output.c (output_short_table): New function.
17009 * src/output.c (output_gram, output_stos, output_rule_data)
17010 (output_base, output_table, output_check): Use it.
17011
170122000-10-02 Akim Demaille <akim@epita.fr>
17013
17014 * src/output.c (output): Topological sort of the functions, in
17015 order to get rid of the `static' prototypes.
17016 No longer use `register'.
17017 * src/output.h: New file.
17018 Propagate its inclusion in files explicitly prototyping functions
17019 from output.c.
17020
170212000-09-21 Akim Demaille <akim@epita.fr>
17022
17023 * src/atgeneral.m4: Update from Autoconf.
17024
170252000-09-21 Akim Demaille <akim@epita.fr>
17026
17027 * src/closure.h: New file.
17028 * src/closure.c: Formatting changes, topological sort over the
17029 functions, use of closure.h.
17030 (initialize_closure, finalize_closure): Rename as...
17031 (new_closure, free_closure): these. Adjust dependencies.
17032 * src/LR0.c: Formatting changes, topological sort, use of
17033 cloture.h.
17034 (initialize_states): Rename as...
17035 (new_states): this.
17036 * src/Makefile.am (noinst_HEADERS): Adjust.
17037
170382000-09-20 Akim Demaille <akim@epita.fr>
17039
17040 * src/acconfig.h: Don't protect config.h against multiple
17041 inclusion.
17042 Don't define PARAMS.
17043 * src/system.h: Define PARAMS.
17044 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
17045 purpose of config.h. system.h must not try to fix wrong
17046 definitions in config.h.
17047
170482000-09-20 Akim Demaille <akim@epita.fr>
17049
17050 * src/derives.h: New file.
17051 * src/main.c, src/derives.h: Use it.
17052 Formatting changes.
17053 * src/Makefile.am (noinst_HEADERS): Adjust.
17054
170552000-09-20 Akim Demaille <akim@epita.fr>
17056
17057 * tests/atgeneral.m4: Update from Autoconf.
17058 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
17059 (AT_CHECK_CALC): New macros.
17060 Use these macros to test bison with options `', `--raw',
17061 `--debug', `--yacc', `--yacc --debug'.
17062
170632000-09-19 Akim Demaille <akim@epita.fr>
17064
17065 * src/output.c: Formatting changes.
17066 * src/machine.h: Remove, leaving its contents in...
17067 * src/system.h: here.
17068 Include stdio.h.
17069 Adjust all dependencies on stdio.h and machine.h.
17070 * src/getargs.h: New file.
17071 Let all `extern' declarations about getargs.c be replaced with
17072 inclusion of `getargs.h'.
17073 * src/Makefile.am (noinst_HEADERS): Adjust.
17074
17075 * tests/calc.m4 (yyin): Be initialized in main, not on the global
17076 scope.
17077 (yyerror): Returns void, not int.
17078 * doc/bison.texinfo: Formatting changes.
17079
170802000-09-19 Akim Demaille <akim@epita.fr>
17081
17082 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
17083 portable.
17084
170852000-09-18 Akim Demaille <akim@epita.fr>
17086
17087 * configure.in: Append WARNING_CFLAGS to CFLAGS.
17088 * src/Makefile.am (INCLUDES): Don't.
17089 Be ready to fetch headers in lib/.
17090
170912000-09-18 Akim Demaille <akim@epita.fr>
17092
17093 * doc/bison.texinfo: Update the copyright.
17094 ANSIfy and GNUify the examples.
17095 Remove the old menu.
17096
170972000-09-18 Akim Demaille <akim@epita.fr>
17098
17099 First set of tests: use the `calc' example from the documentation.
17100
17101 * src/bison.s1 (yyparse): Condition the code using `yytname' which
17102 is defined only when YYDEBUG is.
17103 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
17104 * src/files.c (tryopen, tryclose): Formatting changes.
17105 Move to the top and be static.
17106 * src/reader.c (read_signed_integer): Likewise.
17107 * tests/calc.m4: New file.
17108 * Makefile.am, suite.m4: Adjust.
17109 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
17110
171112000-09-18 Akim Demaille <akim@epita.fr>
17112
17113 Add support for an Autotest test suite for Bison.
17114
17115 * m4/m4.m4, m4/atconfig.m4: New files.
17116 * m4/Makefile.am (EXTRA_DIST): Adjust.
17117 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
17118 files.
17119 * src/getargs.c: Display a more standard --version message.
17120 * src/reader.c (reader): Formatting changes.
17121 No longer depend upon VERSION_STRING.
17122 * configure.in: No longer use `dnl'.
17123 Set up the test suite and the new directory `tests/.
17124 (VERSION_STRING): Remove.
17125
171262000-04-14 Akim Demaille <akim@epita.fr>
17127
17128 * src/reader.c (copy_comment2): New function, same as former
17129 `copy_comment', but outputs into two FILE *.
17130 (copy_comment): Use it.
17131 (parse_union_decl): Use it.
17132 (get_type, parse_start_decl): Use the same `invalid' message.
17133 (parse_start_decl, parse_union_decl): Use the same `multiple'
17134 message.
17135 (parse_union_decl, copy_guard, copy_action): Use the same
17136 `unmatched' message.
17137 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
17138
171392000-03-31 Akim Demaille <akim@epita.fr>
17140
17141 * src/files.c (tryopen, tryclose): Move to the top.
17142 Be static.
17143
171442000-03-31 Akim Demaille <akim@epita.fr>
17145
17146 * src/main.c (main): Don't call `done', exit does it.
17147
171482000-03-31 Akim Demaille <akim@epita.fr>
17149
17150 * allocate.c: s/return (foo)/return foo/.
17151 * lalr.c: Likewise.
17152 * LR0.c: Likewise.
17153 * output.c: Likewise.
17154 * reader.c: Likewise.
17155 * symtab.c: Likewise.
17156 * vmsgetargs.c: Likewise.
17157
171582000-03-31 Akim Demaille <akim@epita.fr>
17159
17160 Clean up the error reporting functions.
17161
17162 * src/report.c: New file.
17163 * src/report.h: Likewise.
17164 * src/Makefile.am: Adjust.
17165 * m4/error.m4: New file.
17166 * m4/Makefile.am: Adjust.
17167 * configure.in (jm_PREREQ_ERROR): Call it.
17168 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
17169 Remove.
17170 (fatal, fatals): Remove. All callers use complain.c::fatal.
17171 (warn, warni, warns, warnss, warnss): Remove. All callers use
17172 complain.c::complain.
17173 (toomany): Remove, use fatal instead.
17174 * src/files.c (done): No argument, use complain_message_count.
17175 * src/main.c (main): Register `done' to `atexit'.
17176
17177 * src/getargs.c (usage): More `fputs', less `fprintf'.
17178
171792000-03-28 Akim Demaille <akim@epita.fr>
17180
17181 * lib/: New directory.
17182 * Makefile.am (SUBDIRS): Adjust.
17183 * configure.in: Adjust.
17184 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
17185 useless.
17186 * src/alloca.c: Moved to lib/.
17187 * src/getopt.c: Likewise.
17188 * src/getopt1.c: Likewise.
17189 * src/getopt.h: Likewise.
17190 * src/ansi2knr.c: Likewise.
17191 * src/ansi2knr.1: Likewise.
17192 * src/Makefile.am: Adjust.
17193 * lib/Makefile.am: New file.
17194
171952000-03-28 Akim Demaille <akim@epita.fr>
17196
17197 * src/getargs.c (usage): Refresh the help message.
17198
171992000-03-17 Akim Demaille <akim@epita.fr>
17200
17201 * src/getopt1.c: Updated from textutils 2.0e
17202 * src/getopt.c: Likewise.
17203 * src/getopt.h: Likewise.
17204
172052000-03-17 Akim Demaille <akim@epita.fr>
17206
17207 * src/Makefile.am (bison.simple): Fix the awk program: quote only
17208 the file name, not the whole `#line LINE FILE'.
17209
172102000-03-17 Akim Demaille <akim@epita.fr>
17211
17212 On syntax errors, report the token on which we choked.
17213
17214 * src/bison.s1 (yyparse): In the label yyerrlab, when
17215 YYERROR_VERBOSE, add yychar in msg.
17216
172172000-03-17 Akim Demaille <akim@epita.fr>
17218
17219 * src/reader.c (copy_at): New function.
17220 (copy_guard): Use it.
17221 (copy_action): Use it.
17222
172232000-03-17 Akim Demaille <akim@epita.fr>
17224
17225 Be kind to translators, save some useless translations.
17226
17227 * src/main.c (banner): New function.
17228 (fatal_banner): Use it.
17229 (warn_banner): Use it.
17230
172312000-03-17 Akim Demaille <akim@epita.fr>
17232
17233 * src/reader.c (copy_definition): Use copy_string and
17234 copy_comment. Removed now unused `match', `ended',
17235 `cplus_comment'.
17236 (copy_comment, copy_string): Moved, to be visible from
17237 copy_definition.
17238
172392000-03-17 Akim Demaille <akim@epita.fr>
17240
17241 * src/reader.c (copy_string): Declare `static inline'. No
17242 problems with inline, since it is checked by configure.
17243 (copy_comment): Likewise.
17244
172452000-03-17 Akim Demaille <akim@epita.fr>
17246
17247 * src/reader.c (packsymbols): Formatting changes.
17248
172492000-03-17 Akim Demaille <akim@epita.fr>
17250
17251 * src/reader.c (copy_comment): New function, factored out from:
17252 (copy_action): Use it. Removed now unused `match', `ended',
17253 `cplus_comment'.
17254 (copy_guard): Likewise.
17255
172562000-03-17 Akim Demaille <akim@epita.fr>
17257
17258 * src/reader.c (copy_string): New function, factored out from:
17259 (copy_action): Use it.
17260 (copy_guard): Likewise.
17261
172622000-03-17 Akim Demaille <akim@epita.fr>
17263
17264 Change the handling of @s so that they behave exactly like $s.
17265 There is now a pseudo variable @$ (readble and writable), location
17266 of the lhs of the rule (by default ranging from the location of
17267 the first symbol of the rhs, to the location of the last symbol,
17268 or, if the rhs is empty, YYLLOC).
17269
17270 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
17271 yyval.
17272 (yyparse): When providing a default semantic action, provide a
17273 default location action.
17274 (after the $): No longer change `*YYLSP', just stack YYLOC the
17275 same way you stack YYVAL.
17276 * src/reader.c (read_declarations): Use warns.
17277 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
17278 (copy_action, case '@'): Likewise.
17279 Use a standard error message, to save useless work from
17280 translators.
17281
172822000-03-17 Akim Demaille <akim@epita.fr>
17283
17284 * src/bison.s1: Formatting and cosmetics changes.
17285 * src/reader.c: Likewise.
17286 Update the Copyright notice.
17287
172882000-03-17 Akim Demaille <akim@epita.fr>
17289
17290 * src/bison.s1 (#line): All set to `#line' only, since the
17291 Makefile now handles them.
17292
172932000-03-16 Akim Demaille <akim@epita.fr>
17294
17295 * src/output.c (output_rule_data): Output the documentation of
17296 some of the tables.
17297 (Copyright notice): Update.
17298 Formatting changes.
17299
173002000-03-16 Akim Demaille <akim@epita.fr>
17301
17302 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
17303 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
17304 One `#if YYDEBUG' remains, since it uses variables which are
17305 defined only if `YYDEBUG != 0'.
17306
173072000-03-16 Akim Demaille <akim@epita.fr>
17308
17309 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
17310 and related variables so that the similarities are highlighted.
17311
173122000-03-16 Akim Demaille <akim@epita.fr>
17313
17314 * src/bison.s1: Properly indent CPP directives.
17315
173162000-03-16 Akim Demaille <akim@epita.fr>
17317
17318 * src/bison.s1: Properly indent the `alloca' CPP section.
17319
173202000-03-16 Akim Demaille <akim@epita.fr>
17321
17322 Do not hard code values of directories in `configure.in'.
17323 Update the `configure' tool chain.
17324
17325 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
17326 src/makefile.am.
17327 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
17328 (AC_OUTPUT): Add m4/Makefile.
17329 Bump to bison 1.28a, 1.29 has never been released.
17330 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
17331 handled via src/Makefile.am.
17332 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
17333 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
17334 autoheader.
17335 * Makefile.am (SUBDIRS): Add m4.
17336 (ACLOCAL_AM_FLAGS): New variable.
17337 (AUTOMAKE_OPTIONS): Add check-news.
17338 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
17339 the proper line number and file name.
17340 (DEFS): Propagate the location of bison library files and of the
17341 locale files.
17342 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
17343 builddir.
17344 * acinclude.m4: Remove, replaced by the directory m4.
17345 * m4/Makefile.am (EXTRA_DIST): New variable.
17346 * m4/gettext.m4: New file, from the fileutils.
17347 * m4/lcmessage.m4: Likewise
17348 * m4/progtest.m4: Likewise.
17349 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
17350
173512000-03-10 Akim Demaille <akim@epita.fr>
17352
17353 * src/closure.c:
17354 Formatting changes of various comments.
17355 Respect the GNU coding standards at various places.
17356 Don't use `_()' when no translation is needed.
17357
173581999-12-13 Jesse Thilo <jthilo@gnu.org>
17359
17360 * src/files.c:
17361 OS/2 honors TMPDIR environment variable.
17362
173631999-12-13 Jesse Thilo <jthilo@gnu.org>
17364
17365 * doc/bison.texinfo: Tweaked spelling and grammar.
17366 Updated ISBN.
17367 Removed reference to price of printed copy.
17368 Mention BISON_SIMPLE and BISON_HAIRY.
17369
173701999-12-13 Jesse Thilo <jthilo@gnu.org>
17371
17372 * configure.in, NEWS:
17373 Bison 1.29 released.
17374
173751999-10-27 Jesse Thilo <jthilo@gnu.org>
17376
17377 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
17378 Added reference card.
17379
173801999-07-26 Jesse Thilo <jthilo@gnu.org>
17381
17382 * po/ru.po: Added Russian translation.
17383
173841999-07-26 Jesse Thilo <jthilo@gnu.org>
17385
17386 * configure.in: Added Russian translation.
17387
173881999-07-06 Jesse Thilo <jthilo@gnu.org>
17389
17390 * configure.in, NEWS, README:
17391 Released version 1.28.
17392
173931999-06-14 Jesse Thilo <jthilo@gnu.org>
17394
17395 * src/system.h:
17396 Squashed redefinition warning on some systems.
17397
17398 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
17399 Have configure build version string instead of relying on ANSI string
17400 concatentation.
17401
174021999-06-14 Jesse Thilo <jthilo@gnu.org>
17403
17404 * po/POTFILES.in: Got rid of version.c.
17405
174061999-06-14 Jesse Thilo <jthilo@gnu.org>
17407
17408 * acconfig.h, configure.in:
17409 Have configure build version string instead of relying on ANSI string
17410 concatentation.
17411
174121999-06-08 Jesse Thilo <jthilo@gnu.org>
17413
17414 * doc/bison.1:
17415 Dropped mention of `+' for long-named options.
17416
174171999-05-30 Jesse Thilo <jthilo@gnu.org>
17418
17419 * src/files.c: Added <unistd.h> for unlink().
17420
17421 * src/Makefile.am, src/system.h:
17422 I18n fixes.
17423
174241999-05-30 Jesse Thilo <jthilo@gnu.org>
17425
17426 * README: Added a FAQ list.
17427
17428 * configure.in, acconfig.h:
17429 I18n fixes.
17430
174311999-05-30 Jesse Thilo <jthilo@gnu.org>
17432
17433 * doc/FAQ, doc/Makefile.am:
17434 Added a FAQ list.
17435
174361999-05-19 Jesse Thilo <jthilo@gnu.org>
17437
17438 * src/alloc.h, src/symtab.h, src/version.c:
17439 Protected inclusion of "config.h" with HAVE_CONFIG_H.
17440
174411999-04-18 Jesse Thilo <jthilo@gnu.org>
17442
17443 * src/.cvsignore, src/Makefile.am:
17444 Reorganized: sources in `src', documentation in `doc'.
17445
17446 * src/lex.c (literalchar):
17447 fixed the code for escaping double quotes (thanks
17448 Jonathan Czisny.)
17449
174501999-04-18 Jesse Thilo <jthilo@gnu.org>
17451
17452 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
17453 Adjusted paths to reflect directory reorganization.
17454
174551999-04-18 Jesse Thilo <jthilo@gnu.org>
17456
17457 * doc/.cvsignore, doc/Makefile.am:
17458 Reorganized: sources in `src', documentation in `doc'.
17459
174601999-04-18 Jesse Thilo <jthilo@gnu.org>
17461
17462 * configure.in:
17463 Updated AC_INIT file to reflect directory reorganization.
17464
17465 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
17466 Reorganized: sources in `src', documentation in `doc'.
17467
174681999-04-13 Jesse Thilo <jthilo@gnu.org>
17469
17470 * src/allocate.c:
17471 Don't declare calloc() and realloc() if not necessary.
17472
174731999-04-13 Jesse Thilo <jthilo@gnu.org>
17474
17475 * configure.in, acconfig.h, acinclude.m4:
17476 Don't declare calloc() and realloc() if not necessary.
17477
174781999-03-23 Jesse Thilo <jthilo@gnu.org>
17479
17480 * po/.cvsignore: Added i18n support.
17481
174821999-03-23 Jesse Thilo <jthilo@gnu.org>
17483
17484 * acconfig.h, configure.in, Makefile.am:
17485 Added i18n support.
17486
174871999-03-22 Jesse Thilo <jthilo@gnu.org>
17488
17489 * src/bison.s1: Fixed #line numbers.
17490
174911999-03-15 Jesse Thilo <jthilo@gnu.org>
17492
17493 * po/es.po, po/fr.po, po/nl.po, po/de.po:
17494 Added PO files from Translation Project.
17495
174961999-03-03 Jesse Thilo <jthilo@gnu.org>
17497
17498 * Makefile.am:
17499 Added support for non-ANSI compilers (ansi2knr).
17500
175011999-02-16 Jesse Thilo <jthilo@gnu.org>
17502
17503 * configure.in: Bumped version number to 1.27.
17504
17505 * Makefile.am:
17506 Added `bison.simple' to list of files removed by `make distclean'.
17507
175081999-02-12 Jesse Thilo <jthilo@gnu.org>
17509
17510 * src/files.c, src/files.h:
17511 Defined locations of parser files in config.h instead of Makefile.
17512
175131999-02-12 Jesse Thilo <jthilo@gnu.org>
17514
17515 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
17516 Defined locations of parser files in config.h instead of Makefile.
17517
175181999-02-09 Jesse Thilo <jthilo@gnu.org>
17519
17520 * Makefile.am:
17521 Removed inappropriate use of $< macro.
17522
175231999-02-05 Jesse Thilo <jthilo@gnu.org>
17524
17525 * po/Makefile.in.in, po/POTFILES.in:
17526 Add `po' directory skeleton.
17527
175281999-01-27 Jesse Thilo <jthilo@gnu.org>
17529
17530 * README: Document help-bison list.
17531
17532 * configure.in: Add check for mkstemp().
17533
175341999-01-20 Jesse Thilo <jthilo@gnu.org>
17535
17536 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
17537 Hush a few compiler warnings.
17538
17539 * src/files.c:
17540 Add tryclose(), which verifies that fclose was successful.
17541 Hush a couple of compiler warnings.
17542
175431999-01-20 Jesse Thilo <jthilo@gnu.org>
17544
17545 * Makefile.am, OChangeLog:
17546 ChangeLog is now automatically generated. Include the old version as
17547 OChangeLog.
17548
175491999-01-14 Jesse Thilo <jthilo@gnu.org>
17550
17551 * src/gram.h, src/lalr.c, src/lex.c, src/lex.h, src/machine.h, src/main.c, src/nullable.c, src/output.c, src/print.c, src/reader.c, src/reduce.c, src/state.h, src/symtab.c, src/symtab.h, src/types.h, src/vmsgetargs.c, src/warshall.c, src/allocate.c, src/alloc.h, src/bison.s1, src/closure.c, src/conflicts.c, src/derives.c, src/files.c, src/files.h, src/getargs.c, src/gram.c, src/LR0.c:
17552 Update FSF address.
17553
175541999-01-14 Jesse Thilo <jthilo@gnu.org>
17555
17556 * doc/bison.texinfo: Fix formatting glitch.
17557
17558 * doc/bison.texinfo: Update FSF address.
17559
175601999-01-14 Jesse Thilo <jthilo@gnu.org>
17561
17562 * acconfig.h: Update FSF address.
17563
175641999-01-08 Jesse Thilo <jthilo@gnu.org>
17565
17566 * src/system.h:
17567 Don't define PACKAGE here, since config.h defines it.
17568
175691998-12-30 Jesse Thilo <jthilo@gnu.org>
17570
17571 * src/reader.c: Update copyright date.
17572
17573 * src/main.c:
17574 Ditch sprintf to statically-sized buffers in fatal/warn functions in
17575 favor of output directly to stderr (avoids buffer overruns).
17576
17577 * src/reader.c: Some checks for premature EOF.
17578
17579 * src/allocate.c, src/alloc.h, src/closure.c, src/conflicts.c, src/derives.c, src/getargs.c, src/gram.c, src/lalr.c, src/lex.c, src/LR0.c, src/main.c, src/nullable.c, src/output.c, src/print.c, src/reduce.c, src/symtab.c, src/symtab.h, src/warshall.c:
17580 Use prototypes if the compiler understands them.
17581
17582 * src/files.c: Honor TMPDIR on Unix hosts.
17583 Use prototypes if the compiler understands them.
17584
17585 * src/reader.c:
17586 Fix a couple of buffer overrun bugs.
17587 Use prototypes if the compiler understands them.
17588
17589 * src/system.h: Include unistd.h and ctype.h.
17590 Use #ifdef instead of #if for NLS symbols.
17591
175921998-12-30 Jesse Thilo <jthilo@gnu.org>
17593
17594 * doc/bison.texinfo:
17595 Delete comment "consider using @set for edition number, etc..." since
17596 we now are doing so.
17597
175981998-12-30 Jesse Thilo <jthilo@gnu.org>
17599
17600 * configure.in:
17601 Use prototypes if the compiler understands them.
17602
17603 * NEWS: Document 1.26 highlights.
17604
17605 * Makefile.am: Require Automake 1.3 or later.
17606
17607 * acconfig.h:
17608 Use prototypes if the compiler understands them.
17609
176101998-12-29 Jesse Thilo <jthilo@gnu.org>
17611
17612 * src/version.c:
17613 Use VERSION symbol from automake for version number.
17614
176151998-12-29 Jesse Thilo <jthilo@gnu.org>
17616
17617 * acconfig.h, configure.in, version.cin:
17618 Use VERSION symbol from automake for version number.
17619
176201998-11-28 Jesse Thilo <jthilo@gnu.org>
17621
17622 * Makefile.am:
17623 Distribute original version of simple parser (bison.s1), not built
17624 version (bison.simple).
17625
176261998-11-28 Jesse Thilo <jthilo@gnu.org>
17627
17628 * doc/bison.texinfo: Add info dir entry.
17629
17630 * doc/bison.texinfo:
17631 Let automake put version number into documentation.
17632
176331998-11-26 Jesse Thilo <jthilo@gnu.org>
17634
17635 * src/bison.cld, src/build.com, src/vmshlp.mar:
17636 Add non-RCS files from /gd/gnu/bison.
17637
176381998-11-26 Jesse Thilo <jthilo@gnu.org>
17639
17640 * doc/bison.1:
17641 Document the BISON_HAIRY and BISON_SIMPLE variables.
17642
176431998-11-25 Jesse Thilo <jthilo@gnu.org>
17644
17645 * src/version.c: Build version.c automatically.
17646
17647 * src/reader.c:
17648 Fix token numbering (used to start at 258, not 257).
17649
17650 * src/system.h: Include config.h.
17651
17652 * src/getargs.c: Update bug report address.
17653
17654 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
17655 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
17656
176571998-11-25 Jesse Thilo <jthilo@gnu.org>
17658
17659 * Makefile.am:
17660 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17661
17662 * configure.in, version.cin:
17663 Build version.c automatically.
17664
17665 * AUTHORS: Add AUTHORS file.
17666
17667 * README: Update bug report address.
17668
17669 * bison.simple:
17670 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17671
17672 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
17673 Add automake stuff.
17674
176751998-11-25 Jesse Thilo <jthilo@gnu.org>
17676
17677 * doc/bison.texinfo: Clean up some formatting.
17678
176791998-05-05 Richard Stallman <rms@gnu.org>
17680
17681 * doc/bison.texinfo:
17682 Explain better why to make a pure parser.
17683
176841998-01-05 Richard Stallman <rms@gnu.org>
17685
17686 * src/files.c (openfiles):
17687 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
17688 find a temporary directory, if possible. Do not unlink files while
17689 they are open.
17690
176911997-08-25 Richard Stallman <rms@gnu.org>
17692
17693 * src/reader.c (stack_offset;):
17694 Change some warni to warns.
17695
17696 * src/lex.c (literalchar): Use warns, not warni.
17697
176981997-06-28 Richard Stallman <rms@gnu.org>
17699
17700 * src/bison.s1: Add a Bison version comment.
17701
17702 * src/main.c (fatal, warn, berror):
17703 Use program_name.
17704
177051997-06-28 Richard Stallman <rms@gnu.org>
17706
17707 * Makefile.in (bison_version): New variable.
17708 (dist): Use that variable.
17709 (bison.s1): Substitute the Bison version into bison.simple.
17710
17711 * bison.simple: Add a Bison version comment.
17712
177131997-06-18 Richard Stallman <rms@gnu.org>
17714
17715 * src/main.c (fatal, warn, berror):
17716 Make error messages standard.
17717 (toomany): Improve error message text.
17718
17719 * src/LR0.c, src/closure.c, src/conflicts.c, src/derives.c, src/files.c, src/lalr.c, src/lex.c, src/nullable.c, src/output.c, src/print.c, src/reader.c, src/reduce.c, src/symtab.c:
17720 new.h renamed to alloc.h.
17721
177221997-06-18 Richard Stallman <rms@gnu.org>
17723
17724 * Makefile.in: new.h renamed to alloc.h.
17725
177261997-05-24 Richard Stallman <rms@gnu.org>
17727
17728 * src/lex.c (literalchar):
17729 Fix the code for escaping \, " and '.
17730
17731 (lex): Avoid trouble when there are many chars
17732 to discard in a char literal with just several chars in it.
17733
177341997-05-17 Richard Stallman <rms@gnu.org>
17735
17736 * src/bison.s1:
17737 Use malloc, if using alloca is troublesome.
17738 (YYSTACK_USE_ALLOCA): New flag macro.
17739 Define it for some systems and compilers.
17740 (YYSTACK_ALLOC): New macro.
17741 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17742 If it was malloc'd, free it.
17743
177441997-05-17 Richard Stallman <rms@gnu.org>
17745
17746 * bison.simple:
17747 Use malloc, if using alloca is troublesome.
17748 (YYSTACK_USE_ALLOCA): New flag macro.
17749 Define it for some systems and compilers.
17750 (YYSTACK_ALLOC): New macro.
17751 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17752 If it was malloc'd, free it.
17753
177541997-04-23 Richard Stallman <rms@gnu.org>
17755
17756 * src/bison.s1:
17757 (alloca) [__hpux]: Always define as __builtin_alloca.
17758
177591997-04-23 Richard Stallman <rms@gnu.org>
17760
17761 * bison.simple:
17762 (alloca) [__hpux]: Always define as __builtin_alloca.
17763
177641997-04-22 Richard Stallman <rms@gnu.org>
17765
17766 * src/bison.s1:
17767 [__hpux]: Include alloca.h (right for HPUX 10)
17768 instead of declaring alloca (right for HPUX 9).
17769
17770 * src/bison.s1 (__yy_memcpy):
17771 Declare arg `count' as unsigned int.
17772 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17773
177741997-04-22 Richard Stallman <rms@gnu.org>
17775
17776 * bison.simple:
17777 [__hpux]: Include alloca.h (right for HPUX 10)
17778 instead of declaring alloca (right for HPUX 9).
17779
17780 * bison.simple (__yy_memcpy):
17781 Declare arg `count' as unsigned int.
17782 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17783
177841997-01-03 Richard Stallman <rms@gnu.org>
17785
17786 * src/allocate.c: [__STDC__ or _MSC_VER]:
17787 Declare calloc and realloc to return void *.
17788
177891997-01-02 Richard Stallman <rms@gnu.org>
17790
17791 * src/system.h:
17792 [_MSC_VER]: Include stdlib.h and process.h.
17793 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
17794
17795 * src/main.c (main): Return FAILURE as a value.
17796 (printable_version): Declare arg as int, not char.
17797
177981997-01-02 Richard Stallman <rms@gnu.org>
17799
17800 * Makefile.in (dist):
17801 Explicitly check for symlinks, and copy them.
17802
178031996-12-19 Richard Stallman <rms@gnu.org>
17804
17805 * src/files.c:
17806 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
17807
178081996-12-18 Paul Eggert <eggert@gnu.org>
17809
17810 * src/bison.s1 (yyparse):
17811 If __GNUC__ and YYPARSE_PARAM are both defined,
17812 declare yyparse to have a void * argument.
17813
178141996-12-18 Paul Eggert <eggert@gnu.org>
17815
17816 * bison.simple (yyparse):
17817 If __GNUC__ and YYPARSE_PARAM are both defined,
17818 declare yyparse to have a void * argument.
17819
178201996-12-17 Richard Stallman <rms@gnu.org>
17821
17822 * src/reduce.c (nbits): Add some casts.
17823
178241996-08-12 Richard Stallman <rms@gnu.org>
17825
17826 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
17827
178281996-08-12 Richard Stallman <rms@gnu.org>
17829
17830 * bison.simple: Test _MSDOS as well as _MSDOS_.
17831
178321996-07-31 Richard Stallman <rms@gnu.org>
17833
17834 * src/bison.s1:
17835 [__sun && __i386]: Include alloca.h.
17836
178371996-07-31 Richard Stallman <rms@gnu.org>
17838
17839 * bison.simple:
17840 [__sun && __i386]: Include alloca.h.
17841
178421996-07-30 Richard Stallman <rms@gnu.org>
17843
17844 * src/bison.s1: Comment change.
17845
17846 * src/bison.s1: Test _MSDOS_, not MSDOS.
17847
178481996-07-30 Richard Stallman <rms@gnu.org>
17849
17850 * bison.simple: Comment change.
17851
17852 * bison.simple: Test _MSDOS_, not MSDOS.
17853
178541996-06-01 Richard Stallman <rms@gnu.org>
17855
17856 * src/reduce.c, src/reader.c, src/print.c, src/output.c, src/nullable.c, src/lex.c, src/lalr.c, src/getargs.c, src/derives.c, src/conflicts.c, src/closure.c, src/allocate.c:
17857 Insert `_' macro around many string constants.
17858
17859 * src/main.c:
17860 Insert `_' macro around many string constants.
17861
17862 (main): Call setlocale, bindtextdomain and textdomain.
17863
17864 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
17865 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
17866 [ENABLE_NLS]: Include libintl.h.
17867 [ENABLE_NLS] (gettext): Define.
17868 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
17869 (N_, PACKAGE, LOCALEDIR): New macros.
17870
178711996-06-01 Richard Stallman <rms@gnu.org>
17872
17873 * POTFILES.in: New file.
17874
17875 * Makefile.in (allocate.o):
17876 Define target explicitly.
17877
17878 * Makefile.in (CFLAGS): Set to @CFLAGS@.
17879 (LDFLAGS): Set to @LDFLAGS@.
17880 (configure): Run autoconf only if preceding `cd' succeeds.
17881 (bison.s1): Redirect output to temporary file then move the
17882 temporary to the target, rather than redirecting directly to bison.s1.
17883 (clean): Remove config.status and config.log.
17884 (distclean): Don't remove config.status here.
17885
178861996-05-12 Richard Stallman <rms@gnu.org>
17887
17888 * src/bison.s1:
17889 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17890
178911996-05-12 Richard Stallman <rms@gnu.org>
17892
17893 * bison.simple:
17894 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17895
178961996-05-11 Richard Stallman <rms@gnu.org>
17897
17898 * src/bison.s1 (__yy_memcpy):
17899 Really reorder the args, as was supposedly done on Feb 14 1995.
17900 (yyparse): Calls changed accordingly.
17901
179021996-05-11 Richard Stallman <rms@gnu.org>
17903
17904 * Makefile.in (dist): Don't use $(srcdir).
17905
17906 * bison.simple (__yy_memcpy):
17907 Really reorder the args, as was supposedly done on Feb 14 1995.
17908 (yyparse): Calls changed accordingly.
17909
179101996-01-27 Richard Stallman <rms@gnu.org>
17911
17912 * src/output.c (output_rule_data):
17913 Test YYERROR_VERBOSE in the conditional
17914 around the definition of ttyname.
17915
179161995-12-29 Richard Stallman <rms@gnu.org>
17917
17918 * src/bison.s1:
17919 Fix line numbers in #line commands.
17920
179211995-12-29 Richard Stallman <rms@gnu.org>
17922
17923 * bison.simple:
17924 Fix line numbers in #line commands.
17925
179261995-12-27 Richard Stallman <rms@gnu.org>
17927
17928 * src/bison.s1 (YYPARSE_PARAM_DECL):
17929 In C++, make it always null.
17930 (YYPARSE_PARAM_ARG): New macro.
17931 (yyparse): Use YYPARSE_PARAM_ARG.
17932
179331995-12-27 Richard Stallman <rms@gnu.org>
17934
17935 * bison.simple (YYPARSE_PARAM_DECL):
17936 In C++, make it always null.
17937 (YYPARSE_PARAM_ARG): New macro.
17938 (yyparse): Use YYPARSE_PARAM_ARG.
17939
179401995-11-29 Richard Stallman <rms@gnu.org>
17941
17942 * doc/bison.texinfo:
17943 Describe literal string tokens, %raw, %no_lines, %token_table.
17944
179451995-11-29 Daniel Hagerty <hag@gnu.org>
17946
17947 * doc/bison.texinfo: Fixed update date
17948
179491995-10-16 Richard Stallman <rms@gnu.org>
17950
17951 * src/version.c: Version 1.25.
17952
179531995-10-16 Richard Stallman <rms@gnu.org>
17954
17955 * NEWS: *** empty log message ***
17956
179571995-10-16 Richard Stallman <rms@gnu.org>
17958
17959 * doc/bison.1, doc/bison.rnh:
17960 Add new options.
17961
179621995-10-15 Richard Stallman <rms@gnu.org>
17963
17964 * src/vmsgetargs.c, src/getargs.c:
17965 Added -n, -k, and -raw switches.
17966 (noparserflag, toknumflag, rawtoknumflag): New variables.
17967
17968 * src/symtab.h (SALIAS):
17969 New #define for adding aliases to %token.
17970 (struct bucket): Added `alias' field.
17971
17972 * src/reduce.c (reduce_grammar):
17973 Revise error message.
17974 (print_notices): Remove final `.' from error message.
17975
17976 * src/reader.c (reader_output_yylsp):
17977 New function.
17978 (readgram): Use `#if 0' around code that accepted %command
17979 inside grammar rules: The documentation doesn't allow it,
17980 and it will fail since the %command processors scan for the next %.
17981 (parse_token_decl): Extended the %token
17982 declaration to allow a multi-character symbol as an alias.
17983 (parse_thong_decl): New function.
17984 (read_declarations): Added %thong declarations.
17985 (read_declarations): Handle NOOP to deal with allowing
17986 % declarations as another means to specify the flags.
17987 (readgram): Allow %prec prior to semantics embedded in a rule.
17988 (skip_to_char, read_declarations, copy_definition)
17989 (parse_token_decl, parse_start_decl, parse_type_decl)
17990 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
17991 (get_type_name, copy_guard, copy_action, readgram)
17992 (get_type, packsymbols): Revised most error messages.
17993 Changed `fatal' to `warnxxx' to avoid aborting for error.
17994 Revised and use multiple warnxxx functions to avoid using VARARGS1.
17995 (read_declarations): Improve the error message for
17996 an invalid character. Do not abort.
17997 (read_declarations, copy_guard, copy_action): Use
17998 printable_version to avoid unprintable characters in printed output.
17999 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
18000 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
18001 Allow the type of a non-terminal can be given
18002 more than once, as long as all specifications give the same type.
18003
18004 * src/output.c:
18005 (output_headers, output_trailers, output, output_gram)
18006 (output_rule_data): Implement noparserflag variable.
18007 Implement toknumflag variable.
18008 (output): Call reader_output_yylsp to output LTYPESTR.
18009
18010 * src/main.c (main):
18011 If reader sees an error, don't process the grammar.
18012 (fatals): Updated to not use VARARGS1.
18013 (printable_version, int_to_string, warn, warni, warns, warnss)
18014 (warnsss): New error reporting functions. Avoid abort for error.
18015
18016 * src/lex.h:
18017 Added THONG and NOOP for alias processing.
18018 Added SETOPT for the new code that allows setting options with %flags.
18019
18020 * src/lex.c:
18021 Include getopt.h. Add some extern decls.
18022 (safegetc): New function to deal with EOF gracefully.
18023 (literalchar); new function to deal with reading \ escapes.
18024 (lex): Use literalchar.
18025 (lex): Implemented "..." tokens.
18026 (literalchar, lex, parse_percent_token): Made tokenbuffer
18027 always contain the token. This includes growing the token
18028 buffer while reading an integer.
18029 (parse_percent_token): Replaced if-else statement with percent_table.
18030 (parse_percent_token): Added % declarations as another
18031 way to specify the flags -n, -l, and -r. Also added hooks for
18032 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
18033 major changes to files.c.
18034 (lex) Retain in the incoming stream a character following
18035 an incorrect '/'.
18036 (skip_white_space, lex): Revised most error messages
18037 and changed fatal to warn to avoid aborting.
18038 (percent_table): Added %thong declarations.
18039
18040 * src/gram.h: Comment changes.
18041
18042 * src/files.c (openfiles, open_extra_files, done):
18043 Add faction flag
18044 and actfile file. Handle noparserflag. Both for -n switch.
18045
18046 * src/conflicts.c (resolve_sr_conflict):
18047 Remove use of alloca.
18048
180491995-06-01 Jim Meyering <meyering@gnu.org>
18050
18051 * doc/bison.texinfo: *** empty log message ***
18052
180531995-05-06 Richard Stallman <rms@gnu.org>
18054
18055 * src/bison.s1: Comment change.
18056
180571995-05-06 Richard Stallman <rms@gnu.org>
18058
18059 * bison.simple: Comment change.
18060
180611995-05-03 Richard Stallman <rms@gnu.org>
18062
18063 * src/version.c: Version now 1.24.
18064
18065 * src/bison.s1: Change distribution terms.
18066
18067 * src/version.c: Version now 1.23.
18068
180691995-05-03 Richard Stallman <rms@gnu.org>
18070
18071 * doc/bison.texinfo:
18072 Rewrite "Conditions for Using Bison".
18073 Update version to 1.24.
18074
180751995-05-03 Richard Stallman <rms@gnu.org>
18076
18077 * bison.simple: Change distribution terms.
18078
180791995-02-23 Richard Stallman <rms@gnu.org>
18080
18081 * src/files.c: Test __VMS_POSIX as well as VMS.
18082
180831995-02-14 Jim Meyering <meyering@gnu.org>
18084
18085 * src/bison.s1 (__yy_memcpy):
18086 Renamed from __yy_bcopy to avoid
18087 confusion. Reverse FROM and TO arguments to be consistent with
18088 those of memcpy.
18089
180901995-02-14 Jim Meyering <meyering@gnu.org>
18091
18092 * bison.simple (__yy_memcpy):
18093 Renamed from __yy_bcopy to avoid
18094 confusion. Reverse FROM and TO arguments to be consistent with
18095 those of memcpy.
18096
180971994-11-10 David J. MacKenzie <djm@gnu.org>
18098
18099 * NEWS: reformat
18100
18101 * NEWS: New file.
18102
18103 * Makefile.in (DISTFILES): Include NEWS.
18104
18105 * Makefile.in (DISTFILES):
18106 Include install-sh, not install.sh.
18107
18108 * configure.in: Update to Autoconf v2 macro names.
18109
181101994-10-05 David J. MacKenzie <djm@gnu.org>
18111
18112 * Makefile.in: fix typo
18113
18114 * Makefile.in (prefix, exec_prefix):
18115 Let configure set them.
18116
181171994-09-28 David J. MacKenzie <djm@gnu.org>
18118
18119 * Makefile.in: Set datadir to $(prefix)/share.
18120
181211994-09-15 Richard Stallman <rms@gnu.org>
18122
18123 * src/bison.s1:
18124 Update copyright notice and GPL version.
18125
181261994-09-15 Richard Stallman <rms@gnu.org>
18127
18128 * bison.simple:
18129 Update copyright notice and GPL version.
18130
181311994-07-12 Richard Stallman <rms@gnu.org>
18132
18133 * src/reduce.c, src/reader.c:
18134 entered into RCS
18135
181361994-05-05 David J. MacKenzie <djm@gnu.org>
18137
18138 * Makefile.in: entered into RCS
18139
181401994-03-26 Richard Stallman <rms@gnu.org>
18141
18142 * src/bison.s1: entered into RCS
18143
181441994-03-26 Richard Stallman <rms@gnu.org>
18145
18146 * bison.simple: entered into RCS
18147
181481994-03-25 Richard Stallman <rms@gnu.org>
18149
18150 * src/main.c: entered into RCS
18151
181521994-03-24 Richard Stallman <rms@gnu.org>
18153
18154 * src/conflicts.c: entered into RCS
18155
181561994-01-02 Richard Stallman <rms@gnu.org>
18157
18158 * Makefile.in: *** empty log message ***
18159
181601993-11-21 Richard Stallman <rms@gnu.org>
18161
18162 * src/bison.s1: *** empty log message ***
18163
181641993-11-21 Richard Stallman <rms@gnu.org>
18165
18166 * doc/bison.texinfo: entered into RCS
18167
18168 * doc/bison.texinfo: *** empty log message ***
18169
181701993-11-21 Richard Stallman <rms@gnu.org>
18171
18172 * bison.simple: *** empty log message ***
18173
181741993-10-25 David J. MacKenzie <djm@gnu.org>
18175
18176 * doc/bison.texinfo: *** empty log message ***
18177
181781993-10-19 Richard Stallman <rms@gnu.org>
18179
18180 * src/bison.s1: *** empty log message ***
18181
181821993-10-19 Richard Stallman <rms@gnu.org>
18183
18184 * bison.simple: *** empty log message ***
18185
181861993-10-14 Richard Stallman <rms@gnu.org>
18187
18188 * src/bison.s1: *** empty log message ***
18189
181901993-10-14 Richard Stallman <rms@gnu.org>
18191
18192 * bison.simple: *** empty log message ***
18193
181941993-09-14 David J. MacKenzie <djm@gnu.org>
18195
18196 * doc/bison.texinfo: *** empty log message ***
18197
181981993-09-13 Noah Friedman <friedman@gnu.org>
18199
18200 * Makefile.in: *** empty log message ***
18201
182021993-09-10 Richard Stallman <rms@gnu.org>
18203
18204 * src/conflicts.c: *** empty log message ***
18205
18206 * src/system.h: entered into RCS
18207
182081993-09-10 Richard Stallman <rms@gnu.org>
18209
18210 * doc/bison.1: entered into RCS
18211
182121993-09-06 Noah Friedman <friedman@gnu.org>
18213
18214 * src/version.c: entered into RCS
18215
182161993-09-06 Noah Friedman <friedman@gnu.org>
18217
18218 * Makefile.in: *** empty log message ***
18219
182201993-07-30 David J. MacKenzie <djm@gnu.org>
18221
18222 * Makefile.in: *** empty log message ***
18223
182241993-07-24 Richard Stallman <rms@gnu.org>
18225
18226 * src/bison.s1: *** empty log message ***
18227
182281993-07-24 Richard Stallman <rms@gnu.org>
18229
18230 * bison.simple: *** empty log message ***
18231
182321993-07-08 David J. MacKenzie <djm@gnu.org>
18233
18234 * Makefile.in: *** empty log message ***
18235
182361993-07-04 Richard Stallman <rms@gnu.org>
18237
18238 * src/bison.s1: *** empty log message ***
18239
182401993-07-04 Richard Stallman <rms@gnu.org>
18241
18242 * bison.simple: *** empty log message ***
18243
182441993-06-26 David J. MacKenzie <djm@gnu.org>
18245
18246 * src/getargs.c: entered into RCS
18247
182481993-06-26 David J. MacKenzie <djm@gnu.org>
18249
18250 * doc/bison.texinfo: *** empty log message ***
18251
18252 * doc/bison.1: New file.
18253
182541993-06-25 Richard Stallman <rms@gnu.org>
18255
18256 * src/getargs.c: New file.
18257
182581993-06-16 Richard Stallman <rms@gnu.org>
18259
18260 * src/bison.s1: *** empty log message ***
18261
182621993-06-16 Richard Stallman <rms@gnu.org>
18263
18264 * bison.simple: *** empty log message ***
18265
182661993-06-03 Richard Stallman <rms@gnu.org>
18267
18268 * src/bison.s1: New file.
18269
182701993-06-03 Richard Stallman <rms@gnu.org>
18271
18272 * doc/bison.texinfo: *** empty log message ***
18273
182741993-06-03 Richard Stallman <rms@gnu.org>
18275
18276 * bison.simple: New file.
18277
182781993-05-19 Richard Stallman <rms@gnu.org>
18279
18280 * doc/bison.texinfo: New file.
18281
182821993-05-07 Noah Friedman <friedman@gnu.org>
18283
18284 * Makefile.in: *** empty log message ***
18285
182861993-04-28 Noah Friedman <friedman@gnu.org>
18287
18288 * src/reader.c: *** empty log message ***
18289
182901993-04-23 Noah Friedman <friedman@gnu.org>
18291
18292 * src/alloc.h: entered into RCS
18293
182941993-04-20 David J. MacKenzie <djm@gnu.org>
18295
18296 * src/version.c: *** empty log message ***
18297
18298 * src/files.c, src/allocate.c:
18299 entered into RCS
18300
18301 * src/reader.c: *** empty log message ***
18302
18303 * src/lex.c: entered into RCS
18304
18305 * src/conflicts.c: New file.
18306
18307 * src/symtab.c: entered into RCS
18308
18309 * src/alloc.h: New file.
18310
18311 * src/LR0.c: entered into RCS
18312
183131993-04-18 Noah Friedman <friedman@gnu.org>
18314
18315 * src/reader.c: New file.
18316
18317 * src/version.c: *** empty log message ***
18318
183191993-04-18 Noah Friedman <friedman@gnu.org>
18320
18321 * Makefile.in: *** empty log message ***
18322
183231993-04-17 Noah Friedman <friedman@gnu.org>
18324
18325 * Makefile.in: *** empty log message ***
18326
183271993-04-15 Richard Stallman <rms@gnu.org>
18328
18329 * src/main.c, src/files.c:
18330 New file.
18331
183321993-04-15 Noah Friedman <friedman@gnu.org>
18333
18334 * configure.in: entered into RCS
18335
18336 * configure.in: *** empty log message ***
18337
18338 * configure.in: New file.
18339
183401993-04-14 Richard Stallman <rms@gnu.org>
18341
18342 * Makefile.in: New file.
18343
183441993-04-13 Richard Stallman <rms@gnu.org>
18345
18346 * src/version.c: New file.
18347
183481993-03-25 Richard Stallman <rms@gnu.org>
18349
18350 * src/output.c: entered into RCS
18351
183521992-09-25 Richard Stallman <rms@gnu.org>
18353
18354 * configure.bat: entered into RCS
18355
183561992-06-22 Richard Stallman <rms@gnu.org>
18357
18358 * src/vmsgetargs.c: entered into RCS
18359
183601992-06-22 Richard Stallman <rms@gnu.org>
18361
18362 * doc/bison.rnh: entered into RCS
18363
183641992-04-20 David J. MacKenzie <djm@gnu.org>
18365
18366 * README: entered into RCS
18367
183681992-01-22 Richard Stallman <rms@gnu.org>
18369
18370 * src/machine.h: entered into RCS
18371
183721991-12-21 Richard Stallman <rms@gnu.org>
18373
18374 * src/lalr.c, src/closure.c:
18375 entered into RCS
18376
183771991-12-20 Richard Stallman <rms@gnu.org>
18378
18379 * src/state.h: entered into RCS
18380
183811991-12-18 Richard Stallman <rms@gnu.org>
18382
18383 * src/print.c, src/nullable.c, src/derives.c:
18384 entered into RCS
18385
183861991-11-03 David J. MacKenzie <djm@gnu.org>
18387
18388 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
18389 entered into RCS
18390
183911988-09-09 Richard Stallman <rms@gnu.org>
18392
18393 * src/bison.hairy: entered into RCS
18394
183951987-12-16 Richard Stallman <rms@gnu.org>
18396
18397 * REFERENCES: entered into RCS
18398
18399
18400 -----
18401
18402 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
18403 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
18404 Software Foundation, Inc.
18405
18406 Copying and distribution of this file, with or without
18407 modification, are permitted provided the copyright notice and this
18408 notice are preserved.
18409
18410$Id$