]> git.saurik.com Git - bison.git/blame - ChangeLog
Consolidate the 4 prologue alternative directives (%code, %requires,
[bison.git] / ChangeLog
CommitLineData
8e0a5e9e
JD
12007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 Consolidate the 4 prologue alternative directives (%code, %requires,
4 %provides, and %code-top) into a single %code directive with an
5 optional qualifier field. Discussed at
6 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
7 * NEWS (2.3a+): Rewrite the existing entry for the prologue
8 alternatives.
9 * doc/bison.texinfo (Prologue Alternatives): Update.
10 (Decl Summary): Update to %code "requires" and %code "provides".
11 (Calc++ Parser): Update to %code "requires".
12 (Bison Symbols): Remove entries for %requires, %provides, and
13 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
14 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
15 are replaced by b4_percent_code_provides and b4_percent_code_requires,
16 which are skeleton-specific.
17 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
18 declare what %code qualifiers it supports and to complain if any other
19 qualifiers were used in the grammar.
20 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
21 and b4_user_code([b4_percent_code_provides]) in place of
22 b4_user_requires and b4_user_provides.
23 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
24 Add b4_user_code([b4_percent_code_top]) and
25 b4_user_code([b4_percent_code]).
26 Invoke b4_check_percent_code_qualifiers.
27 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
28 PERCENT_REQUIRES): Remove.
29 (grammar_declaration): Remove RHS's for %code-top, %provides, and
30 %requires. Rewrite the %code RHS as the unqualified form defining the
31 muscle b4_percent_code. Add another RHS for the qualified %code form,
32 which defines muscles of the form b4_percent_code_QUALIFIER and the
33 b4_used_percent_code_qualifiers muscle.
34 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
35 PERCENT_REQUIRES): Remove.
36 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
37 %code "requires" and %code "provides".
38 * tests/input.at (Reject bad %code qualifiers): New.
39
95021767
JD
402007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
41
42 Use the new code_props interface for destructors and printers.
43 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
44 printer_location members, and change the type of the destructor and
45 printer members to code_props.
46 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
47 symbol_printer_get, semantic_type_destructor_set,
48 semantic_type_printer_set, default_tagged_destructor_set,
49 default_tagless_destructor_set, default_tagged_printer_set,
50 default_tagless_printer_set): Use code_props in arguments and return
51 types in place of char const * and location.
52 (symbol_destructor_location_get, symbol_printer_location_get): Remove
53 since the locations are now contained in the return of
54 symbol_destructor_get and symbol_printer_get.
55 * src/output.c (symbol_destructors_output, symbol_printers_output):
56 Replace with...
57 (symbol_code_props_output): ... this to eliminate duplicate code.
58 (output_skeleton): Update to use symbol_code_props_output.
59 * src/reader.c (symbol_should_be_used): Update use of
60 symbol_destructor_get.
61 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
62 Update uses of the various _destructor_set and _printer_set functions.
63 * src/symtab.c: (default_tagged_destructor_location,
64 default_tagless_destructor_location, default_tagged_printer_location,
65 default_tagless_printer_location): Remove since we...
66 (default_tagged_destructor, default_tagless_destructor,
67 default_tagged_printer, default_tagless_printer): ... change the type
68 of these to code_props.
69 (symbol_new, semantic_type_new, symbol_destructor_set,
70 semantic_type_destructor_set, symbol_destructor_get,
71 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
72 symbol_check_alias_consistency, default_tagged_destructor_set,
73 default_tagless_destructor_set, default_tagged_printer_set,
74 default_tagless_printer_set): Update.
75 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
76 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
77 code_props members.
78 (symbol_print): Use SYMBOL_CODE_PRINT.
79
f6857bbf
JD
802007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
81
82 Use the new code_props interface for rule actions.
83 * src/symlist.h (symbol_list): Replace action, action_location, and
84 used members with a code_props action_props member.
85 * src/reader.c (symbol_should_be_used, grammar_rule_check,
86 grammar_midrule_action, grammar_current_rule_merge_set,
87 grammar_current_rule_symbol_append, packgram): Update.
88 * src/scan-code.h (translate_rule_action): Remove, no longer used.
89 * src/scan-code.l (handle_action_dollar): Update.
90 (translate_rule_action): Remove, no longer used.
91 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
92
7c0c6181
JD
932007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
94
95 Use the new code_props interface in parse-gram.y.
96 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
97 Update all uses of translate_* functions to use the new code_props
98 interface and to use gram_scanner_last_string_free and
99 code_scanner_last_string_free where possible.
100 (grammar_declaration): symbol_list_destructor_set and
101 symbol_list_printer_set now perform the translation, so don't do it
102 here. Use gram_scanner_last_string_free where possible.
103 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
104 translate_code): Remove, no longer used.
105 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
106 symbol_list_printer_set): Perform code translation here rather than
107 depending on the caller to do so.
108
109 * src/symlist.h (struct symbol_list): Correct some documentation typos.
110 * src/scan-gram.h (gram_last_string): Remove declaration.
111 * src/scan-gram.l (last_string): Declare it static.
112
28e52c0d
JD
1132007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
114
115 Encapsulate code properties and related functionality for the various
116 destructors, printers, and actions into a code_props structure and
117 interface. This patch merely implements code_props in scan-code.h and
118 scan-code.l. Future patches will rewrite other modules to use it.
119 Discussed starting at
120 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
121 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
122 consistently initialize const structs that have an empty location
123 field.
124 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
125 to ensure consistency.
126 * src/scan-code.h (code_props): New structure.
127 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
128 function, macro, and const global variable for initializing a
129 code_props with no code.
130 (code_props_plain_init, code_props_symbol_action_init,
131 code_props_rule_action_init, code_props_translate_code): The rest of
132 the new code_props functional interface. Among other things, the init
133 functions set the code_props kind field so that
134 code_props_translate_code will know whether to behave like
135 translate_symbol_action, translate_rule_action, or translate_code.
136 These old translate functions must remain until all other modules are
137 updated to use the new code_props interface.
138 (code_scanner_last_string_free): New function similar to
139 gram_scanner_last_string_free.
140 (code_scanner_free): Add documentation.
141 * src/scan-code.l: Implement the new interface.
142 (code_lex): Make it static, add a code_props* argument, and remove the
143 rule argument.
144 (last_string): New static global similar to the one in scan-gram.l.
145 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
146 instead of rule.
147 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
148 code_props since Bison may one day use this information for destructors
149 and printers.
150 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
151 (handle_action_dollar): Use symbol_list_n_get and set used flag
152 directly since symbol_list_n_used_set is removed.
153 (translate_action): Add a code_props* argument and remove the rule,
154 action, and location arguments. Pass the code_props* on to code_lex.
155 (translate_rule_action, translate_symbol_action, translate_code):
156 Rewrite as wrappers around the new code_props interface.
157 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
158 it would eventually need to break the encapsulation of code_props.
159
96034983
JD
1602007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
161
162 * etc/.cvsignore: New.
163
945e396c
JD
1642007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
165
166 Add maintainer-push-check to run maintainer-check using push parsing in
167 place of pull parsing where available.
168 * Makefile.am (maintainer-push-check): New.
169 * data/bison.m4 (b4_use_push_for_pull_if): New.
170 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
171 appropriately based on their existing values.
172 (yypush_parse): Don't print push-parser-specific diagnostics if push
173 parsing is being used in place of pull parsing.
174 * data/yacc.c: If push parsing should replace pull parsing, redirect to
175 push.c.
176 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
177 variable, and insert b4_use_push_for_pull_flag into muscles.
178 * tests/Makefile.am (maintainer-push-check): New.
179
7d596384
JD
1802006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
181
182 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
183 (whether successful or failed) so that yypush_parse can be invoked
184 again to start a new parse using the same yypstate.
185 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
186 check multiple yypull_parse invocations on the same yypstate. For pull
187 mode, extend to check multiple yyparse invocations.
188 (Exploding the Stack Size with Alloca): Extend to try with
189 %push-pull-parser.
190 (Exploding the Stack Size with Malloc): Likewise.
191
192 * tests/calc.at (Simple LALR Calculator): Don't specify
193 %skeleton "push.c" since %push-pull-parser implies that now.
194 * tests/headers.at (export YYLTYPE): Don't check for the push
195 declarations. Otherwise, this test case can't be used to see if push
196 mode can truly emulate pull mode.
197 * tests/input.at (Torturing the Scanner): Likewise.
198 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
199 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
200 AT_YACC_IF, which now includes the case of push mode since %skeleton
201 need not be used for push mode. This will be more intuitive once
202 push.c is renamed to yacc.c.
203
7172e23e
JD
2042006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
205
206 For push mode, convert yyparse from a macro to a function, invoke yylex
207 instead of passing a yylexp argument to yypull_parse, and don't
208 generate yypull_parse or yyparse unless %push-pull-parser is declared.
209 Discussed starting at
210 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
211 * data/bison.m4 (b4_pull_if): New.
212 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
213 * data/push.c: Improve M4 quoting a little.
214 (b4_generate_macro_args, b4_parenthesize): Remove.
215 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
216 any time a pull parser is requested.
217 Don't #define this as a wrapper around yypull_parse. Instead, when
218 both push and pull are requested, make it a function that does that
219 same thing.
220 (yypull_parse): If there's a b4_prefix, #define this to
221 b4_prefix[pull_parse] when both push and pull are requested.
222 Don't define this as a function unless both push and pull are
223 requested.
224 Remove the yylexp argument and hard-code yylex invocation instead.
225 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
226 %push-parser.
227 * src/getargs.c (pull_parser): New global initialized to true.
228 * getargs.h (pull_parser): extern it.
229 * src/output.c (prepare): Insert pull_flag muscle.
230 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
231 (prologue_declaration): Set both push_parser and pull_parser = true for
232 %push-pull-parser. Set push_parser = true and pull_parser = false for
233 %push-parser.
234 * src/scan-gram.l: Don't accept %push_parser as an alternative to
235 %push-parser since there's no backward-compatibility concern here.
236 Scan %push-pull-parser.
237 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
238 instead of %push-parser.
239 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
240 prototype it in the module that calls yyparse.
241 * tests/input.at (Torturing the Scanner): Likewise.
242 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
243
2e7944cb
JD
2442006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
245
246 Update etc/bench.pl. Optimize push mode a little (the yyn change
247 deserves most of the credit).
248 * Makefile.am (SUBDIRS): Add etc subdirectory.
249 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
250 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
251 yytoken, yyval, and yyloc declarations to...
252 (yyparse or yypush_parse): ... here to improve performance. For
253 yypush_parse invocations after the first, be sure to assign yyn its old
254 value again.
255 (yypstate_new): Don't bother initializing the yyresult field since the
256 initial value isn't used.
257 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
258 remove the #define that, in push mode, set it to yyps->NAME.
259 * etc/Makefile.am: New.
260 * etc/bench.pl: Remove and build it instead from...
261 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
262 "tests/bison" from the build directory by default rather than just
263 invoking "bison" from $PATH.
264 (calc_grammar): Update push parser code: don't declare yylval globally,
265 don't define yyparse_wrapper, and don't #define yyparse.
266 (bench_grammar): Update to check all working combinations of yacc.c,
267 push.c, impure, pure, pull, and push.
268
c3d50342
JD
2692006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
270
271 For push mode, add pull wrappers around yypush_parse.
272 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
273 (yypull_parse): New function wrapping yypush_parse.
274 (yyparse): New #define wrapping yypull_parse.
275 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
276 is declared.
277 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
278 prototype yylex in the module that calls yyparse, and don't prototype
279 yyparse there. Otherwise, the yyparse expansion won't compile.
280 * tests/input.at (Torturing the Scanner): Likewise.
281
94ebeba5
JD
2822006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
283
284 Enable push parsers to operate in impure mode. Thus, %push-parser no
285 longer implies %pure-parser. The point of this change is to move
286 towards being able to test the push parser code by running the entire
287 test suite as if %push-parser had been declared.
288 * data/push.c (yypush_parse): For impure mode, remove the
289 yypushed_char, yypushed_val, and yypushed_loc arguments.
290 Instead, declare these as local variables initialized to the global
291 yychar, yylval, and yylloc.
292 For the first yypush_parse invocation only, restore the initial values
293 of these global variables when it's time to read a token since they
294 have been overwritten.
295 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
296 %push-parser.
297 * tests/calc.at (Simple LALR(1) Calculator): Always declare
298 %pure-parser along with %push-parser since this test case was designed
299 for pure push parsers.
300 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
301 (AT_YACC_OR_PUSH_IF): New.
302 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
303 add a note that it's still wrong for some cases (as it has been for a
304 while).
305 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
306 %push-parser no longer implies %pure-parser.
307
a0633178
JD
3082006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
309
310 Remove some unnecessary differences between the pull parser code and
311 the push parser code. This patch enables yynerrs in push mode.
312 * data/push.c: Reformat M4 a little.
313 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
314 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
315 because push mode is on. Instead, if pure mode is on, move yynerrs
316 to...
317 (b4_declare_parser_state_variables): ... here.
318 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
319 to yyps->NAME so it can be used in yypush_parse.
320 (yypush_parse): Don't omit uses of yynerrs in push mode.
321
8646b6a3
JD
3222006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
323
324 Fix bug such that the first pushed token's value and location are
325 sometimes overwritten (sometimes by %initial-action) before being used.
326 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
327 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
328 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
329 more closely mimic the pull parser logic.
330 Don't copy the pushed token to yychar, yylval, and yylloc until it's
331 time to read a token, which is after any initialization of yylval and
332 yylloc.
333 (gottoken): Rename label to...
334 (yyread_pushed_token): ... for clarity and to avoid infringing on the
335 user namespace.
336
9baf4d74
JD
3372006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
338
339 Rearrange initialization of the parser state variables so that the
340 skeleton doesn't have to have a copy for pull mode and another for push
341 mode. This patch also fixes at least a bug such that yylloc was not
342 initialized (with b4_location_initial_line and
343 b4_location_initial_column) upon calling yypush_parse. However, that
344 initialization now overwrites the first token's location;
345 %initial-action assigning @$ already did the same thing, and both bugs
346 will be fixed in a later patch.
347 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
348 (b4_declare_parser_state_variables): Remove initialization of yytoken,
349 yyss, yyvs, yyls, and yystacksize.
350 (yypstate_new): Remove initialization of some yypstate fields: yystate,
351 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
352 yylsp.
353 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
354 yyps->NAME so it can be used in yypush_parse.
355 (yyparse or yypush_parse): For yypush_parse, don't print the
356 "Starting parse" diagnostic for invocations after the first.
357 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
358 yypush_parse, only do it for the first invocation.
359 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
360 initialization to occur in yypush_parse but only on the first
361 invocation.
362
23522164
JD
3632006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
364
365 * data/push.c: Add CPP guards around push parser declarations in both
366 the header and the code file.
367 In the code file, move the push parser declarations to the same place
368 they appear in the header file.
369 Clean up the M4 some, especially the inconsistent underquoting in
370 some b4_c_function_def and b4_c_function_decl uses.
371
bb010fe5
JD
3722006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
373
374 Encapsulate the push parser state variables into an M4 macro so the
375 push skeleton doesn't have to list them again for pull mode's yyparse.
376 For push mode, remove yypush_parse's local equivalents of these
377 variables to eliminate unnecessary copying between the two sets at
378 run-time. This patch also fixes at least a bug related to multiple
379 %initial-action invocations in push mode.
380 * data/push.c (b4_declare_parser_variables): Rename to...
381 (b4_declare_scanner_communication_variables): ... this for clarity and
382 update both uses.
383 (b4_declare_yyparse_variables): Remove and move its contents to the one
384 spot where it was invoked.
385 (b4_declare_parser_state_variables): New macro containing the parser
386 state variables required by push mode.
387 (struct yypstate): Replace all fields but yynew with
388 b4_declare_parser_state_variables.
389 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
390 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
391 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
392 (yyparse or yypush_parse): For yyparse in pull mode, replace local
393 parser state variable declarations with
394 b4_declare_parser_state_variables.
395 Don't initialize parser state variables when calling yypush_parse since
396 yypstate_new already does that.
397 Invoke the user's initial action only upon the first yypush_parse
398 invocation.
399 Remove all code that copies between the local parser state variables
400 and the yypstate.
401
2d212f8c
JD
4022006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
403
404 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
405 prevent a name collision in a future patch where these names will
406 sometimes be #define'd.
407 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
408 since it no longer has the same name as the existing argument.
409 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
410
e6e704dc
JD
4112006-12-19 Paolo Bonzini <bonzini@gnu.org>
412 and Joel E. Denny <jdenny@ces.clemson.edu>
413
414 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
415 that the argument is case-insensitive, and there's no `=' here.
416 For the %skeleton entry, mention that %language is better.
417 (Bison Options): Likewise for --language and --skeleton. Move the
418 --skeleton entry so that the `Tuning the parser' section is sorted
419 alphabetically on long options.
420 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
421 %language directive in detail here; cross-reference the %language
422 documentation instead.
423 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
424 `%require "2.3b"' so that the example is always up-to-date.
425 (Bison Symbols): Add entries for %language and %skeleton.
426 * examples/extexi (normalize): Instead of replacing every %require
427 argument with the current Bison version, just substitute for
428 `@value{VERSION}'. This guarantees that we're testing what actually
429 appears in the documentation.
430 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
431 rather than `@VERSION@'.
432
0e021770
PE
4332006-12-18 Paul Eggert <eggert@cs.ucla.edu>
434
fd575f05
PE
435 * NEWS: Reword the %language news a bit, and put it earlier.
436
0e021770
PE
437 * src/getargs.c (skeleton_arg): Last arg is now location const *.
438 Rewrite to simplify the logic.
439 (language_argmatch): Likewise.
fd575f05
PE
440 (program_name): We now own this var.
441 * src/getargs.h (struct bison_language): Use char[] rather than
442 const char *.
0e021770
PE
443
444 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
445 Java is supported.
446 * src/complain.c (program_name): Remove decl; no longer needed.
447 * src/main.c (program_name): Remove; now belongs to getargs.
448
4492006-12-18 Paolo Bonzini <bonzini@gnu.org>
450
451 * NEWS: Document %language.
452
453 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
454
455 * data/c-skel.m4, data/c++-skel.m4: New files.
456 * data/glr.c: Complain on push parsers.
457
458 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
459 over %skeleton.
460 (Directives): Document %language and %skeleton.
461 (Command line): Document -L.
462
463 * examples/extexi: Rewrite %require directive.
464 * examples/calc++/Makefile.am: Pass VERSION to extexi.
465
466 * src/files.c (compute_exts_from_gc): Look in language structure
467 for .y extension.
468 (compute_file_name_parts): Check whether .tab should be added.
469 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
470 (language, skeleton_arg, language_argmatch): New.
471 (long_options): Add --language.
472 (getargs): Use skeleton_arg, add -L/--language.
473 * src/getargs.h: Include location.h.
474 (struct bison_language, language, skeleton_arg, language_argmatch): New.
475 * src/output.c (prepare): Pick default skeleton from struct language.
476 Don't dispatch C skeletons here.
477 * src/parse-gram.y (PERCENT_LANGUAGE): New.
478 (prologue_declaration): Add "%language" rule, use skeleton_arg.
479 * src/scan-gram.l ("%language"): New rule.
480
481 * tests/calc.at: Test %skeleton and %language.
482 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
483 (AT_GLR_IF): Look for %skeleton "glr.cc".
484 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
485 (AT_YACC_IF): Reject %language.
486
5691bf57
PE
4872006-12-18 Paul Eggert <eggert@cs.ucla.edu>
488
db06f0ce
PE
489 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
490 since it wasn't used; only the typedef name 'semantic_type' is needed.
491 Also, omit trailing white space.
492
5691bf57
PE
493 * bootstrap: Sync from coreutils.
494 (gnulib_extra_files): Add build-aux/announce.gen.
495 (slurp): Adjust .gitignore files like .cvsignore files.
496 * build-aux/announce-gen: Remove from CVS, since bootstrap
497 now creates this.
498
791934e4
JD
4992006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
500
501 Make %push-parser imply %pure-parser. This fixes several bugs; see
502 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
503 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
504 pure_parser = true.
505 * data/push.c: Don't bother testing b4_push_if when deciding whether
506 to expand b4_declare_parser_variables globally.
507 (yypush_parse): Likewise in here.
508
509 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
510 (yy_reduce_print): Reformat M4 for readability.
511
ee5abb37
JD
5122006-12-15 Bob Rossi <bob@brasko.net>
513 and Joel Denny <jdenny@ces.clemson.edu>
514
515 * data/push.c (yypstate): Add typedef, and update all uses of
516 struct yypstate to just yypstate.
517 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
518
16ca01f9
JD
5192006-12-14 Bob Rossi <bob@brasko.net>
520
521 * data/push.c (yypush_parse): Declare prototype regardless of
522 %locations option.
523
ab8e7e1a
JD
5242006-12-14 Bob Rossi <bob@brasko.net>
525
526 * data/push.c (yyparse): Remove the prototype and the #define when in
527 push-parser mode.
528
9bf32be3
JD
5292006-12-13 Bob Rossi <bob@brasko.net>
530
531 * data/push.c (yypstate_init): Rename to...
532 (yypstate_new): ... this and use b4_c_function_def.
533 (yypstate_delete): New.
534 (yypush_parse): Change parameters yynval and yynlloc to be const.
535 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
536 yypstate_delete functions.
537
f02e2948
JD
5382006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
539
540 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
541 strange test case titles. Reported by Bob Rossi.
542
38eb7751
PE
5432006-12-13 Paul Eggert <eggert@cs.ucla.edu>
544
545 * TODO: Add pointer to Sylvain Schmitz's work on static detection
546 of potential ambiguities in GLR grammers.
547
bd9d212b
JD
5482006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
549
550 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
551 `bison ', use m4_index instead of m4_substr since chopping up a string
552 containing M4-special characters causes problems here.
553
554 Fix a couple of bugs related to special characters in user-specified
555 file names, and make it easier for skeletons to compute output file
556 names with the same file name prefix as Bison-computed output file
557 names.
558 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
559 b4_parser_file_name and b4_spec_defines_file instead of
560 @output_parser_name@ and @output_header_name@, which are now redundant.
561 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
562 b4_parser_file_name, b4_spec_defines_file, and the new
563 @basename(FILENAME@) instead of @output_parser_name@ and
564 @output_header_name@, which inappropriately escaped the file names as
565 C string literals.
566 * src/files.c (all_but_ext): Remove static qualifier.
567 (compute_output_file_names): Move `free (all_but_ext)' to...
568 (output_file_names_free): ... here since all_but_ext is needed later.
569 * src/files.h (all_but_ext): Extern.
570 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
571 exactly what MUSCLE_INSERT_STRING used to do.
572 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
573 characters are escaped properly.
574 * src/output.c (prepare): Define muscle file_name_all_but_ext as
575 all_but_ext.
576 For pkgdatadir muscle, maintain previous functionality by using
577 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
578 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
579 digraphs would never be expanded. Hopefully no one has M4-special
580 characters in his Bison installation path.
581 * src/scan-skel.l: Don't parse @output_header_name@ and
582 @output_parser_name@ anymore since they're now redundant.
583 In @output, use decode_at_digraphs.
584 Parse a new @basename command that invokes last_component.
585 (decode_at_digraphs): New.
586 (BASE_QPUTS): Remove unused.
587 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
588 (Output file name): New tests.
589
3f7ca628
JD
5902006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
591
592 Warn about output files that are generated by the skeletons and that
593 conflict with other output files.
594 * data/glr.c: Don't generate the header file here when glr.cc does.
595 * src/files.c (file_names, file_names_count): New static globals.
596 (compute_output_file_names): Invoke output_file_name_check for files
597 not generated by the skeletons and remove existing checks.
598 (output_file_name_check): New function that warns about conflicting
599 output file names.
600 (output_file_names_free): Free file_names.
601 * src/files.h (output_file_name_check): Declare.
602 * src/scan-skel.l: Invoke output_file_name_check for files generated by
603 the skeletons.
604 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
605 (Conflicting output files): New tests.
606
178e123e
PE
6072006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
608
609 * doc/bison.texinfo: Fix a couple of typos.
610
6112006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
612
613 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
614 Rename to...
615 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
616 update all uses.
617 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
618 (yypush_parse): Rename yypvars argument to yyps and remove redundant
619 local pv.
620 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
621 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
622
ea17f233
JD
6232006-12-07 Bob Rossi <bob@brasko.net>
624 and Joel Denny <jdenny@ces.clemson.edu>
625
626 * data/push.c (yypvarsinit): Change return type from void* to struct
627 yypvars*. No longer cast to void* on return.
628 (struct yypvars): Remove yylen since it need not be remembered between
629 yypushparse invocations.
630 (yypushparse): Don't copy between yylen and pv->yylen.
631
55a30bda
JD
6322006-12-05 Bob Rossi <bob@brasko.net>
633
634 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
635 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
636 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
637 (struct yypvars): Remove b4_declare_parser_variables.
638 (yypvarsinit): Remove init code for removed variables.
639 (global scope): Do not declare b4_declare_parser_variables if
640 push or pure mode.
641 (yypushparse): Add b4_declare_parser_variables.
642 Init new local variables, and remove init code for removed
643 yypvars variables.
644 (yyparse): Delete.
645 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
646 and yyparse for other modes.
647 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
648 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
649 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
650 (AT_PURE_LEX_IF): True if pure or push parser.
651
85894313
JD
6522006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
653
654 Document Yacc prologue alternatives and default %destructor's and
655 %printer's as experimental. Don't mention Java yet. Discussed at
656 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
657 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
658 (2.3a): Annotate this entry to say the old forms of these features were
659 also experimental.
660 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
661 Bison Symbols): Say they're experimental. Comment out any mention
662 of Java (we'll want this back eventually).
663
02975b9a
JD
6642006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
665
666 Support a file name argument to %defines. Deprecate `=' in
667 %file-prefix, %name-prefix, and %output. Discussed at
668 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
669 * NEWS (2.3a+): Mention.
670 * doc/bison.texinfo (Decl Summary, Bison Symbols): Add entry for new
671 form of %defines, and remove `=' from entries for %file-prefix,
672 %name-prefix, and %output.
673 * src/parse-gram.y (prologue_declaration): Implement.
674 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
675 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
676 all but one occurrence of %name-prefix.
677 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
678 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
679 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
680 occurrence of each of %file-prefix and %output. Add check for %defines
681 with argument.
682 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
683 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
684 Remove the `=' from %output.
685
287b314e
JD
6862006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
687
688 Don't escape $ in test case titles since Autoconf 2.61 now does that
689 correctly.
690 * tests/actions.at (Default %printer and %destructor are not for error
691 or $undefined): Here.
692 (Default %printer and %destructor are not for $accept): Here.
693 * tests/input.at (Invalid $n and @n): Here.
694
3ebecc24
JD
6952006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
696
697 Rename <!> to <>. Discussed starting at
698 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
699 * NEWS (2.3a+): Update.
700 * doc/bison.texinfo (Freeing Discarded Symbols, Bison Symbols):
701 Update.
702 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
703 * src/scan-gram.l (INITIAL): Implement.
704 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
705 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
706 comment.
707 * tests/actions.at (Default tagless %printer and %destructor,
708 Default tagged and per-type %printer and %destructor,
709 Default %printer and %destructor are not for error or $undefined,
710 Default %printer and %destructor are not for $accept,
711 Default %printer and %destructor for mid-rule values): Update.
712 * tests/input.at (Default %printer and %destructor redeclared,
713 Unused values with default %destructor): Update.
714
26b8a438
JD
7152006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
716
717 Don't let %prec take a nonterminal.
718 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
719 token.
720 * tests/input.at (%prec takes a token): New test checking that %prec
721 won't take a nonterminal.
722
07c39ae9
JD
7232006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
724
405d53b7
JD
725 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
726 it was double-quoted.
07c39ae9
JD
727 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
728 grammar is maintained with Bison's highest standards.
729 * src/getargs.c: Fix some typos in Doxygen comments.
730
580b8926
JD
7312006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
732
733 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
734 later. Reported by Paul Eggert in
735 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
736 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
737 * src/scan-code.l (translate_action): Don't bother invoking
738 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
739 (code_scanner_free): Instead of invoking
740 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
741 which frees more.
742 * src/scan-gram.l (gram_scanner_free): Likewise.
743 * src/scan-skel.l (scan_skel): Likewise.
744
4502eadc
JD
7452006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
746
747 * src/files.c (tr): Change return type to void.
748 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
749 has been called previously for the same key.
750 (muscle_find): Return storage instead of value so that
751 --enable-gcc-warnings doesn't produce warnings that the return discards
752 const. aver that the value and storage are the same since storage
753 could potentially be NULL when value is not.
754 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
755 same as 0.
756
7746c8f6
PE
7572006-11-08 Paul Eggert <eggert@cs.ucla.edu>
758
759 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
760 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
761 us a slightly cleaner distribution, and also works.
762 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
763 gnulib changes.
764
eb095650
PE
7652006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
766 and Paul Eggert <eggert@cs.ucla.edu>
767
768 Don't let Bison leak memory except when it complains.
769 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
770 (spec_defines_file, dir_prefix): Now char *, not const char *,
771 since they are freed.
772 * src/files.c: Likewise.
773 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
774 Likewise.
775 (tr): Now operates in-place. All uses changed.
776 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
777 values.
778 (compute_file_name_parts, compute_output_file_names): Don't store
779 read-only data in variables that will be freed.
780 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
781 src_extension, and header_extension.
782 (output_file_names_free): New public function to free
783 spec_verbose_file, spec_graph_file, spec_defines_file,
784 parser_file_name, and dir_prefix.
785 * src/getargs.c (getargs): Don't store read-only data in variables that
786 will be freed.
787 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
788 (which previously existed but was unused), and quotearg_free.
789 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
790 * src/muscle_tab.c: Likewise.
791 (muscle_entry): Make the value char const *,
792 and add a new storage member that is char * and can be freed.
793 (muscle_entry_free): New private function.
794 (muscle_init): Use it instead of free.
795 (muscle_insert, muscle_grow): Update and use new storage member.
796 (muscle_code_grow): Free the string passed to muscle_grow
797 since it's not needed anymore.
798 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
799 add a new `char *code' member.
800 ("{...}"): Declare semantic type as code.
801 * src/scan-code.h (translate_rule_action):
802 (translate_symbol_action, translate_code, translate_action): Return
803 `char const *' rather than `char *' since external code should not free
804 these strings.
805 * src/scan-code.l: Likewise.
806 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
807 which is "{...}" in the parser.
808 * tests/Makefile.am (maintainer-check-valgrind): Set
809 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
810 Valgrind.
811 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
812 complain.
813 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
814 expecting a non-zero exit status sets --leak-check=summary and
815 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
816 this case, and we don't want to hear about it.
817
ac564be4
PE
8182006-11-08 Paul Eggert <eggert@cs.ucla.edu>
819
820 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
821 instead of from the template, to simplify configuration a bit.
822 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
823 and m4/wint_t.m4, as they are needed with the latest gnulib.
824
17bd8a73
JD
8252006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
826
827 Disable unset/unused mid-rule value warnings by default, and recognize
828 --warnings=midrule-values to enable them. Discussed starting at
829 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
830 * NEWS (2.3a+): Mention.
831 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
832 warnings): Add entry for midrule-values subargument.
833 * src/reader.c (symbol_should_be_used): Don't return true just because
834 the value is a set/used mid-rule value unless
835 --warnings=midrule-values was specified.
836 * tests/input.at (Unused values, Unused values before symbol
837 declarations): Run tests with and without --warnings=midrule-values.
838
839 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
840 than LIST_FREE directly.
841
89eb3c76
JD
8422006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
843
844 Finish implementing --warnings=error, which should not be implied by
845 --warnings=all (or by its synonyms -W and --warnings without
846 subarguments).
847 * src/complain.c (set_warning_issued): New function to report that
848 warnings are being treated as errors and to record an error if so.
849 Invoke...
850 (warn_at, warn): ... here.
851 * src/getargs.c (warnings_args, warnings_types): Reorder so that
852 "error - warnings are errors" does not appear above "all - all of the
853 above".
854 (getargs): For -W and --warnings without subarguments, don't let
855 FLAGS_ARGMATCH set warnings_error in warnings_flag.
856 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
857
ba7560e2
JD
8582006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
859
860 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
861 empty subargument list. For example: `bison --warnings= parser.y'.
862
31283fc3
JD
8632006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
864
865 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
866 the parser header file so that gcc doesn't warn.
867
12e35840
JD
8682006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
869
870 Split the default %destructor/%printer into two kinds: <*> and <!>.
871 Discussed starting at
872 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
873 * NEWS (2.3a+): Mention.
874 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
875 previous change today related to mid-rules.
876 (Bison Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 877 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
878 (TYPE_TAG_ANY): Add as <*>.
879 (TYPE_TAG_NONE): Add as <!>.
880 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
881 for <*> and <!>.
882 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
883 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
884 * src/symlist.c (symbol_list_default_new): Split into tagged and
885 tagless versions.
886 (symbol_list_destructor_set, symbol_list_printer_set): Split
887 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
888 SYMLIST_DEFAULT_TAGLESS.
889 * src/symlist.h: Update symbol_list_default*_new prototypes.
890 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
891 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
892 * src/symtab.c (default_destructor, default_destructor_location,
893 default_printer, default_printer_location): Split each into tagged and
894 tagless versions.
895 (symbol_destructor_get, symbol_destructor_location_get,
896 symbol_printer_get, symbol_printer_location_get): Implement tagged
897 default and tagless default cases.
898 (default_destructor_set, default_printer_set): Split each into tagged
899 and tagless versions.
900 * src/symtab.h: Update prototypes.
901 * tests/actions.at (Default %printer and %destructor): Rename to...
902 (Default tagless %printer and %destructor): ... this, and extend.
903 (Per-type %printer and %destructor): Rename to...
904 (Default tagged and per-type %printer and %destructor): ... this, and
905 extend.
906 (Default %printer and %destructor for user-defined end token): Extend.
907 (Default %printer and %destructor are not for error or $undefined):
908 Update.
909 (Default %printer and %destructor are not for $accept): Update.
910 (Default %printer and %destructor for mid-rule values): Extend.
911 * tests/input.at (Default %printer and %destructor redeclared): Extend.
912 (Unused values with default %destructor): Extend.
913
f91b1629
JD
9142006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
915
916 Don't apply the default %destructor/%printer to an unreferenced midrule
917 value. Mentioned at
918 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
919 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
920 like $@n instead of just @n so that the default %destructor/%printer
921 logic doesn't see them as user-defined symbols.
922 (symbol_is_dummy): Check for both forms of the name.
923 * src/reader.c (packgram): Remove the `$' from each midrule symbol
924 name for which the midrule value is referenced in any action.
925 * tests/actions.at (Default %printer and %destructor for mid-rule
926 values): New test.
927 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
928 for change to dummy symbol names.
929
519d0004
JD
9302006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
931
932 Warn about unset midrule $$ if the corresponding $n is used.
933 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
934 $n usage.
935 (packgram): Before invoking grammar_rule_check on any rule, make sure
936 all actions have already been scanned in order to set `used' flags.
937 Otherwise, checking that a midrule's $$ is set will not always work
938 properly because the midrule check must forward-reference the midrule's
939 parent rule.
940 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
941 warning.
942
a501eca9
JD
9432006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
944
945 More improvements to the documentation of the prologue alternatives:
946 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
947 Bison manual.
948 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
949 some text to clarify the relative importance of the new directives and
950 to show how these directives may be viewed as code labels.
951
2cbe6b7f
JD
9522006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
953
954 Similar to the recently removed %before-header, add %code-top as the
955 alternative to the pre-prologue. Mentioned at
956 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
957 Also, let the prologue alternatives appear in the grammar section.
958 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
959 (prologue_declaration): Move the existing prologue alternatives to...
960 (grammar_declaration): ... here and add %code-top.
961 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
962
963 Clean up and extend documentation for the prologue alternatives.
964 * NEWS (2.3a+): Describe prologue alternatives.
965 * doc/bison.texinfo (Prologue): Move discussion of prologue
966 alternatives to...
967 (Prologue Alternatives): ... this new section, and extend it to discuss
968 all 4 directives in detail.
969 (Bison Symbols): Clean up discussion of prologue alternatives and add
970 %code-top.
971
e557d3ea
JMG
9722006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
973
974 DJGPP specific issues.
975
976 * djgpp/config.bat: config.hin has been moved to lib. Adjust
977 config.bat accordingly.
978 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
979 * djgpp/config.site: Likewise.
980
136a0f76
PB
9812006-10-16 Paolo Bonzini <bonzini@gnu.org>
982
27bd5d67
PB
983 Replace %*-header with %provides, %requires, %code. See discussion at
984 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
985
136a0f76
PB
986 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
987 (b4_user_start_header): Remove.
988 * data/glr.c: Use new macros instead of b4_*start_header
989 and b4_*end_header.
990 * data/glr.cc: Likewise.
991 * data/lalr1.cc: Likewise.
992 * data/push.c: Likewise.
993 * data/yacc.c: Likewise.
994
995 * doc/bison.texinfo: Remove %before-header, rename
996 %{start,end,after}-header to %requires, %provides, %code.
997
998 * src/parse-gram.y: Likewise (also rename token names accordingly).
999 * src/scan-gram.l: Likewise.
1000 * tests/actions.at: Likewise.
1001
10f429ef
PE
10022006-10-14 Paul Eggert <eggert@cs.ucla.edu>
1003
1004 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
1005 Problem reported by Joel E. Denny.
1006
10072006-10-14 Jim Meyering <jim@meyering.net>
1008
1009 (Sync from coreutils.)
1010 Work also when the working directory (with e.g. coreutils sources)
1011 is version controlled with git, rather than CVS.
1012 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
1013 rather than CVS.
1014 In messages and comments, say e.g., "checked-out sources",
1015 rather than "CVS sources".
1016 (version_controlled_file): New function. Work for git as well as
1017 for CVS. Don't use grep's -q option.
1018 (slurp): Call it here, in place of CVS-specific code.
1019
c4bd5bf7
JD
10202006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
1021
1022 Fix testsuite for ./configure --enable-gcc-warnings:
1023 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
1024 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
1025 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
1026 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
1027 * test/regression.at (Diagnostic that expects two alternatives):
1028 Likewise.
1029
46356ea4
PE
10302006-10-12 Paul Eggert <eggert@cs.ucla.edu>
1031
231ed89a
PE
1032 * bootstrap.conf (gnulib_modules): Add config-h.
1033 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
1034 worry about HAVE_CONFIG_H.
1035 * lib/abitset.c: Likewise.
1036 * lib/bitset.c: Likewise.
1037 * lib/bitset_stats.c: Likewise.
1038 * lib/bitsetv-print.c: Likewise.
1039 * lib/bitsetv.c: Likewise.
1040 * lib/ebitset.c: Likewise.
1041 * lib/get-errno.c: Likewise.
1042 * lib/lbitset.c: Likewise.
1043 * lib/subpipe.c: Likewise.
1044 * lib/timevar.c: Likewise.
1045 * lib/vbitset.c: Likewise.
1046 * lib/bitset.c: Include "bitset.h" first, to test interface.
1047 * lib/bitset_stats.c: Include "bitset_stats.h" first.
1048 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
1049 * lib/bitsetv.c: Include "bitsetv.h" first.
1050 * lib/get-errno.c: Include "get-errno.h" first.
1051 * m4/.cvsignore: Add config-h.m4.
1052 * tests/actions.at (Default %printer and %destructor for ...):
1053 Adjust expected line numbers in output to reflect removal of #if
1054 HAVE_CONFIG_H lines.
1055 * tests/glr-regression.at (Missed %merge type warnings when ...):
1056 Likewise.
1057 * tests/regression.at (Braced code in declaration in rules section):
1058 Likewise.
1059 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
1060 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
1061 Include <config.h> unconditionally.
1062
46356ea4
PE
1063 * bootstrap: Sync from coreutils, as follows:
1064
1065 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
1066
1067 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
1068 variable was sometimes used without being initialized. This
1069 messed up the installation of the INSTALL file in some cases.
1070
1071 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
1072
1073 * bootstrap (usage, main program, symlink_to_gnulib): Add option
1074 --copy. Inspired by a suggestion from Bruno Haible.
1075
1076 2006-10-03 Jim Meyering <jim@meyering.net>
1077
1078 * bootstrap: Undo last change to this file, since now gnulib-tool
1079 sticks with the automake default in generating dependencies.
1080
dd4bf078
PE
10812006-10-12 Paul Eggert <eggert@cs.ucla.edu>
1082
cf2a5f7c
PE
1083 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
1084 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
1085
1086 * doc/bison.1: Add copyright notice.
1087
1088 * data/glr.c: Don't include <stdarg.h>; not used.
1089
35fe0834
PE
1090 * NEWS: The -g and --graph options now output graphs in Graphviz
1091 DOT format, not VCG format.
1092 * doc/bison.1: Likewise.
1093 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
1094 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
1095 of this change in
1096 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
1097 * TODO: Remove Graphviz entry.
1098 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
1099 remove vcg.c, vcg.h, vcg_defaults.h.
1100 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
1101 * src/graphviz.c, src/graphviz.h: New files.
1102 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
1103 * src/files.h: Make comment more generic.
1104 * src/main.c (main): Likewise.
1105 * src/print_graph.h: Likewise.
1106 * src/getargs.c (usage): Make usage description more generic.
1107 * src/print_graph.c: Include graphviz.h rather than vcg.h.
1108 (static_graph, fgraph): Remove. All uses changed to pass
1109 arguments instead of sharing a static var.
1110 (print_core, print_actions, print_state, print_graph):
1111 Output graphviz format rather than VCG format.
1112 * tests/.cvsignore: Remove *.vcg; add *.dot.
1113 * tests/output.at: Expect *.dot files, not *.vcg files.
1114
dd4bf078
PE
1115 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
1116 accommodates the 2006-10-08 change.
1117
efdd7421
PE
11182006-10-11 Bob Rossi <bob@brasko.net>
1119
1120 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
1121 (b4_yyssa, b4_yyerror_range): New macros.
1122 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
1123 (yypvarsinit): Remove init of removed fields.
1124 (yypushparse): Remove use of removed fields; use new macros instead.
1125
96a1981a
PE
11262006-10-11 Paul Eggert <eggert@cs.ucla.edu>
1127
1128 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
1129 in a push parser. Reindent slightly to match yacc.c better.
1130
11312006-10-11 Bob Rossi <bob@brasko.net>
1132
46356ea4
PE
1133 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
1134 yymsg_alloc fields.
1135 (yypvarsinit, yypushparse): Remove init of removed fields.
1136 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 1137
c1630a8b
PE
11382006-10-09 Paul Eggert <eggert@cs.ucla.edu>
1139
1140 * THANKS: Add Paolo Bonzini and Bob Rossi.
1141
90b9908d
PB
11422006-10-08 Paolo Bonzini <bonzini@gnu.org>
1143
1144 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
1145 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
1146 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
1147 b4_define_user_cde and uses): Remove.
1148 (b4_comment, b4_prefix, b4_sync_start): New.
1149 * data/bison.m4: New file, with most of the content removed from c.m4.
1150 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
1151 * src/output.c (output_skeleton): Pass bison.m4.
1152 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
1153 only if specified.
1154
cf806753
PE
11552006-10-05 Paul Eggert <eggert@cs.ucla.edu>
1156
1157 Fix test failure reported by Tom Lane in
1158 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
1159 and try to make such failures easier to catch in the future.
1160 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
1161 that's now the caller's responsibility.
1162 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
1163 Set yychar = YYEOF if it's negative.
1164 * tests/actions.at (yylex): Abort if asked to read past EOF.
1165 * tests/conflicts.at (yylex): Likewise.
1166 * tests/cxx-type.at (yylex): Likewise.
1167 * tests/glr-regression.at (yylex): Likewise.
1168 * tests/input.at (yylex): Likewise.
1169 * tests/regression.at (yylex): Likewise.
1170 * tests/torture.at (yylex): Likewise.
1171
0e2f006a
PE
11722006-10-01 Paul Eggert <eggert@cs.ucla.edu>
1173
1174 Fix problems with translating English-language diagnostics.
1175 * bootstrap: Fix bug introduced in recent bootstrap changes, with
1176 respect to bison-runtime pot generation. The YY_ stuff
1177 wasn't being captured.
1178 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
1179 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
1180 * runtime-po/POTFILES.in: Add data/push.c.
1181
e3ddc1e3
PE
11822006-09-29 Paul Eggert <eggert@cs.ucla.edu>
1183
1184 Merge bootstrap changes from coreutils.
1185
1186 2006-09-28 Jim Meyering <jim@meyering.net>
1187
1188 Automatically generated dependencies are important even
1189 when all of the sources in a directory come from gnulib.
1190 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
1191 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
1192
1193 2006-09-23 Jim Meyering <jim@meyering.net>
1194
1195 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
1196
1197 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1198
1199 * bootstrap: Add support for --force.
1200 (usage): New function. Describe usage less tersely.
1201 (CVS_only_file): New var.
1202
01e972b3
PE
12032006-09-21 Paul Eggert <eggert@cs.ucla.edu>
1204
1205 * data/push.c (YYPUSH_MORE): Make it an enum instead.
1206 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
1207 Adjust white space and comments to match GNU style better.
1208
c63d3e90
PE
12092006-09-20 Bob Rossi <bob@brasko.net>
1210
1211 * data/push.c (yyresult_get): Remove function.
1212 (YYPUSH_MORE): Add #define.
1213 (yypushparse): Modify return value.
1214
e70f46d1
PE
12152006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1216
1217 * stamp-h.in: Remove; no longer needed.
1218 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
1219 Remove config.h, config.hin, intl (no longer created).
1220 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
1221 stamp-h1.
1222
1223 Sync bootstrap from coreutils, as follows:
1224
1225 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
1226
1227 * bootstrap (symlink_to_gnulib): New function.
1228 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
1229 to copies-of-gnulib.
1230 (cp_mark_as_generated, slurp, gnulib_files):
1231 Avoid making a copy if it's the same as the old version.
1232 (gnulib_files): Add support for this variable (used by Bison).
1233
a92be413
PE
12342006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1235
1236 * src/getargs.c (usage): Rework to use conventions similar to
1237 coreutils, to make translation a bit easier and the code a bit
1238 smaller. Problem reported by Tim Van Holder.
1239
4f82b42a
PE
12402006-09-15 Paul Eggert <eggert@cs.ucla.edu>
1241
3b2942e6
PE
1242 Use some of gnulib's new modules, taken from coreutils.
1243
1244 * bootstrap: Sync from coreutils, except add support for gnulib_files.
1245 * bootstrap.conf: New file.
1246 (gnulib_modules): Add configmake, inttypes, unistd.
1247 (XGETTEXT_OPTIONS): Add complain, complain_at,
1248 fatal, fatal_at, warn, warn_at, unexpected_end.
1249 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
1250 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
1251 (gl_EARLY): Add.
1252 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
1253 (gl_INIT): Add
1254 (GNULIB_AUTOCONF_SNIPPET): Remove.
1255 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
1256 the pickiest.
1257 * lib/.cvsignore: Add inttypes_.h.
1258 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
1259 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
1260 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
1261 no-longer-necessary initializations.
1262 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
1263 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
1264 use the unistd module.
1265 * src/system.h: Likewise.
1266 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
1267 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
1268 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
1269 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
1270 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
1271 * src/system.h: Include inttypes.h unconditionally, now that we
1272 use the inttypes module. Don't bother to include stdint.h, since
1273 inttypes.h now does that for us.
1274 (LOCALEDIR): Remove, now that we use the configmake module.
1275 * src/getargs.c: Include configmake.h.
1276 * src/main.c: Likewise.
1277 * src/output.c: Likewise.
1278 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
1279 not from $abs_top_builddir, since config.h moved.
1280
1281
4f82b42a
PE
1282 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
1283 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
1284
1285 * src/parse-gram.y (symbol_declaration): Don't put statements
1286 before declarations; it's not portable to C89.
1287 * src/scan-code.l (handle_action_at): Likewise.
1288
1289 * src/scan-code.l: Always initialize braces_level; the old code
1290 left it uninitialized and therefore had undefined behavior.
1291
1292 Don't attempt to redefine 'assert', since it runs afoul of
1293 systems where standard headers (mistakenly) include <assert.h>.
1294 Instead, define and use our own alternative, called 'aver'.
1295 * src/reader.c: Don't include assert.h, since we no longer
1296 use assert.
1297 * src/scan-code.l: Likewise.
1298 * src/system.h (assert): Remove, replacing with....
1299 (aver): New function, taking a bool arg. All uses changed.
1300 * src/tables.c (pack_vector): Ensure that aver arg is bool,
1301 not merely an integer.
1302
31c10e38
PE
13032006-09-15 Bob Rossi <bob@brasko.net>
1304
1305 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
1306 * data/c.m4 (YYPUSH): New.
1307 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
1308 * src/getargs.c (push_parser): New var.
1309 * src/getargs.h (push_parser): New declaration.
1310 * src/output.c (prepare): Add macro insertion of `push_flag'.
1311 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
1312 (prologue_declaration): Parse %push-parser.
1313 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
1314 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
1315 list of removed lines from the traces observed.
1316 (AT_CHECK_CALC_LALR): Added push parser tests.
1317
fa7b79c0
PE
13182006-09-13 Paul Eggert <eggert@cs.ucla.edu>
1319
21fe08ca
PE
1320 * NEWS: Version 2.3a.
1321 * configure.ac (AC_INIT): Likewise.
1322
e8ec4d9b
PE
1323 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
1324 "#define YYSTYPE int" that caused "make maintainer-check" to fail
1325 due to header ordering dependencies. I don't know why the #define
1326 was there.
1327
fa7b79c0
PE
1328 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
1329 runtime cost when YYDEBUG is not defined, and so that some tests
1330 that used to fail now work. Problem and initial suggestion by
1331 Paolo Bonzini.
1332 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
1333 * data/glr.cc (b4_parser_class_name):
1334 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
1335 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
1336 (yydebug_) [YYDEBUG]: New member.
1337 (yycdebug_): Now defined only if YYDEBUG.
1338 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
1339 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
1340 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
1341 if YYYDEBUG.
1342 (debug_stream, set_debug_stream, debug_level, set_debug_level):
1343 Define only if YYDEBUG.
1344 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
1345 set_debug_level.
1346 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
1347 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
1348 AT_CHECK_CALC_GLR_CC that are working now.
1349
4ec13d60
PE
13502006-09-12 Paul Eggert <eggert@cs.ucla.edu>
1351
1352 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
1353 We don't need them in glr.cc, and glr.c defines them.
1354 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
1355 assumes that defining it to anything is the same as defining
1356 it to 1. Problem reported by Paolo Bonzini.
1357
8e1687ae
PE
13582006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
1359
1360 * data/c.m4 (b4_null, b4_case): Define.
1361 * src/output.c (prepare_symbols): Use b4_null.
1362 (user_actions_output): Use b4_case.
1363
3dc5e96b
PE
13642006-09-11 Paul Eggert <eggert@cs.ucla.edu>
1365
aef3da86
PE
1366 * data/glr.c (b4_shared_declarations): Put start-header first,
1367 before any #includes that we generate, so that feature-test
1368 macros work. Problem reported by Michael Deutschmann in
1369 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
1370 * data/lalr1.cc: Likewise.
1371 * doc/bison.texinfo (Prologue): Document that feature-test macros
1372 should be defined before any Bison declarations.
1373 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
1374 that depend on location.hh after, not before, Bison decls, since
1375 we now include location.hh after the first user prologue.
1376
3dc5e96b
PE
1377 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
1378 Sander Brandenburg in
1379 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
1380 Also, fix minor white space and comment issues.
aef3da86
PE
1381 (Prologue): Mention that it's better to define feature-test macros
1382 before Bison declarations. Problem reported by Michael Deutschmann.
1383
1384 * README-cvs: Fix typo: "&" should be "&&". Problem reported
1385 by Jim Meyering.
1386 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
1387 This adjusts to recent gnulib changes.
3dc5e96b 1388
b2a0b7ca
JD
13892006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
1390
1391 Finish implementation of per-type %destructor/%printer. Discussed
1392 starting at
1393 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
1394 and
1395 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
1396 * NEWS (2.3+): Add a description of this feature to the default
1397 %destructor/%printer description.
1398 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
1399 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
1400 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
1401 list node contains a semantic type.
1402 * src/symtab.c, src/symtab.h: Extend with a table that associates
1403 semantic types with their %destructor's and %printer's.
1404 (semantic_type_from_uniqstr, semantic_type_get,
1405 semantic_type_destructor_set, semantic_type_printer_set): New functions
1406 composing the public interface of that table.
1407 (symbol_destructor_get, symbol_destructor_location_get,
1408 symbol_printer_get, symbol_printer_location_get): If there's no
1409 per-symbol %destructor/%printer, look up the per-type before trying
1410 the default.
1411 * tests/actions.at (Per-type %printer and %destructor): New test case.
1412 * tests/input.at (Default %printer and %destructor redeclared):
1413 Extend to check that multiple occurrences of %symbol-default in a
1414 single %destructor/%printer declaration is an error.
1415 (Per-type %printer and %destructor redeclared, Unused values with
1416 per-type %destructor): New test cases.
1417
3be03b13
JD
14182006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
1419
1420 Require default %destructor/%printer to be declared using
1421 %symbol-default instead of an empty symbol list, and start working on
1422 new per-type %destructor/%printer. Discussed at
1423 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
1424 * NEWS (2.3+): Add %symbol-default to example.
1425 * bison.texinfo (Freeing Discarded Symbols): Likewise.
1426 (Bison Symbols): Add entry for %symbol-default.
1427 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
1428 (generic_symlist, generic_symlist_item): New nonterminals for creating
1429 a list in which each item is a symbol, semantic type, or
1430 %symbol-default.
1431 (grammar_declaration): Use generic_symlist in %destructor and %printer
1432 declarations instead of symbols.1 or an empty list.
1433 (symbol_declaration, precedence_declaration, symbols.1): Update actions
1434 for changes to symbol_list.
1435 * src/reader.c: Update for changes to symbol_list.
1436 * src/scan-code.l: Likewise.
1437 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
1438 * src/symlist.c, src/symlist.h: Extend such that a list node may
1439 represent a semantic type or a %symbol-default in addition to just an
1440 ordinary symbol. Add switched functions for setting %destructor's and
1441 %printer's.
1442 * tests/actions.at, tests/input.at: Add %symbol-default to all default
1443 %destructor/%printer declarations.
1444
3508ce36
JD
14452006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
1446
1447 Whether the default %destructor/%printer applies to a particular symbol
1448 isn't a question of whether the user *declares* that symbol (in %token,
1449 for example). It's a question of whether the user by any means
1450 *defines* the symbol at all (by simply using a char token, for
1451 example). $end is defined by Bison whereas any other token with token
1452 number 0 is defined by the user. The error token is always defined by
1453 Bison regardless of whether the user declares it with %token, but we
1454 may one day let the user define error as a nonterminal instead.
1455 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
1456 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
1457 the meaning of "user-defined".
1458 * tests/actions.at (Default %printer and %destructor for user-declared
1459 end token): Rename to...
1460 (Default %printer and %destructor for user-defined end token): ...
1461 this.
1462
1463 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
1464 computation of whether to apply the default, don't maintain a list of
1465 every Bison-defined symbol. Instead, just check for a first character
1466 of '$', which a user symbol cannot have, and check for the error token.
1467
9350499c
JD
14682006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
1469
1470 Don't apply the default %destructor or %printer to the error token,
1471 $undefined, or $accept. This change fits the general rule that the
1472 default %destructor and %printer are only for user-declared symbols,
1473 and it solves several difficulties that are described in the new test
1474 cases listed below.
1475 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
1476 * tests/actions.at (Default %printer and %destructor are not for error
1477 or $undefined, Default %printer and %destructor are not for $accept):
1478 New test cases.
1479
4d7370cb
JD
14802006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
1481
1482 Allow %start after the first rule.
1483 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
1484 when parsing the first rule.
1485 (check_and_convert_grammar): Search for it here after all grammar
1486 declarations have been parsed. Skip midrules, which have dummy LHS
1487 nonterminals.
1488 * src/symtab.c (symbol_is_dummy): New function.
1489 * src/symtab.h (symbol_is_dummy): Declare it.
1490 * tests/input.at (%start after first rule): New test.
1491
6d0ef4ec
JD
14922006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
1493
1494 Redo some of the previous commit: add back the ability to use
1495 non-aliased/undeclared string literals since it might be useful to
1496 those declaring %token-table.
1497 * src/reader.c (check_and_convert_grammar): Undo changes in previous
1498 commit: don't worry about complaints from symbols_pack.
1499 * src/symtab.c (symbol_new, symbol_class_set,
1500 symbol_check_alias_consistency): Undo changes in previous commit: count
1501 each string literal as a new symbol and token, assign it a symbol
1502 number, and don't complain about non-aliased string literals.
1503 (symbols_pack): Since symbol_make_alias still does not decrement symbol
1504 and token counts but does still set aliased tokens to the same number,
1505 symbol_pack_processor now leaves empty slots in the symbols array.
1506 Remove those slots.
1507 * tests/regression.at (Undeclared string literal): Remove test case
1508 added in previous commit since non-aliased string literals are allowed
1509 again.
1510 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
1511 remove unnecessary string literal declarations.
1512 * tests/sets.at (Firsts): Likewise.
1513
965537bc
JD
15142006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
1515
1516 Don't allow an undeclared string literal, but allow a string literal to
1517 be used before its declaration.
1518 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
1519 symbols_pack complained.
1520 * src/symtab.c (symbol_new): Don't count a string literal as a new
1521 symbol.
1522 (symbol_class_set): Don't count a string literal as a new token, and
1523 don't assign it a symbol number since symbol_make_alias does that.
1524 (symbol_make_alias): It's not necessary to decrement the symbol and
1525 token counts anymore. Don't assume that an alias declaration occurs
1526 before any uses of the identifier or string, and thus don't assert that
1527 one of them has the highest symbol number so far.
1528 (symbol_check_alias_consistency): Complain if there's a string literal
1529 that wasn't declared as an alias.
1530 (symbols_pack): Bail if symbol_check_alias_consistency failed since
1531 symbol_pack asserts that every token has been assigned a symbol number
1532 although undeclared string literals have not.
1533 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 1534 string literal): New test cases.
965537bc
JD
1535 (Characters Escapes, Web2c Actions): Declare string literals as
1536 aliases.
1537 * tests/sets.at (Firsts): Likewise.
1538
47aee066
JD
15392006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
1540
1541 In the grammar scanner, STRING_FINISH unclosed constructs and return
1542 them to the parser in order to improve error messages.
1543 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
1544 SC_BRACED_CODE, SC_PROLOGUE): Implement.
1545 * tests/input.at (Unclosed constructs): New test case.
1546 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
1547 seen.
1548
1549 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
1550 unused global.
1551
1f6b3679
JD
15522006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
1553
1554 Handle string aliases for character tokens correctly.
1555 * src/symtab.c (symbol_user_token_number_set): If the token has an
1556 alias, check and set its alias's user token number instead of its own,
1557 which is set to indicate the alias. Previously, every occurrence of
1558 the character token in the grammar overwrote that alias indicator with
1559 the character code.
1560 * tests/input.at (String aliases for character tokens): New test.
1561
219741d8
JD
15622006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
1563
1564 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
1565
11daa4e7
PE
15662006-08-11 Paul Eggert <eggert@cs.ucla.edu>
1567
1568 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
1569 to prevent failures when building on older platforms.
1570 Check for autopoint failure.
1571 Set XGETTEXT_OPTIONS to values that check for C format strings,
1572 so that translators are warned about them (this also helps
1573 prevent core dumps).
1574
1575 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
1576 function, since it simplifies our code a bit.
1577
1578 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
1579 rather than -W, so we don't get bogus warnings about sign comparisons.
1580 Add -Wpointer-arith, since that warning is useful (it reports code
1581 that does not conform to C89 and that some compilers reject).
1582 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
1583 since it's no longer needed.
1584
f9bfc42a
JD
15852006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
1586
1587 Clean up scanners a bit.
1588 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
1589 definitions so gcc won't warn when obstack_for_string is unused.
1590 * src/scan-code.l: config.h and system.h are already #include'd by
1591 scan-code-c.c, so get rid of them here.
1592 * src/scan-gram.l: Likewise.
1593 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
1594 definitions rather than duplicating the rest of it.
1595 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
1596
06e8700a
JD
15972006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
1598
1599 Suppress signed/unsigned comparison warnings for yycheck.
1600 * data/c.m4 (b4_safest_int_type): New macro.
1601 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
1602 a signed int type, cast it to b4_safest_int_type first.
1603 * data/yacc.c: Likewise.
1604 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
1605 also overwritten.
1606
9c437126
PE
16072006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
1608
1609 * doc/bison.texinfo: Fix some typos.
1610
284d8a13
PE
16112006-08-02 Paul Eggert <eggert@cs.ucla.edu>
1612
1613 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
1614 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
1615
1616 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
1617 the latest gnulib does this a different way.
1618 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
1619 translation was patched, so stop omitting it.
1620
ec5479ce
JD
16212006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1622
1623 Enable declaration of default %printer/%destructor. Make the parser
1624 use these for all user-declared grammar symbols for which the user does
1625 not declare a specific %printer/%destructor. Thus, the parser uses it
1626 for token 0 if the user declares it but not if Bison generates it as
1627 $end. Discussed starting at
1628 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
1629 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
1630 and
1631 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
1632 * NEWS (2.3+): Mention.
1633 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
1634 declare a %destructor for a mid-rule's semantic value. It's just
1635 impossible to declare one specific to it.
1636 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
1637 code. Describe default %destructor form.
1638 * src/parse-gram.y (grammar_declaration): Parse default
1639 %printer/%destructor declarations.
1640 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
1641 and symbol_destructor_location_get rather than accessing the destructor
1642 and destructor_location members of struct symbol.
1643 (symbol_printers_output): Likewise but for %printer's.
1644 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
1645 again.
1646 * src/symtab.c (default_destructor, default_destructor_location,
1647 default_printer, default_printer_location): New static global
1648 variables to record the default %destructor and %printer.
1649 (symbol_destructor_get, symbol_destructor_location_get,
1650 symbol_printer_get, symbol_printer_location_get): New functions to
1651 compute the appropriate %destructor and %printer for a symbol.
1652 (default_destructor_set, default_printer_set): New functions to set the
1653 default %destructor and %printer.
1654 * src/symtab.h: Prototype all those new functions.
1655 * tests/actions.at (Default %printer and %destructor): New test to
1656 check that the right %printer and %destructor are called, that they're
1657 not called for $end, and that $$ and @$ work correctly.
1658 (Default %printer and %destructor for user-declared end token): New
1659 test to check that the default %printer and %destructor are called for
1660 a user-declared end token.
1661 * tests/input.at (Default %printer and %destructor redeclared, Unused
1662 values with default %destructor): New tests to check related grammar
1663 warnings and errors.
1664
868d2d96
JD
16652006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1666
1667 Clean up handling of %destructor for the end token (token 0).
1668 Discussed starting at
1669 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
1670 and
1671 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
1672
1673 Make the skeletons consistent in how they pop the end token and invoke
1674 its %destructor.
1675 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
1676 state, which has token number 0, since this would invoke the
1677 %destructor for the end token.
1678 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
1679 until after shifting the end token, or else it won't be popped.
1680 * data/yacc.c (yyparse): Likewise.
1681
1682 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
1683 it's the end token. Upon termination, destroy an unshifted lookahead
1684 even when it's the end token.
1685 * data/lalr1.cc (yy::parser::parse): Likewise.
1686 * data/yacc.c (yyparse): Likewise.
1687
1688 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
1689 value warnings for the end token when the user gives the end token a
1690 %destructor.
1691
1692 * tests/actions.at (Printers and Destructors): Test all the above.
1693
62a9592d
PE
16942006-07-24 Paul Eggert <eggert@cs.ucla.edu>
1695
1696 Update to latest gnulib and gettext versions.
1697 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
1698 Add fopen-safer.
1699 (gnulib_files): Add m4/warning.m4. Don't worry about files
1700 overwritten by autopoint.
1701 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
1702 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
1703 rejects them.
1704 Don't use autoreconf; instead, invoke autopoint etc. by hand,
1705 so that we can remove the intl files at a better time.
1706 (intl_files_to_remove): Remove aclocal.m4, since it gets
1707 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
1708 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
1709 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
1710 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
1711 Remove datarootdir hack; no longer needed.
1712 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
1713 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
1714 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
1715 strdup.h.
1716 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
1717 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
1718
10d6970f
PE
17192006-07-20 Paul Eggert <eggert@cs.ucla.edu>
1720
1721 * bootstrap: Adjust to today's change to gnulib-tool by invoking
1722 it with --assume-autoconf='latest-stable'.
1723
50a33993
JD
17242006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
1725
1726 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
1727 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
1728 YYSTYPE' and `{'.
1729 * src/muscle_tab.h (muscle_grow): Replace the header comments with
1730 those from muscle_tab.c since the old ones are misleading.
1731
2ce4ed68
AD
17322006-07-13 Akim Demaille <akim@epita.fr>
1733
1734 Support %define "KEY" {VALUE}.
1735 * src/scan-code.h, src/scan-code.l (translate_action)
1736 (translate_rule_action, translate_symbol_action, translate_code):
1737 Return char *, not const char *.
1738 * src/parse-gram.y (declaration): Rename as...
1739 (prologue_declaration): this.
1740 (string_content): Remove this nonterminal, use STRING.
1741 (braceless, content, content.opt): New nonterminal.
1742 Use them.
1743 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
1744 as value.
1745 * src/scan-gram.l (getargs.h): Don't include it.
1746
db7e5eb5
PE
17472006-07-12 Paul Eggert <eggert@cs.ucla.edu>
1748
1749 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
1750 rather than a for-loop that declares a local bool variable. This
1751 should work around a compatibility problem with a Cray x1e C++
1752 compiler reported by Hung Nguyen in
1753 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
1754 The for-loop was introduced in the 2004-11-17 change but I don't
1755 know why it was needed.
1756
a5d80ba5
AD
17572006-07-12 Akim Demaille <akim@epita.fr>
1758
1759 * data/c.m4: Comment changes.
1760
23eb2a69
AD
17612006-07-10 Akim Demaille <akim@lrde.epita.fr>
1762
1763 * src/complain.c (error_message, ERROR_MESSAGE): New.
1764 To factor...
1765 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
1766 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
1767
ddc8ede1
PE
17682006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1769
1770 * NEWS: Instead of %union, you can define and use your own union type
1771 YYSTYPE if your grammar contains at least one <type> tag.
1772 Your YYSTYPE need not be a macro; it can be a typedef.
1773 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
1774 (Union Decl, Decl Summary): Document this.
1775 * data/glr.c (YYSTYPE): Implement this.
1776 * data/glr.cc (YYSTYPE): Likewise.
1777 * data/lalr1.cc (YYSTYPE): Likewise.
1778 * data/yacc.c (YYSTYPE): Likewise.
1779 * src/output.c (prepare): Output tag_seen_flag.
1780 * src/parse-gram.y (declaration, grammar_declaration):
1781 Use 'union_seen' rather than 'typed' to determine whether
1782 %union has been seen, since grammars can now be typed without
1783 %union.
1784 (symbol_declaration, type.opt, symbol_def):
1785 Keep track of whether a tag has been seen.
1786 * src/reader.c (union_seen, tag_seen): New vars.
1787 (typed): remove.
1788 * src/reader.h (union_seen, tag_seen, typed): Likewise.
1789 * src/scan-code.l (untyped_var_seen): New variable.
1790 (handle_action_dollar): Adjust to above changes.
1791 (handle_action_dollar, handle_action_at):
1792 Improve overflow checking for outlandish numbers.
1793 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
1794 avoid new diagnostics generated by above changes.
1795 * tests/regression.at (YYSTYPE typedef): Add test to check
1796 for type tags without %union.
1797
1798 * src/symlist.c (symbol_list_length): Return int, not unsigned
1799 int, since callers expect int. This may need to get revisited
1800 once we have proper integer overflow checking.
1801
1802 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
1803 object is now static.
1804
1805 * src/getargs.c (flags_argmatch): Return void, not int,
1806 to pacify ./configure --enable-gcc-warnings.
1807
1808 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
1809 since last_string is already defined to FLEX_PREFIX (last_string).
1810
7b42569e
AD
18112006-07-09 Akim Demaille <akim@lrde.epita.fr>
1812
1813 Implement --warnings/-W.
1814 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
1815 replaced by...
1816 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
1817 Adjust callers.
1818 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
1819 (warnings_args, warnings_types): New.
1820 (getargs, short_options, long_options): Accept -W/--warnings.
1821 Sort the options by alphabetical order, upper case letter right
1822 before its lower case.
1823
3b452f4e
JD
18242006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1825
1826 Change %merge result type clash warnings to errors. Discussed at
1827 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
1828 * src/reader.c (record_merge_function_type): Use complain_at.
1829 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1830 declared later): Update test case results.
1831
b8a41559
AD
18322006-07-09 Akim Demaille <akim@lrde.epita.fr>
1833
1834 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
1835 to be in alphabetical order.
1836 (trace_args): Spelling fixes.
1837
cd9e1ba2
PE
18382006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1839
1840 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
1841 so they don't collide with user-defined macros.
1842 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
1843 this was never guaranteed, and now that we're using gnulib stdint,
1844 which defines int_fast16_t to long int, the problem is exposed.
1845
cb48f191
PE
18462006-07-08 Paul Eggert <eggert@cs.ucla.edu>
1847
b8445a15
PE
1848 * data/c.m4 (b4_basename): Simplify a bit, since we don't
1849 need the full POSIX semantics (and weren't implementing them
1850 anyway).
1851
cb48f191
PE
1852 Adjust to Autoconf 2.60 and today's gnulib.
1853 * bootstrap (gnulib_modules): Add stdint.
1854 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
1855 no longer copies it.
1856 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
1857 since stdint needs the former and wcwidth (which is now required
1858 by mbswidth) needs the latter.
1859 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
1860 work around a compatibility glitch between gettext 0.14.6 and
1861 Autoconf 2.60.
1862 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
1863 Do not check for uintptr_t, since new stdint module does the right
1864 thing.
1865 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
1866 Add stdint.h, stdint_.h, wcwidth.h.
1867 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
1868 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
1869 stdint.m4, wchar_t.m4, wcwidth.m4.
1870 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
1871 usual order for ../lib/*.h files.
1872 (file_name_split): Use last_component, not base_name, to adjust
1873 to gnulib changes.
1874 * src/parse-gram.h: Include <strverscmp.h> in the usual order
1875 for ../lib/*.h files.
1876 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
1877 Define unconditionally, since we now assume the stdint module.
1878 * src/scan-skel.l: Include <dirname.h>.
1879 (BASE_QPUTS): Use last_component, not base_name.
1880 * src/system.h: Include <unlocked-io.h> in the usual order
1881 for ../lib/*.h files. Include <stdint.h> unconditionally,
1882 since we now use the stdint module.
1883 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
1884 HAVE_UINTPTR_T, since we now use the stdint module.
1885 (base_name): Remove decl, since files now include <dirname.h>
1886 to get the decl.
1887
cd48d21d
AD
18882006-07-08 Akim Demaille <akim@lrde.epita.fr>
1889
1890 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
1891 New, default to 1.
1892 * data/yacc.c, data/glr.c, data/location.cc: Use them.
1893 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
1894 default.
1895 * tests/calc.at: Adjust.
1896
8ec0a172
AD
18972006-07-08 Akim Demaille <akim@lrde.epita.fr>
1898
b8445a15 1899 * data/c.m4 (b4_basename): New.
8ec0a172
AD
1900 (b4_syncline): Also output the location of its invocation (from
1901 the skeleton).
1902 (b4_user_action, b4_define_user_action, b4_user_actions)
1903 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
1904 (b4_user_stype): New.
1905 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
1906
4a678af8
JD
19072006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1908
1909 In the grammar file, the first column is 1 not 0 on the first line as
1910 on every other line.
1911 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
1912 * tests/input.at (Torturing the Scanner): Update output.
1913
1914 * src/scan-gram.l (scanner_cursor): Declare it static.
1915
dd60572a
JD
19162006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1917
1918 In warnings, say "previous declaration" rather than "first
1919 declaration".
1920 * src/symtab.c (redeclaration): Do that here.
1921 * src/reader.c (record_merge_function_type): In the case of a result
1922 type clash, report the previous declaration rather than the very first
1923 one in the grammar file.
1924 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1925 declared later): Add a third declaration to check this behavior.
1926 * tests/input.at (Incompatible Aliases): Update output.
1927
2073e1b6
AD
19282006-06-27 Akim Demaille <akim@epita.fr>
1929
1930 * doc/Doxyfile.in: New.
1931 * doc/Makefile.am: Use it.
1932 * src/lalr.h, src/symtab.h: Initial doxygenation.
1933
8ee5b538
JD
19342006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1935
1936 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
1937 declared after the %merge. This continues the effort of the previous
1938 patch.
8ee5b538
JD
1939 * src/reader.c (get_merge_function): Don't set the merger type yet.
1940 (record_merge_function_type): New function for setting the merger type
1941 and checking for clashes.
1942 (grammar_current_rule_merge_set): Set the location of the %merge for
1943 the current rule.
1944 (packgram): Invoke record_merge_function_type for each rule now that
1945 all symbol type declarations have been parsed.
1946 * src/reader.h (merger_list.type_declaration_location): New member
1947 storing the location of the first %merge from which the type for this
1948 merging function was derived.
1949 * src/symlist.h (symbol_list.merger_declaration_location): New member
1950 storing the location of a rule's %merge, if any.
1951 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1952 declared later): New test to catch the error fixed by the above patch.
1953
ffa4ba3a
JD
19542006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1955
1956 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
1957 declarations appear after the rules. Discussed at
1958 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
1959 and
1960 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
1961 Don't mistake the type of $$ in a midrule to be that of its parent
1962 rule's $$.
ffa4ba3a
JD
1963 * src/reader.c (grammar_current_rule_end): Don't invoke
1964 grammar_rule_check yet since not all symbol declarations may have been
1965 parsed yet.
1966 (grammar_midrule_action): Likewise.
1967 Don't record whether the midrule's $$ has been used yet since actions
1968 haven't been translated yet.
1969 Record the midrule's parent rule and its RHS index within the parent
1970 rule.
1971 (grammar_current_rule_action_append): Don't translate the action yet
1972 since not all symbol declarations may have been parsed yet and, thus,
1973 warnings about types for $$, $n, @$, and @n can't be reported yet.
1974 (packgram): Translate the action and invoke grammar_rule_check now that
1975 all symbol declarations have been parsed.
1976 * src/scan-code.l (handle_action_dollar): Now that this is invoked
1977 after parsing the entire grammar file, the symbol list here in the case
1978 of a midrule is actually the midrule's empty RHS, so reference its
1979 parent rule's RHS where necessary.
1980 On the other hand, now that you can already know it's a midrule, you
1981 aren't forced to think $$ has the same type as its parent rule's $$.
1982 (handle_action_at): In the case of a midrule, reference the parent rule
1983 where necessary.
1984 * src/symlist.c (symbol_list_new): Initialize new midrule-related
1985 members.
1986 (symbol_list_length): Now that this is invoked after all rules have
1987 been parsed, a NULL symbol (rather than a NULL symbol list node)
1988 terminates a rule. symbol_list_print already does this correctly.
1989 * src/symlist.h (symbol_list.midrule_parent_rule,
1990 symbol_list.midrule_parent_rhs_index): New members so that midrules can
1991 remember their relationships with their parents.
1992 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
1993 fixed by the above patch.
1994 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
1995 implementing...
1996 (Unused values): ... this old test case and...
1997 (Unused values before symbol declarations): ... this new test case.
1998 This one is the same as `Unused values' except that all symbol
1999 declarations appear after the rules in order to catch the rest of the
2000 errors fixed by the above patch.
2001
e256e17f
JD
20022006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
2003
300a1930
JD
2004 More cleanup.
2005 * src/reader.c (current_rule): Declare it static since it's no longer
2006 used outside this file.
2007 (grammar_current_rule_action_append): Remove redundant arguments from
2008 translate_rule_action invocation.
2009 * src/reader.h (current_rule): Remove this unused extern.
2010 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
2011 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 2012
381ecb06
JD
20132006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
2014
2015 Clean up yesterday's patch.
2016 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
2017 to...
2018 * src/reader.c (grammar_current_rule_action_append): ... here for
2019 consistency with grammar_current_rule_symbol_append.
2020 * tests/regression.at (Braced code in declaration in rules section):
2021 Make yyerror and yylex static as usual.
2022
4210cd0b
JD
20232006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
2024
2025 Fix bug that mistakes braced code in a declaration in the rules section
2026 to be a rule action. Mentioned at
2027 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
2028 * src/scan-gram.l: Move midrule action detection from the start of the
2029 scanning of any braced code to...
2030 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
2031 action. For readability, use $2 and @2 rather than the equivalent
2032 global variables.
2033 * tests/regression.at (Braced code in declaration in rules section):
2034 New test to catch the error fixed by the above patch.
2035
2036 Work on code readability some.
2037 * src/scan-code.l (current_rule): Get rid of this misleading and
2038 redundant declaration: it's actually extern'ed in reader.h.
2039 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
2040 translate_action): Add a rule argument and use it instead of the global
2041 current_rule.
2042 (translate_rule_action): This already receives current_rule through an
2043 argument, so pass it on to translate_action instead of assigning
2044 current_rule to current_rule.
2045 (translate_symbol_action, translate_code): Pass rule = NULL to
2046 translate_action.
2047
34f98f46
JD
20482006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
2049
2050 Rename %before-definitions to %start-header and %after-definitions to
2051 %end-header. Don't use these declarations to separate pre-prologue
2052 blocks from post-prologue blocks. Add new order-independent
2053 declarations %before-header and %after-header as alternatives to the
2054 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
2055 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
2056 * NEWS (2.3+): Update for these changes.
2057 * data/glr.c (b4_before_definitions): Update to...
2058 (b4_start_header): ... this.
2059 (b4_after_definitions): Update to...
2060 (b4_end_header): ... this.
2061 * data/glr.cc: Likewise.
2062 * data/lalr1.cc: Likewise.
2063 * data/yacc.c: Likewise.
2064 * doc/bison.texinfo (The prologue): Update names, and replace remaining
2065 prologue blocks with %*-header declarations.
2066 (Calc++ Parser): Likewise.
2067 (Bison Declaration Summary): Update names.
2068 (Bison Symbols): Update description.
2069 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
2070 (PERCENT_END_HEADER): ... this.
2071 (PERCENT_BEFORE_DEFINITIONS): Update to...
2072 (PERCENT_START_HEADER): ... this.
2073 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
2074 (declaration): Update token names and m4 macro names.
2075 When parsing %end-header and %start-header, invoke translate_code
2076 before muscle_code_grow, and no longer set global booleans to remember
2077 whether these declarations have been seen.
2078 Parse new %after-header and %before-header.
2079 * src/reader.c (before_definitions, after_definitions): Remove.
2080 (prologue_augment): Accept a new bool argument to specify whether to
2081 augment the pre-prologue or post-prologue.
2082 * src/reader.h (before_definitions, after_definitions): Remove these
2083 extern's.
2084 (prologue_augment): Add new bool argument.
2085 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
2086 (PERCENT_END_HEADER): ... this.
2087 (PERCENT_BEFORE_DEFINITIONS): Update to...
2088 (PERCENT_START_HEADER): ... this.
2089 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
2090 * tests/actions.at (Printers and Destructors): Update names.
2091
31b2b07e
JD
20922006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
2093
2094 Add comparison operators for C++ location classes. Discussed at
2095 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
2096 * data/c++.m4 (b4_define_location_comparison): New boolean %define
2097 declaration indicating whether filename_type has an operator==. If
2098 filename_type is `std::string', it defaults to `1', `0' otherwise.
2099 * data/location.cc: Iff b4_define_location_comparison is `1', add
2100 operator== and operator!= for class position and for class location.
2101
2102 Some minor fixes.
2103 * src/scan-action.l: Remove unused file.
2104 * src/symtab.c (symbol_printer_set): Use printer_location not
2105 destructor_location.
2106 * src/symtab.h (struct symbol): Replace incorrect source comment for
2107 printer members.
2108 * tests/input.at (Incompatible Aliases): Update output with correct
2109 printer location.
2110
9bc0dd67
JD
21112006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
2112
2113 Don't put the pre-prologue in the header file. For the yacc.c code
2114 file and the glr.c header and code files, move the pre-prologue before
2115 the token definitions. Add new %before-definitions and
2116 %after-definitions to declare code that will go in both the header file
2117 and code file. Discussed at
2118 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
2119 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
2120 and
2121 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
2122 * NEWS (2.3+): Describe these changes.
2123 * data/glr.c (b4_pre_prologue): Move from within to before...
2124 (b4_shared_declarations): ... this.
2125 Add new b4_before_definitions before b4_token_enums.
2126 Add new b4_after_definitions at the end.
2127 * data/glr.cc (b4_pre_prologue): Replace with...
2128 (b4_before_definitions): ... this in the header file.
2129 (b4_after_definitions): New near the end of the header file.
2130 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
2131 code file right before including the header file.
2132 (b4_before_definitions): New in the previous position of
2133 b4_pre_prologue in the header file.
2134 (b4_after_definitions): New near the end of the header file.
2135 * data/yacc.c: Clean up some m4 quoting especially in the header file.
2136 (b4_token_enums_defines): In the code file, move to right before
2137 YYSTYPE for consistency with the header file.
2138 (b4_before_definitions): New right before b4_token_enums_defines in
2139 both the header and code file.
2140 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
2141 header and code file.
2142 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
2143 of prologues for %union dependencies.
2144 (Bison Declaration Summary): In %defines description, mention the
2145 effect of %before-definitions and %after-definitions on the header
2146 file.
2147 (Calc++ Parser): Forward declare driver in a %before-definitions rather
2148 than in the pre-prologue so that make check succeeds.
2149 (Bison Symbols): Add entries for %before-definitions and
2150 %after-definitions.
2151 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
2152 %before-definitions.
2153 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
2154 (declaration): Parse those declarations and append to
2155 b4_before_definitions and b4_after_definitions, respectively.
2156 * src/reader.c (before_definitions, after_definitions): New bools to
2157 track whether those declarations have been seen.
2158 (prologue_augment): Add to the post-prologue if %union,
2159 %before-definitions, or %after-definitions has been seen.
2160 * src/reader.h (before_definitions, after_definitions): New extern's.
2161 * src/scan-gram.l: Scan the new declarations.
2162 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
2163 prologue block in a %before-definitions or a %after-definitions based
2164 on whether the %union is declared.
2165 * tests/regression.at (Early token definitions with --yacc, Early token
2166 definitions without --yacc): Move tests for token definitions into the
2167 post-prologue since token names are no longer defined in the
2168 pre-prologue.
2169
203b9274
AD
21702006-06-20 Akim Demaille <akim@epita.fr>
2171
2172 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
2173 (symbol_get): Use it.
2174 * src/parse-gram.y: Use it.
2175
a7ee59cf
JD
21762006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
2177
2178 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
2179 build succeeds when configured with --enable-gcc-warnings.
2180
5a2baae7
PE
21812006-06-19 Paul Eggert <eggert@cs.ucla.edu>
2182
33ad1a9c
PE
2183 * src/parse-gram.y (char_name): New function.
2184 (CHAR, STRING, string_content): For %printer, properly escape.
2185 (ID): Prefer fputs to fprintf.
2186 (id): Reindent to be consistent with other rules.
2187 Properly quote char.
2188
5a2baae7
PE
2189 The Translation Project changed its way of publishing translations
2190 to maintainers. I haven't received any responses to my request
2191 for supporting the old way, or for documenting the new way. I
2192 have modified 'bootstrap' to use screen scraping
2193 (in this case, HTML scraping). This is unreliable and inelegant,
2194 but I don't see any better way. Yuck.
2195 * bootstrap (TP_URL, WGET_COMMAND): New vars.
2196 (get_translations): New function, which uses HTML scraping to
2197 deduce locations of latest translations.
2198 Use this function to grab both bison and bison-runtime .po files.
2199 Don't bother priming the pump for the runtime-po domain any more,
2200 as it's now translated better than bison is.
2201
58d7a1a1
AD
22022006-06-19 Akim Demaille <akim@epita.fr>
2203
2204 * src/scan-gram.l: No longer "parse" things after `%union' until
2205 `{'. Rather, return a single "%union" token.
2206 No longer make symbols: return strings, and leave the conversion
2207 to symbols to the parser.
2208 (SC_PRE_CODE, token_type): Remove.
2209 * src/parse-gram.y (%union): New field `character'.
2210 Sort tokens.
2211 (CHAR): New token.
2212 (ID, ID_COLON): Now that the scanner no longer makes them
2213 identifiers, adjust all uses to invoke symbol_get.
2214 (id_colon): New, wraps the conversion from string to symbol.
2215 (%union): Accept a possible union_name.
2216 (symbol): Now can be a char.
2217 * data/c.m4 (b4_union_name): Leave a default value.
2218 * data/glr.c, data/yacc.c: Use it.
2219
b931235e
JD
22202006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
2221
2222 For associating token numbers with token names for "yacc.c", don't use
2223 #define statements unless `--yacc' is specified; always use enum
2224 yytokentype. Most important discussions start at:
2225 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
2226 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
2227 and
2228 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
2229 * NEWS (2.3+): Mention.
2230 * data/c.m4 (b4_yacc_if): New.
2231 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
2232 token #define's.
2233 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
2234 on token name definitions.
2235 * src/getargs.c (usage): Capitalize `Yacc' in English.
2236 * src/output.c (prepare): Define b4_yacc_flag.
2237 * tests/regression.at (Early token definitions): Test that tokens names
2238 are defined before the pre-prologue not just before the post-prologue.
2239 Remove this test case and copy to...
2240 (Early token definitions with --yacc): ... this to test #define's.
2241 (Early token definitions without --yacc): ... and this to test enums.
2242
9e6e7ed2
PE
22432006-06-11 Paul Eggert <eggert@cs.ucla.edu>
2244
2245 * NEWS: Reword the post-2.3 change to not be so optimistic about
2246 removing the old "look-ahead" spelling.
2247 Update previous look-ahead/lookahead change reports.
2248 * REFERENCES: look-ahead -> lookahead (since that's
2249 what he actually wrote).
2250 * doc/refcard.tex: look ahead -> lookahead,
2251 look-ahead -> lookahead
2252
742e4900
JD
22532006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
2254
2255 For consistency, use `lookahead' instead of `look-ahead' or
2256 `look_ahead'. Discussed starting at
2257 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
2258 and then at
2259 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
2260 * NEWS: For the next release, note the change to `--report'.
2261 * TODO, doc/bison.1: Update English.
2262 * doc/bison.texinfo: Update English.
2263 (Understanding Your Parser, Bison Options): Document as
2264 `--report=lookahead' rather than `--report=look-ahead'.
2265 * src/conflicts.c: Update English in comments.
2266 (lookahead_set): Rename from look_ahead_set.
2267 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
2268 (resolve_sr_conflict): Rename local look_ahead_tokens to
2269 lookahead_tokens, and update other uses.
2270 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
2271 count_rr_conflicts, conflicts_free): Update uses.
2272 * src/getargs.c (report_args): Move "lookahead" before alternate
2273 spellings.
2274 (report_types): Update uses.
2275 (usage): For `--report' usage description, state `lookahead' spelling
2276 rather than `look-ahead'.
2277 * src/getargs.h (report.report_lookahead_tokens): Rename from
2278 report_look_ahead_tokens.
2279 * src/lalr.c: Update English in comments.
2280 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
2281 (state_lookahead_tokens_count): Rename from
2282 state_look_ahead_tokens_count.
2283 Rename local n_look_ahead_tokens to n_lookahead_tokens.
2284 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
2285 Rename local n_look_ahead_tokens to n_lookahead_tokens.
2286 Update other uses.
2287 Update English in output.
2288 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
2289 * src/print.c: Update English in comments.
2290 (lookahead_set): Rename from look_ahead_set.
2291 (print_reduction): Rename argument lookahead_token from
2292 look_ahead_token.
2293 (print_core, state_default_rule, print_reductions, print_results):
2294 Update uses.
2295 * src/print_graph.c: Update English in comments.
2296 (print_core): Update uses.
2297 * src/state.c: Update English in comments.
2298 (reductions_new): Update uses.
2299 (state_rule_lookahead_tokens_print): Rename from
2300 state_rule_look_ahead_tokens_print, and update other uses.
2301 * src/state.h: Update English in comments.
2302 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
2303 (state_rule_lookahead_tokens_print): Rename from
2304 state_rule_look_ahead_tokens_print.
2305 * src/tables.c: Update English in comments.
2306 (conflict_row, action_row): Update uses.
2307 * tests/glr-regression.at
2308 (Incorrect lookahead during deterministic GLR,
2309 Incorrect lookahead during nondeterministic GLR): Rename
2310 print_look_ahead to print_lookahead.
2311 * tests/torture.at: Update English in comments.
2312 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
2313 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
2314 (Many lookahead tokens): Update uses.
2315 * data/glr.c: Update English in comments.
2316 * lalr1.cc: Likewise.
2317 * yacc.c: Likewise.
2318 * src/conflicts.h: Likewise.
2319 * src/lalr.h: Likewise.
2320 * src/main.c: Likewise.
2321 * src/output.c: Likewise.
2322 * src/parse-gram.c: Likewise.
2323 * src/tables.h: Likewise.
2324 * tests/calc.at: Likewise.
2325
3c40d0b5
JD
23262006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
2327
2328 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
2329
5d278082
PE
23302006-06-07 Paul Eggert <eggert@cs.ucla.edu>
2331
2332 * TODO: Add request from Nelson H. F. Beebe to be able to install
2333 Bison without installing the yacc script.
2334
9e668899
JD
23352006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
2336
2337 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
2338 and yytext if they're already #define'd.
2339 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
2340 * src/scan-code-c.c: ... here.
2341 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
2342 <config.h>.
2343
0c8e079f
JD
23442006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
2345
2346 Get Bison to build again when configured with --enable-gcc-warnings.
2347 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
2348 missing #include's.
2349 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
2350 loc argument as it shadows a global.
2351 * src/scan-gram.l: Remove stray comma that prevents boundary_set
2352 invocation.
2353
2354 * src/.cvsignore: Add scan-code.c.
2355
2346344a
AD
23562006-06-07 Akim Demaille <akim@epita.fr>
2357
2358 * src/scan-gram.l: Move the "add a trailing ; to actions" code
2359 to...
2360 * src/scan-code.l: here.
2361 * tests/input.at (Torturing the Scanner): Fix another location
2362 error.
2363
4862bdfd
AD
23642006-06-07 Akim Demaille <akim@epita.fr>
2365
2366 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
2367
e9071366
AD
23682006-06-06 Akim Demaille <akim@epita.fr>
2369
2370 Extract the parsing of user actions from the grammar scanner.
2371 As a consequence, the relation between the grammar scanner and
2372 parser is much simpler. We can also split "composite tokens" back
2373 into simple tokens.
2374 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
2375 * src/scan-gram.l (add_column_width, adjust_location): Move to and
2376 rename as...
2377 * src/location.h, src/location.c (add_column_width)
2378 (location_compute): these.
2379 Fix the column count: the initial column is 0.
2380 (location_print): Be robust to ending column being 0.
2381 * src/location.h (boundary_set): New.
2382 * src/main.c: Adjust to scanner_free being renamed as
2383 gram_scanner_free.
2384 * src/output.c: Include scan-code.h.
2385 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
2386 Use boundary_set.
2387 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
2388 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
2389 which is now, again, a separate token.
2390 Adjust all dependencies.
2391 Whereever actions with $ and @ are used, use translate_code.
2392 (action): Remove this nonterminal which is now useless.
2393 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
2394 (grammar_current_rule_action_append): Use translate_code.
2395 (packgram): Bound check ruleno, itemno, and rule_length.
2396 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
2397 (last_string, last_braced_code_loc, max_left_semantic_context)
2398 (scanner_initialize, scanner_free, scanner_last_string_free)
2399 (gram_out, gram_lineno, YY_DECL_): Move to...
2400 * src/scan-gram.h: this new file.
2401 (YY_DECL): Rename as...
2402 (GRAM_DECL): this.
2403 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
2404 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
2405 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
2406 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
2407 Move these declarations, and...
2408 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
2409 these to...
2410 * src/flex-scanner.h: this new file.
2411 * src/scan-gram.l (rule_length, rule_length_overflow)
2412 (increment_rule_length): Remove.
2413 (last_braced_code_loc): Rename as...
2414 (gram_last_braced_code_loc): this.
2415 Adjust to the changes of the parser.
2416 Move all the handling of $ and @ into...
2417 * src/scan-code.l: here.
2418 * src/scan-gram.l (handle_dollar, handle_at): Remove.
2419 (handle_action_dollar, handle_action_at): Move to...
2420 * src/scan-code.l: here.
2421 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
2422 scan-code.h, scan-code-c.c, scan-gram.h.
2423 (EXTRA_bison_SOURCES): Add scan-code.l.
2424 (BUILT_SOURCES): Add scan-code.c.
2425 (yacc): Be robust to white spaces.
2426
2427 * tests/conflicts.at, tests/input.at, tests/reduce.at,
2428 * tests/regression.at: Adjust the column numbers.
2429 * tests/regression.at: Adjust the error message.
7891a7c4 2430
184e42f0
JD
24312006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
2432
2433 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
2434 Use Akim's wording from
2435 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
2436
7891a7c4
JD
24372006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
2438
2439 Between Bison releases, manually append `+' to the previous Bison
2440 release number, and use that as a signal to automatically print the
2441 ChangeLog's CVS Id keyword from --version. Discussed starting at
2442 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
2443 * ChangeLog: Add Id header.
2444 * configure.ac (AC_INIT): Append `+' to `2.3'.
2445 * src/.cvsignore: Add revision.c.
2446 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
2447 (BUILT_SOURCES): Add revision.c.
2448 (revision.c): New target rule. This file defines a new global variable
2449 named revision. It initializes it with either the Id from ChangeLog
2450 or, if VERSION doesn't contain `+', with the empty string.
2451 * src/getargs.c (version): Print the value of revision.
2452 * src/revision.h: Extern revision.
2453
4ad3ed84
PE
24542006-06-05 Paul Eggert <eggert@cs.ucla.edu>
2455
2456 * NEWS: Version 2.3.
2457 * configure.ac (AC_INIT): Likewise.
2458
02103984
PE
24592006-05-30 Paul Eggert <eggert@cs.ucla.edu>
2460
2461 * data/glr.c (YYRECOVERING): Define to be a function-like macro
2462 with no arguments, not as an object-like macro. This is for
2463 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
2464 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
2465 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
2466 Document this.
2467
2c08afa5
JD
24682006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
2469
2470 * src/getargs.c (usage): Back out yesterday's modification of the
2471 --help output so that we don't have to wait for translation before
2472 releasing 2.3.
2473
6077da58
PE
24742006-05-29 Paul Eggert <eggert@cs.ucla.edu>
2475
2476 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
2477 Problem reported by Akim Demaille.
2478
2a26b6c2
JD
24792006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
2480
2481 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
2482
aefef0d6
PE
24832006-05-26 Paul Eggert <eggert@cs.ucla.edu>
2484
2485 * data/yacc.c (yy_reduce_print): Omit trailing white space in
2486 generated source code. Problem reported by Frans Englich in
2487 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
2488
fcd8e201
PE
24892006-05-22 Paul Eggert <eggert@cs.ucla.edu>
2490
2491 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
2492 shell, not within 'make', so that 'make' by an ordinary builder
2493 (using GNU make) does not worry about configuring gzip. This also
2494 works around a bug reported independently by Keith Thompson and by
2495 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
2496 stderr rather than stdout, messing up the build logs.
2497
7b5cdcbd
JD
24982006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
2499
2500 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
2501 to make sure that YYID will never be unused. This fixes a 'make
2502 maintainer-check' failure caused by the recent changes to the 'Trivial
2503 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
2504 not used.
2505 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
2506
5ad0a449
JD
25072006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
2508
2509 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
2510 state before an empty RHS is always resolved here. Only the location
2511 of that state is guaranteed to be resolved, and that's enough. This
2512 fixes the remaining bug reported by Derek M. Jones in
2513 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
2514 * tests/glr-regression.at (Uninitialized location when reporting
2515 ambiguity): Test the above case.
2516 Also, the embedded comments in this test case claim it checks the case
2517 of an empty RHS that has inherited the initial location. However, the
2518 corresponding LHS was already resolved, so yyresolveLocations didn't
2519 actually have reason to modify it. Fix this by forcing
2520 nondeterministic operation at the beginning of the parse.
2521
50cce58e
PE
25222006-05-20 Paul Eggert <eggert@cs.ucla.edu>
2523
2524 * data/c.m4 (b4_yy_symbol_print_generate):
2525 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
2526 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
2527 of the bugs reported today by Derek M Jones in
2528 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
2529 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
2530 defined to be a type name without parens or brackets.
2531 (Location Type): Similarly for YYLTYPE.
2532 * tests/regression.at (Trivial grammars): Put in a test for this
2533 bug that will be caught by 'make maintainer-check' (though not,
2534 alas, by 'make check' unless your compiler is picky).
2535
ab8d9dc5
PE
25362006-05-19 Paul Eggert <eggert@cs.ucla.edu>
2537
0d2c8934 2538 * NEWS: Version 2.2.
ab8d9dc5
PE
2539 * configure.ac (AC_INIT): Likewise.
2540
9138c575
JD
25412006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
2542
2543 * data/glr.c (yyreportTree): Make room in yystates for the state
2544 preceding the RHS. This fixes the segmentation fault reported by Derek
2545 M. Jones in
2546 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
2547 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
2548 to the user. Reported for yyreportTree by Derek M. Jones later in the
2549 same thread.
2550 * THANKS: Add Derek M. Jones.
2551 Update my email address.
2552 Fix typo in Steve Murphy's name.
2553
276f48df
PE
25542006-05-14 Paul Eggert <eggert@cs.ucla.edu>
2555
d6645148
PE
2556 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
2557 checking against YYLAST that caused the parser to miss a potential
2558 alternative in its diagnostic.
2559 Problem reported by Maria Jose Moron Fernandez in
2560 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
2561 * data/lalr1.cc (yysyntax_error_): Likewise.
2562 * data/yacc.c (yysyntax_error): Likewise.
2563 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
2564 tokens, in case we run into an older C compiler.
2565 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
2566 Use them to check for the off-by-one error fixed above.
2567
276f48df
PE
2568 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
2569 YYSIZE_T, not size_t.
2570 * tests/regression.at (Trivial grammars): New test, to catch
2571 the error fixed by the above patch.
2572
cd8b5791
AD
25732006-05-14 Akim Demaille <akim@lrde.epita.fr>
2574
2575 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
2576 scheme.
2577 Reported by Steve Murphy.
2578
34376418
AD
25792006-05-14 Akim Demaille <akim@lrde.epita.fr>
2580
2581 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
2582 * data/glr.cc: b4_location_flag is now b4_locations_flag.
2583
327afc7c
AD
25842006-05-14 Akim Demaille <akim@lrde.epita.fr>
2585
2586 Implement --trace=m4.
2587 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
2588 * src/output.c (output_skeleton): When set, pass -dV to m4.
2589
2590 Factor the handling of flags in m4.
2591 * src/output.c (prepare): Rename the muscle names debug, defines,
2592 error_verbose to debug_flag, defines_flag, error_verbose_flag.
2593 * data/c.m4: Adjust.
2594 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
2595 Use b4_define_flag_if to define other b4_FLAG_if macros.
2596 (b4_location_if): As a consequence, rename as...
2597 (b4_locations_if): this, for consistency.
2598 Adjust all the skeletons.
2599
ba9ecd19
AD
26002006-05-14 Akim Demaille <akim@lrde.epita.fr>
2601
2602 * etc/bench.pm: Shorten bench names.
2603
4e83ea15
AD
26042006-05-14 Akim Demaille <akim@lrde.epita.fr>
2605
2606 * src/output.h, src/output.c (error_verbose): Move to...
2607 * src/getargs.h, src/getargs.c: here.
2608 Sort the flags.
2609 Adjust dependencies.
2610
6e93d810
PE
26112006-05-13 Paul Eggert <eggert@cs.ucla.edu>
2612
2613 * data/c.m4 (b4_copyright): Put the special exception for Bison
2614 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
2615 uses changed. Suggested by Akim Demaille. Also, wrap the
2616 copyright notice, in case it is longer than 80 columns. Replace
2617 comma by newline after title.
6e93d810 2618
eaea13f5
PE
26192006-05-11 Paul Eggert <eggert@cs.ucla.edu>
2620
2621 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
2622 incompatibility, not a bug. Mention that it wasn't fixed as of
2623 flex 2.5.33.
2624
3cf084ec
AD
26252006-05-11 Akim Demaille <akim@lrde.epita.fr>
2626
2627 * examples/extexi: Enforce the precedence of concatenation over
2628 >>.
0a9f1c7d 2629 Reported by Tommy Nordgren.
3cf084ec 2630
32c96bd7
AD
26312006-05-11 Akim Demaille <akim@lrde.epita.fr>
2632
2633 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
2634 with the member "token".
f94705b2 2635 Reported by Martin Nylin.
32c96bd7 2636
eaea13f5
PE
26372006-05-08 Paul Eggert <eggert@cs.ucla.edu>
2638
2639 * data/glr.c: Switch to Bison 2.2 special-exception language in
2640 the copyright notice. Use more-regular format for titles and
2641 copyright notices.
2642 * data/glr.cc: Likewise.
2643 * data/location.cc: Likewise.
2644 * data/yacc.cc: Likewise.
2645 * doc/bison.texinfo (Conditions): Document this.
2646 * NEWS: likewise. Upgrade version to 2.2.
2647
6e2d1146
AD
26482006-04-27 Akim Demaille <akim@lrde.epita.fr>
2649
2650 * data/glr.cc: Remove dead code.
2651
47671055
PE
26522006-04-25 Paul Eggert <eggert@cs.ucla.edu>
2653
2654 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
2655 that variable and the line breaks the bootstrap. Problem reported
2656 by Juan M. Guerrero.
2657
ed2e6384
AD
26582006-04-24 Akim Demaille <akim@lrde.epita.fr>
2659
2660 * doc/bison.texinfo (Multiple start-symbols): New.
2661
3cedc2dc
AD
26622006-04-24 Akim Demaille <akim@lrde.epita.fr>
2663
2664 * etc/README, etc/bench.pl: New.
2665
b2ddc3f3
AD
26662006-04-03 Akim Demaille <akim@lrde.epita.fr>
2667
2668 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
2669 rule.
2670 Reported by Mickael Labau.
2671 * tests/input.at (Torturing the Scanner): Test it.
2672
91e3ac9a
PE
26732006-03-16 Paul Eggert <eggert@cs.ucla.edu>
2674
2675 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
2676 Problem reported by Bob Rossi.
2677
26782006-03-13 Paul Eggert <eggert@cs.ucla.edu>
2679
2680 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
2681 and didn't really work.
2682 For the index, use @ifnotinfo, not @iftex.
2683 Minor cleanups of spacing and terminology.
2684
5cf61e93
AD
26852006-03-12 Akim Demaille <akim@lrde.epita.fr>
2686
2687 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
2688 of AT_NAME_PREFIX when %name-prefix is not used.
2689
aa08666d
AD
26902006-03-12 Akim Demaille <akim@lrde.epita.fr>
2691
2692 Apply --prefix to C++ skeletons too: they change the namespace.
2693 The test suite already exercize these cases.
2694 * data/c++.m4 (b4_namespace): New.
2695 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
2696 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
2697 * data/yacc.c, data/glr.c: Remove a useless `[]'.
2698 * doc/bison.texinfo: Document it.
2699 (Option Cross Key): Use @multitable in all formats. It looks
2700 nicer, even in TeX outputs.
2701 (Rules): Use the same code whatever the output type is.
2702 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
2703 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
2704 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 2705
45567173
AD
27062006-03-10 Akim Demaille <akim@lrde.epita.fr>
2707
2708 * TODO: Remove dead items.
2709
e9d8f881 27102006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
2711
2712 * doc/FAQ: Remove, merged into...
2713 * doc/bison.texinfo (FAQ): this.
2714 * doc/Makefile.am (EXTRA_DIST): Adjust.
2715
c095d689
AD
27162006-03-10 Akim Demaille <akim@lrde.epita.fr>
2717
2718 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
2719 even if empty.
2720 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
2721 * doc/bison.texinfo (Calc++ Scanner): Use it.
2722
6e0f8287
PE
27232006-03-09 Paul Eggert <eggert@cs.ucla.edu>
2724
2725 Fix two nits reported by twlevo, plus one more that I discovered.
2726
2727 * src/assoc.h (assoc_to_string): Give a name to the arg, as
2728 this is the usual Bison style.
2729 * src/location.h (location_print): Likewise.
2730
2731 * src/reader.h (token_name): Likewise.
2732
d6b771c3
PE
27332006-03-08 Paul Eggert <eggert@cs.ucla.edu>
2734
2735 Fix some nits reported by twlevo.
2736 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
2737 and "POSIX". Use more-modern syntax for URLs. Mention C++
2738 and ask for Java. Don't hardwire OS version numbers. Add
2739 copyright notice.
2740 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
2741 * src/conflicts.c (solved_conflicts_obstack): Now static.
2742
1e137b71
JD
27432006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2744
2745 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
2746 page. Say "you can use it" not "you may use it" as on the web page;
2747 we're describing capabilities not granting permission.
2748
73f2e47e
PE
27492006-03-06 Paul Eggert <eggert@cs.ucla.edu>
2750
6d05403d
PE
2751 * data/glr.c (yyresolveLocations): Rename local variables to avoid
2752 shadowing warnings. Use usual patter for iterating through RHS.
2753 * tests/glr-regression.at
2754 (Uninitialized location when reporting ambiguity):
2755 Modify yylex so that it uses its argument, rather than trying
2756 to rely on ARGSUSED (which doesn't work for gcc with warnings).
2757 const char -> char const.
2758
73f2e47e
PE
2759 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
2760 Don't use tabs inside commands; it messes up 'ps'.
2761 Problem reported by twlevo.
2762
8710fc41
JD
27632006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
2764
2765 * tests/glr-regression.at (Uninitialized location when reporting
2766 ambiguity): New test case.
2767 * data/glr.c (yyresolveLocations): New function, which uses
2768 YYLLOC_DEFAULT.
2769 (yyresolveValue): Invoke yyresolveLocations before reporting an
2770 ambiguity.
2771 * doc/bison.texinfo (Default Action for Locations): Note
2772 YYLLOC_DEFAULT's usage for ambiguity locations.
2773 (GLR Semantic Actions): Cross-reference those notes.
2774
ae952af2
JD
27752006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
2776
2777 * tests/glr-regression.at (Leaked semantic values when reporting
2778 ambiguity): Remove unnecessary union and type declarations.
2779 (Leaked lookahead after nondeterministic parse syntax error): New test
2780 case.
2781 * data/glr.c (yyparse): Check for zero stacks remaining before
2782 attempting to shift the lookahead so that you don't lose it.
2783
35ee866a
JD
27842006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2785
2786 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
2787 * tests/glr-regression.at (Leaked semantic values when reporting
2788 ambiguity): New test case.
2789 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
2790 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
2791 now unnecessary yystackp parameter.
2792 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
2793 destructors can be called.
2794
2795 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
2796 in existing testcases.
2797
520181ab
JD
27982006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2799
2800 Don't leak semantic values for parent RHS when a user action cuts the
2801 parser, and clean up related code a bit.
2802 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
2803 cuts parse): Rename to...
2804 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
2805 for leaked parent RHS values.
2806 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
2807 between an unresolved state (non-empty chain of semantic options) and
2808 an incomplete one (signaled by an empty chain).
ae952af2 2809 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
2810 successfully or unsuccessfully resolved yyGLRState to...
2811 (yyresolveValue): ... here so that yyresolveValue always leaves a
2812 yyGLRState with consistent data and thus is easier to understand.
2813 Remove the yyvalp and yylocp parameters since they are always just
2814 taken from the yys parameter. When reporting a discarded merged value
2815 in debugging output, note that it is incompletely merged. Document the
2816 interface.
2817 (yyresolveAction): If resolving any of the RHS states fails, destroy
2818 them all rather than leaking them. Thus, as long as user actions are
2819 written to clean up the RHS correctly, yyresolveAction always cleans up
2820 the RHS of a semantic option. Document the interface.
2821
18d9185c
PE
28222006-02-27 Paul Eggert <eggert@cs.ucla.edu>
2823
2824 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
2825 led to a segmentation fault in GNU Pascal. Problem reported
2826 by Waldek Hebisch.
2827
841a7737
JD
28282006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
2829
2830 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
2831 mid-rule action inside a nonterminal symbol in order to declare a
2832 destructor for its semantic value.
2833
fc3f467f
PE
28342006-02-16 Paul Eggert <eggert@cs.ucla.edu>
2835
2836 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
2837 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
2838 __cplusplus && ! defined _STDLIB_H && !
2839 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
2840 defined free))]: Include <stdlib.h> rather than rolling our own
2841 declarations of malloc and free, to avoid problems with
2842 incompatible declarations (using 'throw') C++'s stdlib.h. This
2843 should fix Debian bug 340012
2844 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
2845 reported by Guillaume Melquiond.
2846
a3af26dd
PE
28472006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2848
4d7bc38c
PE
2849 * NEWS: Clarify symbols versus types in unused-value warnings.
2850
a3af26dd
PE
2851 * configure.ac (AC_INIT): Bump version number.
2852
4e26c69e
PE
28532006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2854
2855 * NEWS: Version 2.1a.
2856 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
2857 since C99 requires this.
2858
498e897c
PE
28592006-02-11 Paul Eggert <eggert@cs.ucla.edu>
2860
2861 * m4/c-working.m4: New file.
2862 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
2863
57bb17ca
PE
28642006-02-10 Paul Eggert <eggert@cs.ucla.edu>
2865
2866 * Makefile.maint: Merge from coreutils.
2867
0be105dc
PE
28682006-02-09 Paul Eggert <eggert@cs.ucla.edu>
2869
2870 More portability fixes for problems summarized by Nelson H. F. Beebe.
2871
2872 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
2873 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
2874 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
2875 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
2876 messes up because C++ code is compiled in 32-bit mode but linked
2877 in 64-bit mode.
2878
6fc0c024
PE
28792006-02-08 Paul Eggert <eggert@cs.ucla.edu>
2880
2881 More portability fixes for problems summarized by Nelson H. F. Beebe.
2882
7870f699
PE
2883 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
2884 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
2885
6fc0c024
PE
2886 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
2887 nodist_PROGRAMS, since we don't need to actually compile the
2888 example if we're just doing a plain 'make'. This avoids bothering
2889 the installer unnecessarily about problems due to weird C++
2890 compilers.
2891
fe6c2fde
PE
28922006-02-06 Paul Eggert <eggert@cs.ucla.edu>
2893
2894 More portability fixes for problems summarized by Nelson H. F. Beebe.
2895
2896 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
2897 than #include "...", and compile with -I'.'. The old method was
2898 not portable, according to Posix and the C standard, and it does
2899 not work with Sun C 5.7, where previous #line directives affect
2900 the working directory used in later #include "..." directives.
2901
927b425b
JMG
29022006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2903
2904 Various DJGGP specific issues in /djgpp
2905
d9735e9e
PE
29062006-02-02 Paul Eggert <eggert@cs.ucla.edu>
2907
2908 More portability fixes for problems summarized by Nelson H. F. Beebe.
2909
2910 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
2911 '#include <map>' works and that you can apply ++ to iterators.
2912
5a6755af
PE
29132006-02-01 Paul Eggert <eggert@cs.ucla.edu>
2914
67a0dc4f
PE
2915 Work around portability problems summarized by Nelson H. F. Beebe in
2916 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
2917
8c86f0ef
PE
2918 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
2919 that '#include <string>' works.
2920
de35dd59
PE
2921 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
2922 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
2923 "warning: sorry: semantics of inline function static data `const
2924 unsigned char translate_table[262]' are wrong (you'll wind up with
2925 multiple copies)".
2926
67a0dc4f
PE
2927 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
2928 or, xor to not_, and_, or_, and xor_, respectively. This works
2929 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
2930 random system header somewhere that includes the equivalent of
2931 <iso646.h>.
2932
5a6755af
PE
2933 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
2934 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 2935 Suite Version 2.0.
5a6755af 2936
3f001415
JD
29372006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
2938
2939 During deterministic GLR operation, user actions should be able to
2940 influence the parse by changing yychar. To make this easier to fix and
2941 to make glr.c easier to evolve in general, don't maintain yytoken in
2942 parallel with yychar; just compute yytoken when needed.
2943 * tests/glr-regression.at (Incorrect lookahead during deterministic
2944 GLR): Check that setting yychar in a user action has the intended
2945 effect.
2946 * data/glr.c (yyGLRStack): Remove yytokenp member.
2947 (yyclearin): Don't set *yytokenp.
2948 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
2949 yychar rather than *yytokenp to determine the current lookahead.
2950 Compute yytoken locally when needed.
2951 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
2952 point to.
2953
2954 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
2955 after `--report' documentation.
2956
e2a8c0f5
PE
29572006-01-30 Paul Eggert <eggert@cs.ucla.edu>
2958
2959 * src/parse-gram.y (grammar_declaration): Location of printer
2960 symbol is @1, not list->location. Bug reported by twlevo.
2961 * tests/input.at (Incompatible Aliases): Adjust to above change.
2962
6b702268
PE
29632006-01-29 Paul Eggert <eggert@cs.ucla.edu>
2964
27622431
PE
2965 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
2966 all the test at once. This makes the output easier to read in the
2967 normal case.
2968
6b702268
PE
2969 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
2970 got from <http://bro-ids.org/download.html>. The bug is that
2971 when two actions appeared in succession, the second one was
2972 scanned before the first one was added to the grammar rule
2973 as a midrule action. Bison then output the incorrect warning
2974 "parse.y:905.17-906.36: warning: unused value: $3".
2975 * src/parse-gram.y (BRACED_CODE, action): These are no longer
2976 associated with a value.
2977 (rhs): Don't invoke grammar_current_rule_action_append.
2978 (action): Invoke it here instead.
2979 * src/reader.c (grammar_midrule_action): Now extern.
2980 (grammar_current_rule_action_append): Don't invoke
2981 grammar_midrule_action; that is now the scanner's job.
2982 * src/reader.h (last_string, last_braced_code_loc):
2983 (grammar_midrule_action): New decls.
2984 * src/scan-gram.l (last_string): Now extern, sigh.
2985 (last_braced_code_loc): New extern variable.
2986 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
2987 rule already has an action.
2988 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
2989 * tests/input.at (AT_CHECK_UNUSED_VALUES):
2990 Add some tests to check that the above changes fixed the bug.
2991
d40ba6c2
PE
29922006-01-27 Paul Eggert <eggert@cs.ucla.edu>
2993
2994 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
2995 All used changed. Check whether the symbol has a destructor,
2996 not whether it is typed.
2997 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
2998 that the values are still reported as unused. All line numbers
2999 adjusted.
3000
401aace6
PE
30012006-01-23 Paul Eggert <eggert@cs.ucla.edu>
3002
3003 Work around a bug in bro 0.8, which underparenthesizes its
3004 definition of YYLLOC_DEFAULT.
3005 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
3006 their arguments.
3007 * data/lalr1.cc: Likewise.
3008 * data/yacc.cc: Likewise.
3009
06f01bc4
PE
30102006-01-22 Paul Eggert <eggert@cs.ucla.edu>
3011
401aace6
PE
3012 Work around a bug in Pike 7.0, and give the Pike folks a
3013 better way to override the usual int widths.
3014 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
3015 user can override the types.
3016 (short): #undef, to work around a bug in Pike 7.0.
3017 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
3018 (union yyalloc.yyss): Use yytype_int16 rather than short.
3019 All uses changed.
3020 (yysigned_char): Remove.
3021 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
3022 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
3023 * tests/regression.at (Web2c Actions): Adjust to above changes.
3024
3025 * src/reader.c (check_and_convert_grammar): New function.
3026 (reader): Close the input file even if something went wrong during
3027 parsing. Minor file descriptor leak reported by twlevo.
3028
06f01bc4
PE
3029 * src/assoc.c (assoc_to_string): Use a default: abort (); case
3030 to pacify gcc -Wswitch-default.
3031 * src/scan-gram.l (adjust_location): Use a default: break; case
3032 to pacify gcc -Wswitch-default.
3033 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
3034 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
3035 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
3036 Move these decls to scan-skel.l, since they don't need to be
3037 visible elsewhere.
3038 * src/scan-skel.l: Accept the above decls.
3039 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
3040 is used.
3041
02650b7f
PE
30422006-01-21 Paul Eggert <eggert@cs.ucla.edu>
3043
3044 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
3045 since we don't want to insist on a version number at the start
3046 of the changelog every time.
3047 * Makefile.maint: Sync from coreutils a bit better.
3048 (sc_trailing_blank): Renamed from sc_trailing_space.
3049 All uses changed.
3050 (sc_no_if_have_config_h, sc_require_config_h):
3051 (sc_prohibit_assert_without_use): New rules.
3052 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
3053 (sc_dd_max_sym_length): Fix leading spaces in rule.
3054 (sc_system_h_headers): Prefix with @.
3055 (sc_useless_cpp_parens, m4-check): Output line numbers.
3056 (changelog-check): Allow version only in head.
3057 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
3058 satisfy new Makefile.maint rule.
3059 * data/glr.c: Likewise.
3060 * data/glr.cc: Likewise.
3061 * data/lalr1.cc: Likewise.
3062 * data/yacc.c: Likewise.
3063 * lib/ebitsetv.c: Likewise.
3064 * lib/lbitset.c: Likewise.
3065 * lib/subpipe.c: Likewise.
3066 * lib/timevar.c: Likewise.
3067 * src/system.h: Likewise.
3068 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
3069 * djgpp/Makefile.maint: Add copyright notice.
3070 * djgpp/README.in: Likewise.
3071 * djgpp/config.bat: Likewise.
3072 * djgpp/config.site: Likewise.
3073 * djgpp/config_h.sed: Likewise.
3074 * djgpp/djunpack.bat: Likewise.
3075 * djgpp/config.sed: Fix copyright notice to match standard format.
3076 * djgpp/subpipe.h: Likewise.
3077 * lib/bitsetv-print.c: Likewise.
3078 * lib/bitsetv.c: Likewise.
3079 * lib/subpipe.h: Likewise.
3080 * lib/timevar.c: Likewise.
3081 * lib/timevar.h: Likewise.
3082 * djgpp/subpipe.c: Use standard recipe for config.h.
3083 * lib/abitset.c: Likewise.
3084 * lib/bitset.c: Likewise.
3085 * lib/bitset_stats.c: Likewise.
3086 * lib/bitsetv-print.c: Likewise.
3087 * lib/bitsetv.c: Likewise.
3088 * lib/ebitsetv.c: Likewise.
3089 * lib/get-errno.c: Likewise.
3090 * lib/lbitset.c: Likewise.
3091 * lib/subpipe.c: Likewise.
3092 * lib/timevar.c: Likewise.
3093 * lib/vbitset.c: Likewise.
3094 * tests/local.at: Likewise.
3095 * src/scan-gram.l: Don't include verify.h, since system.h does
3096 that for us.
3097 * .x-sc_require_config_h: New file.
3098 * .x-sc_unmarked_diagnostics: New file.
3099
287c78f6
PE
31002006-01-20 Paul Eggert <eggert@cs.ucla.edu>
3101
287c78f6
PE
3102 Be a bit more systematic about using 'abort'.
3103 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
3104 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
3105 Put 'default: abort ();' before some other case, to satisfy older
3106 pedantic compilers.
3107 * lib/bitset_stats.c (bitset_stats_init): Likewise.
3108 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
3109 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
3110 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
3111 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
3112 (get_decision_str, get_orientation_str, get_node_alignment_str):
3113 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
3114 (get_linestyle_str, get_arrowstyle_str): Likewise.
3115 * src/conflicts.c (resolve_sr_conflict):
3116 Use a default case rather than one for the one remaining enum
3117 value, to catch invalid enum values as well.
3118 * src/lalr.c (set_goto_map, map_goto):
3119 Prefer "assert (FOO);" to "if (!FOO) abort ();".
3120 * src/nullable.c (nullable_compute, token_definitions_output):
3121 Likewise.
3122 * src/reader.c (packgram, reader): Likewise.
3123 * src/state.c (transitions_to, state_new, state_reduction_find):
3124 Likewise.
3125 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
3126 (symbol_pack): Likewise.
3127 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
3128 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
3129 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
3130 * src/system.h: Don't include <assert.h>.
3131 (assert): New macro.
3132
3133 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
3134 (Destructor Decl, Parser Function, Pure Calling):
3135 Describe rules for braces inside C code more carefully.
287c78f6 3136
c66dfadd
PE
31372006-01-19 Paul Eggert <eggert@cs.ucla.edu>
3138
c21493b8
PE
3139 Fix some porting glitches found by Nelson H. F. Beebe.
3140 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
3141 compilers that don't understand that abort () does not return.
3142 * src/state.c (transitions_to): Likewise.
3143 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
3144 that '#include <cstdlib>' works.
3145 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
3146 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
3147 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
3148 for the benefit of some pre-C99 compilers.
3149
b6e3facf
PE
3150 * bootstrap: Undo changes to gnulib files that autoreconf made.
3151
c66dfadd
PE
3152 Minor fixups to get 'make maintainer-check' to work.
3153 * configure.ac: Don't use -Wnested-externs, as it's incompatible
3154 with the new verify.h implementation.
3155 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
3156 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
3157 * data/yacc.c (YYUSE): Likewise.
3158 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
3159 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
3160 * src/parse-gram.y (declaration): Don't pass a string constant
3161 to a function that expects char *, since GCC might complain
3162 about the constant value.
3163 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
3164 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
3165 before #defining them.
3166 * tests/glr-regression.at
3167 (Incorrectly initialized location for empty right-hand side in GLR):
3168 In yyerror, use the msg arg.
3169 (Corrupted semantic options if user action cuts parse):
3170 (Incorrect lookahead during deterministic GLR):
3171 (Incorrect lookahead during nondeterministic GLR):
3172 Don't name a local var 'index'; it shadows string.h's 'index'.
3173
ed94ef2a
AD
31742006-01-19 Akim Demaille <akim@epita.fr>
3175
3176 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
3177 location, not just parts of it.
3178
e9ad4aec
PE
31792006-01-18 Paul Eggert <eggert@cs.ucla.edu>
3180
d6ca7905
PE
3181 * NEWS: Document the fact that multiple %unions are now allowed.
3182 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
3183 * TODO: This feature is now implemented, so remove it from
3184 the wishlist.
d6ca7905 3185
ef1b70e0
PE
3186 * Makefile.maint: Merge with coreutils Makefile.maint.
3187 (CVS_LIST): Use build-aux version if available.
3188 (VERSION_REGEXP): New macro.
3189 (syntax-check-rules): Add sc_no_if_have_config_h,
3190 sc_prohibit_assert_without_use, sc_require_config_h,
3191 sc_useless_cpp_parens.
3192 (sc_obsolete_symbols): Check for O_NDELAY.
3193 (sc_dd_max_sym_length): Track coreutils.
3194 (sc_unmarked_diagnostics): Look in all files, not just *.c.
3195 (sc_useless_cpp_parens): New rule.
3196 (news-date-check): Look for version or today's date.
3197 (changelog-check): Don't require version number near head.
3198 (copyright-check): Use current year instead of hardwiring 2005.
3199 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
3200 (announcement): Add --gpg-key-ID.
3201
3202 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
3203 with "file system".
3204
2073ce56 3205 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
3206 array. Problem reported by twlevo.
3207 * src/reader.c (packgram): Prepend a new sentinel before ritem.
3208 * src/lalr.c (build_relations): Rely on new sentinel.
3209 * src/gram.c (gram_free): Adjust to new sentinel.
3210
b7691f15
JD
32112006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
3212
3213 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
3214 yylookaheadNeeds. All uses updated.
3215 (yysplitStack): Rename local yynewLookaheadStatuses to
3216 yynewLookaheadNeeds.
3217 * data/glr-regression.at (Incorrect lookahead during nondeterministic
3218 GLR): In comments, change `lookahead status' to `lookahead need'.
3219
ddee1b06
PH
32202006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3221
3222 * data/glr.c (yysplitStack): A little stylistic rewrite.
3223
12f4614d
PH
32242006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3225
3226 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
3227
32c29292
JD
32282006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
3229
3230 * doc/bison.texinfo: Fix some typos.
3231 (GLR Semantic Actions): New subsection discussing special
3232 considerations because GLR semantic actions might be deferred.
3233 (Actions): Mention look-ahead usage of yylval.
3234 (Actions and Locations): Mention look-ahead usage of yylloc.
3235 (Special Features for Use in Actions): Add YYEOF entry and mention it
3236 in the yychar entry.
3237 In the yychar entry, remove mention of the local yychar case (pure
3238 parser) since this is irrelevant information when writing semantic
3239 actions and since it's already discussed in `Bison Symbols' where
3240 yychar is otherwise described as an external variable.
3241 In the yychar entry, don't call it the `current' look-ahead since it
3242 isn't when semantic actions are deferred.
3243 In the yychar and yyclearin entries, add note about deferred semantic
3244 actions.
3245 Add yylloc and yylval entries discussing look-ahead usage.
3246 (Look-Ahead Tokens): When discussing yychar, don't call it the
3247 `current' look-ahead, and do mention yylval and yylloc.
3248 (Error Recovery): Cross-reference `Action Features' when mentioning
3249 yyclearin.
3250 (Bison Symbols): In the yychar entry, don't call it the `current'
3251 look-ahead.
3252 In the yylloc and yylval entries, mention look-ahead usage.
3253
de366a2f 32542006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
3255
3256 * tests/glr-regression.at: Update copyright year to 2006.
3257
bf70fa87
JD
32582006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3259
3260 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
3261 use during nondeterministic operation to track which stacks have
3262 actually needed the current lookahead.
3263 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
3264 Allocate, deallocate, resize, and otherwise shuffle space for
3265 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
3266 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
3267 appropriately during nondeterministic operation.
3268 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
3269 members to store the current lookahead to be used by the deferred
3270 user action.
3271 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
3272 from which the RHS is taken. Set the lookahead members of the new
3273 yySemanticOption according to the lookahead status for stack yyk.
3274 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
3275 yyaddDeferredAction.
3276 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
3277 members of yySemanticOption before invoking yyuserAction, and then set
3278 them back to their current values afterward.
3279 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
3280 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
3281 * tests/glr-regression.at: Remove `.' from the ends of recent test case
3282 titles for consistency.
3283 (Leaked merged semantic value if user action cuts parse): In order to
3284 suppress lint warnings, use arguments in merge function, and assign
3285 char value < 128 in main.
3286 (Incorrect lookahead during deterministic GLR): New test case.
3287 (Incorrect lookahead during nondeterministic GLR): New test case.
3288
05449a2c
JD
32892006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3290
de366a2f 3291 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
3292 !yyvaluep as signal that no semantic value is available to print.
3293 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
3294 to print a semantic value.
3295
4158e0a1 32962006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 3297
4158e0a1
JD
3298 * tests/glr-regression.at: For consistency with my newer test cases,
3299 don't thank myself.
3300
d659304d
JD
33012006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
3302
3303 * data/glr.c (yyresolveValue): When merging semantic options, if at
3304 least one user action succeeds but a later one cuts the parse, then
3305 destroy the semantic value before returning rather than leaking it.
3306 (yyresolveStates): If a user action cuts the parse and thus
3307 yyresolveValue fails, ignore the (unset) semantic value rather than
3308 corrupting the yyGLRState, and empty the semantic options list since
3309 the user actions should have called all necessary destructors.
3310 Simplify code with YYCHK.
3311 * tests/glr-regression.at (Corrupted semantic options if user action
3312 cuts parse): New test case.
3313 (Undesirable destructors if user action cuts parse): New test case.
3314 Before applying any of this patch, this test case never actually failed
3315 for me... but only because the corrupted semantic options usually
3316 masked this bug.
3317 (Leaked merged semantic value if user action cuts parse): New test
3318 case.
3319
6ec2c0f2
AD
33202006-01-05 Akim Demaille <akim@epita.fr>
3321
3322 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
3323
1b9c21fb
PE
33242006-01-04 Paul Eggert <eggert@cs.ucla.edu>
3325
3326 * data/c.m4 (b4_c_modern): New macro, with a new provision for
3327 _MSC_VER. Problem reported by Cenzato Marco.
3328 (b4_c_function_def): Use it.
3329 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
3330 b4_c_modern.
3331 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
3332 than rolling our own.
3333
84866159
AD
33342006-01-04 Akim Demaille <akim@epita.fr>
3335
3336 Also warn about non-used mid-rule values.
3337 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
3338 member.
3339 (symbol_list_new): Adjust.
3340 * src/reader.c (symbol_typed_p): New.
3341 (grammar_rule_check): Use it.
3342 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
3343 Check its rule.
3344 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
3345 Use it.
3346 * tests/actions.at (Exotic Dollars): Adjust.
3347
378f4bd8
AD
33482006-01-04 Akim Demaille <akim@epita.fr>
3349
3350 * src/reader.c (grammar_midrule_action): If $$ is set in a
3351 mid-rule, move the `used' bit to its lhs.
3352 * tests/input.at (Unused values): New.
3353 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
3354
e2a21b6f
PE
33552006-01-03 Paul Eggert <eggert@cs.ucla.edu>
3356
54662697
PE
3357 * doc/bison.texinfo (Bison Options): Say more accurately what
3358 --yacc does.
3359 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
3360 about declarations in the grammar when in Yacc mode, as POSIX does
3361 not require a diagnostic when the grammar uses extensions.
3362
3363 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
3364
073f9288
PE
3365 Warn about dubious constructions like "%token T T".
3366 Reported by twlevo.
3367 * src/symtab.h (struct symbol.declared): New member.
3368 * src/symtab.c (symbol_new): Initialize it to false.
3369 (symbol_class_set): New arg DECLARING, specifying whether
3370 this is a declaration that we want to warn about, if there
3371 is more than one of them. All uses changed.
3372
1221b78a
PE
3373 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
3374 Allow multiple %union directives, whose contents concatenate.
3375 * src/parse-gram.y (grammar_declaration): Likewise.
3376 Use muscle_code_grow, so that we don't need stype_line any more.
3377 All uses changed.
3378
3379 * src/muscle_tab.c (muscle_grow): Fix comment.
3380
e2a21b6f
PE
3381 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
3382 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
3383 Update copyright year to 2006.
3384
8f7e3cf9
AD
33852006-01-03 Akim Demaille <akim@epita.fr>
3386
3387 Have glr.cc pass (some of) the calc.at tests.
3388 * data/glr.cc (b4_parse_param_orig): New.
3389 (b4_parse_param): Improve its definition, and bound it more
3390 clearly in the skeleton.
3391 (b4_epilogue): Append, instead of prepending, in order to keep
3392 #line consistency.
3393 Simplify the generation of auxiliary functions: locations and
3394 purity are mandated.
3395 (b4_global_tokens_and_yystype): Honor it.
3396 * data/location.cc (c++.m4): Don't include it.
3397 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
3398 and AT_SKEL_CC_IF.
3399 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
3400 AT_LALR1_CC_IF.
3401 Be sure to initialize the first position's filename.
3402 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
3403 mandated anyway.
3404 (AT_CHECK_CALC_GLR_CC): New.
3405 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
3406
3953ed88
AD
34072006-01-02 Akim Demaille <akim@epita.fr>
3408
3409 * src/output.c (output_skeleton): Don't hard wire the inclusion of
3410 c.m4.
0a96ba81 3411 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
3412 * data/glr.cc: Do not include stack.hh.
3413
9ecafbbf
AD
34142006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3415
3416 * data/glr.c: Reformat whitespace with tabs.
3417 (b4_lpure_formals): Remove this unused m4 macro.
3418 * tests/cxx-type.at: Reformat whitespace with tabs.
3419 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
3420 since it's a member. Rename type to isNterm for clarity.
3421
c4d497a0
AD
34222005-12-29 Akim <akim@sulaco.local>
3423
3424 Let glr.cc catch up with symbol_value_print.
3425 * data/glr.cc (b4_yysymprint_generate): Replace by...
3426 (b4_yy_symbol_print_generate): this.
3427 (yy_symbol_print, yy_symbol_value_print): Declare them.
3428
4517da37
PE
34292005-12-28 Paul Eggert <eggert@cs.ucla.edu>
3430
3431 * src/location.h (boundary): Note that a line or column equal
3432 to INT_MAX indicates an overflow.
3433 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
3434 (rule_length_overflow, increment_rule_length, add_column_width):
3435 New functions.
3436 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
3437 (<SC_BRACED_CODE>"}"):
3438 Use increment_rule_length rather than incrementing it by hand.
3439 (adjust_location, handle_syncline): Diagnose overflow.
3440 (handle_action_dollar, handle_action_at):
3441 Fix bug with monstrosities like $-2147483648.
3442 Remove now-unnecessary checks.
3443 (scan_integer): Verify assumptions and remove now-unnecessary checks.
3444 (convert_ucn_to_byte): Verify assumptions.
3445 (handle_syncline): New arg LOC. All callers changed.
3446 Don't store through a value derived from char const * pointer.
3447
3448 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
3449 GCC warnings.
3450
e3233bf6
PE
34512005-12-27 Paul Eggert <eggert@cs.ucla.edu>
3452
3453 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
3454 Remove unnecessary forward static decls.
3455
8f3596a6
AD
34562005-12-27 Akim Demaille <akim@epita.fr>
3457
3458 * src/reader.c (grammar_current_rule_check): Also check that $$
3459 is used.
3460 Take the rule to check as argument, hence rename as...
3461 (grammar_rule_check): this.
3462 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
3463 Rename as...
3464 (grammar_rule_begin, grammar_rule_end): these, for consistency.
3465 (grammar_midrule_action, grammar_symbol_append): Now static.
3466 * tests/torture.at (input): Don't rely on the default action
3467 being always performed.
3468 * tests/calc.at: "Set" $$ even when the action is "cut" with
3469 YYERROR or other.
3470 * tests/actions.at (Exotic Dollars): Instead of using unused
3471 values, check that the warning is issued.
3472
721be13c
PE
34732005-12-22 Paul Eggert <eggert@cs.ucla.edu>
3474
3475 * NEWS: Improve wording for unused-value warnings.
3476
a0af42fc
AD
34772005-12-22 Akim Demaille <akim@epita.fr>
3478
3479 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
3480 (b4_yysymprint_generate): Rename as...
3481 (b4_yy_symbol_print_generate): this.
3482 Generate yy_symbol_print instead of yysymprint.
3483 Generate also yy_symbol_value_print, and use it.
3484
affac613
AD
34852005-12-22 Akim Demaille <akim@epita.fr>
3486
721be13c 3487 * NEWS: Warn about unused values.
affac613
AD
3488 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
3489 a `used' member.
3490 (symbol_list_n_get, symbol_list_n_used_set): New.
3491 (symbol_list_n_type_name_get): Use symbol_list_n_get.
3492 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
3493 * src/reader.c (grammar_current_rule_check): Check that values are
3494 used.
3495 * src/symtab.c (symbol_print): Accept 0.
3496 * tests/existing.at: Remove the type information.
3497 Empty the actions.
3498 Remove useless actions (beware of mid-rule actions: perl -000
3499 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
3500 * tests/actions.at (Exotic Dollars): Use unused values.
3501 * tests/calc.at: Likewise.
3502 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3503 Likewise.
3504
3505 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
3506 rule_useful_p.
3507
9d9b8b70
PE
35082005-12-21 Paul Eggert <eggert@cs.ucla.edu>
3509
8bb4c753
PE
3510 Undo 2005-12-01 tentative license wording change. The wording is
3511 still being reviewed by the lawyers, and we don't want to wait for
3512 them before publishing a test release. For now, revert to the
3513 previous wording.
3514 * NEWS: Undo 2005-12-01 change.
3515 * data/glr.c: Revert to previous license wording.
3516 * data/glr.cc: Likewise.
3517 * data/lalr1.cc: Likewise.
3518 * data/location.cc: Likewise.
3519 * data/yacc.c: Likewise.
3520
9d9b8b70
PE
3521 * NEWS: Reword %destructor vs YYABORT etc.
3522 * data/glr.c: Use American spacing, for consistency.
3523 * data/glr.cc: Likewise.
3524 * data/lalr1.cc: Likewise.
3525 * data/yacc.c: Likewise.
3526 * data/yacc.c: Reformat comments slightly.
3527 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
3528 for consistency. Fix some spelling errors and reword recently-included
3529 text slightly.
3530 * tests/cxx-type.at: Cast results of malloc, for C++.
3531
2c3b392a
AD
35322005-12-21 Joel E. Denny <address@hidden>
3533
3534 * tests/cxx-type.at: Construct a tree, count the parents of shared
3535 nodes, and free each node once and only once. Previously, the memory
3536 for semantic values was leaked instead.
3537
d6cff4dc
AD
35382005-12-21 Joel E. Denny <address@hidden>
3539
3540 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
3541 (yylval, yylloc): If pure, #define to yystackp->yyval and
3542 yystackp->yyloc similar to yychar and yynerrs.
3543 (yyparse): If pure, remove local yylval and yylloc. Add local
3544 yystackp to accommodate pure definitions of yylval and yylloc.
3545 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
3546 yylvalp and yyllocp to &yylval and &yylloc.
3547 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
3548 namespace. Previously, nerrs and char were missing, but lval and lloc
3549 weren't necessary.
3550 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
3551 yylvalp and yyllocp parameters since, if pure, these are now always
3552 accessible through yystackp. If not pure, they are still accessible
3553 globally.
3554 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
3555 `if (YYID (N))' to pacify lint.
3556
a85284cf
AD
35572005-12-21 Akim Demaille <akim@epita.fr>
3558
3559 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
3560 destroy the RHS symbols of a rule.
3561 * data/yacc.c (yylen): Initialize to 0.
3562 Keep its value to the number of items to possibly shift.
3563 In particular, a regular successful parse that ends on YYFINAL by
3564 a (internal) YYACCEPT must not have yylen != 0.
3565 (yyerrorlab, yyreturn): Pop the RHS.
3566 Reorder a bit to emphasize the `shifting' bits of code.
3567 (YYPOPSTACK): Now accept a number of items to pop.
3568 * data/lalr1.cc: Likewise.
3569 * data/glr.c: Formatting changes.
3570 Use goto instead of fall through.
3571 * doc/bison.texinfo (Destructor Decl): Complete.
3572
d508c281
JMG
35732005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3574
3575 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3576 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
3577 * djgpp/config.bat: Replace every occurence of the file name
3578 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3579 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3580 * djgpp/config.sed: Replace every occurence of the file name
3581 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3582 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3583 * djgpp/djunpack.bat: DJGPP specific file.
3584 * djgpp/fnchange.lst: DJGPP specific file.
3585 * djgpp/README.in: Add new information about how to unpack the bison
3586 source on MSDOS and other systems which have 8.3 file name restrictions
3587 using djunpack.bat and fnchange.lst.
3588
3e7a2cd9
PE
35892005-12-12 Paul Eggert <eggert@cs.ucla.edu>
3590
3591 * bootstrap (build_cvs_prefix): Remove; unused.
3592 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
3593 when getting gnulib.
3594
35952005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
3596
3597 * data/glr.c: Reorder typedef declarations for structs to match order
3598 of struct declarations.
3599 Rename yystack everywhere to yystackp except in yyparse where it's not
3600 a pointer.
3601 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
3602 consistency.
3603 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
3604 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
3605 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
3606 lint.
3607
877519f8
PE
36082005-12-09 Paul Eggert <eggert@cs.ucla.edu>
3609
0eca5a39
PE
3610 * tests/sets.at (Accept): Fix typos in regular expression used to
3611 sed out the final state number.
3612
2cec9080
PE
3613 Work around portability problem on Solaris 10: flex-generated
3614 files include <stdio.h> before <config.h>, which messes up
3615 because the latter defines __EXTENSIONS__. Address the problem
3616 by creating two new little files that include <config.h> first,
3617 then include the flex-generated files. Rewrite everyone else
3618 to include <config.h> first, as well.
3619 * lib/timevar.c: Always include "config.h".
3620 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
3621 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
3622 (EXTRA_bison_SOURCES): New macro.
3623 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
3624 * src/system.h: Don't include config.h.
3625 * src/LR0.c: Include <config.h> first.
3626 * src/assoc.c: Likewise.
3627 * src/closure.c: Likewise.
3628 * src/complain.c: Likewise.
3629 * src/conflicts.c: Likewise.
3630 * src/derives.c: Likewise.
3631 * src/files.c: Likewise.
3632 * src/getargs.c: Likewise.
3633 * src/gram.c: Likewise.
3634 * src/lalr.c: Likewise.
3635 * src/location.c: Likewise.
3636 * src/main.c: Likewise.
3637 * src/muscle_tab.c: Likewise.
3638 * src/nullable.c: Likewise.
3639 * src/output.c: Likewise.
3640 * src/parse-gram.y: Likewise.
3641 * src/print.c: Likewise.
3642 * src/print_graph.c: Likewise.
3643 * src/reader.c: Likewise.
3644 * src/reduce.c: Likewise.
3645 * src/relation.c: Likewise.
3646 * src/state.c: Likewise.
3647 * src/symlist.c: Likewise.
3648 * src/symtab.c: Likewise.
3649 * src/tables.c: Likewise.
3650 * src/uniqstr.c: Likewise.
3651 * src/vcg.c: Likewise.
3652
877519f8
PE
3653 * src/parse-gram.y: Fix minor problems uncovered by lint.
3654 (current_lhs, current_lhs_location): Now static.
3655 (current_assoc): Remove unused variable.
3656
3657 Cleanups so that Bison-generated parsers have less lint.
3658 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
3659 Prepend /*ARGSUSED*/, for lint's sake.
3660 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
3661 definition if 'lint' is defined.
3662 (YYID): New macro (or function, if lint).
3663 All uses of /*CONSTCOND*/0 replaced by YYID(0).
3664 * data/yacc.c: Likewise.
3665 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
3666 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
3667 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
3668 is C++ only.
3669 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
3670 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
3671 Use YYID(0) rather than 0, for lint.
3672 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
3673 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
3674
f5228370
PE
36752005-12-07 Paul Eggert <eggert@cs.ucla.edu>
3676
3677 * tests/glr-regression.at
3678 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
3679 Close memory leak reported by twlevo.
3680
69ce078b
PE
36812005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
3682
6ff99711
PE
3683 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
3684 all stacks.
3685 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
3686 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3687 New test case.
3688 (Duplicated user destructor for lookahead): This test now is expected
3689 to succeed.
3690
af3412cd
PE
36912005-12-01 Paul Eggert <eggert@cs.ucla.edu>
3692
32b5b719 3693 * NEWS: Document the following change.
af3412cd
PE
3694 * data/yacc.c: Say "parser skeleton" rather than "file", since
3695 it's no longer just a file.
3696 * data/glr.c: Grant a special exception for C GLR parsers, that
3697 reads like the already-existing exception for C LALR(1) parsers.
3698 * data/glr.cc: Likewise.
3699 * data/lalr1.cc: Likewise.
3700 * data/location.cc: Likewise.
3701 * data/yacc.c: Reword the "written by" statement to clarify that
3702 it was the parser skeleton, not the entire output file.
3703 * data/glr.c: Written by Paul Hilfinger.
3704 * data/glr.cc: Written by Akim Demaille.
3705 * data/lalr1.cc: Likewise.
3706
035aa4a0
PE
37072005-11-18 Paul Eggert <eggert@cs.ucla.edu>
3708
d9963c85
PE
3709 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
3710 Fix typos in previous change that broke 'make check'.
3711 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
3712 supported in C.
3713 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
3714 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
3715 We can revert this once things settle down.
3716
035aa4a0
PE
3717 * src/conflicts.c (conflicts_print): Don't print file name twice
3718 when %expect fails because there were no conflicts.
3719 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
3720 change.
3721 * tests/conflicts.at (%expect not enough, %expect too much):
3722 (%expect with reduce conflicts): Adjust to new behavior.
3723
37242005-11-18 Akim Demaille <akim@epita.fr>
3725
3726 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
3727 errors.
3728 * NEWS: Document this.
3729 * doc/bison.texinfo (Expect Decl): Likewise.
3730
d1ff7a7c
AD
37312005-11-16 Akim Demaille <akim@epita.fr>
3732
3733 Generalize the display of semantic values and locations in traces.
3734 * data/glr.c (yy_reduce_print): Fix indices (again).
3735 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
3736 literal integers.
3737 * data/lalr1.cc (yyreduce_print): Rename as...
3738 (yy_reduce_print): this.
3739 Display values and locations.
3740 * data/yacc.c (yy_reduce_print): Likewise.
3741 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
3742 (yysymprint): Move higher to be visible from yy_reduce_print).
3743 (yyparse): Adjust.
3744 * tests/calc.at: Adjust the expected length of the traces.
3745
6de5398d
AD
37462005-11-14 Akim Demaille <akim@epita.fr>
3747
3748 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
3749 from 1 to N, while values and location start at 0.
3750 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
3751
a1373f55
AD
37522005-11-14 Akim Demaille <akim@epita.fr>
3753
3754 * data/glr.c (yy_reduce_print): Fix the $ number.
3755
613d8952
AD
37562005-11-14 Akim Demaille <akim@epita.fr>
3757
3758 "Use" parse parameters.
3759 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
3760 * data/glr.c, data/glr.cc: Use them.
3761 * data/glr.c (YYUSE): Have a C++ definition that supports
3762 non-pointer types.
3763
b2741627
AD
37642005-11-14 Akim Demaille <akim@epita.fr>
3765
3766 * data/glr.c (yyexpandGLRStack): Declare only if defined.
3767
5059b5c8
AD
37682005-11-14 Akim Demaille <akim@epita.fr>
3769
42249483
AD
3770 * data/glr.cc: New.
3771 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 3772
4626a15d
AD
37732005-11-12 Akim Demaille <akim@epita.fr>
3774
3775 Let position and location be PODs.
3776 * data/location.cc (position::initialize, location::initialize): New.
3777 (position::position, location::location): Define only if
3778 b4_location_constructors is defined.
3779 * data/lalr1.cc (b4_location_constructors): Define it for backward
3780 compatibility.
3781 * doc/bison.texinfo (Initial Action Decl): Use initialize.
3782
37832005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
3784
3785 * data/lalr1.cc: Move the body of the ctor and dtor into the
3786 parser file (instead of the header).
3787 Wrap the implementations in a "namespace yy".
3788
37892005-11-12 Akim Demaille <akim@epita.fr>
3790
3791 Have glr.c include its header file when created.
3792 * data/glr.c (b4_shared_declarations): New.
3793 Output them verbatim in the parser if !%defines, otherwise
3794 output then in the header file, and include it instead.
3795
1989d947
AD
37962005-11-11 Akim Demaille <akim@epita.fr>
3797
3798 * data/glr.c: Comment changes.
3799
38002005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
3801
3802 When yydebug, report semantic and location values for reductions.
3803 * data/glr.c (yy_reduce_print): Report the semantic values and the
3804 locations.
3805 (YY_REDUCE_PRINT): Adjust.
3806 (yyglrReduce): Use them.
3807 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
3808 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
3809 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
3810 traces.
3811
02998094
AD
38122005-11-10 Akim Demaille <akim@epita.fr>
3813
3814 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
3815 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
3816 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
3817
5210672f
PE
38182005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
3819
3820 * m4/cxx.m4, examples/Makefile.am: Don't build
3821 examples/calc++ if no C++ compiler is available. (trivial change)
3822
a8991a1d
AD
38232005-11-09 Akim Demaille <akim@epita.fr>
3824
3825 * src/scan-skel.l: Use a couple of asserts.
3826
36b5e963
AD
38272005-11-03 Akim Demaille <akim@epita.fr>
3828
3829 In some (weird) cases, the final state number is incorrect.
3830 Reported by Alexandre Duret-Lutz.
3831 * src/LR0.c (state_list_append): Remove the computation of
3832 final_state.
3833 (save_reductions): Do it here.
3834 (get_state): Alpha conversion.
3835 (generate_states): Use a for loop.
3836 * src/gram.h (item_number_is_rule_number)
3837 (item_number_is_symbol_number): New.
3838 * src/state.c: Use assert.
3839 * src/system.h: Include assert.h.
3840 * tests/sets.at (Accept): New.
3841
44e7ead1
PH
38422005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3843
3844 * data/glr.c (yyfill): Adjust comment.
36b5e963 3845 (yyresolveAction): Initialize default location properly
44e7ead1
PH
3846 for empty right-hand sides.
3847 (yydoAction): Ditto.
3848 Add comment explaining apparently dead code.
36b5e963
AD
3849 * tests/glr-regression.at
3850 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 3851 New test.
36b5e963 3852
e10a80ee
PE
38532005-10-30 Paul Eggert <eggert@cs.ucla.edu>
3854
3855 * bootstrap (cleanup_gnulib): New function. Use it to clean up
3856 gnulib when interrupted. This fixes some race conditions and
3857 works around some portability problems (one noted by Paul
3858 Hilfinger).
3859
067b32ee
AD
38602005-10-22 Akim <akim@epita.fr>
3861
3862 * Makefile.cfg: Adjust to config -> build-aux.
3863 Reported by twledo.
3864
4b367315
AD
38652005-10-21 Akim Demaille <akim@epita.fr>
3866
3867 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
3868 the %parse-params.
3869 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
3870 * data/yacc.c (b4_Pure_if): Rename as...
3871 (b4_yacc_pure_if): this.
3872 (YY_SYMBOL_PRINT, yyparse): Adjust.
3873 * doc/bison.texinfo: Formatting changes.
3874
24cc23d9
AD
38752005-10-21 Akim Demaille <akim@epita.fr>
3876
3877 Finish the transition config -> build-aux.
3878 * configure.ac, Makefile.am: Use build-aux.
3879 * config/prev-version, config/announce-gen, config/Makefile.am:
3880 Move to...
3881 * build-aux/prev-version, build-aux/announce-gen,
3882 * build-aux/Makefile.am: here.
3883
d4476375
AD
38842005-10-14 Akim Demaille <akim@epita.fr>
3885
3886 * examples/calc++/test: Use set -x only when VERBOSE.
3887
302c0aee
PE
38882005-10-13 Paul Eggert <eggert@cs.ucla.edu>
3889
3890 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
3891 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
3892
7625ec2c
AD
38932005-10-13 Akim Demaille <akim@epita.fr>
3894
3895 * src/scan-skel.l: Output the base name parts of the parser and
3896 header file names.
302c0aee 3897 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
3898 additional checks.
3899 Use this to exercise C++ outputs in subdirs.
3900 Reported by Oleg Smolsky.
3901
ba0fe3c7
PE
39022005-10-12 Paul Eggert <eggert@cs.ucla.edu>
3903
3904 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
3905 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
3906 Problem reported by John P. Hartmann.
3907 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
3908 already defined it.
3909
9b8a5ce0
AD
39102005-10-12 Akim Demaille <akim@epita.fr>
3911
3912 * src/parse-gram.y (version_check): Exit 63 to please missing
3913 (stands for "version mismatch).
3914 * tests/input.at, doc/bison.texinfo: Adjust.
3915
4f6e011e
PE
39162005-10-10 Paul Eggert <eggert@cs.ucla.edu>
3917
3918 Work around portability problems with Visual Age C compiler
3919 (xlc and xlC_r) reported by John P. Hartmann.
3920 * data/location.cc (initial_column, initial_line): Remove.
3921 All uses replaced by 0 and 1.
3922 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
3923 that xlc complains about.
3924 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 3925 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 3926 as __STDC__.
4d7aa45e
PE
3927 * data/yacc.c (YYMODERN_C): New macro, which also looks at
3928 __STDC_VERSION__. Use it everywhere instead of looking at
3929 __STDC__ and __cplusplus.
4f6e011e 3930
a1b3bf8c
AD
39312005-10-10 Akim Demaille <akim@epita.fr>
3932
3933 * examples/calc++/test: Be quiet unless VERBOSE.
3934
412e44aa
PE
39352005-10-05 Paul Eggert <eggert@cs.ucla.edu>
3936
2a4647a3
PE
3937 * data/c.m4 (yydestruct, yysymprint):
3938 Use YYUSE instead of casting to void.
3939 * data/glr.c (YYUSE): New macro.
3940 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3941 Use it instead of rolling our own.
3942 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3943 (YYCHK1):
3944 Use /*CONSTCOND*/ to suppress lint warnings.
3945 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3946 (YY_STACK_PRINT): Use 'false' not '0'.
3947 (YYUSE): New macro.
3948 (yysymprint_, yydestruct_): Use it instead of rolling our own.
3949 * data/yacc.c (YYUSE): New macro.
3950 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
3951 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
3952 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
3953
3954
412e44aa
PE
3955 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
3956 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
3957
88c6637f
PE
39582005-10-04 Paul Eggert <eggert@cs.ucla.edu>
3959
2f4f028d
PE
3960 Undo the parts of the unlocked-I/O change that substituted
3961 putc or puts for printf. This might hurt performance a bit,
3962 but some people prefer the printf style.
3963 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
3964 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
3965 All uses replaced by YYFPRINTF and YYDPRINTF.
3966 * data/yacc.c: Likewise.
3967 * lib/bitset.c (bitset_print): Likewise.
3968 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
3969 putc and puts.
3970 * lib/lbitset.c (debug_lbitset): Likewise.
3971 * src/closure.c (print_firsts, print_fderives): Likewise.
3972 * src/gram.c (grammar_dump): Likewise.
3973 * src/lalr.c (look_ahead_tokens_print): Likewise.
3974 * src/output.c (escaped_output): Likewise.
3975 (user_actions_output): Break apart two printfs.
3976 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
3977 * src/reduce.c (reduce_print): Likewise.
3978 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
3979 * src/system.h: Include unlocked-io.h rathe than stdio.h.
3980
88c6637f
PE
3981 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3982 Use assignments rather than casts-to-void to suppress
3983 unused-variable warnings. This pacifies 'lint'.
3984 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
3985 unused-variable warnings.
3986
fb32e373
JMG
39872005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3988
3989 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3990
edb8f44f
PE
39912005-10-02 Paul Eggert <eggert@cs.ucla.edu>
3992
fb9c0b33
PE
3993 Use unlocked I/O for a minor performance improvement on hosts like
3994 GNU/Linux and Solaris that support unlocked I/O. The basic idea
3995 is to use the gnlib unlocked-io module, and to prefer putc and
3996 puts to printf when either will work (since the latter doesn't
3997 come in an unlocked flavor).
3998 * bootstrap (gnulib_modules): Add unlocked-io.
3999 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
4000 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
4001 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
4002 and similarly for puts and putc and printf.
4003 * data/yacc.c: Likewise.
4004 * lib/bitset.c (bitset_print): Likewise.
4005 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
4006 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
4007 to printf.
4008 * lib/lbitset.c (debug_lbitset): Likewise.
4009 * src/closure.c (print_firsts, print_fderives): Likewise.
4010 * src/gram.c (grammar_dump): Likewise.
4011 * src/lalr.c (look_ahead_tokens_print): Likewise.
4012 * src/output.c (escaped_output): Likewise.
4013 (user_actions_output): Coalesce two printfs.
2f4f028d 4014 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
4015 * src/reduce.c (reduce_print): Likewise.
4016 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 4017 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 4018
edb8f44f
PE
4019 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
4020 this confuses xgettext.
4021
b50d2359
AD
40222005-10-02 Akim Demaille <akim@epita.fr>
4023
4024 * bootstrap (gnulib_modules): Add strverscmp.
4025 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
4026 * m4/.cvsignore: Add strverscmp.m4.
4027 * src/parse-gram.y (%require): New token, new rule.
4028 (version_check): New.
4029 * src/scan-gram.l (%require): Adjust.
4030 * tests/input.at (AT_REQUIRE): New.
4031 Use it.
4032 * doc/bison.texinfo (Require Decl): New.
4033 (Calc++ Parser): Use %require.
4034
21667f64
AD
40352005-10-02 Akim Demaille <akim@epita.fr>
4036
4037 * data/location.cc: New.
4038
2b81e969
AD
40392005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
4040 Akim Demaille <akim@epita.fr>
4041
4042 Make sure -odir/foo.cc creates dir/location.hh etc.
4043 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
4044 (spec_file_prefix, spec_verbose_file, spec_graph_file)
4045 (spec_defines_file): Now const.
4046 (dir_prefix): New.
4047 (short_base_name): Remove.
4048 * src/files.c: Adjust.
4049 (dirname.h): Include.
4050 (base_name): Don't prototype it.
4051 (finput): Remove, duplicates gram_in.
4052 (full_base_name, short_base_name): Replace by...
4053 (all_but_ext, all_but_tab_ext): these.
4054 (compute_base_names): Rename as...
4055 (compute_file_name_parts): this.
4056 Update to compute the new variables, including dir_prefix.
4057 Adjust dependencies.
4058 * src/output.c (prepare): Output them.
4059 * src/reader.c: Adjust to use gram_in, not finput.
4060 * src/scan-skel.l (@dir_prefix@): New.
4061
ad6a9b97
JMG
40622005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4063
4064 * lib/subpipe.c: New function end_of_output_subpipe() added
4065 to allow support for non-posix systems. This is a no-op function
4066 for posix systems.
4067
4068 * lib/subpipe.h: New function end_of_output_subpipe() added
4069 to allow support for non-posix systems. This is a no-op function
4070 for posix systems.
4071
4072 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
4073 handle the lack of pipe/fork functionality on non-posix systems.
4074
4075 * djgpp/Makefile.maint: DJGPP specific file.
4076
4077 * djgpp/README.in: DJGPP specific file.
4078
4079 * djgpp/config.bat: DJGPP specific configuration file.
4080
4081 * djgpp/config.sed: DJGPP specific configuration file.
4082
4083 * djgpp/config.site: DJGPP specific configuration file.
4084
4085 * djgpp/config_h.sed: DJGPP specific configuration file.
4086
4087 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
4088
4089 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
4090
fc695704
AD
40912005-10-02 Akim Demaille <akim@epita.fr>
4092
4093 * data/location.cc: New, extract from...
4094 * data/lalr1.cc: here.
4095 (location.hh): Include it after the user prologue, in case the
4096 filename type is defined by the user.
4097 Forward declation location and position before the pre-prologue.
4098 (yyresult_): Rename as...
4099 (yyresult): this, it's a local variable, not an attribute.
4100 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
4101
41022005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
4103
4104 * examples/extexi: Restore the #line generation.
4105
fb9712a9
AD
41062005-09-30 Akim Demaille <akim@epita.fr>,
4107 Alexandre Duret-Lutz <adl@gnu.org>
4108
4109 Move the token type and YYSTYPE in the parser class.
4110 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
4111 (parser::token): New, from the moved free definition of tokens.
4112 (parser::semantic_value): Now a full definition instead of an
4113 indirection to YYSTYPE.
4114 (b4_post_prologue): No longer included in the header file, but
4115 in the implementation file.
4116 * doc/bison.texi (C+ Language Interface): Update.
4117 * src/parse-gram.y: Support unary %define.
4118 * tests/actions.at: Define global_tokens_and_yystype for backward
4119 compatibility until we update the tests.
4120 * tests/calc.at: Idem.
4121 (first_line, first_column, last_line, last_column): Define for lalr1.cc
4122 to simplify the code.
4123
55f0c7b1
PE
41242005-09-29 Paul Eggert <eggert@cs.ucla.edu>
4125
4126 Port to SunOS 4.1.4, which lacks strtoul and strerror.
4127 Ah, the good old days! Problem reported by Peter Klein.
4128 * bootstrap (gnulib_modules): Add strerror, strtoul.
4129 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
4130 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
4131
fb9712a9 41322005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
4133
4134 * data/c.m4 (b4_error_verbose_if): New.
4135 * data/lalr1.cc: Use it.
4136 (YYERROR_VERBOSE_IF): Remove.
4137 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
4138 parser members, replaced by...
4139 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
4140 local variables.
4141 (yysyntax_error_): Takes the state number as argument.
4142 (yyreduce_print_): Use the argument yyrule, not the former
4143 attribute yyn_.
4144
8a6f72f3
PE
41452005-09-26 Paul Eggert <eggert@cs.ucla.edu>
4146
4147 * bootstrap (gnulib_modules): Add verify.
4148 * lib/.cvsignore: Add verify.h.
4149 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
4150 * src/system.h (verify): Remove.
4151 Include verify.h instead.
4152 * src/tables.c (tables_generate): Use new API for 'verify'.
4153
0d50976f
PE
41542005-09-21 Paul Eggert <eggert@cs.ucla.edu>
4155
ebc3737e
PE
4156 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
4157 local variables whose names begin with 'yy'.
4158 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
4159 Trivial changes from Joel E. Denny.
4160
0d50976f
PE
4161 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
4162 it itself.
4163 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
4164 don't use alloca any more.
4165
4166 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
4167 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 4168 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
4169 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
4170 to match yacc.c, to test more hosts.
4171
a05b79df
PE
41722005-09-20 Paul Eggert <eggert@cs.ucla.edu>
4173
55289366
PE
4174 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
4175 doesn't affect behavior.
4176 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
4177 Solaris, AIX, MSC.
4178 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
4179 This works a bit better with glibc, if user code has already included
4180 stdlib.h.
4181 * doc/bison.texinfo (Bison Parser): Document that users can't
4182 arbitrarily use malloc and free for other purposes. Document
4183 that <alloca.h> and <malloc.h> might be included.
4184 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
4185 user must declare alloca.
4186
a05b79df
PE
4187 * HACKING (release): Forwarn the Translation Project about
4188 stable releses.
4189
3ab2ca22
AD
41902005-09-20 Akim Demaille <akim@epita.fr>
4191
4192 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
4193
a9739e7c
PE
41942005-09-19 Paul Eggert <eggert@cs.ucla.edu>
4195
a702593e
PE
4196 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
4197 (YYSTACK_ALLOC_MAXIMUM): Use it.
4198 (yysyntax_error): New function.
4199 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
4200 multiple syntax errors are reported, and alloca is being used.
4201 Instead, reallocate buffers twice as big each time, so that
4202 we waste at most half the allocated memory. Start with a small
4203 (128-byte) buffer that will suffice in most cases anyway.
4204 Use yysyntax_error to do most of the work.
4205
4206 * doc/bison.texinfo (Error Reporting, Table of Symbols):
4207 yynerrs is the number of errors reported, not the number of
4208 errors encountered.
4209
a9739e7c
PE
4210 * tests/glr-regression.at (Duplicated user destructor for lookahead):
4211 Mark it as expected to fail.
4212 Cast result of malloc; problem reported by twlevo@xs4all.nl.
4213 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
4214 Don't start user-code symbols with "yy", to avoid name space problems.
4215
f479c6c6
AD
42162005-09-19 Akim Demaille <akim@epita.fr>
4217
4218 Remove the traits, failed experiment.
4219 It never proved useful, and anyway because of the current
4220 definition, it was not possible to have several specialization of
4221 this traits, making it useless.
4222 * data/lalr1.cc (yy:traits): Remove.
4223 Inline its definitions in the parser class.
4224
e2586f82
AD
42252005-09-19 Akim Demaille <akim@epita.fr>
4226
4227 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
4228 least Mac OSX with a /usr/local install of gettext.
4229
2e8cf949
AD
42302005-09-19 Akim Demaille <akim@epita.fr>
4231
4232 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
4233 and yytoken for similarity with the other skeletons.
4234
c7fb0b90
AD
42352005-09-19 Akim Demaille <akim@epita.fr>
4236
4e26c69e 4237 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 4238
1bd0deda
PE
42392005-09-16 Paul Eggert <eggert@cs.ucla.edu>
4240
4241 * NEWS: Version 2.1.
4242
4243 * NEWS: Remove notice of yytname change, since it was never in an
4244 official release.
4245 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
4246 diagnostic.
4247 * src/output.c (prepare): Likewise.
4248 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
4249 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
4250 is not defined. This is an awful hack, but it's enough for now.
4251 All callers changed.
4252 * tests/glr-regression-at (make_value): Args are const pointers now,
4253 to avoid GCC warning.
4254 (Duplicated user destructor for lookahead): New test. Currently
4255 skipped. It fails on my host but I'm not sure it'll always fail.
4256
42572005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
4258
4259 * src/symtab.h (struct symbol): Declare the printer and destructor
4260 as const, to avoid accidental calls to free.
4261 (symbol_destructor_set, symbol_printer_set): Adjust.
4262 * src/symtab.c: Adjust.
4263
1bd0deda 42642005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
4265
4266 * data/c.m4 (b4_token_enums): New.
4267 (b4_token_defines): Rename as...
4268 (b4_token_enums_defines): this.
4269 (b4_token_defines): New, output only the #defines.
4270 * data/yacc.c, data/glr.c: Adjust.
4271 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
4272 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
4273 as default values.
4274
dbcdae2d
AD
42752005-09-16 Akim Demaille <akim@epita.fr>
4276
4277 * data/lalr1.cc (yylex_): Remove, inline its code.
4278 (yyreport_syntax_error_): Remove, replaced by...
4279 (yysyntax_error_): this which returns a string and leaves to the
4280 caller the call to the users' error function.
4281 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
4282 Move from members of the parser object...
4283 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
4284 to local variables of the parse function.
4285
70d8f291
AD
42862005-09-16 Akim Demaille <akim@epita.fr>
4287
4288 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
4289 since it's in Bison's name space.
4290
b47dbebe
PE
42912005-09-15 Paul Eggert <eggert@cs.ucla.edu>
4292
ae199bf1
PE
4293 * data/glr.c (yyresolveValue): Add default case to pacify
4294 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
4295
b47dbebe
PE
4296 * NEWS: Document when yyparse started to return 2.
4297 * doc/bison.texinfo (Parser Function): Document when yyparse
4298 returns 2.
4299
4300 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
4301 (b4_filename_type): Renamed back from b4_file_name_type. All uses
4302 changed.
4303 (class position): file_name -> filename (reverting). All uses changed.
4304
43052005-09-14 Paul Eggert <eggert@cs.ucla.edu>
4306
4307 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
4308 do anything if $@ exists. This reverts part of the 2005-07-07
4309 patch.
4310
00292f66
PE
43112005-09-11 Paul Eggert <eggert@cs.ucla.edu>
4312
4313 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
4314 contains obsolete information and isn't worth distributing as a
4315 separate file anyway.
4316 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
4317 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
4318 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
4319 (yyparse): Abort if user code uses longjmp to throw an unexpected
4320 value.
4321
a420f962
PE
43222005-09-09 Paul Eggert <eggert@cs.ucla.edu>
4323
00292f66
PE
4324 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
4325 Suggested by twlevo@xs4all.nl.
4326
127287e9
PE
4327 * data/glr.c (YYCHK1): Do not assume YYE is in range.
4328 This avoids a diagnostic from gcc -Wswitch-enum.
4329 Problem reported by twlevo@xs4all.nl.
4330
a420f962
PE
4331 * doc/bison.texinfo: Don't use "filename", as per GNU coding
4332 standards. Use "file name" or "file" or "name", depending on
4333 the context.
4334 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
4335 not to hack/foo.tab.c.
4336 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
4337 * data/glr.c: b4_filename -> b4_file_name.
4338 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
4339 All uses changed.
4340 (class position): filename -> file_name. All uses changed.
4341 * data/yacc.c: b4_filename -> b4_file_name.
4342 * lib/bitset.h: filename -> file_name in local vars.
4343 * lib/bitset_stats.c: Likewise.
4344 * src/files.c: Likewise.
4345 * src/scan-skel.l ("@output ".*\n): Likewise.
4346 * src/files.c (file_name_split): Renamed from filename_split.
4347 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
4348
43492005-09-08 Paul Eggert <eggert@cs.ucla.edu>
4350
4351 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
4352 to accommodate latest gnulib.
4353
4354 * tests/glr-regression.at (Duplicate representation of merged trees):
4355 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
4356
4357 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
4358 needed.
4359
42a6501d
PE
43602005-08-26 Paul Eggert <eggert@cs.ucla.edu>
4361
4362 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
4363 All uses changed. Invoke user destructor after an error during a
4364 split parse (trivial change from Joel E. Denny).
4365
4366 * tests/glr-regression.at
4367 (User destructor after an error during a split parse): New test case.
4368 Problem reported by Joel E. Denny in:
4369 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
4370
ef9a1faf
PE
43712005-08-25 Paul Eggert <eggert@cs.ucla.edu>
4372
5b4aaf78
PE
4373 * README-cvs: Give URLs for recommended tools.
4374 Mention Gzip version problem, and bootstrapping issues.
4375 Remove troubleshooting section, as it's somewhat obsolete.
4376
b5240ba5
PE
4377 * bootstrap (no_cache): New var, to accommodate different wget
4378 variants. Use it instead of '-C off'. Problem reported by
4379 twlevo@xs4all.nl.
4380
ef9a1faf
PE
4381 * data/glr.c (yydestroyStackItem): New function.
4382 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
4383 debugging information. Problem reported by Joel E. Denny.
4384
e6efa9da
AD
43852005-08-25 Akim Demaille <akim@epita.fr>
4386
4387 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
4388
adc90f13
PE
43892005-08-24 Paul Eggert <eggert@cs.ucla.edu>
4390
4391 * data/glr.c (yyrecoverSyntaxError, yyreturn):
4392 Don't invoke destructor on unresolved entries.
4393 * tests/glr-regression.at
4394 (User destructor for unresolved GLR semantic value): New test case.
4395 Problem reported by Joel E. Denny in:
4396 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
4397
f9315de5
PE
43982005-08-21 Paul Eggert <eggert@cs.ucla.edu>
4399
15d29c1f
PE
4400 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
4401 Add strnlen.c.
4402 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
4403 lib-prefix.m4, po.m4.
4404
dd5f2af2
PE
4405 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
4406 in yydestruct diagnostic, since it might not be an error.
4407 Problem reported by Joel Denny near end of
4408 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 4409 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
4410 * data/yacc.c (yyreturn): Likewise.
4411 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
4412
4413 * src/files.c: Remove obsolete FIXME comment.
4414
4415 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
4416 with the other templates, and to fix bogus run-on messages such
4417 as the one reported at the end of
4418 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
4419 All callers changed to avoid the newline.
4420 (yyprocessOneStack): Output two lines rather than one, to accommodate
4421 the above change. This changes the debug output format slightly.
4422
f9315de5
PE
4423 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
4424 reported by Joel E. Denny in
4425 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
4426 (trivial change).
4427 * tests/glr-regression.at (Duplicate representation of merged trees):
4428 New test, from Joel E. Denny in:
4429 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
4430 * THANKS: Add Joel E. Denny.
4431
4432 * configure.ac (AC_INIT): Bump to 2.0c.
4433
04098407
PE
44342005-07-24 Paul Eggert <eggert@cs.ucla.edu>
4435
4436 * NEWS: Version 2.0b.
4437
ca5d2013
PE
4438 * Makefile.am (SUBDIRS): Put examples before tests, so that
4439 "make check" doesn't finish with "All 1 tests passed".
4440
3d54b576
PE
4441 * tests/regression.at (Token definitions): Don't rely on
4442 AT_PARSER_CHECK for data that contains backslashes. It currently
4443 uses 'echo', and 'echo' isn't portable if its argument contains
4444 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
4445 that the byte '\0xff' is not printable in the C locale; it is,
4446 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
4447 not printable, so use '\0x81' to test.
4448
d53ae497
PE
4449 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
4450 version of GCC, since the macro is used with non-GCC compilers.
4451
fc01665e
PE
4452 Fix core dump reported by Pablo De Napoli in
4453 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
4454 * tests/regression.at (Invalid inputs with {}): New test.
4455 * src/parse-gram.y (token_name): Translate type before using
4456 it as an index.
4457
04098407
PE
4458 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
4459 the user's name space. All uses changed to __attribute__
4460 ((__unused__)).
4461 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
4462 Add __attribute__ ((__noreturn__)).
4463
4464 * etc/clcommit: Remove. We weren't using it, and it failed
4465 "make maintainer-distcheck".
4466 * Makefile.maint: Merge from coreutils.
4467 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
4468 (syntax-check-rules): Change list of rules as described below.
4469 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
4470 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
4471 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
4472 (sc_trailing_space): New rules.
4473 (sc_xalloc_h_in_src): Remove.
4474 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
4475 (sc_space_tab, sc_error_exit_success, sc_changelog):
4476 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
4477 (makefile-check, po-check, author_mark_check):
4478 (makefile_path_separator_check, copyright-check):
4479 Use grep -n, to make it easier to find violations.
4480 Use CVS_LIST and CVS_LIST_EXCEPT.
4481 (header_regexp, h_re): Remove.
4482 (dd_c): New macro.
4483 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
4484 (my-distcheck): Use more-modern GCC flags.
4485 (signatures, %.asc): Remove.
4486 (rel-files, announcement): Remove signatures.
4487 Restore old updating code, even though we don't use it, so
4488 that we're the same as coreutils.
4489 (alpha, beta, major): Depend on news-date-check.
4490 Make the upload commands.
4491
4492 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
4493 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
4494 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
4495 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
4496 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
4497 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
4498 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
4499 * tests/sets.at: Likewise.
4500
4501 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
4502 we comment out the Autoconf version number.
4503 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
4504 it's error-prone and "make maintainer-distcheck" rejects it.
4505
4506 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
4507 Indent calls to "error" to pacify "make maintainer-distcheck",
4508 when the calls are not intended to be translated.
4509 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
4510
4511 * src/Makefile.am (DEFS): Use +=, to pacify
4512 "make maintainer-distcheck".
4513 (bison_SOURCES): Add scan-skel.h.
4514 (sc_tight_scope): New rule, from coreutils.
4515
4516 * src/files.c (src_extension, header_extension):
4517 Now static, not extern.
4518 * src/getargs.c (short_options): Likewise.
4519 * src/muscle_tab.c (muscle_table): Likewise.
4520 * src/parse-gram.y (current_class, current_type, current_prec):
4521 Likewise.
4522 * src/reader.c (grammar_end, previous_rule_end): Likewise.
4523 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
4524 * src/main.c (main): Cast bindtextdomain and textdomain calls to
4525 void, to avoid warning when NLS is disabled.
4526 * src/output.c: Include scan-skel.h.
4527 (scan_skel): Remove decl, since scan-skel.h does this.
4528 (output_skeleton):
4529 Indent calls to "error" to pacify "make maintainer-distcheck".
4530 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
4531 * src/reader.h (gram_end, gram_lineno): New decls to pacify
4532 "make maintainer-distcheck".
4533 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
4534 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
4535 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
4536 (skel_lex_destroy, scan_skel): Move these decls to...
4537 * src/scan-skel.h: New file.
4538 * src/uniqstr.c (uniqstr_assert):
4539 Indent calls to "error" to pacify "make maintainer-distcheck".
4540
4541 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
4542 not @VAR@.
4543
4544 * tests/torture.at: Revamp to avoid misuse of atoi that
4545 "make maintainer-distcheck" complained about.
4546
4547 * examples/extexi (message): Don't print a message more than once,
4548 and omit line-number decoration that makes Emacs compile think
4549 that informative messages are worth worrying about.
4550
45512005-07-22 Paul Eggert <eggert@cs.ucla.edu>
4552
4553 * configure.ac: Update version number.
4554
4555 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
4556 accidentally.
4557 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
4558 autogenerated by the maintainer.
4559 * examples/calc++/.cvsignore: Add *.yy.
4560
4561 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
4562 * lib/bitset_stats.c (bitset_stats_init): Likewise.
4563 * lib/bitsetv.c (bitsetv_alloc): Likewise.
4564
4565 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
4566
4567 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
4568 from maintainer-distcheck about casting the argument of 'free'.
4569
4570 * NEWS: Mention recent yytname changes.
4571 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
4572
4573 * bootstrap: For translations that have not yet been upgraded to
4574 the new runtime-po domain, prime the pump by extracting the
4575 relevant strings from the obsolete translations. This code can be
4576 removed once the bison-runtime domain has been translated by each
4577 team.
4578
4579 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
4580 now that token names are already quoted.
4581
4582 Fix problem reported by Anthony Heading.
4583 * data/glr.c (YYTOKEN_TABLE): New macro.
4584 (yytname): Define if YYTOKEN_TABLE.
4585 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
4586 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
4587 (YYERROR_VERBOSE): Define the same way the other skeletons do.
4588 * src/output.c (prepare_symbols): Output token_table_flag.
4589
0ffda363
PE
45902005-07-21 Paul Eggert <eggert@cs.ucla.edu>
4591
4592 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
4593 again if the first call fails.
4594
4595 * data/glr.c (yytnamerr): New function.
4596 (yyreportSyntaxError): Use it to dequote most string literals.
4597 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
4598 with other skeletons. All uses changed.
4599 (yytnameerr_): New function.
4600 (yyreport_syntax_error): Use it to dequote most string literals.
4601 * data/yacc.c (yytnamerr): New function.
4602 (yyerrlab): Use it to decode most string literals.
4603 * doc/bison.texinfo (Decl Summary, Calling Convention):
4604 Clarify quoting convention of yytname.
4605 * src/output.c (prepare_symbols): Quote all names. This undoes
4606 the 2005-04-17 change, which is now accomplished (mostly) via
4607 changes in the parsers as described above.
4608 * tests/regression.at (Token definitions, Web2c Actions):
4609 Undo most 2005-04-17 change here, too.
4610
46112005-07-20 Paul Eggert <eggert@cs.ucla.edu>
4612
4613 Fix more problems reported by twlevo@xs4all.nl.
4614 * tests/cxx-type.at: Don't pipe output of ./types through sed to
4615 remove trailing spaces. This loses the exit status of ./types,
4616 and isn't needed since ./types shouldn't be emitting trailing
4617 spaces.
4618 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
4619 as the stack isn't valid in that case.
4620
4621 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4622 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4623 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4624 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
4625 is used.
4626 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
4627 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
4628 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
4629 Likewise.
4630
4631 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
4632 overly-picky compilers that reject 'char *foo = "bar";'.
4633
4634 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
4635 to FILE * parameter, not to stderr. This fixes a typo introduced
4636 in the 2005-07-12 change.
4637
4638 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
4639 warnings from GCC 4.
4640
4641 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
4642 (yyglrShiftDefer, yysplitStack):
4643 Remove unused parameters b4_pure_formals. All uses changed.
4644 (yyglrShift): Remove unused parameters b4_user_formals.
4645 All uses changed.
4646 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
4647
6100a9aa
PE
46482005-07-18 Paul Eggert <eggert@cs.ucla.edu>
4649
258b75ca
PE
4650 Destructor cleanups and regularization among the three skeletons.
4651 * NEWS: Document the behavior changes.
4652 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
4653 stack before failing, as the cleanup code will do it for us now.
4654 * data/lalr1.cc (yyerrlab): Likewise.
4655 * data/glr.c (yyparse): Pop everything off the stack before
4656 freeing it, so that destructors get called properly.
4657 * data/lalr1.cc (yyreturn): Likewise.
4658 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
4659 This is more consistent.
4660 * doc/bison.texinfo (Destructor Decl): Mention more reasons
4661 why destructors might be called. 1.875 -> 2.1.
4662 (Destructor Decl, Decl Summary, Table of Symbols):
4663 Some English-language cleanups for %destructor.
4664 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
4665 Add output line for destructor of start symbol.
4666 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
4667 because of that same extra output line.
4668
1a059451
PE
4669 * NEWS: Document minor wording changes in diagnostics of
4670 Bison-generated parsers.
4671 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
4672 Remove unused formals. All uses changed.
4673 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
4674 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
4675 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
4676 Rename yyoverflowab to yyexhaustedlab.
4677 When memory exhaustion occurs during syntax-error reporting,
4678 report it separately rather than in a single diagnostic; this
4679 eases translation.
4680 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
4681 (Memory Exhausted): Renamed from Parser Stack Overflow.
4682 Revamp wording slightly to prefer "memory exhaustion".
4683 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
4684
97460c78
PE
4685 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
4686
30757c8c
PE
4687 Add i18n support to the GLR skeleton. Partially fix the C++
4688 skeleton; a C++ expert needs to finish this. Remove debugging
4689 msgids; there's little point to having them translated, since they
4690 can be understood only by someone who can read the
4691 (English-language) source code.
4692
4693 Generate runtime-po/bison-runtime.pot automatically, so that we
4694 don't have to worry about garbage getting in that file. We'll
4695 make sure after the next official release that old msgids don't
4696 get lost. See
4697 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
4698
4699 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
4700 Now auto-generated.
4701 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
4702 Fix typos in explanations of the runtime file.
4703 * bootstrap: Change gettext keyword from YYI18N to YY_.
4704 Use standard Makefile.in.in in runtime-po, since we'll arrange
4705 for backward-compatible bison-runtime.po files in a different way.
4706 * data/glr.c (YY_): New macro, from yacc.c.
4707 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
4708 Translate messages intended for users.
4709 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
4710 the wording in the other skeletons. We don't know that the memory
4711 is virtual.
4712 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
4713 Use same method that yacc.c uses.
4714 Don't translate debugging messages.
4715 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
4716 it doesn't work (yet), and requires C++ expertise to fix.
4717 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
4718 Move defn to a more logical place, to be consistent with other
4719 skeletons.
4720 Don't translate debugging messages.
4721 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
4722 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
4723 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
4724 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
4725
ac8c5689
PE
4726 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
4727 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
4728 void, not int.
4729 * tests/glr-regression.at (Badly Collapsed GLR States):
4730 Likewise.
4731 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4732 yylex should return 0 at EOF rather than aborting.
4733
6100a9aa
PE
4734 Improve tests for stack overflow in GLR parser.
4735 Problem reported by twlevo@xs4all.nl.
4736 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
4737 All uses removed.
4738 (yyStackOverflow): Just longjmp, but with value 2 so that caller
4739 can handle the problem.
4740 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
4741 (yyparse): New local variable yyresult to record the result.
4742 Use result of setjmp to set it, rather than storing itinto
4743 struct.
4744 (yyDone): Remove label.
4745 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
4746 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
4747 if YYABORT is used).
4748 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
4749 yyparse status; put status > 1 into diagnostic.
4750 Check that status==2 works.
4751 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
4752 Use exit status 3 for failure to open (which shouldn't happen).
4753
15f40952
PE
47542005-07-17 Paul Eggert <eggert@cs.ucla.edu>
4755
67fd79c4
PE
4756 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
4757 1 on syntax error; just let yyparse do its thing.
4758 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
4759 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
4760 (Exploding the Stack Size with Alloca):
4761 (Exploding the Stack Size with Malloc):
4762 Expect exit status 2, not 1, since the parser is supposed to blow
4763 its stack. Problem reported by twlevo@xs4all.nl.
4764
15f40952
PE
4765 * data/glr.c (yyparse): Don't assume that the initial calls
4766 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
4767 Print a stack-overflow message and fail instead.
4768 Initialize the line-number information before creating the stack,
4769 so that the stack-overflow message can report line zero safely.
4770
f32c66b5
PE
47712005-07-14 Paul Eggert <eggert@cs.ucla.edu>
4772
a22ff96f 4773 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
4774 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
4775 (yyuserMerge): Provide a default case if b4_mergers is empty.
4776 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
4777 * tests/glr-regression.at
4778 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 4779 Add casts to pacify C++ compilers.
1beb0b24
PE
4780 * tests/glr-regression.at (Improper merging of GLR delayed action
4781 sets): Declare yylex before using it.
f32c66b5 4782 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
4783 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
4784 test for valgrind; valgrind is independent of g++.
4785 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
4786 for compatibility with POSIX 1003.1-2001 (if running coreutils).
4787 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
4788 Use a destructor, so that we can expand the stack. Change
4789 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 4790
d741bd1b
PE
47912005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4792
4793 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
4794 a valgrind failure. Problem reported by twlevo@xs4all.nl.
4795
0410a6e0
PE
47962005-07-13 Paul Eggert <eggert@cs.ucla.edu>
4797
4798 * PACKAGING: New file, suggested by Bruno Haible and taken from
4799 similar wording in gettext's PACKAGING file.
4800 * NEWS: Mention PACKAGING.
4801 * Makefile.am (EXTRA_DIST): Add PACKAGING.
4802
f7ab6a50
PE
48032005-07-12 Paul Eggert <eggert@cs.ucla.edu>
4804
baf785db 4805 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
4806 * bootstrap: Get runtime translations into runtime-po.
4807 Create runtime-po files automatically, if possible.
4808 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
4809 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
4810 does not infringe on the user's name space.
4811 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
4812 * doc/bison.texinfo (Internationalization): Revamp the English
4813 and Texinfo syntax a bit, to try to make it clearer.
4814 (Bison Options, Option Cross Key): Mention --print-localedir.
4815 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
4816 YYENABLE_NLS. Quote a bit more.
4817 * runtime-po/.cvsignore: New file.
4818 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
4819 * runtime-po/Rules-quot: Remove; now created by bootstrap.
4820 * runtime-po/quot.sed: Likewise.
4821 * runtime-po/boldquot.sed: Likewise.
4822 * runtime-po/en@quot.header: Likewise.
4823 * runtime-po/en@boldquot.header: Likewise.
4824 * runtime-po/insert-header.sin: Likewise.
4825 * runtime-po/remove-potcdate.sin: Likewise.
4826 * runtime-po/Makevars: Likewise.
4827 * runtime-po/LINGUAS: Likewise.
4828 * runtime-po/de.po: Likewise; we will rely on the translation project
4829 to maintain this, so "bootstrap" should get it.
0410a6e0 4830 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
4831 its value.
4832 * src/main.c (main): Bind the bison-runtime domain, too.
4833
48342005-07-12 Bruno Haible <bruno@clisp.org>
4835
4836 * data/yacc.c: Include <libintl.h> when NLS is enabled.
4837 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
4838 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
4839 * runtime-po: New directory.
4840 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
4841 $(DOMAIN).pot-update rule, so that old messages are never dropped.
4842 * runtime-po/Rules-quot: New file, copied from po/.
4843 * runtime-po/quot.sed: Likewise.
4844 * runtime-po/boldquot.sed: Likewise.
4845 * runtime-po/en@quot.header: Likewise.
4846 * runtime-po/en@boldquot.header: Likewise.
4847 * runtime-po/insert-header.sin: Likewise.
4848 * runtime-po/remove-potcdate.sin: Likewise.
4849 * runtime-po/Makevars: New file.
4850 * runtime-po/POTFILES.in: New file.
4851 * runtime-po/LINGUAS: New file.
4852 * runtime-po/bison-runtime.pot: New file.
4853 * runtime-po/de.po: New file.
4854 * m4/bison.m4: New file.
4855 * Makefile.am (SUBDIRS): Add runtime-po.
4856 (aclocaldir, aclocal_DATA): New variables.
4857 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
4858 Define aclocaldir.
4859 * src/getargs.c (usage): Document --print-localedir option.
4860 (PRINT_LOCALEDIR_OPTION): New enum item.
4861 (long_options): Add --print-localedir option.
4862 (getargs): Handle --print-localedir option.
4863 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
4864 (Internationalization): New section.
4865
22dda0f0
AD
48662005-07-12 Akim Demaille <akim@epita.fr>
4867
4868 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
4869 for consistency with the rest of the code.
4870 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
4871 Add separators.
4872
82b248ad
AD
48732005-07-12 Akim Demaille <akim@epita.fr>
4874
4875 * src/parse-gram.y: Use %printer instead of YYPRINT.
4876
fa0e9314
AD
48772005-07-12 Akim Demaille <akim@epita.fr>
4878
867a3e00
AD
4879 * src/symtab.h, src/symtab.c (symbol_print): New.
4880 * src/symlist.h, src/symlist.c (symbol_list_print): New.
4881 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
4882
48832005-07-12 Akim Demaille <akim@epita.fr>
4884
4885 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
4886 b4_at_dollar and b4_dollar_dollar.
4887
e054b190
PE
48882005-07-11 Paul Eggert <eggert@cs.ucla.edu>
4889
4890 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
4891 and Pennello's paper.
4892
34160ec4
PE
48932005-07-09 Paul Eggert <eggert@cs.ucla.edu>
4894
407d4a75
PE
4895 * data/yacc.c (yyparse): Undo previous patch. Instead,
4896 set yylsp[0] and yyvsp[0] only if the initial action
4897 sets yylloc and yylval, respectively.
4898
34160ec4
PE
4899 * data/yacc.c (yyparse): In the initial action, set
4900 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
4901 This avoids the use of undefined variables if the initial
4902 action does not set yylloc and/or yylval.
4903
c3d5a4a7
PE
49042005-07-07 Paul Eggert <eggert@cs.ucla.edu>
4905
b34d96c1
PE
4906 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
4907 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
4908 Remove from CVS. These files are automatically generated.
4909 * examples/extexi: Clarify that this file is now part of Bison,
4910 not GNU M4, and that it works with any POSIX-compatible Awk.
4911 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
4912 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
4913 so that we also get calc++-parser.yy. Geneate it.
4914 Use $(AWK), not gawk, since any conforming Awk will do.
4915 Put comment before action, since older 'make' can't handle comment
4916 in action.
4917 $(BUILT_SOURCES): List all built sources, not just some of them.
4918 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
4919 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
4920 $($(calc_sources_generated)): Remove unnecessary test for existence
4921 of target. (This had a shell syntax error anyway; a stray "x".)
4922 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
4923 calc++-parser.yy.
4924 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
4925
c3d5a4a7
PE
4926 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
4927 implied by the other modules.
4928
828c373b
AD
49292005-07-06 Akim Demaille <akim@epita.fr>
4930
4931 Bind examples/calc++ to the package.
4932 * examples/calc++/Makefile: Remove, replaced by...
4933 * examples/calc++/Makefile.am: ... this new file.
4934 * examples/calc++/test: Remove input.
4935 * examples/calc++/compile: Remove.
4936 * examples/Makefile.am: New.
4937 * configure.ac, Makefile.am: Adjust.
4938 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
4939
63cb01d6
PE
49402005-07-05 Paul Eggert <eggert@cs.ucla.edu>
4941
fd2df2ed
PE
4942 * data/glr.c (yyFail): Drastically simplify; since the format argument
4943 never had any % directives, we can simply pass it to yyerror.
4944 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
4945 be modified later, as that is the usual style in glr.c.
4946 Problems reported by Paul Hilfinger.
4947
63cb01d6
PE
4948 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
4949 and size overflow errors.
4950 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
4951 in case the user prolog sets feature-test macros like _GNU_SOURCE.
4952 (YYSIZEMAX): New macro.
4953 (yystpcpy): New function, taken from yacc.c.
4954 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
4955 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
4956 so that we don't have to maintain their signatures.
4957 (yyFail): Check for buffer overflow, by using vsnprintf rather
4958 than vsprintf. Allocate a bigger buffer if possible.
4959 Report an error if buffer allocation fails.
4960 (yyStackOverflow): New function.
4961 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
4962 the initialization was successful. It might fail if storage was
4963 exhausted.
4964 (yyexpandGLRStack): Add more checks for storage allocation failure.
4965 Use yyStackOverflow to report failures.
4966 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
4967 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
4968 Don't assume stack number fits in int.
4969 (yysplitStack): Check for storage allocation failure.
4970 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
4971 can print diagnostics on storage allocation failure. All callers
4972 changed.
4973 (yyresolveValue): Use yybool for boolean.
4974 (yyreportSyntaxError): Check for size-calculation overflow.
4975 This code is taken from yacc.c.
4976 (yyparse): Check for storage allocation errors when allocating
4977 the initial stack.
4978
1c59e0a1
AD
49792005-07-05 Akim Demaille <akim@epita.fr>
4980
4981 Extract calc++ from the documentation.
4982 * doc/bison.texinfo (Calc++): Add the extraction marks.
4983 * examples/extexi: New, from the aborted GNU Programming 2E.
4984 Separate the different paragraph of a file with empty lines.
4985 * examples/Makefile: Use it to extract the whole calc++ example.
4986
8a0adb01
AD
49872005-06-24 Akim Demaille <akim@epita.fr>
4988
4989 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
4990 class typedefs.
4991
12545799
AD
49922005-06-22 Akim Demaille <akim@epita.fr>
4993
4994 * doc/bison.texinfo (C++ Language Interface): First stab.
4995 (C++ Parsers): Remove.
4996
99be0235
AD
49972005-06-22 Akim Demaille <akim@epita.fr>
4998
4999 * data/lalr1.cc (yylex_): Honor %lex-param.
5000
0ffd4fd1
AD
50012005-06-22 Akim Demaille <akim@epita.fr>
5002
5003 Start a set of simple examples.
5004 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
5005 * examples/calc++/calc++-driver.hh,
5006 * examples/calc++/calc++-parser.yy,
5007 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
5008 * examples/calc++/compile, examples/calc++/test: New.
5009
0925ebb4
PE
50102005-06-09 Paul Eggert <eggert@cs.ucla.edu>
5011
5012 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
5013 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
5014 which stems from the 2005-05-27 patch.
5015
43d3b664
PH
50162005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5017
5018 * data/glr.c: Modify treatment of unused parameters to permit use
5019 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
5020
3062864d
PE
50212005-05-30 Paul Eggert <eggert@cs.ucla.edu>
5022
5023 Fix infringement on user name space reported by Janos Zoltan Szabo.
5024 * data/yacc.c (yyparse): strlen -> yystrlen.
5025
989b5b8e
AD
50262005-05-30 Akim Demaille <akim@epita.fr>
5027
5028 * data/lalr1.cc (_): New.
5029 Translate the various messages.
5030
bedf57f5
PE
50312005-05-27 Paul Eggert <eggert@cs.ucla.edu>
5032
5033 Fix infringement on user name space reported by Bruno Haible.
5034 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
5035 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
5036 the user's name space.
5037 (alloca): Include <stdlib.h> to get it, if it's not built in.
5038 (YYMALLOC, YYFREE): Define only if needed.
5039 (malloc, free): Declare, but only if needed, as this infringes on
5040 the user name space.
5041
4d1801f1
PE
50422005-05-25 Paul Eggert <eggert@cs.ucla.edu>
5043
5044 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
5045 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
5046 with %d format.
5047 * lib/ebitset.c (min, max): Undef before defining.
5048 * lib/vbitset.c (min, max): Likewise.
5049 * lib/subpipe.c (create_subpipe): Save local variables in case
5050 vfork clobbers them.
5051
50522005-05-24 Bruno Haible <bruno@clisp.org>
5053
5054 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
5055 error message syntax used by gcc-4.0.
5056
b94a9e1e
PE
50572005-05-23 Paul Eggert <eggert@cs.ucla.edu>
5058
85ac3861
PE
5059 * README: Mention m4 1.4.3. Remove obsolete advice about
5060 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
5061
b94a9e1e
PE
5062 * bootstrap: Remove workaround for problem I encountered with
5063 gettext 0.14.1; it seems to be fixed now.
5064
51c30d21
PE
50652005-05-22 Paul Eggert <eggert@cs.ucla.edu>
5066
009ce67d
PE
5067 * NEWS: Version 2.0a.
5068
f2a97c62
PE
5069 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
5070 the previous change.
5071
c8775f93
PE
5072 Various maintainer cleanups.
5073 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
5074 conftest*, for benefit of CVS commands run at the same time as
5075 "configure". Add build-aux, since "bootstrap" now creates it and
5076 its subfiles.
5077 * Makefile.cfg (move_if_change): Remove.
5078 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
5079 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
5080 (po_repo, do-po-update, po-update, wget_files, get-targets):
5081 (config.guess-url_prefix, config.sub-url_prefix):
5082 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
5083 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
5084 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
5085 Remove.
5086 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
5087 this is now the recommended name.
5088 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
5089 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
5090 ylwrap. These files now go into build-aux.
5091 * config/move-if-change: Remove.
5092 * config/prev-version.txt: Bump from 1.75 to 2.0.
5093
3ea5f0ec
PE
5094 * bootstrap: Add stdio-safer, unistd-safer modules.
5095 Remove m4/glibc2.m4 (introduced by latest gnulib, but
5096 we don't need it).
5097 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
5098 fopen-safer.c, stdio-safer.h, unistd-safer.h.
5099 * lib/subpipe.c: Include "unistd-safer.h".
5100 (create_subpipe): Make sure all the newly-created
5101 file descriptors are > 2, so that diagnostics don't
5102 get sent down them (which might cause Bison to hang, in theory).
5103 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
5104 * src/files.c (xfopen): Use fopen_safer, not fopen.
5105
51c30d21
PE
5106 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
5107 yesterday's yacc.c fix.
5108
cea1469d
PE
51092005-05-21 Paul Eggert <eggert@cs.ucla.edu>
5110
3ea5f0ec
PE
5111 * data/glr.c, data/lalr1.cc: Update copyright date.
5112
cea1469d
PE
5113 Fix a destructor bug reported by Wolfgang Spraul in
5114 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
5115 * data/yacc.c (yyabortlab): Don't call destructor, and
5116 don't set yychar to EMPTY.
5117 (yyoverflowlab): Don't call destructor.
5118 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
5119 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
5120 since we no longer output the message "discarding lookahead token
5121 end of input ()".
5122
5e6f62f2
PH
51232005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5124
5125 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
5126 fix a small glitch in debugging output.
5127 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
5128 after YY_SYMBOL_PRINT where needed.
5129
5130 (struct yyGLRState): Add some comments.
5131 (struct yySemanticOption): Add some comments.
5132 (union yyGLRStackItem): Add comment.
5133
5134 (yymergeOptionSets): Correct this to properly perform the union,
5135 avoiding infinite reported by Michael Rosien.
5136 Update comment.
5137
5138 * tests/glr-regression.at: Add test for GLR merging error reported
5139 by M. Rosien.
cea1469d 5140
0fb669f9
PE
51412005-05-13 Paul Eggert <eggert@cs.ucla.edu>
5142
5143 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
5144 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
5145 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
5146 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
5147 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
5148 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
5149 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
5150 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
5151 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
5152 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
5153 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
5154 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
5155 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
5156 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
5157 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
5158 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
5159 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
5160 src/derives.h, src/files.c, src/files.h, src/getargs.c,
5161 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
5162 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
5163 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
5164 src/output.h, src/parse-gram.c, src/parse-gram.h,
5165 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
5166 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
5167 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
5168 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
5169 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
5170 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
5171 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
5172 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
5173 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
5174 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
5175 tests/reduce.at, tests/regression.at, tests/sets.at,
5176 tests/synclines.at, tests/testsuite.at, tests/torture.at:
5177 Update FSF postal mail address.
5178
51f4735e
PE
51792005-05-11 Paul Eggert <eggert@cs.ucla.edu>
5180
5181 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
5182 Problem reported by Ralf Menzel.
5183
80ce3401
PE
51842005-05-01 Paul Eggert <eggert@cs.ucla.edu>
5185
5186 * tests/actions.at: Test that stack overflow invokes destructors.
5187 From Marcus Holland-Moritz.
5188 * data/yacc.c (yyerrlab): Move the code that destroys the stack
5189 from here....
5190 (yyreturn): to here. That way, destructors are called properly
5191 even if the stack overflows, or the user calls YYACCEPT or
5192 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
5193 (yyoverflowlab): Destroy the lookahead.
5194
51952005-04-24 Paul Eggert <eggert@cs.ucla.edu>
5196
5197 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
5198
72f000b0
PE
51992005-04-17 Paul Eggert <eggert@cs.ucla.edu>
5200
5201 * NEWS: Bison-generated C parsers no longer quote literal strings
5202 associated with tokens.
5203 * src/output.c (prepare_symbols): Don't escape strings,
5204 since users don't want to see C escapes.
5205 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
5206 in diagnostics.
c19683bb 5207 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
5208 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
5209
1094323f
PE
52102005-04-16 Paul Eggert <eggert@cs.ucla.edu>
5211
5212 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
5213 the data size is known to be too small and we can't increase it.
5214 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
5215
ca407bdf
PE
52162005-04-15 Paul Eggert <eggert@cs.ucla.edu>
5217
5218 * src/parse-gram.y: Include quotearg.h.
5219 (string_as_id): Quote $1 before using it as a key, since the
5220 lexer no longer quotes it for us.
5221 (string_content): Don't strip quotes, since lexer no longer
5222 quotes it for us.
5223 * src/scan-gram.l: Include quotearg.h.
5224 ("\""): Omit quote.
5225 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
5226 a key, since the rest of the lexer doesn't quote it.
5227 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
5228 * tests/regression.at (Token definitions): Check for backslashes
5229 in token strings.
5230
5231 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
5232 (YYSIZE_T): Define to unsigned long int when using an older compiler.
5233 (yyparse): Revamp code to generate long syntax error message, to
5234 make it easier to translate, and to avoid problems with arithmetic
5235 overflow. Change "virtual memory" to "memory" in diagnostic, since
5236 we don't know whether the memory is virtual.
5237
1ce59070
PE
52382005-04-13 Paul Eggert <eggert@cs.ucla.edu>
5239
5240 * NEWS: Bison-generated C parsers now use the _ macro to
5241 translate strings.
5242 * data/yacc.c (_) [!defined _]: New macro.
5243 All English strings wrapped inside this macro.
5244 * doc/bison.texinfo (Bison Parser): Document _.
5245 * po/POTFILES.in: Include src/parse-gram.c, since it now
5246 includes translateable strings that parse-gram.y doesn't.
5247
a749a695
PE
52482005-04-12 Paul Eggert <eggert@cs.ucla.edu>
5249
5250 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
5251 reverting the 2004-10-11 change to this function.
5252 (symbol_check_alias_consistency): Don't call symbol_type_set
5253 if the type name is already correct.
5254 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
5255
8fb1053b
PE
52562005-03-25 Paul Eggert <eggert@cs.ucla.edu>
5257
5258 * tests/regression.at (Token definitions): Don't use a token named
5259 c, as that generates a "#define c ..." that runs afoul of buggy
5260 stdlib.h that uses the identifier c as a member of struct
5261 drand48_data. Problem reported by Horst Wente.
5262
ff498c4a
PE
52632005-03-21 Paul Eggert <eggert@cs.ucla.edu>
5264
5265 * bootstrap: Change translation URL from
5266 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
5267 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
5268 redirection glitches. Problem reported by twlevo@xs4all.nl.
5269
65211d70
PE
52702005-03-20 Paul Eggert <eggert@cs.ucla.edu>
5271
5272 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
5273 after operands; POSIX says this isn't portable for the c99 command.
5274
9577fb1f
PE
52752005-03-18 Paul Eggert <eggert@cs.ucla.edu>
5276
5277 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
5278 immediately if a data overrun has occurred; this may help us track
5279 down what may be a spurious failure on MacOS.
5280
78b178f7
PE
52812005-03-17 Paul Eggert <eggert@cs.ucla.edu>
5282
a2599d0f
PE
5283 Respond to problems reported by twlevo@xs4all.nl.
5284
5285 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
5286
78b178f7
PE
5287 * src/vcg.h: Comment fix.
5288 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
5289 (G_CMAX): Change to -1 instead of INT_MAX.
5290
5291 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 5292
7296e729
PE
52932005-03-15 Paul Eggert <eggert@cs.ucla.edu>
5294
5295 * src/tables.c (state_number_to_vector_number): Put it inside an
5296 "#if 0", since it's not currently used. Problem reported by
5297 Roland McGrath.
5298
05ac60f3
PE
52992005-03-06 Paul Eggert <eggert@cs.ucla.edu>
5300
5301 * src/output.c (escaped_output): Renamed from
5302 escaped_file_name_output, since we now use it for symbol tags as
5303 well. All uses changed.
5304 (symbol_destructors_output, symbol_printers_output):
5305 Escape symbol tags too.
5306 Problem reported by Matyas Forstner in
5307 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
5308
5309 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
5310 not needed.
5311 * src/output.c (user_actions_output, token_definitions_output,
5312 symbol_destructors_output, symbol_printers_output): Likewise.
5313 * src/reader.c (prologue_augment): Likewise.
5314 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
5315
5316 * src/vcg.c (output_edge): Don't quote linestyle arg.
5317 Problem reported by twlevo@xs4all.nl.
5318
7eb453ac
PE
53192005-02-28 Paul Eggert <eggert@cs.ucla.edu>
5320
5321 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
5322 example, reported by Derek M Jones. Also, make the example even
5323 more outrageous, to better illustrate how bad the problem is.
5324
4c04c52a
PE
53252005-02-24 Paul Eggert <eggert@cs.ucla.edu>
5326
5327 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
5328 putsym. Typo reported by Sebastian Piping.
5329
a61e1620
PE
53302005-02-23 Paul Eggert <eggert@cs.ucla.edu>
5331
5332 * doc/bison.texinfo (Language and Grammar): some -> same
5333 (Epilogue): int he -> in the
5334 Typos reported by Sebastian Piping via Justin Pence.
5335
9ec93868
PE
53362005-02-07 Paul Eggert <eggert@cs.ucla.edu>
5337
5338 * tests/glr-regression.at (Improper handling of embedded actions
5339 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
5340 embedded actions and $-N in GLR parsers", work around an Autoconf bug
5341 with dollar signs in test names.
5342 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
5343 for a similar reason.
5344
73ce7e7e
PE
53452005-01-28 Paul Eggert <eggert@cs.ucla.edu>
5346
5347 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
5348 wants to redefine G_VIEW.
5349
2e72b98e
PE
53502005-01-27 Paul Eggert <eggert@cs.ucla.edu>
5351
5352 * src/vcg.c (get_view_str): Remove case for normal_view.
5353 Problem reported by twlevo@xs4all.nl.
5354
e0d634e5
PE
53552005-01-24 Paul Eggert <eggert@cs.ucla.edu>
5356
ccf830a4
PE
5357 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
5358 Problem reported by twlevo@xs4all.nl.
5359
e0d634e5
PE
5360 * doc/bison.texinfo: Change @dircategory from "GNU programming
5361 tools" to "Software development". Requested by Richard Stallman
5362 via Karl Berry.
5363
7bbc8cb0
PE
53642005-01-23 Paul Eggert <eggert@cs.ucla.edu>
5365
5366 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
5367 Problem reported by twlevo@xs4all.nl.
5368
08b770bc
PE
53692005-01-21 Paul Eggert <eggert@cs.ucla.edu>
5370
5371 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
5372 keyword; it's not needed with modern compilers, and it doesn't
5373 affect correctness with older compilers. Suggested by
5374 twlevo@xs4all.nl.
5375
95f22ad2
PE
53762005-01-17 Paul Eggert <eggert@cs.ucla.edu>
5377
5378 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
5379 gcc -Wswitch-default.
5380 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
5381 * data/yacc.c (yyparse): Likewise.
5382
d229d15c
PE
53832005-01-12 Paul Eggert <eggert@cs.ucla.edu>
5384
5385 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
5386 already. Let config.h define any nonstandard values.
5387
ecadd90f
PE
53882005-01-10 Paul Eggert <eggert@cs.ucla.edu>
5389
5390 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
5391 for the benefit of slower hosts. Problem reported by
5392 Nelson H. F. Beebe.
5393
213744b5
PE
53942005-01-07 Paul Eggert <eggert@cs.ucla.edu>
5395
5396 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
5397 being defined and not used.
5398 * data/lalr1.cc (yyparse): Likewise.
5399 Use "if (false)" rather than "if (0)".
5400
249d3236
PE
54012005-01-05 Paul Eggert <eggert@cs.ucla.edu>
5402
5403 * TODO: Mention that we should allow NUL bytes in tokens.
5404
987cc1fb
PE
54052005-01-02 Paul Eggert <eggert@cs.ucla.edu>
5406
5407 * src/scan-skel.l (<<EOF>>): Don't close standard output.
5408 Problem reported by Hans Aberg.
5409
08fe02d9
PE
54102005-01-01 Paul Eggert <eggert@cs.ucla.edu>
5411
5412 * src/getargs.c (version): Happy new year; update overall
5413 program copyright date from 2004 to 2005.
5414
5415 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
5416 Problem reported by Hans Aberg.
5417 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
5418 (Output file names.): Add a test for the case when standard output
5419 is closed.
5420
010c0266
PE
54212004-12-26 Paul Eggert <eggert@cs.ucla.edu>
5422
5423 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
5424 to fix an oversight in the Bison 2.0 manual.
5425
da12206a
PE
54262004-12-25 Paul Eggert <eggert@cs.ucla.edu>
5427
5428 * NEWS: Version 2.0. Reformat the existing news items since
5429 1.875, so that related items are grouped together.
3a4734aa 5430 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
5431 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
5432
c935d934
PE
5433 * tests/torture.at (Exploding the Stack Size with Alloca): Set
5434 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
5435 otherwise, we're not testing alloca. Unfortunately there's no
5436 simple way to consult HAVE_ALLOCA here.
5437
da12206a
PE
5438 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
5439 for yymsg, too.
5440
5441 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
5442 hand. This avoids a warning about comparing int to size_t when
5443 GCC warnings are enabled.
5444
0a2c5137
PE
54452004-12-22 Paul Eggert <eggert@cs.ucla.edu>
5446
d7e14fc0
PE
5447 * NEWS: Bison-generated parsers no longer default to using the
5448 alloca function (when available) to extend the parser stack, due
5449 to widespread problems in unchecked stack-overflow detection.
5450 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
5451 responsibility to set it to a positive value. This lets the user
5452 specify a value that is not a preprocessor constant.
5453 * data/yacc.c (YYMAXDEPTH): Likewise.
5454 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
5455 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
5456 to be a compile-time constant. However, explain the constraints on it.
5457 Also, explain the constraints on YYINITDEPTH.
5458 (Table of Symbols): Explain that alloca is no longer the default.
5459 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
5460 to 1.
5461
0a2c5137
PE
5462 * doc/bison.texinfo (Location Default Action): Mention that n must
5463 be zero when k is zero. Suggested by Frank Heckenbach.
5464
e019c247
AD
54652004-12-22 Akim Demaille <akim@epita.fr>
5466
5467 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
5468 (parser::state_type, parser::semantic_type, parser::location_type):
5469 Private, not public.
5470 (parser::parse): Return ints, not bool.
5471 Returning a bool introduces a problem: 0 corresponds to false, and
5472 it seems weird to return false on success. Returning true changes
5473 the conventions for yyparse.
5474 Alternatively we could return void and send an exception.
5475 There is no clear consensus (yet?).
5476 (state_stack, semantic_stack, location_stack): Rename as...
5477 (state_stack_type, semantic_stack_type, location_stack_type): these.
5478 Private, not public.
5479 * tests/c++.at: New.
5480 * tests/testsuite.at, tests/Makefile.am: Adjust.
5481
72731bb7
AD
54822004-12-21 Akim Demaille <akim@epita.fr>
5483
5484 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
5485
9a0d8bec
AD
54862004-12-21 Akim Demaille <akim@epita.fr>
5487
5488 Don't impose std::string for filenames.
5489
5490 * data/lalr1.cc (b4_filename_type): New.
5491 (position::filename): Use it.
5492 (parser.hh): Move the inclusion of stack.hh and location.hh below
5493 the user code, so that needed headers for the filename type can be
5494 included first.
72731bb7
AD
5495 Forward declare them before the user code.
5496 * tests/Makefile.am (check-local, installcheck-local): Pass
5497 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 5498
99880de5
AD
54992004-12-20 Akim Demaille <akim@epita.fr>
5500
5501 Use more STL like names: my_class instead of MyClass.
5502
5503 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
5504 (SemanticStack, SemanticType, StateStack, StateType)
5505 (TokenNumberType, Stack, Slice, Traits, Parser::location)
5506 (Parser::value): Rename as...
5507 (location_stack, location_type, rhs_number_type, semantic_stack)
5508 (semantic_type, state_stack, state_type, token_number_type, stack)
5509 (slice, traits, parser::yylloc, parser::yylval): these.
5510
5511 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
5512
9bec482e
PE
55132004-12-19 Paul Eggert <eggert@cs.ucla.edu>
5514
5515 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
5516 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
5517
f6fbd3da
PE
55182004-12-17 Paul Eggert <eggert@cs.ucla.edu>
5519
5520 Remove uses of 'short int' and 'unsigned short int'. This raises
5521 some arbitrary limits. It uses more memory but nowadays that's
5522 not much of an issue.
5523
5524 This change does not affect the generated parsers; that's a different
5525 task, as some users will want to conserve memory there.
5526
5527 Ideally we should use size_t to represent all object counts, and
5528 something like ptrdiff_t to represent signed differences of object
5529 counts; but that will require more code-cleanup than I have the
5530 time to do right now.
5531
5532 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
5533 Use size_t, not int or short int, to count objects.
5534 * src/closure.c (nritemset, closure): Likewise.
5535 * src/closure.h (nritemset, closure): Likewise.
5536 * src/nullable.c (nullable_compute): Likewise.
5537 * src/print.c (print_core): Likewise.
5538 * src/print_graph.c (print_core): Likewise.
5539 * src/state.c (state_compare, state_hash): Likewise.
5540 * src/state.h (struct state): Likewise.
5541 * src/tables.c (default_goto, goto_actions): Likewise.
5542
5543 * src/gram.h (rule_number, rule): Use int, not short int.
5544 * src/output.c (prepare_rules): Likewise.
5545 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
5546 errs, reductions): Likewise.
5547 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
5548 Likewise.
5549 * src/tables.c (vector_number, tally, action_number,
5550 ACTION_NUMBER_MINIMUM): Likewise.
5551 * src/output.c (muscle_insert_short_int_table): Remove.
5552
efeed023
AD
55532004-12-17 Akim Demaille <akim@epita.fr>
5554
5555 * data/lalr1.cc: Extensive Doxygenation.
5556 (error_): Rename as...
5557 (error): this, since it is visible to the user.
5558 Adjust callers.
5559 (Parser::message): Now an automatic variable from...
5560 (Parser::yyreport_syntax_error_): here.
5561 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
5562 Parser::error.
5563 * tests/input.at: Escape $.
5564
bc82c5a5
PE
55652004-12-16 Paul Eggert <eggert@cs.ucla.edu>
5566
5567 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
5568 Parenthesize rhs to avoid obscure problems with mistakes like
5569 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
5570 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5571 b4_rhs_location): Likewise.
5572 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5573 b4_rhs_location): Likewise.
5574
fd19f271
AD
55752004-12-16 Akim Demaille <akim@epita.fr>
5576
5577 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
5578 yacc.c: be sure to stay within yycheck_.
5579 * tests/actions.at: Re-enable C++ tests.
5580
10454ea4
AD
55812004-12-16 Akim Demaille <akim@epita.fr>
5582
5583 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
5584 real.
5585
c5b95ccf
AD
55862004-12-16 Akim Demaille <akim@epita.fr>
5587
5588 Use #define to handle the %name-prefix.
5589
5590 * data/glr.c, data/yacc.c: Comment changes.
5591 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
5592 so that one can refer to yylex in the parser file, and have it
5593 renamed, as is the case with other skeletons.
5594
617a8f12
AD
55952004-12-16 Akim Demaille <akim@epita.fr>
5596
5597 Move lalr1.cc internals into yy*.
5598
5599 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
5600 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
5601 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
5602 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
5603 (empty_, final_, terror_, errcode_, ntokens_)
5604 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
5605 (looka_, ilooka_, error_range_, nerrs_):
5606 Rename as...
5607 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
5608 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
5609 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
5610 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
5611 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
5612 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
5613 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
5614 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
5615 these.
5616
1e547e6e
PE
56172004-12-15 Paul Eggert <eggert@cs.ucla.edu>
5618
5619 Fix some problems reported by twlevo at xs4all.
5620 * src/symtab.c (symbol_new): Report an error if the input grammar
5621 contains too many symbols. This is better than calling abort() later.
5622 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
5623 (struct node, struct graph):
5624 Rename member expand to stretch. All uses changed.
5625 (struct graph): Remove member layoutalgorithm. All uses removed.
5626 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
5627 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
5628 All uses changed.
5629 (N_STRETCH): Rename from N_EXPAND. All uses changed.
5630
735d6bd4
AD
56312004-12-15 Akim Demaille <akim@epita.fr>
5632
5633 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
5634 Add more Doxygen comments.
5635 (symprint_, stack_print_, reduce_print_, destruct_, pop)
5636 (report_syntax_error_, translate_): Rename as...
5637 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
5638 (yypop_, yyreport_syntax_error_, yytranslate_): this.
5639
2e1f5829
AD
56402004-12-15 Akim Demaille <akim@epita.fr>
5641
5642 * data/lalr1.cc (lex_): Rename as...
5643 (yylex_): this.
5644 Move the trace here.
5645 Take the %name-prefix into account.
5646 Reported by Alexandre Duret-Lutz.
5647
a3cb6248
AD
56482004-12-15 Akim Demaille <akim@epita.fr>
5649
5650 Simplify the C++ parser constructor.
5651
5652 * data/lalr1.cc (debug_): Rename as...
5653 (yydebug_): so that the parser's internals are always in the yy*
5654 pseudo namespace.
5655 Adjust uses.
5656 (b4_parse_param_decl): Remove the leading comma as it is now only
5657 called as unique argument list.
5658 (Parser::Parser): Remove the constructor accepting a location and
5659 an initial debugging level.
5660 Remove from the other ctor the argument for the debugging level.
5661 (debug_level_type, debug_level, set_debug_level): New.
5662
5663 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
5664 constructor calls.
5665
07fed891
AD
56662004-12-15 Akim Demaille <akim@epita.fr>
5667
5668 Remove b4_root related material: failure experiment
a3cb6248 5669 (which goal was to allow to derive from a class).
07fed891
AD
5670
5671 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
5672 definitions and uses.
5673
e603eaa5
PE
56742004-12-14 Paul Eggert <eggert@cs.ucla.edu>
5675
5676 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
5677 not 2, since it's not portable to subtract 1 from the start of an
5678 array. The new item 0 is never set or used. All uses changed.
5679
5680 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
5681 the default definition of YYLLOC_DEFAULT. Problem reported
5682 by Frank Heckenbach.
5683
fafb007d
PE
56842004-12-12 Paul Eggert <eggert@cs.ucla.edu>
5685
5686 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
5687 the normal case and one for the error case. Just use the
5688 first one uniformly. Problem reported by Frank Heckenbach.
5689 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
5690 use exactly the same macro in both places.
5691 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
5692 so that the normal-case YYRHSLOC works for the error case too.
5693 All uses changed.
5694 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
5695 (YYLLOC_DEFAULT): Use the same macro as glr.c.
5696 * doc/bison.texinfo (Location Default Action): Don't claim that
5697 we have an array of locations. Use the same macro for both glr
5698 and lalr parsers. Mention YYRHSLOC. Mention what happens when
5699 the index is 0.
5700
48814dcd
PE
57012004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5702
a4e1a53b
PE
5703 * HACKING: Update email addresses to send announcements to.
5704
48814dcd
PE
5705 * configure.ac (AC_INIT): Bump version to 1.875f.
5706
337116ba
PE
57072004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5708
5709 * NEWS: Version 1.875e.
5710 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
5711
5712 * src/scan-skel.l: Include "complain.h", for "fatal".
5713
5714 * src/relation.h (relation_print, relation_digraph):
5715 Relation sizes are of type relation_node, not size_t (this is
5716 merely a doc fix, since the two types are equivalent).
5717 (relation_transpose): Relation sizes are of type relation_node,
5718 not int.
5719 * src/relation.c: Likewise.
5720 (top, infinity): Now of type relation_node, not int.
5721 (traverse, relation_transpose): Use relation_node, not int.
5722
5723 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
5724 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
5725 (yyparse): Remove unused local introduced in 2004-10-25 patch.
5726
5727 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 5728 specifying whether the test should be skipped. Use it tp
337116ba 5729 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 5730 fail on some hosts, and should be skipped.
337116ba 5731
da2a7671
PE
57322004-12-08 Paul Eggert <eggert@cs.ucla.edu>
5733
5734 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
5735 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
5736 unless otherwise specified below.
5737
5738 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
5739 to allocate kernel_base, kernel_items, kernel_size, since
5740 they needn't be initialized to 0.
5741 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
5742 * src/closure.c (new_closure): Likewise, for itemset.
5743 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
5744 * src/lalr.c (set_goto_map): Likewise, for temp_map.
5745 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
5746 (build_relations): Likewise for edge, states1, includes.
5747 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
5748 * src/reader.c (packgram): Likewise, for ritem, rules.
5749 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
5750 * src/relation.c (relation_digraph): Likewise for VERTICES.
5751 (relation_transpose): Likewise for new_R, end_R.
5752 * src/symtab.c (symbols_token_translations_init): Likewise for
5753 token_translations.
5754 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
5755 (token_actions): Likewise for yydefact, actrow, conflrow,
5756 conflict_list.
5757 (save_column): Likewise for froms[symno], tos[symno].
5758 (goto_actions): Likewise for state_count.
5759 (pack_table): Likewise for base, pos, check.
5760 (tables_generate): Likewise for width.
5761
5762 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
5763 for initial core. Just have a separate core, so we needn't worry
5764 about whether kernel_size and kernel_base are initialized.
5765
5766 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
5767 kernel_size, kernel_items): Remove unnecessary initialization.
5768 * src/conflicts.c (conflicts): Likewise.
5769 * src/derives.c (derives): Likewise.
5770 * src/muscle_tablc (muscle_insert): Likewise.
5771 * src/relation.c (relation_digraph): Likewise.
5772 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
5773 conflrow, conflict_table, conflict_list, table, check):
5774 Likewise.
5775
5776 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
5777 This is because all callers pass unsigned int.
5778 * src/closure.h (new_closure): Likewise.
5779
5780 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
5781 (build_relations): Initialize includes[i] in all cases.
5782 * src/reader.c (packgram): Always initialize rules[ruleno].prec
5783 and rules[ruleno].precsym. Initialize members in order.
5784 * src/relation.c (relation_transpose): Always initialize new_R[i]
5785 and end_R[i].
5786 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
5787
5788 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
5789 conflict_list[0] was always 0, but now it isn't initialized.
5790
5791 * src/table.c (table_grow): When conflict_table grew, the grown
5792 area wasn't cleared. Fix this.
5793
5794 * lib/.cvsignore: Add strdup.c, strdup.h.
5795 * m4/.cvsignore: Add strdup.m4.
5796
00baeeac
PE
57972004-12-07 Paul Eggert <eggert@cs.ucla.edu>
5798
5799 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
5800 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
5801 GOTO_NUMBER_MAXIMUM, since we occasionally compute
5802 ngotos + 1 without checking for overflow.
5803 (build_relations): Use END_NODE, not -1, to denote end of edges.
5804 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
5805 build_relations): Use goto_number, not int, for goto numbers.
5806 * src/tables.c (save_column, default_goto): Likewise.
5807
be3d9d42
AD
58082004-11-23 Akim Demaille <akim@epita.fr>
5809
5810 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
5811 of #defining from yystype.
5812 Don't typedef yystype, C++ does not need it.
5813 This lets it possible to forward declare it as union.
5814
78e526d5
PE
58152004-11-23 Paul Eggert <eggert@cs.ucla.edu>
5816
5817 * bootstrap (gnulib_modules): Add extensions.
5818 Problem reported by Jim Meyering.
5819
afbb696d
PE
58202004-11-22 Paul Eggert <eggert@cs.ucla.edu>
5821
5822 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
5823 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
5824 src/system.h, src/tables.c: XFREE -> free, to accommodate
5825 recent change to gnulib xalloc.h.
78e526d5 5826 Problem reported by Jim Meyering.
afbb696d 5827
c1f8f16a
AD
58282004-11-17 Akim Demaille <akim@epita.fr>
5829
5830 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
5831
db7e5eb5 58322004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
5833 Alexandre Duret-Lutz <adl@gnu.org>
5834
5835 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
5836 changes.
5837 (YYCDEBUG): Adjust.
5838 Use it instead of cdebug_.
5839 (Parser::debug_stream, Parser::set_debug_stream): New.
5840 (Parser::symprint_): Define cdebug_ for temporary backward
5841 compatibility.
5842 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
5843 debug_stream ().
5844
68e11668
AD
58452004-11-17 Akim Demaille <akim@epita.fr>
5846
5847 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
5848 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
5849 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
5850 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
5851
97cbc73e
PE
58522004-10-27 Paul Eggert <eggert@cs.ucla.edu>
5853
5854 * data/glr.c (yyloc_default): Remove; not used.
5855 Problem reported by Frank Heckenbach.
5856
e342c3be
AD
58572004-10-25 Akim Demaille <akim@epita.fr>
5858
5859 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
5860 Introduce another definition to address simple location arrays.
5861 (yyGLRStack): New member: yyerror_range.
5862 (yyrecoverSyntaxError, yyparse): Update it.
5863 (yyrecoverSyntaxError): Use it when shifting the error token to
5864 have an accurate range, equivalent to the one computed by both
5865 yacc.c and lalr1.cc.
5866 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
5867 that column numbers start at column 0, as per GNU Coding
5868 Standards, the others tests, and the doc.
5869 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
5870 Adjust to the above change (first column is 0).
5871 And adjust the location of the "<error>", now covering the whole
5872 line.
5873
93602feb 58742004-10-22 Akim Demaille <akim@epita.fr>
04098407 5875 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
5876
5877 Remove some arbitrary limits on goto numbers and relations.
5878 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
5879 initial values, since they're never used.
5880 (set_goto_map): ngotos is now unsigned, so test for overflow
5881 by seeing whether it wraps around to zero.
5882 * src/lalr.h (goto_number): Now size_t, not short int.
5883 (GOTO_NUMBER_MAXIMUM): Remove.
5884 * src/relation.c (relation_print, traverse, relation_transpose):
5885 Check for END_NODE rather than looking at sign.
5886 * src/relation.h (END_NODE): New macro.
5887 (relation_node): Now size_t, not short int.
5888
dba08b04
PE
58892004-10-22 Paul Eggert <eggert@cs.ucla.edu>
5890
5891 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
5892 keyword, not an identifier. Problem reported by Baron Schwartz in
5893 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
5894
df09ef2e
AD
58952004-10-11 Akim Demaille <akim@epita.fr>
5896
5897 * src/symtab.c (symbol_check_alias_consistency): Also check
5898 type names, destructors, and printers.
5899 Reported by Alexandre Duret-Lutz.
5900 Recode the handling of associativity and precedence in terms
5901 of symbol_precedence_set.
5902 Accept no redeclaration at all, not even equal to the previous
5903 value.
5904 (redeclaration): New.
5905 Use it to factor redeclaration complaints.
5906 (symbol_make_alias): Don't set the type of the alias, let
5907 symbol_check_alias_consistency do it as for other features.
5908 * src/symtab.h (symbol): Add new member prec_location, and
5909 type_location.
5910 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
5911 * tests/input.at (Incompatible Aliases): New.
5912
146bc99d
PE
59132004-10-09 Paul Eggert <eggert@cs.ucla.edu>
5914
5915 .cvsignore fixes to accommodate gnulib changes,
5916 and the practice of naming build directories "_build".
5917 * .cvsignore: Add "_*". Sort.
5918 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
5919 * m4/.cvsignore: Add "*_gl.m4".
5920
e503aa60
AD
59212004-10-06 Akim Demaille <akim@epita.fr>
5922
5923 * src/parse-gram.y (add_param): Fix the truncation of trailing
5924 spaces.
5925
b4a20338
AD
59262004-10-05 Akim Demaille <akim@epita.fr>
5927
5928 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
5929 whether the reducion was empty or not. This leaves room to
5930 improve the use of YYLLOC_DEFAULT in such a case.
5931 lalr1.cc is still experimental, so changing this is acceptable.
5932 And finally, there are probably not many users who changed the
5933 handling of locations in GLR, so changing is admissible too.
5934
5935 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
5936 empty reduction, set @$ to an empty location ending the previously
5937 stacked symbol.
5938 Adjust uses to make sure the code is triggered on empty
5939 reductions.
5940 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
5941 expected output: empty reductions have empty locations.
5942
f85a5e6f
AD
59432004-09-29 Akim Demaille <akim@epita.fr>
5944
5945 * data/lalr1.cc: Move towards a more standard C++ coding style
5946 for templates: Class < T > -> Class<T>.
5947
b203fc2c
AD
59482004-09-29 Akim Demaille <akim@epita.fr>
5949
5950 * data/lalr1.cc: Reinstall the former ctor, for sake of
5951 compatibility, but warn it will be removed.
5952 Move towards a more standard C++ coding style (i.e., type *var ->
5953 type* var).
5954
5b7e1e73
PE
59552004-09-27 Paul Eggert <eggert@cs.ucla.edu>
5956
3fee967f
PE
5957 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
5958 since it's less likely to work if NULs are involved in the future.
5b7e1e73 5959
0dcca5c2
AD
59602004-09-27 Akim Demaille <akim@epita.fr>
5961
5962 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
5963
6dde1c82
AD
59642004-09-27 Akim Demaille <akim@epita.fr>
5965
5966 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 5967 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
5968 and argument names.
5969 (b4_cc_constructor_call): Likewise.
5970
b233d555
AD
59712004-09-24 Akim Demaille <akim@epita.fr>
5972
5973 * src/parse-gram.y (add_param): Strip the leading and trailing
5974 blanks from a formal argument declaration.
5975 (YY_LOCATION_PRINT): New.
5976
619404e3
AD
59772004-09-24 Akim Demaille <akim@epita.fr>
5978
5979 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
5980 after the location.
5981
dd8d9022
AD
59822004-09-24 Akim Demaille <akim@epita.fr>
5983
5984 * doc/bison.texinfo (Table of Symbols): Sort.
5985
0092f063
AD
59862004-09-21 Akim Demaille <akim@epita.fr>
5987
5988 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
5989 the useless parentheses.
5990 Suggested by Paul Eggert.
5991
451364ed
AD
59922004-09-20 Akim Demaille <akim@epita.fr>
5993
5994 Let the initial-action act on the look-ahead, and use it for the
5995 "initial push" (corresponding to an hypothetical beginning-of-file).
5996 And let lalr1.cc honor %initial-action.
5997
5998 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
5999 example.
6000 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
6001 (Parser::Parser): Remove the ctor that used to initialize it.
6002 (Parser::parse): Like in the other skeletons, issue the "starting
6003 parse" message before any action.
6004 Honor %initial-action.
6005 Initialize the stacks with the lookahead.
6006 * data/yacc.c: Let $$ and @$ in %initial-action designate the
6007 look-ahead.
6008 Push them in the stacks.
6009 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
6010
18d192f0
AD
60112004-09-20 Akim Demaille <akim@epita.fr>
6012
6013 * doc/bison.texinfo (Initial Action Decl): New.
6014
b8458aa5
AD
60152004-09-20 Akim Demaille <akim@epita.fr>
6016
6017 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
6018 clearer criterion to define it.
6019 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
6020 When reducing on an empty RHS, use the latest stacked location as
6021 location.
6022 yylloc is not always available.
6023 * data/glr.c: Likewise.
6024 Also, honor initial-actions.
6025
3fc16193
AD
60262004-09-20 Akim Demaille <akim@epita.fr>
6027
6028 * data/yacc.c (YY_LOCATION_PRINT): New.
6029 Define when we know YYLTYPE's structure, i.e., when the default
6030 YYLLOC_DEFAULT is used.
6031 * data/c.m4 (b4_yysymprint_generate): Use it.
6032 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
6033 value of the result.
6034 (error_start_): Replace with...
6035 (error_range_): this location array.
6036 This allows to replace code relying on the implementation of
6037 locations by portable code.
6038 * data/yacc.c (yylerrsp): Replace with...
6039 (yyerror_range): this.
6040 Every time a token is popped, update yyerror_range[0], to have an
6041 accurate location for the error token.
6042 * data/glr.c (YY_LOCATION_PRINT): New.
6043 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
6044 deference a pointer.
6045 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
6046 report the location in %printers.
6047
6048 * src/scan-skel.l: Instead of abort, report error messages to ease
6049 understanding skeleton scanning failures.
6050
ecfe33e7
AD
60512004-09-16 Akim Demaille <akim@epita.fr>
6052
6053 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
6054 (iterator, const_iterator): these, to be more in the C++ spirit.
6055 Also, return reverse iterators so that when displaying the stack
6056 we display its bottom first.
6057 (Parser::stack_print_, Parser::reduce_print_): Match the messages
6058 from yacc.c.
6059 We should probably use vector here though.
6060
1576d44d
AD
60612004-09-16 Akim Demaille <akim@epita.fr>
6062
6063 Have more complete shift traces.
6064
6065 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
6066 to report Shifts instead of ad hoc YYDPRINTF invocations,
6067 including for the error token.
6068 * data/lalr1.cc (symprint_): Output the location.
6069 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
6070 output the location within the %printer.
6071 Activate GLR tests, at least to make sure they compile properly.
6072 They still don't pass though.
6073 * tests/calc.at: Adjust expect verbose output, since now "Entering
6074 state..." is on a different line than the "Shifting" message.
6075
9c66f418
AD
60762004-09-08 Akim Demaille <akim@epita.fr>
6077
6078 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
6079 Bison directive from the Bison file to the invocation of this
6080 macro, so that these directives are passed to
6081 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
6082 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
6083 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
6084 the extra Bison directives instead of the whole series.
6085 Change the grammar so that there are recoverable errors, and
6086 unrecoverable errors. Now we can have the parser give up before
6087 consuming the whole input. As a result we now can observe that
6088 the lookahead is freed when needed.
6089 Change the parser source to parse argv[1] instead of a hard coded
6090 string.
6091 Simplify yylex, and give a value and location to EOF.
6092 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
6093 passed directives already coded in the file.
6094 Add some tests to check the location of "error".
6095 For some tests, the C++ parser is correct, and not yacc.c.
6096 For other tests, they provide different, but unsatisfying, values,
6097 so keep the C++ value so that at least one parser is "correct"
6098 according to the test suite.
6099 (Actions after errors): Remove, this is subsumed by the
6100 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
6101
52d5733f
AD
61022004-09-06 Akim Demaille <akim@epita.fr>
6103
6104 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 6105 (Parser::pop): New.
52d5733f
AD
6106 Use it.
6107
a0e68930
AD
61082004-09-06 Akim Demaille <akim@epita.fr>
6109
6110 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
6111 argument, an informative message.
6112 Call YY_SYMBOL_PRINT.
6113 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
6114 * data/lalr1.cc (destruct_): Likewise.
6115 In addition, no longer depend on b4_yysymprint_generate and
6116 b4_yydestruct_generate to generate these functions, do it "by
6117 hand".
6118
e757bb10
AD
61192004-09-03 Akim Demaille <akim@epita.fr>
6120
6121 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
6122 invoked, yydestruct the lookahead.
6123 * tests/calc.at (Calculator $1): Update the expected lengths of
6124 traces: there is an added line for the discarded lookahead.
6125 * doc/bison.texinfo (Destructor Decl): Some rewording.
6126 Define "discarded" symbols.
6127
0fe1f06d
AD
61282004-09-02 Akim Demaille <akim@epita.fr>
6129
6130 * data/lalr1.cc (translate_, destruct_): No reason to be static.
6131
284acc8b
AD
61322004-09-02 Akim Demaille <akim@epita.fr>
6133
6134 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
6135 (YYDSYMPRINTF): Rename as...
6136 (YY_SYMBOL_PRINT): this.
6137 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
6138 two.
6139 Use it instead of direct symprint_ calls.
6140 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
6141 one.
6142
a5eb1ed2
AD
61432004-09-02 Akim Demaille <akim@epita.fr>
6144
b7c72fe1
AD
6145 * data/lalr1.cc (b4_yysymprint_generate): New.
6146 (symprint_): New member function, defined when YYDEBUG.
6147 Use it consistently instead of token/nterm debugging output by
6148 hand.
a5eb1ed2
AD
6149 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
6150 %printer calls to use cdebug_ when using lalr1.cc.
6151
417141dd
AD
61522004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
6153
6154 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
6155 with #ifdef YYDEBUG.
6156
2fa09258
AD
61572004-08-26 Akim Demaille <akim@epita.fr>
6158
6159 * doc/bison.texinfo (Implementing Loops): Rename as...
6160 (Implementing Gotos/Loops): this.
6161
9378b508
PE
61622004-08-13 Paul Eggert <eggert@cs.ucla.edu>
6163
6164 Adjust to latest gnulib.
6165 * bootstrap (gnulib_modules): Add xalloc-die.
6166 Set LC_ALL=C so that file names sort consistently.
6167 Prefer the gnulib copies of gettext.m4, glibc21.m4,
6168 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
6169 uintmax_t.m4, ulonglong.m4.
6170 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
6171 po.m4 since we are now using _gl.m4 instead.
6172
87a8ad5c
PE
61732004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
6174
6175 * src/scan-action.l: Remove. Scanning of semantic actions is
6176 handled in scan-gram.l.
6177
dca81a78
PE
61782004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
6179
6180 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
6181
6182 * src/location.h (struct): The file member is a uniqstr.
6183 (equal_boundaries): Use UNIQSTR_EQ for comparison.
6184
c9cbf7c5
PE
61852004-07-22 Paul Eggert <eggert@cs.ucla.edu>
6186
6187 Fix bug with non-%union parsers that have printers or destructors,
6188 which led to a Bison core dump. Reported by Peter Fales in
6189 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 6190
c9cbf7c5
PE
6191 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
6192 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
6193 not to our own type.
6194 * src/output.c (symbol_destructors_output, symbol_printers_output):
6195 Don't assume %union.
6196 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
6197 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
6198 UNION-FLAG. All callers changed.
6199 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
6200 Use type char, not unsigned int, when declaring an array of char;
6201 this lets us remove a cast.
6202 (Printers and Destructors): Add non-%union test cases.
6203
fa7e68c3
PE
62042004-06-21 Paul Eggert <eggert@cs.ucla.edu>
6205
6206 * doc/bison.texinfo: Minor editorial changes, mostly to the new
6207 GLR writeups. E.g., avoid frenchspacing and the future tense,
6208 change "lookahead" to "look-ahead", and change "wrt" to "with
6209 respect to".
2fa09258 6210
fa7e68c3
PE
62112004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6212
6213 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
6214 New sections, split off from the GLR Parsers section. Put the new
6215 Simple GLR Parser near the start of the GLR section, for clarity.
6216 Rewrite connective text.
6217
99a9344e
PE
62182004-06-21 Frank Heckenbach <frank@g-n-u.de>
6219
6220 * doc/bison.texinfo (Simple GLR Parsers): New section.
6221
8dd162d3
PE
62222004-06-21 Paul Eggert <eggert@cs.ucla.edu>
6223
6224 * NEWS, TODO, doc/bison.texinfo:
6225 Use "look-ahead" instead of "lookahead", to be consistent.
6226 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
6227 while we're fixing "look-ahead".
6228 * src/conflicts.c (shift_set): Renamed from shiftset.
6229 (look_ahead_set): Renamed from lookaheadset.
6230 * src/print.c: Likewise.
6231 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
6232 name for "lookahead".
6233 (report_types, usage): Likewise.
6234 * src/getargs.h (report_look_ahead_tokens): Renamed from
6235 report_lookaheads.
6236 * src/lalr.c (compute_look_ahead_tokens): Renamed from
6237 compute_lookaheads.
6238 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
6239 (look_ahead_tokens_print): Renamed from lookaheads_print.
6240 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
6241 state_rule_lookaheads_print.
6242 * src/state.h: Likewise.
6243 (reductions.look_ahead_tokens): Renamed from lookaheads.
6244 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
6245 AT_DATA_LOOKAHEADS_GRAMMAR.
6246
57a90331
PE
62472004-06-03 Paul Eggert <eggert@cs.ucla.edu>
6248
6249 * README: Update location of patched M4 distribution.
6250
8ed3234a
PE
62512004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
6252
6253 Don't assume the C++ compiler takes the same arguments as the C compiler
6254 (trivial change).
6255 * configure.ac (O0CXXFLAGS): New var.
6256 * tests/atlocal.in (CXXFLAGS): Use it.
6257
07971983
PE
62582004-05-29 Paul Eggert <eggert@cs.ucla.edu>
6259
6260 Fix some "make check" problems with C++ reported by
6261 Albert Chin-A-Young for Tru64 C++ in this thread:
6262 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
6263
6264 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
6265 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6266 Output to a .cc file for C++, not to a .c file.
6267 * tests/calc.at (AT_CHECK_CALC): Likewise.
6268 * tests/regression.at (AT_CHECK_DANCER): Likewise.
6269 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
6270
29058652
PE
62712004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
6272
6273 * tests/calc.at, tests/actions.at: Workaround for SGI
6274 C++ compiler. (trivial change)
6275
62cb8a99
PE
62762004-05-27 Paul Eggert <eggert@cs.ucla.edu>
6277
fd418816
PE
6278 Spent a few hours checking out which prerequisite versions the
6279 current sources actually require. I went all the way back to
6280 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
6281 a seemingly endless set of combinations of versions more recent
6282 than that. The bottom line is that the current sources require
6283 fairly recent versions of the build tools, and it'll be some work
6284 to change this.
6285 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
6286 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
6287 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
6288 Add comments explaining why those particular versions are
6289 currently needed.
2fa09258 6290
62cb8a99
PE
6291 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
6292 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 6293 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
6294
6295 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
6296 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
6297
caa52c10
PE
62982004-05-26 Paul Eggert <eggert@cs.ucla.edu>
6299
6300 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
6301 0.11.5. Suggested by Bruno Haible.
6302 * bootstrap: Remove gettext version checking.
6303
6304 * doc/bison.texinfo (Decl Summary): Also mention that %union
6305 can depend on prerequisite types. Problem reported by Tim
6306 Van Holder.
6307
4bfd5e4e
PE
63082004-05-25 Paul Eggert <eggert@cs.ucla.edu>
6309
2cef3017
PE
6310 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
6311 * README-alpha: Don't tell people not to package this.
6312
b9c85d5c
PE
6313 * bootstrap: Don't assume $(...) works; use `...` instead.
6314 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
6315 gettext better.
6316
4bfd5e4e
PE
6317 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
6318 put into the -d output file, and mention what to do if YYSTYPE is
6319 defined as a macro.
6320
6a36ff94
PE
63212004-05-24 Paul Eggert <eggert@cs.ucla.edu>
6322
6712933e
PE
6323 Undo change made earlier today: it caused autopoint to not bring
6324 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
6325 autopoint's.
6326
6327 * bootstrap: Check that gettext version matches what's in
6328 configure.ac. Warn users to ignore robots.txt ERROR 404.
6329 * bootstrap: Undo today's earlier change (logged below).
6330 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 6331
6a36ff94
PE
6332 The gettext version checking is causing more trouble than it's
6333 curing; remove it. Problem reported by Paul Hilfinger.
6334
6335 * bootstrap: Issue a warning that one can expect a message
6336 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
6337 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
6338
209ea708
PE
63392004-05-23 Paul Eggert <eggert@cs.ucla.edu>
6340
6341 Ensure that the C++ compiler used for testing actually works on a
6342 simple test program; if not, skip the C++-related tests. Problem
6343 reported by Vin Shelton in:
161a71f3 6344 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
6345
6346 * m4/cxx.m4: New file.
6347 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
6348 * tests/atlocal.in (BISON_CXX_WORKS): Add.
6349 * tests/local.at (AT_COMPILE_CXX): Use it.
6350
41ca2549
PE
63512004-05-21 Paul Eggert <eggert@cs.ucla.edu>
6352
383e69dc
PE
6353 * data/glr.c (yylloc): Output this macro even if locations are not
6354 being generated, as the GLR parser needs it even in that case.
6355 Problem reported by Troy A. Johnson
6356 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
6357
41ca2549
PE
6358 * configure.ac (AC_INIT): Update to 1.875e.
6359
e476c87d
PE
63602004-05-21 Paul Eggert <eggert@cs.ucla.edu>
6361
6362 * NEWS: Version 1.875d.
6363 * configure.ac (AC_INIT): Likewise.
6364 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
6365
6366 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
6367 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
6368 lalr1.cc runs afoul of the first, and the last two are no longer
6369 supported by GCC 3.4.0.
6370 * README: Mention GNU m4 1.4 or later; mention m4 patches.
6371 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
6372
233a88ad
PE
63732004-05-06 Paul Eggert <eggert@cs.ucla.edu>
6374
6375 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
6376 unsigned int, for compatibility with latest gnulib hash module.
6377 * src/state.c (state_hash, state_hasher): Likewise.
6378 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
6379 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 6380
12ffdd28
PE
63812004-05-03 Paul Eggert <eggert@cs.ucla.edu>
6382
6383 * NEWS: Unescaped newlines are no longer allowed in char & strings.
6384
6385 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
6386 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
6387 character and string literals.
6388 (unexpected_end): New function.
6389 (unexpected_eof): Use it.
6390 (unexpected_newline): New function.
6391 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
6392 actions.
e476c87d 6393
12ffdd28
PE
6394 * NEWS: Document %expect-rr.
6395
6396 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
6397 Fix typo by replacing $1 with $option.
6398 Remove more 'intl'-related files.
9668e2be 6399 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
6400
6401 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
6402 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
6403 strtoul.c.
6404 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
6405 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
6406 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
6407 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
6408 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
6409 * src/.cvsignore: Add *.output.
6410
6411 * src/parse-gram.y: Put copyright notice inside %{ %} so it
6412 gets copied to the output file.
e476c87d 6413
1f65350a
PE
64142004-04-28 Paul Eggert <eggert@twinsun.com>
6415
6416 Get files from the gnulib and po repositories, instead of relying
6417 on them being in our CVS. Upgrade to latest versions of gnulib
6418 and Automake.
6419
6420 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
6421 * bootstrap: Bootstrap from gnulib and po repositories.
6422 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
6423 * README-cvs: Document these changes. Remove version numbers from
6424 mentions of build tools, since they change so often. Mention Flex.
6425
6426 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
6427 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
6428 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
6429 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 6430 does this for us.
12ffdd28
PE
6431 (AC_ISC_POSIX): Remove; we no longer support this
6432 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
6433 (AC_HEADER_STDC): Remove: we now assume C89 or better.
6434 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
6435 Do not check for C89 headers, except for locale.h which is used
6436 by the Yacc library and must port to K&R hosts.
6437 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
6438 Do not check for C89 functions, except for setlocale which is
6439 used by the Yacc library.
6440 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
6441 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
6442 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
6443 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
6444 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
6445 AM_GNU_GETTEXT): Remove; now done by:
6446 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
6447 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
6448 for us.
6449
6450 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
6451 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
6452 Define to empty, as gnulib.mk will do the rest for us.
6453 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
6454 for us.
6455 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
6456 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
6457
6458 * src/files.c: Include gnulib's xstrndup.h.
6459
6460 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
6461 (REALLOC): Use xnrealloc, for likewise.
6462 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
6463 (strnlen, memrchr): Remove decls; functions no longer used.
6464 Include <stpcpy.h>.
6465
6466 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
6467 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
6468 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
6469 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
6470 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
6471 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
6472 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
6473 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
6474 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
6475 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
6476 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
6477 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
6478 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
6479 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
6480 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
6481 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
6482 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
6483 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
6484 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
6485 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
6486 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
6487 Remove, as these files are now generated automatically
6488 by bootstrap or automake.
6489
6490 * po/ChangeLog: Remove: all but one entry was a duplicate
6491 of this file, and I moved that 2000-11-02 entry here.
6492
6493 * config/.cvsignore: Add Makefile, depcomp, install-sh.
6494 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
6495 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
6496 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
6497 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
6498 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
6499 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
6500 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
6501 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
6502 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
6503 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
6504 xstrndup.h.
6505 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
6506 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
6507 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
6508 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
6509 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
6510 * src/.cvsignore: Remove *_.c.
6511
6512
6513 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
6514 support it. (The latest stable gzip doesn't.)
6515
65162004-04-27 Paul Eggert <eggert@twinsun.com>
6517
6518 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
6519 case, as stos_ is now used by destructors due to the 2004-02-09
6520 change.
6521
6522 Remove more K&R C support.
6523 * lib/libiberty.y (PARAMS): Remove. All uses removed.
6524 * lib/subpipe.c (errno): Remove decl.
6525 Include <stdlib.h> unconditionally.
6526 (EXIT_FAILURE): Remove macro.
6527 * src/complain.c (vfprintf, strerror): Remove.
6528 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
6529 unconditionally.
6530 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
6531 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
6532 (strchr, strspn, memchr): Remove decls.
6533 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
6534 unconditionally. Do not declare perror.
6535 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
6536 unconditionally.
6537
6538 * src/complain.c (_): Remove useless defn, as system.h defines this.
6539
6540 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
6541 with latest obstack.h.
6542 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
6543 to procedure types, as obstack.h now does that for us.
6544 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
6545
6546 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
6547 so that this include file can stand alone.
6548 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
6549 does this now. Include subpipe.h first after config.h, to
6550 test whether it can stand alone.
6551
6552 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
6553 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
6554 unused declaration.
6555
6556 * tests/synclines.at (%union synch line): Put a dummy member in
6557 the union, because empty unions aren't allowed in C. Caught
6558 by GCC 3.4.0.
6559
4f16766c
PE
65602004-04-13 Jim Meyering <jim@meyering.net>
6561
6562 * src/conflicts.c (conflicts_print): Correct format string typo:
6563 use `%%' to produce literal `%'. (trivial change)
6564
779e7ceb
PE
65652004-03-30 Paul Eggert <eggert@twinsun.com>
6566
6567 * src/getargs.c (version): Update copyright year to 2004.
6568
6569 * data/c.m4 (b4_int_type): Use 'short int' rather than
6570 'short', and similarly for 'long', 'unsigned', etc.
6571 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
6572 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
6573 yy_yypstack, yydumpstack): Likewise.
6574 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
6575 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
6576 Likewise.
6577 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
6578 yy_stack_print, yyparse): Likewise.
6579 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
6580 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
6581 * lib/bitset.c (bitset_print): Likewise.
6582 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
6583 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
6584 * lib/bitsetv.c (bitsetv_dump): Likewise.
6585 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
6586 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
6587 Likewise.
6588 * src/LR0.c (allocate_itemsets): Likewise.
6589 * src/gram.h (rule_number, rule): Likewise.
6590 * src/lalr.h (goto_number): Likewise.
6591 * src/nullable.c (nullable_compute): Likewise.
6592 * src/output.c (prepare_rules): Likewise.
6593 * src/relation.c (relation_print, relation_digraph): Likewise.
6594 * src/relation.h (relation_node): Likewise.
6595 * src/state.h (state_number, transitions, errs, reductions,
6596 struct state): Likewise.
6597 * src/symtab.h (symbol_number, struct symbol): Likewise.
6598 * src/tables.c (vector_number, tally, action_number,
6599 default_goto, goto_actions): Likewise.
6600 * tests/existing.at (GNU Cim Grammar): Likewise.
6601 * tests/regression.at (Web2c Actions): Likewise.
6602
6603 * src/output.c (muscle_insert_short_int_table): Renamed from
6604 muscle_insert_short_table. All uses changed.
6605
d6328241
PH
66062004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6607
6608 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
6609 (declaration): Replace expected_conflicts with expected_sr_conflicts.
6610 Add %expect-rr rule.
4f16766c 6611
d6328241
PH
6612 * src/scan-gram.l: Recognize %expect-rr.
6613
4f16766c 6614 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 6615 expected_conflicts.
4f16766c 6616 (expected_rr_conflicts): Declare.
d6328241
PH
6617
6618 * src/conflicts.c (expected_sr_conflicts): Rename from
6619 expected_conflicts.
6620 (expected_rr_conflicts): Define.
6621 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
6622 for GLR parsers.
6623 Use expected_sr_conflicts in place of expected_conflicts.
6624 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 6625
d6328241 6626 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 6627
1452af69
PE
66282004-03-08 Paul Eggert <eggert@gnu.org>
6629
6630 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 6631 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
6632
6633 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
6634 in lalr1.cc.
6635 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
6636 * src/scan-gram.l (scan_integer): New function.
6637 ({int}): Use it.
6638 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
6639 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
6640 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
6641 Say "long int", not "long", for uniformity with GNU style.
6642
006d217d
PE
66432004-02-25 Paul Eggert <eggert@twinsun.com>
6644
6645 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
6646 compilers. This fixes a problem with Intel's C++ compiler being
6647 chatty, reported by Guido Trentalancia in
161a71f3 6648 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 6649
c2729758
ADL
66502004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
6651
6652 Support %destructor and merge error locations in lalr1.cc.
6653
6654 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
6655 (Parser::stos_): Define unconditionally.
6656 (Parser::destruct_): New method. Generate its body with
6657 b4_yydestruct_generate.
6658 (Parser::error_start_): New attribute.
6659 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
6660 token which are discarded.
6661 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
6662 error_start_ when erroneous token are discarded.
6663 (Parser::parse) <yyerrlab1>: Compute the location of the error
6664 token so that it covers all the discarded tokens.
6665 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
6666 it can be called with `%skeleton "lalr1.cc"', and do that.
6667
dd0e0635
PE
66682004-02-02 Paul Eggert <eggert@twinsun.com>
6669
6670 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
6671 $(top_srcdir)/lib and ../lib. This fixes a bug reported
6672 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
6673 There's no need to mention top_builddir since Automake does that
6674 for us.
6675 (INCLUDES): Remove, as Automake says it's obsolescent.
6676 Contents migrated into AM_CPPFLAGS as described above.
6677 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
6678
66792004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6680
6681 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
6682 (yyreportSyntaxError): Handle case where lookahead token is
6683 YYEMPTY.
6684
be16239b
PH
66852004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6686
6687 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
6688 resulting parsers are compilable with C++.
6689
5fa90832
PE
66902003-12-23 Paul Eggert <eggert@twinsun.com>
6691
6692 * config/depcomp, config/install-sh: Sync with Automake 1.8.
6693 * src/output.c (output_skeleton): Rename local var.
6694 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
6695 Bison tokens, as this runs afoul of the 2003-10-07 change that
6696 disallowed NUL bytes in character constants or string literals.
6697
6698 * tests/local.at: Require Autoconf 2.59's Autotest.
6699 * tests/testsuite.at: Don't include local.at, since we now assume
6700 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
6701 including it.
6702 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
6703 multiple inclusion warnings.
dd0e0635 6704
b165c324
AD
67052003-12-02 Akim Demaille <akim@epita.fr>
6706
6707 * doc/bison.texinfo (How Can I Reset the Parser): More about start
6708 conditions.
6709 From Bruno Haible.
6710
26e06a21
ADL
67112003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
6712
6713 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
6714
92ac3705
PE
67152003-10-07 Paul Eggert <eggert@twinsun.com>
6716
6a5ecb38
PE
6717 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
6718 if testsuite doesn't exist.
6719
92ac3705
PE
6720 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
6721 literals, unfortunately.
6722 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
6723 Complain about NUL bytes in character constants or string literals.
6724
91d2c560
PE
67252003-10-05 Paul Eggert <eggert@twinsun.com>
6726
6727 * NEWS: Don't document %no-default-prec, as it's still
6728 too experimental.
6729 * doc/bison.texinfo: Document %no-default-prec only if
6730 the defaultprec flag is set. Normally it's not.
6731
0cc3da3a
PE
67322003-10-04 Paul Eggert <eggert@twinsun.com>
6733
6734 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
6735 non-modifiable lvalue, instead of a modifiable one.
6736 * doc/bison.texinfo (Actions): Document that $$ can
6737 be assigned to. Do not claim that $$ and $N are
6738 array element references: user code should not rely on this.
6739
22fccf95
PE
67402003-10-01 Paul Eggert <eggert@twinsun.com>
6741
6742 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
6743 (grammar_declaration): Use it.
6744 * src/scan-gram.l: New token %no-default-prec.
6745 * tests/conflicts.at: Revamp tests to use %no-default-prec.
6746 * NEWS, doc/bison.texinfo: Document the above.
6747
fc8f2965
AD
67482003-10-01 Akim Demaille <akim@epita.fr>
6749
6750 VCG no longer supports long_straight_phase.
6751
6752 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
6753 * src/print_graph.c (print_graph): Adjust.
6754
39a06c25
PE
67552003-09-30 Frank Heckenbach <frank@g-n-u.de>
6756 and Paul Eggert <eggert@twinsun.com>
6757
6758 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
6759 Table of Symbols): Document %default-prec.
6760 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
6761 (grammar_declaration): Set default_prec on %default-prec.
6762 * src/scan-gram.l (%default-prec): New token.
6763 * src/reader.h (default_prec): New flag.
6764 * src/reader.c: Likewise.
6765 (packgram): Handle it.
6766 * tests/conflicts.at (%default-prec without %prec,
6767 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 6768
39a06c25
PE
67692003-09-30 Paul Eggert <eggert@twinsun.com>
6770
6771 * tests/testsuite.at: Include local.at, not input.at, fixing
6772 a typo in the 2003-08-25 patch.
6773
62b6aef9
AD
67742003-08-27 Akim Demaille <akim@epita.fr>
6775
6776 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
6777 GCC warnings.
6778
89e1cc61
AD
67792003-08-26 Akim Demaille <akim@epita.fr>
6780
6781 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
6782 "<\#" to avoid magic from Gnus when posting parts of this script.
6783
a08460b0
AD
67842003-08-26 Akim Demaille <akim@epita.fr>
6785
6786 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
6787 (Parser::parse): here.
6788 Adjust: nerrs and errstatus is now replaced by...
6789 (Parser::nerrs_, Parser::errstatus_): New.
6790
603f1cfd
AD
67912003-08-25 Akim Demaille <akim@epita.fr>
6792
6793 * config/announce-gen, Makefile.cfg: New.
6794 * Makefile.am: Adjust.
6795 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
6796 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
6797
cd3684cf
AD
67982003-08-25 Akim Demaille <akim@epita.fr>
6799
6800 When reducing initial empty rules, Bison parser read an initial
6801 location that is not defined. This results in garbage, and that
6802 affects Bison's own parser. Therefore we need (i) to extend Bison
6803 to support a means to initialize this location, and (ii) to use
6804 this CVS Bison to fix CVS Bison's parser.
6805
6806 * src/reader.h, reader.c (epilogue_augment): Remove, replace
6807 with...
6808 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
6809 * src/parse-gram.y: Adjust.
6810 (%initial-action): New.
6811 (%error-verbose): Since we require CVS Bison, there is no reason
6812 not to use it.
6813 * src/scan-gram.l: Adjust.
6814 * src/Makefile.am (YACC): New, to make sure we use our own parser.
6815 * data/yacc.c (yyparse): Use b4_initial_action.
6816
4e03e201
AD
68172003-08-25 Akim Demaille <akim@epita.fr>
6818
6819 * doc/bison.texinfo: Don't promote stdout for error messages.
6820
8c182d05
AD
68212003-08-25 Akim Demaille <akim@epita.fr>
6822
6823 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
6824 From Alexandre Duret-Lutz.
6825
6a60c4cf
PE
68262003-08-25 Akim Demaille <akim@epita.fr>
6827
6828 Version 1.875c.
6829
25f66e1a
AD
68302003-08-25 Akim Demaille <akim@epita.fr>
6831
6832 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
6833 Use them.
6834
5348bfbe
AD
68352003-08-25 Akim Demaille <akim@epita.fr>
6836
6837 * data/lalr1.cc (Parser::reduce_print_): New.
6838 Use it.
6839
47301314
AD
68402003-08-25 Akim Demaille <akim@epita.fr>
6841
6842 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
6843 error recovery loops. This patch is based on
161a71f3 6844 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
6845 Also, augment the similarity between lalr1.cc and yacc.c.
6846 Note: the locations of error recovery rules are not correct yet.
6847
6848 * data/lalr1.cc: Comment changes to augment the similarity between
6849 lalr1.cc and yacc.c.
6850 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
6851 (yyerrlab1): Remove, but where it used to be (now the bottom part of
6852 yyerrlab), when hitting EOF, pop the whole stack here instead of
6853 merely falling thru the default error handling mechanism.
6854 (yyerrorlab): New label, with the old contents of YYERROR,
6855 plus the following change: pop the stack of rhs corresponding
6856 to the production that invoked YYERROR. That is how Yacc
6857 behaves (required by POSIX).
6858 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
6859 fail.
6860
1f7a61ff
AD
68612003-08-25 Akim Demaille <akim@epita.fr>
6862
6863 Tune local.at so that people can "autom4te -l autotest calc.at -o
6864 calc" for instance, to extract a sub test suite.
6865
6866 * tests/testsuite.at: Move the initialization, Autotest version
6867 requirement, and AT_TESTED invocation into...
6868 * tests/local.at: here.
6869 * tests/testsuite.at: Include it for compatibility with Autoconf
6870 2.57.
6871 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
6872 be ignore.
6873
327b5b56
PE
68742003-08-04 Paul Eggert <eggert@twinsun.com>
6875
6876 Rework code slightly to avoid gcc -Wtraditional warnings.
6877 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
6878 The returned value is now stored in *YY0. All callers changed.
6879 * src/output.c (merge_output): Adjust to the above change.
6880
0051e3ed
PE
68812003-07-26 Paul Eggert <eggert@twinsun.com>
6882
6883 * data/glr.c (YYASSERT): New macro.
6884 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
6885 yyresolveStates, yyprocessOneStack):
6886 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
6887 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 6888
137437c6
PE
68892003-07-25 Paul Eggert <eggert@twinsun.com>
6890
5b620e06
PE
6891 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
6892 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 6893 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
6894 by Frank Heckenbach, though I have omitted the structure-initialization
6895 part of his glr-knr.diff patch since I recall that the Portable
6896 C Compiler didn't require that change.
6897
137437c6
PE
6898 Let the user specify how to allocate and free memory.
6899 Derived from a suggestion by Frank Heckenbach in
161a71f3 6900 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
6901 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
6902 All uses of free, malloc, realloc changed to use these macros,
6903 and unnecessary casts removed.
6904 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
6905
ddb85ca5
PE
69062003-07-06 Matthias Mann <MatthiasMann@gmx.de>
6907
6908 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
6909 use s.empty() rather than s == "" to test for empty string; see
161a71f3 6910 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
6911 (trivial change)
6912
39910e09
AD
69132003-06-25 Akim Demaille <akim@epita.fr>
6914
6915 * config/depcomp, config/install-sh: Update from masters.
6916
0ae99356
PE
69172003-06-20 Paul Eggert <eggert@twinsun.com>
6918
6919 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
6920 and return properly parenthesized result.
6921 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
6922 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
6923 Remove unnecessary parentheses from uses.
6924 * doc/bison.texinfo (Location Default Action): Describe the
6925 conventions for parentheses.
6926
cd05d13c
PE
69272003-06-19 Paul Eggert <eggert@twinsun.com>
6928
81fd08ca
PE
6929 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
6930 yyreportTree): Do not assume that size_t is the same width as int,
6931 when printing sizes. Print sizes using an unsigned format.
6932 Problem reported by Frank Heckenbach in
161a71f3 6933 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 6934
cd05d13c
PE
6935 Port to Forte Developer 7 C compiler.
6936 * data/glr.c (struct YYLTYPE): If locations are not being used,
6937 declare a single dummy member, as empty structs do not conform
6938 to the C standard.
6939 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
6940 the Forte Developer 7 C compiler complains that end-of-loop
6941 code is not reached.
6942
4dcf140b
PE
69432003-06-17 Paul Eggert <eggert@twinsun.com>
6944
6945 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
6946 avoid warnings from picky compilers about redefinition of PARAMS.
6947
8dd76bee
PE
69482003-06-17 Paul Eggert <eggert@twinsun.com>
6949
6950 Version 1.875b.
6951
6952 * NEWS: Document 1.875b.
6953
6954 * lib/bbitset.h: Do not include config.h; that's the includer's job.
6955 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
6956 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
6957 Don't use 'index' in comments, as it's a builtin fn on some hosts.
6958 * lib/bitset_stats.c: Include gettext.h unconditionally, as
6959 per recent gettext manual's suggestion.
6960 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
6961 Use prototypes, not old-style definitions.
6962 * lib/lbitset.c (lbitset_unused_clear): Likewise.
6963 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
6964 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
6965 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
6966 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
6967 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
6968 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
6969 vbitset_or_and_cmp, vbitset_copy): Likewise.
6970
6971 * lib/libiberty.h: Do not include config.h; that's the includer's job.
6972 Do not include <stdlib.h>.
6973 (PARAMS): Define unconditionally for C89.
6974 (ATTRIBUTE_NORETURN): Remove.
6975 (ATTRIBUTE_UNUSED): Define unconditionally.
6976
6977 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 6978 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
6979 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
6980 * lib/vbitset.c, lib/vbitset.h: New files.
6981 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
6982 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
6983 from libbitset.
6984
6985 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
6986 `How Can I Reset @code{yyparse}', since texinfo does not allow
6987 arbitrary @ in node names.
6988
6989 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
6990 shouldn't be needed according to the gettext 0.12.1 documentation
6991 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 6992 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 6993 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 6994 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 6995
8dd76bee
PE
6996 * lib/.cvsignore: Add stdbool.h.
6997 * m4/.cvsignore: Add nls.m4, po.m4.
6998
6999 Upgrade to CVS gnulib.
7000 * stdbool_.h: File renamed from stdbool.h.in.
7001 * configure.ac (AM_STDBOOL_H): Invoke this instead of
7002 AC_HEADER_STDBOOL.
7003 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
7004 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
7005 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
7006 (MOSTLYCLEANFILES): New var.
7007 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
7008 (stdbool.h): New rule.
7009 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
7010 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
7011 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
7012 m4/quote.m4: Upgrade to today's gnulib.
7013
7014 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
7015 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
7016 the tests right now.
7017 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
7018 yyerror are declared before use; C99 requires this.
7019
25005f6a
PH
70202003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7021
7022 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
7023 first.
7024 (yyrecoverSyntaxError): Correct the logic for setting and testing
7025 yyerrState.
7026 Correct comment on handling EOF.
7027 Allow states with only a default reduction, rather than failing
8dd76bee 7028 (I can't quite reconstruct why these were not allowed before).
25005f6a 7029
137437c6 7030 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 7031 buffer overruns, corrupting state.
8dd76bee
PE
7032
7033 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
7034 definition.
7035 * src/reader.h (max_left_semantic_context): New variable declaration.
7036 * src/scan-gram.l (max_left_semantic_context): Define.
7037 (handle_action_dollar): Update max_left_semantic_context.
7038 * data/glr.c (YYMAXLEFT): New definition.
7039 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
7040 (yyresolveAction): Ditto.
7041
7042 Fixes to problems with location handling in GLR parsers reported by
7043 Frank Heckenbach (2003/06/05).
7044
7045 * data/glr.c (YYLTYPE): Make trivial if locations not used.
7046 (YYRHSLOC): Add parentheses, and define only if locations used.
7047 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
7048 locations not used.
7049 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
7050 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 7051
25005f6a
PH
7052 * tests/cxx-type.at: Exercise location information; update tests
7053 to differentiate output with and without locations.
8dd76bee 7054 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
7055 because default YYLTYPE not yet defined.
7056 Change semantic actions to compute strings, rather than printing
7057 them directly (to test proper passing of semantics values). Change
7058 output to prefix notation and update test data and expected results.
7059 (yylex): Track locations.
7060 (stmtMerge): Return value rather than printing, and include arguments
7061 in value.
8dd76bee 7062
711f40b7
PE
70632003-06-03 Paul Eggert <eggert@twinsun.com>
7064
7065 Avoid warnings generated by GCC 2.95.4 when Bison is
7066 configured with --enable-gcc-warnings.
7067 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
7068 yy::]b4_parser_class_name[::translate_,
7069 yy::Stack::operator[] (unsigned),
7070 yy::Stack::operator[] (unsigned) const,
7071 yy::Slice::operator[] (unsigned),
7072 yy::Slice::operator[] (unsigned) const):
7073 Rename local vars to avoid warnings.
7074 * tests/glr-regression.at (Improper handling of embedded actions
7075 and $-N in GLR parsers): Remove unused local variable from yylex.
7076 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
7077 (void) as arg when not pure, since we now assume C89 when building
7078 Bison. Pacify GCC by using parameter.
7079
ac695f7d
PE
70802003-06-02 Paul Eggert <eggert@twinsun.com>
7081
7082 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
7083 yy::Location::lines, yy::Location::columns): Rename arguments
7084 to avoid shadowing; this removes a warning generated by GCC 3.3.
7085
26ec81e0
PE
70862003-06-01 Paul Eggert <eggert@twinsun.com>
7087
7088 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
7089 to g++, as GCC 3.3 complains if you do it.
7090 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
7091 everything that WARNING_CFLAGS has, except omit warnings
7092 not suitable for C++.
7093 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
7094 * tests/atlocal.in (CXXFLAGS): New var.
7095 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
7096
7097 Fix a GLR parser bug I reported in February; see
161a71f3 7098 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
7099 The problem was that GLR parsers did not conform to the C standard,
7100 because actions like { $1 = $2 + $3; } expanded to expressions
7101 that invoked YYFILL in separate subexpressions, and YYFILL assigned
7102 to a local variable. The C standard says that expressions
7103 like (var = f ()) + (var = f ()) have undefined behavior.
7104 Another problem was that GCC sometimes issues warnings that
7105 yyfill and its parameters are unused.
7106
7107 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
7108 as possibly unused.
7109 (yyfill): New function.
7110 (YYFILL): Use it.
7111 (yyuserAction): Change type of yynormal to bool, so that it matches
7112 the new yyfill signature. Mark it as possibly unused.
7113
7114
7115 Follow up on a bug I reported in February, where a Bison-generated
7116 parser can loop. Provide a test case and a fix for yacc.c. I
7117 don't have a fix for lalr1.cc or for glr.c, unfortunately.
7118 The original bug report is in:
161a71f3 7119 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
7120
7121 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
7122 macro's size was becoming unwieldy.
7123 (yyerrlab): Do not discard an empty lookahead symbol, as this
7124 might destroy garbage.
7125 (yyerrorlab): New label, with the old contents of YYERROR,
7126 plus the following change: pop the stack of rhs corresponding
7127 to the production that invoked YYERROR. That is how Yacc
7128 behaves, and POSIX requires this behavior.
7129 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
7130 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
7131 Define 'alarm' to do nothing if unistd.h is not available.
7132 Add a new rule "exp: '-' error;" to test the above change to
7133 data/yacc.c. Use 'alarm' to abort any test taking longer than
7134 10 seconds, as it's probably looping.
7135 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
7136 Also, the new yacc.c generates two fewer diagnostics for an
7137 existing test.
7138
d0829076
PE
71392003-05-24 Paul Eggert <eggert@twinsun.com>
7140
c6ae27df
PE
7141 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
7142 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
7143 This fixes a problem reported by John Bowman when the Compaq/HP
7144 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
7145 -ansi -Wall -gall).
7146 * data/yacc.c (union yyalloc): Likewise.
7147 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 7148
d0829076
PE
7149 Switch from 'int' to 'bool' where that makes sense.
7150
7151 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
7152 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
7153 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
7154 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
7155 Return or accept bool, not int. All callers changed.
7156 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
7157 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
7158 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
7159 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
7160 bitset_or_and_cmp_): Likewise.
7161 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
7162 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
7163 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
7164 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
7165 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
7166 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
7167 bitset_stats_or_and_cmp): Likewise.
7168 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
7169 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
7170 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
7171 ebitset_xor_cmp): Likewise.
7172 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
7173 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
7174 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
7175 lbitset_xor_cmp): Likewise.
7176 * lib/bbitset.h: Include <stdbool.h>.
7177 (struct bitset_vtable): The following members now return bool, not
7178 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
7179 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
7180 or_and_cmp).
7181 * src/conflicts.c (count_rr_conflicts): Likewise.
7182 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
7183 All uses changed.
7184 * lib/ebitset.c (ebitset_obstack_init): Likewise.
7185 * lib/lbitset.c (lbitset_obstack_init): Likewise.
7186 * src/getargs.c (debug_flag, defines_flag, locations_flag,
7187 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
7188 graph_flag): Likewise.
7189 * src/getargs.h (debug_flag, defines_flag, locations_flag,
7190 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
7191 graph_flag): Likewise.
7192 * src/output.c (error_verbose): Likewise.
7193 * src/output.h (error_verbose): Likewise.
7194 * src/reader.c (start_flag, typed): Likewise.
7195 * src/reader.h (typed): Likewise.
7196 * src/getargs.c (LOCATIONS_OPTION): New constant.
7197 (long_options, getargs): Use it.
7198 * src/lalr.c (build_relations): Use bool, not int.
7199 * src/nullable.c (nullable_compute): Likewise.
7200 * src/print.c (print_reductions): Likewise.
7201 * src/tables.c (action_row, pack_vector): Likewise.
7202 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
7203 * src/output.c (prepare): Use it.
7204 * src/output.c (token_definitions_output,
7205 symbol_destructors_output, symbol_destructors_output): Use string,
7206 not boolean integer, to keep track of whether to output separator.
7207 * src/print_graph.c (print_core): Likewise.
7208 * src/state.c (state_rule_lookaheads_print): Likewise.
7209
7210 * config/install-sh: Sync from automake 1.7.5.
7211
6b2584b7
PE
72122003-05-14 Paul Eggert <eggert@twinsun.com>
7213
7214 * src/parse-gram.y (rules_or_grammar_declaration): Require a
7215 semicolon after a grammar declaration, in the interest of possible
7216 future changes to the Bison input language.
7217 Do not allow a stray semicolon at the start of the grammar.
7218 (rhses.1): Allow one or more semicolons after any rule, including
7219 just before "|" as required by POSIX.
7220 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
7221 grammar.
7222
caf37a36
ADL
72232003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
7224
7225 %parse-param support for lalr1.cc.
7226
7227 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
7228 b4_cc_constructor_calls, b4_cc_constructor_call,
7229 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
7230 definitions.
7231 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
7232 parse-param arguments.
7233 (yy::b4_parser_class_name): Declare instance variables to
7234 hold parse-param arguments.
7235 * tests/calc.at: s/value/semantic_value/ because value clashes
7236 with a member of yy::b4_parser_class_name. Adjust C++ code
7237 to handle %parse-param. Enable %parse-param test in C++.
7238
3ab37077
PE
72392003-05-12 Paul Eggert <eggert@twinsun.com>
7240
7241 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
7242 English a bit. Fix fclose typo. Change "const char" to "char
7243 const", and use ANSI C rather than K&R for "main". Suggest
7244 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
7245 and suggest yy_switch_to_buffer.
7246
72472003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
7248
7249 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
7250 C89. This avoids a diagnostic on compilers that define __STDC__
7251 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 7252 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 7253
e743727f
PE
72542003-05-03 Paul Eggert <eggert@twinsun.com>
7255
7256 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
7257 Do not overrun array bounds.
7258 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 7259 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 7260
916708d5
AD
72612003-04-29 Akim Demaille <akim@epita.fr>
7262
7263 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
7264 * src/getargs.c, src/getargs.h: here, as bool, not int.
7265 (nondeterministic_parser): New.
7266 * src/parse-gram.y, src/scan-gram.l: Support
7267 %nondeterministic-parser.
7268 * src/output.c (prepare): Use nondeterministic_parser instead
7269 of glr_parser where appropriate.
7270 * src/tables.c (conflict_row, action_row, save_row)
7271 (token_actions, token_actions, pack_vector): Ditto.
7272
a06ea4aa
AD
72732003-04-29 Akim Demaille <akim@epita.fr>
7274
7275 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
7276
211074ca
AD
72772003-04-29 Akim Demaille <akim@epita.fr>
7278
7279 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
7280 with %pure-parser and %locations to exercise the patch from Yakov
7281 Markovitch below.
7282
6175ffe3
PE
72832003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
7284
7285 * data/yacc.c: (b4_lex_param): Corrected for the case where
7286 %lex-param is provided and %pure-parser isn't.
7287
b1e95857
PE
72882003-04-27 Paul Eggert <eggert@twinsun.com>
7289
7290 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 7291 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
7292 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
7293 if it is not defined.
7294 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
7295
acda9df6
PE
72962003-04-26 Paul Eggert <eggert@twinsun.com>
7297
3470c57b
PE
7298 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
7299 Declare to be of type suitable for the ninf value itself, not of
7300 type suitable for the corresponding table, since the latter might
7301 be unsigned but the ninf value might be negative. This fixes a
7302 bug reported by Alexandre Duret-Lutz in
161a71f3 7303 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 7304
acda9df6
PE
7305 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
7306 invokes it. We shouldn't invoke it twice because it will attempt
7307 to put error.o in the archive twice. This fixes a glitch reported
7308 by Martin Mokrejs in
161a71f3 7309 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 7310
b5250f26
PE
73112003-04-21 Paul Eggert <eggert@twinsun.com>
7312
7313 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
7314 to gnulib.
7315
089ac0f1
PE
73162003-04-21 Yakov Markovitch <Markovitch@iso.ru>
7317
7318 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
7319 Fix obvious typo that results in uncompilable GLR parsers
7320 when both %pure-parser and %locations are used. (trivial change)
7321
5ededac6
PE
73222003-04-17 Paul Eggert <eggert@twinsun.com>
7323
1b8f2fff
PE
7324 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
7325 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
7326 Do not insert the expected token via unput, as this runs afoul
7327 of a POSIX-compatibility bug in flex 2.5.31.
7328 All uses changed to BEGIN the parent state,
7329 since we no longer insert the expected token via unput.
7330 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
7331 that is no longer emitted after the above change.
7332
5ededac6
PE
7333 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
7334 the first one. This change is from Paul Hilfinger, and it fixes
7335 regression reported by Werner Lemberg in
161a71f3 7336 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
7337
7338 (resolve_sr_conflict): Don't invoke state_errs_set
7339 unless one or more tokens have been explicitly made errors.
7340 Otherwise, the above change causes Bison to abort.
7341
7342 * tests/existing.at (GNU pic Grammar): New test case, taken from
7343 Lemberg's email.
7344
b8be9132
AD
73452003-03-31 Akim Demaille <akim@epita.fr>
7346
7347 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
7348
d423d460
AD
73492003-03-31 Akim Demaille <akim@epita.fr>
7350
7351 * src/output.c (prepare_symbols): Avoid trailing spaces in the
7352 output.
7353
c7e441b4
AD
73542003-03-31 Akim Demaille <akim@epita.fr>
7355
7356 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
7357 From Paul Hilfinger.
7358
231897ad
AD
73592003-03-29 Akim Demaille <akim@epita.fr>
7360
7361 * m4/error.m4: Do not put under dynamic conditions some code which
7362 expansion is under static control.
7363
5b066063
AD
73642003-03-29 Akim Demaille <akim@epita.fr>
7365
7366 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
7367
22a74fec
AD
73682003-03-29 Akim Demaille <akim@epita.fr>
7369
7370 * doc/bison.texinfo (Strings are Destroyed): New.
7371
0eee27e7
PE
73722003-03-13 Paul Eggert <eggert@twinsun.com>
7373
7374 * .cvsignore: Add configure.lineno.
7375 * src/.cvsignore: Add yacc.
7376 * tests/.cvsignore: Add testsuite.log.
7377 * doc/fdl.texi: Sync with latest FSF version.
7378
f61aad93
PE
73792003-03-12 Paul Eggert <eggert@twinsun.com>
7380
537636c7
PE
7381 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
7382 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
7383 cursor, instead of leaving it undefined. This fixes a bug
7384 reported by Tim Van Holder in
161a71f3 7385 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
7386 * tests/input.at (Torturing the Scanner): Test the scanner on
7387 an empty input file, which was Tim Van Holder's test case.
7388
7389 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
7390 <sys/resource.h> can be included, include sys/time.h and
7391 sys/times.h first, if available. This works around the SunOS
7392 4.1.4 porting bug reported by Bruce Becker in
161a71f3 7393 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
7394
7395 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
7396 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
7397 AC_HEADER_SYS_WAIT.
7398
f61aad93
PE
7399 Merge changes from gnulib. This was prompted because the CVS
7400 snapshot didn't build on Solaris 7 due to strnlen problems.
7401
7402 These changes need to be merged back into gnulib:
7403 * lib/hash.c: Include <stdbool.h> unconditionally.
7404 * m4/onceonly.m4 (m4_quote): New macro.
7405 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
7406 Quote AC_FOREACH variable-expansions properly.
7407 The 2003-01-03 obstack.h change also needs merging.
7408 {end of changes requiring merging}
5b066063 7409
f61aad93
PE
7410 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
7411 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
7412 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
7413 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
7414 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
7415 New files, imported from gnulib.
7416 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
7417 above.
7418
7419 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
7420 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
7421 gnulib sources.
7422
7423 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
7424 Add.
7425 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
7426 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
7427 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
7428 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
7429 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
7430 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
7431 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
7432 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
7433 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
7434 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
7435 (jm_PREREQ_ARGMATCH): Remove.
7436 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
7437 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
7438
7439 * src/system.h: Include <stdbool.h> unconditionally.
7440
7441 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
7442 assuming at least C89 in the bitset code for some time now.
7443
d2ffe116
AD
74442003-03-03 Akim Demaille <akim@epita.fr>
7445
7446 * ro.po: New.
7447
052826fd
AD
74482003-03-02 Akim Demaille <akim@epita.fr>
7449
7450 * doc/bison.texinfo (Table of Symbols): Reactivate the
7451 documentation for %lex-param, and %parse-param.
7452
c4749565
AD
74532003-03-02 Akim Demaille <akim@epita.fr>
7454
7455 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
7456 generate verbose error messages.
7457 Use the number of tokens as an upper bound in yytname, as it
7458 cannot be a non terminal.
7459
d5286af1
AD
74602003-03-02 Akim Demaille <akim@epita.fr>
7461
7462 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
7463 message.
7464
22e304a6
AD
74652003-03-02 Akim Demaille <akim@epita.fr>
7466
22e304a6
AD
7467 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
7468 Use them to exercise yycheck overrun.
7469 Based on Andrew Suffield's grammar.
7470
67a25fed
AD
74712003-03-02 Akim Demaille <akim@epita.fr>
7472
7473 Create tests/local.at for Bison generic testing macros.
7474
7475 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
7476 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
7477 This new file.
7478 * tests/calc.at (AT_CHECK_CALC): Adjust.
7479 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
7480 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
7481 * tests/local.at: here.
7482 (AT_COMPILE_CXX): Tags the tests using it as c++.
7483 Ignore the test if CXX is not functional.
7484
9c2b381f
PE
74852003-03-01 Paul Eggert <eggert@twinsun.com>
7486
7487 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
7488 not loc->end, since loc->end might contain garbage and this leads
7489 to undefined behavior on some platforms.
7490 (id_loc, token_start): Use (IF_LINTed) initial values that do not
7491 depend on *loc, so that the reader doesn't give the the false
7492 impression that *loc is initialized.
7493 (<INITIAL>"%%"): Do not bother setting code_start, since its value
7494 does not survive the return.
7495
0433ba88
AD
74962003-03-01 Akim Demaille <akim@epita.fr>
7497
7498 * src/scan-gram.l (code_start): Always initialize it when entering
7499 into yylex, as SC_EPILOGUE is activated *before* the corresponding
7500 yylex invocation. An alternative would be making it static, but
7501 then it starts with the second %%'s beginning, instead of its end.
7502
b305ea69
PE
75032003-02-28 Paul Eggert <eggert@twinsun.com>
7504
7505 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
7506 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 7507 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 7508
c3d25e01
PE
75092003-02-26 Paul Eggert <eggert@twinsun.com>
7510
7511 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
7512 Remove Sequent/Pyramid discussion (nobody uses them any more).
7513 Merge VMS and MS-DOS discussion; these ports may well be dead
7514 but let's keep mentioning them for now. Put <> around email
7515 addresses. Add copyright notice.
7516
c267ffbc
PE
75172003-02-24 Paul Eggert <eggert@twinsun.com>
7518
7519 * data/glr.c (yy_reduce_print): yylineno -> yylno,
7520 to avoid collision with flex use of yylineno.
7521 Problem reported by Bruce Lilly in
161a71f3 7522 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
7523 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
7524 * data/yacc.c (yy_reduce_print): Likewise.
7525
7526 * config/depcomp: Sync with Automake 1.7.3.
7527
f939fc12
AD
75282003-02-21 Akim Demaille <akim@epita.fr>
7529
7530 * data/lalr1.cc: Use temporary variables instead of casts to
7531 change integer types.
7532 Suggested by Paul Eggert.
7533
95923bd6
AD
75342003-02-21 Akim Demaille <akim@epita.fr>
7535
7536 * doc/bison.texinfo: Use "location" consistently to refer to @n,
7537 to avoid confusions with lalr1.cc's notion of Position.
7538 Suggested by Paul Eggert.
7539
2cdc240e
AD
75402003-02-20 Akim Demaille <akim@epita.fr>
7541
7542 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
7543 before initial_columns.
7544 (location.hh): Use consistent variable names when defining the
7545 operator<<.
7546 Use "last" so that we subtract from Positions, not from unsigned.
7547
5d003116
AD
75482003-02-20 Akim Demaille <akim@epita.fr>
7549
7550 * data/lalr1.cc (position.hh): New subfile, including the extended
7551 and Doxygen'ed documentation of class Position.
7552 (location.hh): Use it.
7553 Document a` la Doxygen.
ba1ecc07 7554 With the help of Benoit Perrot.
5d003116 7555
d02b25f9
AD
75562003-02-20 Akim Demaille <akim@epita.fr>
7557
7558 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
7559 AT_YACC_IF.
7560 Redefine AT_YYERROR_SEES_LOC_IF using it.
7561 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
7562 not defined.
7563 Don't use the location in yy::Parser::error_ and
7564 yy::Parser::print_ when not %locations.
7565 Activate more lalr1.cc tests.
7566
0d1c3a04
AD
75672003-02-19 Akim Demaille <akim@epita.fr>
7568
7569 * data/lalr1.cc: When displaying a line number, be sure to make it
7570 an int.
7571
60a777aa
AD
75722003-02-19 Akim Demaille <akim@epita.fr>
7573
7574 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
7575 Remove, useless.
7576 (YYABORT, YYACCEPT, YYERROR): New.
7577 * tests/calc.at: Renable the lalr1.cc test.
7578
0b86fc41
AD
75792003-02-19 Akim Demaille <akim@epita.fr>
7580
7581 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
7582 error recovery, mixing with/without pops and discarding of the
7583 lookahead.
7584 Exercise YYERROR.
7585 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
7586
da99a5dc
PE
75872003-02-17 Paul Eggert <eggert@twinsun.com>
7588
7589 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
7590 * tests/testsuite.at (AT_COMPILE): Use them.
7591 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 7592 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 7593
93b8c255
PE
75942003-02-12 Paul Eggert <eggert@twinsun.com>
7595
7596 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
7597 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 7598 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
7599 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
7600 Check for malloc failure, for consistency with yacc.c.
7601 (yytname_size): Remove, for consistency with yacc.c.
7602
7603 The bug still remains in data/lalr1.cc, as I didn't have time
7604 to fix it there.
7605
7548fed2
AD
76062003-02-06 Akim Demaille <akim@epita.fr>
7607
7608 * configure.ac (GXX): Rename as...
7609 (CXX): this, to keep the original Autoconf semantics.
7610 Require 2.57.
7611 * data/lalr1.cc: Fix b4_copyright invocations.
7612 If YYDEBUG is not defined, don't depend upon name_ being defined.
7613 (location.hh): Include string and iostream.
7614 (Position::filename): New member.
7615 (Position::Position ()): New.
7616 (operator<< (Position)): New.
7617 (operator- (Position, int)): New.
7618 (Location::first, Location::last): Rename as...
7619 (Location::begin, Location::end): these, to mock the conventional
7620 iterator names.
7621 (operator<< (Location)): New.
7622 * tests/atlocal.in (CXX): New.
7623 * tests/testsuite.at (AT_COMPILE_CXX): New.
7624 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
7625 locations in a more synthetic way.
7626 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
7627 lalr1.cc is used.
7628 Adjust the C locations to match those from Emacs: first column is
7629 column 0.
7630 Change all the expected results.
7631 Conform to the GCS: simplify the locations when applicable.
7632 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
7633 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
7634 these CPP macros with the m4 macros new defined by...
7635 (AT_CHECK_PUSHDEFS): this, i.e.:
7636 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 7637 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
7638 New macros.
7639 (AT_CHECK_POPDEFS): Undefine them.
7640 (AT_CHECK_CALC_LALR1_CC): New.
7641 Use it for the first lalr1.cc test.
7642
43a176ef
AD
76432003-02-04 Akim Demaille <akim@epita.fr>
7644
7645 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
7646 Location as is defined.
7647
fc049e9c
AD
76482003-02-04 Akim Demaille <akim@epita.fr>
7649
7650 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
7651 name_ being defined.
7652
a737b216
PE
76532003-02-03 Paul Eggert <eggert@twinsun.com>
7654
7655 * src/gram.h (start_symbol): Remove unused decl.
7656
7657 Use more-consistent naming conventions for local vars.
7658
7659 * src/derives.c (derives_compute): Change type of local var from
7660 int to rule_number.
7661 * src/gram.c (grammar_rules_partial_print): Likewise.
7662 * src/print.c (print_core): Likewise.
7663 * src/reduce.c (reduce_grammar_tables): Likewise.
7664
7665 * src/gram.c (grammar_dump): Change name of item_number *
7666 local var from r to rp.
7667 * src/nullable.c (nullable_compute): Likewise.
7668
7669 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
7670
7671 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
7672 for symbol or symbol_number var.
7673 * src/reader.c (grammar_start_symbol_set): Likewise.
7674 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
7675 Likewise.
7676 * src/state.c (transitions_to): Likewise.
7677 * src/state.h: Likewise.
7678 * src/tables.c (symbol_number_to_vector_number): Likewise.
7679
7680 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
7681 char * var.
7682
7683 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
7684 var.
7685
7686 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
7687 var.
7688
7689 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
7690 Use str, not s, for char * var. Use ch, not c, for character var.
7691 Use size for size var.
7692
7693 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
7694 char * var.
7695 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
7696 uniqstr var.
7697 * src/uniqstr.h: Likewise.
7698
7699 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
7700 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
7701 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
7702 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
7703 param to have same name as that of enum, so that we don't use
7704 "s" to stand for a non-state.
7705
68e93ad5
AD
77062003-02-02 Akim Demaille <akim@epita.fr>
7707
7708 * src/scan-skel.l: Scan more than one inert character per yylex
7709 invocation.
7710
92898986
PE
77112003-02-01 Paul Eggert <eggert@twinsun.com>
7712
7713 Version 1.875a.
7714
1d9d5d71
PE
7715 * po/LINGUAS: Add ms.
7716
0435d061
AD
77172003-01-30 Akim Demaille <akim@epita.fr>
7718
7719 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
7720
6029a57f
PH
77212003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7722
7723 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
7724 of $1.
0435d061
AD
7725
7726 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 7727 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 7728 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 7729
6029a57f
PH
7730 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
7731 (b4_rhs_location): Ditto.
0435d061 7732 (yyfill): New function to copy from stack tree into array
6029a57f 7733 incrementally.
0435d061
AD
7734 (yyuserAction): Modify to allow incremental move of semantic values
7735 to rhs array when in GLR mode.
7736 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
7737 as needed.
7738 Remove dummy use of yystack, as there is now a guaranteed use.
7739 (yydoAction): Modify to allow incremental move of semantic values
7740 to rhs array when in GLR mode.
7741 (yyresolveAction): Ditto.
7742 (yyglrShiftDefer): Update comment.
0435d061 7743 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
7744 (yyglrReduce): Ditto.
7745 (yydoAction): Ditto
0435d061 7746
6029a57f
PH
7747 * tests/glr-regr1.at: Rename to ...
7748 * tests/glr-regression.at: Add new regression test for the problems
7749 described above (adapted from S. Eken).
7750 Update copyright notice.
7751 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
7752 * tests/Makefile.am: Ditto.
7753
6cee6297
PE
77542003-01-28 Paul Eggert <eggert@twinsun.com>
7755
7756 * data/lalr1.cc: Do not use @output_header_name@ unless
7757 b4_defines_flag is set. This fixes two bugs reported by
7758 Tim Van Holder in
161a71f3
PE
7759 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
7760 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 7761
b2a836b5
PE
77622003-01-21 Paul Eggert <eggert@twinsun.com>
7763
7764 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
7765 we don't need to worry about yyerrlab1 being reported as an
7766 "unused label" by non-GCC C compilers. The downside is that if
7767 locations are used then a couple of statements are duplicated each
7768 time YYERROR is invoked, but the upside is that the warnings
7769 should vanish.
7770 (yyerrlab1): Move code to YERROR.
7771 (yyerrlab2): Remove. Change uses back to yyerrlab1.
7772 This reverts some of the 2002-12-27 change.
7773
4196b931
PE
77742003-01-17 Paul Eggert <eggert@twinsun.com>
7775
7776 * src/output.c (symbol_printers_output): Fix typo that led
7777 to core dump. Problem reported by Antonio Rus in
161a71f3 7778 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 7779
3ae831b4
AD
77802003-01-13 Akim Demaille <akim@epita.fr>,
7781 Quoc Peyrot <chojin@lrde.epita.fr>,
7782 Robert Anisko <anisko_r@lrde.epita.fr>
7783
7784 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
7785 when the stacks contain one element, as the loop would otherwise
7786 free the last state, and then use the top state (the one we just
7787 popped). This means that the initial elements will not be freed
7788 explicitly, as is the case in yacc.c; it is not a problem, as
7789 these elements have fake values.
7790
e3aa65c5
PE
77912003-01-11 Paul Eggert <eggert@twinsun.com>
7792
7793 * NEWS: %expect-violations are now just warnings, reverting
7794 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
7795 bootstrapping problem reported by Matthias Klose; see
161a71f3 7796 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
7797 * src/conflicts.c (conflicts_print): Likewise.
7798 * tests/conflicts.at (%expect not enough, %expect too much,
7799 %expect with reduce conflicts): Likewise.
7800 * doc/bison.texinfo (Expect Decl): Document this. Also mention
7801 that the warning is enabled if the number of conflicts changes
7802 (not necessarily increases).
7803
7804 * src/getargs.c (version): Update copyright year.
7805
f0057011
AD
78062003-01-09 Akim Demaille <akim@epita.fr>
7807
7808 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
7809
1ee6d2a0
PE
78102003-01-08 Paul Eggert <eggert@twinsun.com>
7811
7812 * Makefile.maint (WGETFLAGS):
7813 New macro, containing "-C off" to disable proxy caches.
7814 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
7815 (rel-check): Use $(WGET) instead of wget.
7816
d4fd77c4
PE
78172003-01-06 Paul Eggert <eggert@twinsun.com>
7818
7819 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
7820 the GLR paper of Scott, Johnstone and Hussain.
7821
464c6927
PE
78222003-01-04 Paul Eggert <eggert@twinsun.com>
7823
d600ee67
PE
7824 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
7825 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
7826 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
7827 (EXTRA_LIBRARIES): New var, for liby.a.
7828 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
7829 (EXTRA_SCRIPTS): New var, for yacc.
7830
464c6927
PE
7831 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
7832 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
7833 Problem reported by Nelson H. F. Beebe.
7834
78352003-01-03 Paul Eggert <eggert@twinsun.com>
7836
7837 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
7838 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7839 when compiling Bison 1.875's `bitset bset = obstack_alloc
7840 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
7841
7842 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
7843 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
7844 grow to a huge size with typical invocation.
d600ee67 7845
464c6927
PE
7846 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
7847 Use the pattern recommended by Autoconf 2.57, except also protect
7848 against double-definition.
7849 * src/system.h: Likewise.
7850 Portability issues reported by Nelson H. F. Beebe.
d600ee67 7851
464c6927
PE
7852 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
7853 All uses changed. Provide a definition in both C and C++.
7854 (yytrue, yyfalse): Define even if defined (__cplusplus).
7855
7856 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
7857 Reported by Nelson H. F. Beebe.
d600ee67 7858
464c6927
PE
7859 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
7860
0f42c7d5
PE
78612003-01-02 Paul Eggert <eggert@twinsun.com>
7862
7863 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
7864 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
7865 Bug reported by Nelson H. F. Beebe.
7866
dc546b0f
PE
78672003-01-01 Paul Eggert <eggert@twinsun.com>
7868
7869 * Version 1.875.
7870
2c09b6a7
PE
78712002-12-30 Paul Eggert <eggert@twinsun.com>
7872
7873 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
7874 Moved here from...
7875 (<INITIAL>","): Here. This causes stray "," to be treated
7876 more uniformly.
7877
dc546b0f 7878 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
7879 last brace in braced code when not in Yacc mode, for compatibility
7880 with Bison 1.35. This resurrects the 2001-12-15 patch to
7881 src/reader.c.
7882
7883 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
7884 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
7885
535c0f63
PE
78862002-12-28 Paul Eggert <eggert@twinsun.com>
7887
7888 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
7889 that of SYM's type. This fixes Debian bug 168069, reported by
7890 Thomas Olsson.
d600ee67 7891
963fcc17
PE
78922002-12-28 Paul Eggert <eggert@twinsun.com>
7893
7894 Version 1.75f.
7895
7896 Switch back to the Yacc style of conflict reports, undoing some
7897 of the 2002-07-30 change.
7898 * doc/bison.texinfo (Understanding): Use Yacc style for
7899 conflict reports. Also, use new way of locating rules.
7900 * src/conflicts.c (conflict_report):
7901 Renamed from conflict_report_yacc, removing the old
7902 'conflict_report'. Translate the entire conflict report at once,
7903 so that we don't assume that "," has the same interpretation in
7904 all languages.
7905 (conflicts_output): Use Yacc-style conflict report for each state,
7906 instead of our more-complicated style.
7907 (conflicts_print): Use Yacc-style conflict report, except print
7908 the input file name when not emulating Yacc.
7909 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
7910 Conflicted Reduction, %expect not enough, %expect too much,
7911 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
7912 * tests/existing.at (GNU Cim Grammar): Likewise.
7913 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
7914
7915 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
7916 fatal): Don't invoke fflush; it's not needed and it might even be
7917 harmful for stdout, as stdout might not be open.
7918 * src/reduce.c (reduce_print): Likewise.
7919
b1efe548
PE
79202002-12-27 Paul Eggert <eggert@twinsun.com>
7921
7922 Fix a bug where error locations were not being recorded correctly.
7923 This problem was originally reported by Paul Hilfinger in
161a71f3 7924 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
7925
7926 * data/yacc.c (yyparse): New local var yylerrsp, to record the
7927 top of the location stack's error locations.
7928 (yyerrlab): Set it. When discarding a token, push its location
7929 onto yylerrsp so that we don't lose track of the error's end.
7930 (yyerrlab1): Now is only the target of YYERROR, so that we can
7931 properly record the location of the action that failed. For GCC
7932 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
7933 GCC warning about yyerrlab1 being unused if YYERROR is unused.
7934 (yyerrlab2): New label, which yyerrlab now falls through to.
7935 Compute the error's location by applying YYLLOC_DEFAULT to
7936 the locations of all the symbols that went into the error.
7937 * doc/bison.texinfo (Location Default Action): Mention that
7938 YYLLOC_DEFAULT is also invoked for syntax errors.
7939 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7940 Error locations include the locations of all the tokens that were
7941 discarded, not just the last token.
d600ee67 7942
983c5c2c
PE
79432002-12-26 Paul Eggert <eggert@twinsun.com>
7944
b1efe548
PE
7945 * src/files.c: Include quote.h.
7946 (compute_output_file_names): Warn if we detect conflicting
7947 outputs to the same file. This should catch the misunderstanding
7948 exemplified by Debian Bug 165349, reported by Bruce Stephens..
7949
7950 * src/conflicts.c (conflicts_print): If the user specifies
7951 "%expect N", report an error if there are any reduce/reduce
7952 conflicts. This is what the manual says should happen.
7953 This fixes Debian bug 130890, reported by Anthony DeRobertis.
7954 * tests/conflicts.at (%expect with reduce conflicts): New test.
7955
983c5c2c
PE
7956 Don't use m4_include on relative file names, as it doesn't work as
7957 desired if there happens to be a file with that name under ".".
d600ee67 7958
983c5c2c
PE
7959 * m4sugar/version.m4: Remove; it was included but it wasn't used.
7960 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
7961 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
7962 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
7963 * src/output.c (output_skeleton): Use full path names when
7964 specifying a file to include; don't rely on include path, as
7965 it's unreliable when the working file contains a file with
7966 that name.
d600ee67 7967
983c5c2c
PE
79682002-12-25 Paul Eggert <eggert@twinsun.com>
7969
7970 Remove obsolete references to bison.simple and bison.hairy.
7971 Problem mentioned by Aubin Mahe in
161a71f3 7972 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
7973 * data/glr.c: Comment fix.
7974 * doc/bison.1: Remove references. Also, mention "yacc".
7975
7976 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
7977 with -g option.
7978
7979 * src/parse-gram.y (declaration): Use enum "report_states" rather
7980 than its numeric value 1.
7981
7982 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
7983 opening a new one. This fixes Debian bug 165349, reported by
7984 Bruce Stephens.
7985
23f2d9dc
PE
79862002-12-24 Paul Eggert <eggert@twinsun.com>
7987
7988 Version 1.75e.
7989
7990 * Makefile.maint (cvs-update): Don't assume that the shell
7991 supports $(...), as Solaris sh doesn't.
7992
7993 * src/parse-gram.y (lloc_default): Remove test for empty
7994 nonterminals at the end, since it didn't change the result.
7995
79962002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
7997
7998 If the user does not define YYSTYPE as a macro, Bison now declares it
7999 using typedef instead of defining it as a macro. POSIX requires this.
8000 For consistency, YYLTYPE is also declared instead of defined.
8001
8002 %union directives can now have a tag before the `{', e.g., the
8003 directive `%union foo {...}' now generates the C code
8004 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
8005 The default union tag is `YYSTYPE', for compatibility with Solaris 9
8006 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
8007 instead of `yyltype'.
8008
8009 `yystype' and `yyltype' are now obsolescent macros instead of being
8010 typedefs or tags; they are no longer documented and will be
8011 withdrawn in a future release.
8012
8013 * data/glr.c (b4_location_type): Remove.
8014 (YYSTYPE): Renamed from yystype.
8015 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
8016 (struct YYLTYPE): Renamed from struct yyltype.
8017 (YYLTYPE): Renamed from yyltype.
8018 (yyltype, yystype): New (and obsolescent) macros,
8019 for backward compatibility.
8020 * data/yacc.c: Likewise.
8021
8022 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
8023 does not specify a union tag. This is for compatibility with
8024 Solaris 9 yacc.
8025
8026 * src/parse-gram.y (add_param): 2nd arg is now char * not char
8027 const *, since it is now modified by stripping surrounding { }.
8028 (current_braced_code): Remove.
8029 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
8030 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
8031 trailing " {...}". Now of type <chars>.
8032 (grammar_declaration): Adjust to bundled tokens.
8033 (code_content): Remove; stripping is now done by add_param.
8034 (print_token_value): Print contents of bundled tokens.
8035 (token_name): New function.
8036
8037 * src/reader.h (braced_code, current_braced_code): Remove.
8038 (token_name): New decl.
8039
8040 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
8041 token_type, not braced_code code_kind. All uses changed.
8042 (SC_PRE_CODE): New state, for scanning after a keyword that
8043 has (or usually has) an immediately-following braced code.
8044 (token_type): New local var, to keep track of which token type
8045 to return when scanning braced code.
8046 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 8047 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
8048 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
8049 instead of returning a token type immediately.
8050 (<INITIAL>"{"): Set token type.
8051 (<SC_BRACED_CODE>"}"): Use it.
8052 (handle_action_dollar, handle_action_at): Now returns bool
8053 indicating success. Fail if ! current_rule; this prevents a core dump.
8054 (handle_symbol_code_dollar, handle_symbol_code_at):
8055 Remove; merge body into caller.
8056 (handle_dollar, handle_at): Complain in invalid contexts.
8057
8058 * NEWS, doc/bison.texinfo: Document the above.
8059 * NEWS: Fix years and program names in copyright notice.
8060
879ca4f8
PE
80612002-12-17 Paul Eggert <eggert@twinsun.com>
8062
8063 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
8064 Reporting, Table of Symbols): Omit mentions of %lex-param and
8065 %parse-param from the documentation for now.
8066
1c5fe69d
PE
80672002-12-15 Paul Eggert <eggert@twinsun.com>
8068
8069 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
8070 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
8071 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
8072 disagreed with the Bison documentation. Bug
8073 reported by Andrew Walrond.
d600ee67 8074
1c5fe69d
PE
8075 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
8076 as the caller now does that.
8077 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
8078 (YYEMPTY): Parenthesize right hand side, since others use it.
8079 (yyparse): Don't assume that our generated code is the only code
8080 that sets yychar.
8081
d1de5372
PE
80822002-12-13 Paul Eggert <eggert@twinsun.com>
8083
8084 Version 1.75d.
8085
8086 POSIX requires a "yacc" command.
8087 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
8088 (MOSTLYCLEANFILES): Add yacc.
8089 (yacc): New rule.
1c5fe69d 8090 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
8091 as an alias for bison y.
8092
8093 * po/LINGUAS: Add da.
d600ee67 8094
d1de5372
PE
8095 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
8096 problem with latest <getopt.h>.
8097 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
8098
8099 * doc/fdl.texi: Upgrade to 1.2.
8100 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
8101 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
8102 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
8103 gnulib.
8104 * config/install-sh: Sync with autotools.
8105
8106 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 8107 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
8108 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
8109 locations are requested.
8110 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
8111 locations are requested.
8112
d0f3fe23
PE
81132002-12-12 Paul Eggert <eggert@twinsun.com>
8114
8115 Remove unportable casts and storage allocation tricks.
8116 While we're at it, remove almost all casts, since they
8117 usually aren't needed and are a sign of trouble.
8118
8119 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
8120
8121 * src/derives.c (derives_compute): Do not subtract NTOKENS from
8122 the pointer DSET returned by malloc; this isn't portable.
8123 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
8124 Similarly for DERIVES.
8125 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
8126 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
8127 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
8128
8129 * src/derives.c (derives_compute): Do not bother invoking
8130 int_of_rule_number, since rule numbers are integers.
8131
8132 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
8133 rather than XMALLOC (char, N).
8134
8135 * src/files.c (filename_split): Rewrite to avoid cast.
8136
8137 * src/gram.h (symbol_number_as_item_number,
8138 item_number_as_symbol_number, rule_number_as_item_number,
8139 item_number_as_rule_number):
8140 Now inline functions rather than macros, to avoid casts.
8141 * src/state.h (state_number_as_int): Likewise.
8142 * src/tables.c (state_number_to_vector_number,
8143 symbol_number_to_vector_number): Likewise.
8144
8145 * src/gram.h (int_of_rule_number): Remove; no longer used.
8146
8147 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
8148 since the resulting storage is always stored into.
8149
8150 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
8151 where it's needed.
8152
8153 * src/muscle_tab.c (muscle_m4_output):
8154 Now inline. Return bool, not int.
8155 * src/state.c (state_compare): Likewise.
8156 * src/symtab.c (symbol_check_defined,
8157 symbol_check_alias_consistency, symbol_pack, symbol_translation,
8158 hash_compare_symbol, hash_symbol):
8159 Likewise.
8160 * src/uniqstr.c (uniqstr_print): Likewise.
8161 * src/muscle_tab.c (muscle_m4_output_processor):
8162 New function, to avoid casts.
8163 * src/state.c (state_comparator, stage_hasher): Likewise.
8164 * src/symtab.c (symbol_check_defined_processor,
8165 symbol_check_alias_consistency_processor, symbol_pack_processor,
8166 symbol_translation_processor, hash_symbol_comparator,
8167 hash_symbol_hasher): Likewise.
8168 * src/uniqstr.c (uniqstr_print_processor): Likewise.
8169 * src/muscle_tab.c (muscles_m4_output):
8170 Use new functions instead of casting old functions unportably.
8171 * src/state.c (state_hash_new): Likewise.
8172 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
8173 symbols_token_translations_init):
8174 Likewise.
8175 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
8176
8177 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
8178 var instead of casting to long, to avoid casts.
8179 (prepare_states): Use MALLOC rather than alloca, so that we don't
8180 have to worry about alloca.
8181 * src/state.c (state_hash_lookup): Likewise.
8182
8183 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
8184 local var instead of casting to unsigned char, to avoid casts.
8185
8186 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
8187 STATE_ALLOC): Remove.
8188 (transitions_new, errs_new, reductions_new, state_new): Use malloc
8189 rather than calloc, and use offsetof to avoid allocating slightly
8190 too much storage.
8191 (state_new): Initialize all members.
8192
8193 * src/state.c (state_hash): Use unsigned accumulator, not signed.
8194
8195 * src/symtab.c (symbol_free): Remove; unused.
8196 (symbol_get): Remove cast in lhs of assignment.
8197 (symbols_do): Now static. Accept generic arguments, not
8198 hashing-related ones.
8199
8200 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
8201 (symbol_processor): Remove.
8202 (symbols_do): Remove decl; now static.
8203
8204 * src/system.h (alloca): Remove; decl no longer needed.
8205 (<stddef.h>): Include, for offsetof.
8206 (<inttypes.>, <stdint.h>): Include if available.
8207 (uintptr_t): New type, if system lacks it.
8208 (CALLOC, MALLOC, REALLOC): New macros.
8209 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
8210 new macros.
8211
8212 * src/tables.c (table_size): Now int, to pacify GCC.
8213 (table_grow, table_ninf_remap): Use signed table size.
8214 (save_row): Don't bother initializing locals when not needed.
8215 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
8216 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
8217
8218 * src/vcg.h: Correct misspellings.
8219
8220 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
8221
8222
8223 * src/getargs.c (getargs): Don't assume EOF == -1.
8224
26b4a969
PE
82252002-12-09 Paul Eggert <eggert@twinsun.com>
8226
8227 Change identifier spellings to avoid collisions with names
8228 that are reserved by POSIX.
8229
8230 Don't use names ending in _t, since POSIX reserves them.
8231 For consistency, remove _e and _s endings -- they're weren't
8232 needed to remove ambiguity. All uses changed.
8233 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
8234 turn was just renamed from struniq_t.
8235 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
8236 which in turn was just renamed from struniq_processor_t.
8237 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
8238 in turn was renamed from hash_compare_struniq_t.
8239 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
8240 (state_list): Renamed from state_list_t.
8241 * src/assoc.h (assoc): Renamed from assoc_t.
8242 * src/conflicts.c (enum conflict_resolution): Renamed from
8243 enum conflict_resolution_e.
8244 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
8245 (rule_list): Renamed from rule_list_t.
8246 * src/getargs.h (enum trace): Renamed from enum trace_e.
8247 (enum report): Renamed from enum report_e.
8248 * src/gram.h (item_number): Renamed from item_number_t.
8249 (rule_number): Renamed from rule_number_t.
8250 (struct rule_s): Remove the "rule_s" part; not used.
8251 (rule): Renamed from rule_t.
8252 (rule_filter): Renamed from rule_filter_t.
8253 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
8254 (goto_list): Renamed from goto_list_t.
8255 * src/lalr.h (goto_number): Renamed from goto_number_t.
8256 * src/location.h (location): Renamed from location_t.
8257 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
8258 and moved here from:
8259 * src/muscle_tab.h (muscle_entry_t): here.
8260 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
8261 (rule_list): Renamed from rule_list_t.
8262 * src/print_graph.c (static_graph): Renamed from graph.
8263 * src/reader.h (braced_code): Renamed from braced_code_t.
8264 Remove brace_code_e tag.
8265 * src/relation.h (relation_node): Renamed from relation_node_t.
8266 (relation_nodes): Renamed from relation_nodes_t.
8267 (relation): Renamed from relation_t.
8268 * src/state.h (state_number): Renamed from state_number_t.
8269 (struct state): Renamed from struct state_s.
8270 (state): Renamed from state_t.
8271 (transitions): Renamed from transitions_t. Unused (and
8272 misspelled) transtion_s tag removed.
8273 (errs): Renamed from errs_t. Unused errs_s tag removed.
8274 (reductions): Renamed from reductions_t. Unused tag
8275 reductions_s removed.
8276 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
8277 (struct symbol_list): Renamed from struct symbol_list_s.
8278 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
8279 (struct symbol): Renamed from struct symbol_s.
8280 (symbol): Renamed from symbol_t.
8281 * src/tables.c (vector_number): Renamed from vector_number_t.
8282 (action_number): Renamed from action_t.
8283 * src/tables.h (base_number): Renamed from base_t.
8284 * src/vcg.h (enum color): Renamed from enum color_e.
8285 (enum textmode): Renamed from enum textmode_e.
8286 (enum shape): Renamed from enum shape_e.
8287 (struct colorentry): Renamed from struct colorentry_s.
8288 (struct classname): Renamed from struct classname_s.
8289 (struct infoname): Renamed from struct infoname_s.
8290 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
8291 (enum decision): Renamed from enum decision_e.
8292 (enum orientation): Renamed from enum orientation_e.
8293 (enum alignment): Renamed from enum alignment_e.
8294 (enum arrow_mode): Renamed from enum arrow_mode_e.
8295 (enum crossing_type): Renamed from enum crossing_type_e.
8296 (enum view): Renamed from enum view_e.
8297 (struct node): Renamed from struct node_s.
8298 (node): Renamed from node_t.
8299 (enum linestyle): Renamed from enum linestyle_e.
8300 (enum arrowstyle): Renamed from enum arrowstyle_e.
8301 (struct edge): Renamed from struct edge.
8302 (edge): Renamed from edge_t.
8303 (struct graph): Renamed from struct graph_s.
8304 (graph): Renamed from graph_t.
8305 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
8306 Rename value_t -> value.
8307 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
8308 value_t_as_yystype -> value_as_yystype.
8309
8310 Don't include <errno.h> in the mainstream code, since it
8311 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
8312 * lib/get-errno.c, lib/get-errno.h: New files.
8313 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
8314 get-errno.c.
8315 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
8316 * src/output.c (output_skeleton): Likewise.
8317 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
8318 instead of errno.
8319 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
8320 Likewise.
8321 (handle_action_dollar, handle_action_at): Likewise.
8322 * src/system.h: Do not include <errno.h>.
8323 (TAB_EXT): Renamed from EXT_TAB.
8324 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
8325
8326 Avoid str[a-z]*, since <string.h> reserves that name space.
8327 Change all instances of "struniq" in names to "uniqstr", and
8328 likewise for "STRUNIQ" and "UNIQSTR".
8329 * src/uniqstr.c: Renamed from src/struniq.c.
8330 * src/uniqstr.h: Renamed from src/struniq.h.
8331 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
8332 * src/files.c (strsuffix): Remove; unused.
8333 (concat2): Renamed from stringappend. Now static.
8334 * src/files.h (strsuffix, stringappend): Remove; unused.
8335 * src/parse-gram.y (<chars>): Renamed from <string>.
8336 (<uniqstr>): Renamed from <struniq>.
8337 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
8338 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
8339 (struct graph_s.expand): Renamed from struct graph_s.stretch.
8340 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
8341 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
8342 (N_EXPAND): Renamed from N_STRETCH.
8343
8344 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
8345 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
8346 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
8347 Remove; unused.
8348 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
8349 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
8350 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
8351 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
8352 (BASE_MAXIMUM): Renamed from BASE_MAX.
8353 (BASE_MINIMUM): Renamed from BASE_MIN.
8354 (ACTION_MAX): Remove; unused.
8355 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
8356 Unnecessary casts removed from above defines.
8357
8358
8359 Fix misspelling in names.
8360 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
8361 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
8362 G_NODE_ALIGNEMENT.
8363
8364
8365 * lib/timevar.c (timevar_report): Renamed from time_report,
8366 for consistency with other names.
8367 * lib/timevar.h (timevar_report): New decl.
8368 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
8369
8370
8371 Sort include-file uses.
8372
8373 Reorder all include files under src to be in the order "system.h".
8374 then the ../lib include files in angle brackets (alphabetized),
8375 then the . include files in double-quotes (alphabetized). Fix
8376 dependency breakages encountered in this process, as follows:
8377 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
8378 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
8379 * src/state.h: Include "symtab.h".
8380
996b1c7e
PE
83812002-12-08 Paul Eggert <eggert@twinsun.com>
8382
8383 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
8384 since this causes problems when __file__ contains character
8385 sequences like "@" that are treated specially by src/scan-skel.l.
8386 Instead, just use the file's basename. This fixes the bug
8387 reported by Martin Mokrejs in
161a71f3 8388 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 8389
e19c4e5d
PE
83902002-12-06 Paul Eggert <eggert@twinsun.com>
8391
8392 Add support for rules that do not have trailing semicolons, as
8393 POSIX requires. Improve the quality of locations in Bison
8394 diagnostics.
26b4a969 8395
e19c4e5d
PE
8396 * src/location.c: Include <quotearg.h>.
8397 (empty_location): Now const.
8398 (location_print): New function. Follow the recommendation of the
8399 GNU Coding Standards for locations that span file boundaries.
8400 * src/location.h: Do not include <quotearg.h>; no longer needed.
8401 (boundary): New type.
8402 (location_t): Use it. This allows locations to span file boundaries.
8403 All member uses changed: file -> start.file or end.file (as needed),
8404 first_line -> start.line, first_column -> start.column,
8405 last_line -> end.line, last_column -> end.column.
8406 (equal_boundaries): New function.
8407 (LOCATION_RESET, LOCATION_STEP): Remove.
8408 (LOCATION_PRINT): Remove. All callers changed to use location_print.
8409 (empty_location): Now const.
8410 (location_print): New decl.
8411 * src/parse-gram.y (lloc_default): New function, which handles
8412 empty locations more accurately.
8413 (YYLLOC_DEFAULT): Use it.
8414 (%token COLON): Remove.
8415 (%token ID_COLON): New token.
26b4a969 8416 (rules): Use it.
e19c4e5d
PE
8417 (declarations, rules): Remove trailing semicolon.
8418 (declaration, rules_or_grammar_declaration):
8419 Allow empty (";") declaration.
8420 (symbol_def): Remove empty actions; no longer needed.
8421 (rules_or_grammar_declaration): Remove trailing semicolon.
8422 (semi_colon.opt): Remove.
8423 * src/reader.h: Include location.h.
8424 (scanner_cursor): New decl.
8425 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
8426 rolling our own.
8427 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
8428 of *loc.
8429 (STEP): Remove. No longer needed, now that adjust_location does
8430 the work. All uses removed.
8431 (scanner_cursor): New var.
8432 (adjust_location): Renamed from extend_location. It now sets
8433 *loc and adjusts the scanner cursor. All uses changed.
8434 Don't bother testing for CR.
8435 (handle_syncline): Remove location arg; now updates scanner cursor.
8436 All callers changed.
8437 (unexpected_end_of_file): Now accepts start boundary of token or
8438 comment, not location. All callers changed. Update scanner cursor,
8439 not the location.
8440 (SC_AFTER_IDENTIFIER): New state.
8441 (context_state): Renamed from c_context. All uses changed.
8442 (id_loc, code_start, token_start): New local vars.
8443 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
8444 processing of Yacc white space and equivalents here.
8445 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
8446 instead of returning ID immediately, since we need to search for
8447 a subsequent colon.
8448 (<INITIAL>"'", "\""): Save token_start.
8449 (<INITIAL>"%{", "{", "%%"): Save code_start.
8450 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
8451 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
8452 BEGIN context_state at end, not INITIAL.
8453 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
8454 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
8455 Return correct token start.
8456 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
8457 the start of a character, string or multiline comment is found.
8458 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
8459 Reduction): Adjust reported locations to match the more-precise
8460 results now expected.
8461 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
8462 * tests/reduce.at (Useless Rules, Reduced Automaton,
8463 Underivable Rules): Likewise.
8464 * tests/regression.at (Invalid inputs): No longer `expecting ";"
8465 or "|"' now that so many other tokens are allowed by the new grammar.
8466
8467 * src/complain.h (current_file): Remove duplicate decl;
8468 current_file is now owned by files.h.
8469 * src/complain.c, src/scan-gram.l: Include files.h.
8470
84712002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 8472
e19c4e5d
PE
8473 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
8474 promotes to int; it might be unsigned int.
8475 * data/yacc.c (yy_reduce_print): Likewise.
8476
8477 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
8478 be #defined in the prologue, not in the Bison declarations.
8479 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 8480
b64755e3
PE
84812002-12-02 Paul Eggert <eggert@twinsun.com>
8482
8483 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
8484 * lib/strtoul.c: New file, from gnulib.
8485 This fixes a porting bug reported by Peter Klein in
161a71f3 8486 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 8487
6e746484
PE
84882002-11-30 Paul Eggert <eggert@twinsun.com>
8489
b64755e3
PE
8490 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
8491 and put only a forward declaration in the prologue. This is for
8492 consistency with the other scanner helper functions.
8493
6ba55592
PE
8494 Type clashes now generate warnings, not errors, since it
8495 appears that POSIX may allow some grammars with type clashes.
8496 * src/reader.c (grammar_current_rule_check): Warn about
8497 type clashes instead of complaining.
8498 * tests/input.at (Type Clashes): Expect warnings, not complaints.
8499
6e746484
PE
8500 Add Yacc library, since POSIX requires it.
8501 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
8502 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
8503 * lib/main.c, lib/yyerror.c: New files.
8504
8505 gram_error can be static; it need not be extern.
8506 * src/reader.h (gram_error): Remove decl.
8507 * src/parse-gram.y (gram_error): Now static. Add static decl.
8508 (print_token_value): Omit parameter names from forward decl,
8509 for consistency.
8510
88510f9c
PE
85112002-11-29 Paul Eggert <eggert@twinsun.com>
8512
6e746484
PE
8513 * doc/bison.texinfo: Emphasize that yylex and yyerror must
8514 be declared before being used. E.g., one should typically
8515 declare them in the prologue. Use GNU coding style in examples.
8516 Put "const" consistently after the type it modifies. Mention
8517 that C99 supports "inline". Mention that yyerror traditionally
8518 returns "int".
8519
88510f9c
PE
8520 %parse-param and %lex-param now take just one argument, the
8521 declaration; the argument name is deduced from the declaration.
8522
8523 * doc/bison.texinfo (Parser Function, Pure Calling, Error
8524 Reporting, Table of Symbols): Document this.
8525 * src/parse-gram.y (add_param): New function.
8526 (COMMA): Remove.
8527 (declaration): Implement new rule for %parse-param and %lex-param.
8528 * src/scan-gram.l: "," now elicits a warning, rather than being
8529 a token; this is more compatible with byacc.
8530 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
8531
bb92250c
PE
85322002-11-27 Paul Eggert <eggert@twinsun.com>
8533
8534 Rename identifiers to avoid real and potential collisions.
8535
8536 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
8537 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 8538 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
8539 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
8540 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
8541 * src/parse-gram.y (print_token_value): Renamed from yyprint.
8542 All uses changed.
8543 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
8544 The name "yycontrol" violates the name space rules, and this stuff
8545 wasn't being used anyway.
8546 (input): Remove action; this stuff wasn't being used.
8547 (gram_error): Rename local variable yylloc -> loc.
8548 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
8549 (YY_DECL): Don't use "yy" at start of local variables.
8550 All uses changed, e.g., yylloc -> loc.
8551 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
8552 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
8553 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
8554 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
8555
8556 * src/parse-gram.y (gram_error): loc is now const *.
8557 * src/reader.h (gram_error): Likewise.
8558
3af4feb2
PE
85592002-11-24 Paul Eggert <eggert@twinsun.com>
8560
8561 Version 1.75c.
8562
8563 * tests/actions.at (Actions after errors): Use an output format
8564 more similar to that of the Printers and Destructors test.
8565 Test the position of the ';' token too.
8566 (Printers and Destructors): Likewise.
8567 (Printers and Destructors: %glr-parser): Remove for now, to avoid
8568 unnecessarily alarming people when the test fails.
8569
8570 * data/yacc.c (yyerrlab1): Move this label down, so that the
8571 parser does not discard the lookahead token if the user code
8572 invokes YYERROR. This change is required for POSIX conformance.
8573
8574 * lib/error.c: Sync with gnulib.
8575
85762002-11-22 Paul Eggert <eggert@twinsun.com>
8577
8578 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
8579 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
8580 * lib/xmalloc.c: Likewise.
26b4a969 8581
58004308
PE
85822002-11-20 Paul Eggert <eggert@twinsun.com>
8583
8584 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
8585
85862002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 8587
58004308
PE
8588 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
8589 should use `if (! x) abort ();' rather than `assert (x);', and
8590 anyway it's one less thing to worry about configuring.
8591
8592 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
8593 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
8594 and replace all instances of assert with abort.
8595 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8596 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
8597
8598 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
8599 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
8600 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
8601 hash_find_entry, hash_rehash, hash_insert): Likewise.
8602 * src/conflicts.c (resolve_sr_conflict): Likewise.
8603 * src/lalr.c (set_goto_map, map_goto): Likewise.
8604 * src/nullable.c (nullable_compute): Likewise.
8605 * src/output.c (prepare_rules, token_definitions_output): Likewise.
8606 * src/reader.c (packgram, reader): Likewise.
8607 * src/state.c (state_new, state_free, state_transitions_set,
8608 state_reduction_find): Likewise.
8609 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
8610 symbol_pack): Likewise.
8611 * src/tables.c (conflict_row, pack_vector): Likewise.
8612 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
8613 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
8614 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
8615 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
8616
8617 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
8618 (ARGMATCH_CONSTRAINT): New macro.
8619 (ARGMATCH_ASSERT): Use it.
8620
8621 * src/system.h (verify): New macro.
8622 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
8623 rather than assert.
8624 * src/tables.c (tables_generate): Likewise.
8625
8626 * src/struniq.c (struniq_assert): Now returns void, and aborts
8627 if the assertion is false.
8628 (struniq_assert_p): Remove.
8629 * src/struniq.h: Likewise.
8630
76ae8198
PE
86312002-11-18 Paul Eggert <eggert@twinsun.com>
8632
8633 * data/glr.c (yygetLRActions): Replace `yyindex' with
8634 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
8635 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 8636 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 8637
d3c4e709
AD
86382002-11-18 Akim Demaille <akim@epita.fr>
8639
8640 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
8641 space.
8642 From Tim Van Holder.
8643
8d8a7238
PE
86442002-11-17 Paul Eggert <eggert@twinsun.com>
8645
8646 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
8647 to "SyntaxError" for consistency with my 2002-11-15 change.
8648
8649 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
8650 not define to {}, since this breaks the common use of `YYDPRINTF
8651 ((...));' if a single statement is desired (e.g. before `else').
8652 Work around GCC warnings by surrounding corresponding calls with
8653 {} if needed.
8654 (yyhasResolvedValue): Remove unused function.
8655 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
8656 loop body.
8657 (yyreportSyntaxError): Renamed from yyreportParseError.
8658 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
8659 All uses changed.
8660 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
8661 extern when possible. Remove unused initializations.
8662
b0937b22
AD
86632002-11-16 Akim Demaille <akim@epita.fr>
8664
8665 Augment the similarity between GLR and LALR traces.
8666
8667 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
8668 (YY_REDUCE_PRINT): New.
8669 (yyparse): Use them.
8670 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
8671 YYDPRINT here.
8672 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
8673 state reached after the reduction/recovery, since...
8674 (yyparse, yyprocessOneStack): Report the state we are entering in.
8675
c5e3e510
AD
86762002-11-16 Akim Demaille <akim@epita.fr>
8677
8678 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
8679 Add support for --trace=skeleton.
8680 * src/scan-skel.l: %option debug.
8681 Scan strings of non-@ or \n instead of character by character.
8682 (scan_skel): Handle trace_skeleton.
8683 (QPUTS): New.
8684 (@output_parser_name@, @output_header_name@): ``Restore'' their
8685 support (used to be M4 macros).
8686 * data/yacc.c: Quote larger chunks, a la glr.c.
8687 * data/lalr1.cc: Likewise.
8688 The header guards are no longer available, so use some other
8689 string than `YYLSP_NEEDED'.
8690
4c6cc1db
AD
86912002-11-16 Akim Demaille <akim@epita.fr>
8692
8693 Make the ``Printers and Destructors'' test more verbose, taking
8694 `yacc.c''s behavior as (possibly wrong) reference.
8695
8696 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
8697 instead of fprint on stdout.
8698 Set and report the last_line of the symbols.
8699 Consistently display values and locations.
8700
6d9e8019
PE
87012002-11-16 Paul Eggert <eggert@twinsun.com>
8702
8703 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
8704
6e649e65
PE
87052002-11-15 Paul Eggert <eggert@twinsun.com>
8706
b25d88f6
PE
8707 * tests/actions.at (Actions after errors): New test case.
8708
6e649e65
PE
8709 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
8710 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
8711 tests/action.at, tests/calc.at, tests/conflicts.at,
8712 tests/cxx-type.at, tests/regression.at:
8713 "parse error" -> "syntax error" for POSIX compatibility.
8714 "parsing stack overflow..." -> "parser stack overflow" so
8715 that code matches Bison documentation.
8716
0f39aab9
AD
87172002-11-15 Akim Demaille <akim@epita.fr>
8718
8719 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
8720 take two BRACED_CODE, not two string_content.
8721 Free the scanner's obstack when we are done.
8722 (code_content): New.
8723 * tests/calc.at: Adjust.
8724 * doc/bison.texinfo: Adjust.
8725 Also, make sure to include the `,' for these declarations.
8726
761c1926
AD
87272002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
8728
8729 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
8730 definition; avoids potential autoreconf problems.
8731
b0f98b10
AD
87322002-11-15 Akim Demaille <akim@epita.fr>
8733
8734 Always check the value returned by yyparse.
8735
8736 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
8737 returned by yyparse.
8738 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
8739 Adjust calls.
8740 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
8741 returned by yyparse.
8742
970785f1
PH
87432002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8744
8745 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
8746 on input.at test.
8747
8fcc7db1
PE
87482002-11-14 Paul Eggert <eggert@twinsun.com>
8749
7ec1b48e
PE
8750 * src/output.c (output_skeleton): Call xfopen instead of
8751 duplicating xfopen's body.
8752
cfff7583 8753 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 8754 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 8755
8fcc7db1
PE
8756 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
8757 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
8758 Group compiler. Instead, use "$CC -E bar.c". Include the .h
8759 file twice in the grammar, as an extra check.
8760
8761 * tests/input.at (Torturing the Scanner): Surround the
8762 backslash-newline tests with "#if 0", to make it less likely that
8763 we'll run into compiler bugs. Bring back solitary \ inside
8764 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 8765 test backslash-newline in C character constant.
8fcc7db1 8766
4e8d992c
AD
87672002-11-14 Akim Demaille <akim@epita.fr>
8768
8769 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
8770 status of the compiler.
f32b346d 8771 Calling `exit 1' is no longer needed.
4e8d992c
AD
8772 Reported by Nelson H. F. Beebe.
8773
9501dc6e
AD
87742002-11-14 Akim Demaille <akim@epita.fr>
8775
8776 * tests/atlocal.in (CPPFLAGS): We have config.h.
8777 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
8778 New.
8779 * tests/actions.at, tests/calc.at, tests/conflicts.at,
8780 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
8781 * tests/regression.at, tests/torture.at: Use them for all the
8782 grammars that are to be compiled.
8783 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
8784 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
8785 * doc/bison.texinfo (GLR Parsers): Document `inline'.
8786
18b519c0
AD
87872002-11-14 Akim Demaille <akim@epita.fr>
8788
8789 * doc/bison.texinfo: Various formatting changes (alignments in
8790 samples, additional @group/@end group, GCS in samples.
8791 Use @deffn instead of simple @table to define the directives,
8792 macros, variables etc.
8793
9a86cdb9
PE
87942002-11-13 Paul Eggert <eggert@twinsun.com>
8795
daa33def 8796 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 8797 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 8798
daa33def 8799 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 8800 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
8801 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
8802 * tests/headers.at (export YYLTYPE): Likewise.
8803
8804 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 8805 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 8806
9a86cdb9
PE
8807 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
8808 comments, since they're not portable. Use GNU coding style.
8809
9c1e26bd
AD
88102002-11-13 Akim Demaille <akim@epita.fr>
8811
8812 * data/yacc.c: Leave bigger chunks of quoted text.
8813 (YYDSYMPRINTF): New.
8814 Use it to report symbol activities.
8815 * data/glr.c (YYDSYMPRINTF): New.
8816 Use it.
8817
87f721cc
PE
88182002-11-12 Paul Eggert <eggert@twinsun.com>
8819
8820 Version 1.75b.
8821
8822 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
8823 (yyglrReduce): Return yyok, not 0.
8824 This should avoid the enumerated-type warnings reported
464c6927 8825 by Nelson H. F. Beebe in
161a71f3 8826 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
8827
8828 * lib/bbitset.h (BITSET_INLINE): Remove.
8829 * lib/bitset.h [! BITSET_INLINE]: Remove.
8830 (bitset_set, bitset_reset, bitset_test): Rename local vars
8831 to avoid shadowing warnings by GCC.
8832
8833 * data/glr.c (inline): Remove #define. It's the user's
8834 responsibility to #define it away, just like 'const'.
464c6927 8835 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 8836 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 8837
87f721cc
PE
8838 * Makefile.maint (po-check): Scan .l and .y files instead of the
8839 .c and the .h files that they generate. This fixes the bug
8840 reported by Tim Van Holder in:
161a71f3 8841 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
8842 Look for N_ as well as for _. Try to avoid matching #define for
8843 N_ and _.
8844 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
8845 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
8846 * src/scan-gram.l: Revamp regular expressions so that " and '
8847 do not confuse xgettext.
8848
8849 * src/struniq.h (struniq_new): Do not declare the return type
8850 to be 'const'; this violates the C standard.
8851 * src/struniq.c (struniq_new): Likewise.
8852
be14ade5
AD
88532002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
8854
8855 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
8856 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
8857 linker.
8858
05291fbc
AD
88592002-11-12 Akim Demaille <akim@epita.fr>
8860
8861 * Makefile.maint: Sync with Autoconf:
8862 (local_updates): New.
8863
1f5fd52e
AD
88642002-11-12 Akim Demaille <akim@epita.fr>
8865
8866 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
8867
283f1e64
AD
88682002-11-12 Akim Demaille <akim@epita.fr>
8869
8870 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
8871 locations.
8872
886b69d1
AD
88732002-11-12 Akim Demaille <akim@epita.fr>
8874
8875 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
8876 not yyvalue.
8877
3df37415
AD
88782002-11-12 Akim Demaille <akim@epita.fr>
8879
8880 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
8881 Use it to test the GLR parser.
8882
7bd6c77e
AD
88832002-11-12 Akim Demaille <akim@epita.fr>
8884
8885 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
8886 defines it.
8887 * data/glr.c (yystos): New.
8888 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
8889 (YYDSYMPRINT): New.
8890 (yyval): Don't define it, it is handled via M4.
8891 (yyrecoverParseError): Free verbosely the discarded symbols.
8892 * data/yacc.c (yysymprint): Remove, rather...
8893 (b4_yysymprint_generate): invoke.
8894 * data/c.m4 (b4_yysymprint_generate): New.
8895 Accept pointers as arguments, as opposed to the version from
8896 yacc.c.
8897 (b4_yydestruct_generate): Likewise.
8898 * tests/cations.at (Printers and Destructors): Use Bison directives
8899 instead of CPP macros.
8900 Don't rely on internal details.
8901
b0400cc6
AD
89022002-11-12 Akim Demaille <akim@epita.fr>
8903
8904 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
8905 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
8906 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
8907 it against YYEMPTY and so forth), work on yytoken (i.e., set
8908 it to YYEMPTY etc.).
8909 (yydestruct): Replace with a b4_yydestruct_generate invocation.
8910 (b4_symbol_actions): Remove.
8911 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
8912 for 0, end-of-input.
8913
72f889cc
AD
89142002-11-12 Akim Demaille <akim@epita.fr>
8915
8916 * doc/bison.texinfo (Destructor Decl): New.
8917
b1ae9233
AD
89182002-11-12 Akim Demaille <akim@epita.fr>
8919
8920 * src/tables.c (tables_generate): Use free for pointers that
8921 cannot be NULL, not XFREE.
8922 (pack_vector): Use assert, not fatal, for bound violations.
8923 * src/state.c (state_new): Likewise.
8924 * src/reader.c (reader): Likewise.
8925 * src/lalr.c (set_goto_map): Likewise.
72f889cc 8926 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
8927 the file name.
8928
7ec2d4cd
AD
89292002-11-12 Akim Demaille <akim@epita.fr>
8930
8931 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
8932 Restore.
8933 * src/scan-gram.l (last_string): Is global to the file, not to
8934 yylex.
8935 * src/parse-gram.y (input): Don't append the epilogue here,
8936 (epilogue.opt): do it here, and free the scanner's obstack.
8937 * src/reader.c (epilogue_set): Rename as...
8938 (epilogue_augment): this.
8939 * data/c.m4 (b4_epilogue): Defaults to empty.
8940
573a6cd3
AD
89412002-11-12 Akim Demaille <akim@epita.fr>
8942
8943 * src/getargs.c (long_options): Remove duplicates.
8944 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
8945 Remove.
8946 * doc/bison.rnh: Remove.
8947 * doc/bison.texinfo (VMS Invocation): Remove.
8948
95612cfa
AD
89492002-11-12 Akim Demaille <akim@epita.fr>
8950
8951 * src/struniq.h, src/struniq.c (struniq_t): Is const.
8952 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
8953
8954 Use struniq for symbols.
8955
8956 * src/symtab.h (symbol_t): The tag member is a struniq.
8957 (symbol_type_set): Adjust.
8958 * src/symtab.c (symbol_new): Takes a struniq.
8959 (symbol_free): Don't free the tag member.
8960 (hash_compare_symbol_t, hash_symbol_t): Rename as...
8961 (hash_compare_symbol, hash_symbol): these.
8962 Use the fact that tags as struniqs.
8963 (symbol_get): Use struniq_new.
8964 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
8965 Returns a strniq.
8966 * src/reader.h (merger_list, grammar_currentmerge_set): The name
8967 and type members are struniqs.
8968 * src/reader.c (get_merge_function)
8969 (grammar_current_rule_merge_set): Adjust.
8970 (TYPE, current_type): Are struniq.
8971
8972 Use struniq for file names.
8973
8974 * src/files.h, src/files.c (infile): Split into...
8975 (grammar_file, current_file): these.
8976 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
8977 * src/reduce.c (reduce_print): Likewise.
8978 * src/getargs.c (getargs): Likewise.
8979 * src/complain.h, src/complain.c: Likewise.
8980 * src/main.c (main): Call struniqs_new early enough to use it for
8981 file names.
8982 Don't free the input file name.
8983
3e6656f9
AD
89842002-11-12 Akim Demaille <akim@epita.fr>
8985
8986 * src/symtab.c (symbol_free): Remove dead deactivated code:
8987 type_name are properly removed.
8988 Don't use XFREE to free items that cannot be NULL.
8989 * src/struniq.h, src/struniq.c: New.
8990 * src/main.c (main): Initialize/free struniqs.
8991 * src/parse-gram.y (%union): Add astruniq member.
8992 (yyprint): Adjust.
8993 * src/scan-gram.l (<{tag}>): Return a struniq.
8994 Free the obstack bit that used to store it.
8995 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
8996
7672019c
PE
89972002-11-11 Paul Eggert <eggert@twinsun.com>
8998
8999 Revamp to fix many (but not all) of the C- and M4-related quoting
9000 problems. Among other things, this fixes the Bison bug reported
9001 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 9002 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
9003
9004 Use new @ escapes consistently. Represent brackets with @{ and @}
9005 rather than @<:@ and @:>@, since this works a bit better with dumb
9006 editors like vi. Represent @ with @@, since @ is now consistently
9007 an escape. Use @oline@ and @ofile@ rather than __oline__ and
9008 __ofile__, to avoid unexpected expansions. Similarly, use @output
9009 rather than #output.
9010
9011 * data/c.m4 (b4_copyright): Omit file name from comment, since
9012 the file name could contain "*/".
9013 (b4_synclines_flag): Don't quote the 2nd argument; it should already
9014 be quoted. All uses changed.
9015
9016 * data/glr.c: Use new @ escapes consistently.
9017 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
9018 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
9019 Remove, since they couldn't handle arbitrary characters in file
9020 names.
9021 * data/lalr1.cc: Likewise.
9022 * data/yacc.c: Likewise.
9023
9024 * src/files.c (output_infix): Remove; all uses removed.
9025 * src/files.h: Likewise.
9026
9027 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
9028 mishandled funny characters in file names, and anyway it isn't
9029 needed any more.
9030 * data/yacc.c: Likewise.
9031 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
9032
9033 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
9034 * data/yacc.c: Likewise.
9035
9036 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
9037 strings now.
9038 (muscle_init): Quote filename as a C string.
9039 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
9040 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
9041 * src/output.c (escaped_file_name_output): New function.
9042 (prepare_symbols): Quote tokens for M4.
9043 (prepare): Don't insert output_infix, output_prefix,
9044 output_parser_name, output_header_name; this is now down by scan-skel.
9045 Insert skeleton as a C string.
9046
9047 * src/output.c (user_actions_output, symbol_destructors_output,
9048 symbol_printers_output): Quote filenames for C and M4.
9049 * src/reader.c (prologue_augment, epilogue_set): Likewise.
9050
9051 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
9052 escapes other than \\ and \'; this simplifies the code.
9053 (<SC_STRING>): Likewise, for \\ and \".
9054 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
9055 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
9056 Use new escapes @{ and @} for [ and ].
9057
9058 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
9059 them with auto vars.
9060 Switch to new escape scheme, where @ is the escape character uniformly.
9061 Abort if a stray escape character is found. Avoid unbounded input
9062 buffer when parsing non-escaped text.
9063
9064 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
9065 __oline__, #output, $@, and @{ do not have unintended meanings.
9066
acea4f3b
PE
90672002-11-09 Paul Eggert <eggert@twinsun.com>
9068
9069 Fix the test failure due to GCC warnings described in
161a71f3 9070 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
9071 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
9072 evaluate to 0 if it's impossible for NINF to be in the respective
9073 table.
9074 (yygetLRActions, yyrecoverParseError): Use them.
9075
9076 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
9077 counted in the token inserted at end of file. Now takes
9078 location_t *, not location_t, so that the location can be
9079 adjusted. All uses changed.
9080
9081 * tests/regression.at (Invalid inputs): Adjust wording in
9082 diagnostic to match the new behavior.
9083
9084 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
9085 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
9086 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
9087 abort ();'. This reduces the runtime of the "Many lookaheads"
9088 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
9089 GCC 3.2.
9090
20ef1ad5
PE
90912002-11-07 Paul Eggert <eggert@twinsun.com>
9092
9093 * src/parse-gram.y (CHARACTER): Remove unused token.
9094 All uses removed.
9095
9096 * src/scan-gram.l: Remove stack option. We no longer use the
9097 stack, since the stack was never deeper than 1; instead, use the
9098 new auto var c_context to record the stacked value.
9099
9100 Remove nounput option. At an unexpected end of file, we now unput
9101 the minimal input necessary to end cleanly; this simplifies the
9102 code.
9103
9104 Avoid unbounded token sizes where this is easy.
9105
9106 (unexpected_end_of_file): New function.
9107 Use it to systematize the error message on unexpected EOF.
9108 (last-string): Now auto, not static.
9109 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
9110 (scanner_last_string_free): Remove; not used.
9111 (percent_percent_count): Move decl to just before use.
9112 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
9113 not the (never otherwised-used) CHARACTER.
9114
93724f13
AD
91152002-11-07 Akim Demaille <akim@epita.fr>
9116
9117 Let yyerror always receive the msg as last argument, so that
9118 yyerror can be variadic.
9119
9120 * data/yacc.c (b4_yyerror_args): New.
9121 Use it when calling yyerror.
9122 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
9123 Use it when calling yyerror.
9124 * doc/bison.texinfo (Error Reporting): Adjust.
9125 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
9126 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
9127
6e40b4eb
AD
91282002-11-06 Akim Demaille <akim@epita.fr>
9129
9130 #line should have quoted strings.
9131 Ideally, this should be done by m4_quotearg.
9132
9133 * src/scan-skel.l: Include quotearg.h.
9134 Quote __ofile__.
9135 * src/output.c (symbol_printers_output)
9136 (symbol_destructors_output): Quote the file name.
9137
2dfbfc12
AD
91382002-11-06 Akim Demaille <akim@epita.fr>
9139
9140 * tests/regression.at (Invalid inputs): Adjust to the recent
9141 messages.
9142
437c2d80
AD
91432002-11-06 Akim Demaille <akim@epita.fr>
9144
9145 Restore --no-lines.
9146 Reported by Jim Kent.
9147
9148 * data/c.m4 (b4_syncline): New.
9149 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
9150 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
9151 * src/output.c (user_actions_output): Likewise.
9152 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 9153 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 9154
900c5db5
AD
91552002-11-06 Akim Demaille <akim@epita.fr>
9156
9157 * src/main.c (main): Free `infile'.
9158 * src/scan-gram.l (handle_syncline): New.
9159 Recognize `#line'.
9160 * src/output.c (user_actions_output, symbol_destructors_output)
9161 (symbol_printers_output): Use the location's file name, not
9162 infile.
9163 * src/reader.c (prologue_augment, epilogue_set): Likewise.
9164
e183b123 91652002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 9166
e183b123 9167 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 9168 either has GLR conflict entries.
e183b123 9169
193eb6b7
PE
91702002-11-05 Paul Eggert <eggert@twinsun.com>
9171
e183b123
PE
9172 * src/scan-gram.l: Use more accurate diagnostics, e.g.
9173 "integer out of range" rather than "invalid value".
9174 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
9175 accordingly.
9176
193eb6b7
PE
9177 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
9178 Also, remove one static variable in the scanner.
9179
9180 * src/scan-gram.l (braces_level): Now auto, not static.
9181 Initialize to zero if the compiler is being picky.
9182 (INITIAL): Clear braces_level instead of incrementing it.
9183 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
9184 as POSIX 1003.1-2001 requires.
9185 * src/system.h (IF_LINT): New macro, taken from coreutils.
9186 * configure.ac: Define "lint" if --enable-gcc-warnings.
9187
29c01725
AD
91882002-11-05 Akim Demaille <akim@epita.fr>
9189
9190 * src/scan-gram.l: When it starts with `%', complain about the
9191 whole directive, not just that `invalid character: %'.
9192
8aeac3ca
AD
91932002-11-04 Akim Demaille <akim@epita.fr>
9194
9195 * Makefile.maint: Update from Autoconf.
9196 (update, cvs-update, po-update, do-po-update): New.
9197
793a58bb
AD
91982002-11-04 Akim Demaille <akim@epita.fr>
9199
9200 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
9201 and yyerror.
9202 Have yyerror `use' its arguments.
9203 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
9204 returns true when location & yacc & pure & parse-param.
9205 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
9206
c4d720cd
AD
92072002-11-04 Akim Demaille <akim@epita.fr>
9208
9209 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
9210 clashes.
9211 * src/scan-gram.l: Use [\'] instead of ['] to pacify
9212 font-lock-mode.
9213 Use complain_at.
9214 Use quote, not quote_n since LOCATION_PRINT no longer uses the
9215 slot 0.
9216
613a0dc5
PE
92172002-11-03 Paul Eggert <eggert@twinsun.com>
9218
9219 * src/reader.c (get_merge_function, grammar_current_rule_check):
9220 Use consistent diagnostics for reporting type name clashes.
9221 Quote the types with <>, for consistency with Yacc.
9222 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
9223
2a8d363a
AD
92242002-11-03 Akim Demaille <akim@epita.fr>
9225
9226 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
9227 New.
9228 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
9229 (b4_parse_param): Remove.
9230 Use b4_identification.
9231 Propagate b4_pure_args where needed to pass them to yyerror.
9232 * data/glr.m4 (b4_parse_param): Remove.
9233 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
9234 (b4_lpure_formals): New.
9235 Use b4_identification.
9236 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
9237 b4_user_formals and b4_user_args.
9238 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
9239 (yyreportAmbiguity): When using a pure parser, also need
9240 the location, and the parse-params.
9241 Adjust callers.
9242 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
9243 When using a pure parser, also need the parse-params.
9244 Adjust callers.
9245 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
9246 (%pure-parser + %parse-param) LALR and GLR parsers.
9247 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
9248 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
9249 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
9250 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
9251 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
9252 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
9253 * doc/bison.texinfo: Untabify the whole file.
9254 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
9255 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
9256 (Error Reporting): Adjust to these new directives.
9257 Document %error-verbose, deprecate YYERROR_VERBOSE.
9258
9e32add8
AD
92592002-11-03 Akim Demaille <akim@epita.fr>
9260
9261 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
9262 AT_CHECK_CALC_GLR invocations to use % directives, instead of
9263 command line options.
9264 * tests/cxx-type.at: Formatting changes.
9265
b02d90a5
PE
92662002-11-03 Paul Eggert <eggert@twinsun.com>
9267
9268 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
9269 to count columns correctly, and to check for invalid inputs.
9e32add8 9270
b02d90a5
PE
9271 Use mbsnwidth to count columns correctly. Account for tabs, too.
9272 Include mbswidth.h.
9273 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
9274 (extend_location): New function.
9275 (YY_LINES): Remove.
9276
9277 Handle CRLF in C code rather than in Lex code.
9278 (YY_INPUT): New macro.
9279 (no_cr_read): New function.
9280
9281 Scan UCNs, even though we don't fully handle them yet.
9282 (convert_ucn_to_byte): New function.
9283
9284 Handle backslash-newline correctly in C code.
9285 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
9286 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
9287 all uses changed.
9288 (tag, splice): New EREs. Do not allow NUL or newline in tags.
9289 Use {splice} wherever C allows backslash-newline.
9290 YY_STEP after space, newline, vertical-tab.
9291 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 9292
b02d90a5
PE
9293 (letter, id): Don't assume ASCII; e.g., spell out a-z.
9294
9295 ({int}, handle_action_dollar, handle_action_at): Check for integer
9296 overflow.
9e32add8 9297
b02d90a5
PE
9298 (YY_STEP): Omit trailing semicolon, so that it's more like C.
9299
9300 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
9301 as well as \000. Check for UCHAR_MAX, not 255.
9302 Allow \x with an arbitrary positive number of digits, as in C.
9303 Check for overflow here.
9304 Allow \? and UCNs, for compatibility with C.
9305
9306 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
9307 with quote slot used by complain_at.
9308
9309 * tests/input.at: Add tests for backslash-newline, m4 quotes
9310 in symbols, long literals, and funny escapes in strings.
9311
9312 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
9313 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
9314 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
9315 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
9316 * m4/mbswidth.m4: New file, from GNU coreutils.
9317
9318 * doc/bison.texinfo (Grammar Outline): Document // comments.
9319 (Symbols): Document that trigraphs have no special meaning in Bison,
9320 nor is backslash-newline allowed.
9321 (Actions): Document that trigraphs have no special meaning.
9322
9323 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
9324 no longer used.
9325
93262002-11-02 Paul Eggert <eggert@twinsun.com>
9327
9328 * src/reader.c: Don't include quote.h; not needed.
9329 (get_merge_function): Reword warning to be consistent with
9330 type clash diagnostic in grammar_current_rule_check.
9331
9332 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
9333 bug in trigraph handling.
9334
9335 * src/output.c (prepare_symbols): When printing token names,
9336 escape "[" as "@<:@" and likewise for "]".
9337
9338 * src/system.h (errno): Remove declaration, as we are now
9339 assuming C89 or better, and C89 guarantees errno.
9340
762b212b
PE
93412002-10-30 Paul Eggert <eggert@twinsun.com>
9342
9343 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
9344 Check for close failures.
9345 * src/files.h (xfclose): Return void, not int, since it always
9346 returned zero.
9347 * src/files.c (xfclose): Likewise. Report I/O error if ferror
9348 indicates one.
9349 * src/output.c (output_skeleton): Use xfclose rather than fclose
9350 and ferror. xfclose now checks ferror.
9351
9352 * data/glr.c (YYLEFTMOST_STATE): Remove.
9353 (yyreportTree): Use a stack-based leftmost state. This avoids
9354 our continuing battles with bogus warnings about initializers.
9355
56100c60
AD
93562002-10-30 Akim Demaille <akim@epita.fr>
9357
9358 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
9359 #if.
9360
51b4a04c
PH
93612002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9362
9363 * tests/glr-regr1.at: New test for reported regressions.
9364 * tests/testsuite.at: Add glr-regr1.at test.
9365 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 9366
bf1ebda2
PE
93672002-10-24 Paul Eggert <eggert@twinsun.com>
9368
5c16c6b1
PE
9369 Version 1.75a.
9370
bf1ebda2
PE
9371 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
9372 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
9373 we use malloc. Don't assume 'A' through 'Z' are contiguous.
9374 Don't assume strdup exists; POSIX says its an XSI extension.
9375 Check for buffer overflow on input.
9376
b526ee61
AD
93772002-10-24 Akim Demaille <akim@epita.fr>
9378
9379 * src/output.c (output_skeleton): Don't disable M4sugar comments
9380 too soon: it results in comments being expanded.
9381 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
9382 first output.
9383
f1886bb2
AD
93842002-10-24 Akim Demaille <akim@epita.fr>
9385
9386 * data/yacc.c (m4_int_type): New.
9387 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
9388 char' as only yacc.c wants K&R portability.
9389 * data/glr.c (yysigned_char): Remove.
9390 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
9391 Reported by Quoc Peyrot.
9392
c5576256
PE
93932002-10-23 Paul Eggert <eggert@twinsun.com>
9394
9395 * src/main.c (main): With --trace=time, report times even if a
9396 non-fatal error occurs. Formerly, the times were reported in some
9397 such cases but not in others.
9398 * src/reader.c (reader): Just return if a complaint has been issued,
9399 instead of exiting, so that 'main' can report times.
9400
27b0ffea
AD
94012002-10-22 Akim Demaille <akim@epita.fr>
9402
9403 * src/system.h: Include sys/types.
9404 Reported by Bert Deknuydt.
9405
223a7883
PE
94062002-10-23 Paul Eggert <eggert@twinsun.com>
9407
9408 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
9409 Suggested by Art Haas.
9410
94112002-10-22 Paul Eggert <eggert@twinsun.com>
9412
9413 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
9414 decl; not needed any more.
9415 * src/main.c (main): Use return to exit, undoing yesterday's change.
9416 The last OS that we could find where this wouldn't work is
9417 SunOS 3.5, and that's too old to worry about now.
9418
9419 * data/glr.c (struct yyltype): Define members even when not
9420 doing locations. This is more consistent with yacc.c, and it
9421 works around the following bug reports:
161a71f3
PE
9422 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
9423 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 9424
223a7883
PE
9425 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
9426 @acronym consistently. Standardize on "Yacc" instead of "YACC",
9427 "Algol" instead of "ALGOL". Give a bit more history about BNF.
9428
8b76775a
AD
94292002-10-22 Akim Demaille <akim@epita.fr>
9430
9431 * data/README: New.
9432
6db10d14
PE
94332002-10-21 Paul Eggert <eggert@twinsun.com>
9434
9435 Be consistent about 'bool'; the old code used an enum in one
9436 module and an int in another, and this violates the C standard.
9437 * m4/stdbool.m4: New file, from coreutils 4.5.3.
9438 * configure.ac (AC_HEADER_STDBOOL): Add.
9439 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
9440 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
9441 * src/symtab.c (hash_compare_symbol_t): Likewise.
9442 * src/system.h (bool, false, true): Use a definition consistent
9443 with ../lib/hash.c. All uses changed.
9444
9445 * src/complain.c (warning_issued): Renamed from warn_message_count,
9446 so that we needn't worry about integer overflow (!).
9447 Now of type bool. All uses changed.
9448 (complaint_issued): Renamed from complain_message_count; likewise.
9449
9450 * src/main.c (main): Use exit to exit with failure.
27b0ffea 9451
6db10d14
PE
9452 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
9453 rather than 1 and 0.
9454 * src/main.c (main): Likewise.
9455 * src/getargs.c (getargs): Likewise.
9456 * src/reader.c (reader): Likewise.
9457
9458 * src/getarg.c (getargs): Remove duplicate code for
9459 "Try `bison --help'".
9460
9461 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
9462 What was that "2" for?
9463
9464 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
9465 * src/getargs.c (usage): Likewise.
9466
9467 * src/getargs.c (getargs): When there are too few operands, report
9468 the last one. When there are too many, report the first extra
9469 one. This is how diffutils does it.
9470
92a060fd
PE
94712002-10-20 Paul Eggert <eggert@twinsun.com>
9472
9473 Remove K&R vestiges.
9474 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
9475 * src/complain.c (VA_START): Remove. Assume prototypes.
9476 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
9477 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
9478 fatal): Assume prototypes.
9479 * src/complain.h: Assume prototypes.
9480 * src/system.h (PARAMS): Remove.
9481 Include <limits.h> unconditionally, since it's guaranteeed even
9482 for a freestanding C89 compiler.
9483 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
9484 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 9485
e7cb57c0
AD
94862002-10-20 Akim Demaille <akim@epita.fr>
9487
9488 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
9489 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
9490 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
9491 (yyresolveStates, yyresolveAction, yyresolveStack)
9492 (yyprocessOneStack): Use them.
9493 (yy_reduce_print): New.
9494 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
9495
0245f82d
AD
94962002-10-20 Akim Demaille <akim@epita.fr>
9497
9498 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
9499 arguments and output `void'.
9500 (b4_c_function): Rename as...
9501 (b4_c_function_def): this.
9502 (b4_c_function_decl, b4_c_ansi_function_def)
9503 (b4_c_ansi_function_decl): New.
9504 Change the interpretation of the arguments: before `int, foo', now
9505 `int foo, foo'.
9506 * data/yacc.c (yyparse): Prototype and define thanks to these.
9507 Adjust b4_c_function_def uses.
9508 * data/glr.c (yyparse): Likewise, but ANSI only.
9509
39912f52
AD
95102002-10-20 Akim Demaille <akim@epita.fr>
9511
9512 * src/output.c (prepare): Move the definition of `tokens_number',
9513 `nterms_number', `undef_token_number', `user_token_number_max'
9514 to...
9515 (prepare_tokens): Here.
9516 (prepare_tokens): Rename as...
9517 (prepare_symbols): this.
9518 (prepare): Move the definition of `rules_number' to...
9519 (prepare_rules): here.
9520 (prepare): Move the definition of `last', `final_state_number',
9521 `states_number' to...
9522 (prepare_states): here.
9523 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
9524
20c1e2ad
AD
95252002-10-20 Akim Demaille <akim@epita.fr>
9526
9527 * src/tables.h, src/tables.c, src/output.c: Comment changes.
9528
21964f43
AD
95292002-10-20 Akim Demaille <akim@epita.fr>
9530
9531 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
9532 * data/c.m4: here.
9533
66d30cd4
AD
95342002-10-20 Akim Demaille <akim@epita.fr>
9535
9536 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
9537 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
9538 `pair'.
9539 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
9540 `name' to...
9541 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
9542 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
9543 These.
9544
95f2c9fe
PE
95452002-10-19 Paul Eggert <eggert@twinsun.com>
9546
9547 Do not create a temporary file, as that involves security and
9548 cleanup headaches. Instead, use a pair of pipes.
9549 Derived from a suggestion by Florian Krohm.
9550 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
9551 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
9552 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
9553 (BISON_PREREQ_SUBPIPE): Add.
9554 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
9555 Add subpipe.h, subpipe.c.
9556 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
9557 * po/POTFILES.in: Add lib/subpipe.c.
9558 * src/output.c: Include "subpipe.h".
9559 (m4_invoke): Remove decl.
9560 (scan_skel): New decl.
9561 (output_skeleton): Use pipe rather than temporary file for m4 input.
9562 Check that m4sugar.m4 is readable, to avoid deadlock.
9563 Check for pipe I/O error.
9564 * src/scan-skel.l (readpipe): Remove decl.
9565 (scan_skel): New function, to be used in place of m4_invoke.
9566 Read from stream rather than file.
66d30cd4 9567
95f2c9fe
PE
9568 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
9569 float, as this generates a warning on Solaris 8 + GCC 3.2 with
9570 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
9571 this generates a more-accurate value anyway.
9572
9573 * lib/timevar.c (timervar_accumulate): Rename locals to
9574 avoid confusion with similarly-named more-global.
9575 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
9576
9577 * src/output.c (prepare): Use xstrdup to convert char const *
9578 to char *, to avoid GCC warning.
9579
c19988b7
AD
95802002-10-19 Akim Demaille <akim@epita.fr>
9581
9582 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
9583 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
9584 Use them to have `calc.y' ready for %pure-parser.
9585 * data/yacc.c (YYLEX): Pass a yylex return type to
9586 b4_c_function_call.
9587
ae7453f2
AD
95882002-10-19 Akim Demaille <akim@epita.fr>
9589
9590 Prototype support of %lex-param and %parse-param.
9591
9592 * src/parse-gram.y: Add the definition of the %lex-param and
9593 %parse-param tokens, plus their rules.
9594 Drop the `_' version of %glr-parser.
9595 Add the "," token.
9596 * src/scan-gram.l (INITIAL): Scan them.
9597 * src/muscle_tab.c: Comment changes.
9598 (muscle_insert, muscle_find): Rename `pair' as `probe'.
9599 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
9600 (muscle_entry_s): The `value' member is no longer const.
9601 Adjust all dependencies.
9602 * src/muscle_tab.c (muscle_init): Adjust: use
9603 MUSCLE_INSERT_STRING.
9604 Initialize the obstack earlier.
9605 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
9606 (muscle_pair_list_grow): New.
9607 * data/c.m4 (b4_c_function_call, b4_c_args): New.
9608 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
9609 * tests/calc.at: Use %locations, not --locations.
9610 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
9611
0e575721
AD
96122002-10-19 Akim Demaille <akim@epita.fr>
9613
9614 * src/getargs.c (usage): Take status as argument and exit
9615 accordingly.
9616 Report the traditional `Try ... --help' message when status != 0.
9617 (usage, version): Don't take a FILE * as arg, it is pointless.
9618 (getargs): When there is an incorrect number of arguments, make it
9619 an error, and report it GNUlically thanks to `usage ()'.
9620
724ce7f5
PE
96212002-10-18 Paul Eggert <eggert@twinsun.com>
9622
3a781eb2
PE
9623 * data/glr.c (yyreportParseError): Don't assume that sprintf
9624 yields the length of the printed string, as this is not true
9625 on SunOS 4.1.4. Reported by Peter Klein.
9626
724ce7f5
PE
9627 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
9628 * tests/conflicts.at (%nonassoc and eof): Likewise.
9629 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
9630
473d0a75
AD
96312002-10-17 Akim Demaille <akim@epita.fr>
9632
9633 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
9634 * src/getargs.c (trace_types, trace_args): Adjust.
9635 * src/reader.c (grammar_current_rule_prec_set)
9636 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
9637 Standardize error messages.
9638 And s/@prec/%prec/!
9639 (reader): Use trace_flag to enable scanner/parser debugging,
9640 instead of an adhoc scheme.
9641 * src/scan-gram.l: Remove trailing debugging code.
9642
e76d2469
PE
96432002-10-16 Paul Eggert <eggert@twinsun.com>
9644
93e2236a
PE
9645 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
9646 MUSCLE_TAB_H.
9647
e76d2469
PE
9648 * NEWS: Officially drop support for building Bison with K&R C,
9649 since it didn't work anyway and it's not worth worrying about.
9650 * Makefile.maint (wget_files): Remove ansi2knr.c.
9651 (ansi2knr.c-url_prefix): Remove.
9652 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
9653 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9654 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9655
5bd1c419
PE
96562002-10-15 Paul Eggert <eggert@twinsun.com>
9657
9658 Stop using the "enum_" trick for K&R-style function definitions;
9659 it confused me, and I was the author! Instead, assume that people
9660 who want to use K&R C compilers (when using these modules in GCC,
9661 perhaps?) will run ansi2knr.
9662
9663 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
9664 All uses of "enum_" changed to "enum ".
9665 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9666 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 9667
5bd1c419
PE
9668 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
9669 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
9670 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
9671 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
9672 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
9673 abitset_not, abitset_ones, abitset_or, abitset_or_and,
9674 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
9675 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
9676 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
9677 Use function prototypes; this removes the need for declaring
9678 static functions simply to provide their prototypes.
9679 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
9680 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
9681 bitset_count_, bitset_create, bitset_dump, bitset_first,
9682 bitset_free, bitset_init, bitset_last, bitset_next,
9683 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
9684 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
9685 bitset_print, bitset_release_memory, bitset_toggle_,
9686 bitset_type_choose, bitset_type_get, bitset_type_name_get,
9687 debug_bitset): Likewise.
9688 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
9689 * lib/bitset_stats.c (bitset_log_histogram_print,
9690 bitset_percent_histogram_print, bitset_stats_and,
9691 bitset_stats_and_cmp, bitset_stats_and_or,
9692 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
9693 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
9694 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
9695 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
9696 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
9697 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
9698 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
9699 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
9700 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
9701 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
9702 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
9703 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
9704 bitset_stats_zero): Likewise.
9705 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9706 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9707 bitsetv_dump, debug_bitsetv): Likewise.
9708 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
9709 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
9710 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
9711 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
9712 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
9713 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
9714 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
9715 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
9716 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
9717 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
9718 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
9719 Likewise.
9720 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
9721 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
9722 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
9723 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
9724 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
9725 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
9726 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
9727 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
9728 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
9729 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
9730 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 9731
ae26e1f0
AD
97322002-10-14 Akim Demaille <akim@epita.fr>
9733
9734 Version 1.75.
9735
d43baf71
AD
97362002-10-14 Akim Demaille <akim@epita.fr>
9737
9738 * tests/Makefile.am (maintainer-check-posix): New.
9739
7ebc83e3
AD
97402002-10-14 Akim Demaille <akim@epita.fr>
9741
9742 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
9743 member.
9744
05846dae
AD
97452002-10-14 Akim Demaille <akim@epita.fr>
9746
9747 * src/tables.c (table_ninf_remap): base -> tab.
9748 Reported by Matt Rosing.
9749
1318e37d
PE
97502002-10-14 Paul Eggert <eggert@twinsun.com>
9751
447fbb17
PE
9752 * tests/action.at, tests/calc.at, tests/conflicts.at,
9753 tests/cxx-type.at, tests/headers.at, tests/input.at,
9754 tests/regression.at, tests/synclines.at, tests/torture.at:
9755 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
9756 so that the tests still work even if POSIXLY_CORRECT is set.
9757 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 9758
1318e37d
PE
9759 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
9760 for portability to K&R hosts. Fix typo: signed char is guaranteed
9761 only to 127, not to 128.
9762 * data/glr.c (yysigned_char): New type.
9763 * data/yacc.c (yysigned_char): Likewise.
9764 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
9765
cc0f0794
PE
97662002-10-13 Paul Eggert <eggert@twinsun.com>
9767
5038f418
PE
9768 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
9769 true due to limited range of data type" warning from GCC.
9770
cc0f0794
PE
9771 * data/c.m4 (b4_token_defines): Protect against double-inclusion
9772 by wrapping enum yytokentype's definition inside #ifndef
9773 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
9774
6fed0802
AD
97752002-10-13 Akim Demaille <akim@epita.fr>
9776
9777 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
9778 Un yy- yyrhs to avoid the name clash with the global YYRHS.
9779
32f0598d
AD
97802002-10-13 Akim Demaille <akim@epita.fr>
9781
9782 * Makefile.maint: Update from Autoconf 2.54.
9783 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
9784
7ea9a33f
AD
97852002-10-13 Akim Demaille <akim@epita.fr>
9786
9787 * src/print.c (print_state): Separate the list of solved conflicts
9788 from the other items.
9789 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
9790
ea99527d
AD
97912002-10-13 Akim Demaille <akim@epita.fr>
9792
9793 Let nondeterministic skeletons be usable with deterministic
9794 tables.
9795
9796 With the patch, GAWK compiled by GCC without -O2 passes its test
9797 suite using a GLR parser driven by LALR tables. It fails with -O2
9798 because `struct stat' gives two different answers on my machine:
9799 88 (definition of an auto var) and later 96 (memset on this var).
9800 Hence the stack is badly corrumpted. The headers inclusion is to
9801 blame: if I move the awk.h inclusion before GLR's system header
9802 inclusion, the two struct stat have the same size.
9803
9804 * src/tables.c (pack_table): Always create conflict_table.
9805 (token_actions): Always create conflict_list.
9806 * data/glr.c (YYFLAG): Remove, unused.
9807
f377f69f
AD
98082002-10-13 Akim Demaille <akim@epita.fr>
9809
9810 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
9811 (O0FLAGS): New.
9812 (VALGRIND, GXX): New.
9813 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
9814 * tests/bison.in: Run $PREBISON a pre-command.
9815 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
9816 (maintainer-check-g++): New.
9817 * Makefile.am (maintainer-check): New.
9818
2a1fe6ed
AD
98192002-10-13 Akim Demaille <akim@epita.fr>
9820
9821 * data/glr.c: Formatting changes.
9822 Tweak some trace messages to match yacc.c's.
9823
f50adbbd
AD
98242002-10-13 Akim Demaille <akim@epita.fr>
9825
9826 GLR parsers sometimes raise parse errors instead of performing the
9827 default reduction.
9828 Reported by Charles-Henry de Boysson.
9829
9830 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 9831 check the length of the traces when %glr.
f50adbbd
AD
9832 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
9833 GLR's traces.
9834 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
9835 Test GLR parsers.
9836 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
9837 (yyltype): Remove the yy prefix from the member names.
9838 (yytable): Complete its comment.
9839 (yygetLRActions): Map error action number from YYTABLE from
9840 YYTABLE_NINF to 0.
9841 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
9842 (which was a bug: it should have been YYTABEL_NINF, and yet it was
9843 not satisfying as we could compare an YYACTION computed from
9844 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
9845 only value for error actions.
9846 (yyreportParseError): In verbose parse error messages, don't issue
9847 `error' in the list of expected tokens.
9848 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
9849 next action to perform to match glr.c's decoding.
9850 (yytable): Complete its comment.
9851
bcbad5b9
PE
98522002-10-13 Paul Eggert <eggert@twinsun.com>
9853
9854 Fix problem reported by Henrik Grubbstroem in
161a71f3 9855 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
9856 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
9857 because the Bison parser reads the second action before reducing
9858 the first one.
9859 * src/scan-gram.l (rule_length): New static var.
9860 Use it to keep track of the rule length in the scanner, since
9861 we can't expect the parser to be in lock-step sync with the scanner.
9862 (handle_action_dollar, handle_action_at): Use this var.
9863 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 9864
14904b89
PE
98652002-10-12 Paul Eggert <eggert@twinsun.com>
9866
1fe611e5
PE
9867 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
9868 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
9869 Include <sys/time.h> when checking for clock_t and struct tms.
9870 Use same include order as source.
9871 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 9872 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 9873
1fe611e5
PE
9874 * lib/timevar.c: Update copyright date and clarify comments.
9875 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 9876
1fe611e5
PE
9877 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
9878 GCC version as of today, then merge Bison's changes.
9879 Change "GCC" to "Bison" in copyright notice. timevar.def's
9880 author is Akim, so change that too.
9881
98194095
PE
9882 * src/reader.c (grammar_current_rule_check):
9883 Don't worry about the default action if $$ is untyped.
9884 Prevents bogus warnings reported by Jim Gifford in
161a71f3 9885 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 9886
14904b89
PE
9887 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
9888 * data/glr.c, data/lalr1.cc, data/yacc.c:
9889 Output token definitions before the first part of user declarations.
9890 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 9891 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 9892
ff6dca18
PE
98932002-10-11 Paul Eggert <eggert@twinsun.com>
9894
9895 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
9896 (yyparse): here. This undoes some of the 2002-07-25 change.
9897 Compatibility problem reported by Ralf S. Engelschall with
9898 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
9899
eb714592
AD
99002002-10-11 Akim Demaille <akim@epita.fr>
9901
9902 * tests/regression.at Characters Escapes): New.
9903 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
9904 characters.
9905 Reported by Jan Nieuwenhuizen.
9906
b7195100
AD
99072002-10-11 Akim Demaille <akim@epita.fr>
9908
9909 * po/id.po: New.
9910
f28a0f2d
PE
99112002-10-10 Paul Eggert <eggert@twinsun.com>
9912
9913 Portability fixes for bitsets; this also avoids several GCC
9914 warnings.
9915
9916 * lib/abitset.c: Include <stddef.h>, for offsetof.
9917 * lib/lbitset.c: Likewise.
9918
9919 * lib/abitset.c (abitset_bytes): Return a size that is aligned
9920 properly for vectors of objects. Do not assume that adding a
9921 header size to a multiple of a word size yields a value that is
9922 properly aligned for the whole union.
9923 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9924
9925 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
9926 unique names for structures.
9927 * lib/ebitset.c (ebitset_bytes): Likewise.
9928 * lib/lbitset.c (lbitset_bytes): Likewise.
9929
9930 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
9931 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
9932 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
9933 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
9934 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
9935 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
9936 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
9937 to improve the type-checking that GCC can do.
9938 * lib/bitset.c (bitset_op4_cmp): Likewise.
9939 * lib/bitset_stats.c (bitset_stats_count,
9940 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
9941 bitset_stats_copy, bitset_stats_disjoint_p,
9942 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
9943 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
9944 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
9945 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
9946 bitset_stats_and_or_cmp, bitset_stats_andn_or,
9947 bitset_stats_andn_or_cmp, bitset_stats_or_and,
9948 bitset_stats_or_and_cmp): Likewise.
9949 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
9950 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
9951 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
9952 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
9953
9954 * lib/abitset.h: Include bitset.h, not bbitset.h.
9955 * lib/ebitset.h: Likewise.
9956 * lib/lbitset.h: Likewise.
9957
9958 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
9959 All instances of parameters of type enum bitset_opts are now of
9960 type enum_bitset_opts, to conform to the C Standard, and similarly
9961 for enum_bitset_type.
9962 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9963 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
9964
9965 Do not use "struct bitset_struct" to mean different things in
9966 different modules. Not only is this confusing, it violates
9967 the C Standard, which requires that structure types in different
9968 modules must be compatible if one is to be passed to the other.
9969 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
9970 All instances of "struct bitset_struct *" replaced with "bitset".
9971 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
9972 (union bitset_union, struct abitset_struct, struct ebitset_struct,
9973 struct lbitset_struct, struct bitset_stats_struct): New types.
9974 All uses of struct bitset_struct changed to union bitset_union,
9975 etc.
ba0fe3c7 9976 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
9977 struct bitset_struct): Remove.
9978 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
9979 struct bitset_struct): Remove.
9980 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
9981 bitset_struct): Remove.
9982 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
9983 Likewise.
9984
9985 Do not call a function of type T using a call that assumes the
9986 function is of a different type U. Standard C requires that a
9987 function must be called with a type that is compatible with its
9988 definition.
9989 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9990 New decls.
9991 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9992 New functions.
9993 * lib/ebitset.c (PFV): Remove.
9994 * lib/lbitset.c (PFV): Likewise.
9995 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
9996 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
9997 decls.
9998 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
9999 (ebitset_vtable): Use them.
10000 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
10001 lbitset_xor): New functions.
10002 (lbitset_vtable): Use them.
10003
10004 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
10005 Declare.
10006
10007 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
10008 GCC warning.
10009 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
10010 Use offsetof, for simplicity.
10011
6fbe4984
PE
100122002-10-06 Paul Eggert <eggert@twinsun.com>
10013
10014 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
10015 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 10016 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
10017 which was inadvertently undone by the 2002-09-30 patch.
10018 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
10019 the same width as int.
10020
420f93c8
PE
100212002-10-04 Paul Eggert <eggert@twinsun.com>
10022
10023 Version 1.50.
10024
10025 * configure.ac (AC_INIT), NEWS: Increment version number.
10026
10027 * doc/bison.texinfo: Minor spelling, grammar, and white space
10028 fixes.
10029 (Symbols): Mention that any negative value returned from yylex
10030 signifies end-of-input. Warn about negative chars. Mention
10031 the portable Standard C character set.
10032
10033 The GNU coding standard says CFLAGS and YFLAGS are reserved
10034 for the installer to set.
10035 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
10036 * src/Makefile.am (AM_CFLAGS): Likewise.
10037 (AM_YFLAGS): Renamed from YFLAGS.
10038
10039 Fix some MAX and MIN problems.
10040 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
10041 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
10042 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
10043 * src/reader.c (reader): Use it.
10044
10045 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
10046 POSIX 1003.1-2001 has removed fgrep.
10047
100482002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
10049
10050 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
10051 interpreted as signed.
10052 * lib/ebitset.c (ebitset_list): Fix bug.
10053
ff68026d
PE
100542002-10-01 Paul Eggert <eggert@twinsun.com>
10055
10056 More fixes for 64-bit hosts and large bitsets.
10057
10058 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
10059 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
10060 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
10061 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
10062 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
10063 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
10064 bitset_count_): Likewise.
10065 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
10066 bitset_first, bitset_last): Likewise.
10067 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
10068 bitset_stats_list_reverse, bitset_stats_size,
10069 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
10070 Likewise.
10071 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10072 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
10073 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
10074 bitsetv_reflexive_transitive_closure): Likewise.
10075 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
10076 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
10077 Likewise.
10078 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
10079 Likewise.
420f93c8 10080
ff68026d
PE
10081 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
10082 Use size_t, not unsigned int, to count bytes.
10083 * lib/abitset.h (abitset_bytes): Likewise.
10084 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
10085 Likewise.
10086 * lib/bitset.h (bitset_bytes): Likewise.
10087 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
10088 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
10089 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10090 * lib/ebitset.c (ebitset_bytes): Likewise.
10091 * lib/ebitset.h (ebitset_bytes): Likewise.
10092 * lib/lbitset.c (lbitset_bytes): Likewise.
10093 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 10094
ff68026d
PE
10095 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
10096 abitset_subset_p, abitset_disjoint_p, abitset_and,
10097 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
10098 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
10099 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
10100 abitset_or_and, abitset_or_and_cmp):
10101 Use bitset_windex instead of unsigned int.
10102 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
10103 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
10104 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
10105 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
10106 Likewise.
10107 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 10108
ff68026d
PE
10109 * lib/bitset.c (bitset_print):
10110 Use proper printf formats for widths of integer types.
10111 * lib/bitset_stats.c (bitset_percent_histogram_print,
10112 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
10113 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10114 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
10115 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 10116
ff68026d
PE
10117 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
10118 BITSET_SIZE_MAX): New macros.
10119 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
10120 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
10121 to BITSET_WINDEX_MAX.
10122
10123 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
10124 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
10125 since we now return the bitset_bindex type (not int).
10126
10127 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
10128 when computing sizes.
10129 * lib/ebitset.c (ebitset_elts_grow): Likewise.
10130
10131 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
10132 and avoid cast to unsigned.
10133
6aa452a6
AD
101342002-09-30 Akim Demaille <akim@epita.fr>
10135
10136 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10137 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
10138 Updates from Michael Hayes.
10139
927f7817
AD
101402002-09-30 Art Haas <ahaas@neosoft.com>
10141
10142 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
10143 invocations.
10144 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
10145 defined.
10146
9738f41e
AD
101472002-09-27 Akim Demaille <akim@epita.fr>
10148
10149 Version 1.49c.
10150
a5c75d7f
AD
101512002-09-27 Akim Demaille <akim@epita.fr>
10152
10153 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
10154 (Because of AC_LIBSOURCE).
10155
8280e179
AD
101562002-09-27 Akim Demaille <akim@epita.fr>
10157
10158 Playing with Autoscan.
10159
10160 * configure.ac: Remove the old LIBOBJ tweaks.
10161 (AC_REPLACE_FUNCS): Add strrchr and strtol.
10162 * lib/strrchr.c: New.
10163 * lib/strtol.c: New, from the Coreutils 4.5.1.
10164
ae64af35
AD
101652002-09-27 Akim Demaille <akim@epita.fr>
10166
10167 Playing with Autoscan.
10168
10169 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
10170 * lib/Makefile.am (libbison_a_SOURCES): No longer include
10171 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
10172 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
10173 Coreutils 4.5.1.
10174
d1a1114f
AD
101752002-09-24 Akim Demaille <akim@epita.fr>
10176
10177 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
10178 (Frequently Asked Questions, Parser Stack Overflow): New.
10179
b906441c
AD
101802002-09-13 Akim Demaille <akim@epita.fr>
10181
10182 Playing with autoscan.
10183
10184 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
10185 * src/files.c (skeleton_find): Remove, unused.
10186 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
10187 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
10188
bd701811
AD
101892002-09-13 Akim Demaille <akim@epita.fr>
10190
10191 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
10192 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
10193
e0a13e7b
AD
101942002-09-13 Akim Demaille <akim@epita.fr>
10195
10196 * configure.ac: Require 2.54.
10197 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
10198 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
10199 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
10200 Remove, provided by Autoconf macros.
10201
c97011bf
AD
102022002-09-12 Akim Demaille <akim@epita.fr>
10203
10204 * m4/prereq.m4: Update, from Coreutils 4.5.1.
10205
d862b1be
AD
102062002-09-12 Akim Demaille <akim@epita.fr>
10207
10208 * m4/prereq.m4: Update, from Fileutils 4.1.5.
10209 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
10210 Reported by Martin Mokrejs.
10211
3d38c03a
AD
102122002-09-10 Akim Demaille <akim@epita.fr>
10213
10214 * src/parse-gram.y: Associate a human readable string to each
10215 token type.
10216 * tests/regression.at (Invalid inputs): Adjust.
10217
b6347355
AD
102182002-09-10 Gary V. Vaughan <gary@gnu.org>
10219
10220 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
10221 with an Autoconf-2.5x style configure.ac.
10222
09ba4ab2
PE
102232002-09-06 Paul Eggert <eggert@twinsun.com>
10224
10225 * doc/bison.texinfo (Conditions): Make explicit that the GPL
10226 exception applies only to yacc.c. This is a modification of a
10227 patch originally suggested by Akim Demaille.
10228
21846f69
AD
102292002-09-06 Akim Demaille <akim@epita.fr>
10230
09ba4ab2
PE
10231 * data/c.m4 (b4_copyright): Move the GPL exception comment from
10232 here to...
10233 * data/yacc.c: here.
10234
21846f69
AD
10235 * data/lalr1.cc (struct yyltype): Don't define it, since we use
10236 LocationType.
10237 (b4_ltype): Default to yy::Location from location.hh.
10238
c0ad8bf3
AD
102392002-09-04 Jim Meyering <jim@meyering.net>
10240
10241 * data/yacc.c: Guard the declaration of yytoknum also with
10242 `#ifdef YYPRINT', so it is declared only when used.
10243
3a93251e
AD
102442002-09-04 Akim Demaille <akim@epita.fr>
10245
10246 * configure.in: Rename as...
10247 * configure.ac: this.
10248 Bump to 1.49c.
10249
427c0dda
AD
102502002-09-04 Akim Demaille <akim@epita.fr>
10251
10252 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
10253 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
10254 translate maintainer only messages.
10255
6a254321
PE
102562002-08-12 Paul Eggert <eggert@twinsun.com>
10257
645e30d1
PE
10258 Version 1.49b.
10259
6a254321
PE
10260 * Makefile.am (SUBDIRS): Remove intl.
10261 (DISTCLEANFILES): Remove.
10262 * NEWS: Mention that GNU M4 is now required. Clarify what is
10263 meant by "larger grammars". Mention the pt_BR translation.
10264 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
10265 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
10266 Bump version from 0.11.2 to 0.11.5.
10267 (BISON_PREREQ_STAGE): Remove.
10268 (AM_GNU_GETTEXT): Use external gettext.
10269 (AC_OUTPUT): Remove intl/Makefile.
10270
10271 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
10272
10273 * data/glr.c: Include string.h, for strlen.
10274 (yyreportParseError): Use size_t for yysize.
10275 (yy_yypstack): No longer nested inside yypstates, as nested
10276 functions are not portable. Do not assume size_t is the
10277 same width as int.
10278 (yypstates): Do not assume that ptrdiff_t is the same width
10279 as int, and similarly for yyposn and YYINDEX.
10280
10281 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
10282
10283 * lib/Makefile.am (INCLUDES): Do not include from the intl
10284 directory, which has been removed.
10285 * src/Makefile.am (INCLUDES): Likewise.
10286
10287 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
10288 (bitsets_sources, additional_bitsets_sources, timevars_sources):
10289 New vars.
10290
10291 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
10292 * tests/Makefile.am (EXTRA_DIST): Likewise.
10293
10294 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
10295 Do not assume that bitset_windex is the same width as unsigned.
10296
10297 * lib/abitset.c (abitset_unused_clear): Do not assume that
10298 bitset_word is the same width as int.
10299 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
10300 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
10301 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
10302 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
10303 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
10304
10305 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
10306 portability to one's complement hosts!).
10307 * lib/ebitset.c (ebitset_op1): Likewise.
10308 * lib/lbitset.c (lbitset_op1): Likewise.
10309
10310 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
10311 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10312 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
10313 Sync with fileutils.
10314 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
10315 lib/gettext.h: Sync with diffutils.
10316
10317 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
10318 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
10319
10320 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
10321 PROTOTYPES to check for prototypes, and "defined __STDC__" to
10322 check for void *.
10323
10324 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
10325 size_t; the old version tried to do this but casted improperly.
10326 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
10327 (bitset_test): Now returns int, not unsigned long.
10328
10329 * lib/bitset_stats.c: Include "gettext.h".
10330 (_): New macro.
10331 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
10332 name locals "index", as it generates unnecessary warnings on some
10333 hosts that have an "index" function.
10334
10335 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
10336 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
10337 they need translation.
10338 * src/LR0.c (state_list_append, new_itemsets, get_state,
10339 append_states, generate_states): Likewise.
10340 * src/assoc.c (assoc_to_string): Likewise.
10341 * src/closure.c (print_closure, set_firsts, closure): Likewise.
10342 * src/gram.c (grammar_dump): Likewise.
10343 * src/injections.c (injections_compute): Likewise.
10344 * src/lalr.c (lookaheads_print): Likewise.
10345 * src/relation.c (relation_transpose): Likewise.
10346 * src/scan-gram.l: Likewise.
10347 * src/tables.c (table_grow, pack_vector): Likewise.
10348
10349 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
10350 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
10351 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
10352 * m4/mbstate_t.m4: Sync with fileutils.
10353 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
10354
10355 * po/LINGUAS: Add pt_BR.
10356 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
10357 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
10358 lib/timevar.c.
10359 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
10360 manual recommends.
10361 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
10362
10363 * src/complain.c (strerror_r): Remove decl; not needed.
10364 (strerror): Use same pattern as ../lib/error.c.
10365
10366 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
10367
10368 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
10369
10370 * src/main.c (main): Cast result of bindtextdomain and textdomain
10371 to void, to avoid a GCC warning when --disable-nls is in effect.
10372
10373 * src/scan-gram.l: Use strings rather than escapes when possible,
10374 to minimize the number of warnings from xgettext.
10375 (handle_action_dollar, handle_action_at): Don't use isdigit,
10376 as it mishandles negative chars and it may not work as expected
10377 outside the C locale.
10378
10379 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
10380 this is a GCC extension and is not portable to other compilers.
10381
10382 * src/system.h (alloca): Use same pattern as ../lib/error.c.
10383 Do not include <ctype.h>; no longer needed.
10384 Do not include <malloc.h>; no longer needed (and generates
10385 warnings on OpenBSD 3.0).
10386
10387 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
10388 it's not portable.
10389
10390 * tests/regression.at: Do not use 'cc -c input.c -o input';
10391 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
10392
10393 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
10394 exit status as failure, not just exit status 1. Sun C exits
10395 with status 2 sometimes.
10396
10397 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
10398 Use it for the two large tests.
10399
c8f002c7
AD
104002002-08-02 Akim Demaille <akim@epita.fr>
10401
10402 * src/conflicts.c (conflicts_output): Don't output rules never
10403 reduced here, since anyway that computation doesn't work.
10404 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
10405 (rule_useless_p, rule_never_reduced_p): New.
10406 (grammar_rules_partial_print): Use a filter instead of a range.
10407 Display the title only if needed.
10408 (grammar_rules_print): Adjust.
10409 (grammar_rules_never_reduced_report): New.
10410 * src/tables.c (action_row): Move the computation of rules never
10411 reduced to...
10412 (token_actions): here.
10413 * src/main.c (main): Make the parser before making the report, so
10414 that rules never reduced are computed.
10415 Call grammar_rules_never_reduced_report.
10416 * src/print.c (print_results): Report rules never reduced.
10417 * tests/conflicts.at, tests/reduce.at: Adjust.
10418
cd08e51e
AD
104192002-08-01 Akim Demaille <akim@epita.fr>
10420
10421 Instead of attaching lookaheads and duplicating the rules being
10422 reduced by a state, attach the lookaheads to the reductions.
10423
10424 * src/state.h (state_t): Remove the `lookaheads',
10425 `lookaheads_rule' member.
10426 (reductions_t): Add a `lookaheads' member.
10427 Use a regular array for the `rules'.
10428 * src/state.c (reductions_new): Initialize the lookaheads member
10429 to 0.
10430 (state_rule_lookaheads_print): Adjust.
10431 * src/state.h, src/state.c (state_reductions_find): New.
10432 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
10433 (count_rr_conflicts): Adjust.
10434 * src/lalr.c (LArule): Remove.
10435 (add_lookback_edge): Adjust.
10436 (state_lookaheads_count): New.
10437 (states_lookaheads_initialize): Merge into...
10438 (initialize_LA): this.
10439 (lalr_free): Adjust.
10440 * src/main.c (main): Don't free nullable and derives too early: it
10441 is used by --verbose.
10442 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
10443
bb0027a9
AD
104442002-08-01 Akim Demaille <akim@epita.fr>
10445
10446 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
10447 `rule_number_t**'.
10448 (set_derives, free_derives): Rename as...
10449 (derives_compute, derives_free): this.
10450 Adjust all dependencies.
10451 * src/nullable.c (set_nullable, free_nullable): Rename as...
10452 (nullable_compute, nullable_free): these.
10453 (rule_list_t): Store rule_t *, not rule_number_t.
10454 * src/state.c (state_rule_lookaheads_print): Directly compare rule
10455 pointers, instead of their numbers.
10456 * src/main.c (main): Call nullable_free, and derives_free earlier,
10457 as they were lo longer used.
10458
3325ddc4
AD
104592002-08-01 Akim Demaille <akim@epita.fr>
10460
10461 * lib/timevar.c (get_time): Include children time.
10462 * src/lalr.h (LA, LArule): Don't export them: used with the
10463 state_t.
10464 * src/lalr.c (LA, LArule): Static.
10465 * src/lalr.h, src/lalr.c (lalr_free): New.
10466 * src/main.c (main): Call it.
10467 * src/tables.c (pack_vector): Check whether loc is >= to the
10468 table_size, not >.
10469 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
10470 (tables_generate): do it, since that's also it which allocates
10471 them.
10472 Don't free LA and LArule, main does.
10473
c6f1a33c
AD
104742002-07-31 Akim Demaille <akim@epita.fr>
10475
10476 Separate parser tables computation and output.
10477
10478 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
10479 (conflict_list, conflict_list_cnt, table, check, table_ninf)
10480 (yydefgoto, yydefact, high): Move to...
10481 * src/tables.h, src/tables.c: here.
10482 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
10483 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
10484 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
10485 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
10486 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
10487 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
10488 (action_row, save_row, token_actions, save_column, default_goto)
10489 (goto_actions, sort_actions, matching_state, pack_vector)
10490 (table_ninf_remap, pack_table, prepare_actions): Move to...
10491 * src/tables.c: here.
10492 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
10493 * src/output.c (token_actions, output_base, output_conflicts)
10494 (output_check): Merge into...
10495 (prepare_actions): this.
10496 (actions_output): Rename as...
10497 (user_actions_output): this.
10498 * src/main.c (main): Call tables_generate and tables_free.
10499
1509d42f
AD
105002002-07-31 Akim Demaille <akim@epita.fr>
10501
10502 Steal GCC's --time-report support.
10503
10504 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
10505 stolen/adjusted from GCC.
10506 * m4/stage.m4: Remove time related checks.
10507 * m4/timevar.m4: New.
10508 * configure.in: Adjust.
10509 * src/system.h: Adjust to using timevar.h.
10510 * src/getargs.h, src/getargs.c: Support trace_time for
10511 --trace=time.
10512 * src/main.c (stage): Remove.
10513 (main): Replace `stage' invocations with timevar calls.
10514 * src/output.c: Insert pertinent timevar calls.
10515
273a74fa
AD
105162002-07-31 Akim Demaille <akim@epita.fr>
10517
10518 Let --trace have arguments.
10519
10520 * src/getargs.h (enum trace_e): New.
10521 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
10522 (long_options, short_options): --trace/-T takes an optional
10523 argument.
10524 Change all the uses of trace_flag to reflect the new flags.
10525 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
10526
10527 Strengthen `stage' portability.
10528
10529 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
10530 * configure.in: Use it.
10531 Don't check for malloc.h and sys/times.h.
10532 * src/system.h: Include them when appropriate.
10533 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
10534 times and struct tms are available.
10535
217598da
AD
105362002-07-30 Akim Demaille <akim@epita.fr>
10537
10538 In verbose parse error message, don't report `error' as an
10539 expected token.
10540 * tests/actions.at (Printers and Destructors): Adjust.
10541 * tests/calc.at (Calculator $1): Adjust.
10542 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
10543 error message, do not report the parser accepts the error token in
10544 that state.
10545
52489d44
AD
105462002-07-30 Akim Demaille <akim@epita.fr>
10547
10548 Normalize conflict related messages.
10549
10550 * src/complain.h, src/complain.c (warn, complain): New.
10551 * src/conflicts.c (conflicts_print): Use them.
10552 (conflict_report_yacc): New, extracted from...
10553 (conflicts_print): here.
10554 * tests/conflicts.at, tests/existing.at: Adjust.
10555
e8832397
AD
105562002-07-30 Akim Demaille <akim@epita.fr>
10557
10558 Report rules which are never reduced by the parser: those hidden
10559 by conflicts.
10560
10561 * src/LR0.c (save_reductions): Don't make the final state too
10562 different: save its reduction (accept) instead of having a state
10563 without any action (no shift or goto, no reduce).
10564 Note: the final state is now a ``regular'' state, i.e., the
10565 parsers now contain `reduce 0' as default reduction.
10566 Nevertheless, since they decide to `accept' when yystate =
10567 final_state, they still will not reduce rule 0.
10568 * src/print.c (print_actions, print_reduction): Adjust.
10569 * src/output.c (action_row): Track reduced rules.
10570 (token_actions): Report rules never reduced.
10571 * tests/conflicts.at, tests/regression.at: Adjust.
10572
caf23d24
AD
105732002-07-30 Akim Demaille <akim@epita.fr>
10574
10575 `stage' was accidently included in a previous patch.
10576 Initiate its autoconfiscation.
10577
10578 * configure.in: Look for malloc.h and sys/times.h.
10579 * src/main.c (stage): Adjust.
10580 Report only when trace_flag.
10581
640748ee
AD
105822002-07-29 Akim Demaille <akim@epita.fr>
10583
10584 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
10585 state_number_t.
10586 (errs_t): symbol_t*, not symbol_number_t.
10587 (reductions_t): rule_t*, not rule_number_t.
10588 (FOR_EACH_SHIFT): New.
10589 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
10590 * src/print.c, src/print_graph.c: Adjust.
10591
88bce5a2
AD
105922002-07-29 Akim Demaille <akim@epita.fr>
10593
10594 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
10595
10596 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
10597 (endtoken, accept): these.
10598 * src/reader.c (reader): Set endtoken's default tag to "$end".
10599 Set undeftoken's tag to "$undefined" instead of "$undefined.".
10600 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
10601 Adjust.
10602
1bfb97db
AD
106032002-07-29 Akim Demaille <akim@epita.fr>
10604
10605 * src/reduce.c (reduce_grammar): When the language is empty,
10606 complain about the start symbol, not the axiom.
10607 Use its location.
10608 * tests/reduce.at (Empty Language): New.
10609
fc5734fe
AD
106102002-07-26 Akim Demaille <akim@epita.fr>
10611
10612 * src/reader.h, src/reader.c (gram_error): ... can't get
10613 yycontrol without making too strong assumptions on the parser
10614 itself.
10615 * src/output.c (prepare_tokens): Use the real 0th value of
10616 token_translations instead of `0'.
10617 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
10618 visible here.
10619 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
10620 for the time being: %locations ought to provide it to yyerror.
10621
3650b4b8
AD
106222002-07-25 Akim Demaille <akim@epita.fr>
10623
10624 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
10625 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
10626 * tests/regression.at (Web2c Actions): Adjust.
10627
4b3d3a8e
AD
106282002-07-25 Akim Demaille <akim@epita.fr>
10629
10630 Stop storing rules from 1 to nrules + 1.
10631
10632 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
10633 * src/nullable.c, src/output.c, src/print.c, src/reader.c
10634 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
10635 Iterate from 0 to nrules.
10636 Use rule_number_as_item_number and item_number_as_rule_number.
10637 Adjust to `derive' now containing possibly 0.
10638 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
10639 Handle the `- 1' part in rule numbers from/to item numbers.
10640 * src/conflicts.c (log_resolution): Fix the message which reversed
10641 shift and reduce.
10642 * src/output.c (action_row): Initialize default_rule to -1.
10643 (token_actions): Adjust.
10644 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
10645 expected output.
10646 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
10647
4a2a22f4
AD
106482002-07-25 Akim Demaille <akim@epita.fr>
10649
10650 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
10651 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
10652 (b4_c_knr_arg_decl): New.
10653 * data/yacc.c: Use it to define yysymprint, yydestruct, and
10654 yyreport_parse_error.
10655
b8df3223
AD
106562002-07-25 Akim Demaille <akim@epita.fr>
10657
10658 * data/yacc.c (yyreport_parse_error): New, extracted from...
10659 (yyparse): here.
10660 (yydestruct, yysymprint): Move above yyparse.
10661 Be K&R compliant.
10662
a762e609
AD
106632002-07-25 Akim Demaille <akim@epita.fr>
10664
10665 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
10666 replace...
10667 (b4_sint_type, b4_uint_type): these.
10668 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
10669 * tests/regression.at (Web2c Actions): Adjust.
10670
12b0043a
AD
106712002-07-25 Akim Demaille <akim@epita.fr>
10672
10673 * src/gram.h (TIEM_NUMBER_MAX): New.
10674 (item_number_of_rule_number, rule_number_of_item_number): Rename
10675 as...
10676 (rule_number_as_item_number, item_number_as_rule_number): these.
10677 Adjust dependencies.
10678 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
10679 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
10680 (symbol_number_to_vector_number): New.
10681 (order): Of vector_number_t* type.
10682 (base_t, BASE_MAX, BASE_MIN): New.
10683 (froms, tos, width, pos, check): Of base_t type.
10684 (action_number_t, ACTION_MIN, ACTION_MAX): New.
10685 (actrow): Of action_number_t type.
10686 (conflrow): Of unsigned int type.
10687 (table_ninf, base_ninf): New.
10688 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
10689 (muscle_insert_int_table, muscle_insert_base_table)
10690 (muscle_insert_rule_number_table): New.
10691 (prepare_tokens): Output `toknum' as int_table.
10692 (action_row): Returns a rule_number_t.
10693 Use ACTION_MIN, not SHRT_MIN.
10694 (token_actions): yydefact is rule_number_t*.
10695 (table_ninf_remap): New.
10696 (pack_table): Use it for `base' and `table'.
10697 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
10698 replaced with...
10699 (YYPACT_NINF, YYTABLE_NINF): these.
10700 (yypact, yytable): Compute their types instead of hard-coded
10701 `short'.
10702 * tests/regression.at (Web2c Actions): Adjust.
10703
5dde258a
AD
107042002-07-19 Akim Demaille <akim@epita.fr>
10705
10706 * src/scan-gram.l (id): Can start with an underscore.
10707
a945ec39
AD
107082002-07-16 Akim Demaille <akim@epita.fr>
10709
10710 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
10711 Adjust all former `associativity' dependencies.
10712 * src/symtab.c (symbol_new): Default associativity is `undef', not
10713 `right'.
10714 (symbol_check_alias_consistence): Adjust.
10715
fae437e8
AD
107162002-07-09 Akim Demaille <akim@epita.fr>
10717
10718 * doc/bison.texinfo: Properly set the ``header'' part.
10719 Use @dircategory ``GNU programming tools'' as per Texinfo's
10720 documentation.
10721 Use @copying.
10722
1a715ef2
AD
107232002-07-09 Akim Demaille <akim@epita.fr>
10724
10725 * lib/quotearg.h: Protect against multiple inclusions.
10726 * src/location.h (location_t): Add a `file' member.
10727 (LOCATION_RESET, LOCATION_PRINT): Adjust.
10728 * src/complain.c (warn_at, complain_at, fatal_at): Drop
10729 `error_one_per_line' support.
10730
a5d50994
AD
107312002-07-09 Akim Demaille <akim@epita.fr>
10732
10733 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
10734 * src/reader.c (lineno): Remove.
10735 Adjust all dependencies.
10736 (get_merge_function): Take a location and use complain_at.
10737 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
10738 * tests/regression.at (Invalid inputs, Mixing %token styles):
10739 Adjust.
10740
b275314e
AD
107412002-07-09 Akim Demaille <akim@epita.fr>
10742
10743 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
10744 recovery rule, and forbid extensions when --yacc.
10745 (gram_error): Use complain_at.
10746 * src/reader.c (reader): Exit if there were parse errors.
10747
865b9df1
AD
107482002-07-09 Akim Demaille <akim@epita.fr>
10749
10750 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
10751 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
10752 Reported by R Blake <blakers@mac.com>.
10753
c76e14da
AD
107542002-07-09 Akim Demaille <akim@epita.fr>
10755
10756 * data/yacc.c: Output the copyright notive in the header.
10757
7db2ed2d
AD
107582002-07-03 Akim Demaille <akim@epita.fr>
10759
10760 * src/output.c (froms, tos): Are state_number_t.
10761 (save_column): sp, sp1, and sp2 are state_number_t.
10762 (prepare): Rename `final' as `final_state_number', `nnts' as
10763 `nterms_number', `nrules' as `rules_number', `nstates' as
10764 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
10765 unused.
10766 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
10767 * data/lalr1.cc (nsym_): Remove, unused.
10768
e68e0410
AD
107692002-07-03 Akim Demaille <akim@epita.fr>
10770
10771 * src/lalr.h, src/lalr.c (goto_number_t): New.
10772 * src/lalr.c (goto_list_t): New.
10773 Propagate them.
10774 * src/nullable.c (rule_list_t): New.
10775 Propagate.
10776 * src/types.h: Remove.
10777
e1a4f3a4
AD
107782002-07-03 Akim Demaille <akim@epita.fr>
10779
10780 * src/closure.c (print_fderives): Use rule_rhs_print.
10781 * src/derives.c (print_derives): Use rule_rhs_print.
10782 (rule_list_t): New, replaces `shorts'.
10783 (set_derives): Add comments.
10784 * tests/sets.at (Nullable, Firsts): Adjust.
10785
536545f3
AD
107862002-07-03 Akim Demaille <akim@epita.fr>
10787
10788 * src/output.c (prepare_actions): Free `tally' and `width'.
10789 (prepare_actions): Allocate and free `order'.
10790 * src/symtab.c (symbols_free): Free `symbols'.
10791 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
10792 * src/output.c (m4_invoke): Move to...
10793 * src/scan-skel.l: here.
10794 (<<EOF>>): Close yyout, and free its name.
10795
8b752b00
AD
107962002-07-03 Akim Demaille <akim@epita.fr>
10797
10798 Fix some memory leaks, and fix a bug: state 0 was examined twice.
10799
10800 * src/LR0.c (new_state): Merge into...
10801 (state_list_append): this.
10802 (new_states): Merge into...
10803 (generate_states): here.
10804 (set_states): Don't ensure a proper `errs' state member here, do it...
10805 * src/conflicts.c (conflicts_solve): here.
10806 * src/state.h, src/state.c: Comment changes.
10807 (state_t): Rename member `shifts' as `transitions'.
10808 Adjust all dependencies.
10809 (errs_new): For consistency, also take the values as argument.
10810 (errs_dup): Remove.
10811 (state_errs_set): New.
10812 (state_reductions_set, state_transitions_set): Assert that no
10813 previous value was assigned.
10814 (state_free): New.
10815 (states_free): Use it.
10816 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
10817 temporary storage: use `errs' and `nerrs' as elsewhere.
10818 (set_conflicts): Allocate and free this `errs'.
10819
613f5e1a
AD
108202002-07-02 Akim Demaille <akim@epita.fr>
10821
10822 * lib/libiberty.h: New.
10823 * lib: Update the bitset implementation from upstream.
10824 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
10825 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
10826 * src/main.c: Adjust bitset stats calls.
10827
26e0cadc
PE
108282002-07-01 Paul Eggert <eggert@twinsun.com>
10829
10830 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
10831 char, so that negative chars don't collide with $.
10832
1154cced
AD
108332002-06-30 Akim Demaille <akim@epita.fr>
10834
10835 Have the GLR tests be `warning' checked, and fix the warnings.
10836
10837 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
10838 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
10839 (yyremoveDeletes): `yyi' and `yyj' are size_t.
10840 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
10841 (yyaddDeferredAction): static.
10842 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
10843 (yyreportParseError): yyprefix is const.
10844 yytokenp is used only when verbose.
10845 (yy__GNUC__): Replace with __GNUC__.
10846 (yypdumpstack): yyi is size_t.
10847 (yypreference): Un-yy local variables and arguments, to avoid
10848 clashes with `yyr1'. Anyway, we are not in the user name space.
10849 (yytname_size): be an int, as is compared with ints.
10850 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
10851 Use them.
10852 * tests/cxx-gram.at: Use quotation to protect $1.
10853 Use AT_COMPILE to enable warnings hunts.
10854 Prototype yylex and yyerror.
10855 `Use' argc.
10856 Include `string.h', not `strings.h'.
10857 Produce and prototype stmtMerge only when used.
10858 yylex takes a location.
10859
97650f4e
AD
108602002-06-30 Akim Demaille <akim@epita.fr>
10861
10862 We spend a lot of time in quotearg, in particular when --verbose.
10863
10864 * src/symtab.c (symbol_get): Store a quoted version of the key.
10865 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
10866 Adjust all callers.
10867
d2576365
AD
108682002-06-30 Akim Demaille <akim@epita.fr>
10869
10870 * src/state.h (reductions_t): Rename member `nreds' as num.
10871 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
10872 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
10873
ccaf65bc
AD
108742002-06-30 Akim Demaille <akim@epita.fr>
10875
10876 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
10877 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
10878 (shifts_to): Rename as...
10879 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
10880 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
10881 (TRANSITION_IS_DISABLED, transitions_to): these.
10882
87675353
AD
108832002-06-30 Akim Demaille <akim@epita.fr>
10884
10885 * src/print.c (print_shifts, print_gotos): Merge into...
10886 (print_transitions): this.
10887 (print_transitions, print_errs, print_reductions): Align the
10888 lookaheads columns.
10889 (print_core, print_transitions, print_errs, print_state,
10890 print_grammar): Output empty lines separator before, not after.
10891 (state_default_rule_compute): Rename as...
10892 (state_default_rule): this.
10893 * tests/conflicts.at (Defaulted Conflicted Reduction),
10894 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
10895 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
10896
ce4ccb4b
AD
108972002-06-30 Akim Demaille <akim@epita.fr>
10898
10899 Display items as we display rules.
10900
10901 * src/gram.h, src/gram.c (rule_lhs_print): New.
10902 * src/gram.c (grammar_rules_partial_print): Use it.
10903 * src/print.c (print_core): Likewise.
10904 * tests/conflicts.at (Defaulted Conflicted Reduction),
10905 (Unresolved SR Conflicts): Adjust.
10906 (Unresolved SR Conflicts): Adjust and rename as...
10907 (Resolved SR Conflicts): this, as was meant.
10908 * tests/regression.at (Web2c Report): Adjust.
10909
bc933ef1
AD
109102002-06-30 Akim Demaille <akim@epita.fr>
10911
10912 * src/print.c (state_default_rule_compute): New, extracted from...
10913 (print_reductions): here.
10914 Pessimize, but clarify the code.
10915 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
10916
53d4308d
AD
109172002-06-30 Akim Demaille <akim@epita.fr>
10918
10919 * src/output.c (action_row): Let default_rule be always a rule
10920 number.
10921
574fb2d5
AD
109222002-06-30 Akim Demaille <akim@epita.fr>
10923
10924 * src/closure.c (print_firsts, print_fderives, closure):
10925 Use BITSET_EXECUTE.
10926 * src/lalr.c (lookaheads_print): Likewise.
10927 * src/state.c (state_rule_lookaheads_print): Likewise.
10928 * src/print_graph.c (print_core): Likewise.
10929 * src/print.c (print_reductions): Likewise.
10930 * src/output.c (action_row): Likewise.
10931 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
10932
05811fd7
AD
109332002-06-30 Akim Demaille <akim@epita.fr>
10934
10935 * src/print_graph.c: Use report_flag.
10936
0e4d5753
AD
109372002-06-30 Akim Demaille <akim@epita.fr>
10938
10939 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
10940 to...
10941 * src/relation.h, src/relation.c (traverse, relation_digraph)
10942 (relation_print, relation_transpose): New.
10943
24c7d800
AD
109442002-06-30 Akim Demaille <akim@epita.fr>
10945
10946 * src/state.h, src/state.c (shifts_to): New.
10947 * src/lalr.c (build_relations): Use it.
10948
9222837b
AD
109492002-06-30 Akim Demaille <akim@epita.fr>
10950
10951 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
10952 (item_number_of_rule_number, rule_number_of_item_number): New.
10953 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
10954 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
10955 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
10956 Propagate their use.
10957 Much remains to be done, in particular wrt `shorts' from types.h.
10958
260008e5
AD
109592002-06-30 Akim Demaille <akim@epita.fr>
10960
10961 * src/symtab.c (symbol_new): Initialize the `printer' member.
10962
8a731ca8
AD
109632002-06-30 Akim Demaille <akim@epita.fr>
10964
10965 * src/LR0.c (save_reductions): Remove, replaced by...
10966 * src/state.h, src/state.c (state_reductions_set): New.
10967 (reductions, errs): Rename as...
10968 (reductions_t, errs_t): these.
10969 Adjust all dependencies.
10970
32e1e0a4
AD
109712002-06-30 Akim Demaille <akim@epita.fr>
10972
10973 * src/LR0.c (state_list_t, state_list_append): New.
10974 (first_state, last_state): Now symbol_list_t.
10975 (this_state): Remove.
10976 (new_itemsets, append_states, save_reductions): Take a state_t as
10977 argument.
10978 (set_states, generate_states): Adjust.
10979 (save_shifts): Remove, replaced by...
10980 * src/state.h, src/state.c (state_shifts_set): New.
10981 (shifts): Rename as...
10982 (shifts_t): this.
10983 Adjust all dependencies.
10984 * src/state.h (state_t): Remove the `next' member.
10985
e5fb6710
AD
109862002-06-30 Akim Demaille <akim@epita.fr>
10987
10988 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
10989 escaped in slot 0.
10990
c7ca99d4
AD
109912002-06-30 Akim Demaille <akim@epita.fr>
10992
10993 Use hash.h for the state hash table.
10994
10995 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
10996 (allocate_storage): Use state_hash_new.
10997 (free_storage): Use state_hash_free.
10998 (new_state, get_state): Adjust.
10999 * src/lalr.h, src/lalr.c (states): Move to...
11000 * src/states.h (state_t): Remove the `link' member, no longer
11001 used.
11002 * src/states.h, src/states.c: here.
11003 (state_hash_new, state_hash_free, state_hash_lookup)
11004 (state_hash_insert, states_free): New.
11005 * src/states.c (state_table, state_compare, state_hash): New.
11006 * src/output.c (output_actions): Do not free states now, since we
11007 still need to know the final_state number in `prepare', called
11008 afterwards. Do it...
11009 * src/main.c (main): here: call states_free after `output'.
11010
df0e7316
AD
110112002-06-30 Akim Demaille <akim@epita.fr>
11012
11013 * src/state.h, src/state.c (state_new): New, extracted from...
11014 * src/LR0.c (new_state): here.
11015 * src/state.h (STATE_ALLOC): Move to...
11016 * src/state.c: here.
11017 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
11018 * src/state.h, src/state.c: here.
11019
39f41916
AD
110202002-06-30 Akim Demaille <akim@epita.fr>
11021
11022 * src/reader.c (gensym): Rename as...
11023 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
11024 (getsym): Rename as...
11025 (symbol_get): this.
11026
d57650a5
AD
110272002-06-30 Akim Demaille <akim@epita.fr>
11028
11029 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
11030 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
11031 * src/output.c, src/print.c, src/print_graph.c: Propagate.
11032 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
11033
5a08f1ce
AD
110342002-06-30 Akim Demaille <akim@epita.fr>
11035
11036 Make the test suite pass with warnings checked.
11037
11038 * tests/actions.at (Printers and Destructors): Improve.
11039 Avoid unsigned vs. signed issues.
11040 * tests/calc.at: Don't exercise the scanner here, do it...
11041 * tests/input.at (Torturing the Scanner): here.
11042
720623af
PH
110432002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11044
88e7e941 11045 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
11046 reorganize first lines parallel to yacc.c.
11047
fb8135fa
AD
110482002-06-28 Akim Demaille <akim@epita.fr>
11049
11050 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
11051 (b4_token_enum, b4_token_defines): New, factored from...
11052 * data/lalr1.cc, data/yacc.c, glr.c: here.
11053
41442480
AD
110542002-06-28 Akim Demaille <akim@epita.fr>
11055
11056 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
11057 unused variables.
11058 * src/output.c (merger_output): static.
11059
e0e5bf84
AD
110602002-06-28 Akim Demaille <akim@epita.fr>
11061
ba0fe3c7 11062 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
11063 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
11064 pacify GCC.
11065 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 11066
676385e2
PH
110672002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11068
11069 Accumulated changelog for new GLR parsing features.
11070
6a254321 11071 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
11072 conflicts_total_count.
11073 * src/conflicts.h: Ditto.
11074 * src/output.c (token_actions): Use the new name.
11075 (output_conflicts): Change conflp => conflict_list_heads, and
11076 confl => conflict_list for better readability.
11077 * data/glr.c: Use the new names.
11078 * NEWS: Add self to GLR announcement.
e0e5bf84 11079
676385e2
PH
11080 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
11081
11082 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
11083 Akim Demaille.
11084
11085 * data/bison.glr: Change name to glr.c
11086 * data/glr.c: Renamed from bison.glr.
11087 * data/Makefile.am: Add glr.c
e0e5bf84
AD
11088
11089 * src/getargs.c:
11090
676385e2 11091 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 11092 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 11093
676385e2
PH
11094 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11095
11096 * data/bison.glr: Be sure to restore the
11097 current #line when returning to the skeleton contents after having
11098 exposed the input file's #line.
11099
11100 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11101
11102 * data/bison.glr: Bring up to date with changes to bison.simple.
11103
11104 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11105
11106 * data/bison.glr: Correct definitions that use b4_prefix.
11107 Various reformatting.
11108 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
11109 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
11110 yytokenp argument; now part of stack.
11111 (yychar): Define to behave as documented.
11112 (yyclearin): Ditto.
e0e5bf84 11113
676385e2
PH
11114 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11115
11116 * src/reader.h: Add declaration for free_merger_functions.
11117
11118 * src/reader.c (merge_functions): New variable.
11119 (get_merge_function): New function.
11120 (free_merger_functions): New function.
11121 (readgram): Check for %prec that is not followed by a symbol.
11122 Handle %dprec and %merge declarations.
11123 (packgram): Initialize dprec and merger fields in rules array.
11124
11125 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
11126 conflict_list_cnt, conflict_list_free): New variables.
11127 (table_grow): Also grow conflict_table.
e0e5bf84 11128 (prepare_rules): Output dprec and merger tables.
676385e2 11129 (conflict_row): New function.
e0e5bf84 11130 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
11131 default reduction in conflicted states for GLR parser so that there
11132 are spaces for the conflict lists.
11133 (save_row): Also save conflict information.
11134 (token_actions): Allocate conflict list.
11135 (merger_output): New function.
11136 (pack_vector): Pack conflict table, too.
11137 (output_conflicts): New function to output yyconflp and yyconfl.
11138 (output_check): Allocate conflict_tos.
11139 (output_actions): Output conflict tables, also.
11140 (output_skeleton): Output b4_mergers definition.
11141 (prepare): Output b4_max_rhs_length definition.
11142 Use 'bison.glr' as default skeleton for GLR parsers.
11143
11144 * src/gram.c (glr_parser): New flag.
11145 (grammar_free): Call free_merger_functions.
11146
11147 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
11148 all pairs of conflicting reductions, rather than just all tokens
11149 causing conflicts. Needed to size conflict tables.
e0e5bf84 11150 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
11151 interface.
11152 (conflicts_print): Ditto.
11153 (count_total_conflicts): New function.
11154
11155 * src/reader.h (merger_list): New type.
11156 (merge_functions): New variable.
11157
11158 * src/lex.h (tok_dprec, tok_merge): New token types.
11159
11160 * src/gram.h (rule_s): Add dprec and merger fields.
11161 (glr_parser): New flag.
11162
11163 * src/conflicts.h (count_total_conflicts): New function.
11164
11165 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
11166
11167 * doc/bison.texinfo (Generalized LR Parsing): New section.
11168 (GLR Parsers): New section.
11169 (Language and Grammar): Mention GLR parsing.
11170 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
11171 Correct typo ("tge" -> "the").
11172
11173 * data/bison.glr: New skeleton for GLR parsing.
11174
11175 * tests/cxx-gram.at: New tests for GLR parsing.
11176
11177 * tests/testsuite.at: Include cxx-gram.at.
11178
11179 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 11180
676385e2
PH
11181 * src/parse-gram.y:
11182
11183 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
11184
11185 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 11186
b5480d74 111872002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
11188
11189 * src/options.h, src/options.c: Remove.
11190 * src/getargs.c (short_options, long_options): New.
11191
60491a94
AD
111922002-06-27 Akim Demaille <akim@epita.fr>
11193
11194 * data/bison.simple, data/bison.c++: Rename as...
11195 * data/yacc.c, data/lalr1.cc: these.
11196 * doc/bison.texinfo (Environment Variables): Remove.
11197
9be0c25b
AD
111982002-06-25 Raja R Harinath <harinath@cs.umn.edu>
11199
11200 * src/getargs.c (report_argmatch): Initialize strtok().
11201
1ae72863
AD
112022002-06-20 Akim Demaille <akim@epita.fr>
11203
11204 * data/bison.simple (b4_symbol_actions): New, replaces...
11205 (b4_symbol_destructor, b4_symbol_printer): these.
11206 (yysymprint): Be sure to call YYPRINT only for tokens, and using
11207 user token numbers.
11208
87542d29
AD
112092002-06-20 Akim Demaille <akim@epita.fr>
11210
11211 * data/bison.simple (yydestructor): Rename as...
11212 (yydestruct): this.
11213
1a31ed21
AD
112142002-06-20 Akim Demaille <akim@epita.fr>
11215
11216 * src/symtab.h, src/symtab.c (symbol_type_set)
11217 (symbol_destructor_set, symbol_precedence_set): The location is
11218 the last argument.
11219 Adjust all callers.
11220
e776192e
AD
112212002-06-20 Akim Demaille <akim@epita.fr>
11222
11223 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
11224 internals.
11225 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
11226 Takes a location.
11227 * src/symtab.h, src/symtab.c (symbol_class_set)
11228 (symbol_user_token_number_set): Likewise.
11229 Adjust all callers.
11230 Promote complain_at.
11231 * tests/input.at (Type Clashes): Adjust.
11232
5c1180b3
AD
112332002-06-20 Akim Demaille <akim@epita.fr>
11234
11235 * data/bison.simple (YYLEX): Fix the declaration when
11236 %pure-parser.
11237
e3170060
AD
112382002-06-20 Akim Demaille <akim@epita.fr>
11239
11240 * data/bison.simple (yysymprint): Don't print the token number,
11241 just its name.
11242 * tests/actions.at (Destructors): Rename as...
11243 (Printers and Destructors): this.
11244 Also exercise %printer.
11245
253862fd
AD
112462002-06-20 Akim Demaille <akim@epita.fr>
11247
11248 * data/bison.simple (YYDSYMPRINT): New.
11249 Use it to remove many of the #if YYDEBUG/if (yydebug).
11250
366eea36
AD
112512002-06-20 Akim Demaille <akim@epita.fr>
11252
11253 * src/symtab.h, src/symtab.c (symbol_t): printer and
11254 printer_location are new members.
11255 (symbol_printer_set): New.
11256 * src/parse-gram.y (PERCENT_PRINTER): New token.
11257 Handle its associated rule.
11258 * src/scan-gram.l: Adjust.
11259 (handle_destructor_at, handle_destructor_dollar): Rename as...
11260 (handle_symbol_code_at, handle_symbol_code_dollar): these.
11261 * src/output.c (symbol_printers_output): New.
11262 (output_skeleton): Call it.
11263 * data/bison.simple (yysymprint): New. Cannot be named yyprint
11264 since there are already many grammar files with a user `yyprint'.
11265 Replace the calls to YYPRINT to calls to yysymprint.
11266 * tests/calc.at: Adjust.
11267 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
11268 taking advantage of parser very internal details (stack size!).
11269
4f25ebb0
AD
112702002-06-20 Akim Demaille <akim@epita.fr>
11271
11272 * src/scan-gram.l: Complete the scanner with the missing patterns
11273 to pacify Flex.
11274 Use `quote' and `symbol_tag_get' where appropriate.
11275
93b68a0e
AD
112762002-06-19 Akim Demaille <akim@epita.fr>
11277
11278 * tests/actions.at (Destructors): Augment to test locations.
11279 * data/bison.simple (yydestructor): Pass it the current location
11280 if locations are enabled.
11281 Prototype only when __STDC__ or C++.
11282 Change the argument names to move into the yy name space: there is
11283 user code here.
11284
58612f1d
AD
112852002-06-19 Akim Demaille <akim@epita.fr>
11286
74310291
AD
11287 * data/bison.simple (b4_pure_if): New.
11288 Use it instead of #ifdef YYPURE.
11289
112902002-06-19 Akim Demaille <akim@epita.fr>
11291
11292 * data/bison.simple (b4_location_if): New.
58612f1d
AD
11293 Use it instead of #ifdef YYLSP_NEEDED.
11294
f25bfb75
AD
112952002-06-19 Akim Demaille <akim@epita.fr>
11296
11297 Prepare @$ in %destructor, but currently don't bind it in the
11298 skeleton, as %location use is not cleaned up yet.
11299
11300 * src/scan-gram.l (handle_dollar, handle_destructor_at)
11301 (handle_action_at): New.
11302 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
11303 a braced_code_t and a location as additional arguments.
11304 (handle_destructor_dollar): Instead of requiring `b4_eval', just
11305 unquote one when outputting `b4_dollar_dollar'.
11306 Adjust callers.
11307 * data/bison.simple (b4_eval): Remove.
11308 (b4_symbol_destructor): Adjust.
11309 * tests/input.at (Invalid @n): Adjust.
11310
c732d2c6
AD
113112002-06-19 Zack Weinberg <zack@codesourcery.com>
11312
11313 * doc/bison.texinfo: Document ability to have multiple
11314 prologue sections.
11315
8c165d89
AD
113162002-06-18 Akim Demaille <akim@epita.fr>
11317
11318 * src/files.c (compute_base_names): When computing the output file
11319 names from the input file name, strip the directory part.
11320
ca98bf57
AD
113212002-06-18 Akim Demaille <akim@epita.fr>
11322
11323 * data/bison.simple.new: Comment changes.
11324 Reported by Andreas Schwab.
11325
0bfb02ff
AD
113262002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
11327
11328 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
11329 there are no `label `yyoverflowlab' defined but not used' warnings
11330 when yyoverflow is defined.
11331
24c0aad7
AD
113322002-06-18 Akim Demaille <akim@epita.fr>
11333
11334 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
11335 new member.
11336 (symbol_destructor_set): Adjust.
11337 * src/output.c (symbol_destructors_output): Output the destructor
11338 locations.
11339 Output the symbol name.
11340 * data/bison.simple (b4_symbol_destructor): Adjust.
11341
5719c109
AD
113422002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
11343 and Akim Demaille <akim@epita.fr>
11344
11345 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
11346 what's left on the stack when the error recovery hits EOF.
11347 * tests/actions.at (Destructors): Complete to exercise this case.
11348
9280d3ef
AD
113492002-06-17 Akim Demaille <akim@epita.fr>
11350
11351 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
11352 arguments is really empty, not only equal to `[]'.
11353 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
11354 member.
11355 (symbol_destructor_set): New.
11356 * src/output.c (symbol_destructors_output): New.
11357 * src/reader.h (brace_code_t, current_braced_code): New.
11358 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
11359 (handle_dollar): Rename as...
11360 (handle_action_dollar): this.
11361 (handle_destructor_dollar): New.
11362 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
11363 (grammar_declaration): Use it.
11364 * data/bison.simple (yystos): Is always defined.
11365 (yydestructor): New.
11366 * tests/actions.at (Destructors): New.
11367 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
11368
dafdc66f
AD
113692002-06-17 Akim Demaille <akim@epita.fr>
11370
11371 * src/symlist.h, src/symlist.c (symbol_list_length): New.
11372 * src/scan-gram.l (handle_dollar, handle_at): Compute the
11373 rule_length only when needed.
11374 * src/output.c (actions_output, token_definitions_output): Output
11375 the full M4 block.
11376 * src/symtab.c: Don't access directly to the symbol tag, use
11377 symbol_tag_get.
11378 * src/parse-gram.y: Use symbol_list_free.
11379
56c47203
AD
113802002-06-17 Akim Demaille <akim@epita.fr>
11381
11382 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
11383 (symbol_list_prepend, get_type_name): Move to...
11384 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
11385 (symbol_list_prepend, symbol_list_n_type_name_get): here.
11386 Adjust all callers.
11387 (symbol_list_free): New.
11388 * src/scan-gram.l (handle_dollar): Takes a location.
11389 * tests/input.at (Invalid $n): Adjust.
11390
1e0bab92
AD
113912002-06-17 Akim Demaille <akim@epita.fr>
11392
11393 * src/reader.h, src/reader.c (symbol_list_new): Export it.
11394 (symbol_list_prepend): New.
11395 * src/parse-gram.y (%union): `list' is a new member.
11396 (symbols.1): New, replaces...
11397 (terms_to_prec.1, nterms_to_type.1): these.
11398 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
11399 Take a location as additional argument.
11400 Adjust all callers.
11401
04e60654
AD
114022002-06-15 Akim Demaille <akim@epita.fr>
11403
11404 * src/parse-gram.y: Move %token in the declaration section so that
11405 we don't depend upon CVS Bison.
11406
10e5b8bd
AD
114072002-06-15 Akim Demaille <akim@epita.fr>
11408
11409 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
11410 * src/print.c (print_core): Use it.
11411
9801d40c
AD
114122002-06-15 Akim Demaille <akim@epita.fr>
11413
11414 * src/conflicts.c (log_resolution): Accept the rule involved in
11415 the sr conflicts instead of the lookahead number that points to
11416 that rule.
11417 (flush_reduce): Accept the current lookahead vector as argument,
11418 instead of the index in LA.
11419 (resolve_sr_conflict): Accept the current number of lookahead
11420 bitset to consider for the STATE, instead of the index in LA.
11421 (set_conflicts): Adjust.
11422 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
11423
c0263492
AD
114242002-06-15 Akim Demaille <akim@epita.fr>
11425
11426 * src/state.h (state_t): Replace the `lookaheadsp' member, a
11427 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
11428 Adjust all dependencies.
11429 * src/lalr.c (initialize_lookaheads): Split into...
11430 (states_lookaheads_count, states_lookaheads_initialize): these.
11431 (lalr): Adjust.
11432
9757c359
AD
114332002-06-15 Akim Demaille <akim@epita.fr>
11434
11435 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
11436 out of...
11437 (grammar_rules_print): here.
11438 * src/reduce.c (reduce_output): Use it.
11439 * tests/reduce.at (Useless Rules, Reduced Automaton)
11440 (Underivable Rules): Adjust.
11441
6b98e4b5
AD
114422002-06-15 Akim Demaille <akim@epita.fr>
11443
11444 Copy BYacc's nice way to report the grammar.
11445
11446 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
11447 New.
11448 Don't print the rules' location, it is confusing and useless.
11449 (rule_print): Use grammar_rhs_print.
11450 * src/print.c (print_grammar): Use grammar_rules_print.
11451
6b98e4b5
AD
114522002-06-15 Akim Demaille <akim@epita.fr>
11453
11454 Complete and rationalize `useless thing' warnings.
11455
11456 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
11457 (symbol_tag_print): New.
11458 Use them everywhere in place of accessing directly the tag member.
11459 * src/gram.h, src/gram.c (rule_print): New.
11460 Use it where a rule used to be printed `by hand'.
11461 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
11462 (reduce_grammar_tables): Report the useless rules.
11463 (reduce_print): Useless things are a warning, not an error.
11464 Report it as such.
11465 * tests/reduce.at (Useless Nonterminals, Useless Rules):
11466 (Reduced Automaton, Underivable Rules): Adjust.
11467 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
11468 * tests/conflicts.at (Unresolved SR Conflicts)
11469 (Solved SR Conflicts): Adjust.
11470
ee000ba4
AD
114712002-06-15 Akim Demaille <akim@epita.fr>
11472
11473 Let symbols have a location.
11474
11475 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
11476 (getsym): Adjust.
11477 Adjust all callers.
11478 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
11479 Use location_t, not int.
11480 * src/symtab.c (symbol_check_defined): Take advantage of the
11481 location.
11482 * tests/regression.at (Invalid inputs): Adjust.
11483
8efe435c
AD
114842002-06-15 Akim Demaille <akim@epita.fr>
11485
11486 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
11487 (input): Don't try to initialize yylloc here, do it in the
11488 scanner.
11489 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
11490 * src/gram.h (rule_t): Change line and action_line into location
11491 and action_location, of location_t type.
11492 Adjust all dependencies.
11493 * src/location.h, src/location.c (empty_location): New.
11494 * src/reader.h, src/reader.c (grammar_start_symbol_set)
11495 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
11496 (grammar_current_rule_symbol_append)
11497 (grammar_current_rule_action_append): Expect a location as argument.
11498 * src/reader.c (grammar_midrule_action): Adjust to attach an
11499 action's location as dummy symbol location.
11500 * src/symtab.h, src/symtab.c (startsymbol_location): New.
11501 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
11502 the line numbers.
11503
1921f1d7
AD
115042002-06-14 Akim Demaille <akim@epita.fr>
11505
11506 Grammar declarations may be found in the grammar section.
11507
11508 * src/parse-gram.y (rules_or_grammar_declaration): New.
11509 (declarations): Each declaration may end with a semicolon, not
11510 just...
11511 (grammar_declaration): `"%union"'.
11512 (grammar): Branch to rules_or_grammar_declaration.
11513
4515534c
AD
115142002-06-14 Akim Demaille <akim@epita.fr>
11515
11516 * src/main.c (main): Invoke scanner_free.
11517
f958596b
AD
115182002-06-14 Akim Demaille <akim@epita.fr>
11519
11520 * src/output.c (m4_invoke): Extracted from...
11521 (output_skeleton): here.
11522 Free tempfile.
11523
2c569025
AD
115242002-06-14 Akim Demaille <akim@epita.fr>
11525
11526 * src/parse-gram.y (directives, directive, gram)
11527 (grammar_directives, precedence_directives, precedence_directive):
11528 Rename as...
11529 (declarations, declaration, grammar, grammar_declaration)
11530 (precedence_declaration, precedence_declarator): these.
11531 (symbol_declaration): New.
11532
592e8d4d
AD
115332002-06-14 Akim Demaille <akim@epita.fr>
11534
11535 * src/files.c (action_obstack): Remove, unused.
11536 (output_obstack): Remove it, and all its dependencies, as it is no
11537 longer needed.
11538 * src/reader.c (epilogue_set): Build the epilogue in the
11539 muscle_obstack.
11540 * src/output.h, src/output.c (muscle_obstack): Move to...
11541 * src/muscle_tab.h, src/muscle_tab.h: here.
11542 (muscle_init): Initialize muscle_obstack.
11543 (muscle_free): New.
11544 * src/main.c (main): Call it.
11545
0c15323d
AD
115462002-06-14 Akim Demaille <akim@epita.fr>
11547
11548 * src/location.h: New, extracted from...
11549 * src/reader.h: here.
11550 * src/Makefile.am (noinst_HEADERS): Merge into
11551 (bison_SOURCES): this.
11552 Add location.h.
11553 * src/parse-gram.y: Use location_t instead of Bison's.
11554 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
11555 Use location_t instead of ints.
11556
e96c9728
AD
115572002-06-14 Akim Demaille <akim@epita.fr>
11558
11559 * data/bison.simple, data/bison.c++: Be sure to restore the
11560 current #line when returning to the skeleton contents after having
11561 exposed the input file's #line.
11562
75d1fe16
AD
115632002-06-12 Akim Demaille <akim@epita.fr>
11564
11565 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
11566 eager.
11567 * tests/actions.at (Exotic Dollars): New.
11568
6c35d22c
AD
115692002-06-12 Akim Demaille <akim@epita.fr>
11570
11571 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
11572 ['"/] too eagerly.
11573 * tests/input.at (Torturing the Scanner): New.
11574
1d6412ad
AD
115752002-06-11 Akim Demaille <akim@epita.fr>
11576
11577 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
11578 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
11579 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
11580 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
11581 * src/reader.c (reader): Use it.
11582
4cdb01db
AD
115832002-06-11 Akim Demaille <akim@epita.fr>
11584
11585 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
11586 Adjust all callers.
11587 (scanner_last_string_free): New.
11588
44995b2e
AD
115892002-06-11 Akim Demaille <akim@epita.fr>
11590
11591 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
11592 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
11593 (last_string, YY_OBS_FREE): New.
11594 Use them when returning an ID.
11595
e9955c83
AD
115962002-06-11 Akim Demaille <akim@epita.fr>
11597
11598 Have Bison grammars parsed by a Bison grammar.
11599
11600 * src/reader.c, src/reader.h (prologue_augment): New.
11601 * src/reader.c (copy_definition): Remove.
11602
11603 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
11604 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
11605 (grammar_current_rule_prec_set, grammar_current_rule_check)
11606 (grammar_current_rule_symbol_append)
11607 (grammar_current_rule_action_append): Export.
11608 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
11609 (symbol_list_action_append): Remove.
11610 Hook the routines from reader.
11611 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
11612 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
11613
11614 * src/reader.c (read_declarations): Remove, unused.
11615
11616 * src/parse-gram.y: Handle the epilogue.
11617 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
11618 (grammar_start_symbol_set): this.
11619 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
11620 * src/reader.c (readgram): Remove, unused.
11621 (reader): Adjust to insert eoftoken and axiom where appropriate.
11622
11623 * src/reader.c (copy_dollar): Replace with...
11624 * src/scan-gram.h (handle_dollar): this.
11625 * src/parse-gram.y: Remove `%thong'.
11626
11627 * src/reader.c (copy_at): Replace with...
11628 * src/scan-gram.h (handle_at): this.
11629
11630 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
11631 New.
11632
11633 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
11634 time being.
11635
11636 * src/reader.h, src/reader.c (grammar_rule_end): New.
11637
11638 * src/parse.y (current_type, current_class): New.
11639 Implement `%nterm', `%token' support.
11640 Merge `%term' into `%token'.
11641 (string_as_id): New.
11642 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
11643 type name.
11644
11645 * src/parse-gram.y: Be sure to handle properly the beginning of
11646 rules.
11647
11648 * src/parse-gram.y: Handle %type.
11649 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
11650
11651 * src/parse-gram.y: More directives support.
11652 * src/options.c: No longer handle source directives.
11653
11654 * src/parse-gram.y: Fix %output.
11655
11656 * src/parse-gram.y: Handle %union.
11657 Use the prologue locations.
11658 * src/reader.c (parse_union_decl): Remove.
11659
11660 * src/reader.h, src/reader.c (epilogue_set): New.
11661 * src/parse-gram.y: Use it.
11662
11663 * data/bison.simple, data/bison.c++: b4_stype is now either not
11664 defined, then default to int, or to the contents of %union,
11665 without `union' itself.
11666 Adjust.
11667 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
11668
11669 * src/output.c (actions_output): Don't output braces, as they are
11670 already handled by the scanner.
11671
11672 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
11673 characters to themselves.
11674
11675 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
11676 that the epilogue has a proper #line.
11677
11678 * src/parse-gram.y: Handle precedence/associativity.
11679
11680 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
11681 a terminal.
11682 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
11683 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
11684 at all to define terminals that cannot be emitted.
11685
11686 * src/scan-gram.l: Escape M4 characters.
11687
11688 * src/scan-gram.l: Working properly with escapes in user
11689 strings/characters.
11690
11691 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
11692 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
11693 grammar.
11694 Use more modest sizes, as for the time being the parser does not
11695 release memory, and therefore the process swallows a huge amount
11696 of memory.
11697
11698 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
11699 stricter %token grammar.
11700
11701 * src/symtab.h (associativity): Add `undef_assoc'.
11702 (symbol_precedence_set): Do nothing when passed an undef_assoc.
11703 * src/symtab.c (symbol_check_alias_consistence): Adjust.
11704
11705 * tests/regression.at (Invalid %directive): Remove, as it is now
11706 meaningless.
11707 (Invalid inputs): Adjust to the new error messages.
11708 (Token definitions): The new grammar doesn't allow too many
11709 eccentricities.
11710
11711 * src/lex.h, src/lex.c: Remove.
11712 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
11713 (copy_character, copy_string2, copy_string, copy_identifier)
11714 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
11715 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
11716 (parse_action): Remove.
11717 * po/POTFILES.in: Adjust.
11718
2e047461
AD
117192002-06-11 Akim Demaille <akim@epita.fr>
11720
cd05d13c 11721 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
11722 rule's action member: return the action as a string.
11723 Don't require `rule_length' as an argument: compute it.
11724 (grammar_current_rule_symbol_append)
11725 (grammar_current_rule_action_append): New, eved out from
11726 (readgram): here.
11727 Remove `action_flag', `rulelength', unused now.
11728
9af3fbce
AD
117292002-06-11 Akim Demaille <akim@epita.fr>
11730
11731 * src/reader.c (grammar_current_rule_prec_set).
11732 (grammar_current_rule_check): New, eved out from...
11733 (readgram): here.
11734 Remove `xaction', `first_rhs': useless.
11735 * tests/input.at (Type clashes): New.
11736 * tests/existing.at (GNU Cim Grammar): Adjust.
11737
1485e106
AD
117382002-06-11 Akim Demaille <akim@epita.fr>
11739
11740 * src/reader.c (grammar_midrule_action): New, Eved out from
11741 (readgram): here.
11742
da4160c3
AD
117432002-06-11 Akim Demaille <akim@epita.fr>
11744
11745 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
11746 New.
11747 (readgram): Use them as replacement of inlined code, crule and
11748 crule1.
11749
f6d0f937
AD
117502002-06-11 Akim Demaille <akim@epita.fr>
11751
11752 * src/reader.c (grammar_end, grammar_symbol_append): New.
11753 (readgram): Use them.
11754 Make the use of `p' as local as possible.
11755
69078d4b
AD
117562002-06-10 Akim Demaille <akim@epita.fr>
11757
11758 GCJ's parser requires the tokens to be defined before the prologue.
11759
11760 * data/bison.simple: Output the token definition before the user's
11761 prologue.
11762 * tests/regression.at (Braces parsing, Duplicate string)
11763 (Mixing %token styles): Check the output from bison.
11764 (Early token definitions): New.
11765
5e424082
AD
117662002-06-10 Akim Demaille <akim@epita.fr>
11767
11768 * src/symtab.c (symbol_user_token_number_set): Don't complain when
11769 assigning twice the same user number to a token, so that we can
11770 use it in...
11771 * src/lex.c (lex): here.
11772 Also use `symbol_class_set' instead of hand written code.
11773 * src/reader.c (parse_assoc_decl): Likewise.
11774
44536b35
AD
117752002-06-10 Akim Demaille <akim@epita.fr>
11776
11777 * src/symtab.c, src/symtab.c (symbol_class_set)
11778 (symbol_user_token_number_set): New.
11779 * src/reader.c (parse_token_decl): Use them.
11780 Use a switch instead of ifs.
11781 Use a single argument.
11782
8b9f2372
AD
117832002-06-10 Akim Demaille <akim@epita.fr>
11784
11785 Remove `%thong' support as it is undocumented, unused, duplicates
11786 `%token's job, and creates useless e-mail traffic with people who
11787 want to know what it is, why it is undocumented, unused, and
11788 duplicates `%token's job.
11789
11790 * src/reader.c (parse_thong_decl): Remove.
11791 * src/options.c (option_table): Remove "thong".
11792 * src/lex.h (tok_thong): Remove.
11793
3ae2b51f
AD
117942002-06-10 Akim Demaille <akim@epita.fr>
11795
11796 * src/symtab.c, src/symtab.c (symbol_type_set)
11797 (symbol_precedence_set): New.
11798 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
11799 (value_components_used): Remove, unused.
11800
2f1afb73
AD
118012002-06-09 Akim Demaille <akim@epita.fr>
11802
11803 Move symbols handling code out of the reader.
11804
11805 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
11806 (axiom): Move to...
11807 * src/symtab.h, src/symtab.c: here.
11808
11809 * src/gram.c (start_symbol): Remove: use startsymbol->number.
11810 * src/reader.c (startval): Rename as...
11811 * src/symtab.h, src/symtab.c (startsymbol): this.
11812 * src/reader.c: Adjust.
11813
11814 * src/reader.c (symbol_check_defined, symbol_make_alias)
11815 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11816 (token_translations_init)
11817 Move to...
11818 * src/symtab.c: here.
11819 * src/reader.c (packsymbols): Move to...
11820 * src/symtab.h, src/symtab.c (symbols_pack): here.
11821 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
11822 argument.
11823
e9bca3ad
AD
118242002-06-03 Akim Demaille <akim@epita.fr>
11825
11826 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
11827 then statements.
11828
86eff183
AD
118292002-06-03 Akim Demaille <akim@epita.fr>
11830
11831 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
11832 structs with non literals.
11833 * src/scan-skel.l: never-interactive.
11834 * src/conflicts.c (enum conflict_resolution_e): No trailing
11835 comma.
11836 * src/getargs.c (usage): Split long literal strings.
11837 Reported by Hans Aberg.
11838
717be197
AD
118392002-05-28 Akim Demaille <akim@epita.fr>
11840
11841 * data/bison.c++: Use C++ ostreams.
11842 (cdebug_): New member.
11843
670ddffd
AD
118442002-05-28 Akim Demaille <akim@epita.fr>
11845
11846 * src/output.c (output_skeleton): Be sure to allocate enough room
11847 for `/' _and_ for `\0' in full_skeleton.
11848
769b430f
AD
118492002-05-28 Akim Demaille <akim@epita.fr>
11850
11851 * data/bison.c++: Catch up with bison.simple:
11852 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11853 and Paul Eggert <eggert@twinsun.com>: `error' handing.
11854 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
11855 and popping traces.
11856
7067cb36
PH
118572002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11858
11859 * src/output.c (output_skeleton): Put an explicit path in front of
11860 the skeleton file name, rather than relying on the -I directory,
11861 to partially alleviate effects of having a skeleton file lying around
11862 in the current directory.
769b430f 11863
4a713ec2
PH
118642002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11865
769b430f 11866 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
11867 obstack_printf should be obstack_fgrow1.
11868
b408954b
AD
118692002-05-26 Akim Demaille <akim@epita.fr>
11870
11871 * src/state.h (state_t): `solved_conflicts' is a new member.
11872 * src/LR0.c (new_state): Set it to 0.
11873 * src/conflicts.h, src/conflicts.c (print_conflicts)
11874 (free_conflicts, solve_conflicts): Rename as...
11875 (conflicts_print, conflicts_free, conflicts_solve): these.
11876 Adjust callers.
11877 * src/conflicts.c (enum conflict_resolution_e)
11878 (solved_conflicts_obstack): New, used by...
11879 (log_resolution): this.
11880 Adjust to attach the conflict resolution to each state.
11881 Complete the description with the precedence/associativity
11882 information.
11883 (resolve_sr_conflict): Adjust.
11884 * src/print.c (print_state): Output its solved_conflicts.
11885 * tests/conflicts.at (Unresolved SR Conflicts)
11886 (Solved SR Conflicts): Exercise --report=all.
11887
a49aecd5
AD
118882002-05-26 Akim Demaille <akim@epita.fr>
11889
11890 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
11891 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
11892 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
11893 (token_number_t, item_number_as_token_number)
11894 (token_number_as_item_number, muscle_insert_token_number_table):
11895 Rename as...
11896 (symbol_number_t, item_number_as_symbol_number)
11897 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
11898 these, since it is more appropriate.
11899
5504898e
AD
119002002-05-26 Akim Demaille <akim@epita.fr>
11901
11902 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
11903 `Error:' lines.
11904 * data/bison.simple (yystos) [YYDEBUG]: New.
11905 (yyparse) [YYDEBUG]: Display the symbols which are popped during
11906 error recovery.
11907 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
11908
ec3bc396
AD
119092002-05-25 Akim Demaille <akim@epita.fr>
11910
11911 * doc/bison.texinfo (Debugging): Split into...
11912 (Tracing): this new section, its former contents, and...
11913 (Understanding): this new section.
11914 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
11915 by...
11916 (report_flag): this.
11917 Adjust all dependencies.
11918 (report_args, report_types, report_argmatch): New.
11919 (usage, getargs): Report/support -r, --report.
11920 * src/options.h
11921 (struct option_table_struct): Rename as..,
11922 (struct option_table_s): this.
11923 Rename the `set_flag' member to `flag' to match with getopt_long's
11924 struct.
11925 * src/options.c (option_table): Split verbose into an entry for
11926 %verbose, and another for --verbose.
11927 Support --report/-r, so remove -r from the obsolete --raw.
11928 * src/print.c: Attach full item sets and lookaheads reports to
11929 report_flag instead of trace_flag.
11930 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
11931
78df8250
PE
119322002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11933 and Paul Eggert <eggert@twinsun.com>
769b430f 11934
78df8250
PE
11935 * data/bison.simple (yyparse): Correct error handling to conform to
11936 POSIX and yacc. Specifically, after syntax error is discovered,
11937 do not reduce further before shifting the error token.
11938 Clean up the code a bit by removing the labels yyerrdefault,
11939 yyerrhandle, yyerrpop.
11940 * NEWS: Document the above.
11941
c0c9ea05
PH
119422002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11943
11944 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
11945 type; it isn't always big enough, since it doesn't necessarily
11946 include non-terminals.
769b430f 11947 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
11948 the latter can be removed.
11949 (yy_token_number_type): Remove, only one use.
11950 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
11951 don't use TokenNumberType as element type.
769b430f 11952
c0c9ea05
PH
11953 * tests/regression.at: Modify expected output to agree with change
11954 to yyr1 and yytranslate.
769b430f 11955
6390a83f
FK
119562002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
11957
11958 * src/reader.c (parse_action): Use copy_character instead of
11959 obstack_1grow.
11960
db7c8e9a
AD
119612002-05-13 Akim Demaille <akim@epita.fr>
11962
11963 * tests/regression.at (Token definitions): Prototype yylex and
11964 yyerror.
11965
fcc61800
PH
119662002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11967
158c687b 11968 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
11969 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
11970 32-bit arithmetic.
11971 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
11972
5683e9b2
AD
119732002-05-07 Akim Demaille <akim@epita.fr>
11974
11975 * tests/synclines.at: Be sure to prototype yylex and yyerror to
11976 avoid GCC warnings.
11977
0c2d3f4c
AD
119782002-05-07 Akim Demaille <akim@epita.fr>
11979
11980 Kill GCC warnings.
11981
11982 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
11983 over the RHS of each rule.
11984 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
11985 * src/state.h (state_t): Member `nitems' is unsigned short.
11986 * src/LR0.c (get_state): Adjust.
11987 * src/reader.c (packgram): Likewise.
11988 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
11989 `Type'.
11990 (muscle_insert_int_table): Remove, unused.
11991 (prepare_rules): Remove `max'.
11992
1565b720
AD
119932002-05-06 Akim Demaille <akim@epita.fr>
11994
11995 * src/closure.c (print_firsts): Display of the symbol tags.
11996 (bitmatrix_print): Move to...
11997 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
11998 here.
11999 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
12000
cfaee611
AD
120012002-05-06 Akim Demaille <akim@epita.fr>
12002
12003 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
12004 hash_do_for_each.
12005
458be8e0
AD
120062002-05-06 Akim Demaille <akim@epita.fr>
12007
12008 * src/LR0.c (new_state, get_state): Instead of using the global
12009 `kernel_size' and `kernel_base', have two new arguments:
12010 `core_size' and `core'.
12011 Adjust callers.
12012
a900a624
AD
120132002-05-06 Akim Demaille <akim@epita.fr>
12014
12015 * src/reader.c (packgram): No longer end `ritem' with a 0
12016 sentinel: it is not used.
12017
d4e7d3a1
AD
120182002-05-05 Akim Demaille <akim@epita.fr>
12019
12020 New experimental feature: display the lookaheads in the report and
12021 graph.
12022
12023 * src/print (print_core): When --trace-flag, display the rules
12024 lookaheads.
12025 * src/print_graph.c (print_core): Likewise.
12026 Swap the arguments.
12027 Adjust caller.
12028
39ceb25b
AD
120292002-05-05 Akim Demaille <akim@epita.fr>
12030
12031 * tests/torture.at (Many lookaheads): New test.
12032
5372019f
AD
120332002-05-05 Akim Demaille <akim@epita.fr>
12034
12035 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
12036 (GENERATE_MUSCLE_INSERT_TABLE): this.
12037 (output_int_table, output_unsigned_int_table, output_short_table)
12038 (output_token_number_table, output_item_number_table): Replace with...
12039 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
12040 (muscle_insert_short_table, muscle_insert_token_number_table)
12041 (muscle_insert_item_number_table): these.
12042 Adjust all callers.
12043 (prepare_tokens): Don't free `translations', since...
12044 * src/reader.h, src/reader.c (grammar_free): do it.
12045 Move to...
12046 * src/gram.h, src/gram.c (grammar_free): here.
12047 * data/bison.simple, data/bison.c++: b4_token_number_max is now
12048 b4_translate_max.
12049
5df5f6d5
AD
120502002-05-05 Akim Demaille <akim@epita.fr>
12051
12052 * src/output.c (output_unsigned_int_table): New.
12053 (prepare_rules): `i' is unsigned.
12054 `prhs', `rline', `r2' are unsigned int.
12055 Rename muscle `rhs_number_max' as `rhs_max'.
12056 Output muscles `prhs_max', `rline_max', and `r2_max'.
12057 Free rline and r1.
12058 * data/bison.simple, data/bison.c++: Adjust to use these muscles
12059 to compute types instead of constant types.
12060 * tests/regression.at (Web2c Actions): Adjust.
12061
b87f8b21
AD
120622002-05-04 Akim Demaille <akim@epita.fr>
12063
12064 * src/symtab.h (SALIAS, SUNDEF): Rename as...
12065 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
12066 Adjust dependencies.
12067 * src/output.c (token_definitions_output): Be sure not to output a
12068 `#define 'a'' when fed with `%token 'a' "a"'.
12069 * tests/regression.at (Token definitions): New.
12070
8bb936e4
PE
120712002-05-03 Paul Eggert <eggert@twinsun.com>
12072
12073 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
12074 for K&R C.
12075
120762002-05-03 gettextize <bug-gnu-gettext@gnu.org>
12077
12078 * Makefile.am (SUBDIRS): Remove intl.
12079 (EXTRA_DIST): Add config/config.rpath.
12080
53c71a12
AD
120812002-05-03 Akim Demaille <akim@epita.fr>
12082
12083 * data/bison.simple (m4_if): Don't output empty enums.
12084 And actually, output valid enum definitions :(.
12085
289dd0cf
AD
120862002-05-03 Akim Demaille <akim@epita.fr>
12087
12088 * configure.bat: Remove, completely obsolete.
12089 * Makefile.am (EXTRA_DIST): Adjust.
12090 Don't distribute config.rpath...
12091 * config/Makefile.am (EXTRA_DIST): Do it.
12092
db85e524
AD
120932002-05-03 Akim Demaille <akim@epita.fr>
12094
12095 * configure.in (GETTEXT_VERSION): New.
12096 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
12097
83ccf991
AD
120982002-05-03 Akim Demaille <akim@epita.fr>
12099
12100 * data/bison.simple (b4_token_enum): New.
12101 (b4_token_defines): Use it to output tokens both as #define and
12102 enums.
12103 Suggested by Paul Eggert.
12104 * src/output.c (token_definitions_output): Don't output spurious
12105 white spaces.
12106
1f418995
AD
121072002-05-03 Akim Demaille <akim@epita.fr>
12108
12109 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12110
45119f04
RA
121112002-05-02 Robert Anisko <robert@lrde.epita.fr>
12112
12113 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
12114 Update the stack class, give a try to deque as the default container.
12115
b2d52318
AD
121162002-05-02 Akim Demaille <akim@epita.fr>
12117
12118 * data/bison.simple (yyparse): Do not implement @$ = @1.
12119 (YYLLOC_DEFAULT): Adjust to do it.
12120 * doc/bison.texinfo (Location Default Action): Fix.
12121
3a8b4109
AD
121222002-05-02 Akim Demaille <akim@epita.fr>
12123
12124 * src/reader.c (parse_braces): Merge into...
12125 (parse_action): this.
12126
84614e13
AD
121272002-05-02 Akim Demaille <akim@epita.fr>
12128
12129 * configure.in (ALL_LINGUAS): Remove.
12130 * po/LINGUAS, hr.po: New.
12131
fdbcd8e2
AD
121322002-05-02 Akim Demaille <akim@epita.fr>
12133
12134 Remove the so called hairy (semantic) parsers.
12135
12136 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
12137 * src/gram.h, src/gram.c (semantic_parser): Remove.
12138 (rule_t): Remove the guard and guard_line members.
12139 * src/lex.h (token_t): remove tok_guard.
12140 * src/options.c (option_table): Remove %guard and %semantic_parser
12141 support.
12142 * src/output.c, src/output.h (guards_output): Remove.
12143 (prepare): Adjust.
12144 (token_definitions_output): Don't output the `T'
12145 tokens (???).
12146 (output_skeleton): Don't output the guards.
12147 * src/files.c, src/files.c (attrsfile): Remove.
12148 * src/reader.c (symbol_list): Remove the guard and guard_line
12149 members.
12150 Adjust dependencies.
12151 (parse_guard): Remove.
12152 * data/bison.hairy: Remove.
12153 * doc/bison.texinfo (Environment Variables): Remove occurrences of
12154 BISON_HAIRY.
12155
82b6cb3f
AD
121562002-05-02 Akim Demaille <akim@epita.fr>
12157
12158 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
12159 (parse_guard): Rename the formal argument `stack_offset' as
12160 `rule_length', which is more readable.
12161 Adjust callers.
12162 (copy_at, copy_dollar): Instead of outputting the hard coded
12163 values of $$, $n and so forth, output invocation to b4_lhs_value,
12164 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
12165 Note: this patch partially drops `semantic-parser' support: it
12166 always does `rule_length - n', where semantic parsers ought to
12167 always use `-n'.
82b6cb3f
AD
12168 * data/bison.simple, data/bison.c++ (b4_lhs_value)
12169 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
12170
6cbfbcc5
AD
121712002-05-02 Akim Demaille <akim@epita.fr>
12172
12173 * configure.in (AC_INIT): Bump to 1.49b.
12174 (AM_INIT_AUTOMAKE): Short invocation.
12175
b8548114
AD
121762002-05-02 Akim Demaille <akim@epita.fr>
12177
12178 Version 1.49a.
12179
c20cd1fa
AD
121802002-05-01 Akim Demaille <akim@epita.fr>
12181
12182 * src/skeleton.h: Remove.
12183
8a9566d4
AD
121842002-05-01 Akim Demaille <akim@epita.fr>
12185
12186 * src/skeleton.h: Fix the #endif.
12187 Reported by Magnus Fromreide.
12188
8c6d399a
PE
121892002-04-26 Paul Eggert <eggert@twinsun.com>
12190
12191 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
12192 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 12193 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 12194
2b7ed18a
RA
121952002-04-25 Robert Anisko <robert@lrde.epita.fr>
12196
12197 * src/scan-skel.l: Postprocess quadrigraphs.
12198
12199 * src/reader.c (copy_character): New function, used to output
12200 single characters while replacing `[' and `]' with quadrigraphs, to
12201 avoid troubles with M4 quotes.
12202 (copy_comment): Output characters with copy_character.
12203 (read_additionnal_code): Likewise.
12204 (copy_string2): Likewise.
12205 (copy_definition): Likewise.
12206
12207 * tests/calc.at: Exercise M4 quoting.
12208
34a89c50
AD
122092002-04-25 Akim Demaille <akim@epita.fr>
12210
12211 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
12212 between `!' and the command.
12213 Reported by Paul Eggert.
12214
0dd1580a
RA
122152002-04-24 Robert Anisko <robert@lrde.epita.fr>
12216
12217 * tests/calc.at: Exercise prologue splitting.
12218
12219 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
12220 `b4_post_prologue' instead of `b4_prologue'.
12221
12222 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
12223 muscles.
12224 (output): Free pre_prologue_obstack and post_prologue_obstack.
12225 * src/files.h, src/files.c (attrs_obstack): Remove.
12226 (pre_prologue_obstack, post_prologue_obstack): New.
12227 * src/reader.c (copy_definition): Add a parameter to specify the
12228 obstack to fill, instead of using attrs_obstack unconditionally.
12229 (read_declarations): Pass pre_prologue_obstack to copy_definition if
12230 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
12231
83c1796f
PE
122322002-04-23 Paul Eggert <eggert@twinsun.com>
12233
12234 * data/bison.simple: Remove unnecessary commentary and white
12235 space differences from 1_29-branch.
12236 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
12237
12238 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
12239 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
12240 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
12241 constructors or destructors.
12242
12243 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
12244
1207eeac
AD
122452002-04-23 Akim Demaille <akim@epita.fr>
12246
12247 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
12248 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
12249 location with columns.
12250 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
12251 All reported by Paul Eggert.
12252
78ab8f67
AD
122532002-04-22 Akim Demaille <akim@epita.fr>
12254
12255 * src/reduce.c (dump_grammar): Move to...
12256 * src/gram.h, src/gram.c (grammar_dump): here.
12257 Be sure to separate long item numbers.
12258 Don't read the members of a rule's prec if its nil.
12259
133c20e2
AD
122602002-04-22 Akim Demaille <akim@epita.fr>
12261
12262 * src/output.c (table_size, table_grow): New.
12263 (MAXTABLE): Remove, replace uses with table_size.
12264 (pack_vector): Instead of dying when the table is too big, grow it.
12265
9515e8a7
AD
122662002-04-22 Akim Demaille <akim@epita.fr>
12267
12268 * data/bison.simple (yyr1): Its type is that of a token number.
12269 * data/bison.c++ (r1_): Likewise.
12270 * tests/regression.at (Web2c Actions): Adjust.
12271
23c5a174
AD
122722002-04-22 Akim Demaille <akim@epita.fr>
12273
12274 * src/reader.c (token_translations_init): 256 is now the default
12275 value for the error token, i.e., it will be assigned another
12276 number if the user assigned 256 to one of her tokens.
12277 (reader): Don't force 256 to error.
12278 * doc/bison.texinfo (Symbols): Adjust.
12279 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
12280 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
12281 etc. instead of 10, 20, 30 (which was used to `jump' over error
12282 (256) and undefined (2)).
12283
5fbb0954
AD
122842002-04-22 Akim Demaille <akim@epita.fr>
12285
12286 Propagate more token_number_t.
12287
12288 * src/gram.h (token_number_as_item_number)
12289 (item_number_as_token_number): New.
12290 * src/output.c (GENERATE_OUTPUT_TABLE): New.
12291 Use it to create output_item_number_table and
12292 output_token_number_table.
12293 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
12294 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
12295 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
12296 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
12297
4f940944
AD
122982002-04-22 Akim Demaille <akim@epita.fr>
12299
12300 * src/output.h, src/output.c (get_lines_number): Remove.
12301
3ded9a63
AD
123022002-04-19 Akim Demaille <akim@epita.fr>
12303
12304 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
12305 as Lex/Flex'.
12306 (Debugging): More details about enabling the debugging features.
12307 (Table of Symbols): Describe $$, $n, @$, and @n.
12308 Suggested by Tim Josling.
12309
e0c471a9
AD
123102002-04-19 Akim Demaille <akim@epita.fr>
12311
12312 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
12313
fecc10cd
AD
123142002-04-10 Akim Demaille <akim@epita.fr>
12315
12316 * src/system.h: Rely on HAVE_LIMITS_H.
12317 Suggested by Paul Eggert.
12318
51dec47b
AD
123192002-04-09 Akim Demaille <akim@epita.fr>
12320
12321 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
12322 full stderr, and strip it according to the bison options, instead
12323 of composing the error message from different bits.
12324 This makes it easier to check for several error messages.
12325 Adjust all the invocations.
12326 Add an invocation exercising the error token.
12327 Add an invocation demonstrating a stupid error message.
12328 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
12329 Adjust the tests.
12330 Error message are for stderr, not stdout.
12331
007a50a4
AD
123322002-04-09 Akim Demaille <akim@epita.fr>
12333
12334 * src/gram.h, src/gram.c (error_token_number): Remove, use
12335 errtoken->number.
12336 * src/reader.c (reader): Don't specify the user token number (2)
12337 for $undefined, as it uselessly prevents using it.
12338 * src/gram.h (token_number_t): Move to...
12339 * src/symtab.h: here.
12340 (state_t.number): Is a token_number_t.
12341 * src/print.c, src/reader.c: Use undeftoken->number instead of
12342 hard coded 2.
12343 (Even though this 2 is not the same as above: the number of the
12344 undeftoken remains being 2, it is its user token number which
12345 might not be 2).
12346 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
12347 `user_token_number_max'.
12348 Output `undef_token_number'.
12349 * data/bison.simple, data/bison.c++: Use them.
12350 Be sure to map invalid yylex return values to
12351 `undef_token_number'. This saves us from gratuitous SEGV.
12352
12353 * tests/conflicts.at (Solved SR Conflicts)
12354 (Unresolved SR Conflicts): Adjust.
12355 * tests/regression.at (Web2c Actions): Adjust.
12356
06446ccf
AD
123572002-04-08 Akim Demaille <akim@epita.fr>
12358
12359 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
12360 Adding #line.
12361 Remove the duplicate `typedefs'.
12362 (RhsNumberType): Fix the declaration and various other typos.
12363 Use __ofile__.
12364 * data/bison.simple: Use __ofile__.
12365 * src/scan-skel.l: Handle __ofile__.
12366
62a3e4f0
AD
123672002-04-08 Akim Demaille <akim@epita.fr>
12368
12369 * src/gram.h (item_number_t): New, the type of item numbers in
12370 RITEM. Note that it must be able to code symbol numbers as
12371 positive number, and the negation of rule numbers as negative
12372 numbers.
12373 Adjust all dependencies (pretty many).
12374 * src/reduce.c (rule): Remove this `short *' pointer: use
12375 item_number_t.
12376 * src/system.h (MINSHORT, MAXSHORT): Remove.
12377 Include `limits.h'.
12378 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
12379 (shortcpy): Remove.
12380 (MAXTABLE): Move to...
12381 * src/output.c (MAXTABLE): here.
12382 (prepare_rules): Use output_int_table to output rhs.
12383 * data/bison.simple, data/bison.c++: Adjust.
12384 * tests/torture.at (Big triangle): Move the limit from 254 to
12385 500.
12386 * tests/regression.at (Web2c Actions): Ajust.
12387
12388 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
12389 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
12390 passes, but produces negative #line number, once fixed, GCC is
12391 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
12392 C), it passes.
12393 * src/state.h (state_h): Code input lines on ints, not shorts.
12394
bb88b0fc
AD
123952002-04-08 Akim Demaille <akim@epita.fr>
12396
12397 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
12398 and then the grammar.
12399
9a636f47
AD
124002002-04-08 Akim Demaille <akim@epita.fr>
12401
12402 * src/system.h: No longer using strndup.
12403
680e8701
AD
124042002-04-07 Akim Demaille <akim@epita.fr>
12405
12406 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
12407 * src/output.c (output_table_data): Return the longest number.
12408 (prepare_tokens): Output `token_number_max').
12409 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
12410 New.
12411 Use them to define yy_token_number_type/TokenNumberType.
12412 Use this type for yytranslate.
12413 * tests/torture.at (Big triangle): Push the limit from 124 to
12414 253.
12415 * tests/regression.at (Web2c Actions): Adjust.
12416
817e9f41
AD
124172002-04-07 Akim Demaille <akim@epita.fr>
12418
12419 * tests/torture.at (Big triangle): New.
12420 (GNU AWK Grammar, GNU Cim Grammar): Move to...
12421 * tests/existing.at: here.
12422
5123689b
AD
124232002-04-07 Akim Demaille <akim@epita.fr>
12424
12425 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
12426 nritems.
12427 Adjust dependencies.
12428
f3849179
AD
124292002-04-07 Akim Demaille <akim@epita.fr>
12430
12431 * src/reader.c: Normalize increments to prefix form.
12432
bd02036a
AD
124332002-04-07 Akim Demaille <akim@epita.fr>
12434
12435 * src/reader.c, symtab.c: Remove debugging code.
12436
db8837cb
AD
124372002-04-07 Akim Demaille <akim@epita.fr>
12438
12439 Rename all the `bucket's as `symbol_t'.
12440
12441 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
12442 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
12443 * src/symtab.c, src/symtab.h (bucket): Rename as...
12444 (symbol_t): this.
12445 (symbol_list_new, bucket_check_defined, bucket_make_alias)
12446 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
12447 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
12448 (buckets_new, buckets_free, buckets_do): Rename as...
12449 (symbol_list_new, symbol_check_defined, symbol_make_alias)
12450 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
12451 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
12452 (symbols_new, symbols_free, symbols_do): these.
12453
72a23c97
AD
124542002-04-07 Akim Demaille <akim@epita.fr>
12455
12456 Use lib/hash for the symbol table.
12457
12458 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
12459 EOF.
12460 * src/lex.c (lex): Set the `number' member of new terminals.
12461 * src/reader.c (bucket_check_defined, bucket_make_alias)
12462 (bucket_check_alias_consistence, bucket_translation): New.
12463 (reader, grammar_free, readgram, token_translations_init)
12464 (packsymbols): Adjust.
12465 (reader): Number the predefined tokens.
12466 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
12467 for predefined tokens.
12468 * src/symtab.h (bucket): Remove all the hash table related
12469 members.
12470 * src/symtab.c (symtab): Replace by...
12471 (bucket_table): this.
12472 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
12473 (buckets_new, buckets_do): New.
12474
280a38c3
AD
124752002-04-07 Akim Demaille <akim@epita.fr>
12476
12477 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
12478 (start_symbol, max_user_token_number, semantic_parser)
12479 (error_token_number): Initialize.
12480 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
12481 Initialize.
12482 (reader): Don't.
12483 (errtoken, eoftoken, undeftoken, axiom): Extern.
12484
03b31c0c
AD
124852002-04-07 Akim Demaille <akim@epita.fr>
12486
12487 * src/gram.h (rule_s): prec and precsym are now pointers
12488 to the bucket giving the priority/associativity.
12489 Member `associativity' removed: useless.
12490 * src/reduce.c, src/conflicts.c: Adjust.
12491
8b3df748
AD
124922002-04-07 Akim Demaille <akim@epita.fr>
12493
12494 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
12495 Properly escape the symbols' TAG when outputting them.
12496
e601aa1d
AD
124972002-04-07 Akim Demaille <akim@epita.fr>
12498
12499 * src/lalr.h (LA): Is a bitsetv, not bitset*.
12500
b0299a2e
AD
125012002-04-07 Akim Demaille <akim@epita.fr>
12502
12503 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
12504 (LArule): this, which is an array to rule_t*.
12505 * src/print.c, src/conflicts.c: Adjust.
12506
d7e1f00c
AD
125072002-04-07 Akim Demaille <akim@epita.fr>
12508
12509 * src/gram.h (rule_t): Rename `number' as `user_number'.
12510 `number' is a new member.
12511 Adjust dependencies.
12512 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
12513
cc9305dd
AD
125142002-04-07 Akim Demaille <akim@epita.fr>
12515
12516 As a result of the previous patch, it is no longer needed
12517 to reorder ritem itself.
12518
12519 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
12520
b0940840
AD
125212002-04-07 Akim Demaille <akim@epita.fr>
12522
12523 Be sure never to walk through RITEMS, but use only data related to
12524 the rules themselves. RITEMS should be banished.
12525
12526 * src/output.c (output_token_translations): Rename as...
12527 (prepare_tokens): this.
12528 In addition to `translate', prepare the muscles `tname' and
12529 `toknum', which were handled by...
12530 (output_rule_data): this.
12531 Remove, and move the remainder of its outputs into...
12532 (prepare_rules): this new routines, which also merges content from
12533 (output_gram): this.
12534 (prepare_rules): Be sure never to walk through RITEMS.
12535 (output_stos): Rename as...
12536 (prepare_stos): this.
12537 (output): Always invoke prepare_states, after all, just don't use it
12538 in the output if you don't need it.
12539
643a5994
AD
125402002-04-07 Akim Demaille <akim@epita.fr>
12541
12542 * src/LR0.c (new_state): Display `nstates' as the name of the
12543 newly created state.
12544 Adjust to initialize first_state and last_state if needed.
12545 Be sure to distinguish the initial from the final state.
12546 (new_states): Create the itemset of the initial state, and use
12547 new_state.
12548 * src/closure.c (closure): Now that the initial state has its
12549 items properly set, there is no need for a special case when
12550 creating `ruleset'.
12551
12552 As a result, now the rule 0, reducing to $axiom, is visible in the
12553 outputs. Adjust the test suite.
12554
12555 * tests/conflicts.at (Solved SR Conflicts)
12556 (Unresolved SR Conflicts): Adjust.
12557 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
12558 * tests/conflicts.at (S/R in initial): New.
12559
b4c4ccc2
AD
125602002-04-07 Akim Demaille <akim@epita.fr>
12561
12562 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
12563 the RHS of the rules.
12564 * src/output.c (output_gram): Likewise.
12565
bba97eb2
AD
125662002-04-07 Akim Demaille <akim@epita.fr>
12567
12568 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
12569 bucket.
12570 Adjust all dependencies.
12571 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
12572 `number' of the buckets too.
12573 * src/gram.h: Include `symtab.h'.
12574 (associativity): Move to...
12575 * src/symtab.h: here.
12576 No longer include `gram.h'.
12577
c3b407f4
AD
125782002-04-07 Akim Demaille <akim@epita.fr>
12579
12580 * src/gram.h, src/gram.c (rules_rhs_length): New.
12581 (ritem_longest_rhs): Use it.
12582 * src/gram.h (rule_t): `number' is a new member.
12583 * src/reader.c (packgram): Set it.
12584 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
12585 the end of `rules', and count them out of `nrules'.
12586 (reduce_output, dump_grammar): Adjust.
12587 * src/print.c (print_grammar): It is no longer needed to check for
12588 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
12589 * tests/reduce.at (Reduced Automaton): New test.
12590
11652ab3
AD
125912002-04-07 Akim Demaille <akim@epita.fr>
12592
12593 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
12594 lacking `+ 1' to nrules, Bison reported as useless a token if it
12595 was used solely to set the precedence of the last rule...
12596
26b23c1a
AD
125972002-04-07 Akim Demaille <akim@epita.fr>
12598
12599 * data/bison.c++, data/bison.simple: Don't output the current file
12600 name in #line, to avoid useless diffs between two identical
12601 outputs under different names.
12602
18bcecb0
AD
126032002-04-07 Akim Demaille <akim@epita.fr>
12604
12605 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
12606 Normalize loops to using `< nrules + 1', not `<= nrules'.
12607
fa770c86
AD
126082002-04-07 Akim Demaille <akim@epita.fr>
12609
12610 * TODO: Update.
12611
d9b739c3
AD
126122002-04-07 Akim Demaille <akim@epita.fr>
12613
12614 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
12615 bucket.value as bucket.number.
12616
99013900
AD
126172002-04-07 Akim Demaille <akim@epita.fr>
12618
12619 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
12620 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
12621 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
12622 RHS, instead of being an index in RITEMS.
12623
e966383b
PE
126242002-04-04 Paul Eggert <eggert@twinsun.com>
12625
12626 * doc/bison.texinfo: Update copyright date.
12627 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
12628 (Symbols): Warn about running Bison in one character set,
12629 but compiling and/or running in an incompatible one.
12630 Warn about character code 256, too.
12631
126322002-04-03 Paul Eggert <eggert@twinsun.com>
12633
12634 * src/bison.data (YYSTACK_ALLOC): Depend on whether
12635 YYERROR_VERBOSE is nonzero, not whether it is defined.
12636
12637 Merge changes from bison-1_29-branch.
c307773e 12638
8d6c48b9
PE
126392002-03-20 Paul Eggert <eggert@twinsun.com>
12640
12641 Merge fixes from Debian bison_1.34-1.diff.
12642
12643 * configure.in (AC_PREREQ): 2.53.
12644
e53c6322
AD
126452002-03-20 Akim Demaille <akim@epita.fr>
12646
12647 * src/conflicts.c (log_resolution): Argument `resolution' is const.
12648
9ffbeca7
PE
126492002-03-19 Paul Eggert <eggert@twinsun.com>
12650
21db0b2a
PE
12651 * src/bison.simple (YYCOPY): New macro.
12652 (YYSTACK_RELOCATE): Use it.
12653 Remove Type arg; no longer needed. All callers changed.
12654 (yymemcpy): Remove; no longer needed.
12655
9ffbeca7
PE
12656 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
12657 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
12658
642cb8f8
AD
126592002-03-19 Akim Demaille <akim@epita.fr>
12660
12661 Test and fix the #line outputs.
12662
12663 * tests/atlocal.at (GCC): New.
12664 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 12665 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
12666 (Action synch line, Epilogue synch line): New tests.
12667 * src/reader.c (parse_union_decl): Define the muscle stype_line.
12668 * data/bison.simple, data/bison.c++: Use it.
12669
3c31a486
AD
126702002-03-19 Akim Demaille <akim@epita.fr>
12671
12672 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
12673 (Solved SR Conflicts, %expect not enough, %expect right)
12674 (%expect too much): Move to...
12675 * tests/conflicts.at: this new file.
12676
0d8bed56
AD
126772002-03-19 Akim Demaille <akim@epita.fr>
12678
12679 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12680 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
12681 that we can move to enums for instance.
12682 * src/output.c (token_definitions_output): Output a list of
12683 `token-name, token-number' instead of the #define.
12684 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
12685
9208d17f
AD
126862002-03-14 Akim Demaille <akim@epita.fr>
12687
12688 Use Gettext 0.11.1.
12689
af27eacb
RA
126902002-03-09 Robert Anisko <robert@lrde.epita.fr>
12691
12692 * data/bison.c++: Make the user able to add members to the generated
12693 parser by subclassing.
12694
9101a310
RA
126952002-03-05 Robert Anisko <robert@lrde.epita.fr>
12696
12697 * src/reader.c (read_additionnal_code): `c' should be an integer, not
12698 a character.
12699 Reported by Nicolas Tisserand and Nicolas Burrus.
12700
fff9bf0b
RA
127012002-03-04 Robert Anisko <robert@lrde.epita.fr>
12702
12703 * src/reader.c: Warn about lacking semi-colons, do not complain.
12704
64dba31e
RA
127052002-03-04 Robert Anisko <robert@lrde.epita.fr>
12706
12707 * data/bison.c++: Remove a debug line.
12708
374f5a14
RA
127092002-03-04 Robert Anisko <robert@lrde.epita.fr>
12710
12711 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
12712 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
12713 provide a default implementation.
12714
bfcf1f3a
AD
127152002-03-04 Akim Demaille <akim@epita.fr>
12716
12717 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
12718 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
12719 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
12720 * tests/semantic.at (Parsing Guards): Similarly.
12721 * src/reader.at (readgram): Complain if the last rule is not ended
12722 with a semi-colon.
12723
65ccf9fc
AD
127242002-03-04 Akim Demaille <akim@epita.fr>
12725
12726 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
12727 * src/closure.c: here.
12728 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
12729 RTC.
12730 * src/warshall.h, src/warshall.c: Remove.
12731 * tests/sets.at (Broken Closure): Adjust.
12732
d0039cbc
AD
127332002-03-04 Akim Demaille <akim@epita.fr>
12734
12735 * src/output.c (output_skeleton): tempdir is const.
12736 bytes_read is unused.
12737
345cea78
AD
127382002-03-04 Akim Demaille <akim@epita.fr>
12739
12740 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12741 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
12742 Update.
12743 From Michael Hayes.
12744
564801f7
AD
127452002-03-04 Akim Demaille <akim@epita.fr>
12746
12747 * src/closure.c (closure): `r' is unused.
12748
e5352bc7
AD
127492002-03-04 Akim Demaille <akim@epita.fr>
12750
12751 * tests/sets.at (Broken Closure): Add the ending `;'.
12752 * src/reader.at (readgram): Complain if a rule is not ended with a
12753 semi-colon.
12754
914feea9
AD
127552002-03-04 Akim Demaille <akim@epita.fr>
12756
12757 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
12758 (count_sr_conflicts): Use bitset_count.
12759 * src/reduce.c (inaccessable_symbols): Ditto.
12760 (bits_size): Remove.
12761 * src/warshall.h, src/warshall.c: Convert to bitsetv.
12762
f0250de6
AD
127632002-03-04 Akim Demaille <akim@epita.fr>
12764
12765 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
12766 * src/reduce.c: Remove the `bitset_zero's following the
12767 `bitset_create's, as now it is performed by the latter.
12768
ef017502
AD
127692002-03-04 Akim Demaille <akim@epita.fr>
12770
12771 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
12772 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
12773 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
12774 latest sources from Michael.
12775
76514394
AD
127762002-03-04 Akim Demaille <akim@epita.fr>
12777
12778 * src/output.c (output): Don't free the grammar.
12779 * src/reader.c (grammar_free): New.
12780 * src/main.c (main): Call it and don't free symtab here.
12781
55024580
AD
127822002-03-04 Akim Demaille <akim@epita.fr>
12783
12784 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
12785 before returning.
12786 Reported by Benoit Perrot.
12787
f9abaa2c
AD
127882002-03-04 Akim Demaille <akim@epita.fr>
12789
12790 Use bitset operations when possible, not loops over bits.
12791
12792 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
12793 bitset_or.
12794 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
12795 * src/reduce.c (useless_nonterminals): Formatting changes.
12796 * src/warshall.c (TC): Use bitset_or.
12797
0e721e75
AD
127982002-03-04 Akim Demaille <akim@epita.fr>
12799
12800 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
12801 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
12802 Ditto.
12803
0fb1ffb1
AD
128042002-03-04 Akim Demaille <akim@epita.fr>
12805
12806 * src/lalr.c (F): Now a bitset*.
12807 Adjust all dependencies.
12808
b86796bf
AD
128092002-03-04 Akim Demaille <akim@epita.fr>
12810
12811 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
12812 Adjust all dependencies.
12813
602bbf31
AD
128142002-03-04 Akim Demaille <akim@epita.fr>
12815
12816 * src/L0.c, src/LR0.h (nstates): Be size_t.
12817 Adjust comparisons (signed vs unsigned).
12818 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
12819 bitset*.
12820 Adjust all dependencies.
12821
d8a0245c
AD
128222002-03-04 Akim Demaille <akim@epita.fr>
12823
12824 * src/closure.c (firsts): Now, also a bitset.
12825 Adjust all dependencies.
12826 (varsetsize): Remove, now unused.
12827 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
12828
34ba9743
AD
128292002-03-04 Akim Demaille <akim@epita.fr>
12830
12831 * src/print.c: Convert to use bitset.h, not hand coded iterations
12832 over ints.
12833
ed86e78c
AD
128342002-03-04 Akim Demaille <akim@epita.fr>
12835
12836 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
12837
dfdb1797
AD
128382002-03-04 Akim Demaille <akim@epita.fr>
12839
12840 * src/closure.c (ruleset): Be a bitset.
12841 (rulesetsize): Remove.
12842
7086e707
AD
128432002-03-04 Akim Demaille <akim@epita.fr>
12844
12845 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12846 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
12847 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
12848 * src/closure.c (fderives): Be an array of bitsets.
12849
98254360
RA
128502002-02-28 Robert Anisko <robert@lrde.epita.fr>
12851
12852 * data/bison.c++: Merge the two generated headers. Insert a copyright
12853 notice in each output file.
12854
a75c057f
AD
128552002-02-28 Akim Demaille <akim@epita.fr>
12856
12857 * data/bison.c++: Copy the prologue of bison.simple to fetch
12858 useful M4 definitions, such as b4_header_guard.
12859
06b00abc
AD
128602002-02-25 Akim Demaille <akim@epita.fr>
12861
12862 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
12863 translator friendly scheme for the bgr
12864 copyright notice.
06b00abc 12865
70e7d534
AD
128662002-02-25 Akim Demaille <akim@epita.fr>
12867
12868 * src/output.c (header_output): Remove, now handled completely via
12869 M4.
12870
abe017f6
AD
128712002-02-25 Akim Demaille <akim@epita.fr>
12872
12873 * m4/m4.m4: New, from CVS Autoconf.
12874 * configure.in: Invoke it.
12875 * src/output.c (output_skeleton): Use its result instead of the
12876 hard coded name.
12877
381fb12e
AD
128782002-02-25 Akim Demaille <akim@epita.fr>
12879
12880 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
12881 Fileutils 4.1.5.
12882 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
12883 * src/output.c (output_skeleton): Use mkstemp to create a real
12884 temporary file.
12885 Move the filling of `skeleton' and its muscle to...
12886 (prepare): here.
12887 (output): Move the definition of the prologue muscle to...
12888 (prepare): here.
12889 * src/system.h (DEFAULT_TMPDIR): New.
12890
6f38107f
PE
128912002-02-14 Paul Eggert <eggert@twinsun.com>
12892
12893 Remove the support for C++ namespace cleanliness; it was
12894 causing more problems than it was curing, since it didn't work
12895 properly on some nonstandard C++ compilers. This can wait
12896 for a proper C++ parser.
12897
12898 * NEWS: Document this.
12899 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
12900 of C++, as it's treated like C now.
12901 * src/bison.simple (YYSTD): Remove.
12902 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
12903 Treat C++ just like Standard C instead of trying to support
12904 namespace cleanliness.
12905
80cce3da
AD
129062002-02-14 Akim Demaille <akim@epita.fr>
12907
12908 * tests/regression.at (else): Adjust to Andreas' change.
12909
842e8679
AD
129102002-02-14 Akim Demaille <akim@epita.fr>
12911
12912 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
12913
4bda3f10
AD
129142002-02-13 Andreas Schwab <schwab@suse.de>
12915
12916 * src/output.c (output_rule_data): Don't output NULL, it might
12917 not be defined yet.
12918
4162fa07 129192002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 12920
4162fa07
RA
12921 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
12922 (Copyright notice): Update.
b418ecd8 12923
bd16a5dc
AD
129242002-02-11 Akim Demaille <akim@epita.fr>
12925
12926 * tests/regression.at (%nonassoc and eof): Don't include
12927 nonportable headers.
12928
8d69a1a3
RA
129292002-02-08 Robert Anisko <robert@lrde.epita.fr>
12930
12931 * data/bison.c++: Correct error recovery. Make the user able to
12932 initialize the starting location.
12933
9b2d0677
AD
129342002-02-07 Akim Demaille <akim@epita.fr>
12935
12936 * tests/input.at: New.
12937
69e2658b
RA
129382002-02-07 Robert Anisko <robert@lrde.epita.fr>
12939
12940 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 12941 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
12942 directives around tables only needed for debugging.
12943
4aacc3a7
RA
129442002-02-07 Robert Anisko <robert@lrde.epita.fr>
12945
12946 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
12947 C++ parsers.
12948 (yy::b4_name::parse): Use print_.
12949
762a801e
RA
129502002-02-07 Robert Anisko <robert@lrde.epita.fr>
12951
12952 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
12953
4bb2bc3f
RA
129542002-02-07 Robert Anisko <robert@lrde.epita.fr>
12955
12956 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
12957 C++ parsers.
12958 (yy::b4_name::parse): Build verbose error messages, and use error_.
12959
6b45a3ca
RA
129602002-02-06 Robert Anisko <robert@lrde.epita.fr>
12961
12962 * data/bison.c++: Fix m4 quoting in comments.
12963
50997c6e
RA
129642002-02-06 Robert Anisko <robert@lrde.epita.fr>
12965
12966 * data/bison.c++: Adjust the parser code. Fix some muscles that were
12967 not expanded by m4.
12968
3f3eed27
AD
129692002-02-05 Akim Demaille <akim@epita.fr>
12970
12971 * data/bison.c++: Adjust to the M4 back end.
12972 More is certainly needed.
12973
be2a1a68
AD
129742002-02-05 Akim Demaille <akim@epita.fr>
12975
12976 Give a try to M4 as a back end.
12977
12978 * lib/readpipe.c: New, from wdiff.
12979 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
12980 BISON_HAIRY.
12981 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
12982 specific values. Now it is m4 that performs the lookup.
12983 * src/parse-skel.y: Remove.
12984 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
12985 * src/output.c (actions_output, guards_output)
12986 (token_definitions_output): No longer keeps track of the output
12987 line number, hence remove the second argument.
12988 (guards_output): Check against the guard member of a rule, not the
12989 action member.
12990 Adjust callers.
12991 (output_skeleton): Don't look for the skeleton location, let m4 do
12992 that.
12993 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
12994 file will be used.
12995 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
12996 (prepare): Given that for the time being changesyntax is not
12997 usable in M4, rename the muscles using `-' to `_'.
12998 Define `defines_flag', `output_parser_name' and `output_header_name'.
12999 * src/output.h (actions_output, guards_output)
13000 (token_definitions_output): Adjust prototypes.
13001 * src/scan-skel.l: Instead of scanning the skeletons, it now
13002 processes the output of m4: `__oline__' and `#output'.
13003 * data/bison.simple: Adjust to be used by M4(sugar).
13004 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
13005 to date.
13006 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
13007 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
13008 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
13009 shamelessly stolen from CVS Autoconf.
13010
beda758b
AD
130112002-02-05 Akim Demaille <akim@epita.fr>
13012
13013 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
13014 * configure.in: Check for the declarations of free and malloc.
13015 * src/muscle_tab.c: Adjust.
13016
5ece6d43
AD
130172002-02-05 Akim Demaille <akim@epita.fr>
13018
13019 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
13020 which have no values.
13021
5bb18f9a
AD
130222002-02-05 Akim Demaille <akim@epita.fr>
13023
13024 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
13025 * data/: here.
13026
894dd62e
PE
130272002-01-29 Paul Eggert <eggert@twinsun.com>
13028
13029 * src/bison.simple (YYSIZE_T): Do not define merely because
13030 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
13031 On some platforms, <alloca.h> does not declare YYSTD (size_t).
13032
82841af7
AD
130332002-01-27 Akim Demaille <akim@epita.fr>
13034
13035 Fix `%nonassoc and eof'.
13036
13037 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
13038 which were not properly copied! Replace
13039 memcpy (res->errs, src->errs, src->nerrs);
13040 with
13041 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
13042 !!!
13043 * tests/regression.at (%nonassoc and eof): Adjust to newest
13044 Autotest: `.' is not in the PATH.
13045
318b76e9
AD
130462002-01-27 Akim Demaille <akim@epita.fr>
13047
13048 * tests/sets.at (AT_EXTRACT_SETS): New.
13049 (Nullable): Use it.
13050 (Firsts): New.
13051
30d2f3d5
AD
130522002-01-26 Akim Demaille <akim@epita.fr>
13053
13054 * tests/actions.at, tests/calc.at, tests/headers.at,
13055 * tests/torture.at: Adjust to the newest Autotest which no longer
13056 forces `.' in the PATH.
13057
30f8c395
AD
130582002-01-25 Akim Demaille <akim@epita.fr>
13059
13060 * tests/regression.at (%nonassoc and eof): New.
13061 Suggested by Robert Anisko.
13062
29ae55f1
AD
130632002-01-24 Akim Demaille <akim@epita.fr>
13064
13065 Bison dumps core when trying to complain about broken input files.
13066 Reported by Cris van Pelt.
13067
13068 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
13069 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
13070 into...
13071 (Invalid inputs): Strengthen: exercise parse_percent_token.
13072
2b548aa6
RA
130732002-01-24 Robert Anisko <robert.anisko@epita.fr>
13074
13075 * src/Makefile.am: Add bison.c++.
13076 * src/bison.c++: New skeleton.
13077
bb0146c2
AD
130782002-01-21 Paolo Bonzini <bonzini@gnu.org>
13079
13080 * po/it.po: New.
13081
bec30531
AD
130822002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
13083
13084 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
13085
fc6edc45
MA
130862002-01-20 Marc Autret <marc@gnu.org>
13087
13088 * src/files.c (compute_output_file_names): Fix
13089
5e5d5415
MA
130902002-01-20 Marc Autret <marc@gnu.org>
13091
13092 * tests/output.at: New test.
13093 * src/files.c (compute_base_names): Don't map extensions when
13094 the YACC flag is set, use defaults.
13095 Reported by Evgeny Stambulchik.
13096
44ea3fbd
MA
130972002-01-20 Marc Autret <marc@gnu.org>
13098
ba0fe3c7
PE
13099 * src/system.h: Need to define __attribute__ away for non-GCC
13100 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
13101 Suggested by Albert Chin-A-Young.
13102
338963d1
TVH
131032002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
13104
13105 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
13106 canonical definition.
13107 * src/system.h: Use the canonical definition for PARAMS (avoids
13108 a conflict with the macro from lib/hash.h).
13109
c57b2479
AD
131102002-01-11 Akim Demaille <akim@epita.fr>
13111
13112 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 13113 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 13114
b85810ae
AD
131152002-01-09 Akim Demaille <akim@epita.fr>
13116
13117 * src/files.c, src/files.h (output_infix): New.
13118 (tab_extension): Remove.
13119 (compute_base_names): Compute the former, drop the latter.
13120 * src/output.c (prepare): Insert the muscles `output-infix', and
13121 `output-suffix'.
13122 * src/parse-skel.y (string, string.1): New.
13123 (section.header): Use it.
13124 (section.yacc): Remove.
13125 (prefix): Remove too.
13126 * src/scan-skel.l: Adjust.
13127 * src/bison.simple, src/bison.hairy: Adjust.
13128
cae60122
AD
131292002-01-09 Akim Demaille <akim@epita.fr>
13130
13131 * configure.in (WERROR_CFLAGS): Compute it.
13132 * src/Makefile.am (CFLAGS): Pass it.
13133 * tests/atlocal.in (CFLAGS): Idem.
13134 * src/files.c: Fix a few warnings.
13135 (get_extension_index): Remove, unused.
13136
ae404801
AD
131372002-01-08 Akim Demaille <akim@epita.fr>
13138
13139 * src/getargs.c (AS_FILE_NAME): New.
13140 (getargs): Use it to convert DOSish file names.
13141 * src/files.c (base_name): Rename as full_base_name to avoid
13142 clashes with `base_name ()'.
13143 (filename_split): New.
13144 (compute_base_names): N-th rewrite, using filename_split.
13145
22312b71
AD
131462002-01-08 Akim Demaille <akim@epita.fr>
13147
13148 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
13149 New, stolen from the Fileutils 4.1.
13150 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
13151 * configure.in: Check for the presence of memrchr, and of its
13152 prototype.
13153
a67cef01
TVH
131542002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
13155
13156 * lib/hash.h (__P): Added definition for this macro.
13157 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
13158 BUILT_SOURCES, to ensure they are generated first.
13159 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
13160 %error-verbose to allow bootstrapping with bison 1.30x.
13161
2b25d624
AD
131622002-01-06 Akim Demaille <akim@epita.fr>
13163
13164 * src/reader.c (parse_braces): Don't fetch the next char, the
13165 convention is to fetch on entry.
13166 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
13167 'switch' without a following semicolon.
13168 * tests/regression.at (braces parsing): New.
13169
3460813b
AD
131702002-01-06 Akim Demaille <akim@epita.fr>
13171
13172 Bison is dead wrong in its RR conflict reports.
13173
13174 * tests/torture.at (GNU Cim Grammar): New.
13175 * src/conflicts.c (count_rr_conflicts): Fix.
13176
73784c64
AD
131772002-01-06 Akim Demaille <akim@epita.fr>
13178
13179 Creating package.m4 from configure.ac causes too many problems.
13180
13181 * tests/Makefile.am (package.m4): Create it by hand,
13182 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
13183
25d81090
AD
131842002-01-06 Akim Demaille <akim@epita.fr>
13185
13186 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
13187 skeleton.h.
13188
a9b8959e
PE
131892002-01-04 Paul Eggert <eggert@twinsun.com>
13190
13191 * doc/bison.texinfo (Debugging):
13192 Remove YYSTDERR; it's no longer defined or used.
13193 Also, s/cstdio.h/cstdio/.
13194
25d81090
AD
131952002-01-03 Akim Demaille <akim@epita.fr>
13196
13197 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
13198
1109455c
AD
131992002-01-03 Akim Demaille <akim@epita.fr>
13200
13201 * src/parse-skel.y (process_skeleton): Don't bind the parser's
13202 tracing code to --trace, wait for a better --trace option, with
13203 args.
13204
7ea5e977
AD
132052002-01-03 Akim Demaille <akim@epita.fr>
13206
13207 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
13208 The ISO C++ standard is extremely clear about it: stderr is
13209 considered a macro, not a regular symbol (see table 94 `Header
13210 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
13211 Therefore std:: does not apply to it. It still does with fprintf.
13212 Also, s/cstdio.h/cstdio/.
13213
fab5b110
AD
132142002-01-03 Akim Demaille <akim@epita.fr>
13215
13216 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
13217 for non system headers.
13218
aed7fd9b
AD
132192002-01-02 Akim Demaille <akim@epita.fr>
13220
13221 Equip the skeleton chain with location tracking, runtime trace,
13222 pure parser and scanner.
13223
13224 * src/parse-skel.y: Request a pure parser, locations, and prefix
13225 renaming.
13226 (%union): Having several members with the same type does not help
13227 type mismatches, simplify.
13228 (YYPRINT, yyprint): New.
13229 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
13230 (skel_error): this.
13231 Handle locations.
13232 * src/scan-skel.l: Adjust to these changes.
13233 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
13234 (LOCATION_PRINT, skel_control_t): New.
13235
24fad99e
AD
132362001-12-30 Akim Demaille <akim@epita.fr>
13237
13238 * src/parse-skel.y: Get rid of the shift/reduce conflict:
13239 replace `gb' with BLANKS.
13240 * src/scan-skel.l: Adjust.
13241
a4b36db4
AD
132422001-12-30 Akim Demaille <akim@epita.fr>
13243
13244 * src/system.h: We don't need nor want bcopy.
13245 Throw away MS-DOS crap: we don't need getpid.
13246 * configure.in: We don't need strndup. It was even causing
13247 problems: because Flex includes the headers *before* us,
13248 _GNU_SOURCE is not defined by config.h, and therefore strndup was
13249 not visible.
13250 * lib/xstrndup.c: New.
13251 * src/scan-skel.l: Use it.
13252 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
13253 * src/parse-skel.y: Use %directives instead of #defines.
13254
1239777d
AD
132552001-12-30 Akim Demaille <akim@epita.fr>
13256
13257 * src/skeleton.h: New.
13258 * src/output.c (output_parser, output_master_parser): Remove, dead
13259 code.
13260 * src/output.h (get_lines_number, actions_output, guards_output)
13261 (token_definitions_output): Prototype them.
13262 * src/parse-skel.y: Add the license notice.
13263 Include output.h and skeleton.h.
13264 (process_skeleton): Returns void, and takes a single parameter.
13265 * src/scan-skel.l: Add the license notice.
13266 Include skeleton.h.
13267 Don't use %option yylineno: it seems that then Flex imagines
13268 REJECT has been used, and therefore it won't reallocate its
13269 buffers (which makes no other sense to me than a bug). It results
13270 in warnings for `unused: yy_flex_realloc'.
13271
9b3add5b
RA
132722001-12-30 Robert Anisko <robert.anisko@epita.fr>
13273
13274 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
13275 (MUSCLE_INSERT_PREFIX): ...to there.
13276 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
13277 (MUSCLE_INSERT_PREFIX): Move from here...
13278
13279 * src/bison.hairy: Add a section directive. Put braces around muscle
13280 names. This parser skeleton is still broken, but Bison should not
13281 choke on a bad muscle 'syntax'.
13282 * src/bison.simple: Add a section directive. Put braces around muscle
13283 names.
13284
13285 * src/files.h (strsuffix, stringappend): Add declarations.
13286 (tab_extension): Add declaration.
13287 (short_base_name): Add declaration.
13288
13289 * src/files.c (strsuffix, stringappend): No longer static. These
13290 functions are used in the skeleton parser.
13291 (tab_extension): New.
13292 (compute_base_names): Use the computations done in this function
fab5b110 13293 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
13294 names.
13295 (short_base_name): No longer static.
13296
13297 * src/output.c (output_skeleton): New.
13298 (output): Disable call to output_master_parser, and give a try to
13299 a new skeleton handling system.
13300 (guards_output, actions_output): No longer static.
13301 (token_definitions_output, get_lines_number): No longer static.
13302
13303 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
13304
fab5b110 13305 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
13306 parse-skel.y.
13307
13308 * src/parse-skel.y: New file.
13309 * src/scan-skel.l: New file.
13310
b5b61c61
AD
133112001-12-29 Akim Demaille <akim@epita.fr>
13312
13313 %name-prefix is broken.
13314
13315 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
13316 Adjust all dependencies.
13317 * tests/headers.at (export YYLTYPE): Strengthen this test: use
13318 %name-prefix.
13319
13320 Renaming yylval but not yylloc is not consistent. Now we do.
13321
13322 * src/bison.simple: Prefix yylloc if used.
13323 * doc/bison.texinfo (Decl Summary): Document that.
13324
8c9a50be
AD
133252001-12-29 Akim Demaille <akim@epita.fr>
13326
13327 * doc/bison.texinfo: Promote `%long-directive' over
13328 `%long_directive'.
13329 Remove all references to fixed-output-files, yacc is enough.
13330
d99361e6
AD
133312001-12-29 Akim Demaille <akim@epita.fr>
13332
13333 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
13334 user prologue. These are defaults.
13335 * tests/actions.at (Mid-rule actions): Make sure the user can
13336 define YYDEBUG and YYERROR_VERBOSE.
13337
b9cecb91
AD
133382001-12-29 Akim Demaille <akim@epita.fr>
13339
13340 * src/output.c (header_output): Don't forget to export YYLTYPE and
13341 yylloc.
13342 * tests/headers.at (export YYLTYPE): New, make sure it does.
13343 * tests/regression.at (%union and --defines, Invalid CPP headers):
13344 Move to...
13345 * tests/headers.at: here.
13346
aea13e97
AD
133472001-12-29 Akim Demaille <akim@epita.fr>
13348
13349 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
13350
931394cb
AD
133512001-12-29 Akim Demaille <akim@epita.fr>
13352
13353 * tests/actions.at (Mid-rule actions): Output on a single line
13354 instead of several.
13355
704a47c4
AD
133562001-12-29 Akim Demaille <akim@epita.fr>
13357
13358 * doc/bison.texinfo: Formatting changes.
13359
091e20bb
AD
133602001-12-29 Akim Demaille <akim@epita.fr>
13361
13362 Don't store the token defs in a muscle, just be ready to output it
13363 on command. Now possible via `symbols'. Fixes a memory leak.
13364
13365 * src/output.c (token_definitions_output): New.
13366 (output_parser, header_output): Use it.
13367 * src/reader.c (symbols_save): Remove.
13368
cce71710
AD
133692001-12-29 Akim Demaille <akim@epita.fr>
13370
13371 * src/bison.simple: Do not provide a default for YYSTYPE and
13372 YYLTYPE before the user's prologue. Otherwise it's hardly... a
13373 default.
13374
82c035a8
AD
133752001-12-29 Akim Demaille <akim@epita.fr>
13376
13377 Mid-rule actions are simply... ignored!
13378
13379 * src/reader.c (readgram): Be sure to attach mid-rule actions to
13380 the empty-rule associated to the dummy symbol, not to the host
13381 rule.
13382 * tests/actions.at (Mid-rule actions): New.
13383
8419d367
AD
133842001-12-29 Akim Demaille <akim@epita.fr>
13385
13386 Memory leak.
13387
13388 * src/reader.c (reader): Free grammar.
13389
375d5806
AD
133902001-12-29 Akim Demaille <akim@epita.fr>
13391
13392 Memory leak.
13393
13394 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
13395 since it allocates it for each state, although only one is needed.
13396 (allocate_storage): Do it here.
13397
f51cb8ff
AD
133982001-12-29 Akim Demaille <akim@epita.fr>
13399
13400 * src/options.h, src/options.c (create_long_option_table): Rename
13401 as...
13402 (long_option_table_new): this, with a clearer prototype.
13403 (percent_table): Remove, unused,
13404 * src/getargs.c (getargs): Adjust.
13405
29e88316
AD
134062001-12-29 Akim Demaille <akim@epita.fr>
13407
13408 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
13409 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
13410 as states.
13411
b9f71f19
AD
134122001-12-29 Akim Demaille <akim@epita.fr>
13413
13414 * src/lalr.c (build_relations): Rename `states' as `states1'.
13415 Sorry, I don't understand exactly what it is, no better name...
13416
1a2b5d37
AD
134172001-12-29 Akim Demaille <akim@epita.fr>
13418
13419 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
13420 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
13421 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
13422 as rules.
13423
1cca533e
AD
134242001-12-29 Akim Demaille <akim@epita.fr>
13425
13426 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
13427 ago.
13428
c03ae966
AD
134292001-12-29 Akim Demaille <akim@epita.fr>
13430
13431 * src/reader.c, src/reader.h (user_toknums): Remove.
13432 Adjust all users to use symbols[i]->user_token_number.
13433
5a670b1e
AD
134342001-12-29 Akim Demaille <akim@epita.fr>
13435
13436 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
13437 Adjust all users to use symbols[i]->prec or ->assoc.
13438
ad949da9
AD
134392001-12-29 Akim Demaille <akim@epita.fr>
13440
13441 * src/reader.c, src/reader.h (tags): Remove.
13442 Adjust all users to use symbols[i]->tag.
13443
0e78e603
AD
134442001-12-29 Akim Demaille <akim@epita.fr>
13445
13446 * src/gram.h, src/gram.c (symbols): New, similar to state_table
13447 and rule_table.
13448 * src/reader.c (packsymbols): Fill this table.
13449 Drop sprec.
13450 * src/conflicts.c (resolve_sr_conflict): Adjust.
13451 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
13452 single table.
13453 Use symbols[i]->tag instead of tags[i].
13454
213e640e
AD
134552001-12-29 Akim Demaille <akim@epita.fr>
13456
13457 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
13458 In addition, put a comment in there, to replace...
13459 * tests/regression.at (%union and C comments): Remove.
13460
e7b8bef1
AD
134612001-12-29 Akim Demaille <akim@epita.fr>
13462
13463 * tests/regression.at (Web2c Actions): Blindly move the actual
13464 output as expected output. The contents *seem* right to me, but I
13465 can't pretend reading perfectly parser tables... Nonetheless, all
13466 the other tests pass correctly, the table look OK, even though the
13467 presence of `$axiom' is to be noted: AFAICS it is useless (but
13468 harmless).
13469
b68e7744
AD
134702001-12-29 Akim Demaille <akim@epita.fr>
13471
13472 * src/reader.c (readgram): Don't add the rule 0 if there were no
13473 rules read. In other words, add it _after_ having performed
13474 grammar sanity checks.
13475 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
13476
78d5bae9
AD
134772001-12-29 Akim Demaille <akim@epita.fr>
13478
13479 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
13480 visible, and some states have now a different number.
13481
ff442794
AD
134822001-12-29 Akim Demaille <akim@epita.fr>
13483
13484 * src/reader.c (readgram): Bind the initial rule's lineno to that
13485 of the first rule.
13486 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
13487 (Solved SR Conflicts): Adjust rule 0's line number.
13488
610ab194
AD
134892001-12-29 Akim Demaille <akim@epita.fr>
13490
13491 Fix the `GAWK Grammar' failure.
13492
13493 * src/LR0.c (final_state): Initialize to -1 so that we do compute
13494 the reductions of the first state which was mistakenly confused
13495 with the final state because precisely final_state was initialized
13496 to 0.
13497 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
13498 now noticed by Bison.
13499 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
13500 have a reduction on $default.
13501
29d29c8f
AD
135022001-12-29 Akim Demaille <akim@epita.fr>
13503
13504 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
13505 rule line numbers.
13506 * src/closure.c (print_closure): Likewise.
13507 * src/derives.c (print_derives): Likewise.
13508 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
13509 now.
13510
7c6b64d0
AD
135112001-12-29 Akim Demaille <akim@epita.fr>
13512
13513 * src/lalr.c (lookaheads_print): New.
13514 (lalr): Call it when --trace-flag.
13515 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
13516 are dumped.
13517
3d4daee3
AD
135182001-12-29 Akim Demaille <akim@epita.fr>
13519
13520 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
13521 when walking through ritem, even via rule->rhs.
13522 * src/reduce.c (dump_grammar, useful_production, reduce_output)
13523 (useful_production, useless_nonterminals): Likewise.
13524 (reduce_grammar_tables): Likewise, plus update nritems.
13525 * src/nullable.c (set_nullable): Likewise.
13526 * src/lalr.c (build_relations): Likewise.
13527 * tests/sets.at (Nullable): Adjust.
13528 Fortunately, now, the $axiom is no longer nullable.
13529
9e7f6bbd
AD
135302001-12-29 Akim Demaille <akim@epita.fr>
13531
13532 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
13533 the 0-sentinel.
13534 * src/gram.c (ritem_longest_rhs): Likewise.
13535 * src/reduce.c (nonterminals_reduce): Likewise.
13536 * src/print_graph.c (print_graph): Likewise.
13537 * src/output.c (output_rule_data): Likewise.
13538 * src/nullable.c (set_nullable): Likewise.
13539
255ef638
AD
135402001-12-29 Akim Demaille <akim@epita.fr>
13541
13542 * src/output.c: Comment changes.
13543
0d8a7363
AD
135442001-12-27 Paul Eggert <eggert@twinsun.com>
13545
13546 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
13547 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
13548 Sparc, as they were causing more porting problems than the
13549 (minor) performance improvement was worth.
13550
13551 Also, catch up with 1.31's YYSTD.
13552
3db472b9
AD
135532001-12-27 Akim Demaille <akim@epita.fr>
13554
13555 * src/output.c (output_gram): Rely on nritems, not the
13556 0-sentinel. See below.
13557 Use -1 as separator, not 0.
13558 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
13559 Rely on -1 as separator in yyrhs, instead of 0.
13560 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
13561 twice `Now at end of input', therefore there are two lines less to
13562 expect.
13563
b365aa05
AD
135642001-12-27 Akim Demaille <akim@epita.fr>
13565
13566 * tests/regression.at (Unresolved SR Conflicts):
13567 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
13568 below.
13569
30171f79
AD
135702001-12-27 Akim Demaille <akim@epita.fr>
13571
13572 * src/LR0.c (new_state): Recognize the final state by the fact it
13573 is reached by eoftoken.
13574 (insert_start_shifting_state, insert_eof_shifting_state)
13575 (insert_accepting_state, augment_automaton): Remove, since now
13576 these states are automatically computed from the initial state.
13577 (generate_states): Adjust.
13578 * src/print.c: When reporting a rule number to the user, substract
13579 1, so that the axiom rule is rule 0, and the first user rule is 1.
13580 * src/reduce.c: Likewise.
13581 * src/print_graph.c (print_core): For the time being, just as for
13582 the report, depend upon --trace-flags to dump the full set of
13583 items.
13584 * src/reader.c (readgram): Once the grammar read, insert the rule
13585 0: `$axiom: START-SYMBOL $'.
13586 * tests/set.at: Adjust: rule 0 is now displayed, and since the
13587 number of the states has changed (the final state is no longer
13588 necessarily the last), catch up.
13589
75142d45
AD
135902001-12-27 Akim Demaille <akim@epita.fr>
13591
13592 Try to make the use of the eoftoken valid. Given that its value
13593 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
13594 is used instead of > 0 where appropriate, (ii), depend upon nritems
13595 instead of the 0-sentinel.
13596
13597 * src/gram.h, src/gram.c (nritems): New.
13598 Expected to be duplication of nitems, but for the time being...
13599 * src/reader.c (packgram): Assert nritems and nitems are equal.
13600 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
13601 * src/closure.c (print_closure, print_fderives): Likewise.
13602 * src/gram.c (ritem_print): Likewise.
13603 * src/print.c (print_core, print_grammar): Likewise.
13604 * src/print_graph.c: Likewise.
13605
b7c49edf
AD
136062001-12-27 Akim Demaille <akim@epita.fr>
13607
13608 * src/main.c (main): If there are complains after grammar
13609 reductions, then output the report anyway if requested, then die.
13610 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
13611 * src/reader.c (eoftoken): New.
13612 (parse_token_decl): If the token being defined has value `0', it
13613 is the eoftoken.
13614 (packsymbols): No longer hack `tags' to insert `$' by hand.
13615 Be sure to preserve the value of the eoftoken.
13616 (reader): Make sure eoftoken is defined.
13617 Initialize nsyms to 0: now eoftoken is created just like the others.
13618 * src/print.c (print_grammar): Don't special case the eof token.
13619 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
13620 lie anyway, albeit pleasant.
13621 * tests/calc.at: Exercise error messages with eoftoken.
13622 Change the grammar so that empty input is invalid.
13623 Adjust expectations.
13624 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
13625
ec2da99f
AD
136262001-12-27 Akim Demaille <akim@epita.fr>
13627
13628 * configure.in: Check the protos of strchr ans strspn.
13629 Replace strchr if needed.
13630 * src/system.h: Provide the protos of strchr, strspn and memchr if
13631 missing.
13632 * lib/strchr.c: New.
13633 * src/reader.c (symbols_save): Use strchr.
13634
8adfa272
AD
136352001-12-27 Akim Demaille <akim@epita.fr>
13636
13637 * src/print.c, src/print_graph.c (escape): New.
13638 Use it to quote the TAGS outputs.
13639 * src/print_graph.c (print_state): Now errors are in red, and
13640 reductions in green.
13641 Prefer high to wide: output the state number on a line of its own.
13642
80dac38c
AD
136432001-12-27 Akim Demaille <akim@epita.fr>
13644
13645 * src/state.h, src/state.c (reductions_new): New.
13646 * src/LR0.c (set_state_table): Let all the states have a
13647 `reductions', even if reduced to 0.
13648 (save_reductions): Adjust.
13649 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
13650 * src/print.c (print_reductions, print_actions): Adjust.
13651 * src/output.c (action_row): Adjust.
13652
2cec70b9
AD
136532001-12-27 Akim Demaille <akim@epita.fr>
13654
13655 * src/state.h, src/state.c (errs_new, errs_dup): New.
13656 * src/LR0.c (set_state_table): Let all the states have an errs,
13657 even if reduced to 0.
13658 * src/print.c (print_errs, print_reductions): Adjust.
13659 * src/output.c (output_actions, action_row): Adjust.
13660 * src/conflicts.c (resolve_sr_conflict): Adjust.
13661
13ca549a
AD
136622001-12-27 Akim Demaille <akim@epita.fr>
13663
13664 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
13665
5092aba5
AD
136662001-12-27 Akim Demaille <akim@epita.fr>
13667
13668 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
13669 * src/print.c: here.
13670 (lookaheadset, shiftset): New, used as additional storage by
13671 print_reductions.
13672 (print_results): Adjust.
13673 (print_shifts, print_gotos, print_errs): New, extracted from...
13674 (print_actions): here.
13675 * src/print_graph.c (print_actions): Remove dead code.
13676
11e2beca
AD
136772001-12-27 Akim Demaille <akim@epita.fr>
13678
13679 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
13680 `$n' and `@n'.
13681
dac3c910
AD
136822001-12-27 Akim Demaille <akim@epita.fr>
13683
13684 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
13685 (build_relations): Adjust.
13686
d0b0fefa
AD
136872001-12-27 Akim Demaille <akim@epita.fr>
13688
13689 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
13690 duplication.
13691
adc8c848
AD
136922001-12-27 Akim Demaille <akim@epita.fr>
13693
13694 * src/reader.c (packgram): Catch nitems overflows.
13695
14d293ac
AD
136962001-12-27 Akim Demaille <akim@epita.fr>
13697
13698 * src/files.c, src/files.h (guard_obstack): Remove.
13699 * src/output.c (output): Adjust.
13700 * src/reader.c (parse_braces): New, factoring...
13701 (copy_action, copy_guard): these two which are renamed as...
13702 (parse_action, parse_guard): these.
13703 As a voluntary consequence, using braces around guards is now
13704 mandatory.
13705
f499b062
AD
137062001-12-27 Akim Demaille <akim@epita.fr>
13707
13708 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
13709 * src/reader.c (symbol_list): `guard' and `guard_line' are new
13710 members.
13711 (symbol_list_new): Adjust.
13712 (copy_action): action_line is the first line, not the last.
13713 (copy_guard): Just as for actions, store the `action' only, not
13714 the switch/case/break flesh.
13715 Don't parse the user action that might follow the guard, let...
13716 (readgram): do it, i.e., now, there can be an action after a
13717 guard.
13718 In other words the guard is just explicitly optional.
13719 (packgram): Adjust.
13720 * src/output.c (guards_output): New.
13721 (output_parser): Call it when needed.
13722 (output): Also free the guard and attrs obstacks.
13723 * src/files.c, src/files.h (obstack_save): Remove.
13724 (output_files): Remove.
13725 As a result, if one needs the former `.act' file, using an
13726 appropriate skeleton which requires actions and guards is now
13727 required.
13728 * src/main.c (main): Adjust.
13729 * tests/semantic.at: New.
13730 * tests/regression.at: Use `input.y' as input file name.
13731 Avoid 8+3 problems by requiring input.c when the test needs the
13732 parser.
13733
d945f5cd
AD
137342001-12-27 Akim Demaille <akim@epita.fr>
13735
13736 * src/reader.c (symbol_list_new): Be sure to initialize all the
13737 fields.
13738
d200e455
AD
137392001-12-27 Akim Demaille <akim@epita.fr>
13740
13741 All the hacks using a final pseudo state are now useless.
13742
13743 * src/LR0.c (set_state_table): state_table holds exactly nstates.
13744 * src/lalr.c (nLA): New.
13745 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
13746 instead of lookaheadsp from the pseudo state (nstate + 1).
13747
f9507c28
AD
137482001-12-27 Akim Demaille <akim@epita.fr>
13749
13750 * src/output.c (action_row, token_actions): Use a state_t instead
13751 of a integer, and nlookaheads instead of the following state's
13752 lookaheadsp.
13753
065fbd27
AD
137542001-12-27 Akim Demaille <akim@epita.fr>
13755
13756 * src/conflicts.c (log_resolution, flush_shift)
13757 (resolve_sr_conflict, set_conflicts, solve_conflicts)
13758 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
13759 (conflicts_print, print_reductions): Use a state_t instead of an
13760 integer when referring to a state.
13761 As much as possible, depend upon nlookaheads, instead of the
13762 `lookaheadsp' member of the following state (since lookaheads of
13763 successive states are successive, the difference between state n + 1
13764 and n served as the number of lookaheads for state n).
13765 * src/lalr.c (add_lookback_edge): Likewise.
13766 * src/print.c (print_core, print_actions, print_state)
13767 (print_results): Likewise.
13768 * src/print_graph.c (print_core, print_actions, print_state)
13769 (print_graph): Likewise.
13770 * src/conflicts.h: Adjust.
13771
1b177bd7
AD
137722001-12-27 Akim Demaille <akim@epita.fr>
13773
13774 * src/bison.hairy: Formatting/comment changes.
13775 ANSIfy.
13776 Remove `register' indications.
13777 Add plenty of `static'.
13778
7742ddeb
AD
137792001-12-27 Akim Demaille <akim@epita.fr>
13780
13781 * src/output.c (prepare): Drop the muscle `ntbase' which
13782 duplicates ntokens.
13783 * src/bison.simple: Formatting/comment changes.
13784 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
13785 is an undocumented synonym.
13786
1fa14068
AD
137872001-12-22 Akim Demaille <akim@epita.fr>
13788
13789 * src/output.c (output_table_data): Change the prototype to use
13790 `int' for array ranges: some invocations do pass an int, not a
13791 short.
13792 Reported by Wayne Green.
13793
b9752825
AD
137942001-12-22 Akim Demaille <akim@epita.fr>
13795
13796 Some actions of web2c.y are improperly triggered.
13797 Reported by Mike Castle.
13798
13799 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
13800 * tests/regression.at (Web2c): Rename as...
13801 (Web2c Report): this.
13802 (Web2c Actions): New.
13803
776209d6
AD
138042001-12-22 Akim Demaille <akim@epita.fr>
13805
13806 Reductions in web2c.y are improperly reported.
13807 Reported by Mike Castle.
13808
13809 * src/conflicts.c (print_reductions): Fix.
13810 * tests/regression.at (Web2c): New.
13811
275fc3ad
AD
138122001-12-18 Akim Demaille <akim@epita.fr>
13813
13814 Some host fail on `assert (!"foo")', which expands to
13815 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
13816 Reported by Nelson Beebee.
13817
13818 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
13819 `#define it_succeeded 0' and `assert (it_succeeded)'.
13820
897668ee
MA
138212001-12-17 Marc Autret <autret_m@epita.fr>
13822
13823 * src/bison.simple: Don't hard code the skeleton line and filename.
13824 * src/output.c (output_parser): Rename 'line' as 'output_line'.
13825 New line counter 'skeleton_line' (skeleton-line muscle).
13826
ab3399e0
PE
138272001-12-17 Paul Eggert <eggert@twinsun.com>
13828
13829 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
13830 YYDEBUG must be defined to a nonzero value.
13831
13832 * src/bison.simple (yytname): Do not assume that the user defines
13833 YYDEBUG to a properly parenthesized expression.
13834
3877f72b
AD
138352001-12-17 Akim Demaille <akim@epita.fr>
13836
13837 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
13838 nlookaheads is a new member.
13839 Adjust all users.
13840 * src/lalr.h (nlookaheads): Remove this orphan declaration.
13841 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
13842 state.
776209d6 13843
331dbc1b
AD
138442001-12-17 Akim Demaille <akim@epita.fr>
13845
13846 * src/files.h, src/files.c (open_files, close_files): Remove.
13847 * src/main.c (main): Don't open/close files, nor invoke lex_free,
13848 let...
13849 * src/reader.c (reader): Do it.
776209d6 13850
be750e4c
AD
138512001-12-17 Akim Demaille <akim@epita.fr>
13852
13853 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 13854
709ae8c6
AD
138552001-12-17 Akim Demaille <akim@epita.fr>
13856
13857 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
13858 (flush_reduce): New.
13859 (resolve_sr_conflict): Adjust.
776209d6 13860
f87685c3
AD
138612001-12-17 Akim Demaille <akim@epita.fr>
13862
13863 * src/output.c (output_obstack): Be static and rename as...
13864 (format_obstack): this, to avoid any confusion with files.c's
13865 output_obstack.
13866 * src/reader.h (muscle_obstack): Move to...
13867 * src/output.h: here, since it's defined in output.c.
13868
837491d8
AD
138692001-12-17 Akim Demaille <akim@epita.fr>
13870
13871 * src/output.c (action_row, save_column, default_goto)
13872 (sort_actions, matching_state, pack_vector): Better variable
13873 locality.
13874
796d61fb
AD
138752001-12-17 Akim Demaille <akim@epita.fr>
13876
13877 * src/output.c: Various formatting changes.
776209d6 13878
64d15509
AD
138792001-12-17 Akim Demaille <akim@epita.fr>
13880
13881 * src/files.c (output_files): Free the output_obstack.
13882 * src/main.c (main): Call print and print_graph conditionally.
13883 * src/print.c (print): Work unconditionally.
13884 * src/print_graph.c (print_graph): Work unconditionally.
13885 * src/conflicts.c (log_resolution): Output only if verbose_flag.
13886
fbc8ecb7
MA
138872001-12-16 Marc Autret <autret_m@epita.fr>
13888
13889 * src/output.c (actions_output): Fix. When we use %no-lines,
13890 there is one less line per action.
13891
f0440388
MA
138922001-12-16 Marc Autret <autret_m@epita.fr>
13893
13894 * src/bison.simple: Remove a useless #line directive.
13895 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
13896 * src/output.c (get_lines_number): New.
776209d6 13897 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
13898 output muscles.
13899 Fix line numbering.
13900 (actions_output): Computes the number of lines taken by actions.
13901 (output_master_parser): Insert new skeleton which is the name of
13902 the output parser file name.
13903
a79986b8
MA
139042001-12-15 Marc Autret <autret_m@epita.fr>
13905
13906 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
13907
4ec8e00f
MA
139082001-12-15 Marc Autret <autret_m@epita.fr>
13909
13910 * src/output.c (output_gram): Keep track of the hairy one.
13911
1a4648ff
AD
139122001-12-15 Akim Demaille <akim@epita.fr>
13913
13914 Make `make distcheck' work.
13915
13916 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
13917 system.h which uses libgettext.h.
13918
9c2c67e6
AD
139192001-12-15 Akim Demaille <akim@epita.fr>
13920
13921 * src/nullable.c (set_nullable): Useless rules must be skipped,
13922 otherwise, since we range over their symbols, we might look at a
13923 nonterminal which no longer ``exists'', i.e., it is not counted in
13924 `nvars', hence we overflow our arrays.
13925
93ede233
AD
139262001-12-15 Akim Demaille <akim@epita.fr>
13927
13928 The header can also be produced directly, without any obstack!
13929 Yahoo!
13930
13931 * src/files.c, src/files.h (defines_obstack): Remove.
13932 (compute_header_macro): Global.
13933 (defines_obstack_save): Remove.
13934 * src/reader.c (parse_union_decl): No longer output to
13935 defines_obstack: its content can be found in the `stype' muscle
13936 anyway.
13937 (output_token_translations): Merge into...
13938 (symbols_output): this.
13939 Rename as...
13940 (symbols_save): this.
13941 (reader): Adjust.
13942 * src/output.c (header_output): New.
13943 (output): Call it.
13944
2666f928
AD
139452001-12-15 Akim Demaille <akim@epita.fr>
13946
13947 * src/reader.c (parse_union_decl): Instead of handling two obstack
13948 simultaneously, use one to define the `stype' muscle, and use the
13949 value of the latter to fill defines_obstack.
13950 (copy_comment): Remove.
13951 (copy_comment2): Work for a single obstack.
13952 Rename as...
13953 (copy_comment): this.
13954
428046f8
AD
139552001-12-15 Akim Demaille <akim@epita.fr>
13956
13957 * src/lex.c, src/lex.h (xgetc): No longer static.
13958 * src/reader.c (parse_union_decl): Revamp.
13959
ea52d706
AD
139602001-12-15 Akim Demaille <akim@epita.fr>
13961
13962 Still making progress in separating Bison into (i) input, (ii)
13963 process, (iii) output: now we can directly output the parser file
13964 without using table_obstack at all.
13965
13966 * src/files.c, src/files.h (table_obstack): Bye bye.
13967 (parser_file_name): New.
13968 * src/files.c (compute_output_file_names): Compute it.
13969 * src/output.c (actions_output, output_parser)
13970 (output_master_parser): To a file instead of an obstack.
13971
3f96f4dc
AD
139722001-12-15 Akim Demaille <akim@epita.fr>
13973
13974 Attach actions to rules, instead of pre-outputting them to
13975 actions_obstack.
13976
13977 * src/gram.h (rule_t): action and action_line are new members.
13978 * src/reader.c (symbol_list): Likewise.
13979 (copy_action): Save the actions within the rule.
13980 (packgram): Save them in rule_table.
13981 * src/output.c (actions_output): New.
13982 (output_parser): Use it on `%%actions'.
13983 (output_rule_data): Don't free rule_table.
13984 (output): Do it.
13985 (prepare): Don't save the `action' muscle.
13986 * src/bison.simple: s/%%action/%%actions/.
13987
51576fb3
AD
139882001-12-15 Akim Demaille <akim@epita.fr>
13989
13990 * src/reader.c (copy_action): When --yacc, don't append a `;'
13991 to the user action: let it fail if lacking.
dee049eb 13992 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 13993
2648a72d
AD
139942001-12-14 Akim Demaille <akim@epita.fr>
13995
13996 * src/lex.c (literalchar): Simply return the char you decoded, non
13997 longer mess around with obstacks and int pointers.
13998 Adjust all callers.
13999
92790e5b
AD
140002001-12-14 Akim Demaille <akim@epita.fr>
14001
14002 * src/lex.c (literalchar): Don't escape the special characters,
14003 just decode them, and keep them as char (before, eol was output as
14004 the 2 char string `\n' etc.).
14005 * src/output.c (output_rule_data): Use quotearg to output the
14006 token strings.
14007
927c1557
PE
140082001-12-13 Paul Eggert <eggert@twinsun.com>
14009
14010 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
14011 Do not infringe on the global user namespace when using C++.
14012 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
14013 All uses of `fprintf' and `stderr' changed.
14014
14015 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
14016
ed8e1f68
AD
140172001-12-13 Akim Demaille <akim@epita.fr>
14018
14019 The computation of nullable is broken: it doesn't handle empty
14020 RHS's properly.
14021
14022 * tests/torture.at (GNU AWK Grammar): New.
14023 * tests/sets.at (Nullable): New.
14024 * src/nullable.c (set_nullable): Instead of blindly looping over
14025 `ritems', loop over the rules, and then over their rhs's.
14026
14027 Work around Autotest bugs.
14028
14029 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
14030 frame, because Autotest understand lines starting with a `+' as
14031 traces from the shell. Then, they are not processed properly.
14032 Admittedly an Autotest bug, but we don't have time to wait for
14033 Autotest to catch up.
14034 * tests/regression.at (Broken Closure): Adjust to the new table
14035 frames.
14036 Move to...
14037 * tests/sets.at: here.
14038
cb581495
AD
140392001-12-13 Akim Demaille <akim@epita.fr>
14040
14041 * src/closure.c (closure): Use nrules instead of playing tricks
14042 with BITS_PER_WORD.
14043
2e729273
AD
140442001-12-13 Akim Demaille <akim@epita.fr>
14045
14046 * src/print.c (print_actions): Output the handling of `$' as the
14047 traces do: shifting the token EOF. Before EOF was treated as a
14048 nonterminal.
14049 * tests/regression.at: Adjust some tests.
14050 * src/print_graph.c (print_core): Complete the set of items via
14051 closure. The next-to-final and final states are still unsatisfying,
14052 but that's to be addressed elsewhere.
14053 No longer output the rule numbers, but do output the state number.
14054 A single loop for the shifts + gotos is enough, but picked a
14055 distinct color for each.
14056 (print_graph): Initialize and finalize closure.
14057
107f7dfb
AD
140582001-12-13 Akim Demaille <akim@epita.fr>
14059
14060 * src/reader.c (readgram): Remove dead code, an strip useless
14061 braces.
14062 (get_type): Remove, unused.
14063
9b53a24f
AD
140642001-12-12 Akim Demaille <akim@epita.fr>
14065
14066 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
14067 on that of lib/error.c.
14068
dbfb6dcd
AD
140692001-12-12 Akim Demaille <akim@epita.fr>
14070
14071 Some hosts don't like `/' in includes.
14072
14073 * src/system.h: Include libgettext.h without qualifying the path.
14074 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
14075 $(top_srcdir).
14076
c25fb648
MA
140772001-12-11 Marc Autret <autret_m@epita.fr>
14078
14079 * src/output.c (output_parser): Remove useless muscle.
14080
710ddc4f
MA
140812001-12-11 Marc Autret <autret_m@epita.fr>
14082
14083 * src/bison.simple: Remove #line just before %%epilogue. It
14084 is now handled in ...
14085 * src/reader.c (read_additionnal_code): Add the output of a
14086 #line for the epilogue.
14087
e83d80b8
MA
140882001-12-10 Marc Autret <autret_m@epita.fr>
14089
927c1557 14090 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
14091 replace precedent remove.
14092 * src/bison.simple: Remove #line before %%prologue because
14093 %%input-line is wrong at this time.
14094
971d5158
MA
140952001-12-10 Marc Autret <autret_m@epita.fr>
14096
14097 * src/reader.c (symbols_output): Clean up.
927c1557 14098 * src/output.c (output_gram, output): Clean up.
971d5158 14099
5edafffd
AD
141002001-12-10 Akim Demaille <akim@epita.fr>
14101
14102 * src/lalr.c (initialize_lookaheads): New. Extracted from...
14103 * src/LR0.c (set_state_table): here.
14104 * src/lalr.c (lalr): Call it.
14105
0279f8e9
AD
141062001-12-10 Akim Demaille <akim@epita.fr>
14107
14108 * src/state.h (shifts): Remove the `number' member: shifts are
14109 attached to state, hence no longer need to be labelled with a
14110 state number.
14111
190c4f5f
AD
141122001-12-10 Akim Demaille <akim@epita.fr>
14113
14114 Now that states have a complete set of members, the linked list of
14115 shifts is useless: just fill directly the state's shifts member.
14116
14117 * src/state.h (shifts): Remove the `next' member.
14118 * src/LR0.c (first_state, last_state): Remove.
14119 Adjust the callers.
14120 (augment_automaton): Don't look for the shifts that must be added
14121 a shift on EOF: it is those of the state we looked for! But now,
14122 since shifts are attached, it is no longer needed to looking
14123 merely by its id: its number.
14124
2a73b93d
AD
141252001-12-10 Akim Demaille <akim@epita.fr>
14126
14127 * src/LR0.c (augment_automaton): Better variable locality.
14128 Remove an impossible branch: if there is a state corresponding to
14129 the start symbol being shifted, then there is shift for the start
14130 symbol from the initial state.
14131
74392f6a
AD
141322001-12-10 Akim Demaille <akim@epita.fr>
14133
14134 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
14135 only when appropriate: when insert_start_shifting_state' is not
14136 invoked.
14137 * tests/regression.at (Rule Line Numbers): Adjust.
14138
37c82725
AD
141392001-12-10 Akim Demaille <akim@epita.fr>
14140
14141 * src/LR0.c (augment_automaton): Now that all states have shifts,
14142 merge the two cases addition shifts to the initial state.
14143
6a164e0c
AD
141442001-12-10 Akim Demaille <akim@epita.fr>
14145
14146 * src/lalr.c (set_state_table): Move to...
14147 * src/LR0.c: here.
14148 * src/lalr.c (lalr): Don't call it...
14149 * src/LR0.c (generate_states): do it.
14150 * src/LR0.h (first_state): Remove, only the table is used.
14151
7215de24
AD
141522001-12-10 Akim Demaille <akim@epita.fr>
14153
14154 * src/LR0.h (first_shift, first_reduction): Remove.
14155 * src/lalr.c: Don't use first_shift: find shifts through the
14156 states.
14157
80e25d4d
AD
141582001-12-10 Akim Demaille <akim@epita.fr>
14159
14160 * src/LR0.c: Attach shifts to states as soon as they are
14161 computed.
14162 * src/lalr.c (set_state_table): Instead of assigning shifts to
14163 state, just assert that the mapping was properly done.
14164
0ab3728b
AD
141652001-12-10 Akim Demaille <akim@epita.fr>
14166
14167 * src/LR0.c (insert_start_shift): Rename as...
14168 (insert_start_shifting_state): this.
14169 (insert_eof_shifting_state, insert_accepting_state): New.
14170 (augment_automaton): Adjust.
14171 Better locality of the variables.
14172 When looking if the start_symbol is shifted from the initial
14173 state, using `while (... symbol != start_symbol ...)' sounds
14174 better than `while (... symbol < start_symbol ...)': If fail
14175 to see how the order between symbols could be relevant!
14176
78af9bbc
AD
141772001-12-10 Akim Demaille <akim@epita.fr>
14178
14179 * src/getargs.h: Don't declare `spec_name_prefix' and
14180 `spec_file_prefix', declared by src/files.h.
14181 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
14182 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
14183 * src/output.c (prepare): Adjust.
14184 * src/reader.c (symbols_output): Likewise.
14185 * src/vmsgetargs.c: Vaguely adjust, but who cares?
14186
bdef2a41
AD
141872001-12-10 Akim Demaille <akim@epita.fr>
14188
14189 * src/muscle_tab.c (muscle_init): NULL is a better default than
14190 `"0"'.
14191
3735969c
AD
141922001-12-10 Akim Demaille <akim@epita.fr>
14193
14194 * src/reader.c (reader): Calling symbols_output once is enough.
14195
49701457
AD
141962001-12-10 Akim Demaille <akim@epita.fr>
14197
14198 Now that states have a complete set of members, the linked list of
14199 reductions is useless: just fill directly the state's reductions
14200 member.
14201
14202 * src/state.h (struct reductions): Remove member `number' and
14203 `next'.
14204 * src/LR0.c (first_reduction, last_reduction): Remove.
14205 (save_reductions): Don't link the new reductions, store them in
14206 this_state.
14207 * src/lalr.c (set_state_table): No need to attach reductions to
14208 states, it's already done.
14209 * src/output.c (output_actions): No longer free the shifts, then
14210 the reductions, then the states: free all the states and their
14211 members.
14212
0edad749
AD
142132001-12-10 Akim Demaille <akim@epita.fr>
14214
14215 * src/options.c (OPTN, DRTV, BOTH): New.
14216 (option_table): Use them.
14217
0edad749
AD
14218 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
14219 the job of system.h.
14220 * src/options.c: Don't include stdio.h and xalloc.h for the same
14221 reasons.
14222
5449dd0f
AD
142232001-12-10 Akim Demaille <akim@epita.fr>
14224
14225 * src/output.c (output, prepare): Make sure the values of the
14226 muscles `action' and `prologue' are 0-terminated.
14227
a870c567
AD
142282001-12-10 Akim Demaille <akim@epita.fr>
14229
14230 Clean up GCC warnings.
14231
14232 * src/reader.c (copy_action): `buf' is not used.
14233 (parse_skel_decl): Be static.
14234 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
14235 * src/options.h (create_long_option_table): Have a real prototype.
14236 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
14237 (hash_delete_at): Return const void *.
14238 Adjust casts to preserve the const.
14239
80df8768
AD
142402001-12-10 Akim Demaille <akim@epita.fr>
14241
14242 * configure.in: Require 2.52g.
14243 M4 is not needed, but AUTOM4TE is.
14244 * m4/m4.m4: Remove.
14245 * tests/Makefile.am: Adjust.
14246
f693ad14
AD
142472001-12-10 Akim Demaille <akim@epita.fr>
14248
14249 One structure for states is enough, even though theoretically
14250 there are LR(0) states and LALR(1) states.
14251
14252 * src/lalr.h (state_t): Remove.
14253 (state_table): Be state_t **, not state_t *.
14254 * src/state.h (core, CORE_ALLOC): Rename as...
14255 (state_t, STATE_ALLOC): this.
14256 Add the LALR(1) members: shifts, reductions, errs.
14257 * src/LR0.c (state_table): Rename as...
14258 (state_hash): this, to avoid name clashes with the global
14259 `state_table'.
14260 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
14261 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
14262
74ffbcb6
AD
142632001-12-10 Akim Demaille <akim@epita.fr>
14264
14265 Bison dumps core on bash.y.
14266 Reported by Pascal Bart.
14267
14268 * src/warshall.c (bitmatrix_print): New.
14269 (TC): Use it.
ba0fe3c7 14270 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
14271 j must be the outer loop.
14272 * tests/regression.at (Broken Closure): New.
14273
07708e19
AD
142742001-12-05 Akim Demaille <akim@epita.fr>
14275
14276 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
14277 its argument.
ba1ecc07 14278 Reported by Peter Hamorsky.
07708e19 14279
92b16366
AD
142802001-12-05 Akim Demaille <akim@epita.fr>
14281
14282 * src/conflicts.c (err_table): Remove.
14283 (resolve_sr_conflict): Adjust.
14284 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
14285 Rename as...
14286 (state_t.reductions, state_t.shifts): this.
14287
076ab033
AD
142882001-12-05 Akim Demaille <akim@epita.fr>
14289
14290 * src/reduce.c (reduce_grammar_tables): No longer disable the
14291 removal of useless rules via CPP but via `if (0)', so that the
14292 compiler still check the code is valid.
14293 For instance, it should have noticed `rline' no longer exists: use
14294 the `line' member of rule_t.
14295 * src/gram.c (dummy, rline): Remove, unused.
14296
3843c413
AD
142972001-12-05 Akim Demaille <akim@epita.fr>
14298
14299 * src/output.c (pack_vector): Use assert, not berror.
14300 * src/main.c (berror): Remove, unused.
14301
43168960
AD
143022001-12-05 Akim Demaille <akim@epita.fr>
14303
14304 New experimental feature: if --verbose --trace output all the
14305 items of a state, not only its kernel.
14306
14307 * src/print.c (print_core): If `trace_flag', then invoke closure
14308 before outputting the items of the state (print_core is no longer
14309 a correct name them).
14310 (print_results): Invoke new_closure/free_closure if needed.
14311
b2872512
AD
143122001-12-05 Akim Demaille <akim@epita.fr>
14313
14314 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
14315 * src/closure.c, src/closure.h (itemsetsize): Rename as...
14316 (nitemset): for consistency with the rest of the project.
14317
23cbcc6c
AD
143182001-12-05 Akim Demaille <akim@epita.fr>
14319
14320 * src/closure.c (print_closure): Improve.
14321 (closure): Use it for printing input and output.
14322
03ec521c
AD
143232001-12-05 Akim Demaille <akim@epita.fr>
14324
14325 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
14326 indexed by nonterminals.
14327
3a7456dd
AD
143282001-12-05 Akim Demaille <akim@epita.fr>
14329
14330 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
14331 what it was!).
14332 * src/warshall.h: Remove accidental duplication of the content.
14333
1cbcf2e7
AD
143342001-12-05 Akim Demaille <akim@epita.fr>
14335
14336 * src/closure.c (set_fderives): De-obfuscate.
14337
84182270
AD
143382001-12-05 Akim Demaille <akim@epita.fr>
14339
14340 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
14341
3f6f053c
AD
143422001-12-05 Akim Demaille <akim@epita.fr>
14343
14344 * src/closure.c (set_firsts): De-obfuscate.
14345
7a5350ba
AD
143462001-12-05 Akim Demaille <akim@epita.fr>
14347
14348 * src/output.c (action_row): De-obfuscate
14349 using the good o' techniques: arrays not pointers, variable
14350 locality, BITISSET, RESETBIT etc.
14351
d954473d
AD
143522001-12-05 Akim Demaille <akim@epita.fr>
14353
14354 Pessimize the code to simplify it: from now on, all the states
14355 have a valid SHIFTS, which NSHIFTS is possibly 0.
14356
14357 * src/LR0.c (shifts_new): Be global and move to..
14358 * src/state.c, src/state.h: here.
14359 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
14360 * src/print_graph: Adjust.
14361
9839bbe5
AD
143622001-12-05 Akim Demaille <akim@epita.fr>
14363
14364 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
14365 * src/conflicts.c: Use it.
14366 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
14367 incorrectly ``simplified''.
14368
9f136c07
AD
143692001-12-05 Akim Demaille <akim@epita.fr>
14370
14371 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
14372 using the good o' techniques: arrays not pointers, variable
14373 locality, BITISSET, RESETBIT etc.
14374
b608206e
AD
143752001-12-05 Akim Demaille <akim@epita.fr>
14376
14377 * src/state.h (SHIFT_SYMBOL): New.
14378 * src/conflicts.c: Use it to deobfuscate.
14379
52afa962
AD
143802001-12-05 Akim Demaille <akim@epita.fr>
14381
14382 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
14383 (print_reductions): De-obfuscate using the good o' techniques:
14384 arrays not pointers, variable locality, BITISSET.
14385
e74dc321
AD
143862001-12-05 Akim Demaille <akim@epita.fr>
14387
14388 * src/conflicts.c (print_reductions): Arrays, not pointers.
14389 Use BITISSET.
14390
768fca83
AD
143912001-12-05 Akim Demaille <akim@epita.fr>
14392
14393 * src/conflicts.c (print_reductions): Pessimize, but clarify.
14394
a17e599f
AD
143952001-12-05 Akim Demaille <akim@epita.fr>
14396
14397 * src/conflicts.c (print_reductions): Improve variable locality.
14398
a04bc341
AD
143992001-12-05 Akim Demaille <akim@epita.fr>
14400
14401 * src/conflicts.c (print_reductions): Pessimize, but clarify.
14402
c8ea038e
AD
144032001-12-05 Akim Demaille <akim@epita.fr>
14404
14405 * src/conflicts.c (print_reductions): Improve variable locality.
14406
aa2aab3c
AD
144072001-12-05 Akim Demaille <akim@epita.fr>
14408
14409 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
14410 * src/lalr.c: Use them.
14411
b178c8cc
AD
144122001-12-05 Akim Demaille <akim@epita.fr>
14413
14414 * src/LR0.c (augment_automaton): Formatting changes.
14415 Better variable locality.
14416
f67d13aa
AD
144172001-12-05 Akim Demaille <akim@epita.fr>
14418
14419 * src/lalr.c (matrix_print): New.
14420 (transpose): Use it.
14421 Use arrays instead of pointers.
14422
c2713865
AD
144232001-12-05 Akim Demaille <akim@epita.fr>
14424
14425 * src/lalr.c (maxrhs): Move to...
14426 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
14427 * src/lalr.c (build_relations): Adjust.
14428
9887c18a
AD
144292001-12-05 Akim Demaille <akim@epita.fr>
14430
14431 * src/lalr.c (transpose): Free the memory allocated to the
14432 argument, as it is replaced by the results by the unique caller.
14433 (build_relations): Merely invoke transpose: it handles the memory
14434 deallocation.
14435 Improve variable locality.
14436 Avoid variables used as mere abbreviations.
14437 (compute_lookaheads): Use arrays instead of pointers.
14438
4d4f699c
AD
144392001-12-05 Akim Demaille <akim@epita.fr>
14440
14441 * src/lalr.c (initialize_F): Improve variable locality.
14442 Avoid variables used as mere abbreviations.
14443
80a69750
AD
144442001-12-05 Akim Demaille <akim@epita.fr>
14445
14446 * src/derives.c (print_derives): Display the ruleno.
14447 * src/lalr.c (initialize_F, transpose): Better variable locality
14448 to improve readability.
14449 Avoid variables used as mere abbreviations.
14450
fe961097
AD
144512001-12-05 Akim Demaille <akim@epita.fr>
14452
14453 * src/lalr.c (traverse): Use arrays instead of pointers.
14454
e3e4e814
AD
144552001-12-05 Akim Demaille <akim@epita.fr>
14456
14457 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
14458 the handling of squeue.
14459 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
14460
630e182b
AD
144612001-12-05 Akim Demaille <akim@epita.fr>
14462
14463 Because useless nonterminals are now kept alive (instead of being
14464 `destroyed'), we now sometimes examine them, and store information
14465 related to them. Hence we need to know their number, and adjust
14466 memory allocations.
14467
14468 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
14469 static.
14470 * src/LR0.c (allocate_itemsets): The memory allocated to
14471 `symbol_count' was used for two different purpose: once to count
14472 the number of occurrences of each symbol, and later reassigned to
14473 `shift_symbol', containing the symbol that can be shifted from a
14474 given state.
14475 Deobfuscate, i.e., allocate, use and free `symbol_count' here
14476 only, and...
14477 (new_itemsets): Allocate `shift_symbol' here.
14478 (allocate_itemsets): symbol_count includes useless nonterminals.
14479 Make room for them.
14480 (free_storage): Use `free', not `XFREE', for pointers that cannot
14481 be null.
14482
81b51460
AD
144832001-12-05 Akim Demaille <akim@epita.fr>
14484
14485 * src/nullable.c (set_nullable): Deobfuscate the handling of
14486 ritem.
14487 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
14488
3067fbef
AD
144892001-12-05 Akim Demaille <akim@epita.fr>
14490
14491 * src/gram.c, src/gram.h (ritem_print): New.
14492 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
14493 (This useless function was defined only to work around VMS linkers
14494 that can't handle compilation units with variables only).
14495 * src/reduce.c (dump_grammar): Use it to trace the construction of
14496 ritem.
14497
c2bea5f9
PE
144982001-12-04 Paul Eggert <eggert@twinsun.com>
14499
7d27c823
PE
14500 * src/bison.simple (union yyalloc): Change member names
14501 to be the same as the stack names.
14502 (yyparse): yyptr is now union yyalloc *, not char *.
14503 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
14504 and may generate better code on some machines.
c2bea5f9
PE
14505 (yystpcpy): Use prototype if __STDC__ is defined, not just
14506 if __cplusplus is defined.
35687a9d 14507
2c8a9dfa
AD
145082001-11-30 Akim Demaille <akim@epita.fr>
14509
14510 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
14511 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
14512 Gettext doesn't compile cleanly, and dies with -Werror.
14513 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
14514 Include WARNING_CFLAGS here.
14515 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
14516 before being defined.
14517
f4e421e6
AD
145182001-11-27 Paul Eggert <eggert@twinsun.com>
14519
14520 * lib/quotearg.h (quotearg_n, quotearg_n_style):
14521 First arg is int, not unsigned.
14522 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
14523 (SIZE_MAX, UINT_MAX): New macros.
14524 (quotearg_n_options): Abort if N is negative.
14525 Avoid overflow check on hosts where size_t is 64 bits and int
14526 is 32 bits, as overflow is impossible there.
14527 Fix off-by-one typo that caused unnecessary reallocation.
14528
7093d0f5
AD
145292001-11-29 Paul Eggert <eggert@twinsun.com>
14530
14531 Name space cleanup in generated parser.
14532
14533 * doc/bison.texinfo (Bison Parser): Discuss system headers
14534 and their effect on the user name space.
14535
14536 * src/bison.simple:
14537 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
14538 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
14539 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
14540
14541 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
14542 on user names when possible.
14543
14544 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
14545 Simplify test for whather <alloca.h> exists.
14546
14547 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
14548
14549 (<stdio.h>): Include if YYDEBUG.
14550
14551 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
14552 ! defined (yyoverflow) && ! defined (yymemcpy).
14553
14554 (yymemcpy, yyparse): Rename local variables as needed so that
14555 they all begin with 'yy'.
14556
14557 (yystrlen, yystpcpy): New functions.
14558
14559 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
14560 All uses changed.
14561
14562 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
14563 instead of relying on string.h functions. Use YYSTACK_ALLOC
14564 and YYSTACK_FREE instead of malloc and free.
14565
fd51e5ff
AD
145662001-11-30 Akim Demaille <akim@epita.fr>
14567
14568 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
14569 before their first uses.
14570 (YYBISON, YYPURE): Move to the top of the output.
14571
7d13ff5f
AD
145722001-11-30 Akim Demaille <akim@epita.fr>
14573
14574 * tests/reduce.at (Useless Nonterminals): Fix.
14575
892a3995
AD
145762001-11-30 Akim Demaille <akim@epita.fr>
14577
14578 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
14579 if body instead of `;' to pacify GCC's warnings.
14580
68f1e3ed
AD
145812001-11-30 Akim Demaille <akim@epita.fr>
14582
14583 Instead of mapping the LHS of unused rules to -1, keep the LHS
14584 valid, but flag the rules as invalid.
14585
14586 * src/gram.h (rule_t): `useful' is a new member.
14587 * src/print.c (print_grammar): Adjust.
14588 * src/derives.c (set_derives): Likewise.
14589 * src/reader.c (packgram, reduce_output): Likewise.
14590 * src/reduce.c (reduce_grammar_tables): Likewise.
14591 * tests/reduce.at (Underivable Rules, Useless Rules): New.
14592
d2d1b42b
AD
145932001-11-30 Akim Demaille <akim@epita.fr>
14594
14595 * src/reduce.c (reduce_output): Formatting changes.
14596 * src/print.c (print_results, print_grammar): Likewise.
14597 * tests/regression.at (Rule Line Numbers)
14598 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
14599
760b53a8
AD
146002001-11-30 Akim Demaille <akim@epita.fr>
14601
14602 * src/reduce.c (nonterminals_reduce): Instead of throwing away
14603 useless nonterminals, move them at the end of the symbol arrays.
14604 (reduce_output): Adjust.
14605 * tests/reduce.at (Useless Nonterminals): Adjust.
14606
00238958
AD
146072001-11-30 Akim Demaille <akim@epita.fr>
14608
14609 * src/reduce.c: Various comment/formatting changes.
14610 (nonterminals_reduce): New, extracted from...
14611 (reduce_grammar_tables): here.
14612 (reduce_grammar): Call nonterminals_reduce.
14613
396452de
PE
146142001-11-29 Paul Eggert <eggert@twinsun.com>
14615
14616 * src/bison.simple (YYSTACK_REALLOC): Remove.
14617 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
14618 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
14619 New macros.
14620 (union yyalloc): New type.
14621 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
14622 an arbitrary restriction on hosts where size_t is wider than int.
14623
14624 (yyparse): Don't dump core if alloca or malloc fails; instead, report
14625 a parser stack overflow. Allocate just one block of memory for all
14626 three stacks, instead of allocating three blocks; this typically is
14627 faster and reduces fragmentation.
14628
14629 Do not limit the number of items in the stack to a value that fits
14630 in 'int', as this is an arbitrary limit on hosts with 64-bit
14631 size_t and 32-bit int.
14632
147e184c
MA
146332001-11-29 Marc Autret <autret_m@epita.fr>
14634
14635 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
14636 of defining YYERROR_VERBOSE.
14637 [AT_DATA]: $4 is now out of C declarations in the prologue.
14638
426cf563
MA
146392001-11-28 Marc Autret <autret_m@epita.fr>
14640
14641 * src/reader.c (parse_dquoted_param): New.
14642 (parse_skel_decl): Use it.
14643 * src/lex.h: Add its prototype.
14644 * src/lex.c (literalchar): Become not static.
14645
c7925b99
MA
146462001-11-28 Marc Autret <autret_m@epita.fr>
14647
14648 * src/output.h: And put its extern declaration here.
14649 * src/output.c (error_verbose): Define here.
14650 (prepare): Echo name modification.
14651 * src/getargs.h: Clean its extern declaration.
14652 * src/getargs.c (error_verbose_flag): Remove.
14653 (getargs): Remove case 'e'.
14654 * src/options.c (option_table): 'error-verbose' is now seen as simple
14655 percent option.
14656 Include output.h.
14657
14658 * src/reader.c (read_declarations): Remove case tok_include.
14659 (parse_include_decl): Remove.
14660 * src/lex.h (token_t): Remove tok_include.
14661 * src/options.c (option_table): 'include' is now a simple command line
14662 option.
14663
5b5d1929
MA
146642001-11-28 Marc Autret <autret_m@epita.fr>
14665
14666 * src/bison.simple: Adjust muscle names.
14667 * src/muscle_tab.c (muscle_init): Also rename the muscles.
14668 * src/output.c (prepare): s/_/-/ for the muscles names.
14669 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
14670
8850be4b
MA
146712001-11-28 Marc Autret <autret_m@epita.fr>
14672
14673 * src/bison.simple: Fix debug.
14674 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
14675
4a38e613
AD
146762001-11-28 Akim Demaille <akim@epita.fr>
14677
14678 * src/LR0.c (shifts_new): New.
14679 (save_shifts, insert_start_shift, augment_automaton): Use it.
14680
4b35e1c1
AD
146812001-11-28 Akim Demaille <akim@epita.fr>
14682
14683 * src/closure.c (closure): `b' and `ruleno' denote the same value:
14684 keep ruleno only.
14685
d2b04478
AD
146862001-11-28 Akim Demaille <akim@epita.fr>
14687
14688 * src/closure.c (closure): Instead of looping over word in array
14689 then bits in words, loop over bits in array.
14690
2c4c30aa
AD
146912001-11-28 Akim Demaille <akim@epita.fr>
14692
14693 * src/closure.c (closure): No longer optimize the special case
14694 where all the bits of `ruleset[r]' are set to 0, to make the code
14695 clearer.
14696
576890b7
AD
146972001-11-28 Akim Demaille <akim@epita.fr>
14698
14699 * src/closure.c (closure): `r' and `c' are new variables, used to
14700 de-obfuscate accesses to RULESET and CORE.
14701
cb487d7d
AD
147022001-11-28 Akim Demaille <akim@epita.fr>
14703
14704 * src/reduce.c (reduce_print): Use ngettext.
14705 (dump_grammar): Improve the trace accuracy.
14706
6013d43f
AD
147072001-11-28 Akim Demaille <akim@epita.fr>
14708
14709 * src/reduce.c (dump_grammar): Don't translate trace messages.
14710
cb4956ee
AD
147112001-11-28 Akim Demaille <akim@epita.fr>
14712
14713 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
14714 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
14715 as all tags are free'ed afterwards.
14716 From Enrico Scholz.
14717
648185ab
PE
147182001-11-27 Paul Eggert <eggert@twinsun.com>
14719
14720 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
14721 use alloca when we didn't want to, and vice versa.
14722
68254a03
MA
147232001-11-27 Marc Autret <autret_m@epita.fr>
14724
9113b58f
AD
14725 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
14726 initialization.
68254a03
MA
14727 * src/output.c (prepare): Remove its update.
14728
04d843a2
MA
147292001-11-27 Marc Autret <autret_m@epita.fr>
14730
14731 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
14732 Use %error-verbose.
14733
d2079671 147342001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
14735
14736 * src/bison.simple: Remove YYERROR_VERBOSE using.
14737 Use %%error_verbose.
14738 (yyparse): Likewise.
14739 * src/output.c (prepare): Give its final value.
14740 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
14741 * src/getargs.h: Add its extern declaration.
14742 * src/getargs.c (error_verbose_flag): New int.
14743 (getargs): Update to catch new case.
14744 * src/options.c (option_table): 'error-verbose' is a new option.
14745 (shortopts): Update.
14746
e0327bc8
AD
147472001-11-27 Akim Demaille <akim@epita.fr>
14748
14749 * src/system.h: Use intl/libgettext.h.
14750 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
14751
000f1a3c
AD
147522001-11-27 Akim Demaille <akim@epita.fr>
14753
14754 * tests/torture.at (Exploding the Stack Size with Malloc):
14755 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
14756
26cfe0be
AD
147572001-11-27 Akim Demaille <akim@epita.fr>
14758
14759 * src/files.c: Include error.h.
14760 Reported by Hans Aberg.
14761
f6bd5427
MA
147622001-11-26 Marc Autret <autret_m@epita.fr>
14763
d2079671 14764 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
14765 (read_declarations): Add case tok_include.
14766 * src/getargs.h (include): Add its extern definition.
14767 * src/getargs.c (include): New const char *.
14768 (getargs): Add case '-I'.
14769 * src/options.c (option_table): Add include as command line and
14770 percent option.
14771 * src/lex.h (token_t): Add tok_include.
14772
2ca209c1
AD
147732001-11-26 Akim Demaille <akim@epita.fr>
14774
14775 * src/reader.c (readgram): Make sure rules for mid-rule actions
14776 have a lineno equal to that of their host rule.
14777 Reported by Hans Aberg.
14778 * tests/regression.at (Rule Line Numbers): New.
14779
0e41b407
AD
147802001-11-26 Akim Demaille <akim@epita.fr>
14781
14782 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
14783 size_ts.
14784
147852001-11-26 Akim Demaille <akim@epita.fr>
14786
14787 * src/complain.c, src/complain.h (error): Remove, provided by
14788 lib/error.[ch].
14789
e0c40012
AD
147902001-11-26 Akim Demaille <akim@epita.fr>
14791
14792 * src/reader.c (read_declarations): Don't abort on tok_illegal,
14793 issue an error message.
14794 * tests/regression.at (Invalid %directive): New.
14795 Reported by Hans Aberg.
14796
5e147124
AD
147972001-11-26 Akim Demaille <akim@epita.fr>
14798
14799 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
14800 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
14801
a034c8b8
AD
148022001-11-26 Akim Demaille <akim@epita.fr>
14803
14804 * src/conflicts.c (conflicts_print): Don't complain at all when
14805 there are no reduce/reduce conflicts, and as many shift/reduce
14806 conflicts as expected.
14807 * tests/regression.at (%expect right): Adjust.
14808
c64a20f3
AD
148092001-11-23 Akim Demaille <akim@epita.fr>
14810
14811 * lib/alloca.c: Update, from fileutils.
14812
5b0d29bb
AD
148132001-11-23 Akim Demaille <akim@epita.fr>
14814
14815 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
14816
722c4bfe
AD
148172001-11-23 Akim Demaille <akim@epita.fr>
14818
14819 * src/system.h: Include alloca.h.
14820 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
14821
6255b435
AD
148222001-11-23 Akim Demaille <akim@epita.fr>
14823
14824 * src/print_graph.c (print_actions): Remove `rule', unused.
14825 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
14826 pacify GCC's signed < unsigned warnings.
14827 * src/closure.c (itemsetsize): Likewise.
14828 * src/reader.c (symbol_list_new): Static.
14829
b29b2ed5
AD
148302001-11-23 Akim Demaille <akim@epita.fr>
14831
14832 Attaching lineno to buckets is stupid, since only one copy of each
14833 symbol is kept, only the line of the first occurrence is kept too.
14834
14835 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
14836 * src/reader.c (rline_allocated): Remove, unused.
14837 (symbol_list): Have a `line' member.
14838 (symbol_list_new): New.
14839 (readgram): Use it.
14840 * src/print.c (print_grammar): Output the rule line numbers.
14841 * tests/regression.at (Solved SR Conflicts)
14842 (Unresolved SR Conflicts): Adjust.
14843 Reported by Hans Aberg.
14844
a81b1d4a
MA
148452001-11-22 Marc Autret <autret_m@epita.fr>
14846
14847 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
14848
c1ecb3c1
MA
148492001-11-22 Marc Autret <autret_m@epita.fr>
14850
14851 * src/muscle_tab.c (muscle_init): Remove initialization of
14852 skeleton muscle.
14853 * src/output.c (output_master_parser): Do it here.
14854
fbe01355
AD
148552001-11-20 Akim Demaille <akim@epita.fr>
14856
14857 * po/sv.po: New.
14858 * configure.in (ALL_LINGUAS): Adjust.
14859 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
14860 longer contains strings to translate.
14861
81e895c0
AD
148622001-11-19 Akim Demaille <akim@epita.fr>
14863
14864 * src/conflicts.c (conflicts_print): Add a missing \n.
14865
6bb1878b
AD
148662001-11-19 Akim Demaille <akim@epita.fr>
14867
14868 * src/nullable.c (nullable_print): New.
14869 (set_nullable): Call it when tracing.
14870 Better locality of variables.
14871
d9ec2d07
AD
148722001-11-19 Akim Demaille <akim@epita.fr>
14873
14874 * src/print.c (print_actions): Better locality of variables.
14875
720e5c1b
AD
148762001-11-19 Akim Demaille <akim@epita.fr>
14877
14878 * src/derives.c (print_derives): Fix and enrich.
14879 * src/closure.c (print_fderives): Likewise.
14880
fb908786
AD
148812001-11-19 Akim Demaille <akim@epita.fr>
14882
14883 * src/closure.c (itemsetend): Remove, replaced with...
14884 (itemsetsize): new.
14885
125ecb56
AD
148862001-11-19 Akim Demaille <akim@epita.fr>
14887
14888 * src/LR0.c (kernel_end): Remove, replaced with...
14889 (kernel_size): new.
14890
d8cf039f
AD
148912001-11-19 Akim Demaille <akim@epita.fr>
14892
14893 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
14894 to clarify.
14895
7bec0760
AD
148962001-11-19 Akim Demaille <akim@epita.fr>
14897
14898 * src/closure.c (closure): Use arrays instead of pointers to clarify.
14899
c87d4863
AD
149002001-11-19 Akim Demaille <akim@epita.fr>
14901
14902 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
14903 trace messages.
14904 * src/LR0.c: Likewise.
14905 (allocate_itemsets): Use arrays instead of pointers to clarify.
14906
9bfe901c
AD
149072001-11-19 Akim Demaille <akim@epita.fr>
14908
14909 * src/getargs.c (statistics_flag): Replace with...
14910 (trace_flag): New.
14911 (longopts): Accept --trace instead of --statistics.
14912 * src/getargs.h, src/options.c: Adjust.
14913 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
14914 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
14915
97db7bd4
AD
149162001-11-19 Akim Demaille <akim@epita.fr>
14917
cc72668c 14918 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
14919 pointers to clarify the code.
14920 (save_reductions, save_shifts): Factor common parts of alternatives.
14921
2c5f66ed
AD
149222001-11-19 Akim Demaille <akim@epita.fr>
14923
14924 * src/LR0.c (new_state, get_state): Complete TRACE code.
14925 * src/closure.c: Include `reader.h' to get `tags', needed by the
14926 trace code.
14927 Rename the conditional DEBUG as TRACE.
14928 Output consistently TRACEs to stderr, not stdout.
14929 * src/derives.c: Likewise.
14930 * src/reduce.c: (inaccessable_symbols): Using if is better style
14931 than goto.
14932 Use `#if TRACE' instead of `#if 0' for tracing code.
14933
300f275f
AD
149342001-11-19 Akim Demaille <akim@epita.fr>
14935
14936 * src/system.h (LIST_FREE, shortcpy): New.
14937 * src/LR0.c: Use them.
14938 * src/output.c (free_itemsets, free_reductions, free_shifts):
14939 Remove, replaced by LIST_FREE.
14940
f59c437a
AD
149412001-11-19 Akim Demaille <akim@epita.fr>
14942
14943 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
14944 (REDUCTIONS_ALLOC): New.
14945 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
14946 allocation.
14947
6986fd9e
AD
149482001-11-19 Akim Demaille <akim@epita.fr>
14949
14950 * src/LR0.c (new_state): Complete trace code.
14951 * src/nullable.c (set_nullable): Don't translate traces.
14952
4bc30f78
AD
149532001-11-19 Akim Demaille <akim@epita.fr>
14954
14955 * src/print_graph.c (print_core): Better locality of variables.
14956 * src/print.c (print_core): Likewise.
14957
08a946e0
AD
149582001-11-19 Akim Demaille <akim@epita.fr>
14959
14960 * src/vcg.c: You do the output, so you are responsible of the
14961 handling of VCG syntax, in particular: use quotearg.
14962 * src/print_graph.c: Don't.
14963 (print_actions): Don't output the actions as part of the nodes,
14964 since that's the job of the edges.
14965 (print_state): Don't output by hand: fill the node description,
9bfe901c 14966 and ask for its output.
08a946e0 14967
f0473484
AD
149682001-11-19 Akim Demaille <akim@epita.fr>
14969
cc72668c
AD
14970 * src/bison.simple (yyparse): When verbosely reporting an error,
14971 no longer put additional quotes around token names.
f0473484
AD
14972 * tests/calc.at: Adjust.
14973
e41dc700
AD
149742001-11-19 Akim Demaille <akim@epita.fr>
14975
14976 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
14977 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
14978 * src/output.c: Adjust.
14979
652a871c
AD
149802001-11-19 Akim Demaille <akim@epita.fr>
14981
14982 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
14983 (rule_t): this.
14984 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
14985
b2ed6e58
AD
149862001-11-19 Akim Demaille <akim@epita.fr>
14987
14988 * src/gram.h (rule_t): New.
14989 (rule_table): New.
14990 (rrhs, rlhs): Remove, part of state_t.
14991 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
14992 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14993 * src/reader.c, src/reduce.c: Adjust.
14994
edad7067
AD
149952001-11-19 Akim Demaille <akim@epita.fr>
14996
14997 * src/reader.c (symbols_output): New, extracted from...
14998 (packsymbols): Here.
14999 (reader): Call it.
15000
3feec034
AD
150012001-11-19 Akim Demaille <akim@epita.fr>
15002
15003 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
15004 (maxrhs): this new function.
15005
ddcd5fdf
AD
150062001-11-19 Akim Demaille <akim@epita.fr>
15007
cc72668c 15008 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
15009 Adjust.
15010
bb527fc2
AD
150112001-11-19 Akim Demaille <akim@epita.fr>
15012
cc72668c 15013 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
15014 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15015 * src/lalr.c: Adjust.
15016
a845a697
AD
150172001-11-19 Akim Demaille <akim@epita.fr>
15018
15019 * src/lalr.c (initialize_LA): Only initialize LA. Let...
15020 (set_state_table): handle the `lookaheads' members.
15021
f004bf6a
AD
150222001-11-19 Akim Demaille <akim@epita.fr>
15023
cc72668c
AD
15024 * src/lalr.h (lookaheads): Removed array, whose contents is now
15025 a member of...
f004bf6a
AD
15026 (state_t): this structure.
15027 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15028 Adjust.
15029
de326cc0
AD
150302001-11-19 Akim Demaille <akim@epita.fr>
15031
cc72668c
AD
15032 * src/lalr.h (consistent): Removed array, whose contents is now
15033 a member of...
de326cc0
AD
15034 (state_t): this structure.
15035 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15036 Adjust.
15037
90b4416b
AD
150382001-11-19 Akim Demaille <akim@epita.fr>
15039
cc72668c
AD
15040 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
15041 contents are now members of...
90b4416b
AD
15042 (state_t): this structure.
15043 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15044 Adjust.
15045
9703cc49
AD
150462001-11-19 Akim Demaille <akim@epita.fr>
15047
15048 * src/lalr.h (state_t): New.
15049 (state_table): Be a state_t * instead of a core **.
15050 (accessing_symbol): Remove, part of state_t.
15051 * src/lalr.c: Adjust.
15052 (set_accessing_symbol): Merge into...
15053 (set_state_table): this.
15054 * src/print_graph.c, src/conflicts.c: Adjust.
15055
d803322e
AD
150562001-11-14 Akim Demaille <akim@epita.fr>
15057
15058 * tests/calc.at, tests/output.at, tests/regression.at,
15059 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
15060 now the tests are run in private dirs, therefore AC_CLEANUP and
15061 family can be simplified to 0-ary.
15062 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
15063 use abs. path to find config.h.
15064 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
15065 stderr, there can be way too much random noise.
15066 Instead pass -Werror to GCC and rely on the exit status.
15067 Reported by Wolfram Wagner.
15068
3d76b07d
AD
150692001-11-14 Akim Demaille <akim@epita.fr>
15070
15071 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
15072 defined only if yyoverflow is defined, to avoid `warning: unused
15073 variable `yyvs1''.
15074 Reported by The Test Suite.
15075
09b503c8
AD
150762001-11-14 Akim Demaille <akim@epita.fr>
15077
15078 * src/print.c: Include reduce.h.
15079 Reported by Hans Aberg.
15080
150812001-11-14 Akim Demaille <akim@epita.fr>
15082
15083 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
15084 Revert a previous patch: these are really const.
15085 * src/conflicts.c (conflict_report): Additional useless pair of
15086 braces to pacify GCC's warnings for `if () if () {} else {}'.
15087 * src/lex.c (parse_percent_token): Replace equal_offset with
15088 arg_offset.
15089 arg is const.
15090 Be sure to strdup `arg' when used, since there is no reason for
15091 token_buffer not to change.
15092
0f37a994
AD
150932001-11-14 Akim Demaille <akim@epita.fr>
15094
15095 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
15096 definition.
15097 * src/main.c (main): Use them.
15098 Suggested by Hans Aberg.
15099
d39d93b8
AD
151002001-11-12 Akim Demaille <akim@epita.fr>
15101
15102 * src/system.h (ngettext): Now that we use ngettext, be sure to
15103 provide a default definition when NLS are not used.
15104
9edcd895
AD
151052001-11-12 Akim Demaille <akim@epita.fr>
15106
15107 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
15108 Use @kbd to denote user input.
15109 (Language and Grammar): ANSIfy the example.
15110 Adjust its layout for info/notinfo.
15111 (Location Tracking Calc): Output error messages to stderr.
15112 Output locations in a more GNUtically correct way.
15113 Fix a couple of Englishos.
15114 Adjust @group/@end group pairs.
15115
7da99ede
AD
151162001-11-12 Akim Demaille <akim@epita.fr>
15117
e3aa65c5 15118 %expect was not functioning at all.
7da99ede
AD
15119
15120 * src/conflicts.c (expected_conflicts): Set to -1.
15121 (conflict_report): Use ngettext.
15122 (conflicts_print): Check %expect and make its violation an error.
15123 * doc/bison.texinfo (Expect Decl): Adjust.
15124 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
15125 * tests/regression.at (%expect not enough, %expect right)
15126 (%expect too much): New.
15127
ba9dda1a
AD
151282001-11-12 Akim Demaille <akim@epita.fr>
15129
15130 * tests/regression.at (Conflicts): Rename as...
15131 (Unresolved SR Conflicts): this.
15132 (Solved SR Conflicts): New.
15133
337c5bd1
AD
151342001-11-12 Akim Demaille <akim@epita.fr>
15135
15136 * src/reduce.c (print_results): Rename as...
15137 (reduce_output): This.
15138 Output to OUT, passed as argument, instead of output_obstack.
15139 (dump_grammar): Likewise.
15140 (reduce_free): New.
15141 Also free V1.
15142 (reduce_grammar): No longer call reduce_output, since...
15143 * src/print.c (print_results): do it.
15144 * src/main.c (main): Call reduce_free;
15145
c73a41af
AD
151462001-11-12 Akim Demaille <akim@epita.fr>
15147
15148 * src/conflicts.c (print_reductions): Accept OUT as argument.
15149 Output to it, not to output_obstack.
15150 * src/print.c (print_actions): Adjust.
15151
0df87bb6
AD
151522001-11-12 Akim Demaille <akim@epita.fr>
15153
15154 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
15155 the result instead of using...
15156 (src_total, rrc_total, src_count, rrc_count): Remove.
15157 (any_conflicts): Remove.
15158 (print_conflicts): Split into...
15159 (conflicts_print, conflicts_output): New.
15160 * src/conflicts.h: Adjust.
15161 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 15162 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
15163 * tests/regression.at (Conflicts): New.
15164 Reported by Tom Lane.
15165
e4d3d4de
AD
151662001-11-12 Akim Demaille <akim@epita.fr>
15167
15168 * tests/regression.at (Invalid input): Remove, duplicate with
15169 ``Invalid input: 1''.
15170
6d7d248e
AD
151712001-11-12 Akim Demaille <akim@epita.fr>
15172
15173 * tests/torture.at (AT_DATA_STACK_TORTURE)
15174 (Exploding the Stack Size with Alloca)
15175 (Exploding the Stack Size with Malloc): New.
15176
e9e4c321
AD
151772001-11-12 Akim Demaille <akim@epita.fr>
15178
15179 * src/bison.simple (YYSTACK_REALLOC): New.
15180 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 15181 Reported by Per Allansson.
e9e4c321 15182
5f7e0832
AD
151832001-11-12 Pascal Bart <pascal.bart@epita.fr>
15184
15185 * src/bison.simple: Define type yystype instead of YYSTYPE, and
15186 define CPP macro, which substitute YYSTYPE by yystype.
15187 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
15188 with yyltype/YYLTYPE. This allows inclusion of the generated
15189 header within the parser if the compiler, such as GGC, accepts
15190 multiple equivalent #defines.
15191 From Akim.
15192
e3f1699f
AD
151932001-11-05 Akim Demaille <akim@epita.fr>
15194
15195 * src/reader.c (symbols_output): New, extracted from...
15196 (packsymbols): here.
15197 (reader): Adjust.
15198
65be0866
AD
151992001-11-05 Akim Demaille <akim@epita.fr>
15200
15201 * src/lex.c (parse_percent_token): s/quotearg/quote/.
15202
e4d910bf
AD
152032001-11-05 Akim Demaille <akim@epita.fr>
15204
15205 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
15206 pattern.
15207
951366c1
AD
152082001-11-05 Akim Demaille <akim@epita.fr>
15209
15210 * src/options.h (struct option_table_struct): set_flags is void*.
15211 * src/options.c (longopts): Support `--output' and `%output'.
15212 (usage): Adjust.
15213 * src/lex.h (tok_setopt): Remove, replaced with...
15214 (tok_intopt, tok_stropt): these new guys.
15215 * src/lex.c (getopt.h): Not needed.
15216 (token_buffer, unlexed_token_buffer): Not const.
15217 (percent_table): Promote `-' over `_' in directive names.
15218 Active `%name-prefix', `file-prefix', and `output'.
15219 (parse_percent_token): Accept possible arguments to directives.
15220 Promote `-' over `_' in directive names.
15221
d8988b2f
AD
152222001-11-04 Akim Demaille <akim@epita.fr>
15223
15224 * doc/bison.texinfo (Decl Summary): Split the list into
15225 `directives for grammars' and `directives for bison'.
15226 Sort'em.
15227 Add description of `%name-prefix', `file-prefix', and `output'.
15228 Promote `-' over `_' in directive names.
15229 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
15230 Simplify the description of `--name-prefix'.
15231 Promote `-' over `_' in directive names.
15232 Promote `--output' over `--output-file'.
15233 Fix the description of `--defines'.
15234 * tests/output.at: Exercise %file-prefix and %output.
15235
6468d18e
AD
152362001-11-02 Akim Demaille <akim@epita.fr>
15237
15238 * doc/refcard.tex: Update.
15239
6b7e85b9
AD
152402001-11-02 Akim Demaille <akim@epita.fr>
15241
15242 * src/symtab.h (SUNDEF): New.
15243 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
15244 stand for `uninitialized', instead of 0.
15245 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
15246 * src/lex.c (lex): Adjust.
15247
15248 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
15249 Number it 0.
15250 Let yylex return it instead of a plain 0.
15251 Reported by Dick Streefland.
15252
cd5aafcf
AD
152532001-11-02 Akim Demaille <akim@epita.fr>
15254
15255 * tests/regression.at (Mixing %token styles): New test.
15256
037ca2f1
AD
152572001-11-02 Akim Demaille <akim@epita.fr>
15258
15259 * src/reader.c (parse_thong_decl): Formatting changes.
15260 (token_translations_init): New, extracted from...
15261 (packsymbols): Here.
15262 Adjust.
15263
270a173c
AD
152642001-11-01 Akim Demaille <akim@epita.fr>
15265
15266 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
15267 Check that `9foo.y' produces correct cpp guards.
15268 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
15269 guards.
15270 Reported by Wwp.
15271
561f9a30
AD
152722001-11-01 Akim Demaille <akim@epita.fr>
15273
15274 * tests/regression.at (Invalid input: 2): New.
15275 * src/lex.c (unlexed_token_buffer): New.
15276 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
15277 too.
15278 Reported by Wwp.
15279
f987e9d2
AD
152802001-11-01 Akim Demaille <akim@epita.fr>
15281
15282 * tests/calc.at: Catch up with 1.30.
15283 * configure.in: Bump to 1.49a.
15284 Adjust to newer Autotest.
15285
0846f581
PB
152862001-10-19 Pascal Bart <pascal.bart@epita.fr>
15287
15288 * src/conflicts.c: Move global variables rrc_total and src_total ...
15289 (print_conflicts): here.
15290 * src/output.c (output): Free global variable user_toknums.
15291 * src/lex.c (token_obstack): Become static.
15292
3c1a79b3
AD
152932001-10-18 Akim Demaille <akim@epita.fr>
15294
15295 * tests/atlocal.in (GCC): Add.
15296 * tests/calc.at: s/m4_match/m4_bmatch/.
15297 s/m4_patsubst/m4_bpatsubst/.
15298 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
15299 * configure.in: AC_SUBST(GCC).
15300
5d52e7d0
MA
153012001-10-14 Marc Autret <autret_m@epita.fr>
15302
15303 * src/options.c (create_long_option_table): Fix.
15304
631aa1d3
AD
153052001-10-10 Akim Demaille <akim@epita.fr>
15306
15307 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
15308
f6ec6d13
AD
153092001-10-04 Akim Demaille <akim@epita.fr>
15310
15311 * src/reader.c (parse_union_decl): Push the caracters in
15312 union_obstack, not attrs_obstack.
15313
342b8b6e
AD
153142001-10-04 Akim Demaille <akim@epita.fr>
15315
15316 Merge in the branch 1.29.
15317
15318 * src/reader.c (packsymbols): Use a temporary obstack for
15319 `%%tokendef', since output_stack is already used elsewhere.
15320
15321 2001-10-02 Akim Demaille <akim@epita.fr>
15322
15323 Bump 1.29d.
15324
15325 2001-10-02 Akim Demaille <akim@epita.fr>
15326
15327 Version 1.29c.
15328
15329 2001-10-02 Akim Demaille <akim@epita.fr>
15330
15331 * tests/regression.at (Invalid CPP headers): New.
15332 From Alexander Belopolsky.
15333 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
15334
15335 2001-10-02 Akim Demaille <akim@epita.fr>
15336
15337 * tests/regression.at (Invalid input): New.
15338 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
15339 Reported by Shura.
15340
15341 2001-10-02 Akim Demaille <akim@epita.fr>
15342
15343 * tests/calc.at: Now that --debug works, the tests must be adjusted.
15344
15345 2001-10-02 Akim Demaille <akim@epita.fr>
15346
15347 * src/output.c (output_parser): Assert `skeleton'.
15348 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
15349 systems.
15350 From Shura.
15351
15352 2001-10-01 Marc Autret <autret_m@epita.fr>
15353
15354 * src/lex.h: Echo modifications.
15355 * src/lex.c (unlex): Parameter is now token_t.
15356 From Hans Aberg.
15357
15358 2001-10-01 Marc Autret <autret_m@epita.fr>
15359
15360 * src/main.c: Include lex.h.
15361 From Hans Aberg.
15362
15363 2001-09-29 Akim Demaille <akim@epita.fr>
15364
15365 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
15366
15367 2001-09-28 Akim Demaille <akim@epita.fr>
15368
15369 * tests/testsuite.at: Update to newer Autotest.
15370 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
15371
15372 2001-09-27 Akim Demaille <akim@epita.fr>
15373
15374 Position independent wrapper.
15375
15376 * tests/bison: Remove.
15377 * tests/bison.in: New.
15378 * configure.in: Adjust.
15379
15380 2001-09-27 Paul Eggert <eggert@twinsun.com>
15381
15382 Port quotearg fixes from tar 1.13.24.
15383
15384 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
15385 tm to be declared.
15386 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
15387 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
15388
15389 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
15390 * m4/mbrtowc.m4: New file.
15391 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
15392 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
15393
15394 2001-09-27 Akim Demaille <akim@epita.fr>
15395
15396 Bump to 1.29c.
15397
15398 2001-09-27 Akim Demaille <akim@epita.fr>
15399
15400 Version 1.29b.
15401
15402 2001-09-25 Akim Demaille <akim@epita.fr>
15403
15404 * src/system.h: Include `xalloc.h'.
15405 Remove it from the C files.
15406 * src/files.c (output_files): Free the obstacks.
15407 * src/lex.c (init_lex): Rename as...
15408 (lex_init): this.
15409 (lex_free): New.
15410 * src/main.c (main): Use it.
15411
15412 2001-09-24 Marc Autret <autret_m@epita.fr>
15413
15414 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
15415 to output informations in fout (FILE*).
15416 (open_graph, close_graph): Likewise.
15417 (output_graph, output_edge, output_node): Likewise.
15418 * src/vcg.h: Update function prototypes.
15419 * src/print_graph.c (print_graph): Open output graph file.
15420 (print_actions): Adjust.
15421 * src/files.h: Remove extern declaration.
15422 * src/files.c: Remove graph_obstack declaration.
15423 (open_files): Remove graph_obstack initialization.
15424 (output_files): Remove graph_obstack saving.
15425
15426 2001-09-24 Marc Autret <autret_m@epita.fr>
15427
15428 * src/files.c (compute_output_file_names): Fix.
15429
15430 2001-09-24 Marc Autret <autret_m@epita.fr>,
15431 Akim Demaille <akim@epita.fr>
15432
15433 * src/reader.c (reader): Remove call to free_symtab ().
15434 * src/main.c (main): Call it here.
15435 Include symtab.h.
15436 * src/conflicts.c (initialize_conflicts): Rename as...
15437 (solve_conflicts): this.
15438 * src/print.c (print_core, print_actions, print_state)
15439 (print_grammar): Dump to a file instead a `output_obstack'.
15440 (print_results): Dump `output_obstack', and then proceed with the
15441 FILE *.
15442 * src/files.c (compute_output_file_names, close_files): New.
15443 (output_files): Adjust.
15444 * src/main.c (main): Adjust.
15445
15446 2001-09-23 Marc Autret <autret_m@epita.fr>
15447
15448 * src/files.c (compute_header_macro): Computes header macro name
15449 from spec_defines_file when given.
15450
15451 2001-09-23 Marc Autret <autret_m@epita.fr>
15452
15453 * src/files.c (output_files): Add default extensions.
15454
15455 2001-09-22 Akim Demaille <akim@epita.fr>
15456
15457 * src/conflicts.c (finalize_conflicts): Rename as...
15458 (free_conflicts): this.
15459
15460 2001-09-22 Akim Demaille <akim@epita.fr>
15461
15462 * src/gram.c (gram_free): Rename back as...
15463 (dummy): this.
15464 (output_token_translations): Free `token_translations'.
15465 * src/symtab.c (free_symtab): Free the tag field.
15466
15467 2001-09-22 Akim Demaille <akim@epita.fr>
15468
15469 Remove `translations' as it is always set to true.
15470
15471 * src/gram.h: Adjust.
15472 * src/reader.c (packsymbols, parse_token_decl): Adjust
15473 * src/print.c (print_grammar): Adjust.
15474 * src/output.c (output_token_translations): Adjust.
15475 * src/lex.c (lex): Adjust.
15476 * src/gram.c: Be sure the set pointers to NULL.
15477 (dummy): Rename as...
15478 (gram_free): this.
15479
15480 2001-09-22 Akim Demaille <akim@epita.fr>
15481
15482 * configure.in: Invoke AM_LIB_DMALLOC.
15483 * src/system.h: Use dmalloc.
15484 * src/LR0.c: Be sure to have pointers initialized to NULL.
15485 (allocate_itemsets): Allocate kernel_items only if needed.
15486
15487 2001-09-22 Akim Demaille <akim@epita.fr>
15488
15489 * configure.in: Bump to 1.29b.
15490 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
15491 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
15492 need xmalloc.c in calc.y.
15493 From Pascal Bart.
15494
15495 2001-09-21 Akim Demaille <akim@epita.fr>
15496
15497 Version 1.29a.
15498 * Makefile.maint, config/config.guess, config/config.sub,
15499 * config/missing: Update from masters.
15500 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
15501 upon package.m4.
15502 * configure.in (ALL_LINGUAS): Add `tr'.
15503
15504 2001-09-21 Akim Demaille <akim@epita.fr>
15505
15506 * tests/Makefile.am (package.m4): Move to...
15507 ($(srcdir)/$(TESTSUITE)): here.
15508
15509 2001-09-20 Akim Demaille <akim@epita.fr>
15510
15511 * src/complain.c: No longer try to be standalone: use system.h.
15512 Don't assume __STDC__ is defined to 1. Just test if it is defined.
15513 * src/complain.h: Likewise.
15514 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
15515 Remove the unused variable `n'.
15516 From Albert Chin-A-Young.
15517
15518 2001-09-18 Marc Autret <autret_m@epita.fr>
15519
15520 * doc/bison.1: Update.
15521 * doc/bison.texinfo (Bison Options): Update --defines and --graph
15522 descriptions.
15523 (Option Cross Key): Update.
15524 Add --graph.
15525
15526 2001-09-18 Marc Autret <autret_m@epita.fr>
15527
15528 * tests/regression.at: New test (comment in %union).
15529
15530 2001-09-18 Marc Autret <autret_m@epita.fr>
15531
15532 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
15533 do that.
15534 Reported by Keith Browne.
15535
15536 2001-09-18 Marc Autret <autret_m@epita.fr>
15537
15538 * tests/output.at: Add tests for --defines and --graph.
15539
15540 2001-09-18 Marc Autret <autret_m@epita.fr>
15541
15542 * tests/output.at: Removes tests of %{header,src}_extension features.
15543
15544 2001-09-18 Akim Demaille <akim@epita.fr>
15545
15546 * tests/Makefile.am (package.m4): New.
15547 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
15548 (_AT_CHECK_CALC_ERROR): Likewise.
15549 Factor the `, ' part of verbose error messages.
15550
15551 2001-09-18 Marc Autret <autret_m@epita.fr>
15552
15553 * src/getargs.c (longopts): Declare --defines and --graph as options
15554 with optional arguments.
15555 * src/files.h: Add extern declarations.
15556 * src/files.c (spec_graph_file, spec_defines_file): New.
15557 (output_files): Update.
15558 Remove CPP-outed code.
15559
15560 2001-09-18 Marc Autret <autret_m@epita.fr>
15561
15562 Turn off %{source,header}_extension feature.
15563
15564 * src/files.c (compute_exts_from_gf): Update.
15565 (compute_exts_from_src): Update.
15566 (output_files): CPP-out useless code.
15567 * src/files.h: Remove {header,source}_extension extern declarations.
15568 * src/reader.c (parse_dquoted_param): CPP-out.
15569 (parse_header_extension_decl): Remove.
15570 (parse_source_extension_decl): Remove.
15571 (read_declarations): Remove cases tok_{hdrext,srcext}.
15572 * src/lex.c (percent_table): Remove {header,source}_extension entries.
15573 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
15574
15575 2001-09-10 Akim Demaille <akim@epita.fr>
15576
15577 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
15578 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
15579 (AT_CHECK_OUTPUT): this.
15580 Merely check ls' exit status, its output is useless.
15581
15582 2001-09-10 Akim Demaille <akim@epita.fr>
15583
15584 * tests/calc.at: Use m4_match.
15585 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
15586
15587 2001-09-10 Marc Autret <autret_m@epita.fr>,
15588 Akim Demaille <akim@epita.fr>
15589
15590 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
15591 enum color_e.
15592 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
15593 to `normal'.
15594 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
15595 * src/lex.h: Adjust prototype.
15596 (token_t): Add `tok_undef'.
15597 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
15598 (parse_percent_token): Now returns token_t.
15599 Add default statement in switch.
15600 (lex): Separate `c' as an input variable, from the token_t result
15601 part.
15602 (unlexed): Is a token_t.
15603
15604 2001-09-10 Akim Demaille <akim@epita.fr>
15605
15606 * configure.in: Bump to 1.29a.
15607
15608 2001-09-07 Akim Demaille <akim@epita.fr>
15609
15610 Version 1.29.
15611
15612 2001-08-30 Akim Demaille <akim@epita.fr>
15613
15614 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
15615 * m4/atconfig.m4: Remove.
15616 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
15617 * tests/bison: New.
15618 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
15619 m4_if, m4_patsubst, and m4_regexp.
15620 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
15621 `input' file instead of echo.
15622
15623 2001-08-29 Akim Demaille <akim@epita.fr>
15624
15625 Bump to 1.28e.
15626
15627 2001-08-29 Akim Demaille <akim@epita.fr>
15628
15629 Version 1.28d.
15630
15631 2001-08-29 Paul Eggert <eggert@twinsun.com>
15632
15633 * src/bison.simple (yyparse): Don't take the address of an
15634 item before the start of an array, as that doesn't conform to
15635 the C Standard.
15636
15637 2001-08-29 Robert Anisko <anisko_r@epita.fr>
15638
15639 * doc/bison.texinfo (Location Tracking Calc): New node.
15640
15641 2001-08-29 Paul Eggert <eggert@twinsun.com>
15642
15643 * src/output.c (output): Do not define const, as this now
15644 causes more problems than it cures.
15645
15646 2001-08-29 Akim Demaille <akim@epita.fr>
15647
15648 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
15649 the nodes.
15650 Be sure to tag the `detailmenu'.
15651
15652 2001-08-29 Akim Demaille <akim@epita.fr>
15653
15654 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
15655 download in a tmp dir.
15656
15657 2001-08-28 Marc Autret <autret_m@epita.fr>
15658
15659 * config/depcomp: New file.
15660
15661 2001-08-28 Marc Autret <autret_m@epita.fr>
15662
15663 * doc/bison.1 (mandoc): Adjust.
15664 From Juan Manuel Guerrero.
15665
15666 2001-08-28 Marc Autret <autret_m@epita.fr>
15667
15668 * src/print_graph.c (print_state): Fix.
15669
15670 2001-08-27 Marc Autret <autret_m@epita.fr>
15671
15672 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
15673 char * members.
15674 Echo modifications to the functions prototypes.
15675 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
15676
15677 2001-08-27 Marc Autret <autret_m@epita.fr>
15678
15679 * src/vcg.c: Include `xalloc.h'.
15680 (add_colorentry): New.
15681 (add_classname): New.
15682 (add_infoname): New.
15683 * src/vcg.h: Add new prototypes.
15684
15685 2001-08-27 Akim Demaille <akim@epita.fr>
15686
15687 * Makefile.maint: Sync. again with CVS Autoconf.
15688
15689 2001-08-27 Akim Demaille <akim@epita.fr>
15690
15691 * Makefile.maint: Formatting changes.
15692 (po-update, cvs-update, update): New targets.
15693 (AMTAR): Remove.
15694
15695 2001-08-27 Akim Demaille <akim@epita.fr>
15696
15697 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15698 * Makefile.maint: Sync. with CVS Autoconf.
15699
15700 2001-08-27 Marc Autret <autret_m@epita.fr>
15701
15702 * src/vcg.h (struct infoname_s): New.
15703 (struct colorentry_s): New.
15704 (graph_s): New fields {vertical,horizontal}_order in structure.
15705 Add `infoname' field.
15706 Add `colorentry' field;
15707 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
15708 (G_HORIZONTAL_ORDER): New.
15709 (G_INFONAME): New.
15710 (G_COLORENTRY): New.
15711 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
15712 Add output of `infoname'.
15713 Add output of `colorentry'.
15714
15715 2001-08-27 Marc Autret <autret_m@epita.fr>
15716
15717 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
15718 This one shadowed a global parameter.
15719
15720 2001-08-24 Marc Autret <autret_m@epita.fr>
15721
15722 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
15723 instead of `unsigned'.
15724 (print_state): Do not call obstack_object_size () in obstack_grow ()
15725 to avoid macro variables shadowing.
15726
15727 2001-08-23 Marc Autret <autret_m@epita.fr>
15728
15729 * src/lex.c (percent_table): Typo: s/naem/name/.
15730 Add graph option.
15731 Normalize new options declarations.
15732
15733 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
15734
15735 * tests/suite.at: Exercise %header_extension and %source_extension.
15736
15737 2001-08-16 Marc Autret <autret_m@epita.fr>
15738
15739 * src/reader.c (parse_dquoted_param): New.
15740 (parse_header_extension_decl): Use it.
15741 (parse_source_extension_decl): Likewise.
15742
15743 2001-08-16 Marc Autret <autret_m@epita.fr>
15744
15745 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
15746 (get_xxxx_str): Use assert () instead of complain ().
15747 Remove return invokations in default cases.
15748 (get_decision_str): Modify default behaviour. Remove second argument.
15749 Echo modifications on calls.
15750 (output_graph): Fix.
15751
15752 2001-08-16 Marc Autret <autret_m@epita.fr>
15753
15754 * src/getargs.c (usage): Update with ``-g, --graph''.
15755
15756 2001-08-16 Marc Autret <autret_m@epita.fr>
15757
15758 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
15759 (Option Cross Key): Likewise.
15760 * doc/bison.1: Update.
15761
1c8c2190
PB
157622001-09-25 Pascal Bart <pascal.bart@epita.fr>
15763
15764 * src/output.c (output_master_parser): Don't finish action_obstack.
15765 (output_parser): Don't care about the muscle action, here.
15766 (prepare): Copy the action_obstack in the action muscle.
15767 (output): Free action_obstack.
15768
180d45ba
PB
157692001-09-23 Pascal Bart <pascal.bart@epita.fr>
15770
15771 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
15772 will contain `%union' declaration.
15773 (parse_union_decl): Delete #line directive output.
15774 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
15775 informations about %union.
15776 (parse_union_decl): Copy the union_obstack in the muscle stype.
15777 * src/bison.simple: Add new #line directive.
15778 Add typdef %%stype YYSTYPE.
15779
c51d1a19
PB
157802001-09-23 Pascal Bart <pascal.bart@epita.fr>
15781
15782 * src/bison.simple: Add new `#line' directive.
15783
6f9344da
PB
157842001-09-22 Pascal Bart <pascal.bart@epita.fr>
15785
15786 * src/bison.simple: New `#line' directive.
15787 * src/output.c (output_parser): Support new dynamic muscle input_line.
15788
652def80
MA
157892001-09-22 Marc Autret <autret_m@epita.fr>
15790
15791 * src/output.c (output_master_parser): New.
15792 (output_parser): Be more re-entrant.
15793
25b222fa
MA
157942001-09-21 Marc Autret <autret_m@epita.fr>
15795
15796 * src/reader.c (copy_definition, parse_union_decl): Update and use
15797 `linef' muscle.
15798 (copy_action): Likewise.
15799 Use obstack_1grow ().
15800 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
15801
6bc35ae5
MA
158022001-09-21 Marc Autret <autret_m@epita.fr>
15803
15804 * src/options.c (option_table): Adjust.
15805 * src/lex.c (parse_percent_token): Fix.
15806
c0629aa1
PB
158072001-09-20 Pascal Bart <pascal.bart@epita.fr>
15808
15809 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 15810
82b6d266
PB
158112001-09-20 Pascal Bart <pascal.bart@epita.fr>
15812
15813 * src/lex.c (parse_percent_token): Change type of variable `tx', which
15814 is now an option_table_struct*.
15815 (option_strcmp): New function option_strcmp.
15816 (parse_percent_token): Call option_strcmp.
15817 * src/getargs.c (xalloc.h, options.h): Include it.
15818 (getargs): Call create_long_option_table.
15819 (getargs): Free longopts at the end of the function.
15820 (shortopts): Move in options.c.
15821 * src/options.c (create_long_option_table): New function. Convert
15822 information from option_table to option structure.
15823 * src/reader.c (options.h): Include it.
15824
15825 * src/Makefile.am: Adjust.
15826 * src/options.c (option_table): Create from longopts and percent_table.
15827 * src/getargs.c (longopts): Delete.
15828 * src/lex.c (struct percent_table_struct): Delete.
15829 (percent_table): Delete.
15830 (options.h): Include it.
15831 * src/options.c: Create.
15832 * src/options.h: Create.
15833 Declare enum opt_access_e.
15834 Define struct option_table_struct.
15835
75f5aaea
MA
158362001-09-20 Marc Autret <autret_m@epita.fr>
15837
15838 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
15839 sections of Bison.
15840
f508cb0a
PB
158412001-09-19 Pascal Bart <pascal.bart@epita.fr>
15842
15843 * src/bison.simple: s/%%filename/%%skeleton.
15844 * src/muscle_tab.c (getargs.h): Include it.
15845 (muscle_init): Insert new muscle skeleton.
15846
13105fc1
PB
158472001-09-18 Pascal Bart <pascal.bart@epita.fr>
15848
15849 * src/output.c (output_parser): Delete unused variable actions_dumped.
15850
b0c4483e
PB
158512001-09-07 Pascal Bart <pascal.bart@epita.fr>
15852
15853 * src/output.c (output): Delete call to reader_output_yylsp.
15854 * src/reader.c (reader): Likewise.
ba0fe3c7 15855 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 15856
11d82f03
MA
158572001-09-02 Marc Autret <autret_m@epita.fr>
15858
15859 * src/reader.c: Include muscle_tab.h.
15860 (parse_union_decl): Update.
15861 (parse_macro_decl): Rename parse_muscle_decl.
15862 Update to use renamed functions and variable.
15863 (read_declarations, copy_action, read_additionnal_code, : Updated
15864 with correct variables and functions names.
15865 (packsymbols, reader): Likewise.
342b8b6e 15866
11d82f03 15867 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 15868
11d82f03
MA
15869 * src/output.c: Include muscle_tab.h
15870 In all functions using macro_insert, change by using muscle_insert ().
15871 (macro_obstack): Rename muscle_obstack.
15872 Echo modifications in the whole file.
15873 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
15874 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
15875 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
15876
15877 * src/muscle_tab.h: Update double inclusion macros.
15878 (macro_entry_s): Rename muscle_entry_s.
15879 Update prototypes.
342b8b6e 15880
11d82f03
MA
15881 * src/muscle_tab.c: Include muscle_tab.h.
15882 Rename macro_tabble to muscle_table.
15883 (mhash1, mhash2, mcmp): Use muscle_entry.
15884 (macro_init): Rename muscle_init. Update.
15885 (macro_insert): Rename muscle_insert. Update.
15886 (macro_find): Rename muscle_find. Update.
15887
15888 * src/main.c: Include muscle_tab.h.
15889 (main): Call muscle_init ().
15890 * src/Makefile.am (bison_SOURCES): Echo modifications.
15891
93a37297
MA
158922001-09-02 Marc Autret <autret_m@epita.fr>
15893
f753cd62 15894 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 15895
f753cd62
MA
15896 * src/muscle_tab.c, src/muscle_tab.h: Add files.
15897
158982001-09-02 Marc Autret <autret_m@epita.fr>
15899
15900 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 15901
682d48cd
PB
159022001-09-01 Pascal Bart <pascal.bart@epita.fr>
15903
342b8b6e 15904 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
15905 filename.
15906
087c8fda
MA
159072001-09-01 Marc Autret <autret_m@epita.fr>
15908
15909 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
15910 to an explicit value to activate the feature. We do it here.
15911
dda680cb
PB
159122001-08-31 Pascal Bart <pascal.bart@epita.fr>
15913
15914 * src/output.c (prepare): Delete the `filename' muscule insertion.
15915 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
15916 (parse_union_decl): Likewise.
15917 * src/macrotab.c (macro_init): Initialize filename by infile.
15918
9e644e64
MA
159192001-08-31 Marc Autret <autret_m@epita.fr>
15920
15921 * src/bison.simple (YYLSP_NEEDED): New definition.
15922 * src/output.c (prepare): Add macro insertion of `locations_flag'
15923
17da6427
PB
159242001-08-31 Pascal Bart <pascal.bart@epita.fr>
15925
15926 * src/output.c (prepare): Delete insertion of previous muscles,
15927 and insert the `prefix' muscles.
15928 * src/macrotab.c (macro_init): Likewise.
15929 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 15930 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
15931 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
15932 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 15933 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
15934 name_prefix.
15935
e8cb70b9
PB
159362001-08-31 Pascal Bart <pascal.bart@epita.fr>
15937
15938 * src/main.c (main): Standardize.
15939 * src/output.c (output_table_data, output_parser): Likewise.
15940 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
15941
63c2d5de
MA
159422001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
15943
342b8b6e 15944 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
15945 %%epilogue.
15946 * src/output.c (output): Rename %%declarations to %%prologue.
15947 * src/bison.simple: Echo modifications.
342b8b6e 15948
d8cb5183
MA
159492001-08-31 Marc Autret <autret_m@epita.fr>
15950
15951 * src/reader.c (readgram): CleanUp.
15952 (output_token_defines): Likewise.
15953 (packsymbols): Likewise.
15954 (reader): Likewise.
15955 * src/output.c (output): CPP-out useless code.
15956
6c686258
PB
159572001-08-31 Pascal Bart <pascal.bart@epita.fr>
15958
342b8b6e 15959 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
15960 output_trailers and output_headers.
15961 * src/output.h: Remove obsolete functions prototypes of output_headers
15962 and output_trailers.
15963
8f451ef7
PB
159642001-08-30 Pascal Bart <pascal.bart@epita.fr>
15965
15966 * src/main.c: Include macrotab.h.
342b8b6e 15967 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
15968 Adjust functions prototypes.
15969 * src/macrotab.c (macro_insert): Constify key and value.
15970 (macro_find): Constify key.
15971 (macro_insert): Include 'xalloc.h'
15972 (macro_insert): Use XMALLOC.
15973 (macro_find): Constify return value.
15974 * src/output.c (output_table_data): Rename table to table_data.
15975 (output_parser): Constify macro_key, macro_value.
15976
997b6fd0 159772001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
15978
15979 * src/reader.c (parse_skel_decl): New.
342b8b6e 15980 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
15981 * src/lex.h (token_t): New token `tok_skel'.
15982 * src/lex.c (percent_table): Add skeleton option entry.
15983 Standardize.
15984
ff48177d
MA
159852001-08-29 Marc Autret <autret_m@epita.fr>
15986
15987 * src/bison.simple: Add %%user_code directive at the end.
15988 * src/reader.c (read_additionnal_code): New.
15989 (reader): Use it.
15990 * src/output.c (output_program): Remove.
15991 (output): Update.
15992
b33160bf
MA
159932001-08-28 Marc Autret <autret_m@epita.fr>
15994
15995 * src/output.c (output_actions): Clean up.
4e5caae2 15996 (output_gram): CPP-out useless code.
b33160bf
MA
15997 * src/reader.c (reader): Clean up, CPP-out useless code.
15998
d1a2daf7
PB
159992001-08-28 Pascal Bart <pascal.bart@epita.fr>
16000
342b8b6e 16001 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 16002 directive.
d1a2daf7
PB
16003 * src/bison.simple: Add `%%definitions'.
16004
2b763dfe
MA
160052001-08-28 Marc Autret <autret_m@epita.fr>
16006
16007 * config/depcomp: New file.
16008
f1a87ef6
PE
160092001-08-27 Paul Eggert <eggert@twinsun.com>
16010
16011 * src/bison.simple (yyparse): Don't take the address of an
16012 item before the start of an array, as that doesn't conform to
16013 the C Standard.
16014
82e236e2
RA
160152001-08-27 Robert Anisko <robert.anisko@epita.fr>
16016
f1a87ef6 16017 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
16018 obstack. It was done too late here.
16019
16020 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
16021 completely wrong.
16022 (reader): Initialize the macro obstack here, since we need it to grow
16023 '%define' directives.
16024
16025 * src/reader.h: Declare the macro obstack as extern.
16026
b0cfa28a
RA
160272001-08-27 Robert Anisko <robert.anisko@epita.fr>
16028
16029 * src/output.c (output_parser): Fix. Store single '%' characters in
16030 the output obstack instead of throwing them away.
16031
6fc74234
AD
160322001-08-27 Akim Demaille <akim@epita.fr>
16033
16034 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
16035
9c76d118
RA
160362001-08-25 Robert Anisko <robert.anisko@epita.fr>
16037
16038 * lib/Makefile.am: Adjust.
16039
a8289c62
RA
160402001-08-25 Robert Anisko <robert.anisko@epita.fr>
16041
16042 * src/bison.simple: Update and add '%%' directives.
16043
b6610515
RA
160442001-08-25 Robert Anisko <robert.anisko@epita.fr>
16045
16046 * src/reader.c (reader): Remove calls to 'output_headers' and
16047 'output_trailers'. Remove some C output.
16048 (readgram): Disable a piece of code that was writing a default
16049 definition for 'YYSTYPE'.
16050 (reader_output_yylsp): Remove.
16051 (packsymbols): Output token defintions to a macro.
16052 (copy_definition): Disable C output.
6fc74234 16053
b6610515
RA
16054 * src/reader.c (parse_macro_decl): New function used to parse macro
16055 declarations.
16056 (copy_string2): Put the body of copy_string into this new function.
16057 Add a parameter to let the caller choose whether he wants to copy the
16058 string delimiters or not.
16059 (copy_string): Be a simple call to copy_string2 with the last argument
16060 bound to true.
16061 (read_declarations): Add case for macro definition.
16062 (copy_identifier): New.
6fc74234 16063 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
16064 rather than lex.
16065
26f609ff
RA
160662001-08-25 Robert Anisko <robert.anisko@epita.fr>
16067
16068 * src/output.c (prepare): Add prefixed names.
16069 (output_parser): Output semantic actions.
16070 (output_parser): Fix bug on '%%line' directives.
6fc74234 16071
26f609ff
RA
16072 * src/output.c (output_headers): Remove. The C code printed by this
16073 function should now be in the skeletons.
16074 (output_trailers): Remove.
16075 (output): Disable call to 'reader_output_yylsp'.
16076 (output_rule_data): Do not output tables to the table obstack.
16077
16078 * src/output.c: Remove some C dedicated output.
16079 Improve the use of macro and output obstacks.
16080 (output_defines): Remove.
6fc74234 16081
26f609ff
RA
16082 * src/output.c (output_token_translations): Associate 'translate'
16083 table with a macro. No output to the table obstack.
16084 (output_gram): Same for 'rhs' and 'prhs'.
16085 (output_stos): Same for 'stos'.
16086 (output_rule_data): Same for 'r1' and 'r2'.
16087 (token_actions): Same for 'defact'.
16088 (goto_actions): Same for 'defgoto'.
16089 (output_base): Same for 'pact' and 'pgoto'.
16090 (output_table): Same for 'table'.
16091 (output_check): Same for 'check'.
6fc74234 16092
26f609ff
RA
16093 * src/output.c (output_table_data): New function.
16094 (output_short_table): Remove.
16095 (output_short_or_char_table): Remove.
6fc74234 16096
26f609ff
RA
16097 * src/output.c (output_parser): Replace most of the skeleton copy code
16098 with something new. Skeletons are now processed character by character
16099 rather than line by line, and Bison looks for '%%' macros. This is the
16100 first step in making Bison's output process (a lot) more flexible.
16101 (output_parser): Use the macro table.
16102
6f43b113
RA
161032001-08-25 Robert Anisko <robert.anisko@epita.fr>
16104
16105 * src/main.c (main): Initialize the macro table.
16106
dd3127cf
RA
161072001-08-25 Robert Anisko <robert.anisko@epita.fr>
16108
16109 * src/lex.c (percent_table): Add tok_define.
16110 * src/lex.h: Add tok_define.
16111
aa321494
RA
161122001-08-25 Robert Anisko <robert.anisko@epita.fr>
16113
16114 * src/macrotab.c: New file.
16115 * src/macrotab.h: New file.
16116 * src/Makefile.am: Update.
16117
68bd3b6b
RA
161182001-08-25 Robert Anisko <robert.anisko@epita.fr>
16119
16120 * lib/hash.c: New file.
16121 * lib/hash.h: New file.
16122 * lib/Makefile.am: Update.
16123
45f8dd1e
AD
161242001-08-15 Akim Demaille <akim@epita.fr>
16125
16126 Version 1.28c.
16127
40a64a7a 161282001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
16129
16130 * src/reader.c (readgram): Indent output macro YYSTYPE.
16131 (packsymbols): Likewise.
16132 (output_token_defines): Likewise.
16133 * src/files.c: Standardize.
16134 (compute_header_macro): New.
16135 (defines_obstack_save): New. Use compute_header_macro.
16136 (output_files): Update. Use defines_obstack_save.
16137
f9a8293a
AD
161382001-08-15 Akim Demaille <akim@epita.fr>
16139
16140 * doc/bison.texinfo (Table of Symbols): Document
16141 YYSTACK_USE_ALLOCA.
16142
150ca7a7
AD
161432001-08-15 Akim Demaille <akim@epita.fr>
16144
16145 * missing: Update from CVS Automake.
16146 * config/config.guess, config/config.sub, config/texinfo.tex:
16147 Update from gnu.org.
16148
69b5cec4
AD
161492001-08-15 Akim Demaille <akim@epita.fr>
16150
16151 * Makefile.maint: Sync with CVS Autoconf.
16152
f2b5126e
PB
161532001-08-14 Pascal Bart <pascal.bart@epita.fr>
16154
69b5cec4 16155 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
16156 `fdl.texi'.
16157 * doc/fdl.texi: Add to package.
16158
4ecbf796
MA
161592001-08-14 Marc Autret <autret_m@epita.fr>
16160
16161 Turn on %{source,header}_extension features.
16162
69b5cec4 16163 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
16164 source_extension.
16165 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 16166 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
16167 between options.
16168
95fb5662
MA
161692001-08-14 Marc Autret <autret_m@epita.fr>
16170
16171 * src/files.c (compute_base_names): Add extensions computing when
16172 `--file-prefix' used.
16173 Standardize function calls.
16174
78d09da9
MA
161752001-08-13 Marc Autret <autret_m@epita.fr>
16176
69b5cec4 16177 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
16178 defining it (defined but null disables alloca).
16179
5a009f2c
MA
161802001-08-13 Marc Autret <autret_m@epita.fr>
16181
16182 * src/bison.simple (_yy_memcpy): CPP reformat.
16183
1e41465a
PB
161842001-08-13 Pascal Bart <pascal.bart@epita.fr>
16185
16186 * tests/atconfig.in (CPPFLAGS): Fix.
16187
c67a198d
PB
161882001-08-10 Pascal Bart <pascal.bart@epita.fr>
16189
79282c6c 16190 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
16191 `gpl.texi'.
16192 * doc/gpl.texi: Add to package.
16193
09a6de7e
MA
161942001-08-10 Marc Autret <autret_m@epita.fr>
16195
16196 * src/print_graph.h: Fix.
16197 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
16198
b77b9ee0
AD
161992001-08-10 Akim Demaille <akim@epita.fr>
16200
16201 * src/system.h: Provide default declarations for stpcpy, strndup,
16202 and strnlen.
16203
3e259915
MA
162042001-08-10 Robert Anisko <anisko_r@epita.fr>
16205
16206 * doc/bison.texinfo (Locations): Update @$ stuff.
16207
ca96bc2d
MA
162082001-08-09 Robert Anisko <anisko_r@epita.fr>
16209
16210 * src/bison.simple (YYLLOC_DEFAULT): Update.
16211 (yyparse): Adjust.
16212
fdc6758b
MA
162132001-08-08 Marc Autret <autret_m@epita.fr>
16214
b77b9ee0 16215 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
16216 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
16217 Reported by Fabrice Bauzac.
957d4dbf 16218
600cad3b
MA
162192001-08-08 Marc Autret <autret_m@epita.fr>
16220
16221 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
16222 * src/vcg.c (output_node): Fix.
16223 * src/vcg.h: Cleanup.
16224 * src/print_graph.c: Add comments.
b77b9ee0 16225 (node_output_size): New global variable. Simplify the formatting of
600cad3b 16226 the VCG graph output.
b77b9ee0 16227 (print_actions): Unused code is now used. It notifies the final state
600cad3b 16228 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 16229 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
16230 blue.
16231 Get the current node name and node_obstack by argument.
16232 (node_obstack): New variable.
16233 (print_state): Manage node_obstack.
16234 (print_core): Use node_obstack given by argument.
16235 A node is not only computed here but in print_actions also.
16236 (print_graph): CPP out useless code instead of commenting it.
16237
976e528f
AD
162382001-08-07 Pascal Bart <pascal.bart@epita.fr>
16239
16240 * tests/atconfig.in (CPPFLAGS): Fix.
16241
20e8e5ca
AD
162422001-08-07 Akim Demaille <akim@epita.fr>
16243
16244 * src/print_graph.c (quote): New.
16245 (print_core): Use it.
16246
957d4dbf 162472001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 16248
3e3da797
AD
16249 * src/vcg.c (complain.h): Include it.
16250 Unepitaize `return' invocations.
c4b66126 16251 [NDEBUG] (main): Remove.
79282c6c 16252 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
16253 * src/files.c (open_files): Initialize graph_obstack.
16254 * src/print_graph.c (print_actions): CPP out useless code.
16255 (print_core): Don't output the last `\n' in labels.
16256 Use `quote'.
16257 * src/files.c (output_files): Output the VCG file.
16258 * src/main.c (main): Invoke print_graph ();
3e3da797 16259
957d4dbf 162602001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
16261
16262 Automaton VCG graph output.
16263 Using option ``-g'' or long option ``--graph'', you can generate
16264 a gram_filename.vcg file containing a VCG description of the LALR (1)
16265 automaton of your grammar.
16266
16267 * src/main.c: Call to print_graph() function.
16268 * src/getargs.h: Update.
16269 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
16270 (graph_flag): New flag.
16271 (longopts): Update.
16272 (getargs): Add case `g'.
16273 * src/files.c (graph_obstack): New obstack struct.
16274 (open_files): Initialize new obstack.
16275 (output_files): Saves graph_obstack if required.
16276 * src/files.h (graph_obstack): New extern declaration.
16277 * src/Makefile.am: Add new source files.
16278
927c1557 162792001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
16280
16281 * src/print_graph.c, src/print_graph.h (graph): New.
16282 * src/vcg.h: New file.
16283 * src/vcg.c: New file, VCG graph handling.
16284
7333d403
AD
162852001-08-06 Marc Autret <autret_m@epita.fr>
16286
16287 Add of %source_extension and %header_extension which specify
16288 the source or/and the header output file extension.
16289
16290 * src/files.c (compute_base_names): Remove initialisation of
16291 src_extension and header_extension.
16292 (compute_exts_from_gf): Update.
16293 (compute_exts_from_src): Update.
16294 (output_files): Update.
16295 * src/reader.c (parse_header_extension_decl): New.
16296 (parse_source_extension_decl): New.
16297 (read_declarations): New case statements for the new tokens.
16298 * src/lex.c (percent_table): Add entries for %source_extension
16299 and %header_extension.
16300 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
16301
84163231
AD
163022001-08-06 Marc Autret <autret_m@epita.fr>
16303
16304 * configure.in: Bump to 1.28c.
16305 * doc/bison.texinfo: Texinfo thingies.
16306
8303fc42
AD
163072001-08-04 Pascal Bart <pascal.bart@epita.fr>
16308
16309 * tests/atconfig.in (CPPFLAGS): Add.
16310 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
16311
70a84437
AD
163122001-08-03 Akim Demaille <akim@epita.fr>
16313
16314 Version 1.28b.
16315
2ce10144
AD
163162001-08-03 Akim Demaille <akim@epita.fr>
16317
16318 * tests/Makefile.am (check-local): Ship testsuite.
16319 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
16320 Include `string.h'.
16321
1e3e4bc1
AD
163222001-08-03 Akim Demaille <akim@epita.fr>
16323
16324 * configure.in: Try using -Wformat when compiling.
16325
42b45b7f
AD
163262001-08-03 Akim Demaille <akim@epita.fr>
16327
16328 * configure.in: Bump to 1.28b.
16329
8f13fe33
AD
163302001-08-03 Akim Demaille <akim@epita.fr>
16331
16332 * src/complain.c: Adjust strerror_r portability issues.
16333
b37ba92c
AD
163342001-08-03 Akim Demaille <akim@epita.fr>
16335
16336 Version 1.28a.
16337
b0ce6046
AD
163382001-08-03 Akim Demaille <akim@epita.fr>
16339
16340 * src/getargs.c, src/getarg.h (skeleton)): Constify.
16341 * src/lex.c (literalchar): Avoid name clashes on `buf'.
16342 * src/getargs.c: Include complain.h.
16343 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
16344 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
16345
d01c415b
AD
163462001-08-03 Akim Demaille <akim@epita.fr>
16347
16348 * src/reader.c (readgram): Display hidden chars in error messages.
16349
459dd1a6
AD
163502001-08-03 Akim Demaille <akim@epita.fr>
16351
16352 Update to gettext 0.10.39.
16353
53b74c0c
AD
163542001-08-03 Akim Demaille <akim@epita.fr>
16355
16356 * lib/strspn.c: New.
16357
234a3be3
AD
163582001-08-01 Marc Autret <autret_m@epita.fr>
16359
16360 * doc/bison.texinfo: Update.
16361 * doc/bison.1 (mandoc): Update.
16362 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
16363 * src/files.c: Support output files extensions computing.
16364 (src_extension): New static variable.
16365 (header_extension): New static variable.
16366 (tr): New function.
16367 (get_extension_index): New function, gets the index of an extension
16368 filename in a string.
16369 (compute_exts_from_gf): New function, computes extensions from the
16370 grammar file extension.
16371 (compute_exts_from_src): New functions, computes extensions from the
16372 C source file extension, file given by ``-o'' option.
16373 (compute_base_names): Update.
16374 (output_files): Update.
16375
847bf1f5
AD
163762001-08-01 Robert Anisko <anisko_r@epita.fr>
16377
d995fee7 16378 * doc/bison.texi: Document @$.
847bf1f5
AD
16379 (Locations): New section.
16380
d074a105
AD
163812001-07-18 Akim Demaille <akim@epita.fr>
16382
16383 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
16384 * config/prev-version.txt, config/move-if-change: New.
16385 * Makefile.am: Adjust.
16386
3419715d
AD
163872001-07-08 Pascal Bart <pascal.bart@epita.fr>
16388
16389 * src/bison.simple (yyparse): Suppress warning `comparaison
16390 between signed and unsigned'.
16391
62ab6972
AD
163922001-07-05 Pascal Bart <pascal.bart@epita.fr>
16393
16394 * src/getargs.h (raw_flag): Remove.
16395 * src/getargs.c: Die on `-r'/`--raw'.
16396 * src/lex.c (parse_percent_token): Die on `%raw'.
16397 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
16398 * tests/calc.at: Suppress test with option `--raw'.
16399
1e24cc5b
AD
164002001-07-14 Akim Demaille <akim@epita.fr>
16401
16402 * config/: New.
16403 * configure.in: Require Autoconf 2.50.
16404 Update to gettext 0.10.38.
16405
32dfccf8
AD
164062001-03-16 Akim Demaille <akim@epita.fr>
16407
16408 * doc/bison.texinfo: ANSIfy the examples.
16409
cd5bd6ac
AD
164102001-03-16 Akim Demaille <akim@epita.fr>
16411
16412 * getargs.c (skeleton): New variable.
16413 (longopts): --skeleton is a new option.
16414 (shortopts, getargs): -S is a new option.
16415 * getargs.h: Declare skeleton.
16416 * output.c (output_parser): Use it.
16417
5141b016
AD
164182001-03-16 Akim Demaille <akim@epita.fr>
16419
16420 * m4/strerror_r.m4: New.
16421 * m4/error.m4: Run AC_FUNC_STRERROR_R.
16422 * lib/error.h, lib/error.c: Update.
16423
447992b9
AD
164242001-03-16 Akim Demaille <akim@epita.fr>
16425
16426 * src/getargs.c (longopts): Clean up.
16427
274d42ce
AD
164282001-02-21 Akim Demaille <akim@epita.fr>
16429
16430 * src/reader.c (gensym): `gensym_count' is your own.
16431 Use a static buf to create the symbol name, as token_buffer is no
16432 longer a buffer.
16433
22c821f3
AD
164342001-02-08 Akim Demaille <akim@epita.fr>
16435
16436 * src/conflicts.c (conflict_report): Be sure not to append to res
16437 between two calls, which could happen if both first sprintf were
16438 skipped, but not the first cp += strlen.
16439
18569462
AD
164402001-02-08 Akim Demaille <akim@epita.fr>
16441
16442 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
16443 New, from fileutils 4.0.37.
16444 * configure.in: Require Autoconf 2.49c. I took some time before
16445 making this decision. This is the only way out for portability
16446 issues in Bison, it would mean way too much duplicate effort to
16447 import in Bison features implemented in 2.49c since 2.13.
16448 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
16449
0d8f3c8a
AD
164502001-02-02 Akim Demaille <akim@epita.fr>
16451
16452 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 16453 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 16454
f17bcd1f
AD
164552001-01-19 Akim Demaille <akim@epita.fr>
16456
16457 Get rid of the ad hoc handling of token_buffer in the scanner: use
16458 the obstacks.
16459
16460 * src/lex.c (token_obstack): New.
16461 (init_lex): Initialize it. No longer call...
16462 (grow_token_buffer): this. Remove it.
16463 Adjust all the places which used it to use the obstack.
16464
511e79b3
AD
164652001-01-19 Akim Demaille <akim@epita.fr>
16466
16467 * src/lex.h: Rename all the tokens:
16468 s/\bENDFILE\b/tok_eof/g;
16469 s/\bIDENTIFIER\b/tok_identifier/g;
16470 etc.
16471 Let them be enums, not #define, to ease debugging.
16472 Adjust all the code.
16473
0d6508ef
AD
164742001-01-18 Akim Demaille <akim@epita.fr>
16475
16476 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
16477 * src/lex.c (maxtoken, grow_token_buffer): Static.
16478
6deb4447
AD
164792001-01-18 Akim Demaille <akim@epita.fr>
16480
16481 Since we now use obstacks, more % directives can be enabled.
16482
16483 * src/lex.c (percent_table): Also accept `%yacc',
16484 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
16485 `%debug'.
16486 Handle the actions for `%semantic_parser' and `%pure_parser' here,
16487 instead of returning a token.
16488 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
16489 * src/reader.c (read_declarations): Adjust.
16490 * src/files.c (open_files): Don't call `compute_base_names', don't
16491 compute `attrsfile' since they depend upon data which might be
16492 *in* the input file now.
16493 (output_files): Do it here.
16494 * src/output.c (output_headers): Document the fact that this patch
16495 introduces a guaranteed SEGV for semantic parsers.
16496 * doc/bison.texinfo: Document them.
16497 * tests/suite.at: Exercise these %options.
16498
ff4423cc
AD
164992000-12-20 Akim Demaille <akim@epita.fr>
16500
16501 Also handle the output file (--verbose) with obstacks.
16502
16503 * files.c (foutput): Remove.
16504 (output_obstack): New.
16505 Adjust all dependencies.
16506 * src/conflicts.c: Return a string.
16507 * src/system.h (obstack_grow_string): Rename as...
16508 (obstack_sgrow): this. Be ready to work with non literals.
16509 (obstack_fgrow4): New.
16510
956dba3a
AD
165112000-12-20 Akim Demaille <akim@epita.fr>
16512
16513 * src/files.c (open_files): Fix the computation of short_base_name
16514 in the case of `-o foo.tab.c'.
16515
337bab46
AD
165162000-12-20 Akim Demaille <akim@epita.fr>
16517
16518 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
16519 (copy_dollar): Now that everything uses obstacks, get rid of the
16520 FILE * parameters.
16521
5d3214b8
AD
165222000-12-20 Akim Demaille <akim@epita.fr>
16523
16524 * src/files.c (open_files): Actually the `.output' file is based
16525 on the short_base_name, not base_name.
16526 * tests/suite.at (Checking output file names): Adjust.
16527
29092a57
AD
165282000-12-20 Akim Demaille <akim@epita.fr>
16529
16530 * src/bison.s1: Remove, we now use directly...
16531 * src/bison.simple: this.
16532 * src/Makefile.am: Use pkgdata instead of data.
16533
ea5607fd
AD
165342000-12-20 Akim Demaille <akim@epita.fr>
16535
16536 * src/files.c (guard_obstack): New.
16537 (open_files): Initialize it.
16538 (output_files): Dump it...
16539 * src/files.h: Export it.
16540 * src/reader.c (copy_guard): Use it.
16541
27110317
AD
165422000-12-19 Akim Demaille <akim@epita.fr>
16543
16544 * src/files.c (outfile, defsfile, actfile): Removed as global
16545 vars.
16546 (open_files): Don't compute them.
16547 (output_files): Adjust.
16548 (base_name, short_base_name): Be global.
16549 Adjust dependencies.
16550
19c50364
AD
165512000-12-19 Akim Demaille <akim@epita.fr>
16552
16553 * src/files.c (strsuffix): New.
16554 (stringappend): Be just like strcat but allocate.
16555 (base_names): Eve out from open_files.
16556 Try to simplify the rather hairy computation of base_name and
16557 short_base_name.
16558 (open_files): Use it.
16559 * tests/suite.at (Checking output file names): New test.
16560
573c1d9f
AD
165612000-12-19 Akim Demaille <akim@epita.fr>
16562
16563 * src/system.h (obstack_grow_literal_string): Rename as...
16564 (obstack_grow_string): this.
16565 * src/output.c (output_parser): Recognize `%% actions' instead of
16566 `$'.
16567 * src/bison.s1: s/$/%% actions/.
16568 * src/bison.hairy: Likewise.
16569
ef7ddedd
AD
165702000-12-19 Akim Demaille <akim@epita.fr>
16571
16572 * src/output.c (output_parser): Compute the `#line' lines when
16573 there are.
16574 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
16575 Suggested by Hans Aberg.
16576
ff61dabd
AD
165772000-12-19 Akim Demaille <akim@epita.fr>
16578
16579 Let the handling of the skeleton files be local to the procedures
16580 that use it.
16581
16582 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
16583 longer static.
16584 (fparser, open_extra_files): Remove.
16585 (open_files, output_files): Don't take care of fparser.
16586 * src/files.h: Adjust.
16587 * src/output.c (output_parser): Open and close the file to the
16588 skeleton.
16589 * src/reader.c (read_declarations): When %semantic_parser, open
16590 fguard.
16591
55b96341
AD
165922000-12-19 Akim Demaille <akim@epita.fr>
16593
16594 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
16595 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
16596
358c15b7
AD
165972000-12-19 Akim Demaille <akim@epita.fr>
16598
16599 * src/files.c (open_files): Yipee! We no longer need all the code
16600 looking for `/tmp' since we have no tmp file.
16601
7de3329e
AD
166022000-12-19 Akim Demaille <akim@epita.fr>
16603
16604 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
16605 New macros.
16606 * src/files.c (open_files): Less dependency on MSDOS etc.
16607
3abcd459
AD
166082000-12-14 Akim Demaille <akim@epita.fr>
16609
16610 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
16611 Provide a default definition.
16612 Use it when executing the default @ action.
16613 * src/reader.c (reader_output_yylsp): No longer include
16614 `timestamp' and `text' in the default YYLTYPE.
16615
2a91a95e
AD
166162000-12-12 Akim Demaille <akim@epita.fr>
16617
16618 * src/reader.c (copy_definition, parse_union_decl, copy_action)
16619 (copy_guard): Quote the file names.
16620 Reported by Laurent Mascherpa.
16621
14d3eb9b
AD
166222000-12-12 Akim Demaille <akim@epita.fr>
16623
16624 * src/output.c (output_headers, output_program, output): Be sure
16625 to escape special characters when outputting filenames.
16626 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
16627 (output_headers): Don't depend on them, Use ACTSTR.
16628
d7045ec6
AD
166292000-11-17 Akim Demaille <akim@epita.fr>
16630
16631 * lib/obstack.h: Formatting changes.
16632 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
16633 prevents type checking.
16634 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
16635 cast the value to (void *): assigning a `foo *' to a `void *'
16636 variable is valid.
16637 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
16638 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
16639 append characters.
16640
6fd54b73
AD
166412000-11-17 Akim Demaille <akim@epita.fr>
16642
16643 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
16644 as...
16645 (suite.m4, regression.m4, calc.m4): these.
16646 * tests/atgeneral.m4: Update from CVS Autoconf.
16647
4c50eae6
AD
166482000-11-17 Akim Demaille <akim@epita.fr>
16649
16650 * tests/regression.m4 (%union and --defines): New test,
16651 demonstrating a current bug in the obstack implementation.
16652
a35f64ea
AD
166532000-11-17 Akim Demaille <akim@epita.fr>
16654
16655 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
16656 macros.
16657 Use them to declare the variables which are global or local to
16658 `yyparse'.
16659
7de23534
AD
166602000-11-17 Akim Demaille <akim@epita.fr>
16661
16662 * acconfig.h: Remove, no longer used.
16663
aa7815f5
AD
166642000-11-07 Akim Demaille <akim@epita.fr>
16665
16666 * src: s/Copyright (C)/Copyright/g.
16667
5af1f549
AD
166682000-11-07 Akim Demaille <akim@epita.fr>
16669
16670 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
16671 defining.
16672 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
16673
553e2b22
AD
166742000-11-07 Akim Demaille <akim@epita.fr>
16675
16676 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
16677 Merge in a single CPP if/else.
16678
8a4f41d6
AD
166792000-11-07 Akim Demaille <akim@epita.fr>
16680
16681 * src/output.c (output): Remove useless variables.
16682 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
16683 argument `data' for consistency with the prototypes.
16684 Qualify it `const'.
16685 (obstack_copy, obstack_copy0): Rename the second argument as
16686 `address' for consistency. Qualify it `const'.
16687 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
16688 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
16689 `const' their input argument (`data' or `address').
16690 Adjust the corresponding macros to include `const' in casts.
16691
095a3fb5
AD
166922000-11-03 Akim Demaille <akim@epita.fr>
16693
16694 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
16695 s/PFILE1/BISON_HAIRY/.
16696 Adjust dependencies.
16697
d1cdce7c
AD
166982000-11-03 Akim Demaille <akim@epita.fr>
16699
090c5ebf 16700 For some reason, this was not applied.
d1cdce7c
AD
16701
16702 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16703 `unlink': it's no longer used.
16704
9311529b
AD
167052000-11-03 Akim Demaille <akim@epita.fr>
16706
16707 * src/files.c (skeleton_find): New function, eved out of...
16708 (open_files, open_extra_files): here.
16709
d8880f69
AD
167102000-11-03 Akim Demaille <akim@epita.fr>
16711
16712 Don't use `atexit'.
16713
16714 * src/files.c (obstack_save): New function.
16715 (done): Rename as...
16716 (output_files): this.
16717 Use `obstack_save'.
16718 * src/main.c (main): Don't use `atexit' to register `done', since
16719 it no longer has to remove tmp files, just call `output_files'
16720 when there are no errors.
16721
0dbb648e
AD
167222000-11-02 Akim Demaille <akim@epita.fr>
16723
16724 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16725 `unlink': it's no longer used.
16726 * src/files.h: Formatting changes.
16727
896fe5c1
AD
167282000-11-02 Akim Demaille <akim@epita.fr>
16729
16730 Remove the last uses of mktemp and unlink/delete.
16731
16732 * src/files.c (fdefines, ftable): Removed.
16733 (defines_ostack, table_obstack): New.
16734 Adjust dependencies of the former into uses of the latter.
16735 * src/output.c (output_short_or_char_table, output_short_table):
16736 Convert to using obstacks.
16737 * src/reader.c (copy_comment2): Accept one FILE * and two
16738 obstacks.
16739 (output_token_defines, reader_output_yylsp): Use obstacks.
16740 * src/system.h (obstack_fgrow3): New.
1f65350a 16741 * po/POTFILES.in: Adjust.
896fe5c1 16742
dd60faec
AD
167432000-11-01 Akim Demaille <akim@epita.fr>
16744
16745 Change each use of `fattrs' into a use of `attrs_obstack'.
16746
16747 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
16748 * src/files.c (fattrs): Remove.
16749 (attrs_obstack): New.
16750 Adjust all dependencies.
16751 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
16752
8c7ebe49
AD
167532000-11-01 Akim Demaille <akim@epita.fr>
16754
16755 Introduce obstacks.
16756 Change each use of `faction' into a use of `action_obstack'.
16757
16758 * lib/obstack.h, lib/obstack.c: New files.
16759 * src/files.c (faction): Remove.
16760 (action_obstack): New.
16761 Adjust all dependencies.
16762
77aee789
AD
167632000-10-20 Akim Demaille <akim@epita.fr>
16764
16765 * lib/quote.h (PARAMS): New macro. Use it.
16766
43591cec
AD
167672000-10-16 Akim Demaille <akim@epita.fr>
16768
16769 * src/output.c (output_short_or_char_table): New function.
16770 (output_short_table, output_token_translations): Use it.
16771 (goto_actions): Use output_short_table.
16772
1e9798d5
AD
167732000-10-16 Akim Demaille <akim@epita.fr>
16774
16775 * src/symtab.c (bucket_new): New function.
16776 (getsym): Use it.
16777
16778 * src/output.c (output_short_table): New argument to display the
16779 comment associated with the table.
16780 Adjust dependencies.
16781 (output_gram): Use it.
16782 (output_rule_data): Nicer output layout for YYTNAME.
16783
f282676b
AD
167842000-10-16 Akim Demaille <akim@epita.fr>
16785
16786 * src/lex.c (read_typename): New function.
16787 (lex): Use it.
16788 * src/reader.c (copy_dollar): Likewise.
16789
550a72a3
AD
167902000-10-16 Akim Demaille <akim@epita.fr>
16791
16792 * src/reader.c (copy_comment2): Expect the input stream to be on
16793 the `/' which is suspected to open a comment, instead of being
16794 called after `//' or `/*' was read.
16795 (copy_comment, copy_definition, parse_union_decl, copy_action)
16796 (copy_guard): Adjust.
16797
131e2fef
AD
167982000-10-16 Akim Demaille <akim@epita.fr>
16799
16800 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
16801 `read_signed_integer'.
16802
79282c5a
AD
168032000-10-16 Akim Demaille <akim@epita.fr>
16804
16805 * src/reader.c (copy_dollar): New function.
16806 (copy_guard, copy_action): Use it.
16807
ff4a34be
AD
168082000-10-16 Akim Demaille <akim@epita.fr>
16809
16810 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
16811 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
16812 New files, from Fileutils 4.0.27.
16813 * src/main.c (printable_version): Remove.
16814 * src/lex.c, src/reader.c: Use `quote'.
16815
168162000-10-04 Akim Demaille <akim@epita.fr>
16817
16818 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
16819
14ded682
AD
168202000-10-04 Akim Demaille <akim@epita.fr>
16821
16822 * doc/bison.texinfo: Various typos spotted by Neil Booth.
16823
8e03724b
AD
168242000-10-04 Akim Demaille <akim@epita.fr>
16825
16826 When a literal string is used to define two different tokens,
16827 `bison -v' segfaults.
16828 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
16829
16830 * tests/regression.m4: New file.
16831 Include the core of the sample provided by Piotr Gackiewicz.
16832 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
16833 properly.
16834
a9e64249
AD
168352000-10-04 Akim Demaille <akim@epita.fr>
16836
16837 * src/reader.c (parse_expect_decl): Keep `count' within the size
16838 of `buffer'.
16839 From Neil Booth.
16840
da9abf43
AD
168412000-10-02 Paul Eggert <eggert@twinsun.com>
16842
16843 * bison.s1 (yyparse): Assign the default value
16844 unconditionally, to avoid a GCC warning and make the parser a
16845 tad smaller.
16846
c33638bb
AD
168472000-10-02 Akim Demaille <akim@epita.fr>
16848
16849 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
16850 options.
16851
444c570a
AD
168522000-10-02 Akim Demaille <akim@epita.fr>
16853
16854 * src/derives.c, src/print.c, src/reduce.c: To ease the
16855 translation, move some `\n' out of the translated strings.
16856
89cab50d
AD
168572000-10-02 Akim Demaille <akim@epita.fr>
16858
16859 The location tracking mechanism is precious for parse error
16860 messages. Nevertheless, it is enabled only when `@n' is used in
16861 the grammar, which is a different issue (you can use it in error
16862 message, but not in the grammar per se). Therefore, there should
16863 be another means to enable it.
16864
16865 * src/getargs.c (getargs): Support `--locations'.
16866 (usage): Report it.
16867 * src/getargs.h (locationsflag): Export it.
16868 * src/lex.c (percent_table): Support `%locations'.
16869 * src/reader.c (yylsp_needed): Remove this variable, now replaced
16870 with `locationsflag'.
16871 * doc/bison.texinfo: Document `--locations' and `%locations'.
16872 Sort the options.
16873 * tests/calc.m4: Test it.
16874
16875 For regularity of the names, replace each
16876 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
16877 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
16878 In addition replace each `flag' with `_flag'.
16879
d6c2cba0
AD
168802000-10-02 Akim Demaille <akim@epita.fr>
16881
16882 Also test parse error messages, including with YYERROR_VERBOSE.
16883
16884 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
16885 associative).
16886 Use it to check the computations.
16887 Use it to check `nonassoc' is honored.
16888 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
16889 `--yyerror-verbose'.
16890 (_AT_CHECK_CALC): Adjust to this option.
16891 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
16892
5a35a6cb
AD
168932000-10-02 Akim Demaille <akim@epita.fr>
16894
16895 Test also `--verbose', `--defines' and `--name-prefix'. Testing
16896 the latter demonstrates a flaw in the handling of non debugging
16897 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
16898 was used in order to simplify:
16899
16900 #if YYDEBUG
16901 if (yydebug)
16902 {
16903 ...
16904 }
16905 #endif
16906
16907 into
16908
16909 if (yydebug)
16910 {
16911 ...
16912 }
16913
16914 unfortunately this leads to a CPP conflict when
16915 `--name-prefix=foo' is used since it produces `#define yydebug
16916 foodebug'.
16917
16918 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
16919 (YYDPRINTF): New macro.
16920 Spread its use.
16921 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
16922 the bison options.
16923 Also test `--verbose', `--defines' and `--name-prefix'.
16924
71da9eea
AD
169252000-10-02 Akim Demaille <akim@epita.fr>
16926
16927 Improve the readability of the produced parsers.
16928
16929 * src/bison.s1: Formatting changes.
16930 Improve the comment related to the `$' mark.
16931 (yydefault): Don't fall through to `yyresume': `goto' there.
16932 * src/output.c (output_parser): When the `$' is met, skip the end
16933 of its line.
16934 New variable, `number_of_dollar_signs', to check there's exactly
16935 one `$' in the parser skeleton.
16936
95e36146
AD
169372000-10-02 Akim Demaille <akim@epita.fr>
16938
16939 * lib/xstrdup.c: New file, from the fileutils.
16940 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
16941 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
16942 instead of strlen + xmalloc + strcpy.
16943 * src/symtab.c (copys): Remove, use xstrdup instead.
16944
d7020c20
AD
169452000-10-02 Akim Demaille <akim@epita.fr>
16946
16947 * src/gram.h (associativity): New enum type which replaces the
16948 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
16949 `right_assoc', `left_assoc' and `non_assoc'.
16950 Adjust all dependencies.
16951 * src/reader.c: Formatting changes.
16952 (LTYPESTR): Don't define it, use it as a literal in
16953 `reader_output_yylsp'.
16954 * src/symtab.h (symbol_class): New enum type which replaces the
16955 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
16956 `sunknown', `stoken and `snterm'.
16957
1916f98e
AD
169582000-10-02 Akim Demaille <akim@epita.fr>
16959
16960 * src/getargs.c (fixed_outfiles): Rename as...
16961 (yaccflag): for consistency and accuracy.
16962 Adjust dependencies.
16963
d7913476
AD
169642000-10-02 Akim Demaille <akim@epita.fr>
16965
16966 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
16967 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
16968 difficult and introduced a lot of core dump. It turns out that
16969 Bison used an implementation of `xmalloc' based on `calloc', and
16970 at various places it does depend upon the initialization to 0. I
16971 have not tried to isolate the pertinent places, and all the former
16972 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
16973 someone should address this issue.
16974
16975 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
16976 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
16977 files.
16978 Adjust dependencies.
16979 * src/warshall.h: New file.
16980 Propagate.
16981
340ef489
AD
169822000-10-02 Akim Demaille <akim@epita.fr>
16983
16984 Various anti-`extern in *.c' changes.
16985
16986 * src/system.h: Include `assert.h'.
16987
b2ca4022
AD
169882000-10-02 Akim Demaille <akim@epita.fr>
16989
16990 * src/state.h (nstates, final_state, first_state, first_shift)
16991 (first_reduction): Move their exportation from here...
16992 * src/LR0.h: to here.
16993 Adjust dependencies.
16994 * src/getargs.c (statisticsflag): New variable.
16995 Add support for `--statistics'.
16996 Adjust dependencies.
16997
16998 Remove a lot of now useless `extern' statements in most files.
16999
403b315b
AD
170002000-10-02 Akim Demaille <akim@epita.fr>
17001
17002 * src/LR0.h: New file.
17003 Propagate its use.
17004
07a58c13
AD
170052000-10-02 Akim Demaille <akim@epita.fr>
17006
17007 * src/print.h: New file.
17008 Propagate its use.
17009 * src/print.c: Formatting and ordering changes.
17010 (verbose, terse): Replace with...
17011 (print_results): this new function.
17012 Adjust dependencies.
17013
0619caf0
AD
170142000-10-02 Akim Demaille <akim@epita.fr>
17015
17016 * src/conflicts.c (conflict_report): New function.
17017 (conflict_log, verbose_conflict_log): Replace with...
17018 (print_conflicts): this function.
17019 Adjust dependencies.
17020 * src/conflicts.h: New file.
17021 Propagate its inclusion.
17022
3519ec76
AD
170232000-10-02 Akim Demaille <akim@epita.fr>
17024
17025 * src/nullable.h: New file.
17026 Propagate its inclusion.
17027 * src/nullable.c: Formatting changes.
17028
015acc48
AD
170292000-10-02 Akim Demaille <akim@epita.fr>
17030
17031 * src/reduce.h: New file.
17032 Propagate its inclusion.
17033 * src/reduce.c: Topological sort and other formatting changes.
17034 (bool, TRUE, FALSE): Move their definition to...
17035 * src/system.h: here.
17036
8963a27b
AD
170372000-10-02 Akim Demaille <akim@epita.fr>
17038
17039 * src/files.c: Formatting changes.
17040 (tryopen, tryclose, openfiles): Rename as...
17041 (xfopen, xfclose, open_files): this.
17042 (stringappend): static.
17043 * src/files.h: Complete the list of exported symbols.
17044 Propagate its use.
17045
a70083a3
AD
170462000-10-02 Akim Demaille <akim@epita.fr>
17047
17048 * src/reader.h: New file.
17049 Propagate its use instead of tedious list of `extern' and
17050 prototypes.
17051 * src/reader.c: Formatting changes, topological sort,
17052 s/register//.
17053
abadc117
AD
170542000-10-02 Akim Demaille <akim@epita.fr>
17055
17056 * src/lex.h: Prototype `lex.c' exported functions.
17057 * src/reader.c: Adjust.
17058 * src/lex.c: Formatting changes.
17059 (safegetc): Rename as...
17060 (xgetc): this.
17061
720d742f
AD
170622000-10-02 Akim Demaille <akim@epita.fr>
17063
17064 * src/lalr.h: New file.
17065 Propagate its inclusion instead of prototypes and `extern'.
17066 * src/lalr.c: Formatting changes, topological sorting etc.
17067
f2acea59
AD
170682000-10-02 Akim Demaille <akim@epita.fr>
17069
17070 * src/output.c (token_actions): Introduce a temporary array,
17071 YYDEFACT, that makes it possible for this function to use
17072 output_short_table.
17073
d019d655
AD
170742000-10-02 Akim Demaille <akim@epita.fr>
17075
17076 `user_toknums' is output as a `short[]' in `output.c', while it is
17077 defined as a `int[]' in `reader.c'. For consistency with the
17078 other output tables, `user_toknums' is now defined as a table of
17079 shorts.
17080
17081 * src/reader.c (user_toknums): Be a short table instead of an int
17082 table.
17083 Adjust dependencies.
17084
17085 Factor the short table outputs.
17086
17087 * src/output.c (output_short_table): New function.
17088 * src/output.c (output_gram, output_stos, output_rule_data)
17089 (output_base, output_table, output_check): Use it.
17090
6c89f1c1
AD
170912000-10-02 Akim Demaille <akim@epita.fr>
17092
17093 * src/output.c (output): Topological sort of the functions, in
17094 order to get rid of the `static' prototypes.
17095 No longer use `register'.
17096 * src/output.h: New file.
17097 Propagate its inclusion in files explicitly prototyping functions
17098 from output.c.
17099
d9efd181
AD
171002000-09-21 Akim Demaille <akim@epita.fr>
17101
17102 * src/atgeneral.m4: Update from Autoconf.
17103
c29240e7 171042000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
17105
17106 * src/closure.h: New file.
17107 * src/closure.c: Formatting changes, topological sort over the
17108 functions, use of closure.h.
17109 (initialize_closure, finalize_closure): Rename as...
17110 (new_closure, free_closure): these. Adjust dependencies.
17111 * src/LR0.c: Formatting changes, topological sort, use of
17112 cloture.h.
17113 (initialize_states): Rename as...
17114 (new_states): this.
17115 * src/Makefile.am (noinst_HEADERS): Adjust.
17116
499daa50
AD
171172000-09-20 Akim Demaille <akim@epita.fr>
17118
17119 * src/acconfig.h: Don't protect config.h against multiple
17120 inclusion.
17121 Don't define PARAMS.
17122 * src/system.h: Define PARAMS.
17123 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
17124 purpose of config.h. system.h must not try to fix wrong
17125 definitions in config.h.
17126
cc84fd5d
AD
171272000-09-20 Akim Demaille <akim@epita.fr>
17128
17129 * src/derives.h: New file.
17130 * src/main.c, src/derives.h: Use it.
17131 Formatting changes.
17132 * src/Makefile.am (noinst_HEADERS): Adjust.
17133
db5b3a89
AD
171342000-09-20 Akim Demaille <akim@epita.fr>
17135
17136 * tests/atgeneral.m4: Update from Autoconf.
17137 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
17138 (AT_CHECK_CALC): New macros.
17139 Use these macros to test bison with options `', `--raw',
17140 `--debug', `--yacc', `--yacc --debug'.
17141
ceed8467
AD
171422000-09-19 Akim Demaille <akim@epita.fr>
17143
17144 * src/output.c: Formatting changes.
17145 * src/machine.h: Remove, leaving its contents in...
17146 * src/system.h: here.
17147 Include stdio.h.
17148 Adjust all dependencies on stdio.h and machine.h.
17149 * src/getargs.h: New file.
17150 Let all `extern' declarations about getargs.c be replaced with
17151 inclusion of `getargs.h'.
17152 * src/Makefile.am (noinst_HEADERS): Adjust.
17153
17154 * tests/calc.m4 (yyin): Be initialized in main, not on the global
17155 scope.
17156 (yyerror): Returns void, not int.
17157 * doc/bison.texinfo: Formatting changes.
17158
05a1d24b
AD
171592000-09-19 Akim Demaille <akim@epita.fr>
17160
17161 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
17162 portable.
17163
cbd25751
AD
171642000-09-18 Akim Demaille <akim@epita.fr>
17165
17166 * configure.in: Append WARNING_CFLAGS to CFLAGS.
17167 * src/Makefile.am (INCLUDES): Don't.
17168 Be ready to fetch headers in lib/.
17169
13863333
AD
171702000-09-18 Akim Demaille <akim@epita.fr>
17171
17172 * doc/bison.texinfo: Update the copyright.
17173 ANSIfy and GNUify the examples.
17174 Remove the old menu.
17175
0d533154
AD
171762000-09-18 Akim Demaille <akim@epita.fr>
17177
17178 First set of tests: use the `calc' example from the documentation.
17179
17180 * src/bison.s1 (yyparse): Condition the code using `yytname' which
17181 is defined only when YYDEBUG is.
17182 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
17183 * src/files.c (tryopen, tryclose): Formatting changes.
17184 Move to the top and be static.
17185 * src/reader.c (read_signed_integer): Likewise.
17186 * tests/calc.m4: New file.
17187 * Makefile.am, suite.m4: Adjust.
17188 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
17189
e79137ac
AD
171902000-09-18 Akim Demaille <akim@epita.fr>
17191
17192 Add support for an Autotest test suite for Bison.
17193
17194 * m4/m4.m4, m4/atconfig.m4: New files.
17195 * m4/Makefile.am (EXTRA_DIST): Adjust.
17196 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
17197 files.
17198 * src/getargs.c: Display a more standard --version message.
17199 * src/reader.c (reader): Formatting changes.
17200 No longer depend upon VERSION_STRING.
17201 * configure.in: No longer use `dnl'.
17202 Set up the test suite and the new directory `tests/.
17203 (VERSION_STRING): Remove.
17204
27821bff
AD
172052000-04-14 Akim Demaille <akim@epita.fr>
17206
17207 * src/reader.c (copy_comment2): New function, same as former
17208 `copy_comment', but outputs into two FILE *.
17209 (copy_comment): Use it.
17210 (parse_union_decl): Use it.
17211 (get_type, parse_start_decl): Use the same `invalid' message.
17212 (parse_start_decl, parse_union_decl): Use the same `multiple'
17213 message.
17214 (parse_union_decl, copy_guard, copy_action): Use the same
17215 `unmatched' message.
17216 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
17217
cfe5fbc0
AD
172182000-03-31 Akim Demaille <akim@epita.fr>
17219
17220 * src/files.c (tryopen, tryclose): Move to the top.
17221 Be static.
17222
cb7db13e
AD
172232000-03-31 Akim Demaille <akim@epita.fr>
17224
17225 * src/main.c (main): Don't call `done', exit does it.
17226
a0f6b076
AD
172272000-03-31 Akim Demaille <akim@epita.fr>
17228
36281465
AD
17229 * allocate.c: s/return (foo)/return foo/.
17230 * lalr.c: Likewise.
17231 * LR0.c: Likewise.
17232 * output.c: Likewise.
17233 * reader.c: Likewise.
17234 * symtab.c: Likewise.
17235 * vmsgetargs.c: Likewise.
17236
172372000-03-31 Akim Demaille <akim@epita.fr>
17238
17239 Clean up the error reporting functions.
a0f6b076
AD
17240
17241 * src/report.c: New file.
17242 * src/report.h: Likewise.
17243 * src/Makefile.am: Adjust.
17244 * m4/error.m4: New file.
17245 * m4/Makefile.am: Adjust.
17246 * configure.in (jm_PREREQ_ERROR): Call it.
17247 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
17248 Remove.
17249 (fatal, fatals): Remove. All callers use complain.c::fatal.
17250 (warn, warni, warns, warnss, warnss): Remove. All callers use
17251 complain.c::complain.
17252 (toomany): Remove, use fatal instead.
17253 * src/files.c (done): No argument, use complain_message_count.
17254 * src/main.c (main): Register `done' to `atexit'.
17255
17256 * src/getargs.c (usage): More `fputs', less `fprintf'.
17257
18539825
AD
172582000-03-28 Akim Demaille <akim@epita.fr>
17259
17260 * lib/: New directory.
17261 * Makefile.am (SUBDIRS): Adjust.
17262 * configure.in: Adjust.
17263 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
17264 useless.
17265 * src/alloca.c: Moved to lib/.
17266 * src/getopt.c: Likewise.
17267 * src/getopt1.c: Likewise.
17268 * src/getopt.h: Likewise.
17269 * src/ansi2knr.c: Likewise.
17270 * src/ansi2knr.1: Likewise.
17271 * src/Makefile.am: Adjust.
17272 * lib/Makefile.am: New file.
17273
9f306f2a
AD
172742000-03-28 Akim Demaille <akim@epita.fr>
17275
17276 * src/getargs.c (usage): Refresh the help message.
17277
0ba347b6
AD
172782000-03-17 Akim Demaille <akim@epita.fr>
17279
17280 * src/getopt1.c: Updated from textutils 2.0e
17281 * src/getopt.c: Likewise.
17282 * src/getopt.h: Likewise.
17283
dbe7f271
AD
172842000-03-17 Akim Demaille <akim@epita.fr>
17285
17286 * src/Makefile.am (bison.simple): Fix the awk program: quote only
17287 the file name, not the whole `#line LINE FILE'.
17288
75bbe78d
AD
172892000-03-17 Akim Demaille <akim@epita.fr>
17290
17291 On syntax errors, report the token on which we choked.
17292
aa5fd0ee
AD
17293 * src/bison.s1 (yyparse): In the label yyerrlab, when
17294 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 17295
7b306f52
AD
172962000-03-17 Akim Demaille <akim@epita.fr>
17297
aa5fd0ee 17298 * src/reader.c (copy_at): New function.
7b306f52
AD
17299 (copy_guard): Use it.
17300 (copy_action): Use it.
17301
e87b5700
AD
173022000-03-17 Akim Demaille <akim@epita.fr>
17303
17304 Be kind to translators, save some useless translations.
17305
aa5fd0ee 17306 * src/main.c (banner): New function.
e87b5700
AD
17307 (fatal_banner): Use it.
17308 (warn_banner): Use it.
17309
ae3c3164
AD
173102000-03-17 Akim Demaille <akim@epita.fr>
17311
aa5fd0ee
AD
17312 * src/reader.c (copy_definition): Use copy_string and
17313 copy_comment. Removed now unused `match', `ended',
17314 `cplus_comment'.
ae3c3164
AD
17315 (copy_comment, copy_string): Moved, to be visible from
17316 copy_definition.
17317
4dc58e7c
AD
173182000-03-17 Akim Demaille <akim@epita.fr>
17319
aa5fd0ee
AD
17320 * src/reader.c (copy_string): Declare `static inline'. No
17321 problems with inline, since it is checked by configure.
4dc58e7c
AD
17322 (copy_comment): Likewise.
17323
0a6384c4
AD
173242000-03-17 Akim Demaille <akim@epita.fr>
17325
aa5fd0ee 17326 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 17327
3cef001a
AD
173282000-03-17 Akim Demaille <akim@epita.fr>
17329
aa5fd0ee 17330 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
17331 (copy_action): Use it. Removed now unused `match', `ended',
17332 `cplus_comment'.
17333 (copy_guard): Likewise.
17334
ca36d2ef
AD
173352000-03-17 Akim Demaille <akim@epita.fr>
17336
aa5fd0ee 17337 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
17338 (copy_action): Use it.
17339 (copy_guard): Likewise.
17340
6666f98f
AD
173412000-03-17 Akim Demaille <akim@epita.fr>
17342
17343 Change the handling of @s so that they behave exactly like $s.
17344 There is now a pseudo variable @$ (readble and writable), location
17345 of the lhs of the rule (by default ranging from the location of
17346 the first symbol of the rhs, to the location of the last symbol,
17347 or, if the rhs is empty, YYLLOC).
17348
17349 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
17350 yyval.
17351 (yyparse): When providing a default semantic action, provide a
17352 default location action.
17353 (after the $): No longer change `*YYLSP', just stack YYLOC the
17354 same way you stack YYVAL.
17355 * src/reader.c (read_declarations): Use warns.
17356 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
17357 (copy_action, case '@'): Likewise.
17358 Use a standard error message, to save useless work from
17359 translators.
17360
41aca2e0
AD
173612000-03-17 Akim Demaille <akim@epita.fr>
17362
aa5fd0ee
AD
17363 * src/bison.s1: Formatting and cosmetics changes.
17364 * src/reader.c: Likewise.
41aca2e0
AD
17365 Update the Copyright notice.
17366
dc08c1d5
AD
173672000-03-17 Akim Demaille <akim@epita.fr>
17368
aa5fd0ee
AD
17369 * src/bison.s1 (#line): All set to `#line' only, since the
17370 Makefile now handles them.
dc08c1d5 17371
9ee3c97b
AD
173722000-03-16 Akim Demaille <akim@epita.fr>
17373
17374 * src/output.c (output_rule_data): Output the documentation of
17375 some of the tables.
17376 (Copyright notice): Update.
17377 Formatting changes.
17378
0de741ca
AD
173792000-03-16 Akim Demaille <akim@epita.fr>
17380
17381 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
17382 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
17383 One `#if YYDEBUG' remains, since it uses variables which are
17384 defined only if `YYDEBUG != 0'.
17385
bb10be54
AD
173862000-03-16 Akim Demaille <akim@epita.fr>
17387
17388 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
17389 and related variables so that the similarities are highlighted.
17390
b07b484a
AD
173912000-03-16 Akim Demaille <akim@epita.fr>
17392
17393 * src/bison.s1: Properly indent CPP directives.
17394
361f60b3
AD
173952000-03-16 Akim Demaille <akim@epita.fr>
17396
17397 * src/bison.s1: Properly indent the `alloca' CPP section.
17398
8c44d3ec
AD
173992000-03-16 Akim Demaille <akim@epita.fr>
17400
17401 Do not hard code values of directories in `configure.in'.
17402 Update the `configure' tool chain.
17403
17404 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
17405 src/makefile.am.
17406 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
17407 (AC_OUTPUT): Add m4/Makefile.
17408 Bump to bison 1.28a, 1.29 has never been released.
17409 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
17410 handled via src/Makefile.am.
17411 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
17412 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
17413 autoheader.
17414 * Makefile.am (SUBDIRS): Add m4.
17415 (ACLOCAL_AM_FLAGS): New variable.
17416 (AUTOMAKE_OPTIONS): Add check-news.
17417 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
17418 the proper line number and file name.
17419 (DEFS): Propagate the location of bison library files and of the
17420 locale files.
17421 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
17422 builddir.
17423 * acinclude.m4: Remove, replaced by the directory m4.
17424 * m4/Makefile.am (EXTRA_DIST): New variable.
17425 * m4/gettext.m4: New file, from the fileutils.
17426 * m4/lcmessage.m4: Likewise
17427 * m4/progtest.m4: Likewise.
17428 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
17429
f95997e7
AD
174302000-03-10 Akim Demaille <akim@epita.fr>
17431
17432 * src/closure.c:
17433 Formatting changes of various comments.
17434 Respect the GNU coding standards at various places.
17435 Don't use `_()' when no translation is needed.
17436
174371999-12-13 Jesse Thilo <jthilo@gnu.org>
17438
17439 * src/files.c:
17440 OS/2 honors TMPDIR environment variable.
17441
174421999-12-13 Jesse Thilo <jthilo@gnu.org>
17443
17444 * doc/bison.texinfo: Tweaked spelling and grammar.
17445 Updated ISBN.
17446 Removed reference to price of printed copy.
17447 Mention BISON_SIMPLE and BISON_HAIRY.
17448
174491999-12-13 Jesse Thilo <jthilo@gnu.org>
17450
17451 * configure.in, NEWS:
17452 Bison 1.29 released.
17453
174541999-10-27 Jesse Thilo <jthilo@gnu.org>
17455
17456 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
17457 Added reference card.
17458
174591999-07-26 Jesse Thilo <jthilo@gnu.org>
17460
17461 * po/ru.po: Added Russian translation.
17462
174631999-07-26 Jesse Thilo <jthilo@gnu.org>
17464
17465 * configure.in: Added Russian translation.
17466
174671999-07-06 Jesse Thilo <jthilo@gnu.org>
17468
17469 * configure.in, NEWS, README:
17470 Released version 1.28.
17471
174721999-06-14 Jesse Thilo <jthilo@gnu.org>
17473
17474 * src/system.h:
17475 Squashed redefinition warning on some systems.
17476
17477 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
17478 Have configure build version string instead of relying on ANSI string
17479 concatentation.
17480
174811999-06-14 Jesse Thilo <jthilo@gnu.org>
17482
17483 * po/POTFILES.in: Got rid of version.c.
17484
174851999-06-14 Jesse Thilo <jthilo@gnu.org>
17486
17487 * acconfig.h, configure.in:
17488 Have configure build version string instead of relying on ANSI string
17489 concatentation.
17490
174911999-06-08 Jesse Thilo <jthilo@gnu.org>
17492
17493 * doc/bison.1:
17494 Dropped mention of `+' for long-named options.
17495
174961999-05-30 Jesse Thilo <jthilo@gnu.org>
17497
17498 * src/files.c: Added <unistd.h> for unlink().
17499
17500 * src/Makefile.am, src/system.h:
17501 I18n fixes.
17502
175031999-05-30 Jesse Thilo <jthilo@gnu.org>
17504
17505 * README: Added a FAQ list.
17506
17507 * configure.in, acconfig.h:
17508 I18n fixes.
17509
175101999-05-30 Jesse Thilo <jthilo@gnu.org>
17511
17512 * doc/FAQ, doc/Makefile.am:
17513 Added a FAQ list.
17514
175151999-05-19 Jesse Thilo <jthilo@gnu.org>
17516
17517 * src/alloc.h, src/symtab.h, src/version.c:
17518 Protected inclusion of "config.h" with HAVE_CONFIG_H.
17519
175201999-04-18 Jesse Thilo <jthilo@gnu.org>
17521
17522 * src/.cvsignore, src/Makefile.am:
17523 Reorganized: sources in `src', documentation in `doc'.
17524
17525 * src/lex.c (literalchar):
17526 fixed the code for escaping double quotes (thanks
17527 Jonathan Czisny.)
17528
175291999-04-18 Jesse Thilo <jthilo@gnu.org>
17530
17531 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
17532 Adjusted paths to reflect directory reorganization.
17533
175341999-04-18 Jesse Thilo <jthilo@gnu.org>
17535
17536 * doc/.cvsignore, doc/Makefile.am:
17537 Reorganized: sources in `src', documentation in `doc'.
17538
175391999-04-18 Jesse Thilo <jthilo@gnu.org>
17540
17541 * configure.in:
17542 Updated AC_INIT file to reflect directory reorganization.
17543
17544 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
17545 Reorganized: sources in `src', documentation in `doc'.
17546
175471999-04-13 Jesse Thilo <jthilo@gnu.org>
17548
17549 * src/allocate.c:
17550 Don't declare calloc() and realloc() if not necessary.
17551
175521999-04-13 Jesse Thilo <jthilo@gnu.org>
17553
17554 * configure.in, acconfig.h, acinclude.m4:
17555 Don't declare calloc() and realloc() if not necessary.
17556
175571999-03-23 Jesse Thilo <jthilo@gnu.org>
17558
17559 * po/.cvsignore: Added i18n support.
17560
175611999-03-23 Jesse Thilo <jthilo@gnu.org>
17562
17563 * acconfig.h, configure.in, Makefile.am:
17564 Added i18n support.
17565
175661999-03-22 Jesse Thilo <jthilo@gnu.org>
17567
17568 * src/bison.s1: Fixed #line numbers.
17569
175701999-03-15 Jesse Thilo <jthilo@gnu.org>
17571
17572 * po/es.po, po/fr.po, po/nl.po, po/de.po:
17573 Added PO files from Translation Project.
17574
175751999-03-03 Jesse Thilo <jthilo@gnu.org>
17576
17577 * Makefile.am:
17578 Added support for non-ANSI compilers (ansi2knr).
17579
175801999-02-16 Jesse Thilo <jthilo@gnu.org>
17581
17582 * configure.in: Bumped version number to 1.27.
17583
17584 * Makefile.am:
17585 Added `bison.simple' to list of files removed by `make distclean'.
17586
175871999-02-12 Jesse Thilo <jthilo@gnu.org>
17588
17589 * src/files.c, src/files.h:
17590 Defined locations of parser files in config.h instead of Makefile.
17591
175921999-02-12 Jesse Thilo <jthilo@gnu.org>
17593
17594 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
17595 Defined locations of parser files in config.h instead of Makefile.
17596
175971999-02-09 Jesse Thilo <jthilo@gnu.org>
17598
17599 * Makefile.am:
17600 Removed inappropriate use of $< macro.
17601
176021999-02-05 Jesse Thilo <jthilo@gnu.org>
17603
17604 * po/Makefile.in.in, po/POTFILES.in:
17605 Add `po' directory skeleton.
17606
176071999-01-27 Jesse Thilo <jthilo@gnu.org>
17608
17609 * README: Document help-bison list.
17610
17611 * configure.in: Add check for mkstemp().
17612
176131999-01-20 Jesse Thilo <jthilo@gnu.org>
17614
17615 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
17616 Hush a few compiler warnings.
17617
17618 * src/files.c:
17619 Add tryclose(), which verifies that fclose was successful.
17620 Hush a couple of compiler warnings.
17621
176221999-01-20 Jesse Thilo <jthilo@gnu.org>
17623
17624 * Makefile.am, OChangeLog:
17625 ChangeLog is now automatically generated. Include the old version as
17626 OChangeLog.
17627
176281999-01-14 Jesse Thilo <jthilo@gnu.org>
17629
17630 * src/gram.h, src/lalr.c, src/lex.c, src/lex.h, src/machine.h, src/main.c, src/nullable.c, src/output.c, src/print.c, src/reader.c, src/reduce.c, src/state.h, src/symtab.c, src/symtab.h, src/types.h, src/vmsgetargs.c, src/warshall.c, src/allocate.c, src/alloc.h, src/bison.s1, src/closure.c, src/conflicts.c, src/derives.c, src/files.c, src/files.h, src/getargs.c, src/gram.c, src/LR0.c:
17631 Update FSF address.
17632
176331999-01-14 Jesse Thilo <jthilo@gnu.org>
17634
17635 * doc/bison.texinfo: Fix formatting glitch.
17636
17637 * doc/bison.texinfo: Update FSF address.
17638
176391999-01-14 Jesse Thilo <jthilo@gnu.org>
17640
17641 * acconfig.h: Update FSF address.
17642
176431999-01-08 Jesse Thilo <jthilo@gnu.org>
17644
17645 * src/system.h:
17646 Don't define PACKAGE here, since config.h defines it.
17647
176481998-12-30 Jesse Thilo <jthilo@gnu.org>
17649
17650 * src/reader.c: Update copyright date.
17651
17652 * src/main.c:
17653 Ditch sprintf to statically-sized buffers in fatal/warn functions in
17654 favor of output directly to stderr (avoids buffer overruns).
17655
17656 * src/reader.c: Some checks for premature EOF.
17657
17658 * src/allocate.c, src/alloc.h, src/closure.c, src/conflicts.c, src/derives.c, src/getargs.c, src/gram.c, src/lalr.c, src/lex.c, src/LR0.c, src/main.c, src/nullable.c, src/output.c, src/print.c, src/reduce.c, src/symtab.c, src/symtab.h, src/warshall.c:
17659 Use prototypes if the compiler understands them.
17660
17661 * src/files.c: Honor TMPDIR on Unix hosts.
17662 Use prototypes if the compiler understands them.
17663
17664 * src/reader.c:
17665 Fix a couple of buffer overrun bugs.
17666 Use prototypes if the compiler understands them.
17667
17668 * src/system.h: Include unistd.h and ctype.h.
17669 Use #ifdef instead of #if for NLS symbols.
17670
176711998-12-30 Jesse Thilo <jthilo@gnu.org>
17672
17673 * doc/bison.texinfo:
17674 Delete comment "consider using @set for edition number, etc..." since
17675 we now are doing so.
17676
176771998-12-30 Jesse Thilo <jthilo@gnu.org>
17678
17679 * configure.in:
17680 Use prototypes if the compiler understands them.
17681
17682 * NEWS: Document 1.26 highlights.
17683
17684 * Makefile.am: Require Automake 1.3 or later.
17685
17686 * acconfig.h:
17687 Use prototypes if the compiler understands them.
17688
176891998-12-29 Jesse Thilo <jthilo@gnu.org>
17690
17691 * src/version.c:
17692 Use VERSION symbol from automake for version number.
17693
176941998-12-29 Jesse Thilo <jthilo@gnu.org>
17695
17696 * acconfig.h, configure.in, version.cin:
17697 Use VERSION symbol from automake for version number.
17698
176991998-11-28 Jesse Thilo <jthilo@gnu.org>
17700
17701 * Makefile.am:
17702 Distribute original version of simple parser (bison.s1), not built
17703 version (bison.simple).
17704
177051998-11-28 Jesse Thilo <jthilo@gnu.org>
17706
17707 * doc/bison.texinfo: Add info dir entry.
17708
17709 * doc/bison.texinfo:
17710 Let automake put version number into documentation.
17711
177121998-11-26 Jesse Thilo <jthilo@gnu.org>
17713
17714 * src/bison.cld, src/build.com, src/vmshlp.mar:
17715 Add non-RCS files from /gd/gnu/bison.
17716
177171998-11-26 Jesse Thilo <jthilo@gnu.org>
17718
17719 * doc/bison.1:
17720 Document the BISON_HAIRY and BISON_SIMPLE variables.
17721
177221998-11-25 Jesse Thilo <jthilo@gnu.org>
17723
17724 * src/version.c: Build version.c automatically.
17725
17726 * src/reader.c:
17727 Fix token numbering (used to start at 258, not 257).
17728
17729 * src/system.h: Include config.h.
17730
17731 * src/getargs.c: Update bug report address.
17732
17733 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
17734 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
17735
177361998-11-25 Jesse Thilo <jthilo@gnu.org>
17737
17738 * Makefile.am:
17739 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17740
17741 * configure.in, version.cin:
17742 Build version.c automatically.
17743
17744 * AUTHORS: Add AUTHORS file.
17745
17746 * README: Update bug report address.
17747
17748 * bison.simple:
17749 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17750
17751 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
17752 Add automake stuff.
17753
177541998-11-25 Jesse Thilo <jthilo@gnu.org>
17755
17756 * doc/bison.texinfo: Clean up some formatting.
17757
177581998-05-05 Richard Stallman <rms@gnu.org>
17759
17760 * doc/bison.texinfo:
17761 Explain better why to make a pure parser.
17762
177631998-01-05 Richard Stallman <rms@gnu.org>
17764
17765 * src/files.c (openfiles):
17766 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
17767 find a temporary directory, if possible. Do not unlink files while
17768 they are open.
17769
177701997-08-25 Richard Stallman <rms@gnu.org>
17771
17772 * src/reader.c (stack_offset;):
17773 Change some warni to warns.
17774
17775 * src/lex.c (literalchar): Use warns, not warni.
17776
177771997-06-28 Richard Stallman <rms@gnu.org>
17778
17779 * src/bison.s1: Add a Bison version comment.
17780
17781 * src/main.c (fatal, warn, berror):
17782 Use program_name.
17783
177841997-06-28 Richard Stallman <rms@gnu.org>
17785
17786 * Makefile.in (bison_version): New variable.
17787 (dist): Use that variable.
17788 (bison.s1): Substitute the Bison version into bison.simple.
17789
17790 * bison.simple: Add a Bison version comment.
17791
177921997-06-18 Richard Stallman <rms@gnu.org>
17793
17794 * src/main.c (fatal, warn, berror):
17795 Make error messages standard.
17796 (toomany): Improve error message text.
17797
17798 * src/LR0.c, src/closure.c, src/conflicts.c, src/derives.c, src/files.c, src/lalr.c, src/lex.c, src/nullable.c, src/output.c, src/print.c, src/reader.c, src/reduce.c, src/symtab.c:
17799 new.h renamed to alloc.h.
17800
178011997-06-18 Richard Stallman <rms@gnu.org>
17802
17803 * Makefile.in: new.h renamed to alloc.h.
17804
178051997-05-24 Richard Stallman <rms@gnu.org>
17806
17807 * src/lex.c (literalchar):
17808 Fix the code for escaping \, " and '.
17809
17810 (lex): Avoid trouble when there are many chars
17811 to discard in a char literal with just several chars in it.
17812
178131997-05-17 Richard Stallman <rms@gnu.org>
17814
17815 * src/bison.s1:
17816 Use malloc, if using alloca is troublesome.
17817 (YYSTACK_USE_ALLOCA): New flag macro.
17818 Define it for some systems and compilers.
17819 (YYSTACK_ALLOC): New macro.
17820 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17821 If it was malloc'd, free it.
17822
178231997-05-17 Richard Stallman <rms@gnu.org>
17824
17825 * bison.simple:
17826 Use malloc, if using alloca is troublesome.
17827 (YYSTACK_USE_ALLOCA): New flag macro.
17828 Define it for some systems and compilers.
17829 (YYSTACK_ALLOC): New macro.
17830 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17831 If it was malloc'd, free it.
17832
178331997-04-23 Richard Stallman <rms@gnu.org>
17834
17835 * src/bison.s1:
17836 (alloca) [__hpux]: Always define as __builtin_alloca.
17837
178381997-04-23 Richard Stallman <rms@gnu.org>
17839
17840 * bison.simple:
17841 (alloca) [__hpux]: Always define as __builtin_alloca.
17842
178431997-04-22 Richard Stallman <rms@gnu.org>
17844
17845 * src/bison.s1:
17846 [__hpux]: Include alloca.h (right for HPUX 10)
17847 instead of declaring alloca (right for HPUX 9).
17848
17849 * src/bison.s1 (__yy_memcpy):
17850 Declare arg `count' as unsigned int.
17851 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17852
178531997-04-22 Richard Stallman <rms@gnu.org>
17854
17855 * bison.simple:
17856 [__hpux]: Include alloca.h (right for HPUX 10)
17857 instead of declaring alloca (right for HPUX 9).
17858
17859 * bison.simple (__yy_memcpy):
17860 Declare arg `count' as unsigned int.
17861 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17862
178631997-01-03 Richard Stallman <rms@gnu.org>
17864
17865 * src/allocate.c: [__STDC__ or _MSC_VER]:
17866 Declare calloc and realloc to return void *.
17867
178681997-01-02 Richard Stallman <rms@gnu.org>
17869
17870 * src/system.h:
17871 [_MSC_VER]: Include stdlib.h and process.h.
17872 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
17873
17874 * src/main.c (main): Return FAILURE as a value.
17875 (printable_version): Declare arg as int, not char.
17876
178771997-01-02 Richard Stallman <rms@gnu.org>
17878
17879 * Makefile.in (dist):
17880 Explicitly check for symlinks, and copy them.
17881
178821996-12-19 Richard Stallman <rms@gnu.org>
17883
17884 * src/files.c:
17885 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
17886
178871996-12-18 Paul Eggert <eggert@gnu.org>
17888
17889 * src/bison.s1 (yyparse):
17890 If __GNUC__ and YYPARSE_PARAM are both defined,
17891 declare yyparse to have a void * argument.
17892
178931996-12-18 Paul Eggert <eggert@gnu.org>
17894
17895 * bison.simple (yyparse):
17896 If __GNUC__ and YYPARSE_PARAM are both defined,
17897 declare yyparse to have a void * argument.
17898
178991996-12-17 Richard Stallman <rms@gnu.org>
17900
17901 * src/reduce.c (nbits): Add some casts.
17902
179031996-08-12 Richard Stallman <rms@gnu.org>
17904
17905 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
17906
179071996-08-12 Richard Stallman <rms@gnu.org>
17908
17909 * bison.simple: Test _MSDOS as well as _MSDOS_.
17910
179111996-07-31 Richard Stallman <rms@gnu.org>
17912
17913 * src/bison.s1:
17914 [__sun && __i386]: Include alloca.h.
17915
179161996-07-31 Richard Stallman <rms@gnu.org>
17917
17918 * bison.simple:
17919 [__sun && __i386]: Include alloca.h.
17920
179211996-07-30 Richard Stallman <rms@gnu.org>
17922
17923 * src/bison.s1: Comment change.
17924
17925 * src/bison.s1: Test _MSDOS_, not MSDOS.
17926
179271996-07-30 Richard Stallman <rms@gnu.org>
17928
17929 * bison.simple: Comment change.
17930
17931 * bison.simple: Test _MSDOS_, not MSDOS.
17932
179331996-06-01 Richard Stallman <rms@gnu.org>
17934
17935 * src/reduce.c, src/reader.c, src/print.c, src/output.c, src/nullable.c, src/lex.c, src/lalr.c, src/getargs.c, src/derives.c, src/conflicts.c, src/closure.c, src/allocate.c:
17936 Insert `_' macro around many string constants.
17937
17938 * src/main.c:
17939 Insert `_' macro around many string constants.
17940
17941 (main): Call setlocale, bindtextdomain and textdomain.
17942
17943 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
17944 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
17945 [ENABLE_NLS]: Include libintl.h.
17946 [ENABLE_NLS] (gettext): Define.
17947 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
17948 (N_, PACKAGE, LOCALEDIR): New macros.
17949
179501996-06-01 Richard Stallman <rms@gnu.org>
17951
17952 * POTFILES.in: New file.
17953
17954 * Makefile.in (allocate.o):
17955 Define target explicitly.
17956
17957 * Makefile.in (CFLAGS): Set to @CFLAGS@.
17958 (LDFLAGS): Set to @LDFLAGS@.
17959 (configure): Run autoconf only if preceding `cd' succeeds.
17960 (bison.s1): Redirect output to temporary file then move the
17961 temporary to the target, rather than redirecting directly to bison.s1.
17962 (clean): Remove config.status and config.log.
17963 (distclean): Don't remove config.status here.
17964
179651996-05-12 Richard Stallman <rms@gnu.org>
17966
17967 * src/bison.s1:
17968 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17969
179701996-05-12 Richard Stallman <rms@gnu.org>
17971
17972 * bison.simple:
17973 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17974
179751996-05-11 Richard Stallman <rms@gnu.org>
17976
17977 * src/bison.s1 (__yy_memcpy):
17978 Really reorder the args, as was supposedly done on Feb 14 1995.
17979 (yyparse): Calls changed accordingly.
17980
179811996-05-11 Richard Stallman <rms@gnu.org>
17982
17983 * Makefile.in (dist): Don't use $(srcdir).
17984
17985 * bison.simple (__yy_memcpy):
17986 Really reorder the args, as was supposedly done on Feb 14 1995.
17987 (yyparse): Calls changed accordingly.
17988
179891996-01-27 Richard Stallman <rms@gnu.org>
17990
17991 * src/output.c (output_rule_data):
17992 Test YYERROR_VERBOSE in the conditional
17993 around the definition of ttyname.
17994
179951995-12-29 Richard Stallman <rms@gnu.org>
17996
17997 * src/bison.s1:
17998 Fix line numbers in #line commands.
17999
180001995-12-29 Richard Stallman <rms@gnu.org>
18001
18002 * bison.simple:
18003 Fix line numbers in #line commands.
18004
180051995-12-27 Richard Stallman <rms@gnu.org>
18006
18007 * src/bison.s1 (YYPARSE_PARAM_DECL):
18008 In C++, make it always null.
18009 (YYPARSE_PARAM_ARG): New macro.
18010 (yyparse): Use YYPARSE_PARAM_ARG.
18011
180121995-12-27 Richard Stallman <rms@gnu.org>
18013
18014 * bison.simple (YYPARSE_PARAM_DECL):
18015 In C++, make it always null.
18016 (YYPARSE_PARAM_ARG): New macro.
18017 (yyparse): Use YYPARSE_PARAM_ARG.
18018
180191995-11-29 Richard Stallman <rms@gnu.org>
18020
18021 * doc/bison.texinfo:
18022 Describe literal string tokens, %raw, %no_lines, %token_table.
18023
180241995-11-29 Daniel Hagerty <hag@gnu.org>
18025
18026 * doc/bison.texinfo: Fixed update date
18027
180281995-10-16 Richard Stallman <rms@gnu.org>
18029
18030 * src/version.c: Version 1.25.
18031
180321995-10-16 Richard Stallman <rms@gnu.org>
18033
18034 * NEWS: *** empty log message ***
18035
180361995-10-16 Richard Stallman <rms@gnu.org>
18037
18038 * doc/bison.1, doc/bison.rnh:
18039 Add new options.
18040
180411995-10-15 Richard Stallman <rms@gnu.org>
18042
18043 * src/vmsgetargs.c, src/getargs.c:
18044 Added -n, -k, and -raw switches.
18045 (noparserflag, toknumflag, rawtoknumflag): New variables.
18046
18047 * src/symtab.h (SALIAS):
18048 New #define for adding aliases to %token.
18049 (struct bucket): Added `alias' field.
18050
18051 * src/reduce.c (reduce_grammar):
18052 Revise error message.
18053 (print_notices): Remove final `.' from error message.
18054
18055 * src/reader.c (reader_output_yylsp):
18056 New function.
18057 (readgram): Use `#if 0' around code that accepted %command
18058 inside grammar rules: The documentation doesn't allow it,
18059 and it will fail since the %command processors scan for the next %.
18060 (parse_token_decl): Extended the %token
18061 declaration to allow a multi-character symbol as an alias.
18062 (parse_thong_decl): New function.
18063 (read_declarations): Added %thong declarations.
18064 (read_declarations): Handle NOOP to deal with allowing
18065 % declarations as another means to specify the flags.
18066 (readgram): Allow %prec prior to semantics embedded in a rule.
18067 (skip_to_char, read_declarations, copy_definition)
18068 (parse_token_decl, parse_start_decl, parse_type_decl)
18069 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
18070 (get_type_name, copy_guard, copy_action, readgram)
18071 (get_type, packsymbols): Revised most error messages.
18072 Changed `fatal' to `warnxxx' to avoid aborting for error.
18073 Revised and use multiple warnxxx functions to avoid using VARARGS1.
18074 (read_declarations): Improve the error message for
18075 an invalid character. Do not abort.
18076 (read_declarations, copy_guard, copy_action): Use
18077 printable_version to avoid unprintable characters in printed output.
18078 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
18079 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
18080 Allow the type of a non-terminal can be given
18081 more than once, as long as all specifications give the same type.
18082
18083 * src/output.c:
18084 (output_headers, output_trailers, output, output_gram)
18085 (output_rule_data): Implement noparserflag variable.
18086 Implement toknumflag variable.
18087 (output): Call reader_output_yylsp to output LTYPESTR.
18088
18089 * src/main.c (main):
18090 If reader sees an error, don't process the grammar.
18091 (fatals): Updated to not use VARARGS1.
18092 (printable_version, int_to_string, warn, warni, warns, warnss)
18093 (warnsss): New error reporting functions. Avoid abort for error.
18094
18095 * src/lex.h:
18096 Added THONG and NOOP for alias processing.
18097 Added SETOPT for the new code that allows setting options with %flags.
18098
18099 * src/lex.c:
18100 Include getopt.h. Add some extern decls.
18101 (safegetc): New function to deal with EOF gracefully.
18102 (literalchar); new function to deal with reading \ escapes.
18103 (lex): Use literalchar.
18104 (lex): Implemented "..." tokens.
18105 (literalchar, lex, parse_percent_token): Made tokenbuffer
18106 always contain the token. This includes growing the token
18107 buffer while reading an integer.
18108 (parse_percent_token): Replaced if-else statement with percent_table.
18109 (parse_percent_token): Added % declarations as another
18110 way to specify the flags -n, -l, and -r. Also added hooks for
18111 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
18112 major changes to files.c.
18113 (lex) Retain in the incoming stream a character following
18114 an incorrect '/'.
18115 (skip_white_space, lex): Revised most error messages
18116 and changed fatal to warn to avoid aborting.
18117 (percent_table): Added %thong declarations.
18118
18119 * src/gram.h: Comment changes.
18120
18121 * src/files.c (openfiles, open_extra_files, done):
18122 Add faction flag
18123 and actfile file. Handle noparserflag. Both for -n switch.
18124
18125 * src/conflicts.c (resolve_sr_conflict):
18126 Remove use of alloca.
18127
181281995-06-01 Jim Meyering <meyering@gnu.org>
18129
18130 * doc/bison.texinfo: *** empty log message ***
18131
181321995-05-06 Richard Stallman <rms@gnu.org>
18133
18134 * src/bison.s1: Comment change.
18135
181361995-05-06 Richard Stallman <rms@gnu.org>
18137
18138 * bison.simple: Comment change.
18139
181401995-05-03 Richard Stallman <rms@gnu.org>
18141
18142 * src/version.c: Version now 1.24.
18143
18144 * src/bison.s1: Change distribution terms.
18145
18146 * src/version.c: Version now 1.23.
18147
181481995-05-03 Richard Stallman <rms@gnu.org>
18149
18150 * doc/bison.texinfo:
18151 Rewrite "Conditions for Using Bison".
18152 Update version to 1.24.
18153
181541995-05-03 Richard Stallman <rms@gnu.org>
18155
18156 * bison.simple: Change distribution terms.
18157
181581995-02-23 Richard Stallman <rms@gnu.org>
18159
18160 * src/files.c: Test __VMS_POSIX as well as VMS.
18161
181621995-02-14 Jim Meyering <meyering@gnu.org>
18163
18164 * src/bison.s1 (__yy_memcpy):
18165 Renamed from __yy_bcopy to avoid
18166 confusion. Reverse FROM and TO arguments to be consistent with
18167 those of memcpy.
18168
181691995-02-14 Jim Meyering <meyering@gnu.org>
18170
18171 * bison.simple (__yy_memcpy):
18172 Renamed from __yy_bcopy to avoid
18173 confusion. Reverse FROM and TO arguments to be consistent with
18174 those of memcpy.
18175
181761994-11-10 David J. MacKenzie <djm@gnu.org>
18177
18178 * NEWS: reformat
18179
18180 * NEWS: New file.
18181
18182 * Makefile.in (DISTFILES): Include NEWS.
18183
18184 * Makefile.in (DISTFILES):
18185 Include install-sh, not install.sh.
18186
18187 * configure.in: Update to Autoconf v2 macro names.
18188
181891994-10-05 David J. MacKenzie <djm@gnu.org>
18190
18191 * Makefile.in: fix typo
18192
18193 * Makefile.in (prefix, exec_prefix):
18194 Let configure set them.
18195
181961994-09-28 David J. MacKenzie <djm@gnu.org>
18197
18198 * Makefile.in: Set datadir to $(prefix)/share.
18199
182001994-09-15 Richard Stallman <rms@gnu.org>
18201
18202 * src/bison.s1:
18203 Update copyright notice and GPL version.
18204
182051994-09-15 Richard Stallman <rms@gnu.org>
18206
18207 * bison.simple:
18208 Update copyright notice and GPL version.
18209
182101994-07-12 Richard Stallman <rms@gnu.org>
18211
18212 * src/reduce.c, src/reader.c:
18213 entered into RCS
18214
182151994-05-05 David J. MacKenzie <djm@gnu.org>
18216
18217 * Makefile.in: entered into RCS
18218
182191994-03-26 Richard Stallman <rms@gnu.org>
18220
18221 * src/bison.s1: entered into RCS
18222
182231994-03-26 Richard Stallman <rms@gnu.org>
18224
18225 * bison.simple: entered into RCS
18226
182271994-03-25 Richard Stallman <rms@gnu.org>
18228
18229 * src/main.c: entered into RCS
18230
182311994-03-24 Richard Stallman <rms@gnu.org>
18232
18233 * src/conflicts.c: entered into RCS
18234
182351994-01-02 Richard Stallman <rms@gnu.org>
18236
18237 * Makefile.in: *** empty log message ***
18238
182391993-11-21 Richard Stallman <rms@gnu.org>
18240
18241 * src/bison.s1: *** empty log message ***
18242
182431993-11-21 Richard Stallman <rms@gnu.org>
18244
18245 * doc/bison.texinfo: entered into RCS
18246
18247 * doc/bison.texinfo: *** empty log message ***
18248
182491993-11-21 Richard Stallman <rms@gnu.org>
18250
18251 * bison.simple: *** empty log message ***
18252
182531993-10-25 David J. MacKenzie <djm@gnu.org>
18254
18255 * doc/bison.texinfo: *** empty log message ***
18256
182571993-10-19 Richard Stallman <rms@gnu.org>
18258
18259 * src/bison.s1: *** empty log message ***
18260
182611993-10-19 Richard Stallman <rms@gnu.org>
18262
18263 * bison.simple: *** empty log message ***
18264
182651993-10-14 Richard Stallman <rms@gnu.org>
18266
18267 * src/bison.s1: *** empty log message ***
18268
182691993-10-14 Richard Stallman <rms@gnu.org>
18270
18271 * bison.simple: *** empty log message ***
18272
182731993-09-14 David J. MacKenzie <djm@gnu.org>
18274
18275 * doc/bison.texinfo: *** empty log message ***
18276
182771993-09-13 Noah Friedman <friedman@gnu.org>
18278
18279 * Makefile.in: *** empty log message ***
18280
182811993-09-10 Richard Stallman <rms@gnu.org>
18282
18283 * src/conflicts.c: *** empty log message ***
18284
18285 * src/system.h: entered into RCS
18286
182871993-09-10 Richard Stallman <rms@gnu.org>
18288
18289 * doc/bison.1: entered into RCS
18290
182911993-09-06 Noah Friedman <friedman@gnu.org>
18292
18293 * src/version.c: entered into RCS
18294
182951993-09-06 Noah Friedman <friedman@gnu.org>
18296
18297 * Makefile.in: *** empty log message ***
18298
182991993-07-30 David J. MacKenzie <djm@gnu.org>
18300
18301 * Makefile.in: *** empty log message ***
18302
183031993-07-24 Richard Stallman <rms@gnu.org>
18304
18305 * src/bison.s1: *** empty log message ***
18306
183071993-07-24 Richard Stallman <rms@gnu.org>
18308
18309 * bison.simple: *** empty log message ***
18310
183111993-07-08 David J. MacKenzie <djm@gnu.org>
18312
18313 * Makefile.in: *** empty log message ***
18314
183151993-07-04 Richard Stallman <rms@gnu.org>
18316
18317 * src/bison.s1: *** empty log message ***
18318
183191993-07-04 Richard Stallman <rms@gnu.org>
18320
18321 * bison.simple: *** empty log message ***
18322
183231993-06-26 David J. MacKenzie <djm@gnu.org>
18324
18325 * src/getargs.c: entered into RCS
18326
183271993-06-26 David J. MacKenzie <djm@gnu.org>
18328
18329 * doc/bison.texinfo: *** empty log message ***
18330
18331 * doc/bison.1: New file.
18332
183331993-06-25 Richard Stallman <rms@gnu.org>
18334
18335 * src/getargs.c: New file.
18336
183371993-06-16 Richard Stallman <rms@gnu.org>
18338
18339 * src/bison.s1: *** empty log message ***
18340
183411993-06-16 Richard Stallman <rms@gnu.org>
18342
18343 * bison.simple: *** empty log message ***
18344
183451993-06-03 Richard Stallman <rms@gnu.org>
18346
18347 * src/bison.s1: New file.
18348
183491993-06-03 Richard Stallman <rms@gnu.org>
18350
18351 * doc/bison.texinfo: *** empty log message ***
18352
183531993-06-03 Richard Stallman <rms@gnu.org>
18354
18355 * bison.simple: New file.
18356
183571993-05-19 Richard Stallman <rms@gnu.org>
18358
18359 * doc/bison.texinfo: New file.
18360
183611993-05-07 Noah Friedman <friedman@gnu.org>
18362
18363 * Makefile.in: *** empty log message ***
18364
183651993-04-28 Noah Friedman <friedman@gnu.org>
18366
18367 * src/reader.c: *** empty log message ***
18368
183691993-04-23 Noah Friedman <friedman@gnu.org>
18370
18371 * src/alloc.h: entered into RCS
18372
183731993-04-20 David J. MacKenzie <djm@gnu.org>
18374
18375 * src/version.c: *** empty log message ***
18376
18377 * src/files.c, src/allocate.c:
18378 entered into RCS
18379
18380 * src/reader.c: *** empty log message ***
18381
18382 * src/lex.c: entered into RCS
18383
18384 * src/conflicts.c: New file.
18385
18386 * src/symtab.c: entered into RCS
18387
18388 * src/alloc.h: New file.
18389
18390 * src/LR0.c: entered into RCS
18391
183921993-04-18 Noah Friedman <friedman@gnu.org>
18393
18394 * src/reader.c: New file.
18395
18396 * src/version.c: *** empty log message ***
18397
183981993-04-18 Noah Friedman <friedman@gnu.org>
18399
18400 * Makefile.in: *** empty log message ***
18401
184021993-04-17 Noah Friedman <friedman@gnu.org>
18403
18404 * Makefile.in: *** empty log message ***
18405
184061993-04-15 Richard Stallman <rms@gnu.org>
18407
18408 * src/main.c, src/files.c:
18409 New file.
18410
184111993-04-15 Noah Friedman <friedman@gnu.org>
18412
18413 * configure.in: entered into RCS
18414
18415 * configure.in: *** empty log message ***
18416
18417 * configure.in: New file.
18418
184191993-04-14 Richard Stallman <rms@gnu.org>
18420
18421 * Makefile.in: New file.
18422
184231993-04-13 Richard Stallman <rms@gnu.org>
18424
18425 * src/version.c: New file.
18426
184271993-03-25 Richard Stallman <rms@gnu.org>
18428
18429 * src/output.c: entered into RCS
18430
184311992-09-25 Richard Stallman <rms@gnu.org>
18432
18433 * configure.bat: entered into RCS
18434
184351992-06-22 Richard Stallman <rms@gnu.org>
18436
18437 * src/vmsgetargs.c: entered into RCS
18438
184391992-06-22 Richard Stallman <rms@gnu.org>
18440
18441 * doc/bison.rnh: entered into RCS
18442
184431992-04-20 David J. MacKenzie <djm@gnu.org>
18444
18445 * README: entered into RCS
18446
184471992-01-22 Richard Stallman <rms@gnu.org>
18448
18449 * src/machine.h: entered into RCS
18450
184511991-12-21 Richard Stallman <rms@gnu.org>
18452
18453 * src/lalr.c, src/closure.c:
18454 entered into RCS
18455
184561991-12-20 Richard Stallman <rms@gnu.org>
18457
18458 * src/state.h: entered into RCS
18459
184601991-12-18 Richard Stallman <rms@gnu.org>
18461
18462 * src/print.c, src/nullable.c, src/derives.c:
18463 entered into RCS
18464
184651991-11-03 David J. MacKenzie <djm@gnu.org>
18466
18467 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
18468 entered into RCS
18469
184701988-09-09 Richard Stallman <rms@gnu.org>
18471
18472 * src/bison.hairy: entered into RCS
18473
184741987-12-16 Richard Stallman <rms@gnu.org>
18475
18476 * REFERENCES: entered into RCS
dc546b0f 18477
f294a2c2 18478
04098407 18479 -----
f294a2c2 18480
04098407 18481 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
95021767
JD
18482 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
18483 Free Software Foundation, Inc.
f294a2c2 18484
04098407
PE
18485 Copying and distribution of this file, with or without
18486 modification, are permitted provided the copyright notice and this
18487 notice are preserved.
e9071366
AD
18488
18489$Id$