]> git.saurik.com Git - bison.git/blob - ChangeLog
50f5ed1f13a771164063b7192a5e4b3f0438f153
[bison.git] / ChangeLog
1 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 Remove quotes from variables names in %define directives and from
4 qualifiers in %code directives, and restrict the characters that are
5 allowed in them to M4-friendly ones. For %define, continue to support
6 the quoted form as a deprecated feature. Discussed starting at
7 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
8 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
9 %code.
10 * doc/bison.texinfo (Prologue Alternatives): Update.
11 (Bison Declaration Summary): In %defines entry, update mention of
12 `%code requires' and `%code provides'.
13 (C++ Location Values): Update %define uses.
14 (Calc++ Parser Interface): Likewise.
15 (Calc++ Parser): Likewise, and update `%code requires' uses.
16 (Bison Symbols): Update %code documentation.
17 * src/parse-gram.y (prologue_declaration): For %define variables, use
18 `variable' instead of `STRING'.
19 (grammar_declaration): For %code qualifiers, use `ID' instead of
20 `STRING'.
21 (variable): New nonterminal that takes an `ID' or a `STRING'.
22 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
23 and %define uses.
24 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
25 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
26 (%define errors): Update %define uses.
27
28 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
29
30 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
31 instead of muscle_insert for %define values so that M4-special
32 characters are replaced with digraphs.
33 * tests/input.at (%define errors): Extend to check weird values.
34
35 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
36
37 Instead of having skeletons declare all valid %define variables and
38 %code qualifiers, provide macros that retrieve the associated values
39 and build these lists automatically. Thus Bison will now warn when a
40 variable or qualifier is not used by the skeleton in the current
41 invocation regardless of whether it might sometimes be used by that
42 skeleton in other invocations. Also, move all %define value macros to
43 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
44 form, which is replaced by %code.
45 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
46 (b4_check_user_names): ... this, and change the series of valid name
47 arguments to a single list argument for names used in the skeleton
48 similar to the existing list argument for names used in the grammar.
49 Warn instead of complaining.
50 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
51 values and %code code, to format %code code properly, and to build
52 lists of all %define variables and %code qualifiers used in the
53 skeleton: b4_skeleton_percent_define_variables and
54 b4_skeleton_percent_code_qualifiers.
55 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
56 Remove, and...
57 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
58 the skeleton names lists can finish building first. In place of
59 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
60 expect the lists b4_user_percent_define_variables and
61 b4_user_percent_code_qualifiers.
62 * data/c++.m4: Where setting default values for b4_parser_class_name,
63 b4_location_type, b4_filename_type, b4_namespace, and
64 b4_define_location_comparison, update their names to the
65 b4_percent_define_ namespace.
66 * data/glr.c: Don't use b4_check_percent_define_variables and
67 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
68 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
69 (b4_parser_class_name, b4_namespace): Define these using
70 b4_get_percent_define for parser_class_name and namespace. Normally
71 this would be a bad idea since there might be cases when the variables
72 aren't used, but these variables are too pervasive in these skeletons
73 for that to be a problem.
74 * data/location.cc: Use b4_get_percent_define.
75 * data/push.c: Don't use b4_check_percent_define_variables and
76 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
77 * data/yacc.c: Likewise, and don't call m4_exit in
78 b4_use_push_for_pull_if or m4_wrap code will never execute.
79 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
80 Rename to...
81 (muscle_grow_user_name_list): ... this for consistency with the
82 terminology used in bison.m4.
83 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
84 %define variable names, and rename muscle used_percent_define_variables
85 to user_percent_define_variables.
86 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
87 user_percent_code_qualifiers.
88 (content): Remove.
89 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
90 {CODE} form is no longer accepted.
91 * tests/input.at (Reject bad %code qualifiers): Rename to...
92 (Reject unused %code qualifiers): ... this, and update test output.
93 (%define error): Update test output.
94
95 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
96
97 Check for unrecognized %define variables similar to checking for
98 unrecognized %code qualifiers. Check for redefined %define variables.
99 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
100 generalizes...
101 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
102 (b4_check_percent_define_variables): New, also wraps it.
103 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
104 variables using b4_check_percent_define_variables.
105 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
106 all those exercised in the test suite and all those listed in the
107 `Default values' section of c++.m4. Are there others?
108 * data/push.c, data/yacc.c: Declare no valid %define variables.
109 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
110 similar to muscle_find, but it works even when the muscle stores a
111 const value.
112 (muscle_grow_used_name_list): New function for constructing the used
113 name list muscles that b4_check_for_unrecognized_names requires.
114 * src/parse-gram.y (prologue_declaration): Warn if a variable is
115 %define'd more than once. Define the b4_used_percent_define_variables
116 muscle with muscle_grow_used_name_list.
117 (grammar_declaration): Abbreviate %code code with
118 muscle_grow_used_name_list.
119 * tests/input.at (%define errors): New.
120
121 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
122
123 Provide warn_at, complain_at, and fatal_at function callbacks to the
124 skeletons, and use this for %code qualifier complaints.
125 * data/bison.m4 (b4_error_at): New, invoked by...
126 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
127 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
128 @fatal_at(...@) directives.
129 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
130 qualifiers in b4_used_percent_code_qualifiers and to use
131 b4_complain_at.
132 * src/location.c, src/location.h (boundary_set_from_string): New global
133 function.
134 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
135 function.
136 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
137 to b4_used_percent_code_qualifiers.
138 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
139 function.
140 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
141 (lineno): Rename to...
142 (out_lineno): ... this so I don't misunderstand it again.
143 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
144 here; these newlines are in the input but not the output file.
145 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
146 (at_directive_perform): ... this new static function, and add handling
147 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
148 directives.
149 * tests/input.at (Reject bad %code qualifiers): Update test output with
150 locations and extend.
151
152 * tests/output.at (Output file name: [, Output file name: ]): Remove
153 bogus comment about these tests failing.
154
155 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
156
157 Clean up b4_check_percent_code_qualifiers a little.
158 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
159 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
160 documentation and add examples.
161 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
162 qualifiers here.
163
164 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
165
166 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
167 unreliable -- especially when they're hidden inside another macro.
168 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
169 data/c.m4: Remove m4_divert(-1).
170 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
171 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
172 m4_divert_push(0) and m4_divert_pop(0).
173 * data/output.c (output_skeleton): Don't add an m4_divert_push(0) and
174 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
175 pushed and popped by m4sugar, should be first on the stack.
176
177 Provide warn, complain, and fatal function callbacks to the skeletons.
178 This provides more flexibility than m4_fatal, improves the error
179 message format, and captures messages for translation. Discussed
180 starting at
181 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
182 * data/bison.m4 (b4_error): New, invoked by...
183 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
184 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
185 directives. Because these M4 macros might be called when the current
186 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
187 the previous removal of uses of m4_divert, which caused trouble.
188 (b4_check_percent_code_qualifiers): Use b4_complain instead of
189 m4_fatal to report unrecognized %code qualifiers.
190 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
191 push parser requests.
192 * data/glr.c: Use b4_complain instead of m4_fatal to report
193 non-deterministic push parser requests.
194 Update @output usage to @output(...@) form.
195 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
196 report missing %defines. Update @output usage to @output(...@) form.
197 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
198 @output(...@) form.
199 * src/main.c (main): Invoke skel_scanner_free.
200 * src/scan-skel.h (skel_scanner_free): Prototype new function.
201 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
202 obstack_for_string from flex-scanner.h.
203 (YY_DECL): Use to declare skel_lex static.
204 (decode_at_digraphs): Remove; now handled in the new
205 SC_AT_DIRECTIVE_ARG start condition.
206 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
207 functions.
208 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
209 at_directive_argv): New static globals.
210 (INITIAL): Use fail_for_invalid_at.
211 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
212 recognize the start of a generalized `@directive(...@)' form and
213 start...
214 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
215 directive args (using the new obstack_for_string), to decode the
216 contained @ diagraphs, and to perform the directive. It recognizes
217 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
218 @output(...@).
219 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
220 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
221 `@,'.
222 (scan_skel): Initialize obstack_for_string on the first call.
223 (skel_scanner_free): New function to free obstack_for_string.
224 * tests/input.at (Reject bad %code qualifiers): Update test output.
225
226 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
227
228 Consolidate the 4 prologue alternative directives (%code, %requires,
229 %provides, and %code-top) into a single %code directive with an
230 optional qualifier field. Discussed at
231 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
232 * NEWS (2.3a+): Rewrite the existing entry for the prologue
233 alternatives.
234 * doc/bison.texinfo (Prologue Alternatives): Update.
235 (Decl Summary): Update to %code "requires" and %code "provides".
236 (Calc++ Parser): Update to %code "requires".
237 (Bison Symbols): Remove entries for %requires, %provides, and
238 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
239 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
240 are replaced by b4_percent_code_provides and b4_percent_code_requires,
241 which are skeleton-specific.
242 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
243 declare what %code qualifiers it supports and to complain if any other
244 qualifiers were used in the grammar.
245 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
246 and b4_user_code([b4_percent_code_provides]) in place of
247 b4_user_requires and b4_user_provides.
248 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
249 Add b4_user_code([b4_percent_code_top]) and
250 b4_user_code([b4_percent_code]).
251 Invoke b4_check_percent_code_qualifiers.
252 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
253 PERCENT_REQUIRES): Remove.
254 (grammar_declaration): Remove RHS's for %code-top, %provides, and
255 %requires. Rewrite the %code RHS as the unqualified form defining the
256 muscle b4_percent_code. Add another RHS for the qualified %code form,
257 which defines muscles of the form b4_percent_code_QUALIFIER and the
258 b4_used_percent_code_qualifiers muscle.
259 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
260 PERCENT_REQUIRES): Remove.
261 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
262 %code "requires" and %code "provides".
263 * tests/input.at (Reject bad %code qualifiers): New.
264
265 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
266
267 Use the new code_props interface for destructors and printers.
268 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
269 printer_location members, and change the type of the destructor and
270 printer members to code_props.
271 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
272 symbol_printer_get, semantic_type_destructor_set,
273 semantic_type_printer_set, default_tagged_destructor_set,
274 default_tagless_destructor_set, default_tagged_printer_set,
275 default_tagless_printer_set): Use code_props in arguments and return
276 types in place of char const * and location.
277 (symbol_destructor_location_get, symbol_printer_location_get): Remove
278 since the locations are now contained in the return of
279 symbol_destructor_get and symbol_printer_get.
280 * src/output.c (symbol_destructors_output, symbol_printers_output):
281 Replace with...
282 (symbol_code_props_output): ... this to eliminate duplicate code.
283 (output_skeleton): Update to use symbol_code_props_output.
284 * src/reader.c (symbol_should_be_used): Update use of
285 symbol_destructor_get.
286 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
287 Update uses of the various _destructor_set and _printer_set functions.
288 * src/symtab.c: (default_tagged_destructor_location,
289 default_tagless_destructor_location, default_tagged_printer_location,
290 default_tagless_printer_location): Remove since we...
291 (default_tagged_destructor, default_tagless_destructor,
292 default_tagged_printer, default_tagless_printer): ... change the type
293 of these to code_props.
294 (symbol_new, semantic_type_new, symbol_destructor_set,
295 semantic_type_destructor_set, symbol_destructor_get,
296 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
297 symbol_check_alias_consistency, default_tagged_destructor_set,
298 default_tagless_destructor_set, default_tagged_printer_set,
299 default_tagless_printer_set): Update.
300 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
301 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
302 code_props members.
303 (symbol_print): Use SYMBOL_CODE_PRINT.
304
305 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
306
307 Use the new code_props interface for rule actions.
308 * src/symlist.h (symbol_list): Replace action, action_location, and
309 used members with a code_props action_props member.
310 * src/reader.c (symbol_should_be_used, grammar_rule_check,
311 grammar_midrule_action, grammar_current_rule_merge_set,
312 grammar_current_rule_symbol_append, packgram): Update.
313 * src/scan-code.h (translate_rule_action): Remove, no longer used.
314 * src/scan-code.l (handle_action_dollar): Update.
315 (translate_rule_action): Remove, no longer used.
316 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
317
318 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
319
320 Use the new code_props interface in parse-gram.y.
321 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
322 Update all uses of translate_* functions to use the new code_props
323 interface and to use gram_scanner_last_string_free and
324 code_scanner_last_string_free where possible.
325 (grammar_declaration): symbol_list_destructor_set and
326 symbol_list_printer_set now perform the translation, so don't do it
327 here. Use gram_scanner_last_string_free where possible.
328 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
329 translate_code): Remove, no longer used.
330 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
331 symbol_list_printer_set): Perform code translation here rather than
332 depending on the caller to do so.
333
334 * src/symlist.h (struct symbol_list): Correct some documentation typos.
335 * src/scan-gram.h (gram_last_string): Remove declaration.
336 * src/scan-gram.l (last_string): Declare it static.
337
338 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
339
340 Encapsulate code properties and related functionality for the various
341 destructors, printers, and actions into a code_props structure and
342 interface. This patch merely implements code_props in scan-code.h and
343 scan-code.l. Future patches will rewrite other modules to use it.
344 Discussed starting at
345 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
346 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
347 consistently initialize const structs that have an empty location
348 field.
349 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
350 to ensure consistency.
351 * src/scan-code.h (code_props): New structure.
352 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
353 function, macro, and const global variable for initializing a
354 code_props with no code.
355 (code_props_plain_init, code_props_symbol_action_init,
356 code_props_rule_action_init, code_props_translate_code): The rest of
357 the new code_props functional interface. Among other things, the init
358 functions set the code_props kind field so that
359 code_props_translate_code will know whether to behave like
360 translate_symbol_action, translate_rule_action, or translate_code.
361 These old translate functions must remain until all other modules are
362 updated to use the new code_props interface.
363 (code_scanner_last_string_free): New function similar to
364 gram_scanner_last_string_free.
365 (code_scanner_free): Add documentation.
366 * src/scan-code.l: Implement the new interface.
367 (code_lex): Make it static, add a code_props* argument, and remove the
368 rule argument.
369 (last_string): New static global similar to the one in scan-gram.l.
370 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
371 instead of rule.
372 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
373 code_props since Bison may one day use this information for destructors
374 and printers.
375 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
376 (handle_action_dollar): Use symbol_list_n_get and set used flag
377 directly since symbol_list_n_used_set is removed.
378 (translate_action): Add a code_props* argument and remove the rule,
379 action, and location arguments. Pass the code_props* on to code_lex.
380 (translate_rule_action, translate_symbol_action, translate_code):
381 Rewrite as wrappers around the new code_props interface.
382 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
383 it would eventually need to break the encapsulation of code_props.
384
385 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
386
387 * etc/.cvsignore: New.
388
389 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
390
391 Add maintainer-push-check to run maintainer-check using push parsing in
392 place of pull parsing where available.
393 * Makefile.am (maintainer-push-check): New.
394 * data/bison.m4 (b4_use_push_for_pull_if): New.
395 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
396 appropriately based on their existing values.
397 (yypush_parse): Don't print push-parser-specific diagnostics if push
398 parsing is being used in place of pull parsing.
399 * data/yacc.c: If push parsing should replace pull parsing, redirect to
400 push.c.
401 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
402 variable, and insert b4_use_push_for_pull_flag into muscles.
403 * tests/Makefile.am (maintainer-push-check): New.
404
405 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
406
407 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
408 (whether successful or failed) so that yypush_parse can be invoked
409 again to start a new parse using the same yypstate.
410 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
411 check multiple yypull_parse invocations on the same yypstate. For pull
412 mode, extend to check multiple yyparse invocations.
413 (Exploding the Stack Size with Alloca): Extend to try with
414 %push-pull-parser.
415 (Exploding the Stack Size with Malloc): Likewise.
416
417 * tests/calc.at (Simple LALR Calculator): Don't specify
418 %skeleton "push.c" since %push-pull-parser implies that now.
419 * tests/headers.at (export YYLTYPE): Don't check for the push
420 declarations. Otherwise, this test case can't be used to see if push
421 mode can truly emulate pull mode.
422 * tests/input.at (Torturing the Scanner): Likewise.
423 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
424 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
425 AT_YACC_IF, which now includes the case of push mode since %skeleton
426 need not be used for push mode. This will be more intuitive once
427 push.c is renamed to yacc.c.
428
429 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
430
431 For push mode, convert yyparse from a macro to a function, invoke yylex
432 instead of passing a yylexp argument to yypull_parse, and don't
433 generate yypull_parse or yyparse unless %push-pull-parser is declared.
434 Discussed starting at
435 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
436 * data/bison.m4 (b4_pull_if): New.
437 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
438 * data/push.c: Improve M4 quoting a little.
439 (b4_generate_macro_args, b4_parenthesize): Remove.
440 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
441 any time a pull parser is requested.
442 Don't #define this as a wrapper around yypull_parse. Instead, when
443 both push and pull are requested, make it a function that does that
444 same thing.
445 (yypull_parse): If there's a b4_prefix, #define this to
446 b4_prefix[pull_parse] when both push and pull are requested.
447 Don't define this as a function unless both push and pull are
448 requested.
449 Remove the yylexp argument and hard-code yylex invocation instead.
450 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
451 %push-parser.
452 * src/getargs.c (pull_parser): New global initialized to true.
453 * getargs.h (pull_parser): extern it.
454 * src/output.c (prepare): Insert pull_flag muscle.
455 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
456 (prologue_declaration): Set both push_parser and pull_parser = true for
457 %push-pull-parser. Set push_parser = true and pull_parser = false for
458 %push-parser.
459 * src/scan-gram.l: Don't accept %push_parser as an alternative to
460 %push-parser since there's no backward-compatibility concern here.
461 Scan %push-pull-parser.
462 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
463 instead of %push-parser.
464 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
465 prototype it in the module that calls yyparse.
466 * tests/input.at (Torturing the Scanner): Likewise.
467 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
468
469 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
470
471 Update etc/bench.pl. Optimize push mode a little (the yyn change
472 deserves most of the credit).
473 * Makefile.am (SUBDIRS): Add etc subdirectory.
474 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
475 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
476 yytoken, yyval, and yyloc declarations to...
477 (yyparse or yypush_parse): ... here to improve performance. For
478 yypush_parse invocations after the first, be sure to assign yyn its old
479 value again.
480 (yypstate_new): Don't bother initializing the yyresult field since the
481 initial value isn't used.
482 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
483 remove the #define that, in push mode, set it to yyps->NAME.
484 * etc/Makefile.am: New.
485 * etc/bench.pl: Remove and build it instead from...
486 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
487 "tests/bison" from the build directory by default rather than just
488 invoking "bison" from $PATH.
489 (calc_grammar): Update push parser code: don't declare yylval globally,
490 don't define yyparse_wrapper, and don't #define yyparse.
491 (bench_grammar): Update to check all working combinations of yacc.c,
492 push.c, impure, pure, pull, and push.
493
494 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
495
496 For push mode, add pull wrappers around yypush_parse.
497 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
498 (yypull_parse): New function wrapping yypush_parse.
499 (yyparse): New #define wrapping yypull_parse.
500 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
501 is declared.
502 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
503 prototype yylex in the module that calls yyparse, and don't prototype
504 yyparse there. Otherwise, the yyparse expansion won't compile.
505 * tests/input.at (Torturing the Scanner): Likewise.
506
507 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
508
509 Enable push parsers to operate in impure mode. Thus, %push-parser no
510 longer implies %pure-parser. The point of this change is to move
511 towards being able to test the push parser code by running the entire
512 test suite as if %push-parser had been declared.
513 * data/push.c (yypush_parse): For impure mode, remove the
514 yypushed_char, yypushed_val, and yypushed_loc arguments.
515 Instead, declare these as local variables initialized to the global
516 yychar, yylval, and yylloc.
517 For the first yypush_parse invocation only, restore the initial values
518 of these global variables when it's time to read a token since they
519 have been overwritten.
520 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
521 %push-parser.
522 * tests/calc.at (Simple LALR(1) Calculator): Always declare
523 %pure-parser along with %push-parser since this test case was designed
524 for pure push parsers.
525 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
526 (AT_YACC_OR_PUSH_IF): New.
527 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
528 add a note that it's still wrong for some cases (as it has been for a
529 while).
530 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
531 %push-parser no longer implies %pure-parser.
532
533 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
534
535 Remove some unnecessary differences between the pull parser code and
536 the push parser code. This patch enables yynerrs in push mode.
537 * data/push.c: Reformat M4 a little.
538 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
539 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
540 because push mode is on. Instead, if pure mode is on, move yynerrs
541 to...
542 (b4_declare_parser_state_variables): ... here.
543 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
544 to yyps->NAME so it can be used in yypush_parse.
545 (yypush_parse): Don't omit uses of yynerrs in push mode.
546
547 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
548
549 Fix bug such that the first pushed token's value and location are
550 sometimes overwritten (sometimes by %initial-action) before being used.
551 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
552 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
553 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
554 more closely mimic the pull parser logic.
555 Don't copy the pushed token to yychar, yylval, and yylloc until it's
556 time to read a token, which is after any initialization of yylval and
557 yylloc.
558 (gottoken): Rename label to...
559 (yyread_pushed_token): ... for clarity and to avoid infringing on the
560 user namespace.
561
562 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
563
564 Rearrange initialization of the parser state variables so that the
565 skeleton doesn't have to have a copy for pull mode and another for push
566 mode. This patch also fixes at least a bug such that yylloc was not
567 initialized (with b4_location_initial_line and
568 b4_location_initial_column) upon calling yypush_parse. However, that
569 initialization now overwrites the first token's location;
570 %initial-action assigning @$ already did the same thing, and both bugs
571 will be fixed in a later patch.
572 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
573 (b4_declare_parser_state_variables): Remove initialization of yytoken,
574 yyss, yyvs, yyls, and yystacksize.
575 (yypstate_new): Remove initialization of some yypstate fields: yystate,
576 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
577 yylsp.
578 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
579 yyps->NAME so it can be used in yypush_parse.
580 (yyparse or yypush_parse): For yypush_parse, don't print the
581 "Starting parse" diagnostic for invocations after the first.
582 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
583 yypush_parse, only do it for the first invocation.
584 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
585 initialization to occur in yypush_parse but only on the first
586 invocation.
587
588 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
589
590 * data/push.c: Add CPP guards around push parser declarations in both
591 the header and the code file.
592 In the code file, move the push parser declarations to the same place
593 they appear in the header file.
594 Clean up the M4 some, especially the inconsistent underquoting in
595 some b4_c_function_def and b4_c_function_decl uses.
596
597 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
598
599 Encapsulate the push parser state variables into an M4 macro so the
600 push skeleton doesn't have to list them again for pull mode's yyparse.
601 For push mode, remove yypush_parse's local equivalents of these
602 variables to eliminate unnecessary copying between the two sets at
603 run-time. This patch also fixes at least a bug related to multiple
604 %initial-action invocations in push mode.
605 * data/push.c (b4_declare_parser_variables): Rename to...
606 (b4_declare_scanner_communication_variables): ... this for clarity and
607 update both uses.
608 (b4_declare_yyparse_variables): Remove and move its contents to the one
609 spot where it was invoked.
610 (b4_declare_parser_state_variables): New macro containing the parser
611 state variables required by push mode.
612 (struct yypstate): Replace all fields but yynew with
613 b4_declare_parser_state_variables.
614 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
615 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
616 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
617 (yyparse or yypush_parse): For yyparse in pull mode, replace local
618 parser state variable declarations with
619 b4_declare_parser_state_variables.
620 Don't initialize parser state variables when calling yypush_parse since
621 yypstate_new already does that.
622 Invoke the user's initial action only upon the first yypush_parse
623 invocation.
624 Remove all code that copies between the local parser state variables
625 and the yypstate.
626
627 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
628
629 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
630 prevent a name collision in a future patch where these names will
631 sometimes be #define'd.
632 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
633 since it no longer has the same name as the existing argument.
634 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
635
636 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
637 and Joel E. Denny <jdenny@ces.clemson.edu>
638
639 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
640 that the argument is case-insensitive, and there's no `=' here.
641 For the %skeleton entry, mention that %language is better.
642 (Bison Options): Likewise for --language and --skeleton. Move the
643 --skeleton entry so that the `Tuning the parser' section is sorted
644 alphabetically on long options.
645 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
646 %language directive in detail here; cross-reference the %language
647 documentation instead.
648 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
649 `%require "2.3b"' so that the example is always up-to-date.
650 (Bison Symbols): Add entries for %language and %skeleton.
651 * examples/extexi (normalize): Instead of replacing every %require
652 argument with the current Bison version, just substitute for
653 `@value{VERSION}'. This guarantees that we're testing what actually
654 appears in the documentation.
655 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
656 rather than `@VERSION@'.
657
658 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
659
660 * NEWS: Reword the %language news a bit, and put it earlier.
661
662 * src/getargs.c (skeleton_arg): Last arg is now location const *.
663 Rewrite to simplify the logic.
664 (language_argmatch): Likewise.
665 (program_name): We now own this var.
666 * src/getargs.h (struct bison_language): Use char[] rather than
667 const char *.
668
669 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
670 Java is supported.
671 * src/complain.c (program_name): Remove decl; no longer needed.
672 * src/main.c (program_name): Remove; now belongs to getargs.
673
674 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
675
676 * NEWS: Document %language.
677
678 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
679
680 * data/c-skel.m4, data/c++-skel.m4: New files.
681 * data/glr.c: Complain on push parsers.
682
683 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
684 over %skeleton.
685 (Directives): Document %language and %skeleton.
686 (Command line): Document -L.
687
688 * examples/extexi: Rewrite %require directive.
689 * examples/calc++/Makefile.am: Pass VERSION to extexi.
690
691 * src/files.c (compute_exts_from_gc): Look in language structure
692 for .y extension.
693 (compute_file_name_parts): Check whether .tab should be added.
694 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
695 (language, skeleton_arg, language_argmatch): New.
696 (long_options): Add --language.
697 (getargs): Use skeleton_arg, add -L/--language.
698 * src/getargs.h: Include location.h.
699 (struct bison_language, language, skeleton_arg, language_argmatch): New.
700 * src/output.c (prepare): Pick default skeleton from struct language.
701 Don't dispatch C skeletons here.
702 * src/parse-gram.y (PERCENT_LANGUAGE): New.
703 (prologue_declaration): Add "%language" rule, use skeleton_arg.
704 * src/scan-gram.l ("%language"): New rule.
705
706 * tests/calc.at: Test %skeleton and %language.
707 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
708 (AT_GLR_IF): Look for %skeleton "glr.cc".
709 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
710 (AT_YACC_IF): Reject %language.
711
712 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
713
714 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
715 since it wasn't used; only the typedef name 'semantic_type' is needed.
716 Also, omit trailing white space.
717
718 * bootstrap: Sync from coreutils.
719 (gnulib_extra_files): Add build-aux/announce.gen.
720 (slurp): Adjust .gitignore files like .cvsignore files.
721 * build-aux/announce-gen: Remove from CVS, since bootstrap
722 now creates this.
723
724 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
725
726 Make %push-parser imply %pure-parser. This fixes several bugs; see
727 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
728 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
729 pure_parser = true.
730 * data/push.c: Don't bother testing b4_push_if when deciding whether
731 to expand b4_declare_parser_variables globally.
732 (yypush_parse): Likewise in here.
733
734 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
735 (yy_reduce_print): Reformat M4 for readability.
736
737 2006-12-15 Bob Rossi <bob@brasko.net>
738 and Joel Denny <jdenny@ces.clemson.edu>
739
740 * data/push.c (yypstate): Add typedef, and update all uses of
741 struct yypstate to just yypstate.
742 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
743
744 2006-12-14 Bob Rossi <bob@brasko.net>
745
746 * data/push.c (yypush_parse): Declare prototype regardless of
747 %locations option.
748
749 2006-12-14 Bob Rossi <bob@brasko.net>
750
751 * data/push.c (yyparse): Remove the prototype and the #define when in
752 push-parser mode.
753
754 2006-12-13 Bob Rossi <bob@brasko.net>
755
756 * data/push.c (yypstate_init): Rename to...
757 (yypstate_new): ... this and use b4_c_function_def.
758 (yypstate_delete): New.
759 (yypush_parse): Change parameters yynval and yynlloc to be const.
760 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
761 yypstate_delete functions.
762
763 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
764
765 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
766 strange test case titles. Reported by Bob Rossi.
767
768 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
769
770 * TODO: Add pointer to Sylvain Schmitz's work on static detection
771 of potential ambiguities in GLR grammers.
772
773 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
774
775 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
776 `bison ', use m4_index instead of m4_substr since chopping up a string
777 containing M4-special characters causes problems here.
778
779 Fix a couple of bugs related to special characters in user-specified
780 file names, and make it easier for skeletons to compute output file
781 names with the same file name prefix as Bison-computed output file
782 names.
783 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
784 b4_parser_file_name and b4_spec_defines_file instead of
785 @output_parser_name@ and @output_header_name@, which are now redundant.
786 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
787 b4_parser_file_name, b4_spec_defines_file, and the new
788 @basename(FILENAME@) instead of @output_parser_name@ and
789 @output_header_name@, which inappropriately escaped the file names as
790 C string literals.
791 * src/files.c (all_but_ext): Remove static qualifier.
792 (compute_output_file_names): Move `free (all_but_ext)' to...
793 (output_file_names_free): ... here since all_but_ext is needed later.
794 * src/files.h (all_but_ext): Extern.
795 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
796 exactly what MUSCLE_INSERT_STRING used to do.
797 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
798 characters are escaped properly.
799 * src/output.c (prepare): Define muscle file_name_all_but_ext as
800 all_but_ext.
801 For pkgdatadir muscle, maintain previous functionality by using
802 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
803 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
804 digraphs would never be expanded. Hopefully no one has M4-special
805 characters in his Bison installation path.
806 * src/scan-skel.l: Don't parse @output_header_name@ and
807 @output_parser_name@ anymore since they're now redundant.
808 In @output, use decode_at_digraphs.
809 Parse a new @basename command that invokes last_component.
810 (decode_at_digraphs): New.
811 (BASE_QPUTS): Remove unused.
812 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
813 (Output file name): New tests.
814
815 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
816
817 Warn about output files that are generated by the skeletons and that
818 conflict with other output files.
819 * data/glr.c: Don't generate the header file here when glr.cc does.
820 * src/files.c (file_names, file_names_count): New static globals.
821 (compute_output_file_names): Invoke output_file_name_check for files
822 not generated by the skeletons and remove existing checks.
823 (output_file_name_check): New function that warns about conflicting
824 output file names.
825 (output_file_names_free): Free file_names.
826 * src/files.h (output_file_name_check): Declare.
827 * src/scan-skel.l: Invoke output_file_name_check for files generated by
828 the skeletons.
829 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
830 (Conflicting output files): New tests.
831
832 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
833
834 * doc/bison.texinfo: Fix a couple of typos.
835
836 2006-12-08 Bob Rossi <bob@brasko.net>
837
838 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
839 Rename to...
840 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
841 update all uses.
842 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
843 (yypush_parse): Rename yypvars argument to yyps and remove redundant
844 local pv.
845 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
846 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
847
848 2006-12-07 Bob Rossi <bob@brasko.net>
849 and Joel Denny <jdenny@ces.clemson.edu>
850
851 * data/push.c (yypvarsinit): Change return type from void* to struct
852 yypvars*. No longer cast to void* on return.
853 (struct yypvars): Remove yylen since it need not be remembered between
854 yypushparse invocations.
855 (yypushparse): Don't copy between yylen and pv->yylen.
856
857 2006-12-05 Bob Rossi <bob@brasko.net>
858
859 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
860 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
861 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
862 (struct yypvars): Remove b4_declare_parser_variables.
863 (yypvarsinit): Remove init code for removed variables.
864 (global scope): Do not declare b4_declare_parser_variables if
865 push or pure mode.
866 (yypushparse): Add b4_declare_parser_variables.
867 Init new local variables, and remove init code for removed
868 yypvars variables.
869 (yyparse): Delete.
870 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
871 and yyparse for other modes.
872 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
873 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
874 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
875 (AT_PURE_LEX_IF): True if pure or push parser.
876
877 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
878
879 Document Yacc prologue alternatives and default %destructor's and
880 %printer's as experimental. Don't mention Java yet. Discussed at
881 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
882 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
883 (2.3a): Annotate this entry to say the old forms of these features were
884 also experimental.
885 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
886 Bison Symbols): Say they're experimental. Comment out any mention
887 of Java (we'll want this back eventually).
888
889 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
890
891 Support a file name argument to %defines. Deprecate `=' in
892 %file-prefix, %name-prefix, and %output. Discussed at
893 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
894 * NEWS (2.3a+): Mention.
895 * doc/bison.texinfo (Decl Summary, Bison Symbols): Add entry for new
896 form of %defines, and remove `=' from entries for %file-prefix,
897 %name-prefix, and %output.
898 * src/parse-gram.y (prologue_declaration): Implement.
899 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
900 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
901 all but one occurrence of %name-prefix.
902 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
903 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
904 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
905 occurrence of each of %file-prefix and %output. Add check for %defines
906 with argument.
907 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
908 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
909 Remove the `=' from %output.
910
911 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
912
913 Don't escape $ in test case titles since Autoconf 2.61 now does that
914 correctly.
915 * tests/actions.at (Default %printer and %destructor are not for error
916 or $undefined): Here.
917 (Default %printer and %destructor are not for $accept): Here.
918 * tests/input.at (Invalid $n and @n): Here.
919
920 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
921
922 Rename <!> to <>. Discussed starting at
923 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
924 * NEWS (2.3a+): Update.
925 * doc/bison.texinfo (Freeing Discarded Symbols, Bison Symbols):
926 Update.
927 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
928 * src/scan-gram.l (INITIAL): Implement.
929 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
930 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
931 comment.
932 * tests/actions.at (Default tagless %printer and %destructor,
933 Default tagged and per-type %printer and %destructor,
934 Default %printer and %destructor are not for error or $undefined,
935 Default %printer and %destructor are not for $accept,
936 Default %printer and %destructor for mid-rule values): Update.
937 * tests/input.at (Default %printer and %destructor redeclared,
938 Unused values with default %destructor): Update.
939
940 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
941
942 Don't let %prec take a nonterminal.
943 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
944 token.
945 * tests/input.at (%prec takes a token): New test checking that %prec
946 won't take a nonterminal.
947
948 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
949
950 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
951 it was double-quoted.
952 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
953 grammar is maintained with Bison's highest standards.
954 * src/getargs.c: Fix some typos in Doxygen comments.
955
956 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
957
958 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
959 later. Reported by Paul Eggert in
960 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
961 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
962 * src/scan-code.l (translate_action): Don't bother invoking
963 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
964 (code_scanner_free): Instead of invoking
965 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
966 which frees more.
967 * src/scan-gram.l (gram_scanner_free): Likewise.
968 * src/scan-skel.l (scan_skel): Likewise.
969
970 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
971
972 * src/files.c (tr): Change return type to void.
973 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
974 has been called previously for the same key.
975 (muscle_find): Return storage instead of value so that
976 --enable-gcc-warnings doesn't produce warnings that the return discards
977 const. aver that the value and storage are the same since storage
978 could potentially be NULL when value is not.
979 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
980 same as 0.
981
982 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
983
984 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
985 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
986 us a slightly cleaner distribution, and also works.
987 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
988 gnulib changes.
989
990 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
991 and Paul Eggert <eggert@cs.ucla.edu>
992
993 Don't let Bison leak memory except when it complains.
994 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
995 (spec_defines_file, dir_prefix): Now char *, not const char *,
996 since they are freed.
997 * src/files.c: Likewise.
998 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
999 Likewise.
1000 (tr): Now operates in-place. All uses changed.
1001 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
1002 values.
1003 (compute_file_name_parts, compute_output_file_names): Don't store
1004 read-only data in variables that will be freed.
1005 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
1006 src_extension, and header_extension.
1007 (output_file_names_free): New public function to free
1008 spec_verbose_file, spec_graph_file, spec_defines_file,
1009 parser_file_name, and dir_prefix.
1010 * src/getargs.c (getargs): Don't store read-only data in variables that
1011 will be freed.
1012 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
1013 (which previously existed but was unused), and quotearg_free.
1014 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
1015 * src/muscle_tab.c: Likewise.
1016 (muscle_entry): Make the value char const *,
1017 and add a new storage member that is char * and can be freed.
1018 (muscle_entry_free): New private function.
1019 (muscle_init): Use it instead of free.
1020 (muscle_insert, muscle_grow): Update and use new storage member.
1021 (muscle_code_grow): Free the string passed to muscle_grow
1022 since it's not needed anymore.
1023 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
1024 add a new `char *code' member.
1025 ("{...}"): Declare semantic type as code.
1026 * src/scan-code.h (translate_rule_action):
1027 (translate_symbol_action, translate_code, translate_action): Return
1028 `char const *' rather than `char *' since external code should not free
1029 these strings.
1030 * src/scan-code.l: Likewise.
1031 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
1032 which is "{...}" in the parser.
1033 * tests/Makefile.am (maintainer-check-valgrind): Set
1034 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
1035 Valgrind.
1036 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
1037 complain.
1038 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
1039 expecting a non-zero exit status sets --leak-check=summary and
1040 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
1041 this case, and we don't want to hear about it.
1042
1043 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
1044
1045 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
1046 instead of from the template, to simplify configuration a bit.
1047 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
1048 and m4/wint_t.m4, as they are needed with the latest gnulib.
1049
1050 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
1051
1052 Disable unset/unused mid-rule value warnings by default, and recognize
1053 --warnings=midrule-values to enable them. Discussed starting at
1054 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
1055 * NEWS (2.3a+): Mention.
1056 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
1057 warnings): Add entry for midrule-values subargument.
1058 * src/reader.c (symbol_should_be_used): Don't return true just because
1059 the value is a set/used mid-rule value unless
1060 --warnings=midrule-values was specified.
1061 * tests/input.at (Unused values, Unused values before symbol
1062 declarations): Run tests with and without --warnings=midrule-values.
1063
1064 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
1065 than LIST_FREE directly.
1066
1067 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
1068
1069 Finish implementing --warnings=error, which should not be implied by
1070 --warnings=all (or by its synonyms -W and --warnings without
1071 subarguments).
1072 * src/complain.c (set_warning_issued): New function to report that
1073 warnings are being treated as errors and to record an error if so.
1074 Invoke...
1075 (warn_at, warn): ... here.
1076 * src/getargs.c (warnings_args, warnings_types): Reorder so that
1077 "error - warnings are errors" does not appear above "all - all of the
1078 above".
1079 (getargs): For -W and --warnings without subarguments, don't let
1080 FLAGS_ARGMATCH set warnings_error in warnings_flag.
1081 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
1082
1083 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
1084
1085 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
1086 empty subargument list. For example: `bison --warnings= parser.y'.
1087
1088 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
1089
1090 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
1091 the parser header file so that gcc doesn't warn.
1092
1093 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
1094
1095 Split the default %destructor/%printer into two kinds: <*> and <!>.
1096 Discussed starting at
1097 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
1098 * NEWS (2.3a+): Mention.
1099 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
1100 previous change today related to mid-rules.
1101 (Bison Symbols): Remove %symbol-default and add <*> and <!>.
1102 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
1103 (TYPE_TAG_ANY): Add as <*>.
1104 (TYPE_TAG_NONE): Add as <!>.
1105 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
1106 for <*> and <!>.
1107 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
1108 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
1109 * src/symlist.c (symbol_list_default_new): Split into tagged and
1110 tagless versions.
1111 (symbol_list_destructor_set, symbol_list_printer_set): Split
1112 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
1113 SYMLIST_DEFAULT_TAGLESS.
1114 * src/symlist.h: Update symbol_list_default*_new prototypes.
1115 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
1116 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
1117 * src/symtab.c (default_destructor, default_destructor_location,
1118 default_printer, default_printer_location): Split each into tagged and
1119 tagless versions.
1120 (symbol_destructor_get, symbol_destructor_location_get,
1121 symbol_printer_get, symbol_printer_location_get): Implement tagged
1122 default and tagless default cases.
1123 (default_destructor_set, default_printer_set): Split each into tagged
1124 and tagless versions.
1125 * src/symtab.h: Update prototypes.
1126 * tests/actions.at (Default %printer and %destructor): Rename to...
1127 (Default tagless %printer and %destructor): ... this, and extend.
1128 (Per-type %printer and %destructor): Rename to...
1129 (Default tagged and per-type %printer and %destructor): ... this, and
1130 extend.
1131 (Default %printer and %destructor for user-defined end token): Extend.
1132 (Default %printer and %destructor are not for error or $undefined):
1133 Update.
1134 (Default %printer and %destructor are not for $accept): Update.
1135 (Default %printer and %destructor for mid-rule values): Extend.
1136 * tests/input.at (Default %printer and %destructor redeclared): Extend.
1137 (Unused values with default %destructor): Extend.
1138
1139 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
1140
1141 Don't apply the default %destructor/%printer to an unreferenced midrule
1142 value. Mentioned at
1143 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
1144 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
1145 like $@n instead of just @n so that the default %destructor/%printer
1146 logic doesn't see them as user-defined symbols.
1147 (symbol_is_dummy): Check for both forms of the name.
1148 * src/reader.c (packgram): Remove the `$' from each midrule symbol
1149 name for which the midrule value is referenced in any action.
1150 * tests/actions.at (Default %printer and %destructor for mid-rule
1151 values): New test.
1152 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
1153 for change to dummy symbol names.
1154
1155 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
1156
1157 Warn about unset midrule $$ if the corresponding $n is used.
1158 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
1159 $n usage.
1160 (packgram): Before invoking grammar_rule_check on any rule, make sure
1161 all actions have already been scanned in order to set `used' flags.
1162 Otherwise, checking that a midrule's $$ is set will not always work
1163 properly because the midrule check must forward-reference the midrule's
1164 parent rule.
1165 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
1166 warning.
1167
1168 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
1169
1170 More improvements to the documentation of the prologue alternatives:
1171 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
1172 Bison manual.
1173 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
1174 some text to clarify the relative importance of the new directives and
1175 to show how these directives may be viewed as code labels.
1176
1177 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
1178
1179 Similar to the recently removed %before-header, add %code-top as the
1180 alternative to the pre-prologue. Mentioned at
1181 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
1182 Also, let the prologue alternatives appear in the grammar section.
1183 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
1184 (prologue_declaration): Move the existing prologue alternatives to...
1185 (grammar_declaration): ... here and add %code-top.
1186 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
1187
1188 Clean up and extend documentation for the prologue alternatives.
1189 * NEWS (2.3a+): Describe prologue alternatives.
1190 * doc/bison.texinfo (Prologue): Move discussion of prologue
1191 alternatives to...
1192 (Prologue Alternatives): ... this new section, and extend it to discuss
1193 all 4 directives in detail.
1194 (Bison Symbols): Clean up discussion of prologue alternatives and add
1195 %code-top.
1196
1197 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1198
1199 DJGPP specific issues.
1200
1201 * djgpp/config.bat: config.hin has been moved to lib. Adjust
1202 config.bat accordingly.
1203 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
1204 * djgpp/config.site: Likewise.
1205
1206 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
1207
1208 Replace %*-header with %provides, %requires, %code. See discussion at
1209 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
1210
1211 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
1212 (b4_user_start_header): Remove.
1213 * data/glr.c: Use new macros instead of b4_*start_header
1214 and b4_*end_header.
1215 * data/glr.cc: Likewise.
1216 * data/lalr1.cc: Likewise.
1217 * data/push.c: Likewise.
1218 * data/yacc.c: Likewise.
1219
1220 * doc/bison.texinfo: Remove %before-header, rename
1221 %{start,end,after}-header to %requires, %provides, %code.
1222
1223 * src/parse-gram.y: Likewise (also rename token names accordingly).
1224 * src/scan-gram.l: Likewise.
1225 * tests/actions.at: Likewise.
1226
1227 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
1228
1229 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
1230 Problem reported by Joel E. Denny.
1231
1232 2006-10-14 Jim Meyering <jim@meyering.net>
1233
1234 (Sync from coreutils.)
1235 Work also when the working directory (with e.g. coreutils sources)
1236 is version controlled with git, rather than CVS.
1237 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
1238 rather than CVS.
1239 In messages and comments, say e.g., "checked-out sources",
1240 rather than "CVS sources".
1241 (version_controlled_file): New function. Work for git as well as
1242 for CVS. Don't use grep's -q option.
1243 (slurp): Call it here, in place of CVS-specific code.
1244
1245 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
1246
1247 Fix testsuite for ./configure --enable-gcc-warnings:
1248 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
1249 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
1250 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
1251 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
1252 * test/regression.at (Diagnostic that expects two alternatives):
1253 Likewise.
1254
1255 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
1256
1257 * bootstrap.conf (gnulib_modules): Add config-h.
1258 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
1259 worry about HAVE_CONFIG_H.
1260 * lib/abitset.c: Likewise.
1261 * lib/bitset.c: Likewise.
1262 * lib/bitset_stats.c: Likewise.
1263 * lib/bitsetv-print.c: Likewise.
1264 * lib/bitsetv.c: Likewise.
1265 * lib/ebitset.c: Likewise.
1266 * lib/get-errno.c: Likewise.
1267 * lib/lbitset.c: Likewise.
1268 * lib/subpipe.c: Likewise.
1269 * lib/timevar.c: Likewise.
1270 * lib/vbitset.c: Likewise.
1271 * lib/bitset.c: Include "bitset.h" first, to test interface.
1272 * lib/bitset_stats.c: Include "bitset_stats.h" first.
1273 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
1274 * lib/bitsetv.c: Include "bitsetv.h" first.
1275 * lib/get-errno.c: Include "get-errno.h" first.
1276 * m4/.cvsignore: Add config-h.m4.
1277 * tests/actions.at (Default %printer and %destructor for ...):
1278 Adjust expected line numbers in output to reflect removal of #if
1279 HAVE_CONFIG_H lines.
1280 * tests/glr-regression.at (Missed %merge type warnings when ...):
1281 Likewise.
1282 * tests/regression.at (Braced code in declaration in rules section):
1283 Likewise.
1284 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
1285 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
1286 Include <config.h> unconditionally.
1287
1288 * bootstrap: Sync from coreutils, as follows:
1289
1290 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
1291
1292 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
1293 variable was sometimes used without being initialized. This
1294 messed up the installation of the INSTALL file in some cases.
1295
1296 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
1297
1298 * bootstrap (usage, main program, symlink_to_gnulib): Add option
1299 --copy. Inspired by a suggestion from Bruno Haible.
1300
1301 2006-10-03 Jim Meyering <jim@meyering.net>
1302
1303 * bootstrap: Undo last change to this file, since now gnulib-tool
1304 sticks with the automake default in generating dependencies.
1305
1306 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
1307
1308 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
1309 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
1310
1311 * doc/bison.1: Add copyright notice.
1312
1313 * data/glr.c: Don't include <stdarg.h>; not used.
1314
1315 * NEWS: The -g and --graph options now output graphs in Graphviz
1316 DOT format, not VCG format.
1317 * doc/bison.1: Likewise.
1318 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
1319 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
1320 of this change in
1321 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
1322 * TODO: Remove Graphviz entry.
1323 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
1324 remove vcg.c, vcg.h, vcg_defaults.h.
1325 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
1326 * src/graphviz.c, src/graphviz.h: New files.
1327 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
1328 * src/files.h: Make comment more generic.
1329 * src/main.c (main): Likewise.
1330 * src/print_graph.h: Likewise.
1331 * src/getargs.c (usage): Make usage description more generic.
1332 * src/print_graph.c: Include graphviz.h rather than vcg.h.
1333 (static_graph, fgraph): Remove. All uses changed to pass
1334 arguments instead of sharing a static var.
1335 (print_core, print_actions, print_state, print_graph):
1336 Output graphviz format rather than VCG format.
1337 * tests/.cvsignore: Remove *.vcg; add *.dot.
1338 * tests/output.at: Expect *.dot files, not *.vcg files.
1339
1340 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
1341 accommodates the 2006-10-08 change.
1342
1343 2006-10-11 Bob Rossi <bob@brasko.net>
1344
1345 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
1346 (b4_yyssa, b4_yyerror_range): New macros.
1347 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
1348 (yypvarsinit): Remove init of removed fields.
1349 (yypushparse): Remove use of removed fields; use new macros instead.
1350
1351 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
1352
1353 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
1354 in a push parser. Reindent slightly to match yacc.c better.
1355
1356 2006-10-11 Bob Rossi <bob@brasko.net>
1357
1358 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
1359 yymsg_alloc fields.
1360 (yypvarsinit, yypushparse): Remove init of removed fields.
1361 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
1362
1363 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
1364
1365 * THANKS: Add Paolo Bonzini and Bob Rossi.
1366
1367 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
1368
1369 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
1370 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
1371 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
1372 b4_define_user_cde and uses): Remove.
1373 (b4_comment, b4_prefix, b4_sync_start): New.
1374 * data/bison.m4: New file, with most of the content removed from c.m4.
1375 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
1376 * src/output.c (output_skeleton): Pass bison.m4.
1377 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
1378 only if specified.
1379
1380 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
1381
1382 Fix test failure reported by Tom Lane in
1383 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
1384 and try to make such failures easier to catch in the future.
1385 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
1386 that's now the caller's responsibility.
1387 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
1388 Set yychar = YYEOF if it's negative.
1389 * tests/actions.at (yylex): Abort if asked to read past EOF.
1390 * tests/conflicts.at (yylex): Likewise.
1391 * tests/cxx-type.at (yylex): Likewise.
1392 * tests/glr-regression.at (yylex): Likewise.
1393 * tests/input.at (yylex): Likewise.
1394 * tests/regression.at (yylex): Likewise.
1395 * tests/torture.at (yylex): Likewise.
1396
1397 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
1398
1399 Fix problems with translating English-language diagnostics.
1400 * bootstrap: Fix bug introduced in recent bootstrap changes, with
1401 respect to bison-runtime pot generation. The YY_ stuff
1402 wasn't being captured.
1403 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
1404 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
1405 * runtime-po/POTFILES.in: Add data/push.c.
1406
1407 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
1408
1409 Merge bootstrap changes from coreutils.
1410
1411 2006-09-28 Jim Meyering <jim@meyering.net>
1412
1413 Automatically generated dependencies are important even
1414 when all of the sources in a directory come from gnulib.
1415 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
1416 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
1417
1418 2006-09-23 Jim Meyering <jim@meyering.net>
1419
1420 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
1421
1422 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1423
1424 * bootstrap: Add support for --force.
1425 (usage): New function. Describe usage less tersely.
1426 (CVS_only_file): New var.
1427
1428 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
1429
1430 * data/push.c (YYPUSH_MORE): Make it an enum instead.
1431 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
1432 Adjust white space and comments to match GNU style better.
1433
1434 2006-09-20 Bob Rossi <bob@brasko.net>
1435
1436 * data/push.c (yyresult_get): Remove function.
1437 (YYPUSH_MORE): Add #define.
1438 (yypushparse): Modify return value.
1439
1440 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1441
1442 * stamp-h.in: Remove; no longer needed.
1443 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
1444 Remove config.h, config.hin, intl (no longer created).
1445 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
1446 stamp-h1.
1447
1448 Sync bootstrap from coreutils, as follows:
1449
1450 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
1451
1452 * bootstrap (symlink_to_gnulib): New function.
1453 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
1454 to copies-of-gnulib.
1455 (cp_mark_as_generated, slurp, gnulib_files):
1456 Avoid making a copy if it's the same as the old version.
1457 (gnulib_files): Add support for this variable (used by Bison).
1458
1459 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
1460
1461 * src/getargs.c (usage): Rework to use conventions similar to
1462 coreutils, to make translation a bit easier and the code a bit
1463 smaller. Problem reported by Tim Van Holder.
1464
1465 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
1466
1467 Use some of gnulib's new modules, taken from coreutils.
1468
1469 * bootstrap: Sync from coreutils, except add support for gnulib_files.
1470 * bootstrap.conf: New file.
1471 (gnulib_modules): Add configmake, inttypes, unistd.
1472 (XGETTEXT_OPTIONS): Add complain, complain_at,
1473 fatal, fatal_at, warn, warn_at, unexpected_end.
1474 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
1475 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
1476 (gl_EARLY): Add.
1477 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
1478 (gl_INIT): Add
1479 (GNULIB_AUTOCONF_SNIPPET): Remove.
1480 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
1481 the pickiest.
1482 * lib/.cvsignore: Add inttypes_.h.
1483 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
1484 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
1485 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
1486 no-longer-necessary initializations.
1487 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
1488 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
1489 use the unistd module.
1490 * src/system.h: Likewise.
1491 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
1492 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
1493 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
1494 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
1495 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
1496 * src/system.h: Include inttypes.h unconditionally, now that we
1497 use the inttypes module. Don't bother to include stdint.h, since
1498 inttypes.h now does that for us.
1499 (LOCALEDIR): Remove, now that we use the configmake module.
1500 * src/getargs.c: Include configmake.h.
1501 * src/main.c: Likewise.
1502 * src/output.c: Likewise.
1503 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
1504 not from $abs_top_builddir, since config.h moved.
1505
1506
1507 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
1508 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
1509
1510 * src/parse-gram.y (symbol_declaration): Don't put statements
1511 before declarations; it's not portable to C89.
1512 * src/scan-code.l (handle_action_at): Likewise.
1513
1514 * src/scan-code.l: Always initialize braces_level; the old code
1515 left it uninitialized and therefore had undefined behavior.
1516
1517 Don't attempt to redefine 'assert', since it runs afoul of
1518 systems where standard headers (mistakenly) include <assert.h>.
1519 Instead, define and use our own alternative, called 'aver'.
1520 * src/reader.c: Don't include assert.h, since we no longer
1521 use assert.
1522 * src/scan-code.l: Likewise.
1523 * src/system.h (assert): Remove, replacing with....
1524 (aver): New function, taking a bool arg. All uses changed.
1525 * src/tables.c (pack_vector): Ensure that aver arg is bool,
1526 not merely an integer.
1527
1528 2006-09-15 Bob Rossi <bob@brasko.net>
1529
1530 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
1531 * data/c.m4 (YYPUSH): New.
1532 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
1533 * src/getargs.c (push_parser): New var.
1534 * src/getargs.h (push_parser): New declaration.
1535 * src/output.c (prepare): Add macro insertion of `push_flag'.
1536 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
1537 (prologue_declaration): Parse %push-parser.
1538 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
1539 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
1540 list of removed lines from the traces observed.
1541 (AT_CHECK_CALC_LALR): Added push parser tests.
1542
1543 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
1544
1545 * NEWS: Version 2.3a.
1546 * configure.ac (AC_INIT): Likewise.
1547
1548 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
1549 "#define YYSTYPE int" that caused "make maintainer-check" to fail
1550 due to header ordering dependencies. I don't know why the #define
1551 was there.
1552
1553 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
1554 runtime cost when YYDEBUG is not defined, and so that some tests
1555 that used to fail now work. Problem and initial suggestion by
1556 Paolo Bonzini.
1557 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
1558 * data/glr.cc (b4_parser_class_name):
1559 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
1560 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
1561 (yydebug_) [YYDEBUG]: New member.
1562 (yycdebug_): Now defined only if YYDEBUG.
1563 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
1564 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
1565 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
1566 if YYYDEBUG.
1567 (debug_stream, set_debug_stream, debug_level, set_debug_level):
1568 Define only if YYDEBUG.
1569 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
1570 set_debug_level.
1571 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
1572 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
1573 AT_CHECK_CALC_GLR_CC that are working now.
1574
1575 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
1576
1577 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
1578 We don't need them in glr.cc, and glr.c defines them.
1579 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
1580 assumes that defining it to anything is the same as defining
1581 it to 1. Problem reported by Paolo Bonzini.
1582
1583 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
1584
1585 * data/c.m4 (b4_null, b4_case): Define.
1586 * src/output.c (prepare_symbols): Use b4_null.
1587 (user_actions_output): Use b4_case.
1588
1589 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
1590
1591 * data/glr.c (b4_shared_declarations): Put start-header first,
1592 before any #includes that we generate, so that feature-test
1593 macros work. Problem reported by Michael Deutschmann in
1594 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
1595 * data/lalr1.cc: Likewise.
1596 * doc/bison.texinfo (Prologue): Document that feature-test macros
1597 should be defined before any Bison declarations.
1598 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
1599 that depend on location.hh after, not before, Bison decls, since
1600 we now include location.hh after the first user prologue.
1601
1602 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
1603 Sander Brandenburg in
1604 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
1605 Also, fix minor white space and comment issues.
1606 (Prologue): Mention that it's better to define feature-test macros
1607 before Bison declarations. Problem reported by Michael Deutschmann.
1608
1609 * README-cvs: Fix typo: "&" should be "&&". Problem reported
1610 by Jim Meyering.
1611 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
1612 This adjusts to recent gnulib changes.
1613
1614 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
1615
1616 Finish implementation of per-type %destructor/%printer. Discussed
1617 starting at
1618 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
1619 and
1620 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
1621 * NEWS (2.3+): Add a description of this feature to the default
1622 %destructor/%printer description.
1623 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
1624 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
1625 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
1626 list node contains a semantic type.
1627 * src/symtab.c, src/symtab.h: Extend with a table that associates
1628 semantic types with their %destructor's and %printer's.
1629 (semantic_type_from_uniqstr, semantic_type_get,
1630 semantic_type_destructor_set, semantic_type_printer_set): New functions
1631 composing the public interface of that table.
1632 (symbol_destructor_get, symbol_destructor_location_get,
1633 symbol_printer_get, symbol_printer_location_get): If there's no
1634 per-symbol %destructor/%printer, look up the per-type before trying
1635 the default.
1636 * tests/actions.at (Per-type %printer and %destructor): New test case.
1637 * tests/input.at (Default %printer and %destructor redeclared):
1638 Extend to check that multiple occurrences of %symbol-default in a
1639 single %destructor/%printer declaration is an error.
1640 (Per-type %printer and %destructor redeclared, Unused values with
1641 per-type %destructor): New test cases.
1642
1643 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
1644
1645 Require default %destructor/%printer to be declared using
1646 %symbol-default instead of an empty symbol list, and start working on
1647 new per-type %destructor/%printer. Discussed at
1648 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
1649 * NEWS (2.3+): Add %symbol-default to example.
1650 * bison.texinfo (Freeing Discarded Symbols): Likewise.
1651 (Bison Symbols): Add entry for %symbol-default.
1652 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
1653 (generic_symlist, generic_symlist_item): New nonterminals for creating
1654 a list in which each item is a symbol, semantic type, or
1655 %symbol-default.
1656 (grammar_declaration): Use generic_symlist in %destructor and %printer
1657 declarations instead of symbols.1 or an empty list.
1658 (symbol_declaration, precedence_declaration, symbols.1): Update actions
1659 for changes to symbol_list.
1660 * src/reader.c: Update for changes to symbol_list.
1661 * src/scan-code.l: Likewise.
1662 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
1663 * src/symlist.c, src/symlist.h: Extend such that a list node may
1664 represent a semantic type or a %symbol-default in addition to just an
1665 ordinary symbol. Add switched functions for setting %destructor's and
1666 %printer's.
1667 * tests/actions.at, tests/input.at: Add %symbol-default to all default
1668 %destructor/%printer declarations.
1669
1670 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
1671
1672 Whether the default %destructor/%printer applies to a particular symbol
1673 isn't a question of whether the user *declares* that symbol (in %token,
1674 for example). It's a question of whether the user by any means
1675 *defines* the symbol at all (by simply using a char token, for
1676 example). $end is defined by Bison whereas any other token with token
1677 number 0 is defined by the user. The error token is always defined by
1678 Bison regardless of whether the user declares it with %token, but we
1679 may one day let the user define error as a nonterminal instead.
1680 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
1681 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
1682 the meaning of "user-defined".
1683 * tests/actions.at (Default %printer and %destructor for user-declared
1684 end token): Rename to...
1685 (Default %printer and %destructor for user-defined end token): ...
1686 this.
1687
1688 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
1689 computation of whether to apply the default, don't maintain a list of
1690 every Bison-defined symbol. Instead, just check for a first character
1691 of '$', which a user symbol cannot have, and check for the error token.
1692
1693 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
1694
1695 Don't apply the default %destructor or %printer to the error token,
1696 $undefined, or $accept. This change fits the general rule that the
1697 default %destructor and %printer are only for user-declared symbols,
1698 and it solves several difficulties that are described in the new test
1699 cases listed below.
1700 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
1701 * tests/actions.at (Default %printer and %destructor are not for error
1702 or $undefined, Default %printer and %destructor are not for $accept):
1703 New test cases.
1704
1705 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
1706
1707 Allow %start after the first rule.
1708 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
1709 when parsing the first rule.
1710 (check_and_convert_grammar): Search for it here after all grammar
1711 declarations have been parsed. Skip midrules, which have dummy LHS
1712 nonterminals.
1713 * src/symtab.c (symbol_is_dummy): New function.
1714 * src/symtab.h (symbol_is_dummy): Declare it.
1715 * tests/input.at (%start after first rule): New test.
1716
1717 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
1718
1719 Redo some of the previous commit: add back the ability to use
1720 non-aliased/undeclared string literals since it might be useful to
1721 those declaring %token-table.
1722 * src/reader.c (check_and_convert_grammar): Undo changes in previous
1723 commit: don't worry about complaints from symbols_pack.
1724 * src/symtab.c (symbol_new, symbol_class_set,
1725 symbol_check_alias_consistency): Undo changes in previous commit: count
1726 each string literal as a new symbol and token, assign it a symbol
1727 number, and don't complain about non-aliased string literals.
1728 (symbols_pack): Since symbol_make_alias still does not decrement symbol
1729 and token counts but does still set aliased tokens to the same number,
1730 symbol_pack_processor now leaves empty slots in the symbols array.
1731 Remove those slots.
1732 * tests/regression.at (Undeclared string literal): Remove test case
1733 added in previous commit since non-aliased string literals are allowed
1734 again.
1735 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
1736 remove unnecessary string literal declarations.
1737 * tests/sets.at (Firsts): Likewise.
1738
1739 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
1740
1741 Don't allow an undeclared string literal, but allow a string literal to
1742 be used before its declaration.
1743 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
1744 symbols_pack complained.
1745 * src/symtab.c (symbol_new): Don't count a string literal as a new
1746 symbol.
1747 (symbol_class_set): Don't count a string literal as a new token, and
1748 don't assign it a symbol number since symbol_make_alias does that.
1749 (symbol_make_alias): It's not necessary to decrement the symbol and
1750 token counts anymore. Don't assume that an alias declaration occurs
1751 before any uses of the identifier or string, and thus don't assert that
1752 one of them has the highest symbol number so far.
1753 (symbol_check_alias_consistency): Complain if there's a string literal
1754 that wasn't declared as an alias.
1755 (symbols_pack): Bail if symbol_check_alias_consistency failed since
1756 symbol_pack asserts that every token has been assigned a symbol number
1757 although undeclared string literals have not.
1758 * tests/regression.at (String alias declared after use, Undeclared
1759 string literal): New test cases.
1760 (Characters Escapes, Web2c Actions): Declare string literals as
1761 aliases.
1762 * tests/sets.at (Firsts): Likewise.
1763
1764 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
1765
1766 In the grammar scanner, STRING_FINISH unclosed constructs and return
1767 them to the parser in order to improve error messages.
1768 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
1769 SC_BRACED_CODE, SC_PROLOGUE): Implement.
1770 * tests/input.at (Unclosed constructs): New test case.
1771 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
1772 seen.
1773
1774 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
1775 unused global.
1776
1777 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
1778
1779 Handle string aliases for character tokens correctly.
1780 * src/symtab.c (symbol_user_token_number_set): If the token has an
1781 alias, check and set its alias's user token number instead of its own,
1782 which is set to indicate the alias. Previously, every occurrence of
1783 the character token in the grammar overwrote that alias indicator with
1784 the character code.
1785 * tests/input.at (String aliases for character tokens): New test.
1786
1787 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
1788
1789 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
1790
1791 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
1792
1793 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
1794 to prevent failures when building on older platforms.
1795 Check for autopoint failure.
1796 Set XGETTEXT_OPTIONS to values that check for C format strings,
1797 so that translators are warned about them (this also helps
1798 prevent core dumps).
1799
1800 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
1801 function, since it simplifies our code a bit.
1802
1803 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
1804 rather than -W, so we don't get bogus warnings about sign comparisons.
1805 Add -Wpointer-arith, since that warning is useful (it reports code
1806 that does not conform to C89 and that some compilers reject).
1807 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
1808 since it's no longer needed.
1809
1810 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
1811
1812 Clean up scanners a bit.
1813 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
1814 definitions so gcc won't warn when obstack_for_string is unused.
1815 * src/scan-code.l: config.h and system.h are already #include'd by
1816 scan-code-c.c, so get rid of them here.
1817 * src/scan-gram.l: Likewise.
1818 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
1819 definitions rather than duplicating the rest of it.
1820 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
1821
1822 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
1823
1824 Suppress signed/unsigned comparison warnings for yycheck.
1825 * data/c.m4 (b4_safest_int_type): New macro.
1826 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
1827 a signed int type, cast it to b4_safest_int_type first.
1828 * data/yacc.c: Likewise.
1829 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
1830 also overwritten.
1831
1832 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
1833
1834 * doc/bison.texinfo: Fix some typos.
1835
1836 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
1837
1838 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
1839 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
1840
1841 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
1842 the latest gnulib does this a different way.
1843 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
1844 translation was patched, so stop omitting it.
1845
1846 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1847
1848 Enable declaration of default %printer/%destructor. Make the parser
1849 use these for all user-declared grammar symbols for which the user does
1850 not declare a specific %printer/%destructor. Thus, the parser uses it
1851 for token 0 if the user declares it but not if Bison generates it as
1852 $end. Discussed starting at
1853 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
1854 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
1855 and
1856 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
1857 * NEWS (2.3+): Mention.
1858 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
1859 declare a %destructor for a mid-rule's semantic value. It's just
1860 impossible to declare one specific to it.
1861 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
1862 code. Describe default %destructor form.
1863 * src/parse-gram.y (grammar_declaration): Parse default
1864 %printer/%destructor declarations.
1865 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
1866 and symbol_destructor_location_get rather than accessing the destructor
1867 and destructor_location members of struct symbol.
1868 (symbol_printers_output): Likewise but for %printer's.
1869 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
1870 again.
1871 * src/symtab.c (default_destructor, default_destructor_location,
1872 default_printer, default_printer_location): New static global
1873 variables to record the default %destructor and %printer.
1874 (symbol_destructor_get, symbol_destructor_location_get,
1875 symbol_printer_get, symbol_printer_location_get): New functions to
1876 compute the appropriate %destructor and %printer for a symbol.
1877 (default_destructor_set, default_printer_set): New functions to set the
1878 default %destructor and %printer.
1879 * src/symtab.h: Prototype all those new functions.
1880 * tests/actions.at (Default %printer and %destructor): New test to
1881 check that the right %printer and %destructor are called, that they're
1882 not called for $end, and that $$ and @$ work correctly.
1883 (Default %printer and %destructor for user-declared end token): New
1884 test to check that the default %printer and %destructor are called for
1885 a user-declared end token.
1886 * tests/input.at (Default %printer and %destructor redeclared, Unused
1887 values with default %destructor): New tests to check related grammar
1888 warnings and errors.
1889
1890 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1891
1892 Clean up handling of %destructor for the end token (token 0).
1893 Discussed starting at
1894 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
1895 and
1896 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
1897
1898 Make the skeletons consistent in how they pop the end token and invoke
1899 its %destructor.
1900 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
1901 state, which has token number 0, since this would invoke the
1902 %destructor for the end token.
1903 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
1904 until after shifting the end token, or else it won't be popped.
1905 * data/yacc.c (yyparse): Likewise.
1906
1907 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
1908 it's the end token. Upon termination, destroy an unshifted lookahead
1909 even when it's the end token.
1910 * data/lalr1.cc (yy::parser::parse): Likewise.
1911 * data/yacc.c (yyparse): Likewise.
1912
1913 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
1914 value warnings for the end token when the user gives the end token a
1915 %destructor.
1916
1917 * tests/actions.at (Printers and Destructors): Test all the above.
1918
1919 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
1920
1921 Update to latest gnulib and gettext versions.
1922 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
1923 Add fopen-safer.
1924 (gnulib_files): Add m4/warning.m4. Don't worry about files
1925 overwritten by autopoint.
1926 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
1927 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
1928 rejects them.
1929 Don't use autoreconf; instead, invoke autopoint etc. by hand,
1930 so that we can remove the intl files at a better time.
1931 (intl_files_to_remove): Remove aclocal.m4, since it gets
1932 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
1933 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
1934 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
1935 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
1936 Remove datarootdir hack; no longer needed.
1937 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
1938 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
1939 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
1940 strdup.h.
1941 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
1942 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
1943
1944 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
1945
1946 * bootstrap: Adjust to today's change to gnulib-tool by invoking
1947 it with --assume-autoconf='latest-stable'.
1948
1949 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
1950
1951 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
1952 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
1953 YYSTYPE' and `{'.
1954 * src/muscle_tab.h (muscle_grow): Replace the header comments with
1955 those from muscle_tab.c since the old ones are misleading.
1956
1957 2006-07-13 Akim Demaille <akim@epita.fr>
1958
1959 Support %define "KEY" {VALUE}.
1960 * src/scan-code.h, src/scan-code.l (translate_action)
1961 (translate_rule_action, translate_symbol_action, translate_code):
1962 Return char *, not const char *.
1963 * src/parse-gram.y (declaration): Rename as...
1964 (prologue_declaration): this.
1965 (string_content): Remove this nonterminal, use STRING.
1966 (braceless, content, content.opt): New nonterminal.
1967 Use them.
1968 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
1969 as value.
1970 * src/scan-gram.l (getargs.h): Don't include it.
1971
1972 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
1973
1974 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
1975 rather than a for-loop that declares a local bool variable. This
1976 should work around a compatibility problem with a Cray x1e C++
1977 compiler reported by Hung Nguyen in
1978 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
1979 The for-loop was introduced in the 2004-11-17 change but I don't
1980 know why it was needed.
1981
1982 2006-07-12 Akim Demaille <akim@epita.fr>
1983
1984 * data/c.m4: Comment changes.
1985
1986 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
1987
1988 * src/complain.c (error_message, ERROR_MESSAGE): New.
1989 To factor...
1990 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
1991 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
1992
1993 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1994
1995 * NEWS: Instead of %union, you can define and use your own union type
1996 YYSTYPE if your grammar contains at least one <type> tag.
1997 Your YYSTYPE need not be a macro; it can be a typedef.
1998 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
1999 (Union Decl, Decl Summary): Document this.
2000 * data/glr.c (YYSTYPE): Implement this.
2001 * data/glr.cc (YYSTYPE): Likewise.
2002 * data/lalr1.cc (YYSTYPE): Likewise.
2003 * data/yacc.c (YYSTYPE): Likewise.
2004 * src/output.c (prepare): Output tag_seen_flag.
2005 * src/parse-gram.y (declaration, grammar_declaration):
2006 Use 'union_seen' rather than 'typed' to determine whether
2007 %union has been seen, since grammars can now be typed without
2008 %union.
2009 (symbol_declaration, type.opt, symbol_def):
2010 Keep track of whether a tag has been seen.
2011 * src/reader.c (union_seen, tag_seen): New vars.
2012 (typed): remove.
2013 * src/reader.h (union_seen, tag_seen, typed): Likewise.
2014 * src/scan-code.l (untyped_var_seen): New variable.
2015 (handle_action_dollar): Adjust to above changes.
2016 (handle_action_dollar, handle_action_at):
2017 Improve overflow checking for outlandish numbers.
2018 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
2019 avoid new diagnostics generated by above changes.
2020 * tests/regression.at (YYSTYPE typedef): Add test to check
2021 for type tags without %union.
2022
2023 * src/symlist.c (symbol_list_length): Return int, not unsigned
2024 int, since callers expect int. This may need to get revisited
2025 once we have proper integer overflow checking.
2026
2027 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
2028 object is now static.
2029
2030 * src/getargs.c (flags_argmatch): Return void, not int,
2031 to pacify ./configure --enable-gcc-warnings.
2032
2033 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
2034 since last_string is already defined to FLEX_PREFIX (last_string).
2035
2036 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
2037
2038 Implement --warnings/-W.
2039 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
2040 replaced by...
2041 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
2042 Adjust callers.
2043 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
2044 (warnings_args, warnings_types): New.
2045 (getargs, short_options, long_options): Accept -W/--warnings.
2046 Sort the options by alphabetical order, upper case letter right
2047 before its lower case.
2048
2049 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
2050
2051 Change %merge result type clash warnings to errors. Discussed at
2052 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
2053 * src/reader.c (record_merge_function_type): Use complain_at.
2054 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
2055 declared later): Update test case results.
2056
2057 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
2058
2059 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
2060 to be in alphabetical order.
2061 (trace_args): Spelling fixes.
2062
2063 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
2064
2065 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
2066 so they don't collide with user-defined macros.
2067 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
2068 this was never guaranteed, and now that we're using gnulib stdint,
2069 which defines int_fast16_t to long int, the problem is exposed.
2070
2071 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
2072
2073 * data/c.m4 (b4_basename): Simplify a bit, since we don't
2074 need the full POSIX semantics (and weren't implementing them
2075 anyway).
2076
2077 Adjust to Autoconf 2.60 and today's gnulib.
2078 * bootstrap (gnulib_modules): Add stdint.
2079 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
2080 no longer copies it.
2081 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
2082 since stdint needs the former and wcwidth (which is now required
2083 by mbswidth) needs the latter.
2084 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
2085 work around a compatibility glitch between gettext 0.14.6 and
2086 Autoconf 2.60.
2087 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
2088 Do not check for uintptr_t, since new stdint module does the right
2089 thing.
2090 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
2091 Add stdint.h, stdint_.h, wcwidth.h.
2092 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
2093 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
2094 stdint.m4, wchar_t.m4, wcwidth.m4.
2095 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
2096 usual order for ../lib/*.h files.
2097 (file_name_split): Use last_component, not base_name, to adjust
2098 to gnulib changes.
2099 * src/parse-gram.h: Include <strverscmp.h> in the usual order
2100 for ../lib/*.h files.
2101 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
2102 Define unconditionally, since we now assume the stdint module.
2103 * src/scan-skel.l: Include <dirname.h>.
2104 (BASE_QPUTS): Use last_component, not base_name.
2105 * src/system.h: Include <unlocked-io.h> in the usual order
2106 for ../lib/*.h files. Include <stdint.h> unconditionally,
2107 since we now use the stdint module.
2108 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
2109 HAVE_UINTPTR_T, since we now use the stdint module.
2110 (base_name): Remove decl, since files now include <dirname.h>
2111 to get the decl.
2112
2113 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
2114
2115 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
2116 New, default to 1.
2117 * data/yacc.c, data/glr.c, data/location.cc: Use them.
2118 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
2119 default.
2120 * tests/calc.at: Adjust.
2121
2122 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
2123
2124 * data/c.m4 (b4_basename): New.
2125 (b4_syncline): Also output the location of its invocation (from
2126 the skeleton).
2127 (b4_user_action, b4_define_user_action, b4_user_actions)
2128 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
2129 (b4_user_stype): New.
2130 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
2131
2132 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
2133
2134 In the grammar file, the first column is 1 not 0 on the first line as
2135 on every other line.
2136 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
2137 * tests/input.at (Torturing the Scanner): Update output.
2138
2139 * src/scan-gram.l (scanner_cursor): Declare it static.
2140
2141 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
2142
2143 In warnings, say "previous declaration" rather than "first
2144 declaration".
2145 * src/symtab.c (redeclaration): Do that here.
2146 * src/reader.c (record_merge_function_type): In the case of a result
2147 type clash, report the previous declaration rather than the very first
2148 one in the grammar file.
2149 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
2150 declared later): Add a third declaration to check this behavior.
2151 * tests/input.at (Incompatible Aliases): Update output.
2152
2153 2006-06-27 Akim Demaille <akim@epita.fr>
2154
2155 * doc/Doxyfile.in: New.
2156 * doc/Makefile.am: Use it.
2157 * src/lalr.h, src/symtab.h: Initial doxygenation.
2158
2159 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
2160
2161 Don't miss %merge result type warnings just because the LHS types are
2162 declared after the %merge. This continues the effort of the previous
2163 patch.
2164 * src/reader.c (get_merge_function): Don't set the merger type yet.
2165 (record_merge_function_type): New function for setting the merger type
2166 and checking for clashes.
2167 (grammar_current_rule_merge_set): Set the location of the %merge for
2168 the current rule.
2169 (packgram): Invoke record_merge_function_type for each rule now that
2170 all symbol type declarations have been parsed.
2171 * src/reader.h (merger_list.type_declaration_location): New member
2172 storing the location of the first %merge from which the type for this
2173 merging function was derived.
2174 * src/symlist.h (symbol_list.merger_declaration_location): New member
2175 storing the location of a rule's %merge, if any.
2176 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
2177 declared later): New test to catch the error fixed by the above patch.
2178
2179 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
2180
2181 Get action warnings (grammar_rule_check) right even when symbol
2182 declarations appear after the rules. Discussed at
2183 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
2184 and
2185 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
2186 Don't mistake the type of $$ in a midrule to be that of its parent
2187 rule's $$.
2188 * src/reader.c (grammar_current_rule_end): Don't invoke
2189 grammar_rule_check yet since not all symbol declarations may have been
2190 parsed yet.
2191 (grammar_midrule_action): Likewise.
2192 Don't record whether the midrule's $$ has been used yet since actions
2193 haven't been translated yet.
2194 Record the midrule's parent rule and its RHS index within the parent
2195 rule.
2196 (grammar_current_rule_action_append): Don't translate the action yet
2197 since not all symbol declarations may have been parsed yet and, thus,
2198 warnings about types for $$, $n, @$, and @n can't be reported yet.
2199 (packgram): Translate the action and invoke grammar_rule_check now that
2200 all symbol declarations have been parsed.
2201 * src/scan-code.l (handle_action_dollar): Now that this is invoked
2202 after parsing the entire grammar file, the symbol list here in the case
2203 of a midrule is actually the midrule's empty RHS, so reference its
2204 parent rule's RHS where necessary.
2205 On the other hand, now that you can already know it's a midrule, you
2206 aren't forced to think $$ has the same type as its parent rule's $$.
2207 (handle_action_at): In the case of a midrule, reference the parent rule
2208 where necessary.
2209 * src/symlist.c (symbol_list_new): Initialize new midrule-related
2210 members.
2211 (symbol_list_length): Now that this is invoked after all rules have
2212 been parsed, a NULL symbol (rather than a NULL symbol list node)
2213 terminates a rule. symbol_list_print already does this correctly.
2214 * src/symlist.h (symbol_list.midrule_parent_rule,
2215 symbol_list.midrule_parent_rhs_index): New members so that midrules can
2216 remember their relationships with their parents.
2217 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
2218 fixed by the above patch.
2219 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
2220 implementing...
2221 (Unused values): ... this old test case and...
2222 (Unused values before symbol declarations): ... this new test case.
2223 This one is the same as `Unused values' except that all symbol
2224 declarations appear after the rules in order to catch the rest of the
2225 errors fixed by the above patch.
2226
2227 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
2228
2229 More cleanup.
2230 * src/reader.c (current_rule): Declare it static since it's no longer
2231 used outside this file.
2232 (grammar_current_rule_action_append): Remove redundant arguments from
2233 translate_rule_action invocation.
2234 * src/reader.h (current_rule): Remove this unused extern.
2235 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
2236 * src/scan-code.l (translate_rule_action): Likewise.
2237
2238 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
2239
2240 Clean up yesterday's patch.
2241 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
2242 to...
2243 * src/reader.c (grammar_current_rule_action_append): ... here for
2244 consistency with grammar_current_rule_symbol_append.
2245 * tests/regression.at (Braced code in declaration in rules section):
2246 Make yyerror and yylex static as usual.
2247
2248 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
2249
2250 Fix bug that mistakes braced code in a declaration in the rules section
2251 to be a rule action. Mentioned at
2252 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
2253 * src/scan-gram.l: Move midrule action detection from the start of the
2254 scanning of any braced code to...
2255 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
2256 action. For readability, use $2 and @2 rather than the equivalent
2257 global variables.
2258 * tests/regression.at (Braced code in declaration in rules section):
2259 New test to catch the error fixed by the above patch.
2260
2261 Work on code readability some.
2262 * src/scan-code.l (current_rule): Get rid of this misleading and
2263 redundant declaration: it's actually extern'ed in reader.h.
2264 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
2265 translate_action): Add a rule argument and use it instead of the global
2266 current_rule.
2267 (translate_rule_action): This already receives current_rule through an
2268 argument, so pass it on to translate_action instead of assigning
2269 current_rule to current_rule.
2270 (translate_symbol_action, translate_code): Pass rule = NULL to
2271 translate_action.
2272
2273 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
2274
2275 Rename %before-definitions to %start-header and %after-definitions to
2276 %end-header. Don't use these declarations to separate pre-prologue
2277 blocks from post-prologue blocks. Add new order-independent
2278 declarations %before-header and %after-header as alternatives to the
2279 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
2280 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
2281 * NEWS (2.3+): Update for these changes.
2282 * data/glr.c (b4_before_definitions): Update to...
2283 (b4_start_header): ... this.
2284 (b4_after_definitions): Update to...
2285 (b4_end_header): ... this.
2286 * data/glr.cc: Likewise.
2287 * data/lalr1.cc: Likewise.
2288 * data/yacc.c: Likewise.
2289 * doc/bison.texinfo (The prologue): Update names, and replace remaining
2290 prologue blocks with %*-header declarations.
2291 (Calc++ Parser): Likewise.
2292 (Bison Declaration Summary): Update names.
2293 (Bison Symbols): Update description.
2294 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
2295 (PERCENT_END_HEADER): ... this.
2296 (PERCENT_BEFORE_DEFINITIONS): Update to...
2297 (PERCENT_START_HEADER): ... this.
2298 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
2299 (declaration): Update token names and m4 macro names.
2300 When parsing %end-header and %start-header, invoke translate_code
2301 before muscle_code_grow, and no longer set global booleans to remember
2302 whether these declarations have been seen.
2303 Parse new %after-header and %before-header.
2304 * src/reader.c (before_definitions, after_definitions): Remove.
2305 (prologue_augment): Accept a new bool argument to specify whether to
2306 augment the pre-prologue or post-prologue.
2307 * src/reader.h (before_definitions, after_definitions): Remove these
2308 extern's.
2309 (prologue_augment): Add new bool argument.
2310 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
2311 (PERCENT_END_HEADER): ... this.
2312 (PERCENT_BEFORE_DEFINITIONS): Update to...
2313 (PERCENT_START_HEADER): ... this.
2314 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
2315 * tests/actions.at (Printers and Destructors): Update names.
2316
2317 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
2318
2319 Add comparison operators for C++ location classes. Discussed at
2320 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
2321 * data/c++.m4 (b4_define_location_comparison): New boolean %define
2322 declaration indicating whether filename_type has an operator==. If
2323 filename_type is `std::string', it defaults to `1', `0' otherwise.
2324 * data/location.cc: Iff b4_define_location_comparison is `1', add
2325 operator== and operator!= for class position and for class location.
2326
2327 Some minor fixes.
2328 * src/scan-action.l: Remove unused file.
2329 * src/symtab.c (symbol_printer_set): Use printer_location not
2330 destructor_location.
2331 * src/symtab.h (struct symbol): Replace incorrect source comment for
2332 printer members.
2333 * tests/input.at (Incompatible Aliases): Update output with correct
2334 printer location.
2335
2336 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
2337
2338 Don't put the pre-prologue in the header file. For the yacc.c code
2339 file and the glr.c header and code files, move the pre-prologue before
2340 the token definitions. Add new %before-definitions and
2341 %after-definitions to declare code that will go in both the header file
2342 and code file. Discussed at
2343 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
2344 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
2345 and
2346 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
2347 * NEWS (2.3+): Describe these changes.
2348 * data/glr.c (b4_pre_prologue): Move from within to before...
2349 (b4_shared_declarations): ... this.
2350 Add new b4_before_definitions before b4_token_enums.
2351 Add new b4_after_definitions at the end.
2352 * data/glr.cc (b4_pre_prologue): Replace with...
2353 (b4_before_definitions): ... this in the header file.
2354 (b4_after_definitions): New near the end of the header file.
2355 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
2356 code file right before including the header file.
2357 (b4_before_definitions): New in the previous position of
2358 b4_pre_prologue in the header file.
2359 (b4_after_definitions): New near the end of the header file.
2360 * data/yacc.c: Clean up some m4 quoting especially in the header file.
2361 (b4_token_enums_defines): In the code file, move to right before
2362 YYSTYPE for consistency with the header file.
2363 (b4_before_definitions): New right before b4_token_enums_defines in
2364 both the header and code file.
2365 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
2366 header and code file.
2367 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
2368 of prologues for %union dependencies.
2369 (Bison Declaration Summary): In %defines description, mention the
2370 effect of %before-definitions and %after-definitions on the header
2371 file.
2372 (Calc++ Parser): Forward declare driver in a %before-definitions rather
2373 than in the pre-prologue so that make check succeeds.
2374 (Bison Symbols): Add entries for %before-definitions and
2375 %after-definitions.
2376 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
2377 %before-definitions.
2378 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
2379 (declaration): Parse those declarations and append to
2380 b4_before_definitions and b4_after_definitions, respectively.
2381 * src/reader.c (before_definitions, after_definitions): New bools to
2382 track whether those declarations have been seen.
2383 (prologue_augment): Add to the post-prologue if %union,
2384 %before-definitions, or %after-definitions has been seen.
2385 * src/reader.h (before_definitions, after_definitions): New extern's.
2386 * src/scan-gram.l: Scan the new declarations.
2387 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
2388 prologue block in a %before-definitions or a %after-definitions based
2389 on whether the %union is declared.
2390 * tests/regression.at (Early token definitions with --yacc, Early token
2391 definitions without --yacc): Move tests for token definitions into the
2392 post-prologue since token names are no longer defined in the
2393 pre-prologue.
2394
2395 2006-06-20 Akim Demaille <akim@epita.fr>
2396
2397 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
2398 (symbol_get): Use it.
2399 * src/parse-gram.y: Use it.
2400
2401 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
2402
2403 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
2404 build succeeds when configured with --enable-gcc-warnings.
2405
2406 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
2407
2408 * src/parse-gram.y (char_name): New function.
2409 (CHAR, STRING, string_content): For %printer, properly escape.
2410 (ID): Prefer fputs to fprintf.
2411 (id): Reindent to be consistent with other rules.
2412 Properly quote char.
2413
2414 The Translation Project changed its way of publishing translations
2415 to maintainers. I haven't received any responses to my request
2416 for supporting the old way, or for documenting the new way. I
2417 have modified 'bootstrap' to use screen scraping
2418 (in this case, HTML scraping). This is unreliable and inelegant,
2419 but I don't see any better way. Yuck.
2420 * bootstrap (TP_URL, WGET_COMMAND): New vars.
2421 (get_translations): New function, which uses HTML scraping to
2422 deduce locations of latest translations.
2423 Use this function to grab both bison and bison-runtime .po files.
2424 Don't bother priming the pump for the runtime-po domain any more,
2425 as it's now translated better than bison is.
2426
2427 2006-06-19 Akim Demaille <akim@epita.fr>
2428
2429 * src/scan-gram.l: No longer "parse" things after `%union' until
2430 `{'. Rather, return a single "%union" token.
2431 No longer make symbols: return strings, and leave the conversion
2432 to symbols to the parser.
2433 (SC_PRE_CODE, token_type): Remove.
2434 * src/parse-gram.y (%union): New field `character'.
2435 Sort tokens.
2436 (CHAR): New token.
2437 (ID, ID_COLON): Now that the scanner no longer makes them
2438 identifiers, adjust all uses to invoke symbol_get.
2439 (id_colon): New, wraps the conversion from string to symbol.
2440 (%union): Accept a possible union_name.
2441 (symbol): Now can be a char.
2442 * data/c.m4 (b4_union_name): Leave a default value.
2443 * data/glr.c, data/yacc.c: Use it.
2444
2445 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
2446
2447 For associating token numbers with token names for "yacc.c", don't use
2448 #define statements unless `--yacc' is specified; always use enum
2449 yytokentype. Most important discussions start at:
2450 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
2451 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
2452 and
2453 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
2454 * NEWS (2.3+): Mention.
2455 * data/c.m4 (b4_yacc_if): New.
2456 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
2457 token #define's.
2458 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
2459 on token name definitions.
2460 * src/getargs.c (usage): Capitalize `Yacc' in English.
2461 * src/output.c (prepare): Define b4_yacc_flag.
2462 * tests/regression.at (Early token definitions): Test that tokens names
2463 are defined before the pre-prologue not just before the post-prologue.
2464 Remove this test case and copy to...
2465 (Early token definitions with --yacc): ... this to test #define's.
2466 (Early token definitions without --yacc): ... and this to test enums.
2467
2468 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
2469
2470 * NEWS: Reword the post-2.3 change to not be so optimistic about
2471 removing the old "look-ahead" spelling.
2472 Update previous look-ahead/lookahead change reports.
2473 * REFERENCES: look-ahead -> lookahead (since that's
2474 what he actually wrote).
2475 * doc/refcard.tex: look ahead -> lookahead,
2476 look-ahead -> lookahead
2477
2478 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
2479
2480 For consistency, use `lookahead' instead of `look-ahead' or
2481 `look_ahead'. Discussed starting at
2482 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
2483 and then at
2484 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
2485 * NEWS: For the next release, note the change to `--report'.
2486 * TODO, doc/bison.1: Update English.
2487 * doc/bison.texinfo: Update English.
2488 (Understanding Your Parser, Bison Options): Document as
2489 `--report=lookahead' rather than `--report=look-ahead'.
2490 * src/conflicts.c: Update English in comments.
2491 (lookahead_set): Rename from look_ahead_set.
2492 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
2493 (resolve_sr_conflict): Rename local look_ahead_tokens to
2494 lookahead_tokens, and update other uses.
2495 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
2496 count_rr_conflicts, conflicts_free): Update uses.
2497 * src/getargs.c (report_args): Move "lookahead" before alternate
2498 spellings.
2499 (report_types): Update uses.
2500 (usage): For `--report' usage description, state `lookahead' spelling
2501 rather than `look-ahead'.
2502 * src/getargs.h (report.report_lookahead_tokens): Rename from
2503 report_look_ahead_tokens.
2504 * src/lalr.c: Update English in comments.
2505 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
2506 (state_lookahead_tokens_count): Rename from
2507 state_look_ahead_tokens_count.
2508 Rename local n_look_ahead_tokens to n_lookahead_tokens.
2509 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
2510 Rename local n_look_ahead_tokens to n_lookahead_tokens.
2511 Update other uses.
2512 Update English in output.
2513 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
2514 * src/print.c: Update English in comments.
2515 (lookahead_set): Rename from look_ahead_set.
2516 (print_reduction): Rename argument lookahead_token from
2517 look_ahead_token.
2518 (print_core, state_default_rule, print_reductions, print_results):
2519 Update uses.
2520 * src/print_graph.c: Update English in comments.
2521 (print_core): Update uses.
2522 * src/state.c: Update English in comments.
2523 (reductions_new): Update uses.
2524 (state_rule_lookahead_tokens_print): Rename from
2525 state_rule_look_ahead_tokens_print, and update other uses.
2526 * src/state.h: Update English in comments.
2527 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
2528 (state_rule_lookahead_tokens_print): Rename from
2529 state_rule_look_ahead_tokens_print.
2530 * src/tables.c: Update English in comments.
2531 (conflict_row, action_row): Update uses.
2532 * tests/glr-regression.at
2533 (Incorrect lookahead during deterministic GLR,
2534 Incorrect lookahead during nondeterministic GLR): Rename
2535 print_look_ahead to print_lookahead.
2536 * tests/torture.at: Update English in comments.
2537 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
2538 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
2539 (Many lookahead tokens): Update uses.
2540 * data/glr.c: Update English in comments.
2541 * lalr1.cc: Likewise.
2542 * yacc.c: Likewise.
2543 * src/conflicts.h: Likewise.
2544 * src/lalr.h: Likewise.
2545 * src/main.c: Likewise.
2546 * src/output.c: Likewise.
2547 * src/parse-gram.c: Likewise.
2548 * src/tables.h: Likewise.
2549 * tests/calc.at: Likewise.
2550
2551 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
2552
2553 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
2554
2555 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
2556
2557 * TODO: Add request from Nelson H. F. Beebe to be able to install
2558 Bison without installing the yacc script.
2559
2560 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
2561
2562 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
2563 and yytext if they're already #define'd.
2564 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
2565 * src/scan-code-c.c: ... here.
2566 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
2567 <config.h>.
2568
2569 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
2570
2571 Get Bison to build again when configured with --enable-gcc-warnings.
2572 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
2573 missing #include's.
2574 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
2575 loc argument as it shadows a global.
2576 * src/scan-gram.l: Remove stray comma that prevents boundary_set
2577 invocation.
2578
2579 * src/.cvsignore: Add scan-code.c.
2580
2581 2006-06-07 Akim Demaille <akim@epita.fr>
2582
2583 * src/scan-gram.l: Move the "add a trailing ; to actions" code
2584 to...
2585 * src/scan-code.l: here.
2586 * tests/input.at (Torturing the Scanner): Fix another location
2587 error.
2588
2589 2006-06-07 Akim Demaille <akim@epita.fr>
2590
2591 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
2592
2593 2006-06-06 Akim Demaille <akim@epita.fr>
2594
2595 Extract the parsing of user actions from the grammar scanner.
2596 As a consequence, the relation between the grammar scanner and
2597 parser is much simpler. We can also split "composite tokens" back
2598 into simple tokens.
2599 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
2600 * src/scan-gram.l (add_column_width, adjust_location): Move to and
2601 rename as...
2602 * src/location.h, src/location.c (add_column_width)
2603 (location_compute): these.
2604 Fix the column count: the initial column is 0.
2605 (location_print): Be robust to ending column being 0.
2606 * src/location.h (boundary_set): New.
2607 * src/main.c: Adjust to scanner_free being renamed as
2608 gram_scanner_free.
2609 * src/output.c: Include scan-code.h.
2610 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
2611 Use boundary_set.
2612 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
2613 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
2614 which is now, again, a separate token.
2615 Adjust all dependencies.
2616 Whereever actions with $ and @ are used, use translate_code.
2617 (action): Remove this nonterminal which is now useless.
2618 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
2619 (grammar_current_rule_action_append): Use translate_code.
2620 (packgram): Bound check ruleno, itemno, and rule_length.
2621 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
2622 (last_string, last_braced_code_loc, max_left_semantic_context)
2623 (scanner_initialize, scanner_free, scanner_last_string_free)
2624 (gram_out, gram_lineno, YY_DECL_): Move to...
2625 * src/scan-gram.h: this new file.
2626 (YY_DECL): Rename as...
2627 (GRAM_DECL): this.
2628 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
2629 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
2630 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
2631 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
2632 Move these declarations, and...
2633 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
2634 these to...
2635 * src/flex-scanner.h: this new file.
2636 * src/scan-gram.l (rule_length, rule_length_overflow)
2637 (increment_rule_length): Remove.
2638 (last_braced_code_loc): Rename as...
2639 (gram_last_braced_code_loc): this.
2640 Adjust to the changes of the parser.
2641 Move all the handling of $ and @ into...
2642 * src/scan-code.l: here.
2643 * src/scan-gram.l (handle_dollar, handle_at): Remove.
2644 (handle_action_dollar, handle_action_at): Move to...
2645 * src/scan-code.l: here.
2646 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
2647 scan-code.h, scan-code-c.c, scan-gram.h.
2648 (EXTRA_bison_SOURCES): Add scan-code.l.
2649 (BUILT_SOURCES): Add scan-code.c.
2650 (yacc): Be robust to white spaces.
2651
2652 * tests/conflicts.at, tests/input.at, tests/reduce.at,
2653 * tests/regression.at: Adjust the column numbers.
2654 * tests/regression.at: Adjust the error message.
2655
2656 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
2657
2658 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
2659 Use Akim's wording from
2660 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
2661
2662 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
2663
2664 Between Bison releases, manually append `+' to the previous Bison
2665 release number, and use that as a signal to automatically print the
2666 ChangeLog's CVS Id keyword from --version. Discussed starting at
2667 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
2668 * ChangeLog: Add Id header.
2669 * configure.ac (AC_INIT): Append `+' to `2.3'.
2670 * src/.cvsignore: Add revision.c.
2671 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
2672 (BUILT_SOURCES): Add revision.c.
2673 (revision.c): New target rule. This file defines a new global variable
2674 named revision. It initializes it with either the Id from ChangeLog
2675 or, if VERSION doesn't contain `+', with the empty string.
2676 * src/getargs.c (version): Print the value of revision.
2677 * src/revision.h: Extern revision.
2678
2679 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
2680
2681 * NEWS: Version 2.3.
2682 * configure.ac (AC_INIT): Likewise.
2683
2684 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
2685
2686 * data/glr.c (YYRECOVERING): Define to be a function-like macro
2687 with no arguments, not as an object-like macro. This is for
2688 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
2689 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
2690 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
2691 Document this.
2692
2693 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
2694
2695 * src/getargs.c (usage): Back out yesterday's modification of the
2696 --help output so that we don't have to wait for translation before
2697 releasing 2.3.
2698
2699 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
2700
2701 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
2702 Problem reported by Akim Demaille.
2703
2704 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
2705
2706 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
2707
2708 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
2709
2710 * data/yacc.c (yy_reduce_print): Omit trailing white space in
2711 generated source code. Problem reported by Frans Englich in
2712 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
2713
2714 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
2715
2716 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
2717 shell, not within 'make', so that 'make' by an ordinary builder
2718 (using GNU make) does not worry about configuring gzip. This also
2719 works around a bug reported independently by Keith Thompson and by
2720 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
2721 stderr rather than stdout, messing up the build logs.
2722
2723 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
2724
2725 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
2726 to make sure that YYID will never be unused. This fixes a 'make
2727 maintainer-check' failure caused by the recent changes to the 'Trivial
2728 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
2729 not used.
2730 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
2731
2732 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
2733
2734 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
2735 state before an empty RHS is always resolved here. Only the location
2736 of that state is guaranteed to be resolved, and that's enough. This
2737 fixes the remaining bug reported by Derek M. Jones in
2738 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
2739 * tests/glr-regression.at (Uninitialized location when reporting
2740 ambiguity): Test the above case.
2741 Also, the embedded comments in this test case claim it checks the case
2742 of an empty RHS that has inherited the initial location. However, the
2743 corresponding LHS was already resolved, so yyresolveLocations didn't
2744 actually have reason to modify it. Fix this by forcing
2745 nondeterministic operation at the beginning of the parse.
2746
2747 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
2748
2749 * data/c.m4 (b4_yy_symbol_print_generate):
2750 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
2751 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
2752 of the bugs reported today by Derek M Jones in
2753 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
2754 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
2755 defined to be a type name without parens or brackets.
2756 (Location Type): Similarly for YYLTYPE.
2757 * tests/regression.at (Trivial grammars): Put in a test for this
2758 bug that will be caught by 'make maintainer-check' (though not,
2759 alas, by 'make check' unless your compiler is picky).
2760
2761 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
2762
2763 * NEWS: Version 2.2.
2764 * configure.ac (AC_INIT): Likewise.
2765
2766 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
2767
2768 * data/glr.c (yyreportTree): Make room in yystates for the state
2769 preceding the RHS. This fixes the segmentation fault reported by Derek
2770 M. Jones in
2771 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
2772 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
2773 to the user. Reported for yyreportTree by Derek M. Jones later in the
2774 same thread.
2775 * THANKS: Add Derek M. Jones.
2776 Update my email address.
2777 Fix typo in Steve Murphy's name.
2778
2779 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
2780
2781 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
2782 checking against YYLAST that caused the parser to miss a potential
2783 alternative in its diagnostic.
2784 Problem reported by Maria Jose Moron Fernandez in
2785 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
2786 * data/lalr1.cc (yysyntax_error_): Likewise.
2787 * data/yacc.c (yysyntax_error): Likewise.
2788 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
2789 tokens, in case we run into an older C compiler.
2790 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
2791 Use them to check for the off-by-one error fixed above.
2792
2793 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
2794 YYSIZE_T, not size_t.
2795 * tests/regression.at (Trivial grammars): New test, to catch
2796 the error fixed by the above patch.
2797
2798 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2799
2800 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
2801 scheme.
2802 Reported by Steve Murphy.
2803
2804 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2805
2806 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
2807 * data/glr.cc: b4_location_flag is now b4_locations_flag.
2808
2809 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2810
2811 Implement --trace=m4.
2812 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
2813 * src/output.c (output_skeleton): When set, pass -dV to m4.
2814
2815 Factor the handling of flags in m4.
2816 * src/output.c (prepare): Rename the muscle names debug, defines,
2817 error_verbose to debug_flag, defines_flag, error_verbose_flag.
2818 * data/c.m4: Adjust.
2819 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
2820 Use b4_define_flag_if to define other b4_FLAG_if macros.
2821 (b4_location_if): As a consequence, rename as...
2822 (b4_locations_if): this, for consistency.
2823 Adjust all the skeletons.
2824
2825 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2826
2827 * etc/bench.pm: Shorten bench names.
2828
2829 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
2830
2831 * src/output.h, src/output.c (error_verbose): Move to...
2832 * src/getargs.h, src/getargs.c: here.
2833 Sort the flags.
2834 Adjust dependencies.
2835
2836 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
2837
2838 * data/c.m4 (b4_copyright): Put the special exception for Bison
2839 skeletons here, so we don't have to put it in each skeleton. All
2840 uses changed. Suggested by Akim Demaille. Also, wrap the
2841 copyright notice, in case it is longer than 80 columns. Replace
2842 comma by newline after title.
2843
2844 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
2845
2846 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
2847 incompatibility, not a bug. Mention that it wasn't fixed as of
2848 flex 2.5.33.
2849
2850 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
2851
2852 * examples/extexi: Enforce the precedence of concatenation over
2853 >>.
2854 Reported by Tommy Nordgren.
2855
2856 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
2857
2858 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
2859 with the member "token".
2860 Reported by Martin Nylin.
2861
2862 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
2863
2864 * data/glr.c: Switch to Bison 2.2 special-exception language in
2865 the copyright notice. Use more-regular format for titles and
2866 copyright notices.
2867 * data/glr.cc: Likewise.
2868 * data/location.cc: Likewise.
2869 * data/yacc.cc: Likewise.
2870 * doc/bison.texinfo (Conditions): Document this.
2871 * NEWS: likewise. Upgrade version to 2.2.
2872
2873 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
2874
2875 * data/glr.cc: Remove dead code.
2876
2877 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
2878
2879 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
2880 that variable and the line breaks the bootstrap. Problem reported
2881 by Juan M. Guerrero.
2882
2883 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
2884
2885 * doc/bison.texinfo (Multiple start-symbols): New.
2886
2887 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
2888
2889 * etc/README, etc/bench.pl: New.
2890
2891 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
2892
2893 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
2894 rule.
2895 Reported by Mickael Labau.
2896 * tests/input.at (Torturing the Scanner): Test it.
2897
2898 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
2899
2900 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
2901 Problem reported by Bob Rossi.
2902
2903 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
2904
2905 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
2906 and didn't really work.
2907 For the index, use @ifnotinfo, not @iftex.
2908 Minor cleanups of spacing and terminology.
2909
2910 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
2911
2912 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
2913 of AT_NAME_PREFIX when %name-prefix is not used.
2914
2915 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
2916
2917 Apply --prefix to C++ skeletons too: they change the namespace.
2918 The test suite already exercize these cases.
2919 * data/c++.m4 (b4_namespace): New.
2920 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
2921 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
2922 * data/yacc.c, data/glr.c: Remove a useless `[]'.
2923 * doc/bison.texinfo: Document it.
2924 (Option Cross Key): Use @multitable in all formats. It looks
2925 nicer, even in TeX outputs.
2926 (Rules): Use the same code whatever the output type is.
2927 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
2928 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
2929 * tests/calc.at: Use it, instead of hard coding `yy'.
2930
2931 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2932
2933 * TODO: Remove dead items.
2934
2935 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2936
2937 * doc/FAQ: Remove, merged into...
2938 * doc/bison.texinfo (FAQ): this.
2939 * doc/Makefile.am (EXTRA_DIST): Adjust.
2940
2941 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
2942
2943 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
2944 even if empty.
2945 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
2946 * doc/bison.texinfo (Calc++ Scanner): Use it.
2947
2948 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
2949
2950 Fix two nits reported by twlevo, plus one more that I discovered.
2951
2952 * src/assoc.h (assoc_to_string): Give a name to the arg, as
2953 this is the usual Bison style.
2954 * src/location.h (location_print): Likewise.
2955
2956 * src/reader.h (token_name): Likewise.
2957
2958 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
2959
2960 Fix some nits reported by twlevo.
2961 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
2962 and "POSIX". Use more-modern syntax for URLs. Mention C++
2963 and ask for Java. Don't hardwire OS version numbers. Add
2964 copyright notice.
2965 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
2966 * src/conflicts.c (solved_conflicts_obstack): Now static.
2967
2968 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2969
2970 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
2971 page. Say "you can use it" not "you may use it" as on the web page;
2972 we're describing capabilities not granting permission.
2973
2974 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
2975
2976 * data/glr.c (yyresolveLocations): Rename local variables to avoid
2977 shadowing warnings. Use usual patter for iterating through RHS.
2978 * tests/glr-regression.at
2979 (Uninitialized location when reporting ambiguity):
2980 Modify yylex so that it uses its argument, rather than trying
2981 to rely on ARGSUSED (which doesn't work for gcc with warnings).
2982 const char -> char const.
2983
2984 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
2985 Don't use tabs inside commands; it messes up 'ps'.
2986 Problem reported by twlevo.
2987
2988 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
2989
2990 * tests/glr-regression.at (Uninitialized location when reporting
2991 ambiguity): New test case.
2992 * data/glr.c (yyresolveLocations): New function, which uses
2993 YYLLOC_DEFAULT.
2994 (yyresolveValue): Invoke yyresolveLocations before reporting an
2995 ambiguity.
2996 * doc/bison.texinfo (Default Action for Locations): Note
2997 YYLLOC_DEFAULT's usage for ambiguity locations.
2998 (GLR Semantic Actions): Cross-reference those notes.
2999
3000 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
3001
3002 * tests/glr-regression.at (Leaked semantic values when reporting
3003 ambiguity): Remove unnecessary union and type declarations.
3004 (Leaked lookahead after nondeterministic parse syntax error): New test
3005 case.
3006 * data/glr.c (yyparse): Check for zero stacks remaining before
3007 attempting to shift the lookahead so that you don't lose it.
3008
3009 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3010
3011 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
3012 * tests/glr-regression.at (Leaked semantic values when reporting
3013 ambiguity): New test case.
3014 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
3015 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
3016 now unnecessary yystackp parameter.
3017 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
3018 destructors can be called.
3019
3020 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
3021 in existing testcases.
3022
3023 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
3024
3025 Don't leak semantic values for parent RHS when a user action cuts the
3026 parser, and clean up related code a bit.
3027 * tests/glr-regression.at (Leaked merged semantic value if user action
3028 cuts parse): Rename to...
3029 (Leaked semantic values if user action cuts parse): ... this. Add check
3030 for leaked parent RHS values.
3031 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
3032 between an unresolved state (non-empty chain of semantic options) and
3033 an incomplete one (signaled by an empty chain).
3034 (yyresolveStates): Document the interface. Move all manipulation of a
3035 successfully or unsuccessfully resolved yyGLRState to...
3036 (yyresolveValue): ... here so that yyresolveValue always leaves a
3037 yyGLRState with consistent data and thus is easier to understand.
3038 Remove the yyvalp and yylocp parameters since they are always just
3039 taken from the yys parameter. When reporting a discarded merged value
3040 in debugging output, note that it is incompletely merged. Document the
3041 interface.
3042 (yyresolveAction): If resolving any of the RHS states fails, destroy
3043 them all rather than leaking them. Thus, as long as user actions are
3044 written to clean up the RHS correctly, yyresolveAction always cleans up
3045 the RHS of a semantic option. Document the interface.
3046
3047 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
3048
3049 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
3050 led to a segmentation fault in GNU Pascal. Problem reported
3051 by Waldek Hebisch.
3052
3053 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
3054
3055 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
3056 mid-rule action inside a nonterminal symbol in order to declare a
3057 destructor for its semantic value.
3058
3059 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
3060
3061 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
3062 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
3063 __cplusplus && ! defined _STDLIB_H && !
3064 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
3065 defined free))]: Include <stdlib.h> rather than rolling our own
3066 declarations of malloc and free, to avoid problems with
3067 incompatible declarations (using 'throw') C++'s stdlib.h. This
3068 should fix Debian bug 340012
3069 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
3070 reported by Guillaume Melquiond.
3071
3072 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
3073
3074 * NEWS: Clarify symbols versus types in unused-value warnings.
3075
3076 * configure.ac (AC_INIT): Bump version number.
3077
3078 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
3079
3080 * NEWS: Version 2.1a.
3081 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
3082 since C99 requires this.
3083
3084 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
3085
3086 * m4/c-working.m4: New file.
3087 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
3088
3089 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
3090
3091 * Makefile.maint: Merge from coreutils.
3092
3093 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
3094
3095 More portability fixes for problems summarized by Nelson H. F. Beebe.
3096
3097 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
3098 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
3099 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
3100 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
3101 messes up because C++ code is compiled in 32-bit mode but linked
3102 in 64-bit mode.
3103
3104 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
3105
3106 More portability fixes for problems summarized by Nelson H. F. Beebe.
3107
3108 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
3109 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
3110
3111 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
3112 nodist_PROGRAMS, since we don't need to actually compile the
3113 example if we're just doing a plain 'make'. This avoids bothering
3114 the installer unnecessarily about problems due to weird C++
3115 compilers.
3116
3117 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
3118
3119 More portability fixes for problems summarized by Nelson H. F. Beebe.
3120
3121 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
3122 than #include "...", and compile with -I'.'. The old method was
3123 not portable, according to Posix and the C standard, and it does
3124 not work with Sun C 5.7, where previous #line directives affect
3125 the working directory used in later #include "..." directives.
3126
3127 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3128
3129 Various DJGGP specific issues in /djgpp
3130
3131 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
3132
3133 More portability fixes for problems summarized by Nelson H. F. Beebe.
3134
3135 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
3136 '#include <map>' works and that you can apply ++ to iterators.
3137
3138 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
3139
3140 Work around portability problems summarized by Nelson H. F. Beebe in
3141 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
3142
3143 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
3144 that '#include <string>' works.
3145
3146 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
3147 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
3148 "warning: sorry: semantics of inline function static data `const
3149 unsigned char translate_table[262]' are wrong (you'll wind up with
3150 multiple copies)".
3151
3152 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
3153 or, xor to not_, and_, or_, and xor_, respectively. This works
3154 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
3155 random system header somewhere that includes the equivalent of
3156 <iso646.h>.
3157
3158 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
3159 -E" works; it apparently doesn't work with PathScale EKO Compiler
3160 Suite Version 2.0.
3161
3162 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
3163
3164 During deterministic GLR operation, user actions should be able to
3165 influence the parse by changing yychar. To make this easier to fix and
3166 to make glr.c easier to evolve in general, don't maintain yytoken in
3167 parallel with yychar; just compute yytoken when needed.
3168 * tests/glr-regression.at (Incorrect lookahead during deterministic
3169 GLR): Check that setting yychar in a user action has the intended
3170 effect.
3171 * data/glr.c (yyGLRStack): Remove yytokenp member.
3172 (yyclearin): Don't set *yytokenp.
3173 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
3174 yychar rather than *yytokenp to determine the current lookahead.
3175 Compute yytoken locally when needed.
3176 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
3177 point to.
3178
3179 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
3180 after `--report' documentation.
3181
3182 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
3183
3184 * src/parse-gram.y (grammar_declaration): Location of printer
3185 symbol is @1, not list->location. Bug reported by twlevo.
3186 * tests/input.at (Incompatible Aliases): Adjust to above change.
3187
3188 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
3189
3190 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
3191 all the test at once. This makes the output easier to read in the
3192 normal case.
3193
3194 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
3195 got from <http://bro-ids.org/download.html>. The bug is that
3196 when two actions appeared in succession, the second one was
3197 scanned before the first one was added to the grammar rule
3198 as a midrule action. Bison then output the incorrect warning
3199 "parse.y:905.17-906.36: warning: unused value: $3".
3200 * src/parse-gram.y (BRACED_CODE, action): These are no longer
3201 associated with a value.
3202 (rhs): Don't invoke grammar_current_rule_action_append.
3203 (action): Invoke it here instead.
3204 * src/reader.c (grammar_midrule_action): Now extern.
3205 (grammar_current_rule_action_append): Don't invoke
3206 grammar_midrule_action; that is now the scanner's job.
3207 * src/reader.h (last_string, last_braced_code_loc):
3208 (grammar_midrule_action): New decls.
3209 * src/scan-gram.l (last_string): Now extern, sigh.
3210 (last_braced_code_loc): New extern variable.
3211 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
3212 rule already has an action.
3213 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
3214 * tests/input.at (AT_CHECK_UNUSED_VALUES):
3215 Add some tests to check that the above changes fixed the bug.
3216
3217 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
3218
3219 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
3220 All used changed. Check whether the symbol has a destructor,
3221 not whether it is typed.
3222 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
3223 that the values are still reported as unused. All line numbers
3224 adjusted.
3225
3226 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
3227
3228 Work around a bug in bro 0.8, which underparenthesizes its
3229 definition of YYLLOC_DEFAULT.
3230 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
3231 their arguments.
3232 * data/lalr1.cc: Likewise.
3233 * data/yacc.cc: Likewise.
3234
3235 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
3236
3237 Work around a bug in Pike 7.0, and give the Pike folks a
3238 better way to override the usual int widths.
3239 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
3240 user can override the types.
3241 (short): #undef, to work around a bug in Pike 7.0.
3242 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
3243 (union yyalloc.yyss): Use yytype_int16 rather than short.
3244 All uses changed.
3245 (yysigned_char): Remove.
3246 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
3247 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
3248 * tests/regression.at (Web2c Actions): Adjust to above changes.
3249
3250 * src/reader.c (check_and_convert_grammar): New function.
3251 (reader): Close the input file even if something went wrong during
3252 parsing. Minor file descriptor leak reported by twlevo.
3253
3254 * src/assoc.c (assoc_to_string): Use a default: abort (); case
3255 to pacify gcc -Wswitch-default.
3256 * src/scan-gram.l (adjust_location): Use a default: break; case
3257 to pacify gcc -Wswitch-default.
3258 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
3259 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
3260 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
3261 Move these decls to scan-skel.l, since they don't need to be
3262 visible elsewhere.
3263 * src/scan-skel.l: Accept the above decls.
3264 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
3265 is used.
3266
3267 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
3268
3269 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
3270 since we don't want to insist on a version number at the start
3271 of the changelog every time.
3272 * Makefile.maint: Sync from coreutils a bit better.
3273 (sc_trailing_blank): Renamed from sc_trailing_space.
3274 All uses changed.
3275 (sc_no_if_have_config_h, sc_require_config_h):
3276 (sc_prohibit_assert_without_use): New rules.
3277 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
3278 (sc_dd_max_sym_length): Fix leading spaces in rule.
3279 (sc_system_h_headers): Prefix with @.
3280 (sc_useless_cpp_parens, m4-check): Output line numbers.
3281 (changelog-check): Allow version only in head.
3282 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
3283 satisfy new Makefile.maint rule.
3284 * data/glr.c: Likewise.
3285 * data/glr.cc: Likewise.
3286 * data/lalr1.cc: Likewise.
3287 * data/yacc.c: Likewise.
3288 * lib/ebitsetv.c: Likewise.
3289 * lib/lbitset.c: Likewise.
3290 * lib/subpipe.c: Likewise.
3291 * lib/timevar.c: Likewise.
3292 * src/system.h: Likewise.
3293 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
3294 * djgpp/Makefile.maint: Add copyright notice.
3295 * djgpp/README.in: Likewise.
3296 * djgpp/config.bat: Likewise.
3297 * djgpp/config.site: Likewise.
3298 * djgpp/config_h.sed: Likewise.
3299 * djgpp/djunpack.bat: Likewise.
3300 * djgpp/config.sed: Fix copyright notice to match standard format.
3301 * djgpp/subpipe.h: Likewise.
3302 * lib/bitsetv-print.c: Likewise.
3303 * lib/bitsetv.c: Likewise.
3304 * lib/subpipe.h: Likewise.
3305 * lib/timevar.c: Likewise.
3306 * lib/timevar.h: Likewise.
3307 * djgpp/subpipe.c: Use standard recipe for config.h.
3308 * lib/abitset.c: Likewise.
3309 * lib/bitset.c: Likewise.
3310 * lib/bitset_stats.c: Likewise.
3311 * lib/bitsetv-print.c: Likewise.
3312 * lib/bitsetv.c: Likewise.
3313 * lib/ebitsetv.c: Likewise.
3314 * lib/get-errno.c: Likewise.
3315 * lib/lbitset.c: Likewise.
3316 * lib/subpipe.c: Likewise.
3317 * lib/timevar.c: Likewise.
3318 * lib/vbitset.c: Likewise.
3319 * tests/local.at: Likewise.
3320 * src/scan-gram.l: Don't include verify.h, since system.h does
3321 that for us.
3322 * .x-sc_require_config_h: New file.
3323 * .x-sc_unmarked_diagnostics: New file.
3324
3325 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
3326
3327 Be a bit more systematic about using 'abort'.
3328 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
3329 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
3330 Put 'default: abort ();' before some other case, to satisfy older
3331 pedantic compilers.
3332 * lib/bitset_stats.c (bitset_stats_init): Likewise.
3333 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
3334 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
3335 * src/conflicts.c (resolve_sr_conflict): Likewise.
3336 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
3337 (get_decision_str, get_orientation_str, get_node_alignment_str):
3338 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
3339 (get_linestyle_str, get_arrowstyle_str): Likewise.
3340 * src/conflicts.c (resolve_sr_conflict):
3341 Use a default case rather than one for the one remaining enum
3342 value, to catch invalid enum values as well.
3343 * src/lalr.c (set_goto_map, map_goto):
3344 Prefer "assert (FOO);" to "if (!FOO) abort ();".
3345 * src/nullable.c (nullable_compute, token_definitions_output):
3346 Likewise.
3347 * src/reader.c (packgram, reader): Likewise.
3348 * src/state.c (transitions_to, state_new, state_reduction_find):
3349 Likewise.
3350 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
3351 (symbol_pack): Likewise.
3352 * src/tables.c (conflict_row, pack_vector): Likewise.
3353 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
3354 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
3355 * src/system.h: Don't include <assert.h>.
3356 (assert): New macro.
3357
3358 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
3359 (Destructor Decl, Parser Function, Pure Calling):
3360 Describe rules for braces inside C code more carefully.
3361
3362 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
3363
3364 Fix some porting glitches found by Nelson H. F. Beebe.
3365 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
3366 compilers that don't understand that abort () does not return.
3367 * src/state.c (transitions_to): Likewise.
3368 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
3369 that '#include <cstdlib>' works.
3370 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
3371 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
3372 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
3373 for the benefit of some pre-C99 compilers.
3374
3375 * bootstrap: Undo changes to gnulib files that autoreconf made.
3376
3377 Minor fixups to get 'make maintainer-check' to work.
3378 * configure.ac: Don't use -Wnested-externs, as it's incompatible
3379 with the new verify.h implementation.
3380 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
3381 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
3382 * data/yacc.c (YYUSE): Likewise.
3383 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
3384 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
3385 * src/parse-gram.y (declaration): Don't pass a string constant
3386 to a function that expects char *, since GCC might complain
3387 about the constant value.
3388 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
3389 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
3390 before #defining them.
3391 * tests/glr-regression.at
3392 (Incorrectly initialized location for empty right-hand side in GLR):
3393 In yyerror, use the msg arg.
3394 (Corrupted semantic options if user action cuts parse):
3395 (Incorrect lookahead during deterministic GLR):
3396 (Incorrect lookahead during nondeterministic GLR):
3397 Don't name a local var 'index'; it shadows string.h's 'index'.
3398
3399 2006-01-19 Akim Demaille <akim@epita.fr>
3400
3401 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
3402 location, not just parts of it.
3403
3404 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
3405
3406 * NEWS: Document the fact that multiple %unions are now allowed.
3407 * doc/bison.texinfo (Union Decl): Likewise.
3408 * TODO: This feature is now implemented, so remove it from
3409 the wishlist.
3410
3411 * Makefile.maint: Merge with coreutils Makefile.maint.
3412 (CVS_LIST): Use build-aux version if available.
3413 (VERSION_REGEXP): New macro.
3414 (syntax-check-rules): Add sc_no_if_have_config_h,
3415 sc_prohibit_assert_without_use, sc_require_config_h,
3416 sc_useless_cpp_parens.
3417 (sc_obsolete_symbols): Check for O_NDELAY.
3418 (sc_dd_max_sym_length): Track coreutils.
3419 (sc_unmarked_diagnostics): Look in all files, not just *.c.
3420 (sc_useless_cpp_parens): New rule.
3421 (news-date-check): Look for version or today's date.
3422 (changelog-check): Don't require version number near head.
3423 (copyright-check): Use current year instead of hardwiring 2005.
3424 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
3425 (announcement): Add --gpg-key-ID.
3426
3427 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
3428 with "file system".
3429
3430 Avoid undefined behavior that addressed just before the start of an
3431 array. Problem reported by twlevo.
3432 * src/reader.c (packgram): Prepend a new sentinel before ritem.
3433 * src/lalr.c (build_relations): Rely on new sentinel.
3434 * src/gram.c (gram_free): Adjust to new sentinel.
3435
3436 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
3437
3438 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
3439 yylookaheadNeeds. All uses updated.
3440 (yysplitStack): Rename local yynewLookaheadStatuses to
3441 yynewLookaheadNeeds.
3442 * data/glr-regression.at (Incorrect lookahead during nondeterministic
3443 GLR): In comments, change `lookahead status' to `lookahead need'.
3444
3445 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3446
3447 * data/glr.c (yysplitStack): A little stylistic rewrite.
3448
3449 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3450
3451 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
3452
3453 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
3454
3455 * doc/bison.texinfo: Fix some typos.
3456 (GLR Semantic Actions): New subsection discussing special
3457 considerations because GLR semantic actions might be deferred.
3458 (Actions): Mention look-ahead usage of yylval.
3459 (Actions and Locations): Mention look-ahead usage of yylloc.
3460 (Special Features for Use in Actions): Add YYEOF entry and mention it
3461 in the yychar entry.
3462 In the yychar entry, remove mention of the local yychar case (pure
3463 parser) since this is irrelevant information when writing semantic
3464 actions and since it's already discussed in `Bison Symbols' where
3465 yychar is otherwise described as an external variable.
3466 In the yychar entry, don't call it the `current' look-ahead since it
3467 isn't when semantic actions are deferred.
3468 In the yychar and yyclearin entries, add note about deferred semantic
3469 actions.
3470 Add yylloc and yylval entries discussing look-ahead usage.
3471 (Look-Ahead Tokens): When discussing yychar, don't call it the
3472 `current' look-ahead, and do mention yylval and yylloc.
3473 (Error Recovery): Cross-reference `Action Features' when mentioning
3474 yyclearin.
3475 (Bison Symbols): In the yychar entry, don't call it the `current'
3476 look-ahead.
3477 In the yylloc and yylval entries, mention look-ahead usage.
3478
3479 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
3480
3481 * tests/glr-regression.at: Update copyright year to 2006.
3482
3483 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3484
3485 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
3486 use during nondeterministic operation to track which stacks have
3487 actually needed the current lookahead.
3488 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
3489 Allocate, deallocate, resize, and otherwise shuffle space for
3490 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
3491 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
3492 appropriately during nondeterministic operation.
3493 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
3494 members to store the current lookahead to be used by the deferred
3495 user action.
3496 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
3497 from which the RHS is taken. Set the lookahead members of the new
3498 yySemanticOption according to the lookahead status for stack yyk.
3499 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
3500 yyaddDeferredAction.
3501 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
3502 members of yySemanticOption before invoking yyuserAction, and then set
3503 them back to their current values afterward.
3504 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
3505 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
3506 * tests/glr-regression.at: Remove `.' from the ends of recent test case
3507 titles for consistency.
3508 (Leaked merged semantic value if user action cuts parse): In order to
3509 suppress lint warnings, use arguments in merge function, and assign
3510 char value < 128 in main.
3511 (Incorrect lookahead during deterministic GLR): New test case.
3512 (Incorrect lookahead during nondeterministic GLR): New test case.
3513
3514 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3515
3516 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
3517 !yyvaluep as signal that no semantic value is available to print.
3518 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
3519 to print a semantic value.
3520
3521 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
3522
3523 * tests/glr-regression.at: For consistency with my newer test cases,
3524 don't thank myself.
3525
3526 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
3527
3528 * data/glr.c (yyresolveValue): When merging semantic options, if at
3529 least one user action succeeds but a later one cuts the parse, then
3530 destroy the semantic value before returning rather than leaking it.
3531 (yyresolveStates): If a user action cuts the parse and thus
3532 yyresolveValue fails, ignore the (unset) semantic value rather than
3533 corrupting the yyGLRState, and empty the semantic options list since
3534 the user actions should have called all necessary destructors.
3535 Simplify code with YYCHK.
3536 * tests/glr-regression.at (Corrupted semantic options if user action
3537 cuts parse): New test case.
3538 (Undesirable destructors if user action cuts parse): New test case.
3539 Before applying any of this patch, this test case never actually failed
3540 for me... but only because the corrupted semantic options usually
3541 masked this bug.
3542 (Leaked merged semantic value if user action cuts parse): New test
3543 case.
3544
3545 2006-01-05 Akim Demaille <akim@epita.fr>
3546
3547 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
3548
3549 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
3550
3551 * data/c.m4 (b4_c_modern): New macro, with a new provision for
3552 _MSC_VER. Problem reported by Cenzato Marco.
3553 (b4_c_function_def): Use it.
3554 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
3555 b4_c_modern.
3556 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
3557 than rolling our own.
3558
3559 2006-01-04 Akim Demaille <akim@epita.fr>
3560
3561 Also warn about non-used mid-rule values.
3562 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
3563 member.
3564 (symbol_list_new): Adjust.
3565 * src/reader.c (symbol_typed_p): New.
3566 (grammar_rule_check): Use it.
3567 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
3568 Check its rule.
3569 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
3570 Use it.
3571 * tests/actions.at (Exotic Dollars): Adjust.
3572
3573 2006-01-04 Akim Demaille <akim@epita.fr>
3574
3575 * src/reader.c (grammar_midrule_action): If $$ is set in a
3576 mid-rule, move the `used' bit to its lhs.
3577 * tests/input.at (Unused values): New.
3578 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
3579
3580 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
3581
3582 * doc/bison.texinfo (Bison Options): Say more accurately what
3583 --yacc does.
3584 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
3585 about declarations in the grammar when in Yacc mode, as POSIX does
3586 not require a diagnostic when the grammar uses extensions.
3587
3588 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
3589
3590 Warn about dubious constructions like "%token T T".
3591 Reported by twlevo.
3592 * src/symtab.h (struct symbol.declared): New member.
3593 * src/symtab.c (symbol_new): Initialize it to false.
3594 (symbol_class_set): New arg DECLARING, specifying whether
3595 this is a declaration that we want to warn about, if there
3596 is more than one of them. All uses changed.
3597
3598 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
3599 Allow multiple %union directives, whose contents concatenate.
3600 * src/parse-gram.y (grammar_declaration): Likewise.
3601 Use muscle_code_grow, so that we don't need stype_line any more.
3602 All uses changed.
3603
3604 * src/muscle_tab.c (muscle_grow): Fix comment.
3605
3606 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
3607 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
3608 Update copyright year to 2006.
3609
3610 2006-01-03 Akim Demaille <akim@epita.fr>
3611
3612 Have glr.cc pass (some of) the calc.at tests.
3613 * data/glr.cc (b4_parse_param_orig): New.
3614 (b4_parse_param): Improve its definition, and bound it more
3615 clearly in the skeleton.
3616 (b4_epilogue): Append, instead of prepending, in order to keep
3617 #line consistency.
3618 Simplify the generation of auxiliary functions: locations and
3619 purity are mandated.
3620 (b4_global_tokens_and_yystype): Honor it.
3621 * data/location.cc (c++.m4): Don't include it.
3622 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
3623 and AT_SKEL_CC_IF.
3624 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
3625 AT_LALR1_CC_IF.
3626 Be sure to initialize the first position's filename.
3627 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
3628 mandated anyway.
3629 (AT_CHECK_CALC_GLR_CC): New.
3630 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
3631
3632 2006-01-02 Akim Demaille <akim@epita.fr>
3633
3634 * src/output.c (output_skeleton): Don't hard wire the inclusion of
3635 c.m4.
3636 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3637 * data/glr.cc: Do not include stack.hh.
3638
3639 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
3640
3641 * data/glr.c: Reformat whitespace with tabs.
3642 (b4_lpure_formals): Remove this unused m4 macro.
3643 * tests/cxx-type.at: Reformat whitespace with tabs.
3644 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
3645 since it's a member. Rename type to isNterm for clarity.
3646
3647 2005-12-29 Akim <akim@sulaco.local>
3648
3649 Let glr.cc catch up with symbol_value_print.
3650 * data/glr.cc (b4_yysymprint_generate): Replace by...
3651 (b4_yy_symbol_print_generate): this.
3652 (yy_symbol_print, yy_symbol_value_print): Declare them.
3653
3654 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
3655
3656 * src/location.h (boundary): Note that a line or column equal
3657 to INT_MAX indicates an overflow.
3658 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
3659 (rule_length_overflow, increment_rule_length, add_column_width):
3660 New functions.
3661 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
3662 (<SC_BRACED_CODE>"}"):
3663 Use increment_rule_length rather than incrementing it by hand.
3664 (adjust_location, handle_syncline): Diagnose overflow.
3665 (handle_action_dollar, handle_action_at):
3666 Fix bug with monstrosities like $-2147483648.
3667 Remove now-unnecessary checks.
3668 (scan_integer): Verify assumptions and remove now-unnecessary checks.
3669 (convert_ucn_to_byte): Verify assumptions.
3670 (handle_syncline): New arg LOC. All callers changed.
3671 Don't store through a value derived from char const * pointer.
3672
3673 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
3674 GCC warnings.
3675
3676 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
3677
3678 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
3679 Remove unnecessary forward static decls.
3680
3681 2005-12-27 Akim Demaille <akim@epita.fr>
3682
3683 * src/reader.c (grammar_current_rule_check): Also check that $$
3684 is used.
3685 Take the rule to check as argument, hence rename as...
3686 (grammar_rule_check): this.
3687 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
3688 Rename as...
3689 (grammar_rule_begin, grammar_rule_end): these, for consistency.
3690 (grammar_midrule_action, grammar_symbol_append): Now static.
3691 * tests/torture.at (input): Don't rely on the default action
3692 being always performed.
3693 * tests/calc.at: "Set" $$ even when the action is "cut" with
3694 YYERROR or other.
3695 * tests/actions.at (Exotic Dollars): Instead of using unused
3696 values, check that the warning is issued.
3697
3698 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
3699
3700 * NEWS: Improve wording for unused-value warnings.
3701
3702 2005-12-22 Akim Demaille <akim@epita.fr>
3703
3704 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
3705 (b4_yysymprint_generate): Rename as...
3706 (b4_yy_symbol_print_generate): this.
3707 Generate yy_symbol_print instead of yysymprint.
3708 Generate also yy_symbol_value_print, and use it.
3709
3710 2005-12-22 Akim Demaille <akim@epita.fr>
3711
3712 * NEWS: Warn about unused values.
3713 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
3714 a `used' member.
3715 (symbol_list_n_get, symbol_list_n_used_set): New.
3716 (symbol_list_n_type_name_get): Use symbol_list_n_get.
3717 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
3718 * src/reader.c (grammar_current_rule_check): Check that values are
3719 used.
3720 * src/symtab.c (symbol_print): Accept 0.
3721 * tests/existing.at: Remove the type information.
3722 Empty the actions.
3723 Remove useless actions (beware of mid-rule actions: perl -000
3724 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
3725 * tests/actions.at (Exotic Dollars): Use unused values.
3726 * tests/calc.at: Likewise.
3727 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3728 Likewise.
3729
3730 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
3731 rule_useful_p.
3732
3733 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
3734
3735 Undo 2005-12-01 tentative license wording change. The wording is
3736 still being reviewed by the lawyers, and we don't want to wait for
3737 them before publishing a test release. For now, revert to the
3738 previous wording.
3739 * NEWS: Undo 2005-12-01 change.
3740 * data/glr.c: Revert to previous license wording.
3741 * data/glr.cc: Likewise.
3742 * data/lalr1.cc: Likewise.
3743 * data/location.cc: Likewise.
3744 * data/yacc.c: Likewise.
3745
3746 * NEWS: Reword %destructor vs YYABORT etc.
3747 * data/glr.c: Use American spacing, for consistency.
3748 * data/glr.cc: Likewise.
3749 * data/lalr1.cc: Likewise.
3750 * data/yacc.c: Likewise.
3751 * data/yacc.c: Reformat comments slightly.
3752 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
3753 for consistency. Fix some spelling errors and reword recently-included
3754 text slightly.
3755 * tests/cxx-type.at: Cast results of malloc, for C++.
3756
3757 2005-12-21 Joel E. Denny <address@hidden>
3758
3759 * tests/cxx-type.at: Construct a tree, count the parents of shared
3760 nodes, and free each node once and only once. Previously, the memory
3761 for semantic values was leaked instead.
3762
3763 2005-12-21 Joel E. Denny <address@hidden>
3764
3765 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
3766 (yylval, yylloc): If pure, #define to yystackp->yyval and
3767 yystackp->yyloc similar to yychar and yynerrs.
3768 (yyparse): If pure, remove local yylval and yylloc. Add local
3769 yystackp to accommodate pure definitions of yylval and yylloc.
3770 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
3771 yylvalp and yyllocp to &yylval and &yylloc.
3772 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
3773 namespace. Previously, nerrs and char were missing, but lval and lloc
3774 weren't necessary.
3775 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
3776 yylvalp and yyllocp parameters since, if pure, these are now always
3777 accessible through yystackp. If not pure, they are still accessible
3778 globally.
3779 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
3780 `if (YYID (N))' to pacify lint.
3781
3782 2005-12-21 Akim Demaille <akim@epita.fr>
3783
3784 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
3785 destroy the RHS symbols of a rule.
3786 * data/yacc.c (yylen): Initialize to 0.
3787 Keep its value to the number of items to possibly shift.
3788 In particular, a regular successful parse that ends on YYFINAL by
3789 a (internal) YYACCEPT must not have yylen != 0.
3790 (yyerrorlab, yyreturn): Pop the RHS.
3791 Reorder a bit to emphasize the `shifting' bits of code.
3792 (YYPOPSTACK): Now accept a number of items to pop.
3793 * data/lalr1.cc: Likewise.
3794 * data/glr.c: Formatting changes.
3795 Use goto instead of fall through.
3796 * doc/bison.texinfo (Destructor Decl): Complete.
3797
3798 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3799
3800 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3801 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
3802 * djgpp/config.bat: Replace every occurence of the file name
3803 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3804 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3805 * djgpp/config.sed: Replace every occurence of the file name
3806 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3807 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3808 * djgpp/djunpack.bat: DJGPP specific file.
3809 * djgpp/fnchange.lst: DJGPP specific file.
3810 * djgpp/README.in: Add new information about how to unpack the bison
3811 source on MSDOS and other systems which have 8.3 file name restrictions
3812 using djunpack.bat and fnchange.lst.
3813
3814 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
3815
3816 * bootstrap (build_cvs_prefix): Remove; unused.
3817 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
3818 when getting gnulib.
3819
3820 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
3821
3822 * data/glr.c: Reorder typedef declarations for structs to match order
3823 of struct declarations.
3824 Rename yystack everywhere to yystackp except in yyparse where it's not
3825 a pointer.
3826 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
3827 consistency.
3828 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
3829 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
3830 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
3831 lint.
3832
3833 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
3834
3835 * tests/sets.at (Accept): Fix typos in regular expression used to
3836 sed out the final state number.
3837
3838 Work around portability problem on Solaris 10: flex-generated
3839 files include <stdio.h> before <config.h>, which messes up
3840 because the latter defines __EXTENSIONS__. Address the problem
3841 by creating two new little files that include <config.h> first,
3842 then include the flex-generated files. Rewrite everyone else
3843 to include <config.h> first, as well.
3844 * lib/timevar.c: Always include "config.h".
3845 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
3846 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
3847 (EXTRA_bison_SOURCES): New macro.
3848 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
3849 * src/system.h: Don't include config.h.
3850 * src/LR0.c: Include <config.h> first.
3851 * src/assoc.c: Likewise.
3852 * src/closure.c: Likewise.
3853 * src/complain.c: Likewise.
3854 * src/conflicts.c: Likewise.
3855 * src/derives.c: Likewise.
3856 * src/files.c: Likewise.
3857 * src/getargs.c: Likewise.
3858 * src/gram.c: Likewise.
3859 * src/lalr.c: Likewise.
3860 * src/location.c: Likewise.
3861 * src/main.c: Likewise.
3862 * src/muscle_tab.c: Likewise.
3863 * src/nullable.c: Likewise.
3864 * src/output.c: Likewise.
3865 * src/parse-gram.y: Likewise.
3866 * src/print.c: Likewise.
3867 * src/print_graph.c: Likewise.
3868 * src/reader.c: Likewise.
3869 * src/reduce.c: Likewise.
3870 * src/relation.c: Likewise.
3871 * src/state.c: Likewise.
3872 * src/symlist.c: Likewise.
3873 * src/symtab.c: Likewise.
3874 * src/tables.c: Likewise.
3875 * src/uniqstr.c: Likewise.
3876 * src/vcg.c: Likewise.
3877
3878 * src/parse-gram.y: Fix minor problems uncovered by lint.
3879 (current_lhs, current_lhs_location): Now static.
3880 (current_assoc): Remove unused variable.
3881
3882 Cleanups so that Bison-generated parsers have less lint.
3883 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
3884 Prepend /*ARGSUSED*/, for lint's sake.
3885 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
3886 definition if 'lint' is defined.
3887 (YYID): New macro (or function, if lint).
3888 All uses of /*CONSTCOND*/0 replaced by YYID(0).
3889 * data/yacc.c: Likewise.
3890 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
3891 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
3892 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
3893 is C++ only.
3894 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
3895 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
3896 Use YYID(0) rather than 0, for lint.
3897 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
3898 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
3899
3900 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
3901
3902 * tests/glr-regression.at
3903 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
3904 Close memory leak reported by twlevo.
3905
3906 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
3907
3908 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
3909 all stacks.
3910 (yyparse): Iterate another stack in order to call user destructors.
3911 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3912 New test case.
3913 (Duplicated user destructor for lookahead): This test now is expected
3914 to succeed.
3915
3916 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
3917
3918 * NEWS: Document the following change.
3919 * data/yacc.c: Say "parser skeleton" rather than "file", since
3920 it's no longer just a file.
3921 * data/glr.c: Grant a special exception for C GLR parsers, that
3922 reads like the already-existing exception for C LALR(1) parsers.
3923 * data/glr.cc: Likewise.
3924 * data/lalr1.cc: Likewise.
3925 * data/location.cc: Likewise.
3926 * data/yacc.c: Reword the "written by" statement to clarify that
3927 it was the parser skeleton, not the entire output file.
3928 * data/glr.c: Written by Paul Hilfinger.
3929 * data/glr.cc: Written by Akim Demaille.
3930 * data/lalr1.cc: Likewise.
3931
3932 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
3933
3934 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
3935 Fix typos in previous change that broke 'make check'.
3936 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
3937 supported in C.
3938 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
3939 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
3940 We can revert this once things settle down.
3941
3942 * src/conflicts.c (conflicts_print): Don't print file name twice
3943 when %expect fails because there were no conflicts.
3944 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
3945 change.
3946 * tests/conflicts.at (%expect not enough, %expect too much):
3947 (%expect with reduce conflicts): Adjust to new behavior.
3948
3949 2005-11-18 Akim Demaille <akim@epita.fr>
3950
3951 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
3952 errors.
3953 * NEWS: Document this.
3954 * doc/bison.texinfo (Expect Decl): Likewise.
3955
3956 2005-11-16 Akim Demaille <akim@epita.fr>
3957
3958 Generalize the display of semantic values and locations in traces.
3959 * data/glr.c (yy_reduce_print): Fix indices (again).
3960 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
3961 literal integers.
3962 * data/lalr1.cc (yyreduce_print): Rename as...
3963 (yy_reduce_print): this.
3964 Display values and locations.
3965 * data/yacc.c (yy_reduce_print): Likewise.
3966 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
3967 (yysymprint): Move higher to be visible from yy_reduce_print).
3968 (yyparse): Adjust.
3969 * tests/calc.at: Adjust the expected length of the traces.
3970
3971 2005-11-14 Akim Demaille <akim@epita.fr>
3972
3973 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
3974 from 1 to N, while values and location start at 0.
3975 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
3976
3977 2005-11-14 Akim Demaille <akim@epita.fr>
3978
3979 * data/glr.c (yy_reduce_print): Fix the $ number.
3980
3981 2005-11-14 Akim Demaille <akim@epita.fr>
3982
3983 "Use" parse parameters.
3984 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
3985 * data/glr.c, data/glr.cc: Use them.
3986 * data/glr.c (YYUSE): Have a C++ definition that supports
3987 non-pointer types.
3988
3989 2005-11-14 Akim Demaille <akim@epita.fr>
3990
3991 * data/glr.c (yyexpandGLRStack): Declare only if defined.
3992
3993 2005-11-14 Akim Demaille <akim@epita.fr>
3994
3995 * data/glr.cc: New.
3996 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
3997
3998 2005-11-12 Akim Demaille <akim@epita.fr>
3999
4000 Let position and location be PODs.
4001 * data/location.cc (position::initialize, location::initialize): New.
4002 (position::position, location::location): Define only if
4003 b4_location_constructors is defined.
4004 * data/lalr1.cc (b4_location_constructors): Define it for backward
4005 compatibility.
4006 * doc/bison.texinfo (Initial Action Decl): Use initialize.
4007
4008 2005-11-12 Akim Demaille <akim@epita.fr>
4009
4010 * data/lalr1.cc: Move the body of the ctor and dtor into the
4011 parser file (instead of the header).
4012 Wrap the implementations in a "namespace yy".
4013
4014 2005-11-12 Akim Demaille <akim@epita.fr>
4015
4016 Have glr.c include its header file when created.
4017 * data/glr.c (b4_shared_declarations): New.
4018 Output them verbatim in the parser if !%defines, otherwise
4019 output then in the header file, and include it instead.
4020
4021 2005-11-11 Akim Demaille <akim@epita.fr>
4022
4023 * data/glr.c: Comment changes.
4024
4025 2005-11-11 Akim Demaille <akim@epita.fr>
4026
4027 When yydebug, report semantic and location values for reductions.
4028 * data/glr.c (yy_reduce_print): Report the semantic values and the
4029 locations.
4030 (YY_REDUCE_PRINT): Adjust.
4031 (yyglrReduce): Use them.
4032 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
4033 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
4034 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
4035 traces.
4036
4037 2005-11-10 Akim Demaille <akim@epita.fr>
4038
4039 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
4040 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
4041 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
4042
4043 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
4044
4045 * m4/cxx.m4, examples/Makefile.am: Don't build
4046 examples/calc++ if no C++ compiler is available. (trivial change)
4047
4048 2005-11-09 Akim Demaille <akim@epita.fr>
4049
4050 * src/scan-skel.l: Use a couple of asserts.
4051
4052 2005-11-03 Akim Demaille <akim@epita.fr>
4053
4054 In some (weird) cases, the final state number is incorrect.
4055 Reported by Alexandre Duret-Lutz.
4056 * src/LR0.c (state_list_append): Remove the computation of
4057 final_state.
4058 (save_reductions): Do it here.
4059 (get_state): Alpha conversion.
4060 (generate_states): Use a for loop.
4061 * src/gram.h (item_number_is_rule_number)
4062 (item_number_is_symbol_number): New.
4063 * src/state.c: Use assert.
4064 * src/system.h: Include assert.h.
4065 * tests/sets.at (Accept): New.
4066
4067 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4068
4069 * data/glr.c (yyfill): Adjust comment.
4070 (yyresolveAction): Initialize default location properly
4071 for empty right-hand sides.
4072 (yydoAction): Ditto.
4073 Add comment explaining apparently dead code.
4074 * tests/glr-regression.at
4075 (Incorrectly initialized location for empty right-hand side in GLR):
4076 New test.
4077
4078 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
4079
4080 * bootstrap (cleanup_gnulib): New function. Use it to clean up
4081 gnulib when interrupted. This fixes some race conditions and
4082 works around some portability problems (one noted by Paul
4083 Hilfinger).
4084
4085 2005-10-22 Akim <akim@epita.fr>
4086
4087 * Makefile.cfg: Adjust to config -> build-aux.
4088 Reported by twledo.
4089
4090 2005-10-21 Akim Demaille <akim@epita.fr>
4091
4092 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
4093 the %parse-params.
4094 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
4095 * data/yacc.c (b4_Pure_if): Rename as...
4096 (b4_yacc_pure_if): this.
4097 (YY_SYMBOL_PRINT, yyparse): Adjust.
4098 * doc/bison.texinfo: Formatting changes.
4099
4100 2005-10-21 Akim Demaille <akim@epita.fr>
4101
4102 Finish the transition config -> build-aux.
4103 * configure.ac, Makefile.am: Use build-aux.
4104 * config/prev-version, config/announce-gen, config/Makefile.am:
4105 Move to...
4106 * build-aux/prev-version, build-aux/announce-gen,
4107 * build-aux/Makefile.am: here.
4108
4109 2005-10-14 Akim Demaille <akim@epita.fr>
4110
4111 * examples/calc++/test: Use set -x only when VERBOSE.
4112
4113 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
4114
4115 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
4116 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
4117
4118 2005-10-13 Akim Demaille <akim@epita.fr>
4119
4120 * src/scan-skel.l: Output the base name parts of the parser and
4121 header file names.
4122 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
4123 additional checks.
4124 Use this to exercise C++ outputs in subdirs.
4125 Reported by Oleg Smolsky.
4126
4127 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
4128
4129 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
4130 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
4131 Problem reported by John P. Hartmann.
4132 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
4133 already defined it.
4134
4135 2005-10-12 Akim Demaille <akim@epita.fr>
4136
4137 * src/parse-gram.y (version_check): Exit 63 to please missing
4138 (stands for "version mismatch).
4139 * tests/input.at, doc/bison.texinfo: Adjust.
4140
4141 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
4142
4143 Work around portability problems with Visual Age C compiler
4144 (xlc and xlC_r) reported by John P. Hartmann.
4145 * data/location.cc (initial_column, initial_line): Remove.
4146 All uses replaced by 0 and 1.
4147 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
4148 that xlc complains about.
4149 * src/scan-skel.l (skel_wrap): Likewise.
4150 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
4151 as __STDC__.
4152 * data/yacc.c (YYMODERN_C): New macro, which also looks at
4153 __STDC_VERSION__. Use it everywhere instead of looking at
4154 __STDC__ and __cplusplus.
4155
4156 2005-10-10 Akim Demaille <akim@epita.fr>
4157
4158 * examples/calc++/test: Be quiet unless VERBOSE.
4159
4160 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
4161
4162 * data/c.m4 (yydestruct, yysymprint):
4163 Use YYUSE instead of casting to void.
4164 * data/glr.c (YYUSE): New macro.
4165 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
4166 Use it instead of rolling our own.
4167 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
4168 (YYCHK1):
4169 Use /*CONSTCOND*/ to suppress lint warnings.
4170 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
4171 (YY_STACK_PRINT): Use 'false' not '0'.
4172 (YYUSE): New macro.
4173 (yysymprint_, yydestruct_): Use it instead of rolling our own.
4174 * data/yacc.c (YYUSE): New macro.
4175 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
4176 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
4177 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
4178
4179
4180 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
4181 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
4182
4183 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
4184
4185 Undo the parts of the unlocked-I/O change that substituted
4186 putc or puts for printf. This might hurt performance a bit,
4187 but some people prefer the printf style.
4188 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
4189 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
4190 All uses replaced by YYFPRINTF and YYDPRINTF.
4191 * data/yacc.c: Likewise.
4192 * lib/bitset.c (bitset_print): Likewise.
4193 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
4194 putc and puts.
4195 * lib/lbitset.c (debug_lbitset): Likewise.
4196 * src/closure.c (print_firsts, print_fderives): Likewise.
4197 * src/gram.c (grammar_dump): Likewise.
4198 * src/lalr.c (look_ahead_tokens_print): Likewise.
4199 * src/output.c (escaped_output): Likewise.
4200 (user_actions_output): Break apart two printfs.
4201 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
4202 * src/reduce.c (reduce_print): Likewise.
4203 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
4204 * src/system.h: Include unlocked-io.h rathe than stdio.h.
4205
4206 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
4207 Use assignments rather than casts-to-void to suppress
4208 unused-variable warnings. This pacifies 'lint'.
4209 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
4210 unused-variable warnings.
4211
4212 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4213
4214 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
4215
4216 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
4217
4218 Use unlocked I/O for a minor performance improvement on hosts like
4219 GNU/Linux and Solaris that support unlocked I/O. The basic idea
4220 is to use the gnlib unlocked-io module, and to prefer putc and
4221 puts to printf when either will work (since the latter doesn't
4222 come in an unlocked flavor).
4223 * bootstrap (gnulib_modules): Add unlocked-io.
4224 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
4225 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
4226 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
4227 and similarly for puts and putc and printf.
4228 * data/yacc.c: Likewise.
4229 * lib/bitset.c (bitset_print): Likewise.
4230 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
4231 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
4232 to printf.
4233 * lib/lbitset.c (debug_lbitset): Likewise.
4234 * src/closure.c (print_firsts, print_fderives): Likewise.
4235 * src/gram.c (grammar_dump): Likewise.
4236 * src/lalr.c (look_ahead_tokens_print): Likewise.
4237 * src/output.c (escaped_output): Likewise.
4238 (user_actions_output): Coalesce two printfs.
4239 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
4240 * src/reduce.c (reduce_print): Likewise.
4241 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
4242 * src/system.h: Include unlocked-io.h rather than stdio.h.
4243
4244 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
4245 this confuses xgettext.
4246
4247 2005-10-02 Akim Demaille <akim@epita.fr>
4248
4249 * bootstrap (gnulib_modules): Add strverscmp.
4250 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
4251 * m4/.cvsignore: Add strverscmp.m4.
4252 * src/parse-gram.y (%require): New token, new rule.
4253 (version_check): New.
4254 * src/scan-gram.l (%require): Adjust.
4255 * tests/input.at (AT_REQUIRE): New.
4256 Use it.
4257 * doc/bison.texinfo (Require Decl): New.
4258 (Calc++ Parser): Use %require.
4259
4260 2005-10-02 Akim Demaille <akim@epita.fr>
4261
4262 * data/location.cc: New.
4263
4264 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
4265 Akim Demaille <akim@epita.fr>
4266
4267 Make sure -odir/foo.cc creates dir/location.hh etc.
4268 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
4269 (spec_file_prefix, spec_verbose_file, spec_graph_file)
4270 (spec_defines_file): Now const.
4271 (dir_prefix): New.
4272 (short_base_name): Remove.
4273 * src/files.c: Adjust.
4274 (dirname.h): Include.
4275 (base_name): Don't prototype it.
4276 (finput): Remove, duplicates gram_in.
4277 (full_base_name, short_base_name): Replace by...
4278 (all_but_ext, all_but_tab_ext): these.
4279 (compute_base_names): Rename as...
4280 (compute_file_name_parts): this.
4281 Update to compute the new variables, including dir_prefix.
4282 Adjust dependencies.
4283 * src/output.c (prepare): Output them.
4284 * src/reader.c: Adjust to use gram_in, not finput.
4285 * src/scan-skel.l (@dir_prefix@): New.
4286
4287 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4288
4289 * lib/subpipe.c: New function end_of_output_subpipe() added
4290 to allow support for non-posix systems. This is a no-op function
4291 for posix systems.
4292
4293 * lib/subpipe.h: New function end_of_output_subpipe() added
4294 to allow support for non-posix systems. This is a no-op function
4295 for posix systems.
4296
4297 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
4298 handle the lack of pipe/fork functionality on non-posix systems.
4299
4300 * djgpp/Makefile.maint: DJGPP specific file.
4301
4302 * djgpp/README.in: DJGPP specific file.
4303
4304 * djgpp/config.bat: DJGPP specific configuration file.
4305
4306 * djgpp/config.sed: DJGPP specific configuration file.
4307
4308 * djgpp/config.site: DJGPP specific configuration file.
4309
4310 * djgpp/config_h.sed: DJGPP specific configuration file.
4311
4312 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
4313
4314 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
4315
4316 2005-10-02 Akim Demaille <akim@epita.fr>
4317
4318 * data/location.cc: New, extract from...
4319 * data/lalr1.cc: here.
4320 (location.hh): Include it after the user prologue, in case the
4321 filename type is defined by the user.
4322 Forward declation location and position before the pre-prologue.
4323 (yyresult_): Rename as...
4324 (yyresult): this, it's a local variable, not an attribute.
4325 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
4326
4327 2005-10-01 Akim Demaille <akim@epita.fr>
4328
4329 * examples/extexi: Restore the #line generation.
4330
4331 2005-09-30 Akim Demaille <akim@epita.fr>,
4332 Alexandre Duret-Lutz <adl@gnu.org>
4333
4334 Move the token type and YYSTYPE in the parser class.
4335 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
4336 (parser::token): New, from the moved free definition of tokens.
4337 (parser::semantic_value): Now a full definition instead of an
4338 indirection to YYSTYPE.
4339 (b4_post_prologue): No longer included in the header file, but
4340 in the implementation file.
4341 * doc/bison.texi (C+ Language Interface): Update.
4342 * src/parse-gram.y: Support unary %define.
4343 * tests/actions.at: Define global_tokens_and_yystype for backward
4344 compatibility until we update the tests.
4345 * tests/calc.at: Idem.
4346 (first_line, first_column, last_line, last_column): Define for lalr1.cc
4347 to simplify the code.
4348
4349 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
4350
4351 Port to SunOS 4.1.4, which lacks strtoul and strerror.
4352 Ah, the good old days! Problem reported by Peter Klein.
4353 * bootstrap (gnulib_modules): Add strerror, strtoul.
4354 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
4355 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
4356
4357 2005-09-29 Akim Demaille <akim@epita.fr>
4358
4359 * data/c.m4 (b4_error_verbose_if): New.
4360 * data/lalr1.cc: Use it.
4361 (YYERROR_VERBOSE_IF): Remove.
4362 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
4363 parser members, replaced by...
4364 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
4365 local variables.
4366 (yysyntax_error_): Takes the state number as argument.
4367 (yyreduce_print_): Use the argument yyrule, not the former
4368 attribute yyn_.
4369
4370 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
4371
4372 * bootstrap (gnulib_modules): Add verify.
4373 * lib/.cvsignore: Add verify.h.
4374 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
4375 * src/system.h (verify): Remove.
4376 Include verify.h instead.
4377 * src/tables.c (tables_generate): Use new API for 'verify'.
4378
4379 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
4380
4381 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
4382 local variables whose names begin with 'yy'.
4383 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
4384 Trivial changes from Joel E. Denny.
4385
4386 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
4387 it itself.
4388 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
4389 don't use alloca any more.
4390
4391 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
4392 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
4393 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
4394 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
4395 to match yacc.c, to test more hosts.
4396
4397 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
4398
4399 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
4400 doesn't affect behavior.
4401 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
4402 Solaris, AIX, MSC.
4403 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
4404 This works a bit better with glibc, if user code has already included
4405 stdlib.h.
4406 * doc/bison.texinfo (Bison Parser): Document that users can't
4407 arbitrarily use malloc and free for other purposes. Document
4408 that <alloca.h> and <malloc.h> might be included.
4409 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
4410 user must declare alloca.
4411
4412 * HACKING (release): Forwarn the Translation Project about
4413 stable releses.
4414
4415 2005-09-20 Akim Demaille <akim@epita.fr>
4416
4417 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
4418
4419 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
4420
4421 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
4422 (YYSTACK_ALLOC_MAXIMUM): Use it.
4423 (yysyntax_error): New function.
4424 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
4425 multiple syntax errors are reported, and alloca is being used.
4426 Instead, reallocate buffers twice as big each time, so that
4427 we waste at most half the allocated memory. Start with a small
4428 (128-byte) buffer that will suffice in most cases anyway.
4429 Use yysyntax_error to do most of the work.
4430
4431 * doc/bison.texinfo (Error Reporting, Table of Symbols):
4432 yynerrs is the number of errors reported, not the number of
4433 errors encountered.
4434
4435 * tests/glr-regression.at (Duplicated user destructor for lookahead):
4436 Mark it as expected to fail.
4437 Cast result of malloc; problem reported by twlevo@xs4all.nl.
4438 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
4439 Don't start user-code symbols with "yy", to avoid name space problems.
4440
4441 2005-09-19 Akim Demaille <akim@epita.fr>
4442
4443 Remove the traits, failed experiment.
4444 It never proved useful, and anyway because of the current
4445 definition, it was not possible to have several specialization of
4446 this traits, making it useless.
4447 * data/lalr1.cc (yy:traits): Remove.
4448 Inline its definitions in the parser class.
4449
4450 2005-09-19 Akim Demaille <akim@epita.fr>
4451
4452 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
4453 least Mac OSX with a /usr/local install of gettext.
4454
4455 2005-09-19 Akim Demaille <akim@epita.fr>
4456
4457 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
4458 and yytoken for similarity with the other skeletons.
4459
4460 2005-09-19 Akim Demaille <akim@epita.fr>
4461
4462 * NEWS, configure.ac: update version number to 2.1a.
4463
4464 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
4465
4466 * NEWS: Version 2.1.
4467
4468 * NEWS: Remove notice of yytname change, since it was never in an
4469 official release.
4470 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
4471 diagnostic.
4472 * src/output.c (prepare): Likewise.
4473 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
4474 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
4475 is not defined. This is an awful hack, but it's enough for now.
4476 All callers changed.
4477 * tests/glr-regression-at (make_value): Args are const pointers now,
4478 to avoid GCC warning.
4479 (Duplicated user destructor for lookahead): New test. Currently
4480 skipped. It fails on my host but I'm not sure it'll always fail.
4481
4482 2005-09-16 Akim Demaille <akim@epita.fr>
4483
4484 * src/symtab.h (struct symbol): Declare the printer and destructor
4485 as const, to avoid accidental calls to free.
4486 (symbol_destructor_set, symbol_printer_set): Adjust.
4487 * src/symtab.c: Adjust.
4488
4489 2005-09-16 Akim Demaille <akim@epita.fr>
4490
4491 * data/c.m4 (b4_token_enums): New.
4492 (b4_token_defines): Rename as...
4493 (b4_token_enums_defines): this.
4494 (b4_token_defines): New, output only the #defines.
4495 * data/yacc.c, data/glr.c: Adjust.
4496 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
4497 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
4498 as default values.
4499
4500 2005-09-16 Akim Demaille <akim@epita.fr>
4501
4502 * data/lalr1.cc (yylex_): Remove, inline its code.
4503 (yyreport_syntax_error_): Remove, replaced by...
4504 (yysyntax_error_): this which returns a string and leaves to the
4505 caller the call to the users' error function.
4506 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
4507 Move from members of the parser object...
4508 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
4509 to local variables of the parse function.
4510
4511 2005-09-16 Akim Demaille <akim@epita.fr>
4512
4513 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
4514 since it's in Bison's name space.
4515
4516 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
4517
4518 * data/glr.c (yyresolveValue): Add default case to pacify
4519 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
4520
4521 * NEWS: Document when yyparse started to return 2.
4522 * doc/bison.texinfo (Parser Function): Document when yyparse
4523 returns 2.
4524
4525 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
4526 (b4_filename_type): Renamed back from b4_file_name_type. All uses
4527 changed.
4528 (class position): file_name -> filename (reverting). All uses changed.
4529
4530 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
4531
4532 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
4533 do anything if $@ exists. This reverts part of the 2005-07-07
4534 patch.
4535
4536 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
4537
4538 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
4539 contains obsolete information and isn't worth distributing as a
4540 separate file anyway.
4541 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
4542 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
4543 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
4544 (yyparse): Abort if user code uses longjmp to throw an unexpected
4545 value.
4546
4547 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
4548
4549 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
4550 Suggested by twlevo@xs4all.nl.
4551
4552 * data/glr.c (YYCHK1): Do not assume YYE is in range.
4553 This avoids a diagnostic from gcc -Wswitch-enum.
4554 Problem reported by twlevo@xs4all.nl.
4555
4556 * doc/bison.texinfo: Don't use "filename", as per GNU coding
4557 standards. Use "file name" or "file" or "name", depending on
4558 the context.
4559 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
4560 not to hack/foo.tab.c.
4561 (Calc++ Top Level): 2nd arg of main is not const.
4562 * data/glr.c: b4_filename -> b4_file_name.
4563 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
4564 All uses changed.
4565 (class position): filename -> file_name. All uses changed.
4566 * data/yacc.c: b4_filename -> b4_file_name.
4567 * lib/bitset.h: filename -> file_name in local vars.
4568 * lib/bitset_stats.c: Likewise.
4569 * src/files.c: Likewise.
4570 * src/scan-skel.l ("@output ".*\n): Likewise.
4571 * src/files.c (file_name_split): Renamed from filename_split.
4572 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
4573
4574 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
4575
4576 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
4577 to accommodate latest gnulib.
4578
4579 * tests/glr-regression.at (Duplicate representation of merged trees):
4580 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
4581
4582 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
4583 needed.
4584
4585 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
4586
4587 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
4588 All uses changed. Invoke user destructor after an error during a
4589 split parse (trivial change from Joel E. Denny).
4590
4591 * tests/glr-regression.at
4592 (User destructor after an error during a split parse): New test case.
4593 Problem reported by Joel E. Denny in:
4594 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
4595
4596 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
4597
4598 * README-cvs: Give URLs for recommended tools.
4599 Mention Gzip version problem, and bootstrapping issues.
4600 Remove troubleshooting section, as it's somewhat obsolete.
4601
4602 * bootstrap (no_cache): New var, to accommodate different wget
4603 variants. Use it instead of '-C off'. Problem reported by
4604 twlevo@xs4all.nl.
4605
4606 * data/glr.c (yydestroyStackItem): New function.
4607 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
4608 debugging information. Problem reported by Joel E. Denny.
4609
4610 2005-08-25 Akim Demaille <akim@epita.fr>
4611
4612 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
4613
4614 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
4615
4616 * data/glr.c (yyrecoverSyntaxError, yyreturn):
4617 Don't invoke destructor on unresolved entries.
4618 * tests/glr-regression.at
4619 (User destructor for unresolved GLR semantic value): New test case.
4620 Problem reported by Joel E. Denny in:
4621 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
4622
4623 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
4624
4625 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
4626 Add strnlen.c.
4627 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
4628 lib-prefix.m4, po.m4.
4629
4630 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
4631 in yydestruct diagnostic, since it might not be an error.
4632 Problem reported by Joel Denny near end of
4633 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
4634 * data/lalr1.cc (yyerturn): Likewise.
4635 * data/yacc.c (yyreturn): Likewise.
4636 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
4637
4638 * src/files.c: Remove obsolete FIXME comment.
4639
4640 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
4641 with the other templates, and to fix bogus run-on messages such
4642 as the one reported at the end of
4643 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
4644 All callers changed to avoid the newline.
4645 (yyprocessOneStack): Output two lines rather than one, to accommodate
4646 the above change. This changes the debug output format slightly.
4647
4648 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
4649 reported by Joel E. Denny in
4650 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
4651 (trivial change).
4652 * tests/glr-regression.at (Duplicate representation of merged trees):
4653 New test, from Joel E. Denny in:
4654 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
4655 * THANKS: Add Joel E. Denny.
4656
4657 * configure.ac (AC_INIT): Bump to 2.0c.
4658
4659 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
4660
4661 * NEWS: Version 2.0b.
4662
4663 * Makefile.am (SUBDIRS): Put examples before tests, so that
4664 "make check" doesn't finish with "All 1 tests passed".
4665
4666 * tests/regression.at (Token definitions): Don't rely on
4667 AT_PARSER_CHECK for data that contains backslashes. It currently
4668 uses 'echo', and 'echo' isn't portable if its argument contains
4669 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
4670 that the byte '\0xff' is not printable in the C locale; it is,
4671 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
4672 not printable, so use '\0x81' to test.
4673
4674 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
4675 version of GCC, since the macro is used with non-GCC compilers.
4676
4677 Fix core dump reported by Pablo De Napoli in
4678 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
4679 * tests/regression.at (Invalid inputs with {}): New test.
4680 * src/parse-gram.y (token_name): Translate type before using
4681 it as an index.
4682
4683 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
4684 the user's name space. All uses changed to __attribute__
4685 ((__unused__)).
4686 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
4687 Add __attribute__ ((__noreturn__)).
4688
4689 * etc/clcommit: Remove. We weren't using it, and it failed
4690 "make maintainer-distcheck".
4691 * Makefile.maint: Merge from coreutils.
4692 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
4693 (syntax-check-rules): Change list of rules as described below.
4694 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
4695 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
4696 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
4697 (sc_trailing_space): New rules.
4698 (sc_xalloc_h_in_src): Remove.
4699 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
4700 (sc_space_tab, sc_error_exit_success, sc_changelog):
4701 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
4702 (makefile-check, po-check, author_mark_check):
4703 (makefile_path_separator_check, copyright-check):
4704 Use grep -n, to make it easier to find violations.
4705 Use CVS_LIST and CVS_LIST_EXCEPT.
4706 (header_regexp, h_re): Remove.
4707 (dd_c): New macro.
4708 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
4709 (my-distcheck): Use more-modern GCC flags.
4710 (signatures, %.asc): Remove.
4711 (rel-files, announcement): Remove signatures.
4712 Restore old updating code, even though we don't use it, so
4713 that we're the same as coreutils.
4714 (alpha, beta, major): Depend on news-date-check.
4715 Make the upload commands.
4716
4717 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
4718 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
4719 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
4720 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
4721 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
4722 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
4723 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
4724 * tests/sets.at: Likewise.
4725
4726 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
4727 we comment out the Autoconf version number.
4728 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
4729 it's error-prone and "make maintainer-distcheck" rejects it.
4730
4731 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
4732 Indent calls to "error" to pacify "make maintainer-distcheck",
4733 when the calls are not intended to be translated.
4734 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
4735
4736 * src/Makefile.am (DEFS): Use +=, to pacify
4737 "make maintainer-distcheck".
4738 (bison_SOURCES): Add scan-skel.h.
4739 (sc_tight_scope): New rule, from coreutils.
4740
4741 * src/files.c (src_extension, header_extension):
4742 Now static, not extern.
4743 * src/getargs.c (short_options): Likewise.
4744 * src/muscle_tab.c (muscle_table): Likewise.
4745 * src/parse-gram.y (current_class, current_type, current_prec):
4746 Likewise.
4747 * src/reader.c (grammar_end, previous_rule_end): Likewise.
4748 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
4749 * src/main.c (main): Cast bindtextdomain and textdomain calls to
4750 void, to avoid warning when NLS is disabled.
4751 * src/output.c: Include scan-skel.h.
4752 (scan_skel): Remove decl, since scan-skel.h does this.
4753 (output_skeleton):
4754 Indent calls to "error" to pacify "make maintainer-distcheck".
4755 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
4756 * src/reader.h (gram_end, gram_lineno): New decls to pacify
4757 "make maintainer-distcheck".
4758 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
4759 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
4760 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
4761 (skel_lex_destroy, scan_skel): Move these decls to...
4762 * src/scan-skel.h: New file.
4763 * src/uniqstr.c (uniqstr_assert):
4764 Indent calls to "error" to pacify "make maintainer-distcheck".
4765
4766 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
4767 not @VAR@.
4768
4769 * tests/torture.at: Revamp to avoid misuse of atoi that
4770 "make maintainer-distcheck" complained about.
4771
4772 * examples/extexi (message): Don't print a message more than once,
4773 and omit line-number decoration that makes Emacs compile think
4774 that informative messages are worth worrying about.
4775
4776 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
4777
4778 * configure.ac: Update version number.
4779
4780 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
4781 accidentally.
4782 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
4783 autogenerated by the maintainer.
4784 * examples/calc++/.cvsignore: Add *.yy.
4785
4786 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
4787 * lib/bitset_stats.c (bitset_stats_init): Likewise.
4788 * lib/bitsetv.c (bitsetv_alloc): Likewise.
4789
4790 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
4791
4792 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
4793 from maintainer-distcheck about casting the argument of 'free'.
4794
4795 * NEWS: Mention recent yytname changes.
4796 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
4797
4798 * bootstrap: For translations that have not yet been upgraded to
4799 the new runtime-po domain, prime the pump by extracting the
4800 relevant strings from the obsolete translations. This code can be
4801 removed once the bison-runtime domain has been translated by each
4802 team.
4803
4804 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
4805 now that token names are already quoted.
4806
4807 Fix problem reported by Anthony Heading.
4808 * data/glr.c (YYTOKEN_TABLE): New macro.
4809 (yytname): Define if YYTOKEN_TABLE.
4810 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
4811 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
4812 (YYERROR_VERBOSE): Define the same way the other skeletons do.
4813 * src/output.c (prepare_symbols): Output token_table_flag.
4814
4815 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
4816
4817 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
4818 again if the first call fails.
4819
4820 * data/glr.c (yytnamerr): New function.
4821 (yyreportSyntaxError): Use it to dequote most string literals.
4822 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
4823 with other skeletons. All uses changed.
4824 (yytnameerr_): New function.
4825 (yyreport_syntax_error): Use it to dequote most string literals.
4826 * data/yacc.c (yytnamerr): New function.
4827 (yyerrlab): Use it to decode most string literals.
4828 * doc/bison.texinfo (Decl Summary, Calling Convention):
4829 Clarify quoting convention of yytname.
4830 * src/output.c (prepare_symbols): Quote all names. This undoes
4831 the 2005-04-17 change, which is now accomplished (mostly) via
4832 changes in the parsers as described above.
4833 * tests/regression.at (Token definitions, Web2c Actions):
4834 Undo most 2005-04-17 change here, too.
4835
4836 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
4837
4838 Fix more problems reported by twlevo@xs4all.nl.
4839 * tests/cxx-type.at: Don't pipe output of ./types through sed to
4840 remove trailing spaces. This loses the exit status of ./types,
4841 and isn't needed since ./types shouldn't be emitting trailing
4842 spaces.
4843 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
4844 as the stack isn't valid in that case.
4845
4846 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4847 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4848 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4849 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
4850 is used.
4851 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
4852 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
4853 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
4854 Likewise.
4855
4856 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
4857 overly-picky compilers that reject 'char *foo = "bar";'.
4858
4859 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
4860 to FILE * parameter, not to stderr. This fixes a typo introduced
4861 in the 2005-07-12 change.
4862
4863 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
4864 warnings from GCC 4.
4865
4866 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
4867 (yyglrShiftDefer, yysplitStack):
4868 Remove unused parameters b4_pure_formals. All uses changed.
4869 (yyglrShift): Remove unused parameters b4_user_formals.
4870 All uses changed.
4871 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
4872
4873 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
4874
4875 Destructor cleanups and regularization among the three skeletons.
4876 * NEWS: Document the behavior changes.
4877 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
4878 stack before failing, as the cleanup code will do it for us now.
4879 * data/lalr1.cc (yyerrlab): Likewise.
4880 * data/glr.c (yyparse): Pop everything off the stack before
4881 freeing it, so that destructors get called properly.
4882 * data/lalr1.cc (yyreturn): Likewise.
4883 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
4884 This is more consistent.
4885 * doc/bison.texinfo (Destructor Decl): Mention more reasons
4886 why destructors might be called. 1.875 -> 2.1.
4887 (Destructor Decl, Decl Summary, Table of Symbols):
4888 Some English-language cleanups for %destructor.
4889 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
4890 Add output line for destructor of start symbol.
4891 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
4892 because of that same extra output line.
4893
4894 * NEWS: Document minor wording changes in diagnostics of
4895 Bison-generated parsers.
4896 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
4897 Remove unused formals. All uses changed.
4898 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
4899 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
4900 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
4901 Rename yyoverflowab to yyexhaustedlab.
4902 When memory exhaustion occurs during syntax-error reporting,
4903 report it separately rather than in a single diagnostic; this
4904 eases translation.
4905 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
4906 (Memory Exhausted): Renamed from Parser Stack Overflow.
4907 Revamp wording slightly to prefer "memory exhaustion".
4908 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
4909
4910 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
4911
4912 Add i18n support to the GLR skeleton. Partially fix the C++
4913 skeleton; a C++ expert needs to finish this. Remove debugging
4914 msgids; there's little point to having them translated, since they
4915 can be understood only by someone who can read the
4916 (English-language) source code.
4917
4918 Generate runtime-po/bison-runtime.pot automatically, so that we
4919 don't have to worry about garbage getting in that file. We'll
4920 make sure after the next official release that old msgids don't
4921 get lost. See
4922 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
4923
4924 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
4925 Now auto-generated.
4926 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
4927 Fix typos in explanations of the runtime file.
4928 * bootstrap: Change gettext keyword from YYI18N to YY_.
4929 Use standard Makefile.in.in in runtime-po, since we'll arrange
4930 for backward-compatible bison-runtime.po files in a different way.
4931 * data/glr.c (YY_): New macro, from yacc.c.
4932 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
4933 Translate messages intended for users.
4934 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
4935 the wording in the other skeletons. We don't know that the memory
4936 is virtual.
4937 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
4938 Use same method that yacc.c uses.
4939 Don't translate debugging messages.
4940 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
4941 it doesn't work (yet), and requires C++ expertise to fix.
4942 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
4943 Move defn to a more logical place, to be consistent with other
4944 skeletons.
4945 Don't translate debugging messages.
4946 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
4947 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
4948 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
4949 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
4950
4951 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
4952 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
4953 void, not int.
4954 * tests/glr-regression.at (Badly Collapsed GLR States):
4955 Likewise.
4956 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4957 yylex should return 0 at EOF rather than aborting.
4958
4959 Improve tests for stack overflow in GLR parser.
4960 Problem reported by twlevo@xs4all.nl.
4961 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
4962 All uses removed.
4963 (yyStackOverflow): Just longjmp, but with value 2 so that caller
4964 can handle the problem.
4965 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
4966 (yyparse): New local variable yyresult to record the result.
4967 Use result of setjmp to set it, rather than storing itinto
4968 struct.
4969 (yyDone): Remove label.
4970 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
4971 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
4972 if YYABORT is used).
4973 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
4974 yyparse status; put status > 1 into diagnostic.
4975 Check that status==2 works.
4976 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
4977 Use exit status 3 for failure to open (which shouldn't happen).
4978
4979 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
4980
4981 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
4982 1 on syntax error; just let yyparse do its thing.
4983 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
4984 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
4985 (Exploding the Stack Size with Alloca):
4986 (Exploding the Stack Size with Malloc):
4987 Expect exit status 2, not 1, since the parser is supposed to blow
4988 its stack. Problem reported by twlevo@xs4all.nl.
4989
4990 * data/glr.c (yyparse): Don't assume that the initial calls
4991 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
4992 Print a stack-overflow message and fail instead.
4993 Initialize the line-number information before creating the stack,
4994 so that the stack-overflow message can report line zero safely.
4995
4996 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
4997
4998 Fix problems reported by twlevo@xs4all.nl.
4999 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
5000 (yyuserMerge): Provide a default case if b4_mergers is empty.
5001 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
5002 * tests/glr-regression.at
5003 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5004 Add casts to pacify C++ compilers.
5005 * tests/glr-regression.at (Improper merging of GLR delayed action
5006 sets): Declare yylex before using it.
5007 * tests/Makefile.am (maintainer-check-g++): Fix a stray
5008 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
5009 test for valgrind; valgrind is independent of g++.
5010 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
5011 for compatibility with POSIX 1003.1-2001 (if running coreutils).
5012 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
5013 Use a destructor, so that we can expand the stack. Change
5014 YYSTYPE to char * so that we can free it. Cast result of malloc.
5015
5016 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5017
5018 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
5019 a valgrind failure. Problem reported by twlevo@xs4all.nl.
5020
5021 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
5022
5023 * PACKAGING: New file, suggested by Bruno Haible and taken from
5024 similar wording in gettext's PACKAGING file.
5025 * NEWS: Mention PACKAGING.
5026 * Makefile.am (EXTRA_DIST): Add PACKAGING.
5027
5028 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
5029
5030 * NEWS: Document recent i18n improvements.
5031 * bootstrap: Get runtime translations into runtime-po.
5032 Create runtime-po files automatically, if possible.
5033 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
5034 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
5035 does not infringe on the user's name space.
5036 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
5037 * doc/bison.texinfo (Internationalization): Revamp the English
5038 and Texinfo syntax a bit, to try to make it clearer.
5039 (Bison Options, Option Cross Key): Mention --print-localedir.
5040 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
5041 YYENABLE_NLS. Quote a bit more.
5042 * runtime-po/.cvsignore: New file.
5043 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
5044 * runtime-po/Rules-quot: Remove; now created by bootstrap.
5045 * runtime-po/quot.sed: Likewise.
5046 * runtime-po/boldquot.sed: Likewise.
5047 * runtime-po/en@quot.header: Likewise.
5048 * runtime-po/en@boldquot.header: Likewise.
5049 * runtime-po/insert-header.sin: Likewise.
5050 * runtime-po/remove-potcdate.sin: Likewise.
5051 * runtime-po/Makevars: Likewise.
5052 * runtime-po/LINGUAS: Likewise.
5053 * runtime-po/de.po: Likewise; we will rely on the translation project
5054 to maintain this, so "bootstrap" should get it.
5055 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
5056 its value.
5057 * src/main.c (main): Bind the bison-runtime domain, too.
5058
5059 2005-07-12 Bruno Haible <bruno@clisp.org>
5060
5061 * data/yacc.c: Include <libintl.h> when NLS is enabled.
5062 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
5063 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
5064 * runtime-po: New directory.
5065 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
5066 $(DOMAIN).pot-update rule, so that old messages are never dropped.
5067 * runtime-po/Rules-quot: New file, copied from po/.
5068 * runtime-po/quot.sed: Likewise.
5069 * runtime-po/boldquot.sed: Likewise.
5070 * runtime-po/en@quot.header: Likewise.
5071 * runtime-po/en@boldquot.header: Likewise.
5072 * runtime-po/insert-header.sin: Likewise.
5073 * runtime-po/remove-potcdate.sin: Likewise.
5074 * runtime-po/Makevars: New file.
5075 * runtime-po/POTFILES.in: New file.
5076 * runtime-po/LINGUAS: New file.
5077 * runtime-po/bison-runtime.pot: New file.
5078 * runtime-po/de.po: New file.
5079 * m4/bison.m4: New file.
5080 * Makefile.am (SUBDIRS): Add runtime-po.
5081 (aclocaldir, aclocal_DATA): New variables.
5082 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
5083 Define aclocaldir.
5084 * src/getargs.c (usage): Document --print-localedir option.
5085 (PRINT_LOCALEDIR_OPTION): New enum item.
5086 (long_options): Add --print-localedir option.
5087 (getargs): Handle --print-localedir option.
5088 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
5089 (Internationalization): New section.
5090
5091 2005-07-12 Akim Demaille <akim@epita.fr>
5092
5093 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
5094 for consistency with the rest of the code.
5095 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
5096 Add separators.
5097
5098 2005-07-12 Akim Demaille <akim@epita.fr>
5099
5100 * src/parse-gram.y: Use %printer instead of YYPRINT.
5101
5102 2005-07-12 Akim Demaille <akim@epita.fr>
5103
5104 * src/symtab.h, src/symtab.c (symbol_print): New.
5105 * src/symlist.h, src/symlist.c (symbol_list_print): New.
5106 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
5107
5108 2005-07-12 Akim Demaille <akim@epita.fr>
5109
5110 * data/glr.c (b4_syncline): Fix (swap) the definitions of
5111 b4_at_dollar and b4_dollar_dollar.
5112
5113 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
5114
5115 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
5116 and Pennello's paper.
5117
5118 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
5119
5120 * data/yacc.c (yyparse): Undo previous patch. Instead,
5121 set yylsp[0] and yyvsp[0] only if the initial action
5122 sets yylloc and yylval, respectively.
5123
5124 * data/yacc.c (yyparse): In the initial action, set
5125 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
5126 This avoids the use of undefined variables if the initial
5127 action does not set yylloc and/or yylval.
5128
5129 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
5130
5131 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
5132 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
5133 Remove from CVS. These files are automatically generated.
5134 * examples/extexi: Clarify that this file is now part of Bison,
5135 not GNU M4, and that it works with any POSIX-compatible Awk.
5136 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
5137 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
5138 so that we also get calc++-parser.yy. Geneate it.
5139 Use $(AWK), not gawk, since any conforming Awk will do.
5140 Put comment before action, since older 'make' can't handle comment
5141 in action.
5142 $(BUILT_SOURCES): List all built sources, not just some of them.
5143 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
5144 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
5145 $($(calc_sources_generated)): Remove unnecessary test for existence
5146 of target. (This had a shell syntax error anyway; a stray "x".)
5147 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
5148 calc++-parser.yy.
5149 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
5150
5151 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
5152 implied by the other modules.
5153
5154 2005-07-06 Akim Demaille <akim@epita.fr>
5155
5156 Bind examples/calc++ to the package.
5157 * examples/calc++/Makefile: Remove, replaced by...
5158 * examples/calc++/Makefile.am: ... this new file.
5159 * examples/calc++/test: Remove input.
5160 * examples/calc++/compile: Remove.
5161 * examples/Makefile.am: New.
5162 * configure.ac, Makefile.am: Adjust.
5163 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
5164
5165 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
5166
5167 * data/glr.c (yyFail): Drastically simplify; since the format argument
5168 never had any % directives, we can simply pass it to yyerror.
5169 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
5170 be modified later, as that is the usual style in glr.c.
5171 Problems reported by Paul Hilfinger.
5172
5173 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
5174 and size overflow errors.
5175 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
5176 in case the user prolog sets feature-test macros like _GNU_SOURCE.
5177 (YYSIZEMAX): New macro.
5178 (yystpcpy): New function, taken from yacc.c.
5179 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
5180 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
5181 so that we don't have to maintain their signatures.
5182 (yyFail): Check for buffer overflow, by using vsnprintf rather
5183 than vsprintf. Allocate a bigger buffer if possible.
5184 Report an error if buffer allocation fails.
5185 (yyStackOverflow): New function.
5186 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
5187 the initialization was successful. It might fail if storage was
5188 exhausted.
5189 (yyexpandGLRStack): Add more checks for storage allocation failure.
5190 Use yyStackOverflow to report failures.
5191 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
5192 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
5193 Don't assume stack number fits in int.
5194 (yysplitStack): Check for storage allocation failure.
5195 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
5196 can print diagnostics on storage allocation failure. All callers
5197 changed.
5198 (yyresolveValue): Use yybool for boolean.
5199 (yyreportSyntaxError): Check for size-calculation overflow.
5200 This code is taken from yacc.c.
5201 (yyparse): Check for storage allocation errors when allocating
5202 the initial stack.
5203
5204 2005-07-05 Akim Demaille <akim@epita.fr>
5205
5206 Extract calc++ from the documentation.
5207 * doc/bison.texinfo (Calc++): Add the extraction marks.
5208 * examples/extexi: New, from the aborted GNU Programming 2E.
5209 Separate the different paragraph of a file with empty lines.
5210 * examples/Makefile: Use it to extract the whole calc++ example.
5211
5212 2005-06-24 Akim Demaille <akim@epita.fr>
5213
5214 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
5215 class typedefs.
5216
5217 2005-06-22 Akim Demaille <akim@epita.fr>
5218
5219 * doc/bison.texinfo (C++ Language Interface): First stab.
5220 (C++ Parsers): Remove.
5221
5222 2005-06-22 Akim Demaille <akim@epita.fr>
5223
5224 * data/lalr1.cc (yylex_): Honor %lex-param.
5225
5226 2005-06-22 Akim Demaille <akim@epita.fr>
5227
5228 Start a set of simple examples.
5229 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
5230 * examples/calc++/calc++-driver.hh,
5231 * examples/calc++/calc++-parser.yy,
5232 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
5233 * examples/calc++/compile, examples/calc++/test: New.
5234
5235 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
5236
5237 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
5238 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
5239 which stems from the 2005-05-27 patch.
5240
5241 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5242
5243 * data/glr.c: Modify treatment of unused parameters to permit use
5244 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
5245
5246 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
5247
5248 Fix infringement on user name space reported by Janos Zoltan Szabo.
5249 * data/yacc.c (yyparse): strlen -> yystrlen.
5250
5251 2005-05-30 Akim Demaille <akim@epita.fr>
5252
5253 * data/lalr1.cc (_): New.
5254 Translate the various messages.
5255
5256 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
5257
5258 Fix infringement on user name space reported by Bruno Haible.
5259 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
5260 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
5261 the user's name space.
5262 (alloca): Include <stdlib.h> to get it, if it's not built in.
5263 (YYMALLOC, YYFREE): Define only if needed.
5264 (malloc, free): Declare, but only if needed, as this infringes on
5265 the user name space.
5266
5267 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
5268
5269 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
5270 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
5271 with %d format.
5272 * lib/ebitset.c (min, max): Undef before defining.
5273 * lib/vbitset.c (min, max): Likewise.
5274 * lib/subpipe.c (create_subpipe): Save local variables in case
5275 vfork clobbers them.
5276
5277 2005-05-24 Bruno Haible <bruno@clisp.org>
5278
5279 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
5280 error message syntax used by gcc-4.0.
5281
5282 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
5283
5284 * README: Mention m4 1.4.3. Remove obsolete advice about
5285 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
5286
5287 * bootstrap: Remove workaround for problem I encountered with
5288 gettext 0.14.1; it seems to be fixed now.
5289
5290 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
5291
5292 * NEWS: Version 2.0a.
5293
5294 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
5295 the previous change.
5296
5297 Various maintainer cleanups.
5298 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
5299 conftest*, for benefit of CVS commands run at the same time as
5300 "configure". Add build-aux, since "bootstrap" now creates it and
5301 its subfiles.
5302 * Makefile.cfg (move_if_change): Remove.
5303 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
5304 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
5305 (po_repo, do-po-update, po-update, wget_files, get-targets):
5306 (config.guess-url_prefix, config.sub-url_prefix):
5307 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
5308 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
5309 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
5310 Remove.
5311 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
5312 this is now the recommended name.
5313 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
5314 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
5315 ylwrap. These files now go into build-aux.
5316 * config/move-if-change: Remove.
5317 * config/prev-version.txt: Bump from 1.75 to 2.0.
5318
5319 * bootstrap: Add stdio-safer, unistd-safer modules.
5320 Remove m4/glibc2.m4 (introduced by latest gnulib, but
5321 we don't need it).
5322 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
5323 fopen-safer.c, stdio-safer.h, unistd-safer.h.
5324 * lib/subpipe.c: Include "unistd-safer.h".
5325 (create_subpipe): Make sure all the newly-created
5326 file descriptors are > 2, so that diagnostics don't
5327 get sent down them (which might cause Bison to hang, in theory).
5328 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
5329 * src/files.c (xfopen): Use fopen_safer, not fopen.
5330
5331 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
5332 yesterday's yacc.c fix.
5333
5334 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
5335
5336 * data/glr.c, data/lalr1.cc: Update copyright date.
5337
5338 Fix a destructor bug reported by Wolfgang Spraul in
5339 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
5340 * data/yacc.c (yyabortlab): Don't call destructor, and
5341 don't set yychar to EMPTY.
5342 (yyoverflowlab): Don't call destructor.
5343 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
5344 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
5345 since we no longer output the message "discarding lookahead token
5346 end of input ()".
5347
5348 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5349
5350 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
5351 fix a small glitch in debugging output.
5352 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
5353 after YY_SYMBOL_PRINT where needed.
5354
5355 (struct yyGLRState): Add some comments.
5356 (struct yySemanticOption): Add some comments.
5357 (union yyGLRStackItem): Add comment.
5358
5359 (yymergeOptionSets): Correct this to properly perform the union,
5360 avoiding infinite reported by Michael Rosien.
5361 Update comment.
5362
5363 * tests/glr-regression.at: Add test for GLR merging error reported
5364 by M. Rosien.
5365
5366 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
5367
5368 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
5369 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
5370 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
5371 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
5372 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
5373 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
5374 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
5375 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
5376 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
5377 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
5378 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
5379 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
5380 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
5381 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
5382 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
5383 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
5384 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
5385 src/derives.h, src/files.c, src/files.h, src/getargs.c,
5386 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
5387 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
5388 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
5389 src/output.h, src/parse-gram.c, src/parse-gram.h,
5390 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
5391 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
5392 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
5393 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
5394 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
5395 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
5396 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
5397 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
5398 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
5399 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
5400 tests/reduce.at, tests/regression.at, tests/sets.at,
5401 tests/synclines.at, tests/testsuite.at, tests/torture.at:
5402 Update FSF postal mail address.
5403
5404 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
5405
5406 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
5407 Problem reported by Ralf Menzel.
5408
5409 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
5410
5411 * tests/actions.at: Test that stack overflow invokes destructors.
5412 From Marcus Holland-Moritz.
5413 * data/yacc.c (yyerrlab): Move the code that destroys the stack
5414 from here....
5415 (yyreturn): to here. That way, destructors are called properly
5416 even if the stack overflows, or the user calls YYACCEPT or
5417 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
5418 (yyoverflowlab): Destroy the lookahead.
5419
5420 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
5421
5422 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
5423
5424 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
5425
5426 * NEWS: Bison-generated C parsers no longer quote literal strings
5427 associated with tokens.
5428 * src/output.c (prepare_symbols): Don't escape strings,
5429 since users don't want to see C escapes.
5430 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
5431 in diagnostics.
5432 * tests/input.at (Torturing the Scanner): Likewise.
5433 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
5434
5435 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
5436
5437 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
5438 the data size is known to be too small and we can't increase it.
5439 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
5440
5441 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
5442
5443 * src/parse-gram.y: Include quotearg.h.
5444 (string_as_id): Quote $1 before using it as a key, since the
5445 lexer no longer quotes it for us.
5446 (string_content): Don't strip quotes, since lexer no longer
5447 quotes it for us.
5448 * src/scan-gram.l: Include quotearg.h.
5449 ("\""): Omit quote.
5450 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
5451 a key, since the rest of the lexer doesn't quote it.
5452 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
5453 * tests/regression.at (Token definitions): Check for backslashes
5454 in token strings.
5455
5456 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
5457 (YYSIZE_T): Define to unsigned long int when using an older compiler.
5458 (yyparse): Revamp code to generate long syntax error message, to
5459 make it easier to translate, and to avoid problems with arithmetic
5460 overflow. Change "virtual memory" to "memory" in diagnostic, since
5461 we don't know whether the memory is virtual.
5462
5463 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
5464
5465 * NEWS: Bison-generated C parsers now use the _ macro to
5466 translate strings.
5467 * data/yacc.c (_) [!defined _]: New macro.
5468 All English strings wrapped inside this macro.
5469 * doc/bison.texinfo (Bison Parser): Document _.
5470 * po/POTFILES.in: Include src/parse-gram.c, since it now
5471 includes translateable strings that parse-gram.y doesn't.
5472
5473 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
5474
5475 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
5476 reverting the 2004-10-11 change to this function.
5477 (symbol_check_alias_consistency): Don't call symbol_type_set
5478 if the type name is already correct.
5479 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
5480
5481 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
5482
5483 * tests/regression.at (Token definitions): Don't use a token named
5484 c, as that generates a "#define c ..." that runs afoul of buggy
5485 stdlib.h that uses the identifier c as a member of struct
5486 drand48_data. Problem reported by Horst Wente.
5487
5488 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
5489
5490 * bootstrap: Change translation URL from
5491 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
5492 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
5493 redirection glitches. Problem reported by twlevo@xs4all.nl.
5494
5495 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
5496
5497 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
5498 after operands; POSIX says this isn't portable for the c99 command.
5499
5500 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
5501
5502 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
5503 immediately if a data overrun has occurred; this may help us track
5504 down what may be a spurious failure on MacOS.
5505
5506 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
5507
5508 Respond to problems reported by twlevo@xs4all.nl.
5509
5510 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
5511
5512 * src/vcg.h: Comment fix.
5513 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
5514 (G_CMAX): Change to -1 instead of INT_MAX.
5515
5516 * data/yacc.c (yyparse): Omit spaces before #line.
5517
5518 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
5519
5520 * src/tables.c (state_number_to_vector_number): Put it inside an
5521 "#if 0", since it's not currently used. Problem reported by
5522 Roland McGrath.
5523
5524 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
5525
5526 * src/output.c (escaped_output): Renamed from
5527 escaped_file_name_output, since we now use it for symbol tags as
5528 well. All uses changed.
5529 (symbol_destructors_output, symbol_printers_output):
5530 Escape symbol tags too.
5531 Problem reported by Matyas Forstner in
5532 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
5533
5534 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
5535 not needed.
5536 * src/output.c (user_actions_output, token_definitions_output,
5537 symbol_destructors_output, symbol_printers_output): Likewise.
5538 * src/reader.c (prologue_augment): Likewise.
5539 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
5540
5541 * src/vcg.c (output_edge): Don't quote linestyle arg.
5542 Problem reported by twlevo@xs4all.nl.
5543
5544 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
5545
5546 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
5547 example, reported by Derek M Jones. Also, make the example even
5548 more outrageous, to better illustrate how bad the problem is.
5549
5550 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
5551
5552 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
5553 putsym. Typo reported by Sebastian Piping.
5554
5555 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
5556
5557 * doc/bison.texinfo (Language and Grammar): some -> same
5558 (Epilogue): int he -> in the
5559 Typos reported by Sebastian Piping via Justin Pence.
5560
5561 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
5562
5563 * tests/glr-regression.at (Improper handling of embedded actions
5564 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
5565 embedded actions and $-N in GLR parsers", work around an Autoconf bug
5566 with dollar signs in test names.
5567 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
5568 for a similar reason.
5569
5570 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
5571
5572 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
5573 wants to redefine G_VIEW.
5574
5575 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
5576
5577 * src/vcg.c (get_view_str): Remove case for normal_view.
5578 Problem reported by twlevo@xs4all.nl.
5579
5580 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
5581
5582 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
5583 Problem reported by twlevo@xs4all.nl.
5584
5585 * doc/bison.texinfo: Change @dircategory from "GNU programming
5586 tools" to "Software development". Requested by Richard Stallman
5587 via Karl Berry.
5588
5589 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
5590
5591 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
5592 Problem reported by twlevo@xs4all.nl.
5593
5594 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
5595
5596 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
5597 keyword; it's not needed with modern compilers, and it doesn't
5598 affect correctness with older compilers. Suggested by
5599 twlevo@xs4all.nl.
5600
5601 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
5602
5603 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
5604 gcc -Wswitch-default.
5605 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
5606 * data/yacc.c (yyparse): Likewise.
5607
5608 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
5609
5610 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
5611 already. Let config.h define any nonstandard values.
5612
5613 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
5614
5615 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
5616 for the benefit of slower hosts. Problem reported by
5617 Nelson H. F. Beebe.
5618
5619 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
5620
5621 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
5622 being defined and not used.
5623 * data/lalr1.cc (yyparse): Likewise.
5624 Use "if (false)" rather than "if (0)".
5625
5626 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
5627
5628 * TODO: Mention that we should allow NUL bytes in tokens.
5629
5630 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
5631
5632 * src/scan-skel.l (<<EOF>>): Don't close standard output.
5633 Problem reported by Hans Aberg.
5634
5635 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
5636
5637 * src/getargs.c (version): Happy new year; update overall
5638 program copyright date from 2004 to 2005.
5639
5640 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
5641 Problem reported by Hans Aberg.
5642 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
5643 (Output file names.): Add a test for the case when standard output
5644 is closed.
5645
5646 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
5647
5648 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
5649 to fix an oversight in the Bison 2.0 manual.
5650
5651 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
5652
5653 * NEWS: Version 2.0. Reformat the existing news items since
5654 1.875, so that related items are grouped together.
5655 * configure.ac (AC_INIT): Bump version to 2.0.
5656 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
5657
5658 * tests/torture.at (Exploding the Stack Size with Alloca): Set
5659 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
5660 otherwise, we're not testing alloca. Unfortunately there's no
5661 simple way to consult HAVE_ALLOCA here.
5662
5663 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
5664 for yymsg, too.
5665
5666 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
5667 hand. This avoids a warning about comparing int to size_t when
5668 GCC warnings are enabled.
5669
5670 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
5671
5672 * NEWS: Bison-generated parsers no longer default to using the
5673 alloca function (when available) to extend the parser stack, due
5674 to widespread problems in unchecked stack-overflow detection.
5675 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
5676 responsibility to set it to a positive value. This lets the user
5677 specify a value that is not a preprocessor constant.
5678 * data/yacc.c (YYMAXDEPTH): Likewise.
5679 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
5680 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
5681 to be a compile-time constant. However, explain the constraints on it.
5682 Also, explain the constraints on YYINITDEPTH.
5683 (Table of Symbols): Explain that alloca is no longer the default.
5684 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
5685 to 1.
5686
5687 * doc/bison.texinfo (Location Default Action): Mention that n must
5688 be zero when k is zero. Suggested by Frank Heckenbach.
5689
5690 2004-12-22 Akim Demaille <akim@epita.fr>
5691
5692 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
5693 (parser::state_type, parser::semantic_type, parser::location_type):
5694 Private, not public.
5695 (parser::parse): Return ints, not bool.
5696 Returning a bool introduces a problem: 0 corresponds to false, and
5697 it seems weird to return false on success. Returning true changes
5698 the conventions for yyparse.
5699 Alternatively we could return void and send an exception.
5700 There is no clear consensus (yet?).
5701 (state_stack, semantic_stack, location_stack): Rename as...
5702 (state_stack_type, semantic_stack_type, location_stack_type): these.
5703 Private, not public.
5704 * tests/c++.at: New.
5705 * tests/testsuite.at, tests/Makefile.am: Adjust.
5706
5707 2004-12-21 Akim Demaille <akim@epita.fr>
5708
5709 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
5710
5711 2004-12-21 Akim Demaille <akim@epita.fr>
5712
5713 Don't impose std::string for filenames.
5714
5715 * data/lalr1.cc (b4_filename_type): New.
5716 (position::filename): Use it.
5717 (parser.hh): Move the inclusion of stack.hh and location.hh below
5718 the user code, so that needed headers for the filename type can be
5719 included first.
5720 Forward declare them before the user code.
5721 * tests/Makefile.am (check-local, installcheck-local): Pass
5722 TESTSUITEFLAGS to the TESTSUITE.
5723
5724 2004-12-20 Akim Demaille <akim@epita.fr>
5725
5726 Use more STL like names: my_class instead of MyClass.
5727
5728 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
5729 (SemanticStack, SemanticType, StateStack, StateType)
5730 (TokenNumberType, Stack, Slice, Traits, Parser::location)
5731 (Parser::value): Rename as...
5732 (location_stack, location_type, rhs_number_type, semantic_stack)
5733 (semantic_type, state_stack, state_type, token_number_type, stack)
5734 (slice, traits, parser::yylloc, parser::yylval): these.
5735
5736 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
5737
5738 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
5739
5740 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
5741 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
5742
5743 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
5744
5745 Remove uses of 'short int' and 'unsigned short int'. This raises
5746 some arbitrary limits. It uses more memory but nowadays that's
5747 not much of an issue.
5748
5749 This change does not affect the generated parsers; that's a different
5750 task, as some users will want to conserve memory there.
5751
5752 Ideally we should use size_t to represent all object counts, and
5753 something like ptrdiff_t to represent signed differences of object
5754 counts; but that will require more code-cleanup than I have the
5755 time to do right now.
5756
5757 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
5758 Use size_t, not int or short int, to count objects.
5759 * src/closure.c (nritemset, closure): Likewise.
5760 * src/closure.h (nritemset, closure): Likewise.
5761 * src/nullable.c (nullable_compute): Likewise.
5762 * src/print.c (print_core): Likewise.
5763 * src/print_graph.c (print_core): Likewise.
5764 * src/state.c (state_compare, state_hash): Likewise.
5765 * src/state.h (struct state): Likewise.
5766 * src/tables.c (default_goto, goto_actions): Likewise.
5767
5768 * src/gram.h (rule_number, rule): Use int, not short int.
5769 * src/output.c (prepare_rules): Likewise.
5770 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
5771 errs, reductions): Likewise.
5772 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
5773 Likewise.
5774 * src/tables.c (vector_number, tally, action_number,
5775 ACTION_NUMBER_MINIMUM): Likewise.
5776 * src/output.c (muscle_insert_short_int_table): Remove.
5777
5778 2004-12-17 Akim Demaille <akim@epita.fr>
5779
5780 * data/lalr1.cc: Extensive Doxygenation.
5781 (error_): Rename as...
5782 (error): this, since it is visible to the user.
5783 Adjust callers.
5784 (Parser::message): Now an automatic variable from...
5785 (Parser::yyreport_syntax_error_): here.
5786 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
5787 Parser::error.
5788 * tests/input.at: Escape $.
5789
5790 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
5791
5792 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
5793 Parenthesize rhs to avoid obscure problems with mistakes like
5794 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
5795 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5796 b4_rhs_location): Likewise.
5797 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5798 b4_rhs_location): Likewise.
5799
5800 2004-12-16 Akim Demaille <akim@epita.fr>
5801
5802 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
5803 yacc.c: be sure to stay within yycheck_.
5804 * tests/actions.at: Re-enable C++ tests.
5805
5806 2004-12-16 Akim Demaille <akim@epita.fr>
5807
5808 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
5809 real.
5810
5811 2004-12-16 Akim Demaille <akim@epita.fr>
5812
5813 Use #define to handle the %name-prefix.
5814
5815 * data/glr.c, data/yacc.c: Comment changes.
5816 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
5817 so that one can refer to yylex in the parser file, and have it
5818 renamed, as is the case with other skeletons.
5819
5820 2004-12-16 Akim Demaille <akim@epita.fr>
5821
5822 Move lalr1.cc internals into yy*.
5823
5824 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
5825 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
5826 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
5827 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
5828 (empty_, final_, terror_, errcode_, ntokens_)
5829 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
5830 (looka_, ilooka_, error_range_, nerrs_):
5831 Rename as...
5832 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
5833 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
5834 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
5835 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
5836 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
5837 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
5838 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
5839 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
5840 these.
5841
5842 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
5843
5844 Fix some problems reported by twlevo at xs4all.
5845 * src/symtab.c (symbol_new): Report an error if the input grammar
5846 contains too many symbols. This is better than calling abort() later.
5847 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
5848 (struct node, struct graph):
5849 Rename member expand to stretch. All uses changed.
5850 (struct graph): Remove member layoutalgorithm. All uses removed.
5851 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
5852 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
5853 All uses changed.
5854 (N_STRETCH): Rename from N_EXPAND. All uses changed.
5855
5856 2004-12-15 Akim Demaille <akim@epita.fr>
5857
5858 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
5859 Add more Doxygen comments.
5860 (symprint_, stack_print_, reduce_print_, destruct_, pop)
5861 (report_syntax_error_, translate_): Rename as...
5862 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
5863 (yypop_, yyreport_syntax_error_, yytranslate_): this.
5864
5865 2004-12-15 Akim Demaille <akim@epita.fr>
5866
5867 * data/lalr1.cc (lex_): Rename as...
5868 (yylex_): this.
5869 Move the trace here.
5870 Take the %name-prefix into account.
5871 Reported by Alexandre Duret-Lutz.
5872
5873 2004-12-15 Akim Demaille <akim@epita.fr>
5874
5875 Simplify the C++ parser constructor.
5876
5877 * data/lalr1.cc (debug_): Rename as...
5878 (yydebug_): so that the parser's internals are always in the yy*
5879 pseudo namespace.
5880 Adjust uses.
5881 (b4_parse_param_decl): Remove the leading comma as it is now only
5882 called as unique argument list.
5883 (Parser::Parser): Remove the constructor accepting a location and
5884 an initial debugging level.
5885 Remove from the other ctor the argument for the debugging level.
5886 (debug_level_type, debug_level, set_debug_level): New.
5887
5888 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
5889 constructor calls.
5890
5891 2004-12-15 Akim Demaille <akim@epita.fr>
5892
5893 Remove b4_root related material: failure experiment
5894 (which goal was to allow to derive from a class).
5895
5896 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
5897 definitions and uses.
5898
5899 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
5900
5901 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
5902 not 2, since it's not portable to subtract 1 from the start of an
5903 array. The new item 0 is never set or used. All uses changed.
5904
5905 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
5906 the default definition of YYLLOC_DEFAULT. Problem reported
5907 by Frank Heckenbach.
5908
5909 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
5910
5911 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
5912 the normal case and one for the error case. Just use the
5913 first one uniformly. Problem reported by Frank Heckenbach.
5914 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
5915 use exactly the same macro in both places.
5916 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
5917 so that the normal-case YYRHSLOC works for the error case too.
5918 All uses changed.
5919 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
5920 (YYLLOC_DEFAULT): Use the same macro as glr.c.
5921 * doc/bison.texinfo (Location Default Action): Don't claim that
5922 we have an array of locations. Use the same macro for both glr
5923 and lalr parsers. Mention YYRHSLOC. Mention what happens when
5924 the index is 0.
5925
5926 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5927
5928 * HACKING: Update email addresses to send announcements to.
5929
5930 * configure.ac (AC_INIT): Bump version to 1.875f.
5931
5932 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5933
5934 * NEWS: Version 1.875e.
5935 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
5936
5937 * src/scan-skel.l: Include "complain.h", for "fatal".
5938
5939 * src/relation.h (relation_print, relation_digraph):
5940 Relation sizes are of type relation_node, not size_t (this is
5941 merely a doc fix, since the two types are equivalent).
5942 (relation_transpose): Relation sizes are of type relation_node,
5943 not int.
5944 * src/relation.c: Likewise.
5945 (top, infinity): Now of type relation_node, not int.
5946 (traverse, relation_transpose): Use relation_node, not int.
5947
5948 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
5949 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
5950 (yyparse): Remove unused local introduced in 2004-10-25 patch.
5951
5952 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
5953 specifying whether the test should be skipped. Use it tp
5954 specify that the [%defines %skeleton "lalr1.cc"] tests currently
5955 fail on some hosts, and should be skipped.
5956
5957 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
5958
5959 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
5960 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
5961 unless otherwise specified below.
5962
5963 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
5964 to allocate kernel_base, kernel_items, kernel_size, since
5965 they needn't be initialized to 0.
5966 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
5967 * src/closure.c (new_closure): Likewise, for itemset.
5968 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
5969 * src/lalr.c (set_goto_map): Likewise, for temp_map.
5970 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
5971 (build_relations): Likewise for edge, states1, includes.
5972 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
5973 * src/reader.c (packgram): Likewise, for ritem, rules.
5974 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
5975 * src/relation.c (relation_digraph): Likewise for VERTICES.
5976 (relation_transpose): Likewise for new_R, end_R.
5977 * src/symtab.c (symbols_token_translations_init): Likewise for
5978 token_translations.
5979 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
5980 (token_actions): Likewise for yydefact, actrow, conflrow,
5981 conflict_list.
5982 (save_column): Likewise for froms[symno], tos[symno].
5983 (goto_actions): Likewise for state_count.
5984 (pack_table): Likewise for base, pos, check.
5985 (tables_generate): Likewise for width.
5986
5987 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
5988 for initial core. Just have a separate core, so we needn't worry
5989 about whether kernel_size and kernel_base are initialized.
5990
5991 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
5992 kernel_size, kernel_items): Remove unnecessary initialization.
5993 * src/conflicts.c (conflicts): Likewise.
5994 * src/derives.c (derives): Likewise.
5995 * src/muscle_tablc (muscle_insert): Likewise.
5996 * src/relation.c (relation_digraph): Likewise.
5997 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
5998 conflrow, conflict_table, conflict_list, table, check):
5999 Likewise.
6000
6001 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
6002 This is because all callers pass unsigned int.
6003 * src/closure.h (new_closure): Likewise.
6004
6005 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
6006 (build_relations): Initialize includes[i] in all cases.
6007 * src/reader.c (packgram): Always initialize rules[ruleno].prec
6008 and rules[ruleno].precsym. Initialize members in order.
6009 * src/relation.c (relation_transpose): Always initialize new_R[i]
6010 and end_R[i].
6011 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
6012
6013 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
6014 conflict_list[0] was always 0, but now it isn't initialized.
6015
6016 * src/table.c (table_grow): When conflict_table grew, the grown
6017 area wasn't cleared. Fix this.
6018
6019 * lib/.cvsignore: Add strdup.c, strdup.h.
6020 * m4/.cvsignore: Add strdup.m4.
6021
6022 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
6023
6024 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
6025 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
6026 GOTO_NUMBER_MAXIMUM, since we occasionally compute
6027 ngotos + 1 without checking for overflow.
6028 (build_relations): Use END_NODE, not -1, to denote end of edges.
6029 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
6030 build_relations): Use goto_number, not int, for goto numbers.
6031 * src/tables.c (save_column, default_goto): Likewise.
6032
6033 2004-11-23 Akim Demaille <akim@epita.fr>
6034
6035 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
6036 of #defining from yystype.
6037 Don't typedef yystype, C++ does not need it.
6038 This lets it possible to forward declare it as union.
6039
6040 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
6041
6042 * bootstrap (gnulib_modules): Add extensions.
6043 Problem reported by Jim Meyering.
6044
6045 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
6046
6047 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
6048 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
6049 src/system.h, src/tables.c: XFREE -> free, to accommodate
6050 recent change to gnulib xalloc.h.
6051 Problem reported by Jim Meyering.
6052
6053 2004-11-17 Akim Demaille <akim@epita.fr>
6054
6055 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
6056
6057 2004-11-17 Akim Demaille <akim@epita.fr>,
6058 Alexandre Duret-Lutz <adl@gnu.org>
6059
6060 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
6061 changes.
6062 (YYCDEBUG): Adjust.
6063 Use it instead of cdebug_.
6064 (Parser::debug_stream, Parser::set_debug_stream): New.
6065 (Parser::symprint_): Define cdebug_ for temporary backward
6066 compatibility.
6067 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
6068 debug_stream ().
6069
6070 2004-11-17 Akim Demaille <akim@epita.fr>
6071
6072 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
6073 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
6074 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
6075 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
6076
6077 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
6078
6079 * data/glr.c (yyloc_default): Remove; not used.
6080 Problem reported by Frank Heckenbach.
6081
6082 2004-10-25 Akim Demaille <akim@epita.fr>
6083
6084 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
6085 Introduce another definition to address simple location arrays.
6086 (yyGLRStack): New member: yyerror_range.
6087 (yyrecoverSyntaxError, yyparse): Update it.
6088 (yyrecoverSyntaxError): Use it when shifting the error token to
6089 have an accurate range, equivalent to the one computed by both
6090 yacc.c and lalr1.cc.
6091 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
6092 that column numbers start at column 0, as per GNU Coding
6093 Standards, the others tests, and the doc.
6094 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
6095 Adjust to the above change (first column is 0).
6096 And adjust the location of the "<error>", now covering the whole
6097 line.
6098
6099 2004-10-22 Akim Demaille <akim@epita.fr>
6100 and Paul Eggert <eggert@cs.ucla.edu>
6101
6102 Remove some arbitrary limits on goto numbers and relations.
6103 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
6104 initial values, since they're never used.
6105 (set_goto_map): ngotos is now unsigned, so test for overflow
6106 by seeing whether it wraps around to zero.
6107 * src/lalr.h (goto_number): Now size_t, not short int.
6108 (GOTO_NUMBER_MAXIMUM): Remove.
6109 * src/relation.c (relation_print, traverse, relation_transpose):
6110 Check for END_NODE rather than looking at sign.
6111 * src/relation.h (END_NODE): New macro.
6112 (relation_node): Now size_t, not short int.
6113
6114 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
6115
6116 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
6117 keyword, not an identifier. Problem reported by Baron Schwartz in
6118 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
6119
6120 2004-10-11 Akim Demaille <akim@epita.fr>
6121
6122 * src/symtab.c (symbol_check_alias_consistency): Also check
6123 type names, destructors, and printers.
6124 Reported by Alexandre Duret-Lutz.
6125 Recode the handling of associativity and precedence in terms
6126 of symbol_precedence_set.
6127 Accept no redeclaration at all, not even equal to the previous
6128 value.
6129 (redeclaration): New.
6130 Use it to factor redeclaration complaints.
6131 (symbol_make_alias): Don't set the type of the alias, let
6132 symbol_check_alias_consistency do it as for other features.
6133 * src/symtab.h (symbol): Add new member prec_location, and
6134 type_location.
6135 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
6136 * tests/input.at (Incompatible Aliases): New.
6137
6138 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
6139
6140 .cvsignore fixes to accommodate gnulib changes,
6141 and the practice of naming build directories "_build".
6142 * .cvsignore: Add "_*". Sort.
6143 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
6144 * m4/.cvsignore: Add "*_gl.m4".
6145
6146 2004-10-06 Akim Demaille <akim@epita.fr>
6147
6148 * src/parse-gram.y (add_param): Fix the truncation of trailing
6149 spaces.
6150
6151 2004-10-05 Akim Demaille <akim@epita.fr>
6152
6153 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
6154 whether the reducion was empty or not. This leaves room to
6155 improve the use of YYLLOC_DEFAULT in such a case.
6156 lalr1.cc is still experimental, so changing this is acceptable.
6157 And finally, there are probably not many users who changed the
6158 handling of locations in GLR, so changing is admissible too.
6159
6160 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
6161 empty reduction, set @$ to an empty location ending the previously
6162 stacked symbol.
6163 Adjust uses to make sure the code is triggered on empty
6164 reductions.
6165 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
6166 expected output: empty reductions have empty locations.
6167
6168 2004-09-29 Akim Demaille <akim@epita.fr>
6169
6170 * data/lalr1.cc: Move towards a more standard C++ coding style
6171 for templates: Class < T > -> Class<T>.
6172
6173 2004-09-29 Akim Demaille <akim@epita.fr>
6174
6175 * data/lalr1.cc: Reinstall the former ctor, for sake of
6176 compatibility, but warn it will be removed.
6177 Move towards a more standard C++ coding style (i.e., type *var ->
6178 type* var).
6179
6180 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
6181
6182 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
6183 since it's less likely to work if NULs are involved in the future.
6184
6185 2004-09-27 Akim Demaille <akim@epita.fr>
6186
6187 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
6188
6189 2004-09-27 Akim Demaille <akim@epita.fr>
6190
6191 * data/lalr1.cc (b4_parse_param_decl_1): New.
6192 (b4_parse_param_decl): Use it to have different names between attribute
6193 and argument names.
6194 (b4_cc_constructor_call): Likewise.
6195
6196 2004-09-24 Akim Demaille <akim@epita.fr>
6197
6198 * src/parse-gram.y (add_param): Strip the leading and trailing
6199 blanks from a formal argument declaration.
6200 (YY_LOCATION_PRINT): New.
6201
6202 2004-09-24 Akim Demaille <akim@epita.fr>
6203
6204 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
6205 after the location.
6206
6207 2004-09-24 Akim Demaille <akim@epita.fr>
6208
6209 * doc/bison.texinfo (Table of Symbols): Sort.
6210
6211 2004-09-21 Akim Demaille <akim@epita.fr>
6212
6213 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
6214 the useless parentheses.
6215 Suggested by Paul Eggert.
6216
6217 2004-09-20 Akim Demaille <akim@epita.fr>
6218
6219 Let the initial-action act on the look-ahead, and use it for the
6220 "initial push" (corresponding to an hypothetical beginning-of-file).
6221 And let lalr1.cc honor %initial-action.
6222
6223 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
6224 example.
6225 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
6226 (Parser::Parser): Remove the ctor that used to initialize it.
6227 (Parser::parse): Like in the other skeletons, issue the "starting
6228 parse" message before any action.
6229 Honor %initial-action.
6230 Initialize the stacks with the lookahead.
6231 * data/yacc.c: Let $$ and @$ in %initial-action designate the
6232 look-ahead.
6233 Push them in the stacks.
6234 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
6235
6236 2004-09-20 Akim Demaille <akim@epita.fr>
6237
6238 * doc/bison.texinfo (Initial Action Decl): New.
6239
6240 2004-09-20 Akim Demaille <akim@epita.fr>
6241
6242 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
6243 clearer criterion to define it.
6244 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
6245 When reducing on an empty RHS, use the latest stacked location as
6246 location.
6247 yylloc is not always available.
6248 * data/glr.c: Likewise.
6249 Also, honor initial-actions.
6250
6251 2004-09-20 Akim Demaille <akim@epita.fr>
6252
6253 * data/yacc.c (YY_LOCATION_PRINT): New.
6254 Define when we know YYLTYPE's structure, i.e., when the default
6255 YYLLOC_DEFAULT is used.
6256 * data/c.m4 (b4_yysymprint_generate): Use it.
6257 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
6258 value of the result.
6259 (error_start_): Replace with...
6260 (error_range_): this location array.
6261 This allows to replace code relying on the implementation of
6262 locations by portable code.
6263 * data/yacc.c (yylerrsp): Replace with...
6264 (yyerror_range): this.
6265 Every time a token is popped, update yyerror_range[0], to have an
6266 accurate location for the error token.
6267 * data/glr.c (YY_LOCATION_PRINT): New.
6268 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
6269 deference a pointer.
6270 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
6271 report the location in %printers.
6272
6273 * src/scan-skel.l: Instead of abort, report error messages to ease
6274 understanding skeleton scanning failures.
6275
6276 2004-09-16 Akim Demaille <akim@epita.fr>
6277
6278 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
6279 (iterator, const_iterator): these, to be more in the C++ spirit.
6280 Also, return reverse iterators so that when displaying the stack
6281 we display its bottom first.
6282 (Parser::stack_print_, Parser::reduce_print_): Match the messages
6283 from yacc.c.
6284 We should probably use vector here though.
6285
6286 2004-09-16 Akim Demaille <akim@epita.fr>
6287
6288 Have more complete shift traces.
6289
6290 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
6291 to report Shifts instead of ad hoc YYDPRINTF invocations,
6292 including for the error token.
6293 * data/lalr1.cc (symprint_): Output the location.
6294 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
6295 output the location within the %printer.
6296 Activate GLR tests, at least to make sure they compile properly.
6297 They still don't pass though.
6298 * tests/calc.at: Adjust expect verbose output, since now "Entering
6299 state..." is on a different line than the "Shifting" message.
6300
6301 2004-09-08 Akim Demaille <akim@epita.fr>
6302
6303 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
6304 Bison directive from the Bison file to the invocation of this
6305 macro, so that these directives are passed to
6306 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
6307 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
6308 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
6309 the extra Bison directives instead of the whole series.
6310 Change the grammar so that there are recoverable errors, and
6311 unrecoverable errors. Now we can have the parser give up before
6312 consuming the whole input. As a result we now can observe that
6313 the lookahead is freed when needed.
6314 Change the parser source to parse argv[1] instead of a hard coded
6315 string.
6316 Simplify yylex, and give a value and location to EOF.
6317 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
6318 passed directives already coded in the file.
6319 Add some tests to check the location of "error".
6320 For some tests, the C++ parser is correct, and not yacc.c.
6321 For other tests, they provide different, but unsatisfying, values,
6322 so keep the C++ value so that at least one parser is "correct"
6323 according to the test suite.
6324 (Actions after errors): Remove, this is subsumed by the
6325 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
6326
6327 2004-09-06 Akim Demaille <akim@epita.fr>
6328
6329 * data/lalr1.cc: Adjust the indentation of the labels.
6330 (Parser::pop): New.
6331 Use it.
6332
6333 2004-09-06 Akim Demaille <akim@epita.fr>
6334
6335 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
6336 argument, an informative message.
6337 Call YY_SYMBOL_PRINT.
6338 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
6339 * data/lalr1.cc (destruct_): Likewise.
6340 In addition, no longer depend on b4_yysymprint_generate and
6341 b4_yydestruct_generate to generate these functions, do it "by
6342 hand".
6343
6344 2004-09-03 Akim Demaille <akim@epita.fr>
6345
6346 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
6347 invoked, yydestruct the lookahead.
6348 * tests/calc.at (Calculator $1): Update the expected lengths of
6349 traces: there is an added line for the discarded lookahead.
6350 * doc/bison.texinfo (Destructor Decl): Some rewording.
6351 Define "discarded" symbols.
6352
6353 2004-09-02 Akim Demaille <akim@epita.fr>
6354
6355 * data/lalr1.cc (translate_, destruct_): No reason to be static.
6356
6357 2004-09-02 Akim Demaille <akim@epita.fr>
6358
6359 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
6360 (YYDSYMPRINTF): Rename as...
6361 (YY_SYMBOL_PRINT): this.
6362 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
6363 two.
6364 Use it instead of direct symprint_ calls.
6365 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
6366 one.
6367
6368 2004-09-02 Akim Demaille <akim@epita.fr>
6369
6370 * data/lalr1.cc (b4_yysymprint_generate): New.
6371 (symprint_): New member function, defined when YYDEBUG.
6372 Use it consistently instead of token/nterm debugging output by
6373 hand.
6374 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
6375 %printer calls to use cdebug_ when using lalr1.cc.
6376
6377 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
6378
6379 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
6380 with #ifdef YYDEBUG.
6381
6382 2004-08-26 Akim Demaille <akim@epita.fr>
6383
6384 * doc/bison.texinfo (Implementing Loops): Rename as...
6385 (Implementing Gotos/Loops): this.
6386
6387 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
6388
6389 Adjust to latest gnulib.
6390 * bootstrap (gnulib_modules): Add xalloc-die.
6391 Set LC_ALL=C so that file names sort consistently.
6392 Prefer the gnulib copies of gettext.m4, glibc21.m4,
6393 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
6394 uintmax_t.m4, ulonglong.m4.
6395 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
6396 po.m4 since we are now using _gl.m4 instead.
6397
6398 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
6399
6400 * src/scan-action.l: Remove. Scanning of semantic actions is
6401 handled in scan-gram.l.
6402
6403 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
6404
6405 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
6406
6407 * src/location.h (struct): The file member is a uniqstr.
6408 (equal_boundaries): Use UNIQSTR_EQ for comparison.
6409
6410 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
6411
6412 Fix bug with non-%union parsers that have printers or destructors,
6413 which led to a Bison core dump. Reported by Peter Fales in
6414 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
6415
6416 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
6417 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
6418 not to our own type.
6419 * src/output.c (symbol_destructors_output, symbol_printers_output):
6420 Don't assume %union.
6421 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
6422 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
6423 UNION-FLAG. All callers changed.
6424 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
6425 Use type char, not unsigned int, when declaring an array of char;
6426 this lets us remove a cast.
6427 (Printers and Destructors): Add non-%union test cases.
6428
6429 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
6430
6431 * doc/bison.texinfo: Minor editorial changes, mostly to the new
6432 GLR writeups. E.g., avoid frenchspacing and the future tense,
6433 change "lookahead" to "look-ahead", and change "wrt" to "with
6434 respect to".
6435
6436 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6437
6438 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
6439 New sections, split off from the GLR Parsers section. Put the new
6440 Simple GLR Parser near the start of the GLR section, for clarity.
6441 Rewrite connective text.
6442
6443 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
6444
6445 * doc/bison.texinfo (Simple GLR Parsers): New section.
6446
6447 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
6448
6449 * NEWS, TODO, doc/bison.texinfo:
6450 Use "look-ahead" instead of "lookahead", to be consistent.
6451 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
6452 while we're fixing "look-ahead".
6453 * src/conflicts.c (shift_set): Renamed from shiftset.
6454 (look_ahead_set): Renamed from lookaheadset.
6455 * src/print.c: Likewise.
6456 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
6457 name for "lookahead".
6458 (report_types, usage): Likewise.
6459 * src/getargs.h (report_look_ahead_tokens): Renamed from
6460 report_lookaheads.
6461 * src/lalr.c (compute_look_ahead_tokens): Renamed from
6462 compute_lookaheads.
6463 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
6464 (look_ahead_tokens_print): Renamed from lookaheads_print.
6465 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
6466 state_rule_lookaheads_print.
6467 * src/state.h: Likewise.
6468 (reductions.look_ahead_tokens): Renamed from lookaheads.
6469 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
6470 AT_DATA_LOOKAHEADS_GRAMMAR.
6471
6472 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
6473
6474 * README: Update location of patched M4 distribution.
6475
6476 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
6477
6478 Don't assume the C++ compiler takes the same arguments as the C compiler
6479 (trivial change).
6480 * configure.ac (O0CXXFLAGS): New var.
6481 * tests/atlocal.in (CXXFLAGS): Use it.
6482
6483 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
6484
6485 Fix some "make check" problems with C++ reported by
6486 Albert Chin-A-Young for Tru64 C++ in this thread:
6487 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
6488
6489 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
6490 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6491 Output to a .cc file for C++, not to a .c file.
6492 * tests/calc.at (AT_CHECK_CALC): Likewise.
6493 * tests/regression.at (AT_CHECK_DANCER): Likewise.
6494 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
6495
6496 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
6497
6498 * tests/calc.at, tests/actions.at: Workaround for SGI
6499 C++ compiler. (trivial change)
6500
6501 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
6502
6503 Spent a few hours checking out which prerequisite versions the
6504 current sources actually require. I went all the way back to
6505 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
6506 a seemingly endless set of combinations of versions more recent
6507 than that. The bottom line is that the current sources require
6508 fairly recent versions of the build tools, and it'll be some work
6509 to change this.
6510 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
6511 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
6512 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
6513 Add comments explaining why those particular versions are
6514 currently needed.
6515
6516 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
6517 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
6518 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
6519
6520 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
6521 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
6522
6523 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
6524
6525 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
6526 0.11.5. Suggested by Bruno Haible.
6527 * bootstrap: Remove gettext version checking.
6528
6529 * doc/bison.texinfo (Decl Summary): Also mention that %union
6530 can depend on prerequisite types. Problem reported by Tim
6531 Van Holder.
6532
6533 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
6534
6535 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
6536 * README-alpha: Don't tell people not to package this.
6537
6538 * bootstrap: Don't assume $(...) works; use `...` instead.
6539 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
6540 gettext better.
6541
6542 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
6543 put into the -d output file, and mention what to do if YYSTYPE is
6544 defined as a macro.
6545
6546 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
6547
6548 Undo change made earlier today: it caused autopoint to not bring
6549 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
6550 autopoint's.
6551
6552 * bootstrap: Check that gettext version matches what's in
6553 configure.ac. Warn users to ignore robots.txt ERROR 404.
6554 * bootstrap: Undo today's earlier change (logged below).
6555 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
6556
6557 The gettext version checking is causing more trouble than it's
6558 curing; remove it. Problem reported by Paul Hilfinger.
6559
6560 * bootstrap: Issue a warning that one can expect a message
6561 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
6562 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
6563
6564 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
6565
6566 Ensure that the C++ compiler used for testing actually works on a
6567 simple test program; if not, skip the C++-related tests. Problem
6568 reported by Vin Shelton in:
6569 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
6570
6571 * m4/cxx.m4: New file.
6572 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
6573 * tests/atlocal.in (BISON_CXX_WORKS): Add.
6574 * tests/local.at (AT_COMPILE_CXX): Use it.
6575
6576 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
6577
6578 * data/glr.c (yylloc): Output this macro even if locations are not
6579 being generated, as the GLR parser needs it even in that case.
6580 Problem reported by Troy A. Johnson
6581 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
6582
6583 * configure.ac (AC_INIT): Update to 1.875e.
6584
6585 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
6586
6587 * NEWS: Version 1.875d.
6588 * configure.ac (AC_INIT): Likewise.
6589 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
6590
6591 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
6592 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
6593 lalr1.cc runs afoul of the first, and the last two are no longer
6594 supported by GCC 3.4.0.
6595 * README: Mention GNU m4 1.4 or later; mention m4 patches.
6596 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
6597
6598 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
6599
6600 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
6601 unsigned int, for compatibility with latest gnulib hash module.
6602 * src/state.c (state_hash, state_hasher): Likewise.
6603 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
6604 * src/uniqstr.c (hash_uniqstr): Likewise.
6605
6606 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
6607
6608 * NEWS: Unescaped newlines are no longer allowed in char & strings.
6609
6610 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
6611 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
6612 character and string literals.
6613 (unexpected_end): New function.
6614 (unexpected_eof): Use it.
6615 (unexpected_newline): New function.
6616 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
6617 actions.
6618
6619 * NEWS: Document %expect-rr.
6620
6621 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
6622 Fix typo by replacing $1 with $option.
6623 Remove more 'intl'-related files.
6624 Don't DEFUN AM_INTL_SUBDIR twice.
6625
6626 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
6627 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
6628 strtoul.c.
6629 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
6630 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
6631 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
6632 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
6633 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
6634 * src/.cvsignore: Add *.output.
6635
6636 * src/parse-gram.y: Put copyright notice inside %{ %} so it
6637 gets copied to the output file.
6638
6639 2004-04-28 Paul Eggert <eggert@twinsun.com>
6640
6641 Get files from the gnulib and po repositories, instead of relying
6642 on them being in our CVS. Upgrade to latest versions of gnulib
6643 and Automake.
6644
6645 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
6646 * bootstrap: Bootstrap from gnulib and po repositories.
6647 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
6648 * README-cvs: Document these changes. Remove version numbers from
6649 mentions of build tools, since they change so often. Mention Flex.
6650
6651 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
6652 (gl_USE_SYSTEM_EXTENSIONS): Add.
6653 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
6654 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
6655 does this for us.
6656 (AC_ISC_POSIX): Remove; we no longer support this
6657 ancient OS, as it gets in the way of latest Autoconf & gnulib.
6658 (AC_HEADER_STDC): Remove: we now assume C89 or better.
6659 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
6660 Do not check for C89 headers, except for locale.h which is used
6661 by the Yacc library and must port to K&R hosts.
6662 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
6663 Do not check for C89 functions, except for setlocale which is
6664 used by the Yacc library.
6665 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
6666 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
6667 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
6668 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
6669 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
6670 AM_GNU_GETTEXT): Remove; now done by:
6671 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
6672 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
6673 for us.
6674
6675 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
6676 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
6677 Define to empty, as gnulib.mk will do the rest for us.
6678 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
6679 for us.
6680 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
6681 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
6682
6683 * src/files.c: Include gnulib's xstrndup.h.
6684
6685 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
6686 (REALLOC): Use xnrealloc, for likewise.
6687 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
6688 (strnlen, memrchr): Remove decls; functions no longer used.
6689 Include <stpcpy.h>.
6690
6691 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
6692 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
6693 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
6694 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
6695 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
6696 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
6697 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
6698 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
6699 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
6700 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
6701 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
6702 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
6703 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
6704 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
6705 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
6706 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
6707 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
6708 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
6709 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
6710 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
6711 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
6712 Remove, as these files are now generated automatically
6713 by bootstrap or automake.
6714
6715 * po/ChangeLog: Remove: all but one entry was a duplicate
6716 of this file, and I moved that 2000-11-02 entry here.
6717
6718 * config/.cvsignore: Add Makefile, depcomp, install-sh.
6719 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
6720 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
6721 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
6722 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
6723 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
6724 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
6725 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
6726 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
6727 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
6728 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
6729 xstrndup.h.
6730 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
6731 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
6732 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
6733 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
6734 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
6735 * src/.cvsignore: Remove *_.c.
6736
6737
6738 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
6739 support it. (The latest stable gzip doesn't.)
6740
6741 2004-04-27 Paul Eggert <eggert@twinsun.com>
6742
6743 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
6744 case, as stos_ is now used by destructors due to the 2004-02-09
6745 change.
6746
6747 Remove more K&R C support.
6748 * lib/libiberty.y (PARAMS): Remove. All uses removed.
6749 * lib/subpipe.c (errno): Remove decl.
6750 Include <stdlib.h> unconditionally.
6751 (EXIT_FAILURE): Remove macro.
6752 * src/complain.c (vfprintf, strerror): Remove.
6753 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
6754 unconditionally.
6755 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
6756 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
6757 (strchr, strspn, memchr): Remove decls.
6758 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
6759 unconditionally. Do not declare perror.
6760 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
6761 unconditionally.
6762
6763 * src/complain.c (_): Remove useless defn, as system.h defines this.
6764
6765 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
6766 with latest obstack.h.
6767 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
6768 to procedure types, as obstack.h now does that for us.
6769 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
6770
6771 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
6772 so that this include file can stand alone.
6773 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
6774 does this now. Include subpipe.h first after config.h, to
6775 test whether it can stand alone.
6776
6777 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
6778 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
6779 unused declaration.
6780
6781 * tests/synclines.at (%union synch line): Put a dummy member in
6782 the union, because empty unions aren't allowed in C. Caught
6783 by GCC 3.4.0.
6784
6785 2004-04-13 Jim Meyering <jim@meyering.net>
6786
6787 * src/conflicts.c (conflicts_print): Correct format string typo:
6788 use `%%' to produce literal `%'. (trivial change)
6789
6790 2004-03-30 Paul Eggert <eggert@twinsun.com>
6791
6792 * src/getargs.c (version): Update copyright year to 2004.
6793
6794 * data/c.m4 (b4_int_type): Use 'short int' rather than
6795 'short', and similarly for 'long', 'unsigned', etc.
6796 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
6797 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
6798 yy_yypstack, yydumpstack): Likewise.
6799 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
6800 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
6801 Likewise.
6802 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
6803 yy_stack_print, yyparse): Likewise.
6804 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
6805 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
6806 * lib/bitset.c (bitset_print): Likewise.
6807 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
6808 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
6809 * lib/bitsetv.c (bitsetv_dump): Likewise.
6810 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
6811 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
6812 Likewise.
6813 * src/LR0.c (allocate_itemsets): Likewise.
6814 * src/gram.h (rule_number, rule): Likewise.
6815 * src/lalr.h (goto_number): Likewise.
6816 * src/nullable.c (nullable_compute): Likewise.
6817 * src/output.c (prepare_rules): Likewise.
6818 * src/relation.c (relation_print, relation_digraph): Likewise.
6819 * src/relation.h (relation_node): Likewise.
6820 * src/state.h (state_number, transitions, errs, reductions,
6821 struct state): Likewise.
6822 * src/symtab.h (symbol_number, struct symbol): Likewise.
6823 * src/tables.c (vector_number, tally, action_number,
6824 default_goto, goto_actions): Likewise.
6825 * tests/existing.at (GNU Cim Grammar): Likewise.
6826 * tests/regression.at (Web2c Actions): Likewise.
6827
6828 * src/output.c (muscle_insert_short_int_table): Renamed from
6829 muscle_insert_short_table. All uses changed.
6830
6831 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6832
6833 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
6834 (declaration): Replace expected_conflicts with expected_sr_conflicts.
6835 Add %expect-rr rule.
6836
6837 * src/scan-gram.l: Recognize %expect-rr.
6838
6839 * src/conflicts.h (expected_sr_conflicts): Rename from
6840 expected_conflicts.
6841 (expected_rr_conflicts): Declare.
6842
6843 * src/conflicts.c (expected_sr_conflicts): Rename from
6844 expected_conflicts.
6845 (expected_rr_conflicts): Define.
6846 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
6847 for GLR parsers.
6848 Use expected_sr_conflicts in place of expected_conflicts.
6849 Warn if expected_rr_conflicts used in non-GLR parser.
6850
6851 * doc/bison.texinfo: Add documentation for %expect-rr.
6852
6853 2004-03-08 Paul Eggert <eggert@gnu.org>
6854
6855 Add support for hex token numbers. Suggested by Odd Arild Olsen in
6856 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
6857
6858 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
6859 in lalr1.cc.
6860 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
6861 * src/scan-gram.l (scan_integer): New function.
6862 ({int}): Use it.
6863 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
6864 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
6865 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
6866 Say "long int", not "long", for uniformity with GNU style.
6867
6868 2004-02-25 Paul Eggert <eggert@twinsun.com>
6869
6870 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
6871 compilers. This fixes a problem with Intel's C++ compiler being
6872 chatty, reported by Guido Trentalancia in
6873 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
6874
6875 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
6876
6877 Support %destructor and merge error locations in lalr1.cc.
6878
6879 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
6880 (Parser::stos_): Define unconditionally.
6881 (Parser::destruct_): New method. Generate its body with
6882 b4_yydestruct_generate.
6883 (Parser::error_start_): New attribute.
6884 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
6885 token which are discarded.
6886 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
6887 error_start_ when erroneous token are discarded.
6888 (Parser::parse) <yyerrlab1>: Compute the location of the error
6889 token so that it covers all the discarded tokens.
6890 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
6891 it can be called with `%skeleton "lalr1.cc"', and do that.
6892
6893 2004-02-02 Paul Eggert <eggert@twinsun.com>
6894
6895 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
6896 $(top_srcdir)/lib and ../lib. This fixes a bug reported
6897 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
6898 There's no need to mention top_builddir since Automake does that
6899 for us.
6900 (INCLUDES): Remove, as Automake says it's obsolescent.
6901 Contents migrated into AM_CPPFLAGS as described above.
6902 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
6903
6904 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6905
6906 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
6907 (yyreportSyntaxError): Handle case where lookahead token is
6908 YYEMPTY.
6909
6910 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6911
6912 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
6913 resulting parsers are compilable with C++.
6914
6915 2003-12-23 Paul Eggert <eggert@twinsun.com>
6916
6917 * config/depcomp, config/install-sh: Sync with Automake 1.8.
6918 * src/output.c (output_skeleton): Rename local var.
6919 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
6920 Bison tokens, as this runs afoul of the 2003-10-07 change that
6921 disallowed NUL bytes in character constants or string literals.
6922
6923 * tests/local.at: Require Autoconf 2.59's Autotest.
6924 * tests/testsuite.at: Don't include local.at, since we now assume
6925 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
6926 including it.
6927 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
6928 multiple inclusion warnings.
6929
6930 2003-12-02 Akim Demaille <akim@epita.fr>
6931
6932 * doc/bison.texinfo (How Can I Reset the Parser): More about start
6933 conditions.
6934 From Bruno Haible.
6935
6936 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
6937
6938 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
6939
6940 2003-10-07 Paul Eggert <eggert@twinsun.com>
6941
6942 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
6943 if testsuite doesn't exist.
6944
6945 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
6946 literals, unfortunately.
6947 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
6948 Complain about NUL bytes in character constants or string literals.
6949
6950 2003-10-05 Paul Eggert <eggert@twinsun.com>
6951
6952 * NEWS: Don't document %no-default-prec, as it's still
6953 too experimental.
6954 * doc/bison.texinfo: Document %no-default-prec only if
6955 the defaultprec flag is set. Normally it's not.
6956
6957 2003-10-04 Paul Eggert <eggert@twinsun.com>
6958
6959 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
6960 non-modifiable lvalue, instead of a modifiable one.
6961 * doc/bison.texinfo (Actions): Document that $$ can
6962 be assigned to. Do not claim that $$ and $N are
6963 array element references: user code should not rely on this.
6964
6965 2003-10-01 Paul Eggert <eggert@twinsun.com>
6966
6967 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
6968 (grammar_declaration): Use it.
6969 * src/scan-gram.l: New token %no-default-prec.
6970 * tests/conflicts.at: Revamp tests to use %no-default-prec.
6971 * NEWS, doc/bison.texinfo: Document the above.
6972
6973 2003-10-01 Akim Demaille <akim@epita.fr>
6974
6975 VCG no longer supports long_straight_phase.
6976
6977 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
6978 * src/print_graph.c (print_graph): Adjust.
6979
6980 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
6981 and Paul Eggert <eggert@twinsun.com>
6982
6983 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
6984 Table of Symbols): Document %default-prec.
6985 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
6986 (grammar_declaration): Set default_prec on %default-prec.
6987 * src/scan-gram.l (%default-prec): New token.
6988 * src/reader.h (default_prec): New flag.
6989 * src/reader.c: Likewise.
6990 (packgram): Handle it.
6991 * tests/conflicts.at (%default-prec without %prec,
6992 %default-prec with %prec, %default-prec 1): New tests.
6993
6994 2003-09-30 Paul Eggert <eggert@twinsun.com>
6995
6996 * tests/testsuite.at: Include local.at, not input.at, fixing
6997 a typo in the 2003-08-25 patch.
6998
6999 2003-08-27 Akim Demaille <akim@epita.fr>
7000
7001 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
7002 GCC warnings.
7003
7004 2003-08-26 Akim Demaille <akim@epita.fr>
7005
7006 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
7007 "<\#" to avoid magic from Gnus when posting parts of this script.
7008
7009 2003-08-26 Akim Demaille <akim@epita.fr>
7010
7011 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
7012 (Parser::parse): here.
7013 Adjust: nerrs and errstatus is now replaced by...
7014 (Parser::nerrs_, Parser::errstatus_): New.
7015
7016 2003-08-25 Akim Demaille <akim@epita.fr>
7017
7018 * config/announce-gen, Makefile.cfg: New.
7019 * Makefile.am: Adjust.
7020 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
7021 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
7022
7023 2003-08-25 Akim Demaille <akim@epita.fr>
7024
7025 When reducing initial empty rules, Bison parser read an initial
7026 location that is not defined. This results in garbage, and that
7027 affects Bison's own parser. Therefore we need (i) to extend Bison
7028 to support a means to initialize this location, and (ii) to use
7029 this CVS Bison to fix CVS Bison's parser.
7030
7031 * src/reader.h, reader.c (epilogue_augment): Remove, replace
7032 with...
7033 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
7034 * src/parse-gram.y: Adjust.
7035 (%initial-action): New.
7036 (%error-verbose): Since we require CVS Bison, there is no reason
7037 not to use it.
7038 * src/scan-gram.l: Adjust.
7039 * src/Makefile.am (YACC): New, to make sure we use our own parser.
7040 * data/yacc.c (yyparse): Use b4_initial_action.
7041
7042 2003-08-25 Akim Demaille <akim@epita.fr>
7043
7044 * doc/bison.texinfo: Don't promote stdout for error messages.
7045
7046 2003-08-25 Akim Demaille <akim@epita.fr>
7047
7048 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
7049 From Alexandre Duret-Lutz.
7050
7051 2003-08-25 Akim Demaille <akim@epita.fr>
7052
7053 Version 1.875c.
7054
7055 2003-08-25 Akim Demaille <akim@epita.fr>
7056
7057 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
7058 Use them.
7059
7060 2003-08-25 Akim Demaille <akim@epita.fr>
7061
7062 * data/lalr1.cc (Parser::reduce_print_): New.
7063 Use it.
7064
7065 2003-08-25 Akim Demaille <akim@epita.fr>
7066
7067 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
7068 error recovery loops. This patch is based on
7069 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
7070 Also, augment the similarity between lalr1.cc and yacc.c.
7071 Note: the locations of error recovery rules are not correct yet.
7072
7073 * data/lalr1.cc: Comment changes to augment the similarity between
7074 lalr1.cc and yacc.c.
7075 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
7076 (yyerrlab1): Remove, but where it used to be (now the bottom part of
7077 yyerrlab), when hitting EOF, pop the whole stack here instead of
7078 merely falling thru the default error handling mechanism.
7079 (yyerrorlab): New label, with the old contents of YYERROR,
7080 plus the following change: pop the stack of rhs corresponding
7081 to the production that invoked YYERROR. That is how Yacc
7082 behaves (required by POSIX).
7083 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
7084 fail.
7085
7086 2003-08-25 Akim Demaille <akim@epita.fr>
7087
7088 Tune local.at so that people can "autom4te -l autotest calc.at -o
7089 calc" for instance, to extract a sub test suite.
7090
7091 * tests/testsuite.at: Move the initialization, Autotest version
7092 requirement, and AT_TESTED invocation into...
7093 * tests/local.at: here.
7094 * tests/testsuite.at: Include it for compatibility with Autoconf
7095 2.57.
7096 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
7097 be ignore.
7098
7099 2003-08-04 Paul Eggert <eggert@twinsun.com>
7100
7101 Rework code slightly to avoid gcc -Wtraditional warnings.
7102 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
7103 The returned value is now stored in *YY0. All callers changed.
7104 * src/output.c (merge_output): Adjust to the above change.
7105
7106 2003-07-26 Paul Eggert <eggert@twinsun.com>
7107
7108 * data/glr.c (YYASSERT): New macro.
7109 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
7110 yyresolveStates, yyprocessOneStack):
7111 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
7112 Derived from a suggestion by Frank Heckenbach.
7113
7114 2003-07-25 Paul Eggert <eggert@twinsun.com>
7115
7116 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
7117 for portability to K&R C (after ansi2knr, presumably). See
7118 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
7119 by Frank Heckenbach, though I have omitted the structure-initialization
7120 part of his glr-knr.diff patch since I recall that the Portable
7121 C Compiler didn't require that change.
7122
7123 Let the user specify how to allocate and free memory.
7124 Derived from a suggestion by Frank Heckenbach in
7125 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
7126 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
7127 All uses of free, malloc, realloc changed to use these macros,
7128 and unnecessary casts removed.
7129 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
7130
7131 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
7132
7133 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
7134 use s.empty() rather than s == "" to test for empty string; see
7135 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
7136 (trivial change)
7137
7138 2003-06-25 Akim Demaille <akim@epita.fr>
7139
7140 * config/depcomp, config/install-sh: Update from masters.
7141
7142 2003-06-20 Paul Eggert <eggert@twinsun.com>
7143
7144 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
7145 and return properly parenthesized result.
7146 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
7147 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
7148 Remove unnecessary parentheses from uses.
7149 * doc/bison.texinfo (Location Default Action): Describe the
7150 conventions for parentheses.
7151
7152 2003-06-19 Paul Eggert <eggert@twinsun.com>
7153
7154 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
7155 yyreportTree): Do not assume that size_t is the same width as int,
7156 when printing sizes. Print sizes using an unsigned format.
7157 Problem reported by Frank Heckenbach in
7158 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
7159
7160 Port to Forte Developer 7 C compiler.
7161 * data/glr.c (struct YYLTYPE): If locations are not being used,
7162 declare a single dummy member, as empty structs do not conform
7163 to the C standard.
7164 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
7165 the Forte Developer 7 C compiler complains that end-of-loop
7166 code is not reached.
7167
7168 2003-06-17 Paul Eggert <eggert@twinsun.com>
7169
7170 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
7171 avoid warnings from picky compilers about redefinition of PARAMS.
7172
7173 2003-06-17 Paul Eggert <eggert@twinsun.com>
7174
7175 Version 1.875b.
7176
7177 * NEWS: Document 1.875b.
7178
7179 * lib/bbitset.h: Do not include config.h; that's the includer's job.
7180 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
7181 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
7182 Don't use 'index' in comments, as it's a builtin fn on some hosts.
7183 * lib/bitset_stats.c: Include gettext.h unconditionally, as
7184 per recent gettext manual's suggestion.
7185 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
7186 Use prototypes, not old-style definitions.
7187 * lib/lbitset.c (lbitset_unused_clear): Likewise.
7188 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
7189 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
7190 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
7191 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
7192 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
7193 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
7194 vbitset_or_and_cmp, vbitset_copy): Likewise.
7195
7196 * lib/libiberty.h: Do not include config.h; that's the includer's job.
7197 Do not include <stdlib.h>.
7198 (PARAMS): Define unconditionally for C89.
7199 (ATTRIBUTE_NORETURN): Remove.
7200 (ATTRIBUTE_UNUSED): Define unconditionally.
7201
7202 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
7203 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
7204 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
7205 * lib/vbitset.c, lib/vbitset.h: New files.
7206 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
7207 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
7208 from libbitset.
7209
7210 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
7211 `How Can I Reset @code{yyparse}', since texinfo does not allow
7212 arbitrary @ in node names.
7213
7214 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
7215 shouldn't be needed according to the gettext 0.12.1 documentation
7216 but which seem to be needed anyway: codeset.m4 glibc21.m4
7217 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
7218 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
7219 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
7220
7221 * lib/.cvsignore: Add stdbool.h.
7222 * m4/.cvsignore: Add nls.m4, po.m4.
7223
7224 Upgrade to CVS gnulib.
7225 * stdbool_.h: File renamed from stdbool.h.in.
7226 * configure.ac (AM_STDBOOL_H): Invoke this instead of
7227 AC_HEADER_STDBOOL.
7228 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
7229 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
7230 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
7231 (MOSTLYCLEANFILES): New var.
7232 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
7233 (stdbool.h): New rule.
7234 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
7235 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
7236 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
7237 m4/quote.m4: Upgrade to today's gnulib.
7238
7239 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
7240 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
7241 the tests right now.
7242 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
7243 yyerror are declared before use; C99 requires this.
7244
7245 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7246
7247 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
7248 first.
7249 (yyrecoverSyntaxError): Correct the logic for setting and testing
7250 yyerrState.
7251 Correct comment on handling EOF.
7252 Allow states with only a default reduction, rather than failing
7253 (I can't quite reconstruct why these were not allowed before).
7254
7255 Fixes to avoid problem that $-N rules in GLR parsers can cause
7256 buffer overruns, corrupting state.
7257
7258 * src/output.c (prepare_rules): Output max_left_semantic_context
7259 definition.
7260 * src/reader.h (max_left_semantic_context): New variable declaration.
7261 * src/scan-gram.l (max_left_semantic_context): Define.
7262 (handle_action_dollar): Update max_left_semantic_context.
7263 * data/glr.c (YYMAXLEFT): New definition.
7264 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
7265 (yyresolveAction): Ditto.
7266
7267 Fixes to problems with location handling in GLR parsers reported by
7268 Frank Heckenbach (2003/06/05).
7269
7270 * data/glr.c (YYLTYPE): Make trivial if locations not used.
7271 (YYRHSLOC): Add parentheses, and define only if locations used.
7272 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
7273 locations not used.
7274 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
7275 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
7276
7277 * tests/cxx-type.at: Exercise location information; update tests
7278 to differentiate output with and without locations.
7279 Remove forward declarations of yylex and yyerror---caused errors
7280 because default YYLTYPE not yet defined.
7281 Change semantic actions to compute strings, rather than printing
7282 them directly (to test proper passing of semantics values). Change
7283 output to prefix notation and update test data and expected results.
7284 (yylex): Track locations.
7285 (stmtMerge): Return value rather than printing, and include arguments
7286 in value.
7287
7288 2003-06-03 Paul Eggert <eggert@twinsun.com>
7289
7290 Avoid warnings generated by GCC 2.95.4 when Bison is
7291 configured with --enable-gcc-warnings.
7292 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
7293 yy::]b4_parser_class_name[::translate_,
7294 yy::Stack::operator[] (unsigned),
7295 yy::Stack::operator[] (unsigned) const,
7296 yy::Slice::operator[] (unsigned),
7297 yy::Slice::operator[] (unsigned) const):
7298 Rename local vars to avoid warnings.
7299 * tests/glr-regression.at (Improper handling of embedded actions
7300 and $-N in GLR parsers): Remove unused local variable from yylex.
7301 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
7302 (void) as arg when not pure, since we now assume C89 when building
7303 Bison. Pacify GCC by using parameter.
7304
7305 2003-06-02 Paul Eggert <eggert@twinsun.com>
7306
7307 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
7308 yy::Location::lines, yy::Location::columns): Rename arguments
7309 to avoid shadowing; this removes a warning generated by GCC 3.3.
7310
7311 2003-06-01 Paul Eggert <eggert@twinsun.com>
7312
7313 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
7314 to g++, as GCC 3.3 complains if you do it.
7315 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
7316 everything that WARNING_CFLAGS has, except omit warnings
7317 not suitable for C++.
7318 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
7319 * tests/atlocal.in (CXXFLAGS): New var.
7320 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
7321
7322 Fix a GLR parser bug I reported in February; see
7323 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
7324 The problem was that GLR parsers did not conform to the C standard,
7325 because actions like { $1 = $2 + $3; } expanded to expressions
7326 that invoked YYFILL in separate subexpressions, and YYFILL assigned
7327 to a local variable. The C standard says that expressions
7328 like (var = f ()) + (var = f ()) have undefined behavior.
7329 Another problem was that GCC sometimes issues warnings that
7330 yyfill and its parameters are unused.
7331
7332 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
7333 as possibly unused.
7334 (yyfill): New function.
7335 (YYFILL): Use it.
7336 (yyuserAction): Change type of yynormal to bool, so that it matches
7337 the new yyfill signature. Mark it as possibly unused.
7338
7339
7340 Follow up on a bug I reported in February, where a Bison-generated
7341 parser can loop. Provide a test case and a fix for yacc.c. I
7342 don't have a fix for lalr1.cc or for glr.c, unfortunately.
7343 The original bug report is in:
7344 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
7345
7346 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
7347 macro's size was becoming unwieldy.
7348 (yyerrlab): Do not discard an empty lookahead symbol, as this
7349 might destroy garbage.
7350 (yyerrorlab): New label, with the old contents of YYERROR,
7351 plus the following change: pop the stack of rhs corresponding
7352 to the production that invoked YYERROR. That is how Yacc
7353 behaves, and POSIX requires this behavior.
7354 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
7355 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
7356 Define 'alarm' to do nothing if unistd.h is not available.
7357 Add a new rule "exp: '-' error;" to test the above change to
7358 data/yacc.c. Use 'alarm' to abort any test taking longer than
7359 10 seconds, as it's probably looping.
7360 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
7361 Also, the new yacc.c generates two fewer diagnostics for an
7362 existing test.
7363
7364 2003-05-24 Paul Eggert <eggert@twinsun.com>
7365
7366 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
7367 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
7368 This fixes a problem reported by John Bowman when the Compaq/HP
7369 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
7370 -ansi -Wall -gall).
7371 * data/yacc.c (union yyalloc): Likewise.
7372 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
7373
7374 Switch from 'int' to 'bool' where that makes sense.
7375
7376 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
7377 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
7378 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
7379 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
7380 Return or accept bool, not int. All callers changed.
7381 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
7382 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
7383 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
7384 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
7385 bitset_or_and_cmp_): Likewise.
7386 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
7387 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
7388 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
7389 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
7390 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
7391 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
7392 bitset_stats_or_and_cmp): Likewise.
7393 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
7394 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
7395 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
7396 ebitset_xor_cmp): Likewise.
7397 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
7398 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
7399 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
7400 lbitset_xor_cmp): Likewise.
7401 * lib/bbitset.h: Include <stdbool.h>.
7402 (struct bitset_vtable): The following members now return bool, not
7403 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
7404 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
7405 or_and_cmp).
7406 * src/conflicts.c (count_rr_conflicts): Likewise.
7407 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
7408 All uses changed.
7409 * lib/ebitset.c (ebitset_obstack_init): Likewise.
7410 * lib/lbitset.c (lbitset_obstack_init): Likewise.
7411 * src/getargs.c (debug_flag, defines_flag, locations_flag,
7412 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
7413 graph_flag): Likewise.
7414 * src/getargs.h (debug_flag, defines_flag, locations_flag,
7415 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
7416 graph_flag): Likewise.
7417 * src/output.c (error_verbose): Likewise.
7418 * src/output.h (error_verbose): Likewise.
7419 * src/reader.c (start_flag, typed): Likewise.
7420 * src/reader.h (typed): Likewise.
7421 * src/getargs.c (LOCATIONS_OPTION): New constant.
7422 (long_options, getargs): Use it.
7423 * src/lalr.c (build_relations): Use bool, not int.
7424 * src/nullable.c (nullable_compute): Likewise.
7425 * src/print.c (print_reductions): Likewise.
7426 * src/tables.c (action_row, pack_vector): Likewise.
7427 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
7428 * src/output.c (prepare): Use it.
7429 * src/output.c (token_definitions_output,
7430 symbol_destructors_output, symbol_destructors_output): Use string,
7431 not boolean integer, to keep track of whether to output separator.
7432 * src/print_graph.c (print_core): Likewise.
7433 * src/state.c (state_rule_lookaheads_print): Likewise.
7434
7435 * config/install-sh: Sync from automake 1.7.5.
7436
7437 2003-05-14 Paul Eggert <eggert@twinsun.com>
7438
7439 * src/parse-gram.y (rules_or_grammar_declaration): Require a
7440 semicolon after a grammar declaration, in the interest of possible
7441 future changes to the Bison input language.
7442 Do not allow a stray semicolon at the start of the grammar.
7443 (rhses.1): Allow one or more semicolons after any rule, including
7444 just before "|" as required by POSIX.
7445 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
7446 grammar.
7447
7448 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
7449
7450 %parse-param support for lalr1.cc.
7451
7452 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
7453 b4_cc_constructor_calls, b4_cc_constructor_call,
7454 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
7455 definitions.
7456 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
7457 parse-param arguments.
7458 (yy::b4_parser_class_name): Declare instance variables to
7459 hold parse-param arguments.
7460 * tests/calc.at: s/value/semantic_value/ because value clashes
7461 with a member of yy::b4_parser_class_name. Adjust C++ code
7462 to handle %parse-param. Enable %parse-param test in C++.
7463
7464 2003-05-12 Paul Eggert <eggert@twinsun.com>
7465
7466 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
7467 English a bit. Fix fclose typo. Change "const char" to "char
7468 const", and use ANSI C rather than K&R for "main". Suggest
7469 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
7470 and suggest yy_switch_to_buffer.
7471
7472 2003-05-05 Paul Eggert <eggert@twinsun.com>
7473
7474 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
7475 C89. This avoids a diagnostic on compilers that define __STDC__
7476 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
7477 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
7478
7479 2003-05-03 Paul Eggert <eggert@twinsun.com>
7480
7481 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
7482 Do not overrun array bounds.
7483 This should fix a bug reported today by Olatunji Oluwabukunmi in
7484 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
7485
7486 2003-04-29 Akim Demaille <akim@epita.fr>
7487
7488 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
7489 * src/getargs.c, src/getargs.h: here, as bool, not int.
7490 (nondeterministic_parser): New.
7491 * src/parse-gram.y, src/scan-gram.l: Support
7492 %nondeterministic-parser.
7493 * src/output.c (prepare): Use nondeterministic_parser instead
7494 of glr_parser where appropriate.
7495 * src/tables.c (conflict_row, action_row, save_row)
7496 (token_actions, token_actions, pack_vector): Ditto.
7497
7498 2003-04-29 Akim Demaille <akim@epita.fr>
7499
7500 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
7501
7502 2003-04-29 Akim Demaille <akim@epita.fr>
7503
7504 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
7505 with %pure-parser and %locations to exercise the patch from Yakov
7506 Markovitch below.
7507
7508 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
7509
7510 * data/yacc.c: (b4_lex_param): Corrected for the case where
7511 %lex-param is provided and %pure-parser isn't.
7512
7513 2003-04-27 Paul Eggert <eggert@twinsun.com>
7514
7515 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
7516 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
7517 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
7518 if it is not defined.
7519 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
7520
7521 2003-04-26 Paul Eggert <eggert@twinsun.com>
7522
7523 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
7524 Declare to be of type suitable for the ninf value itself, not of
7525 type suitable for the corresponding table, since the latter might
7526 be unsigned but the ninf value might be negative. This fixes a
7527 bug reported by Alexandre Duret-Lutz in
7528 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
7529
7530 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
7531 invokes it. We shouldn't invoke it twice because it will attempt
7532 to put error.o in the archive twice. This fixes a glitch reported
7533 by Martin Mokrejs in
7534 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
7535
7536 2003-04-21 Paul Eggert <eggert@twinsun.com>
7537
7538 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
7539 to gnulib.
7540
7541 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
7542
7543 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
7544 Fix obvious typo that results in uncompilable GLR parsers
7545 when both %pure-parser and %locations are used. (trivial change)
7546
7547 2003-04-17 Paul Eggert <eggert@twinsun.com>
7548
7549 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
7550 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
7551 Do not insert the expected token via unput, as this runs afoul
7552 of a POSIX-compatibility bug in flex 2.5.31.
7553 All uses changed to BEGIN the parent state,
7554 since we no longer insert the expected token via unput.
7555 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
7556 that is no longer emitted after the above change.
7557
7558 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
7559 the first one. This change is from Paul Hilfinger, and it fixes
7560 regression reported by Werner Lemberg in
7561 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
7562
7563 (resolve_sr_conflict): Don't invoke state_errs_set
7564 unless one or more tokens have been explicitly made errors.
7565 Otherwise, the above change causes Bison to abort.
7566
7567 * tests/existing.at (GNU pic Grammar): New test case, taken from
7568 Lemberg's email.
7569
7570 2003-03-31 Akim Demaille <akim@epita.fr>
7571
7572 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
7573
7574 2003-03-31 Akim Demaille <akim@epita.fr>
7575
7576 * src/output.c (prepare_symbols): Avoid trailing spaces in the
7577 output.
7578
7579 2003-03-31 Akim Demaille <akim@epita.fr>
7580
7581 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
7582 From Paul Hilfinger.
7583
7584 2003-03-29 Akim Demaille <akim@epita.fr>
7585
7586 * m4/error.m4: Do not put under dynamic conditions some code which
7587 expansion is under static control.
7588
7589 2003-03-29 Akim Demaille <akim@epita.fr>
7590
7591 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
7592
7593 2003-03-29 Akim Demaille <akim@epita.fr>
7594
7595 * doc/bison.texinfo (Strings are Destroyed): New.
7596
7597 2003-03-13 Paul Eggert <eggert@twinsun.com>
7598
7599 * .cvsignore: Add configure.lineno.
7600 * src/.cvsignore: Add yacc.
7601 * tests/.cvsignore: Add testsuite.log.
7602 * doc/fdl.texi: Sync with latest FSF version.
7603
7604 2003-03-12 Paul Eggert <eggert@twinsun.com>
7605
7606 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
7607 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
7608 cursor, instead of leaving it undefined. This fixes a bug
7609 reported by Tim Van Holder in
7610 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
7611 * tests/input.at (Torturing the Scanner): Test the scanner on
7612 an empty input file, which was Tim Van Holder's test case.
7613
7614 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
7615 <sys/resource.h> can be included, include sys/time.h and
7616 sys/times.h first, if available. This works around the SunOS
7617 4.1.4 porting bug reported by Bruce Becker in
7618 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
7619
7620 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
7621 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
7622 AC_HEADER_SYS_WAIT.
7623
7624 Merge changes from gnulib. This was prompted because the CVS
7625 snapshot didn't build on Solaris 7 due to strnlen problems.
7626
7627 These changes need to be merged back into gnulib:
7628 * lib/hash.c: Include <stdbool.h> unconditionally.
7629 * m4/onceonly.m4 (m4_quote): New macro.
7630 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
7631 Quote AC_FOREACH variable-expansions properly.
7632 The 2003-01-03 obstack.h change also needs merging.
7633 {end of changes requiring merging}
7634
7635 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
7636 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
7637 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
7638 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
7639 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
7640 New files, imported from gnulib.
7641 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
7642 above.
7643
7644 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
7645 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
7646 gnulib sources.
7647
7648 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
7649 Add.
7650 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
7651 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
7652 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
7653 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
7654 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
7655 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
7656 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
7657 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
7658 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
7659 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
7660 (jm_PREREQ_ARGMATCH): Remove.
7661 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
7662 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
7663
7664 * src/system.h: Include <stdbool.h> unconditionally.
7665
7666 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
7667 assuming at least C89 in the bitset code for some time now.
7668
7669 2003-03-03 Akim Demaille <akim@epita.fr>
7670
7671 * ro.po: New.
7672
7673 2003-03-02 Akim Demaille <akim@epita.fr>
7674
7675 * doc/bison.texinfo (Table of Symbols): Reactivate the
7676 documentation for %lex-param, and %parse-param.
7677
7678 2003-03-02 Akim Demaille <akim@epita.fr>
7679
7680 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
7681 generate verbose error messages.
7682 Use the number of tokens as an upper bound in yytname, as it
7683 cannot be a non terminal.
7684
7685 2003-03-02 Akim Demaille <akim@epita.fr>
7686
7687 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
7688 message.
7689
7690 2003-03-02 Akim Demaille <akim@epita.fr>
7691
7692 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
7693 Use them to exercise yycheck overrun.
7694 Based on Andrew Suffield's grammar.
7695
7696 2003-03-02 Akim Demaille <akim@epita.fr>
7697
7698 Create tests/local.at for Bison generic testing macros.
7699
7700 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
7701 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
7702 This new file.
7703 * tests/calc.at (AT_CHECK_CALC): Adjust.
7704 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
7705 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
7706 * tests/local.at: here.
7707 (AT_COMPILE_CXX): Tags the tests using it as c++.
7708 Ignore the test if CXX is not functional.
7709
7710 2003-03-01 Paul Eggert <eggert@twinsun.com>
7711
7712 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
7713 not loc->end, since loc->end might contain garbage and this leads
7714 to undefined behavior on some platforms.
7715 (id_loc, token_start): Use (IF_LINTed) initial values that do not
7716 depend on *loc, so that the reader doesn't give the the false
7717 impression that *loc is initialized.
7718 (<INITIAL>"%%"): Do not bother setting code_start, since its value
7719 does not survive the return.
7720
7721 2003-03-01 Akim Demaille <akim@epita.fr>
7722
7723 * src/scan-gram.l (code_start): Always initialize it when entering
7724 into yylex, as SC_EPILOGUE is activated *before* the corresponding
7725 yylex invocation. An alternative would be making it static, but
7726 then it starts with the second %%'s beginning, instead of its end.
7727
7728 2003-02-28 Paul Eggert <eggert@twinsun.com>
7729
7730 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
7731 around a UnixWare 7.1.1 porting bug reported by John Hughes in
7732 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
7733
7734 2003-02-26 Paul Eggert <eggert@twinsun.com>
7735
7736 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
7737 Remove Sequent/Pyramid discussion (nobody uses them any more).
7738 Merge VMS and MS-DOS discussion; these ports may well be dead
7739 but let's keep mentioning them for now. Put <> around email
7740 addresses. Add copyright notice.
7741
7742 2003-02-24 Paul Eggert <eggert@twinsun.com>
7743
7744 * data/glr.c (yy_reduce_print): yylineno -> yylno,
7745 to avoid collision with flex use of yylineno.
7746 Problem reported by Bruce Lilly in
7747 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
7748 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
7749 * data/yacc.c (yy_reduce_print): Likewise.
7750
7751 * config/depcomp: Sync with Automake 1.7.3.
7752
7753 2003-02-21 Akim Demaille <akim@epita.fr>
7754
7755 * data/lalr1.cc: Use temporary variables instead of casts to
7756 change integer types.
7757 Suggested by Paul Eggert.
7758
7759 2003-02-21 Akim Demaille <akim@epita.fr>
7760
7761 * doc/bison.texinfo: Use "location" consistently to refer to @n,
7762 to avoid confusions with lalr1.cc's notion of Position.
7763 Suggested by Paul Eggert.
7764
7765 2003-02-20 Akim Demaille <akim@epita.fr>
7766
7767 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
7768 before initial_columns.
7769 (location.hh): Use consistent variable names when defining the
7770 operator<<.
7771 Use "last" so that we subtract from Positions, not from unsigned.
7772
7773 2003-02-20 Akim Demaille <akim@epita.fr>
7774
7775 * data/lalr1.cc (position.hh): New subfile, including the extended
7776 and Doxygen'ed documentation of class Position.
7777 (location.hh): Use it.
7778 Document a` la Doxygen.
7779 With the help of Benoit Perrot.
7780
7781 2003-02-20 Akim Demaille <akim@epita.fr>
7782
7783 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
7784 AT_YACC_IF.
7785 Redefine AT_YYERROR_SEES_LOC_IF using it.
7786 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
7787 not defined.
7788 Don't use the location in yy::Parser::error_ and
7789 yy::Parser::print_ when not %locations.
7790 Activate more lalr1.cc tests.
7791
7792 2003-02-19 Akim Demaille <akim@epita.fr>
7793
7794 * data/lalr1.cc: When displaying a line number, be sure to make it
7795 an int.
7796
7797 2003-02-19 Akim Demaille <akim@epita.fr>
7798
7799 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
7800 Remove, useless.
7801 (YYABORT, YYACCEPT, YYERROR): New.
7802 * tests/calc.at: Renable the lalr1.cc test.
7803
7804 2003-02-19 Akim Demaille <akim@epita.fr>
7805
7806 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
7807 error recovery, mixing with/without pops and discarding of the
7808 lookahead.
7809 Exercise YYERROR.
7810 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
7811
7812 2003-02-17 Paul Eggert <eggert@twinsun.com>
7813
7814 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
7815 * tests/testsuite.at (AT_COMPILE): Use them.
7816 This fixes the testsuite problem reported by Robert Lentz in
7817 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
7818
7819 2003-02-12 Paul Eggert <eggert@twinsun.com>
7820
7821 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
7822 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
7823 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
7824 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
7825 Check for malloc failure, for consistency with yacc.c.
7826 (yytname_size): Remove, for consistency with yacc.c.
7827
7828 The bug still remains in data/lalr1.cc, as I didn't have time
7829 to fix it there.
7830
7831 2003-02-06 Akim Demaille <akim@epita.fr>
7832
7833 * configure.ac (GXX): Rename as...
7834 (CXX): this, to keep the original Autoconf semantics.
7835 Require 2.57.
7836 * data/lalr1.cc: Fix b4_copyright invocations.
7837 If YYDEBUG is not defined, don't depend upon name_ being defined.
7838 (location.hh): Include string and iostream.
7839 (Position::filename): New member.
7840 (Position::Position ()): New.
7841 (operator<< (Position)): New.
7842 (operator- (Position, int)): New.
7843 (Location::first, Location::last): Rename as...
7844 (Location::begin, Location::end): these, to mock the conventional
7845 iterator names.
7846 (operator<< (Location)): New.
7847 * tests/atlocal.in (CXX): New.
7848 * tests/testsuite.at (AT_COMPILE_CXX): New.
7849 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
7850 locations in a more synthetic way.
7851 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
7852 lalr1.cc is used.
7853 Adjust the C locations to match those from Emacs: first column is
7854 column 0.
7855 Change all the expected results.
7856 Conform to the GCS: simplify the locations when applicable.
7857 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
7858 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
7859 these CPP macros with the m4 macros new defined by...
7860 (AT_CHECK_PUSHDEFS): this, i.e.:
7861 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
7862 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7863 New macros.
7864 (AT_CHECK_POPDEFS): Undefine them.
7865 (AT_CHECK_CALC_LALR1_CC): New.
7866 Use it for the first lalr1.cc test.
7867
7868 2003-02-04 Akim Demaille <akim@epita.fr>
7869
7870 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
7871 Location as is defined.
7872
7873 2003-02-04 Akim Demaille <akim@epita.fr>
7874
7875 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
7876 name_ being defined.
7877
7878 2003-02-03 Paul Eggert <eggert@twinsun.com>
7879
7880 * src/gram.h (start_symbol): Remove unused decl.
7881
7882 Use more-consistent naming conventions for local vars.
7883
7884 * src/derives.c (derives_compute): Change type of local var from
7885 int to rule_number.
7886 * src/gram.c (grammar_rules_partial_print): Likewise.
7887 * src/print.c (print_core): Likewise.
7888 * src/reduce.c (reduce_grammar_tables): Likewise.
7889
7890 * src/gram.c (grammar_dump): Change name of item_number *
7891 local var from r to rp.
7892 * src/nullable.c (nullable_compute): Likewise.
7893
7894 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
7895
7896 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
7897 for symbol or symbol_number var.
7898 * src/reader.c (grammar_start_symbol_set): Likewise.
7899 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
7900 Likewise.
7901 * src/state.c (transitions_to): Likewise.
7902 * src/state.h: Likewise.
7903 * src/tables.c (symbol_number_to_vector_number): Likewise.
7904
7905 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
7906 char * var.
7907
7908 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
7909 var.
7910
7911 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
7912 var.
7913
7914 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
7915 Use str, not s, for char * var. Use ch, not c, for character var.
7916 Use size for size var.
7917
7918 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
7919 char * var.
7920 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
7921 uniqstr var.
7922 * src/uniqstr.h: Likewise.
7923
7924 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
7925 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
7926 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
7927 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
7928 param to have same name as that of enum, so that we don't use
7929 "s" to stand for a non-state.
7930
7931 2003-02-02 Akim Demaille <akim@epita.fr>
7932
7933 * src/scan-skel.l: Scan more than one inert character per yylex
7934 invocation.
7935
7936 2003-02-01 Paul Eggert <eggert@twinsun.com>
7937
7938 Version 1.875a.
7939
7940 * po/LINGUAS: Add ms.
7941
7942 2003-01-30 Akim Demaille <akim@epita.fr>
7943
7944 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
7945
7946 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7947
7948 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
7949 of $1.
7950
7951 Changes in response to error report by S. Eken: GLR mode does not
7952 handle negative $ indices or $ indices in embedded rules correctly.
7953 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
7954
7955 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
7956 (b4_rhs_location): Ditto.
7957 (yyfill): New function to copy from stack tree into array
7958 incrementally.
7959 (yyuserAction): Modify to allow incremental move of semantic values
7960 to rhs array when in GLR mode.
7961 Define YYFILL to use in user-defined actions to fill semantic array
7962 as needed.
7963 Remove dummy use of yystack, as there is now a guaranteed use.
7964 (yydoAction): Modify to allow incremental move of semantic values
7965 to rhs array when in GLR mode.
7966 (yyresolveAction): Ditto.
7967 (yyglrShiftDefer): Update comment.
7968 (yyresolveStates): Use X == NULL for pointers, not !X.
7969 (yyglrReduce): Ditto.
7970 (yydoAction): Ditto
7971
7972 * tests/glr-regr1.at: Rename to ...
7973 * tests/glr-regression.at: Add new regression test for the problems
7974 described above (adapted from S. Eken).
7975 Update copyright notice.
7976 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
7977 * tests/Makefile.am: Ditto.
7978
7979 2003-01-28 Paul Eggert <eggert@twinsun.com>
7980
7981 * data/lalr1.cc: Do not use @output_header_name@ unless
7982 b4_defines_flag is set. This fixes two bugs reported by
7983 Tim Van Holder in
7984 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
7985 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
7986
7987 2003-01-21 Paul Eggert <eggert@twinsun.com>
7988
7989 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
7990 we don't need to worry about yyerrlab1 being reported as an
7991 "unused label" by non-GCC C compilers. The downside is that if
7992 locations are used then a couple of statements are duplicated each
7993 time YYERROR is invoked, but the upside is that the warnings
7994 should vanish.
7995 (yyerrlab1): Move code to YERROR.
7996 (yyerrlab2): Remove. Change uses back to yyerrlab1.
7997 This reverts some of the 2002-12-27 change.
7998
7999 2003-01-17 Paul Eggert <eggert@twinsun.com>
8000
8001 * src/output.c (symbol_printers_output): Fix typo that led
8002 to core dump. Problem reported by Antonio Rus in
8003 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
8004
8005 2003-01-13 Akim Demaille <akim@epita.fr>,
8006 Quoc Peyrot <chojin@lrde.epita.fr>,
8007 Robert Anisko <anisko_r@lrde.epita.fr>
8008
8009 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
8010 when the stacks contain one element, as the loop would otherwise
8011 free the last state, and then use the top state (the one we just
8012 popped). This means that the initial elements will not be freed
8013 explicitly, as is the case in yacc.c; it is not a problem, as
8014 these elements have fake values.
8015
8016 2003-01-11 Paul Eggert <eggert@twinsun.com>
8017
8018 * NEWS: %expect-violations are now just warnings, reverting
8019 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
8020 bootstrapping problem reported by Matthias Klose; see
8021 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
8022 * src/conflicts.c (conflicts_print): Likewise.
8023 * tests/conflicts.at (%expect not enough, %expect too much,
8024 %expect with reduce conflicts): Likewise.
8025 * doc/bison.texinfo (Expect Decl): Document this. Also mention
8026 that the warning is enabled if the number of conflicts changes
8027 (not necessarily increases).
8028
8029 * src/getargs.c (version): Update copyright year.
8030
8031 2003-01-09 Akim Demaille <akim@epita.fr>
8032
8033 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
8034
8035 2003-01-08 Paul Eggert <eggert@twinsun.com>
8036
8037 * Makefile.maint (WGETFLAGS):
8038 New macro, containing "-C off" to disable proxy caches.
8039 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
8040 (rel-check): Use $(WGET) instead of wget.
8041
8042 2003-01-06 Paul Eggert <eggert@twinsun.com>
8043
8044 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
8045 the GLR paper of Scott, Johnstone and Hussain.
8046
8047 2003-01-04 Paul Eggert <eggert@twinsun.com>
8048
8049 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
8050 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
8051 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
8052 (EXTRA_LIBRARIES): New var, for liby.a.
8053 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
8054 (EXTRA_SCRIPTS): New var, for yacc.
8055
8056 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
8057 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
8058 Problem reported by Nelson H. F. Beebe.
8059
8060 2003-01-03 Paul Eggert <eggert@twinsun.com>
8061
8062 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
8063 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
8064 when compiling Bison 1.875's `bitset bset = obstack_alloc
8065 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
8066
8067 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
8068 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
8069 grow to a huge size with typical invocation.
8070
8071 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
8072 Use the pattern recommended by Autoconf 2.57, except also protect
8073 against double-definition.
8074 * src/system.h: Likewise.
8075 Portability issues reported by Nelson H. F. Beebe.
8076
8077 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
8078 All uses changed. Provide a definition in both C and C++.
8079 (yytrue, yyfalse): Define even if defined (__cplusplus).
8080
8081 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
8082 Reported by Nelson H. F. Beebe.
8083
8084 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
8085
8086 2003-01-02 Paul Eggert <eggert@twinsun.com>
8087
8088 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
8089 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
8090 Bug reported by Nelson H. F. Beebe.
8091
8092 2003-01-01 Paul Eggert <eggert@twinsun.com>
8093
8094 * Version 1.875.
8095
8096 2002-12-30 Paul Eggert <eggert@twinsun.com>
8097
8098 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
8099 Moved here from...
8100 (<INITIAL>","): Here. This causes stray "," to be treated
8101 more uniformly.
8102
8103 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
8104 last brace in braced code when not in Yacc mode, for compatibility
8105 with Bison 1.35. This resurrects the 2001-12-15 patch to
8106 src/reader.c.
8107
8108 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
8109 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
8110
8111 2002-12-28 Paul Eggert <eggert@twinsun.com>
8112
8113 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
8114 that of SYM's type. This fixes Debian bug 168069, reported by
8115 Thomas Olsson.
8116
8117 2002-12-28 Paul Eggert <eggert@twinsun.com>
8118
8119 Version 1.75f.
8120
8121 Switch back to the Yacc style of conflict reports, undoing some
8122 of the 2002-07-30 change.
8123 * doc/bison.texinfo (Understanding): Use Yacc style for
8124 conflict reports. Also, use new way of locating rules.
8125 * src/conflicts.c (conflict_report):
8126 Renamed from conflict_report_yacc, removing the old
8127 'conflict_report'. Translate the entire conflict report at once,
8128 so that we don't assume that "," has the same interpretation in
8129 all languages.
8130 (conflicts_output): Use Yacc-style conflict report for each state,
8131 instead of our more-complicated style.
8132 (conflicts_print): Use Yacc-style conflict report, except print
8133 the input file name when not emulating Yacc.
8134 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
8135 Conflicted Reduction, %expect not enough, %expect too much,
8136 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
8137 * tests/existing.at (GNU Cim Grammar): Likewise.
8138 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
8139
8140 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
8141 fatal): Don't invoke fflush; it's not needed and it might even be
8142 harmful for stdout, as stdout might not be open.
8143 * src/reduce.c (reduce_print): Likewise.
8144
8145 2002-12-27 Paul Eggert <eggert@twinsun.com>
8146
8147 Fix a bug where error locations were not being recorded correctly.
8148 This problem was originally reported by Paul Hilfinger in
8149 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
8150
8151 * data/yacc.c (yyparse): New local var yylerrsp, to record the
8152 top of the location stack's error locations.
8153 (yyerrlab): Set it. When discarding a token, push its location
8154 onto yylerrsp so that we don't lose track of the error's end.
8155 (yyerrlab1): Now is only the target of YYERROR, so that we can
8156 properly record the location of the action that failed. For GCC
8157 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
8158 GCC warning about yyerrlab1 being unused if YYERROR is unused.
8159 (yyerrlab2): New label, which yyerrlab now falls through to.
8160 Compute the error's location by applying YYLLOC_DEFAULT to
8161 the locations of all the symbols that went into the error.
8162 * doc/bison.texinfo (Location Default Action): Mention that
8163 YYLLOC_DEFAULT is also invoked for syntax errors.
8164 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8165 Error locations include the locations of all the tokens that were
8166 discarded, not just the last token.
8167
8168 2002-12-26 Paul Eggert <eggert@twinsun.com>
8169
8170 * src/files.c: Include quote.h.
8171 (compute_output_file_names): Warn if we detect conflicting
8172 outputs to the same file. This should catch the misunderstanding
8173 exemplified by Debian Bug 165349, reported by Bruce Stephens..
8174
8175 * src/conflicts.c (conflicts_print): If the user specifies
8176 "%expect N", report an error if there are any reduce/reduce
8177 conflicts. This is what the manual says should happen.
8178 This fixes Debian bug 130890, reported by Anthony DeRobertis.
8179 * tests/conflicts.at (%expect with reduce conflicts): New test.
8180
8181 Don't use m4_include on relative file names, as it doesn't work as
8182 desired if there happens to be a file with that name under ".".
8183
8184 * m4sugar/version.m4: Remove; it was included but it wasn't used.
8185 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
8186 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
8187 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
8188 * src/output.c (output_skeleton): Use full path names when
8189 specifying a file to include; don't rely on include path, as
8190 it's unreliable when the working file contains a file with
8191 that name.
8192
8193 2002-12-25 Paul Eggert <eggert@twinsun.com>
8194
8195 Remove obsolete references to bison.simple and bison.hairy.
8196 Problem mentioned by Aubin Mahe in
8197 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
8198 * data/glr.c: Comment fix.
8199 * doc/bison.1: Remove references. Also, mention "yacc".
8200
8201 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
8202 with -g option.
8203
8204 * src/parse-gram.y (declaration): Use enum "report_states" rather
8205 than its numeric value 1.
8206
8207 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
8208 opening a new one. This fixes Debian bug 165349, reported by
8209 Bruce Stephens.
8210
8211 2002-12-24 Paul Eggert <eggert@twinsun.com>
8212
8213 Version 1.75e.
8214
8215 * Makefile.maint (cvs-update): Don't assume that the shell
8216 supports $(...), as Solaris sh doesn't.
8217
8218 * src/parse-gram.y (lloc_default): Remove test for empty
8219 nonterminals at the end, since it didn't change the result.
8220
8221 2002-12-24 Paul Eggert <eggert@twinsun.com>
8222
8223 If the user does not define YYSTYPE as a macro, Bison now declares it
8224 using typedef instead of defining it as a macro. POSIX requires this.
8225 For consistency, YYLTYPE is also declared instead of defined.
8226
8227 %union directives can now have a tag before the `{', e.g., the
8228 directive `%union foo {...}' now generates the C code
8229 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
8230 The default union tag is `YYSTYPE', for compatibility with Solaris 9
8231 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
8232 instead of `yyltype'.
8233
8234 `yystype' and `yyltype' are now obsolescent macros instead of being
8235 typedefs or tags; they are no longer documented and will be
8236 withdrawn in a future release.
8237
8238 * data/glr.c (b4_location_type): Remove.
8239 (YYSTYPE): Renamed from yystype.
8240 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
8241 (struct YYLTYPE): Renamed from struct yyltype.
8242 (YYLTYPE): Renamed from yyltype.
8243 (yyltype, yystype): New (and obsolescent) macros,
8244 for backward compatibility.
8245 * data/yacc.c: Likewise.
8246
8247 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
8248 does not specify a union tag. This is for compatibility with
8249 Solaris 9 yacc.
8250
8251 * src/parse-gram.y (add_param): 2nd arg is now char * not char
8252 const *, since it is now modified by stripping surrounding { }.
8253 (current_braced_code): Remove.
8254 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
8255 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
8256 trailing " {...}". Now of type <chars>.
8257 (grammar_declaration): Adjust to bundled tokens.
8258 (code_content): Remove; stripping is now done by add_param.
8259 (print_token_value): Print contents of bundled tokens.
8260 (token_name): New function.
8261
8262 * src/reader.h (braced_code, current_braced_code): Remove.
8263 (token_name): New decl.
8264
8265 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
8266 token_type, not braced_code code_kind. All uses changed.
8267 (SC_PRE_CODE): New state, for scanning after a keyword that
8268 has (or usually has) an immediately-following braced code.
8269 (token_type): New local var, to keep track of which token type
8270 to return when scanning braced code.
8271 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
8272 <INITIAL>"%parse-param", <INITIAL>"%printer",
8273 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
8274 instead of returning a token type immediately.
8275 (<INITIAL>"{"): Set token type.
8276 (<SC_BRACED_CODE>"}"): Use it.
8277 (handle_action_dollar, handle_action_at): Now returns bool
8278 indicating success. Fail if ! current_rule; this prevents a core dump.
8279 (handle_symbol_code_dollar, handle_symbol_code_at):
8280 Remove; merge body into caller.
8281 (handle_dollar, handle_at): Complain in invalid contexts.
8282
8283 * NEWS, doc/bison.texinfo: Document the above.
8284 * NEWS: Fix years and program names in copyright notice.
8285
8286 2002-12-17 Paul Eggert <eggert@twinsun.com>
8287
8288 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
8289 Reporting, Table of Symbols): Omit mentions of %lex-param and
8290 %parse-param from the documentation for now.
8291
8292 2002-12-15 Paul Eggert <eggert@twinsun.com>
8293
8294 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
8295 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
8296 lookahead symbol, and which sets yychar in parser actions) and it
8297 disagreed with the Bison documentation. Bug
8298 reported by Andrew Walrond.
8299
8300 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
8301 as the caller now does that.
8302 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
8303 (YYEMPTY): Parenthesize right hand side, since others use it.
8304 (yyparse): Don't assume that our generated code is the only code
8305 that sets yychar.
8306
8307 2002-12-13 Paul Eggert <eggert@twinsun.com>
8308
8309 Version 1.75d.
8310
8311 POSIX requires a "yacc" command.
8312 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
8313 (MOSTLYCLEANFILES): Add yacc.
8314 (yacc): New rule.
8315 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
8316 as an alias for bison y.
8317
8318 * po/LINGUAS: Add da.
8319
8320 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
8321 problem with latest <getopt.h>.
8322 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
8323
8324 * doc/fdl.texi: Upgrade to 1.2.
8325 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
8326 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
8327 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
8328 gnulib.
8329 * config/install-sh: Sync with autotools.
8330
8331 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
8332 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
8333 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
8334 locations are requested.
8335 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
8336 locations are requested.
8337
8338 2002-12-12 Paul Eggert <eggert@twinsun.com>
8339
8340 Remove unportable casts and storage allocation tricks.
8341 While we're at it, remove almost all casts, since they
8342 usually aren't needed and are a sign of trouble.
8343
8344 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
8345
8346 * src/derives.c (derives_compute): Do not subtract NTOKENS from
8347 the pointer DSET returned by malloc; this isn't portable.
8348 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
8349 Similarly for DERIVES.
8350 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
8351 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
8352 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
8353
8354 * src/derives.c (derives_compute): Do not bother invoking
8355 int_of_rule_number, since rule numbers are integers.
8356
8357 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
8358 rather than XMALLOC (char, N).
8359
8360 * src/files.c (filename_split): Rewrite to avoid cast.
8361
8362 * src/gram.h (symbol_number_as_item_number,
8363 item_number_as_symbol_number, rule_number_as_item_number,
8364 item_number_as_rule_number):
8365 Now inline functions rather than macros, to avoid casts.
8366 * src/state.h (state_number_as_int): Likewise.
8367 * src/tables.c (state_number_to_vector_number,
8368 symbol_number_to_vector_number): Likewise.
8369
8370 * src/gram.h (int_of_rule_number): Remove; no longer used.
8371
8372 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
8373 since the resulting storage is always stored into.
8374
8375 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
8376 where it's needed.
8377
8378 * src/muscle_tab.c (muscle_m4_output):
8379 Now inline. Return bool, not int.
8380 * src/state.c (state_compare): Likewise.
8381 * src/symtab.c (symbol_check_defined,
8382 symbol_check_alias_consistency, symbol_pack, symbol_translation,
8383 hash_compare_symbol, hash_symbol):
8384 Likewise.
8385 * src/uniqstr.c (uniqstr_print): Likewise.
8386 * src/muscle_tab.c (muscle_m4_output_processor):
8387 New function, to avoid casts.
8388 * src/state.c (state_comparator, stage_hasher): Likewise.
8389 * src/symtab.c (symbol_check_defined_processor,
8390 symbol_check_alias_consistency_processor, symbol_pack_processor,
8391 symbol_translation_processor, hash_symbol_comparator,
8392 hash_symbol_hasher): Likewise.
8393 * src/uniqstr.c (uniqstr_print_processor): Likewise.
8394 * src/muscle_tab.c (muscles_m4_output):
8395 Use new functions instead of casting old functions unportably.
8396 * src/state.c (state_hash_new): Likewise.
8397 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
8398 symbols_token_translations_init):
8399 Likewise.
8400 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
8401
8402 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
8403 var instead of casting to long, to avoid casts.
8404 (prepare_states): Use MALLOC rather than alloca, so that we don't
8405 have to worry about alloca.
8406 * src/state.c (state_hash_lookup): Likewise.
8407
8408 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
8409 local var instead of casting to unsigned char, to avoid casts.
8410
8411 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
8412 STATE_ALLOC): Remove.
8413 (transitions_new, errs_new, reductions_new, state_new): Use malloc
8414 rather than calloc, and use offsetof to avoid allocating slightly
8415 too much storage.
8416 (state_new): Initialize all members.
8417
8418 * src/state.c (state_hash): Use unsigned accumulator, not signed.
8419
8420 * src/symtab.c (symbol_free): Remove; unused.
8421 (symbol_get): Remove cast in lhs of assignment.
8422 (symbols_do): Now static. Accept generic arguments, not
8423 hashing-related ones.
8424
8425 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
8426 (symbol_processor): Remove.
8427 (symbols_do): Remove decl; now static.
8428
8429 * src/system.h (alloca): Remove; decl no longer needed.
8430 (<stddef.h>): Include, for offsetof.
8431 (<inttypes.>, <stdint.h>): Include if available.
8432 (uintptr_t): New type, if system lacks it.
8433 (CALLOC, MALLOC, REALLOC): New macros.
8434 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
8435 new macros.
8436
8437 * src/tables.c (table_size): Now int, to pacify GCC.
8438 (table_grow, table_ninf_remap): Use signed table size.
8439 (save_row): Don't bother initializing locals when not needed.
8440 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
8441 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
8442
8443 * src/vcg.h: Correct misspellings.
8444
8445 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
8446
8447
8448 * src/getargs.c (getargs): Don't assume EOF == -1.
8449
8450 2002-12-09 Paul Eggert <eggert@twinsun.com>
8451
8452 Change identifier spellings to avoid collisions with names
8453 that are reserved by POSIX.
8454
8455 Don't use names ending in _t, since POSIX reserves them.
8456 For consistency, remove _e and _s endings -- they're weren't
8457 needed to remove ambiguity. All uses changed.
8458 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
8459 turn was just renamed from struniq_t.
8460 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
8461 which in turn was just renamed from struniq_processor_t.
8462 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
8463 in turn was renamed from hash_compare_struniq_t.
8464 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
8465 (state_list): Renamed from state_list_t.
8466 * src/assoc.h (assoc): Renamed from assoc_t.
8467 * src/conflicts.c (enum conflict_resolution): Renamed from
8468 enum conflict_resolution_e.
8469 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
8470 (rule_list): Renamed from rule_list_t.
8471 * src/getargs.h (enum trace): Renamed from enum trace_e.
8472 (enum report): Renamed from enum report_e.
8473 * src/gram.h (item_number): Renamed from item_number_t.
8474 (rule_number): Renamed from rule_number_t.
8475 (struct rule_s): Remove the "rule_s" part; not used.
8476 (rule): Renamed from rule_t.
8477 (rule_filter): Renamed from rule_filter_t.
8478 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
8479 (goto_list): Renamed from goto_list_t.
8480 * src/lalr.h (goto_number): Renamed from goto_number_t.
8481 * src/location.h (location): Renamed from location_t.
8482 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
8483 and moved here from:
8484 * src/muscle_tab.h (muscle_entry_t): here.
8485 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
8486 (rule_list): Renamed from rule_list_t.
8487 * src/print_graph.c (static_graph): Renamed from graph.
8488 * src/reader.h (braced_code): Renamed from braced_code_t.
8489 Remove brace_code_e tag.
8490 * src/relation.h (relation_node): Renamed from relation_node_t.
8491 (relation_nodes): Renamed from relation_nodes_t.
8492 (relation): Renamed from relation_t.
8493 * src/state.h (state_number): Renamed from state_number_t.
8494 (struct state): Renamed from struct state_s.
8495 (state): Renamed from state_t.
8496 (transitions): Renamed from transitions_t. Unused (and
8497 misspelled) transtion_s tag removed.
8498 (errs): Renamed from errs_t. Unused errs_s tag removed.
8499 (reductions): Renamed from reductions_t. Unused tag
8500 reductions_s removed.
8501 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
8502 (struct symbol_list): Renamed from struct symbol_list_s.
8503 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
8504 (struct symbol): Renamed from struct symbol_s.
8505 (symbol): Renamed from symbol_t.
8506 * src/tables.c (vector_number): Renamed from vector_number_t.
8507 (action_number): Renamed from action_t.
8508 * src/tables.h (base_number): Renamed from base_t.
8509 * src/vcg.h (enum color): Renamed from enum color_e.
8510 (enum textmode): Renamed from enum textmode_e.
8511 (enum shape): Renamed from enum shape_e.
8512 (struct colorentry): Renamed from struct colorentry_s.
8513 (struct classname): Renamed from struct classname_s.
8514 (struct infoname): Renamed from struct infoname_s.
8515 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
8516 (enum decision): Renamed from enum decision_e.
8517 (enum orientation): Renamed from enum orientation_e.
8518 (enum alignment): Renamed from enum alignment_e.
8519 (enum arrow_mode): Renamed from enum arrow_mode_e.
8520 (enum crossing_type): Renamed from enum crossing_type_e.
8521 (enum view): Renamed from enum view_e.
8522 (struct node): Renamed from struct node_s.
8523 (node): Renamed from node_t.
8524 (enum linestyle): Renamed from enum linestyle_e.
8525 (enum arrowstyle): Renamed from enum arrowstyle_e.
8526 (struct edge): Renamed from struct edge.
8527 (edge): Renamed from edge_t.
8528 (struct graph): Renamed from struct graph_s.
8529 (graph): Renamed from graph_t.
8530 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
8531 Rename value_t -> value.
8532 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
8533 value_t_as_yystype -> value_as_yystype.
8534
8535 Don't include <errno.h> in the mainstream code, since it
8536 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
8537 * lib/get-errno.c, lib/get-errno.h: New files.
8538 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
8539 get-errno.c.
8540 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
8541 * src/output.c (output_skeleton): Likewise.
8542 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
8543 instead of errno.
8544 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
8545 Likewise.
8546 (handle_action_dollar, handle_action_at): Likewise.
8547 * src/system.h: Do not include <errno.h>.
8548 (TAB_EXT): Renamed from EXT_TAB.
8549 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
8550
8551 Avoid str[a-z]*, since <string.h> reserves that name space.
8552 Change all instances of "struniq" in names to "uniqstr", and
8553 likewise for "STRUNIQ" and "UNIQSTR".
8554 * src/uniqstr.c: Renamed from src/struniq.c.
8555 * src/uniqstr.h: Renamed from src/struniq.h.
8556 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
8557 * src/files.c (strsuffix): Remove; unused.
8558 (concat2): Renamed from stringappend. Now static.
8559 * src/files.h (strsuffix, stringappend): Remove; unused.
8560 * src/parse-gram.y (<chars>): Renamed from <string>.
8561 (<uniqstr>): Renamed from <struniq>.
8562 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
8563 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
8564 (struct graph_s.expand): Renamed from struct graph_s.stretch.
8565 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
8566 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
8567 (N_EXPAND): Renamed from N_STRETCH.
8568
8569 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
8570 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
8571 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
8572 Remove; unused.
8573 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
8574 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
8575 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
8576 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
8577 (BASE_MAXIMUM): Renamed from BASE_MAX.
8578 (BASE_MINIMUM): Renamed from BASE_MIN.
8579 (ACTION_MAX): Remove; unused.
8580 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
8581 Unnecessary casts removed from above defines.
8582
8583
8584 Fix misspelling in names.
8585 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
8586 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
8587 G_NODE_ALIGNEMENT.
8588
8589
8590 * lib/timevar.c (timevar_report): Renamed from time_report,
8591 for consistency with other names.
8592 * lib/timevar.h (timevar_report): New decl.
8593 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
8594
8595
8596 Sort include-file uses.
8597
8598 Reorder all include files under src to be in the order "system.h".
8599 then the ../lib include files in angle brackets (alphabetized),
8600 then the . include files in double-quotes (alphabetized). Fix
8601 dependency breakages encountered in this process, as follows:
8602 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
8603 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
8604 * src/state.h: Include "symtab.h".
8605
8606 2002-12-08 Paul Eggert <eggert@twinsun.com>
8607
8608 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
8609 since this causes problems when __file__ contains character
8610 sequences like "@" that are treated specially by src/scan-skel.l.
8611 Instead, just use the file's basename. This fixes the bug
8612 reported by Martin Mokrejs in
8613 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
8614
8615 2002-12-06 Paul Eggert <eggert@twinsun.com>
8616
8617 Add support for rules that do not have trailing semicolons, as
8618 POSIX requires. Improve the quality of locations in Bison
8619 diagnostics.
8620
8621 * src/location.c: Include <quotearg.h>.
8622 (empty_location): Now const.
8623 (location_print): New function. Follow the recommendation of the
8624 GNU Coding Standards for locations that span file boundaries.
8625 * src/location.h: Do not include <quotearg.h>; no longer needed.
8626 (boundary): New type.
8627 (location_t): Use it. This allows locations to span file boundaries.
8628 All member uses changed: file -> start.file or end.file (as needed),
8629 first_line -> start.line, first_column -> start.column,
8630 last_line -> end.line, last_column -> end.column.
8631 (equal_boundaries): New function.
8632 (LOCATION_RESET, LOCATION_STEP): Remove.
8633 (LOCATION_PRINT): Remove. All callers changed to use location_print.
8634 (empty_location): Now const.
8635 (location_print): New decl.
8636 * src/parse-gram.y (lloc_default): New function, which handles
8637 empty locations more accurately.
8638 (YYLLOC_DEFAULT): Use it.
8639 (%token COLON): Remove.
8640 (%token ID_COLON): New token.
8641 (rules): Use it.
8642 (declarations, rules): Remove trailing semicolon.
8643 (declaration, rules_or_grammar_declaration):
8644 Allow empty (";") declaration.
8645 (symbol_def): Remove empty actions; no longer needed.
8646 (rules_or_grammar_declaration): Remove trailing semicolon.
8647 (semi_colon.opt): Remove.
8648 * src/reader.h: Include location.h.
8649 (scanner_cursor): New decl.
8650 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
8651 rolling our own.
8652 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
8653 of *loc.
8654 (STEP): Remove. No longer needed, now that adjust_location does
8655 the work. All uses removed.
8656 (scanner_cursor): New var.
8657 (adjust_location): Renamed from extend_location. It now sets
8658 *loc and adjusts the scanner cursor. All uses changed.
8659 Don't bother testing for CR.
8660 (handle_syncline): Remove location arg; now updates scanner cursor.
8661 All callers changed.
8662 (unexpected_end_of_file): Now accepts start boundary of token or
8663 comment, not location. All callers changed. Update scanner cursor,
8664 not the location.
8665 (SC_AFTER_IDENTIFIER): New state.
8666 (context_state): Renamed from c_context. All uses changed.
8667 (id_loc, code_start, token_start): New local vars.
8668 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
8669 processing of Yacc white space and equivalents here.
8670 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
8671 instead of returning ID immediately, since we need to search for
8672 a subsequent colon.
8673 (<INITIAL>"'", "\""): Save token_start.
8674 (<INITIAL>"%{", "{", "%%"): Save code_start.
8675 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
8676 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
8677 BEGIN context_state at end, not INITIAL.
8678 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
8679 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
8680 Return correct token start.
8681 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
8682 the start of a character, string or multiline comment is found.
8683 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
8684 Reduction): Adjust reported locations to match the more-precise
8685 results now expected.
8686 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
8687 * tests/reduce.at (Useless Rules, Reduced Automaton,
8688 Underivable Rules): Likewise.
8689 * tests/regression.at (Invalid inputs): No longer `expecting ";"
8690 or "|"' now that so many other tokens are allowed by the new grammar.
8691
8692 * src/complain.h (current_file): Remove duplicate decl;
8693 current_file is now owned by files.h.
8694 * src/complain.c, src/scan-gram.l: Include files.h.
8695
8696 2002-12-06 Paul Eggert <eggert@twinsun.com>
8697
8698 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
8699 promotes to int; it might be unsigned int.
8700 * data/yacc.c (yy_reduce_print): Likewise.
8701
8702 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
8703 be #defined in the prologue, not in the Bison declarations.
8704 This fixes Debian Bug 102878, reported by Shaul Karl.
8705
8706 2002-12-02 Paul Eggert <eggert@twinsun.com>
8707
8708 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
8709 * lib/strtoul.c: New file, from gnulib.
8710 This fixes a porting bug reported by Peter Klein in
8711 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
8712
8713 2002-11-30 Paul Eggert <eggert@twinsun.com>
8714
8715 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
8716 and put only a forward declaration in the prologue. This is for
8717 consistency with the other scanner helper functions.
8718
8719 Type clashes now generate warnings, not errors, since it
8720 appears that POSIX may allow some grammars with type clashes.
8721 * src/reader.c (grammar_current_rule_check): Warn about
8722 type clashes instead of complaining.
8723 * tests/input.at (Type Clashes): Expect warnings, not complaints.
8724
8725 Add Yacc library, since POSIX requires it.
8726 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
8727 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
8728 * lib/main.c, lib/yyerror.c: New files.
8729
8730 gram_error can be static; it need not be extern.
8731 * src/reader.h (gram_error): Remove decl.
8732 * src/parse-gram.y (gram_error): Now static. Add static decl.
8733 (print_token_value): Omit parameter names from forward decl,
8734 for consistency.
8735
8736 2002-11-29 Paul Eggert <eggert@twinsun.com>
8737
8738 * doc/bison.texinfo: Emphasize that yylex and yyerror must
8739 be declared before being used. E.g., one should typically
8740 declare them in the prologue. Use GNU coding style in examples.
8741 Put "const" consistently after the type it modifies. Mention
8742 that C99 supports "inline". Mention that yyerror traditionally
8743 returns "int".
8744
8745 %parse-param and %lex-param now take just one argument, the
8746 declaration; the argument name is deduced from the declaration.
8747
8748 * doc/bison.texinfo (Parser Function, Pure Calling, Error
8749 Reporting, Table of Symbols): Document this.
8750 * src/parse-gram.y (add_param): New function.
8751 (COMMA): Remove.
8752 (declaration): Implement new rule for %parse-param and %lex-param.
8753 * src/scan-gram.l: "," now elicits a warning, rather than being
8754 a token; this is more compatible with byacc.
8755 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
8756
8757 2002-11-27 Paul Eggert <eggert@twinsun.com>
8758
8759 Rename identifiers to avoid real and potential collisions.
8760
8761 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
8762 to avoid collision with lex macro described by Bruce Lilly in
8763 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
8764 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
8765 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
8766 * src/parse-gram.y (print_token_value): Renamed from yyprint.
8767 All uses changed.
8768 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
8769 The name "yycontrol" violates the name space rules, and this stuff
8770 wasn't being used anyway.
8771 (input): Remove action; this stuff wasn't being used.
8772 (gram_error): Rename local variable yylloc -> loc.
8773 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
8774 (YY_DECL): Don't use "yy" at start of local variables.
8775 All uses changed, e.g., yylloc -> loc.
8776 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
8777 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
8778 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
8779 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
8780
8781 * src/parse-gram.y (gram_error): loc is now const *.
8782 * src/reader.h (gram_error): Likewise.
8783
8784 2002-11-24 Paul Eggert <eggert@twinsun.com>
8785
8786 Version 1.75c.
8787
8788 * tests/actions.at (Actions after errors): Use an output format
8789 more similar to that of the Printers and Destructors test.
8790 Test the position of the ';' token too.
8791 (Printers and Destructors): Likewise.
8792 (Printers and Destructors: %glr-parser): Remove for now, to avoid
8793 unnecessarily alarming people when the test fails.
8794
8795 * data/yacc.c (yyerrlab1): Move this label down, so that the
8796 parser does not discard the lookahead token if the user code
8797 invokes YYERROR. This change is required for POSIX conformance.
8798
8799 * lib/error.c: Sync with gnulib.
8800
8801 2002-11-22 Paul Eggert <eggert@twinsun.com>
8802
8803 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
8804 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
8805 * lib/xmalloc.c: Likewise.
8806
8807 2002-11-20 Paul Eggert <eggert@twinsun.com>
8808
8809 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
8810
8811 2002-11-20 Paul Eggert <eggert@twinsun.com>
8812
8813 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
8814 should use `if (! x) abort ();' rather than `assert (x);', and
8815 anyway it's one less thing to worry about configuring.
8816
8817 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
8818 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
8819 and replace all instances of assert with abort.
8820 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8821 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
8822
8823 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
8824 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
8825 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
8826 hash_find_entry, hash_rehash, hash_insert): Likewise.
8827 * src/conflicts.c (resolve_sr_conflict): Likewise.
8828 * src/lalr.c (set_goto_map, map_goto): Likewise.
8829 * src/nullable.c (nullable_compute): Likewise.
8830 * src/output.c (prepare_rules, token_definitions_output): Likewise.
8831 * src/reader.c (packgram, reader): Likewise.
8832 * src/state.c (state_new, state_free, state_transitions_set,
8833 state_reduction_find): Likewise.
8834 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
8835 symbol_pack): Likewise.
8836 * src/tables.c (conflict_row, pack_vector): Likewise.
8837 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
8838 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
8839 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
8840 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
8841
8842 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
8843 (ARGMATCH_CONSTRAINT): New macro.
8844 (ARGMATCH_ASSERT): Use it.
8845
8846 * src/system.h (verify): New macro.
8847 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
8848 rather than assert.
8849 * src/tables.c (tables_generate): Likewise.
8850
8851 * src/struniq.c (struniq_assert): Now returns void, and aborts
8852 if the assertion is false.
8853 (struniq_assert_p): Remove.
8854 * src/struniq.h: Likewise.
8855
8856 2002-11-18 Paul Eggert <eggert@twinsun.com>
8857
8858 * data/glr.c (yygetLRActions): Replace `yyindex' with
8859 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
8860 This fixes the regression with Sun ONE Studio 7 cc that I reported in
8861 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
8862
8863 2002-11-18 Akim Demaille <akim@epita.fr>
8864
8865 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
8866 space.
8867 From Tim Van Holder.
8868
8869 2002-11-17 Paul Eggert <eggert@twinsun.com>
8870
8871 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
8872 to "SyntaxError" for consistency with my 2002-11-15 change.
8873
8874 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
8875 not define to {}, since this breaks the common use of `YYDPRINTF
8876 ((...));' if a single statement is desired (e.g. before `else').
8877 Work around GCC warnings by surrounding corresponding calls with
8878 {} if needed.
8879 (yyhasResolvedValue): Remove unused function.
8880 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
8881 loop body.
8882 (yyreportSyntaxError): Renamed from yyreportParseError.
8883 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
8884 All uses changed.
8885 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
8886 extern when possible. Remove unused initializations.
8887
8888 2002-11-16 Akim Demaille <akim@epita.fr>
8889
8890 Augment the similarity between GLR and LALR traces.
8891
8892 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
8893 (YY_REDUCE_PRINT): New.
8894 (yyparse): Use them.
8895 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
8896 YYDPRINT here.
8897 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
8898 state reached after the reduction/recovery, since...
8899 (yyparse, yyprocessOneStack): Report the state we are entering in.
8900
8901 2002-11-16 Akim Demaille <akim@epita.fr>
8902
8903 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
8904 Add support for --trace=skeleton.
8905 * src/scan-skel.l: %option debug.
8906 Scan strings of non-@ or \n instead of character by character.
8907 (scan_skel): Handle trace_skeleton.
8908 (QPUTS): New.
8909 (@output_parser_name@, @output_header_name@): ``Restore'' their
8910 support (used to be M4 macros).
8911 * data/yacc.c: Quote larger chunks, a la glr.c.
8912 * data/lalr1.cc: Likewise.
8913 The header guards are no longer available, so use some other
8914 string than `YYLSP_NEEDED'.
8915
8916 2002-11-16 Akim Demaille <akim@epita.fr>
8917
8918 Make the ``Printers and Destructors'' test more verbose, taking
8919 `yacc.c''s behavior as (possibly wrong) reference.
8920
8921 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
8922 instead of fprint on stdout.
8923 Set and report the last_line of the symbols.
8924 Consistently display values and locations.
8925
8926 2002-11-16 Paul Eggert <eggert@twinsun.com>
8927
8928 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
8929
8930 2002-11-15 Paul Eggert <eggert@twinsun.com>
8931
8932 * tests/actions.at (Actions after errors): New test case.
8933
8934 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
8935 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
8936 tests/action.at, tests/calc.at, tests/conflicts.at,
8937 tests/cxx-type.at, tests/regression.at:
8938 "parse error" -> "syntax error" for POSIX compatibility.
8939 "parsing stack overflow..." -> "parser stack overflow" so
8940 that code matches Bison documentation.
8941
8942 2002-11-15 Akim Demaille <akim@epita.fr>
8943
8944 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
8945 take two BRACED_CODE, not two string_content.
8946 Free the scanner's obstack when we are done.
8947 (code_content): New.
8948 * tests/calc.at: Adjust.
8949 * doc/bison.texinfo: Adjust.
8950 Also, make sure to include the `,' for these declarations.
8951
8952 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
8953
8954 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
8955 definition; avoids potential autoreconf problems.
8956
8957 2002-11-15 Akim Demaille <akim@epita.fr>
8958
8959 Always check the value returned by yyparse.
8960
8961 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
8962 returned by yyparse.
8963 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
8964 Adjust calls.
8965 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
8966 returned by yyparse.
8967
8968 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8969
8970 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
8971 on input.at test.
8972
8973 2002-11-14 Paul Eggert <eggert@twinsun.com>
8974
8975 * src/output.c (output_skeleton): Call xfopen instead of
8976 duplicating xfopen's body.
8977
8978 Fix bugs reported by Nelson H. F. Beebe in
8979 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
8980
8981 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
8982 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
8983 Group compiler. Instead, use "$CC -E bar.c". Include the .h
8984 file twice in the grammar, as an extra check.
8985
8986 * tests/input.at (Torturing the Scanner): Surround the
8987 backslash-newline tests with "#if 0", to make it less likely that
8988 we'll run into compiler bugs. Bring back solitary \ inside
8989 comment, but add a closing comment to work around HP C bug. Don't
8990 test backslash-newline in C character constant.
8991
8992 2002-11-14 Akim Demaille <akim@epita.fr>
8993
8994 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
8995 status of the compiler.
8996 Calling `exit 1' is no longer needed.
8997 Reported by Nelson H. F. Beebe.
8998
8999 2002-11-14 Akim Demaille <akim@epita.fr>
9000
9001 * tests/atlocal.in (CPPFLAGS): We have config.h.
9002 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
9003 New.
9004 * tests/actions.at, tests/calc.at, tests/conflicts.at,
9005 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
9006 * tests/regression.at, tests/torture.at: Use them for all the
9007 grammars that are to be compiled.
9008 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
9009 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
9010 * doc/bison.texinfo (GLR Parsers): Document `inline'.
9011
9012 2002-11-14 Akim Demaille <akim@epita.fr>
9013
9014 * doc/bison.texinfo: Various formatting changes (alignments in
9015 samples, additional @group/@end group, GCS in samples.
9016 Use @deffn instead of simple @table to define the directives,
9017 macros, variables etc.
9018
9019 2002-11-13 Paul Eggert <eggert@twinsun.com>
9020
9021 Fix some bugs reported by Albert Chin-A-Young in
9022 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
9023
9024 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
9025 -o c"; the HP C compiler chatters during compilation.
9026 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
9027 * tests/headers.at (export YYLTYPE): Likewise.
9028
9029 * tests/input.at (Torturing the Scanner): Remove lines containing
9030 solitary backslashes, as they tickle a bug in the HP C compiler.
9031
9032 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
9033 comments, since they're not portable. Use GNU coding style.
9034
9035 2002-11-13 Akim Demaille <akim@epita.fr>
9036
9037 * data/yacc.c: Leave bigger chunks of quoted text.
9038 (YYDSYMPRINTF): New.
9039 Use it to report symbol activities.
9040 * data/glr.c (YYDSYMPRINTF): New.
9041 Use it.
9042
9043 2002-11-12 Paul Eggert <eggert@twinsun.com>
9044
9045 Version 1.75b.
9046
9047 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
9048 (yyglrReduce): Return yyok, not 0.
9049 This should avoid the enumerated-type warnings reported
9050 by Nelson H. F. Beebe in
9051 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
9052
9053 * lib/bbitset.h (BITSET_INLINE): Remove.
9054 * lib/bitset.h [! BITSET_INLINE]: Remove.
9055 (bitset_set, bitset_reset, bitset_test): Rename local vars
9056 to avoid shadowing warnings by GCC.
9057
9058 * data/glr.c (inline): Remove #define. It's the user's
9059 responsibility to #define it away, just like 'const'.
9060 This fixes one of the bugs reported by Nelson H. F. Beebe in
9061 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
9062
9063 * Makefile.maint (po-check): Scan .l and .y files instead of the
9064 .c and the .h files that they generate. This fixes the bug
9065 reported by Tim Van Holder in:
9066 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
9067 Look for N_ as well as for _. Try to avoid matching #define for
9068 N_ and _.
9069 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
9070 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
9071 * src/scan-gram.l: Revamp regular expressions so that " and '
9072 do not confuse xgettext.
9073
9074 * src/struniq.h (struniq_new): Do not declare the return type
9075 to be 'const'; this violates the C standard.
9076 * src/struniq.c (struniq_new): Likewise.
9077
9078 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
9079
9080 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
9081 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
9082 linker.
9083
9084 2002-11-12 Akim Demaille <akim@epita.fr>
9085
9086 * Makefile.maint: Sync with Autoconf:
9087 (local_updates): New.
9088
9089 2002-11-12 Akim Demaille <akim@epita.fr>
9090
9091 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
9092
9093 2002-11-12 Akim Demaille <akim@epita.fr>
9094
9095 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
9096 locations.
9097
9098 2002-11-12 Akim Demaille <akim@epita.fr>
9099
9100 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
9101 not yyvalue.
9102
9103 2002-11-12 Akim Demaille <akim@epita.fr>
9104
9105 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
9106 Use it to test the GLR parser.
9107
9108 2002-11-12 Akim Demaille <akim@epita.fr>
9109
9110 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
9111 defines it.
9112 * data/glr.c (yystos): New.
9113 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
9114 (YYDSYMPRINT): New.
9115 (yyval): Don't define it, it is handled via M4.
9116 (yyrecoverParseError): Free verbosely the discarded symbols.
9117 * data/yacc.c (yysymprint): Remove, rather...
9118 (b4_yysymprint_generate): invoke.
9119 * data/c.m4 (b4_yysymprint_generate): New.
9120 Accept pointers as arguments, as opposed to the version from
9121 yacc.c.
9122 (b4_yydestruct_generate): Likewise.
9123 * tests/cations.at (Printers and Destructors): Use Bison directives
9124 instead of CPP macros.
9125 Don't rely on internal details.
9126
9127 2002-11-12 Akim Demaille <akim@epita.fr>
9128
9129 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
9130 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
9131 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
9132 it against YYEMPTY and so forth), work on yytoken (i.e., set
9133 it to YYEMPTY etc.).
9134 (yydestruct): Replace with a b4_yydestruct_generate invocation.
9135 (b4_symbol_actions): Remove.
9136 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
9137 for 0, end-of-input.
9138
9139 2002-11-12 Akim Demaille <akim@epita.fr>
9140
9141 * doc/bison.texinfo (Destructor Decl): New.
9142
9143 2002-11-12 Akim Demaille <akim@epita.fr>
9144
9145 * src/tables.c (tables_generate): Use free for pointers that
9146 cannot be NULL, not XFREE.
9147 (pack_vector): Use assert, not fatal, for bound violations.
9148 * src/state.c (state_new): Likewise.
9149 * src/reader.c (reader): Likewise.
9150 * src/lalr.c (set_goto_map): Likewise.
9151 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
9152 the file name.
9153
9154 2002-11-12 Akim Demaille <akim@epita.fr>
9155
9156 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
9157 Restore.
9158 * src/scan-gram.l (last_string): Is global to the file, not to
9159 yylex.
9160 * src/parse-gram.y (input): Don't append the epilogue here,
9161 (epilogue.opt): do it here, and free the scanner's obstack.
9162 * src/reader.c (epilogue_set): Rename as...
9163 (epilogue_augment): this.
9164 * data/c.m4 (b4_epilogue): Defaults to empty.
9165
9166 2002-11-12 Akim Demaille <akim@epita.fr>
9167
9168 * src/getargs.c (long_options): Remove duplicates.
9169 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
9170 Remove.
9171 * doc/bison.rnh: Remove.
9172 * doc/bison.texinfo (VMS Invocation): Remove.
9173
9174 2002-11-12 Akim Demaille <akim@epita.fr>
9175
9176 * src/struniq.h, src/struniq.c (struniq_t): Is const.
9177 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
9178
9179 Use struniq for symbols.
9180
9181 * src/symtab.h (symbol_t): The tag member is a struniq.
9182 (symbol_type_set): Adjust.
9183 * src/symtab.c (symbol_new): Takes a struniq.
9184 (symbol_free): Don't free the tag member.
9185 (hash_compare_symbol_t, hash_symbol_t): Rename as...
9186 (hash_compare_symbol, hash_symbol): these.
9187 Use the fact that tags as struniqs.
9188 (symbol_get): Use struniq_new.
9189 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
9190 Returns a strniq.
9191 * src/reader.h (merger_list, grammar_currentmerge_set): The name
9192 and type members are struniqs.
9193 * src/reader.c (get_merge_function)
9194 (grammar_current_rule_merge_set): Adjust.
9195 (TYPE, current_type): Are struniq.
9196
9197 Use struniq for file names.
9198
9199 * src/files.h, src/files.c (infile): Split into...
9200 (grammar_file, current_file): these.
9201 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
9202 * src/reduce.c (reduce_print): Likewise.
9203 * src/getargs.c (getargs): Likewise.
9204 * src/complain.h, src/complain.c: Likewise.
9205 * src/main.c (main): Call struniqs_new early enough to use it for
9206 file names.
9207 Don't free the input file name.
9208
9209 2002-11-12 Akim Demaille <akim@epita.fr>
9210
9211 * src/symtab.c (symbol_free): Remove dead deactivated code:
9212 type_name are properly removed.
9213 Don't use XFREE to free items that cannot be NULL.
9214 * src/struniq.h, src/struniq.c: New.
9215 * src/main.c (main): Initialize/free struniqs.
9216 * src/parse-gram.y (%union): Add astruniq member.
9217 (yyprint): Adjust.
9218 * src/scan-gram.l (<{tag}>): Return a struniq.
9219 Free the obstack bit that used to store it.
9220 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
9221
9222 2002-11-11 Paul Eggert <eggert@twinsun.com>
9223
9224 Revamp to fix many (but not all) of the C- and M4-related quoting
9225 problems. Among other things, this fixes the Bison bug reported
9226 by Jan Hubicka when processing the Bash grammar; see:
9227 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
9228
9229 Use new @ escapes consistently. Represent brackets with @{ and @}
9230 rather than @<:@ and @:>@, since this works a bit better with dumb
9231 editors like vi. Represent @ with @@, since @ is now consistently
9232 an escape. Use @oline@ and @ofile@ rather than __oline__ and
9233 __ofile__, to avoid unexpected expansions. Similarly, use @output
9234 rather than #output.
9235
9236 * data/c.m4 (b4_copyright): Omit file name from comment, since
9237 the file name could contain "*/".
9238 (b4_synclines_flag): Don't quote the 2nd argument; it should already
9239 be quoted. All uses changed.
9240
9241 * data/glr.c: Use new @ escapes consistently.
9242 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
9243 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
9244 Remove, since they couldn't handle arbitrary characters in file
9245 names.
9246 * data/lalr1.cc: Likewise.
9247 * data/yacc.c: Likewise.
9248
9249 * src/files.c (output_infix): Remove; all uses removed.
9250 * src/files.h: Likewise.
9251
9252 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
9253 mishandled funny characters in file names, and anyway it isn't
9254 needed any more.
9255 * data/yacc.c: Likewise.
9256 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
9257
9258 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
9259 * data/yacc.c: Likewise.
9260
9261 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
9262 strings now.
9263 (muscle_init): Quote filename as a C string.
9264 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
9265 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
9266 * src/output.c (escaped_file_name_output): New function.
9267 (prepare_symbols): Quote tokens for M4.
9268 (prepare): Don't insert output_infix, output_prefix,
9269 output_parser_name, output_header_name; this is now down by scan-skel.
9270 Insert skeleton as a C string.
9271
9272 * src/output.c (user_actions_output, symbol_destructors_output,
9273 symbol_printers_output): Quote filenames for C and M4.
9274 * src/reader.c (prologue_augment, epilogue_set): Likewise.
9275
9276 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
9277 escapes other than \\ and \'; this simplifies the code.
9278 (<SC_STRING>): Likewise, for \\ and \".
9279 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
9280 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
9281 Use new escapes @{ and @} for [ and ].
9282
9283 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
9284 them with auto vars.
9285 Switch to new escape scheme, where @ is the escape character uniformly.
9286 Abort if a stray escape character is found. Avoid unbounded input
9287 buffer when parsing non-escaped text.
9288
9289 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
9290 __oline__, #output, $@, and @{ do not have unintended meanings.
9291
9292 2002-11-09 Paul Eggert <eggert@twinsun.com>
9293
9294 Fix the test failure due to GCC warnings described in
9295 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
9296 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
9297 evaluate to 0 if it's impossible for NINF to be in the respective
9298 table.
9299 (yygetLRActions, yyrecoverParseError): Use them.
9300
9301 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
9302 counted in the token inserted at end of file. Now takes
9303 location_t *, not location_t, so that the location can be
9304 adjusted. All uses changed.
9305
9306 * tests/regression.at (Invalid inputs): Adjust wording in
9307 diagnostic to match the new behavior.
9308
9309 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
9310 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
9311 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
9312 abort ();'. This reduces the runtime of the "Many lookaheads"
9313 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
9314 GCC 3.2.
9315
9316 2002-11-07 Paul Eggert <eggert@twinsun.com>
9317
9318 * src/parse-gram.y (CHARACTER): Remove unused token.
9319 All uses removed.
9320
9321 * src/scan-gram.l: Remove stack option. We no longer use the
9322 stack, since the stack was never deeper than 1; instead, use the
9323 new auto var c_context to record the stacked value.
9324
9325 Remove nounput option. At an unexpected end of file, we now unput
9326 the minimal input necessary to end cleanly; this simplifies the
9327 code.
9328
9329 Avoid unbounded token sizes where this is easy.
9330
9331 (unexpected_end_of_file): New function.
9332 Use it to systematize the error message on unexpected EOF.
9333 (last-string): Now auto, not static.
9334 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
9335 (scanner_last_string_free): Remove; not used.
9336 (percent_percent_count): Move decl to just before use.
9337 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
9338 not the (never otherwised-used) CHARACTER.
9339
9340 2002-11-07 Akim Demaille <akim@epita.fr>
9341
9342 Let yyerror always receive the msg as last argument, so that
9343 yyerror can be variadic.
9344
9345 * data/yacc.c (b4_yyerror_args): New.
9346 Use it when calling yyerror.
9347 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
9348 Use it when calling yyerror.
9349 * doc/bison.texinfo (Error Reporting): Adjust.
9350 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
9351 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
9352
9353 2002-11-06 Akim Demaille <akim@epita.fr>
9354
9355 #line should have quoted strings.
9356 Ideally, this should be done by m4_quotearg.
9357
9358 * src/scan-skel.l: Include quotearg.h.
9359 Quote __ofile__.
9360 * src/output.c (symbol_printers_output)
9361 (symbol_destructors_output): Quote the file name.
9362
9363 2002-11-06 Akim Demaille <akim@epita.fr>
9364
9365 * tests/regression.at (Invalid inputs): Adjust to the recent
9366 messages.
9367
9368 2002-11-06 Akim Demaille <akim@epita.fr>
9369
9370 Restore --no-lines.
9371 Reported by Jim Kent.
9372
9373 * data/c.m4 (b4_syncline): New.
9374 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
9375 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
9376 * src/output.c (user_actions_output): Likewise.
9377 (prepare): Define 'b4_synclines_flag'.
9378 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
9379
9380 2002-11-06 Akim Demaille <akim@epita.fr>
9381
9382 * src/main.c (main): Free `infile'.
9383 * src/scan-gram.l (handle_syncline): New.
9384 Recognize `#line'.
9385 * src/output.c (user_actions_output, symbol_destructors_output)
9386 (symbol_printers_output): Use the location's file name, not
9387 infile.
9388 * src/reader.c (prologue_augment, epilogue_set): Likewise.
9389
9390 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9391
9392 * src/tables.c (matching_state): Don't allow states to match if
9393 either has GLR conflict entries.
9394
9395 2002-11-05 Paul Eggert <eggert@twinsun.com>
9396
9397 * src/scan-gram.l: Use more accurate diagnostics, e.g.
9398 "integer out of range" rather than "invalid value".
9399 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
9400 accordingly.
9401
9402 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
9403 Also, remove one static variable in the scanner.
9404
9405 * src/scan-gram.l (braces_level): Now auto, not static.
9406 Initialize to zero if the compiler is being picky.
9407 (INITIAL): Clear braces_level instead of incrementing it.
9408 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
9409 as POSIX 1003.1-2001 requires.
9410 * src/system.h (IF_LINT): New macro, taken from coreutils.
9411 * configure.ac: Define "lint" if --enable-gcc-warnings.
9412
9413 2002-11-05 Akim Demaille <akim@epita.fr>
9414
9415 * src/scan-gram.l: When it starts with `%', complain about the
9416 whole directive, not just that `invalid character: %'.
9417
9418 2002-11-04 Akim Demaille <akim@epita.fr>
9419
9420 * Makefile.maint: Update from Autoconf.
9421 (update, cvs-update, po-update, do-po-update): New.
9422
9423 2002-11-04 Akim Demaille <akim@epita.fr>
9424
9425 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
9426 and yyerror.
9427 Have yyerror `use' its arguments.
9428 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
9429 returns true when location & yacc & pure & parse-param.
9430 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
9431
9432 2002-11-04 Akim Demaille <akim@epita.fr>
9433
9434 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
9435 clashes.
9436 * src/scan-gram.l: Use [\'] instead of ['] to pacify
9437 font-lock-mode.
9438 Use complain_at.
9439 Use quote, not quote_n since LOCATION_PRINT no longer uses the
9440 slot 0.
9441
9442 2002-11-03 Paul Eggert <eggert@twinsun.com>
9443
9444 * src/reader.c (get_merge_function, grammar_current_rule_check):
9445 Use consistent diagnostics for reporting type name clashes.
9446 Quote the types with <>, for consistency with Yacc.
9447 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
9448
9449 2002-11-03 Akim Demaille <akim@epita.fr>
9450
9451 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
9452 New.
9453 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
9454 (b4_parse_param): Remove.
9455 Use b4_identification.
9456 Propagate b4_pure_args where needed to pass them to yyerror.
9457 * data/glr.m4 (b4_parse_param): Remove.
9458 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
9459 (b4_lpure_formals): New.
9460 Use b4_identification.
9461 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
9462 b4_user_formals and b4_user_args.
9463 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
9464 (yyreportAmbiguity): When using a pure parser, also need
9465 the location, and the parse-params.
9466 Adjust callers.
9467 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
9468 When using a pure parser, also need the parse-params.
9469 Adjust callers.
9470 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
9471 (%pure-parser + %parse-param) LALR and GLR parsers.
9472 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
9473 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
9474 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
9475 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
9476 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
9477 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
9478 * doc/bison.texinfo: Untabify the whole file.
9479 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
9480 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
9481 (Error Reporting): Adjust to these new directives.
9482 Document %error-verbose, deprecate YYERROR_VERBOSE.
9483
9484 2002-11-03 Akim Demaille <akim@epita.fr>
9485
9486 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
9487 AT_CHECK_CALC_GLR invocations to use % directives, instead of
9488 command line options.
9489 * tests/cxx-type.at: Formatting changes.
9490
9491 2002-11-03 Paul Eggert <eggert@twinsun.com>
9492
9493 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
9494 to count columns correctly, and to check for invalid inputs.
9495
9496 Use mbsnwidth to count columns correctly. Account for tabs, too.
9497 Include mbswidth.h.
9498 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
9499 (extend_location): New function.
9500 (YY_LINES): Remove.
9501
9502 Handle CRLF in C code rather than in Lex code.
9503 (YY_INPUT): New macro.
9504 (no_cr_read): New function.
9505
9506 Scan UCNs, even though we don't fully handle them yet.
9507 (convert_ucn_to_byte): New function.
9508
9509 Handle backslash-newline correctly in C code.
9510 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
9511 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
9512 all uses changed.
9513 (tag, splice): New EREs. Do not allow NUL or newline in tags.
9514 Use {splice} wherever C allows backslash-newline.
9515 YY_STEP after space, newline, vertical-tab.
9516 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9517
9518 (letter, id): Don't assume ASCII; e.g., spell out a-z.
9519
9520 ({int}, handle_action_dollar, handle_action_at): Check for integer
9521 overflow.
9522
9523 (YY_STEP): Omit trailing semicolon, so that it's more like C.
9524
9525 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
9526 as well as \000. Check for UCHAR_MAX, not 255.
9527 Allow \x with an arbitrary positive number of digits, as in C.
9528 Check for overflow here.
9529 Allow \? and UCNs, for compatibility with C.
9530
9531 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
9532 with quote slot used by complain_at.
9533
9534 * tests/input.at: Add tests for backslash-newline, m4 quotes
9535 in symbols, long literals, and funny escapes in strings.
9536
9537 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
9538 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
9539 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
9540 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
9541 * m4/mbswidth.m4: New file, from GNU coreutils.
9542
9543 * doc/bison.texinfo (Grammar Outline): Document // comments.
9544 (Symbols): Document that trigraphs have no special meaning in Bison,
9545 nor is backslash-newline allowed.
9546 (Actions): Document that trigraphs have no special meaning.
9547
9548 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
9549 no longer used.
9550
9551 2002-11-02 Paul Eggert <eggert@twinsun.com>
9552
9553 * src/reader.c: Don't include quote.h; not needed.
9554 (get_merge_function): Reword warning to be consistent with
9555 type clash diagnostic in grammar_current_rule_check.
9556
9557 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
9558 bug in trigraph handling.
9559
9560 * src/output.c (prepare_symbols): When printing token names,
9561 escape "[" as "@<:@" and likewise for "]".
9562
9563 * src/system.h (errno): Remove declaration, as we are now
9564 assuming C89 or better, and C89 guarantees errno.
9565
9566 2002-10-30 Paul Eggert <eggert@twinsun.com>
9567
9568 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
9569 Check for close failures.
9570 * src/files.h (xfclose): Return void, not int, since it always
9571 returned zero.
9572 * src/files.c (xfclose): Likewise. Report I/O error if ferror
9573 indicates one.
9574 * src/output.c (output_skeleton): Use xfclose rather than fclose
9575 and ferror. xfclose now checks ferror.
9576
9577 * data/glr.c (YYLEFTMOST_STATE): Remove.
9578 (yyreportTree): Use a stack-based leftmost state. This avoids
9579 our continuing battles with bogus warnings about initializers.
9580
9581 2002-10-30 Akim Demaille <akim@epita.fr>
9582
9583 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
9584 #if.
9585
9586 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9587
9588 * tests/glr-regr1.at: New test for reported regressions.
9589 * tests/testsuite.at: Add glr-regr1.at test.
9590 * tests/Makefile.am: Add glr-regr1.at test.
9591
9592 2002-10-24 Paul Eggert <eggert@twinsun.com>
9593
9594 Version 1.75a.
9595
9596 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
9597 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
9598 we use malloc. Don't assume 'A' through 'Z' are contiguous.
9599 Don't assume strdup exists; POSIX says its an XSI extension.
9600 Check for buffer overflow on input.
9601
9602 2002-10-24 Akim Demaille <akim@epita.fr>
9603
9604 * src/output.c (output_skeleton): Don't disable M4sugar comments
9605 too soon: it results in comments being expanded.
9606 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
9607 first output.
9608
9609 2002-10-24 Akim Demaille <akim@epita.fr>
9610
9611 * data/yacc.c (m4_int_type): New.
9612 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
9613 char' as only yacc.c wants K&R portability.
9614 * data/glr.c (yysigned_char): Remove.
9615 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
9616 Reported by Quoc Peyrot.
9617
9618 2002-10-23 Paul Eggert <eggert@twinsun.com>
9619
9620 * src/main.c (main): With --trace=time, report times even if a
9621 non-fatal error occurs. Formerly, the times were reported in some
9622 such cases but not in others.
9623 * src/reader.c (reader): Just return if a complaint has been issued,
9624 instead of exiting, so that 'main' can report times.
9625
9626 2002-10-22 Akim Demaille <akim@epita.fr>
9627
9628 * src/system.h: Include sys/types.
9629 Reported by Bert Deknuydt.
9630
9631 2002-10-23 Paul Eggert <eggert@twinsun.com>
9632
9633 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
9634 Suggested by Art Haas.
9635
9636 2002-10-22 Paul Eggert <eggert@twinsun.com>
9637
9638 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
9639 decl; not needed any more.
9640 * src/main.c (main): Use return to exit, undoing yesterday's change.
9641 The last OS that we could find where this wouldn't work is
9642 SunOS 3.5, and that's too old to worry about now.
9643
9644 * data/glr.c (struct yyltype): Define members even when not
9645 doing locations. This is more consistent with yacc.c, and it
9646 works around the following bug reports:
9647 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
9648 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
9649
9650 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
9651 @acronym consistently. Standardize on "Yacc" instead of "YACC",
9652 "Algol" instead of "ALGOL". Give a bit more history about BNF.
9653
9654 2002-10-22 Akim Demaille <akim@epita.fr>
9655
9656 * data/README: New.
9657
9658 2002-10-21 Paul Eggert <eggert@twinsun.com>
9659
9660 Be consistent about 'bool'; the old code used an enum in one
9661 module and an int in another, and this violates the C standard.
9662 * m4/stdbool.m4: New file, from coreutils 4.5.3.
9663 * configure.ac (AC_HEADER_STDBOOL): Add.
9664 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
9665 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
9666 * src/symtab.c (hash_compare_symbol_t): Likewise.
9667 * src/system.h (bool, false, true): Use a definition consistent
9668 with ../lib/hash.c. All uses changed.
9669
9670 * src/complain.c (warning_issued): Renamed from warn_message_count,
9671 so that we needn't worry about integer overflow (!).
9672 Now of type bool. All uses changed.
9673 (complaint_issued): Renamed from complain_message_count; likewise.
9674
9675 * src/main.c (main): Use exit to exit with failure.
9676
9677 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
9678 rather than 1 and 0.
9679 * src/main.c (main): Likewise.
9680 * src/getargs.c (getargs): Likewise.
9681 * src/reader.c (reader): Likewise.
9682
9683 * src/getarg.c (getargs): Remove duplicate code for
9684 "Try `bison --help'".
9685
9686 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
9687 What was that "2" for?
9688
9689 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
9690 * src/getargs.c (usage): Likewise.
9691
9692 * src/getargs.c (getargs): When there are too few operands, report
9693 the last one. When there are too many, report the first extra
9694 one. This is how diffutils does it.
9695
9696 2002-10-20 Paul Eggert <eggert@twinsun.com>
9697
9698 Remove K&R vestiges.
9699 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
9700 * src/complain.c (VA_START): Remove. Assume prototypes.
9701 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
9702 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
9703 fatal): Assume prototypes.
9704 * src/complain.h: Assume prototypes.
9705 * src/system.h (PARAMS): Remove.
9706 Include <limits.h> unconditionally, since it's guaranteeed even
9707 for a freestanding C89 compiler.
9708 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
9709 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
9710
9711 2002-10-20 Akim Demaille <akim@epita.fr>
9712
9713 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
9714 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
9715 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
9716 (yyresolveStates, yyresolveAction, yyresolveStack)
9717 (yyprocessOneStack): Use them.
9718 (yy_reduce_print): New.
9719 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
9720
9721 2002-10-20 Akim Demaille <akim@epita.fr>
9722
9723 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
9724 arguments and output `void'.
9725 (b4_c_function): Rename as...
9726 (b4_c_function_def): this.
9727 (b4_c_function_decl, b4_c_ansi_function_def)
9728 (b4_c_ansi_function_decl): New.
9729 Change the interpretation of the arguments: before `int, foo', now
9730 `int foo, foo'.
9731 * data/yacc.c (yyparse): Prototype and define thanks to these.
9732 Adjust b4_c_function_def uses.
9733 * data/glr.c (yyparse): Likewise, but ANSI only.
9734
9735 2002-10-20 Akim Demaille <akim@epita.fr>
9736
9737 * src/output.c (prepare): Move the definition of `tokens_number',
9738 `nterms_number', `undef_token_number', `user_token_number_max'
9739 to...
9740 (prepare_tokens): Here.
9741 (prepare_tokens): Rename as...
9742 (prepare_symbols): this.
9743 (prepare): Move the definition of `rules_number' to...
9744 (prepare_rules): here.
9745 (prepare): Move the definition of `last', `final_state_number',
9746 `states_number' to...
9747 (prepare_states): here.
9748 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
9749
9750 2002-10-20 Akim Demaille <akim@epita.fr>
9751
9752 * src/tables.h, src/tables.c, src/output.c: Comment changes.
9753
9754 2002-10-20 Akim Demaille <akim@epita.fr>
9755
9756 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
9757 * data/c.m4: here.
9758
9759 2002-10-20 Akim Demaille <akim@epita.fr>
9760
9761 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
9762 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
9763 `pair'.
9764 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
9765 `name' to...
9766 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
9767 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
9768 These.
9769
9770 2002-10-19 Paul Eggert <eggert@twinsun.com>
9771
9772 Do not create a temporary file, as that involves security and
9773 cleanup headaches. Instead, use a pair of pipes.
9774 Derived from a suggestion by Florian Krohm.
9775 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
9776 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
9777 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
9778 (BISON_PREREQ_SUBPIPE): Add.
9779 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
9780 Add subpipe.h, subpipe.c.
9781 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
9782 * po/POTFILES.in: Add lib/subpipe.c.
9783 * src/output.c: Include "subpipe.h".
9784 (m4_invoke): Remove decl.
9785 (scan_skel): New decl.
9786 (output_skeleton): Use pipe rather than temporary file for m4 input.
9787 Check that m4sugar.m4 is readable, to avoid deadlock.
9788 Check for pipe I/O error.
9789 * src/scan-skel.l (readpipe): Remove decl.
9790 (scan_skel): New function, to be used in place of m4_invoke.
9791 Read from stream rather than file.
9792
9793 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
9794 float, as this generates a warning on Solaris 8 + GCC 3.2 with
9795 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
9796 this generates a more-accurate value anyway.
9797
9798 * lib/timevar.c (timervar_accumulate): Rename locals to
9799 avoid confusion with similarly-named more-global.
9800 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
9801
9802 * src/output.c (prepare): Use xstrdup to convert char const *
9803 to char *, to avoid GCC warning.
9804
9805 2002-10-19 Akim Demaille <akim@epita.fr>
9806
9807 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
9808 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
9809 Use them to have `calc.y' ready for %pure-parser.
9810 * data/yacc.c (YYLEX): Pass a yylex return type to
9811 b4_c_function_call.
9812
9813 2002-10-19 Akim Demaille <akim@epita.fr>
9814
9815 Prototype support of %lex-param and %parse-param.
9816
9817 * src/parse-gram.y: Add the definition of the %lex-param and
9818 %parse-param tokens, plus their rules.
9819 Drop the `_' version of %glr-parser.
9820 Add the "," token.
9821 * src/scan-gram.l (INITIAL): Scan them.
9822 * src/muscle_tab.c: Comment changes.
9823 (muscle_insert, muscle_find): Rename `pair' as `probe'.
9824 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
9825 (muscle_entry_s): The `value' member is no longer const.
9826 Adjust all dependencies.
9827 * src/muscle_tab.c (muscle_init): Adjust: use
9828 MUSCLE_INSERT_STRING.
9829 Initialize the obstack earlier.
9830 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
9831 (muscle_pair_list_grow): New.
9832 * data/c.m4 (b4_c_function_call, b4_c_args): New.
9833 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
9834 * tests/calc.at: Use %locations, not --locations.
9835 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
9836
9837 2002-10-19 Akim Demaille <akim@epita.fr>
9838
9839 * src/getargs.c (usage): Take status as argument and exit
9840 accordingly.
9841 Report the traditional `Try ... --help' message when status != 0.
9842 (usage, version): Don't take a FILE * as arg, it is pointless.
9843 (getargs): When there is an incorrect number of arguments, make it
9844 an error, and report it GNUlically thanks to `usage ()'.
9845
9846 2002-10-18 Paul Eggert <eggert@twinsun.com>
9847
9848 * data/glr.c (yyreportParseError): Don't assume that sprintf
9849 yields the length of the printed string, as this is not true
9850 on SunOS 4.1.4. Reported by Peter Klein.
9851
9852 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
9853 * tests/conflicts.at (%nonassoc and eof): Likewise.
9854 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
9855
9856 2002-10-17 Akim Demaille <akim@epita.fr>
9857
9858 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
9859 * src/getargs.c (trace_types, trace_args): Adjust.
9860 * src/reader.c (grammar_current_rule_prec_set)
9861 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
9862 Standardize error messages.
9863 And s/@prec/%prec/!
9864 (reader): Use trace_flag to enable scanner/parser debugging,
9865 instead of an adhoc scheme.
9866 * src/scan-gram.l: Remove trailing debugging code.
9867
9868 2002-10-16 Paul Eggert <eggert@twinsun.com>
9869
9870 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
9871 MUSCLE_TAB_H.
9872
9873 * NEWS: Officially drop support for building Bison with K&R C,
9874 since it didn't work anyway and it's not worth worrying about.
9875 * Makefile.maint (wget_files): Remove ansi2knr.c.
9876 (ansi2knr.c-url_prefix): Remove.
9877 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
9878 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9879 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9880
9881 2002-10-15 Paul Eggert <eggert@twinsun.com>
9882
9883 Stop using the "enum_" trick for K&R-style function definitions;
9884 it confused me, and I was the author! Instead, assume that people
9885 who want to use K&R C compilers (when using these modules in GCC,
9886 perhaps?) will run ansi2knr.
9887
9888 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
9889 All uses of "enum_" changed to "enum ".
9890 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9891 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
9892
9893 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
9894 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
9895 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
9896 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
9897 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
9898 abitset_not, abitset_ones, abitset_or, abitset_or_and,
9899 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
9900 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
9901 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
9902 Use function prototypes; this removes the need for declaring
9903 static functions simply to provide their prototypes.
9904 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
9905 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
9906 bitset_count_, bitset_create, bitset_dump, bitset_first,
9907 bitset_free, bitset_init, bitset_last, bitset_next,
9908 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
9909 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
9910 bitset_print, bitset_release_memory, bitset_toggle_,
9911 bitset_type_choose, bitset_type_get, bitset_type_name_get,
9912 debug_bitset): Likewise.
9913 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
9914 * lib/bitset_stats.c (bitset_log_histogram_print,
9915 bitset_percent_histogram_print, bitset_stats_and,
9916 bitset_stats_and_cmp, bitset_stats_and_or,
9917 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
9918 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
9919 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
9920 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
9921 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
9922 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
9923 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
9924 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
9925 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
9926 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
9927 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
9928 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
9929 bitset_stats_zero): Likewise.
9930 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9931 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9932 bitsetv_dump, debug_bitsetv): Likewise.
9933 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
9934 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
9935 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
9936 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
9937 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
9938 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
9939 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
9940 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
9941 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
9942 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
9943 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
9944 Likewise.
9945 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
9946 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
9947 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
9948 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
9949 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
9950 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
9951 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
9952 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
9953 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
9954 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
9955 lbitset_xor_cmp, lbitset_zero): Likewise.
9956
9957 2002-10-14 Akim Demaille <akim@epita.fr>
9958
9959 Version 1.75.
9960
9961 2002-10-14 Akim Demaille <akim@epita.fr>
9962
9963 * tests/Makefile.am (maintainer-check-posix): New.
9964
9965 2002-10-14 Akim Demaille <akim@epita.fr>
9966
9967 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
9968 member.
9969
9970 2002-10-14 Akim Demaille <akim@epita.fr>
9971
9972 * src/tables.c (table_ninf_remap): base -> tab.
9973 Reported by Matt Rosing.
9974
9975 2002-10-14 Paul Eggert <eggert@twinsun.com>
9976
9977 * tests/action.at, tests/calc.at, tests/conflicts.at,
9978 tests/cxx-type.at, tests/headers.at, tests/input.at,
9979 tests/regression.at, tests/synclines.at, tests/torture.at:
9980 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
9981 so that the tests still work even if POSIXLY_CORRECT is set.
9982 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
9983
9984 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
9985 for portability to K&R hosts. Fix typo: signed char is guaranteed
9986 only to 127, not to 128.
9987 * data/glr.c (yysigned_char): New type.
9988 * data/yacc.c (yysigned_char): Likewise.
9989 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
9990
9991 2002-10-13 Paul Eggert <eggert@twinsun.com>
9992
9993 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
9994 true due to limited range of data type" warning from GCC.
9995
9996 * data/c.m4 (b4_token_defines): Protect against double-inclusion
9997 by wrapping enum yytokentype's definition inside #ifndef
9998 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
9999
10000 2002-10-13 Akim Demaille <akim@epita.fr>
10001
10002 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
10003 Un yy- yyrhs to avoid the name clash with the global YYRHS.
10004
10005 2002-10-13 Akim Demaille <akim@epita.fr>
10006
10007 * Makefile.maint: Update from Autoconf 2.54.
10008 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
10009
10010 2002-10-13 Akim Demaille <akim@epita.fr>
10011
10012 * src/print.c (print_state): Separate the list of solved conflicts
10013 from the other items.
10014 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
10015
10016 2002-10-13 Akim Demaille <akim@epita.fr>
10017
10018 Let nondeterministic skeletons be usable with deterministic
10019 tables.
10020
10021 With the patch, GAWK compiled by GCC without -O2 passes its test
10022 suite using a GLR parser driven by LALR tables. It fails with -O2
10023 because `struct stat' gives two different answers on my machine:
10024 88 (definition of an auto var) and later 96 (memset on this var).
10025 Hence the stack is badly corrumpted. The headers inclusion is to
10026 blame: if I move the awk.h inclusion before GLR's system header
10027 inclusion, the two struct stat have the same size.
10028
10029 * src/tables.c (pack_table): Always create conflict_table.
10030 (token_actions): Always create conflict_list.
10031 * data/glr.c (YYFLAG): Remove, unused.
10032
10033 2002-10-13 Akim Demaille <akim@epita.fr>
10034
10035 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
10036 (O0FLAGS): New.
10037 (VALGRIND, GXX): New.
10038 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
10039 * tests/bison.in: Run $PREBISON a pre-command.
10040 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
10041 (maintainer-check-g++): New.
10042 * Makefile.am (maintainer-check): New.
10043
10044 2002-10-13 Akim Demaille <akim@epita.fr>
10045
10046 * data/glr.c: Formatting changes.
10047 Tweak some trace messages to match yacc.c's.
10048
10049 2002-10-13 Akim Demaille <akim@epita.fr>
10050
10051 GLR parsers sometimes raise parse errors instead of performing the
10052 default reduction.
10053 Reported by Charles-Henry de Boysson.
10054
10055 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
10056 check the length of the traces when %glr.
10057 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
10058 GLR's traces.
10059 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
10060 Test GLR parsers.
10061 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
10062 (yyltype): Remove the yy prefix from the member names.
10063 (yytable): Complete its comment.
10064 (yygetLRActions): Map error action number from YYTABLE from
10065 YYTABLE_NINF to 0.
10066 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
10067 (which was a bug: it should have been YYTABEL_NINF, and yet it was
10068 not satisfying as we could compare an YYACTION computed from
10069 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
10070 only value for error actions.
10071 (yyreportParseError): In verbose parse error messages, don't issue
10072 `error' in the list of expected tokens.
10073 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
10074 next action to perform to match glr.c's decoding.
10075 (yytable): Complete its comment.
10076
10077 2002-10-13 Paul Eggert <eggert@twinsun.com>
10078
10079 Fix problem reported by Henrik Grubbstroem in
10080 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
10081 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
10082 because the Bison parser reads the second action before reducing
10083 the first one.
10084 * src/scan-gram.l (rule_length): New static var.
10085 Use it to keep track of the rule length in the scanner, since
10086 we can't expect the parser to be in lock-step sync with the scanner.
10087 (handle_action_dollar, handle_action_at): Use this var.
10088 * tests/actions.at (Exotic Dollars): Test for the problem.
10089
10090 2002-10-12 Paul Eggert <eggert@twinsun.com>
10091
10092 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
10093 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
10094 Include <sys/time.h> when checking for clock_t and struct tms.
10095 Use same include order as source.
10096 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
10097 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
10098
10099 * lib/timevar.c: Update copyright date and clarify comments.
10100 (get_time) [IN_GCC]: Keep the GCC version for reference.
10101
10102 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
10103 GCC version as of today, then merge Bison's changes.
10104 Change "GCC" to "Bison" in copyright notice. timevar.def's
10105 author is Akim, so change that too.
10106
10107 * src/reader.c (grammar_current_rule_check):
10108 Don't worry about the default action if $$ is untyped.
10109 Prevents bogus warnings reported by Jim Gifford in
10110 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
10111
10112 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
10113 * data/glr.c, data/lalr1.cc, data/yacc.c:
10114 Output token definitions before the first part of user declarations.
10115 Fixes compatibility problem reported by Jim Gifford for kbd in
10116 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
10117
10118 2002-10-11 Paul Eggert <eggert@twinsun.com>
10119
10120 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
10121 (yyparse): here. This undoes some of the 2002-07-25 change.
10122 Compatibility problem reported by Ralf S. Engelschall with
10123 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
10124
10125 2002-10-11 Akim Demaille <akim@epita.fr>
10126
10127 * tests/regression.at Characters Escapes): New.
10128 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
10129 characters.
10130 Reported by Jan Nieuwenhuizen.
10131
10132 2002-10-11 Akim Demaille <akim@epita.fr>
10133
10134 * po/id.po: New.
10135
10136 2002-10-10 Paul Eggert <eggert@twinsun.com>
10137
10138 Portability fixes for bitsets; this also avoids several GCC
10139 warnings.
10140
10141 * lib/abitset.c: Include <stddef.h>, for offsetof.
10142 * lib/lbitset.c: Likewise.
10143
10144 * lib/abitset.c (abitset_bytes): Return a size that is aligned
10145 properly for vectors of objects. Do not assume that adding a
10146 header size to a multiple of a word size yields a value that is
10147 properly aligned for the whole union.
10148 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10149
10150 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
10151 unique names for structures.
10152 * lib/ebitset.c (ebitset_bytes): Likewise.
10153 * lib/lbitset.c (lbitset_bytes): Likewise.
10154
10155 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
10156 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
10157 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
10158 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
10159 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
10160 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
10161 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
10162 to improve the type-checking that GCC can do.
10163 * lib/bitset.c (bitset_op4_cmp): Likewise.
10164 * lib/bitset_stats.c (bitset_stats_count,
10165 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
10166 bitset_stats_copy, bitset_stats_disjoint_p,
10167 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
10168 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
10169 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
10170 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
10171 bitset_stats_and_or_cmp, bitset_stats_andn_or,
10172 bitset_stats_andn_or_cmp, bitset_stats_or_and,
10173 bitset_stats_or_and_cmp): Likewise.
10174 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
10175 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
10176 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
10177 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
10178
10179 * lib/abitset.h: Include bitset.h, not bbitset.h.
10180 * lib/ebitset.h: Likewise.
10181 * lib/lbitset.h: Likewise.
10182
10183 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
10184 All instances of parameters of type enum bitset_opts are now of
10185 type enum_bitset_opts, to conform to the C Standard, and similarly
10186 for enum_bitset_type.
10187 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
10188 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
10189
10190 Do not use "struct bitset_struct" to mean different things in
10191 different modules. Not only is this confusing, it violates
10192 the C Standard, which requires that structure types in different
10193 modules must be compatible if one is to be passed to the other.
10194 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
10195 All instances of "struct bitset_struct *" replaced with "bitset".
10196 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
10197 (union bitset_union, struct abitset_struct, struct ebitset_struct,
10198 struct lbitset_struct, struct bitset_stats_struct): New types.
10199 All uses of struct bitset_struct changed to union bitset_union,
10200 etc.
10201 * lib/abitset.c (struct abitset_struct, abitset,
10202 struct bitset_struct): Remove.
10203 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
10204 struct bitset_struct): Remove.
10205 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
10206 bitset_struct): Remove.
10207 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
10208 Likewise.
10209
10210 Do not call a function of type T using a call that assumes the
10211 function is of a different type U. Standard C requires that a
10212 function must be called with a type that is compatible with its
10213 definition.
10214 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
10215 New decls.
10216 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
10217 New functions.
10218 * lib/ebitset.c (PFV): Remove.
10219 * lib/lbitset.c (PFV): Likewise.
10220 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
10221 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
10222 decls.
10223 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
10224 (ebitset_vtable): Use them.
10225 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
10226 lbitset_xor): New functions.
10227 (lbitset_vtable): Use them.
10228
10229 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
10230 Declare.
10231
10232 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
10233 GCC warning.
10234 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
10235 Use offsetof, for simplicity.
10236
10237 2002-10-06 Paul Eggert <eggert@twinsun.com>
10238
10239 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
10240 the same width as int. This reapplies a hunk of the 2002-08-12 patch
10241 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
10242 which was inadvertently undone by the 2002-09-30 patch.
10243 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
10244 the same width as int.
10245
10246 2002-10-04 Paul Eggert <eggert@twinsun.com>
10247
10248 Version 1.50.
10249
10250 * configure.ac (AC_INIT), NEWS: Increment version number.
10251
10252 * doc/bison.texinfo: Minor spelling, grammar, and white space
10253 fixes.
10254 (Symbols): Mention that any negative value returned from yylex
10255 signifies end-of-input. Warn about negative chars. Mention
10256 the portable Standard C character set.
10257
10258 The GNU coding standard says CFLAGS and YFLAGS are reserved
10259 for the installer to set.
10260 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
10261 * src/Makefile.am (AM_CFLAGS): Likewise.
10262 (AM_YFLAGS): Renamed from YFLAGS.
10263
10264 Fix some MAX and MIN problems.
10265 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
10266 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
10267 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
10268 * src/reader.c (reader): Use it.
10269
10270 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
10271 POSIX 1003.1-2001 has removed fgrep.
10272
10273 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
10274
10275 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
10276 interpreted as signed.
10277 * lib/ebitset.c (ebitset_list): Fix bug.
10278
10279 2002-10-01 Paul Eggert <eggert@twinsun.com>
10280
10281 More fixes for 64-bit hosts and large bitsets.
10282
10283 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
10284 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
10285 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
10286 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
10287 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
10288 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
10289 bitset_count_): Likewise.
10290 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
10291 bitset_first, bitset_last): Likewise.
10292 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
10293 bitset_stats_list_reverse, bitset_stats_size,
10294 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
10295 Likewise.
10296 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10297 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
10298 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
10299 bitsetv_reflexive_transitive_closure): Likewise.
10300 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
10301 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
10302 Likewise.
10303 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
10304 Likewise.
10305
10306 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
10307 Use size_t, not unsigned int, to count bytes.
10308 * lib/abitset.h (abitset_bytes): Likewise.
10309 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
10310 Likewise.
10311 * lib/bitset.h (bitset_bytes): Likewise.
10312 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
10313 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
10314 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10315 * lib/ebitset.c (ebitset_bytes): Likewise.
10316 * lib/ebitset.h (ebitset_bytes): Likewise.
10317 * lib/lbitset.c (lbitset_bytes): Likewise.
10318 * lib/lbitset.h (lbitset_bytes): Likewise.
10319
10320 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
10321 abitset_subset_p, abitset_disjoint_p, abitset_and,
10322 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
10323 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
10324 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
10325 abitset_or_and, abitset_or_and_cmp):
10326 Use bitset_windex instead of unsigned int.
10327 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
10328 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
10329 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
10330 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
10331 Likewise.
10332 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
10333
10334 * lib/bitset.c (bitset_print):
10335 Use proper printf formats for widths of integer types.
10336 * lib/bitset_stats.c (bitset_percent_histogram_print,
10337 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
10338 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
10339 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
10340 * lib/lbitset.c (lbitset_bytes): Likewise.
10341
10342 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
10343 BITSET_SIZE_MAX): New macros.
10344 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
10345 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
10346 to BITSET_WINDEX_MAX.
10347
10348 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
10349 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
10350 since we now return the bitset_bindex type (not int).
10351
10352 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
10353 when computing sizes.
10354 * lib/ebitset.c (ebitset_elts_grow): Likewise.
10355
10356 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
10357 and avoid cast to unsigned.
10358
10359 2002-09-30 Akim Demaille <akim@epita.fr>
10360
10361 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
10362 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
10363 Updates from Michael Hayes.
10364
10365 2002-09-30 Art Haas <ahaas@neosoft.com>
10366
10367 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
10368 invocations.
10369 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
10370 defined.
10371
10372 2002-09-27 Akim Demaille <akim@epita.fr>
10373
10374 Version 1.49c.
10375
10376 2002-09-27 Akim Demaille <akim@epita.fr>
10377
10378 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
10379 (Because of AC_LIBSOURCE).
10380
10381 2002-09-27 Akim Demaille <akim@epita.fr>
10382
10383 Playing with Autoscan.
10384
10385 * configure.ac: Remove the old LIBOBJ tweaks.
10386 (AC_REPLACE_FUNCS): Add strrchr and strtol.
10387 * lib/strrchr.c: New.
10388 * lib/strtol.c: New, from the Coreutils 4.5.1.
10389
10390 2002-09-27 Akim Demaille <akim@epita.fr>
10391
10392 Playing with Autoscan.
10393
10394 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
10395 * lib/Makefile.am (libbison_a_SOURCES): No longer include
10396 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
10397 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
10398 Coreutils 4.5.1.
10399
10400 2002-09-24 Akim Demaille <akim@epita.fr>
10401
10402 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
10403 (Frequently Asked Questions, Parser Stack Overflow): New.
10404
10405 2002-09-13 Akim Demaille <akim@epita.fr>
10406
10407 Playing with autoscan.
10408
10409 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
10410 * src/files.c (skeleton_find): Remove, unused.
10411 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
10412 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
10413
10414 2002-09-13 Akim Demaille <akim@epita.fr>
10415
10416 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
10417 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
10418
10419 2002-09-13 Akim Demaille <akim@epita.fr>
10420
10421 * configure.ac: Require 2.54.
10422 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
10423 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
10424 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
10425 Remove, provided by Autoconf macros.
10426
10427 2002-09-12 Akim Demaille <akim@epita.fr>
10428
10429 * m4/prereq.m4: Update, from Coreutils 4.5.1.
10430
10431 2002-09-12 Akim Demaille <akim@epita.fr>
10432
10433 * m4/prereq.m4: Update, from Fileutils 4.1.5.
10434 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
10435 Reported by Martin Mokrejs.
10436
10437 2002-09-10 Akim Demaille <akim@epita.fr>
10438
10439 * src/parse-gram.y: Associate a human readable string to each
10440 token type.
10441 * tests/regression.at (Invalid inputs): Adjust.
10442
10443 2002-09-10 Gary V. Vaughan <gary@gnu.org>
10444
10445 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
10446 with an Autoconf-2.5x style configure.ac.
10447
10448 2002-09-06 Paul Eggert <eggert@twinsun.com>
10449
10450 * doc/bison.texinfo (Conditions): Make explicit that the GPL
10451 exception applies only to yacc.c. This is a modification of a
10452 patch originally suggested by Akim Demaille.
10453
10454 2002-09-06 Akim Demaille <akim@epita.fr>
10455
10456 * data/c.m4 (b4_copyright): Move the GPL exception comment from
10457 here to...
10458 * data/yacc.c: here.
10459
10460 * data/lalr1.cc (struct yyltype): Don't define it, since we use
10461 LocationType.
10462 (b4_ltype): Default to yy::Location from location.hh.
10463
10464 2002-09-04 Jim Meyering <jim@meyering.net>
10465
10466 * data/yacc.c: Guard the declaration of yytoknum also with
10467 `#ifdef YYPRINT', so it is declared only when used.
10468
10469 2002-09-04 Akim Demaille <akim@epita.fr>
10470
10471 * configure.in: Rename as...
10472 * configure.ac: this.
10473 Bump to 1.49c.
10474
10475 2002-09-04 Akim Demaille <akim@epita.fr>
10476
10477 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
10478 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
10479 translate maintainer only messages.
10480
10481 2002-08-12 Paul Eggert <eggert@twinsun.com>
10482
10483 Version 1.49b.
10484
10485 * Makefile.am (SUBDIRS): Remove intl.
10486 (DISTCLEANFILES): Remove.
10487 * NEWS: Mention that GNU M4 is now required. Clarify what is
10488 meant by "larger grammars". Mention the pt_BR translation.
10489 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
10490 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
10491 Bump version from 0.11.2 to 0.11.5.
10492 (BISON_PREREQ_STAGE): Remove.
10493 (AM_GNU_GETTEXT): Use external gettext.
10494 (AC_OUTPUT): Remove intl/Makefile.
10495
10496 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
10497
10498 * data/glr.c: Include string.h, for strlen.
10499 (yyreportParseError): Use size_t for yysize.
10500 (yy_yypstack): No longer nested inside yypstates, as nested
10501 functions are not portable. Do not assume size_t is the
10502 same width as int.
10503 (yypstates): Do not assume that ptrdiff_t is the same width
10504 as int, and similarly for yyposn and YYINDEX.
10505
10506 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
10507
10508 * lib/Makefile.am (INCLUDES): Do not include from the intl
10509 directory, which has been removed.
10510 * src/Makefile.am (INCLUDES): Likewise.
10511
10512 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
10513 (bitsets_sources, additional_bitsets_sources, timevars_sources):
10514 New vars.
10515
10516 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
10517 * tests/Makefile.am (EXTRA_DIST): Likewise.
10518
10519 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
10520 Do not assume that bitset_windex is the same width as unsigned.
10521
10522 * lib/abitset.c (abitset_unused_clear): Do not assume that
10523 bitset_word is the same width as int.
10524 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
10525 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
10526 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
10527 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
10528 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
10529
10530 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
10531 portability to one's complement hosts!).
10532 * lib/ebitset.c (ebitset_op1): Likewise.
10533 * lib/lbitset.c (lbitset_op1): Likewise.
10534
10535 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
10536 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
10537 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
10538 Sync with fileutils.
10539 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
10540 lib/gettext.h: Sync with diffutils.
10541
10542 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
10543 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
10544
10545 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
10546 PROTOTYPES to check for prototypes, and "defined __STDC__" to
10547 check for void *.
10548
10549 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
10550 size_t; the old version tried to do this but casted improperly.
10551 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
10552 (bitset_test): Now returns int, not unsigned long.
10553
10554 * lib/bitset_stats.c: Include "gettext.h".
10555 (_): New macro.
10556 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
10557 name locals "index", as it generates unnecessary warnings on some
10558 hosts that have an "index" function.
10559
10560 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
10561 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
10562 they need translation.
10563 * src/LR0.c (state_list_append, new_itemsets, get_state,
10564 append_states, generate_states): Likewise.
10565 * src/assoc.c (assoc_to_string): Likewise.
10566 * src/closure.c (print_closure, set_firsts, closure): Likewise.
10567 * src/gram.c (grammar_dump): Likewise.
10568 * src/injections.c (injections_compute): Likewise.
10569 * src/lalr.c (lookaheads_print): Likewise.
10570 * src/relation.c (relation_transpose): Likewise.
10571 * src/scan-gram.l: Likewise.
10572 * src/tables.c (table_grow, pack_vector): Likewise.
10573
10574 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
10575 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
10576 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
10577 * m4/mbstate_t.m4: Sync with fileutils.
10578 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
10579
10580 * po/LINGUAS: Add pt_BR.
10581 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
10582 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
10583 lib/timevar.c.
10584 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
10585 manual recommends.
10586 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
10587
10588 * src/complain.c (strerror_r): Remove decl; not needed.
10589 (strerror): Use same pattern as ../lib/error.c.
10590
10591 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
10592
10593 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
10594
10595 * src/main.c (main): Cast result of bindtextdomain and textdomain
10596 to void, to avoid a GCC warning when --disable-nls is in effect.
10597
10598 * src/scan-gram.l: Use strings rather than escapes when possible,
10599 to minimize the number of warnings from xgettext.
10600 (handle_action_dollar, handle_action_at): Don't use isdigit,
10601 as it mishandles negative chars and it may not work as expected
10602 outside the C locale.
10603
10604 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
10605 this is a GCC extension and is not portable to other compilers.
10606
10607 * src/system.h (alloca): Use same pattern as ../lib/error.c.
10608 Do not include <ctype.h>; no longer needed.
10609 Do not include <malloc.h>; no longer needed (and generates
10610 warnings on OpenBSD 3.0).
10611
10612 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
10613 it's not portable.
10614
10615 * tests/regression.at: Do not use 'cc -c input.c -o input';
10616 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
10617
10618 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
10619 exit status as failure, not just exit status 1. Sun C exits
10620 with status 2 sometimes.
10621
10622 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
10623 Use it for the two large tests.
10624
10625 2002-08-02 Akim Demaille <akim@epita.fr>
10626
10627 * src/conflicts.c (conflicts_output): Don't output rules never
10628 reduced here, since anyway that computation doesn't work.
10629 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
10630 (rule_useless_p, rule_never_reduced_p): New.
10631 (grammar_rules_partial_print): Use a filter instead of a range.
10632 Display the title only if needed.
10633 (grammar_rules_print): Adjust.
10634 (grammar_rules_never_reduced_report): New.
10635 * src/tables.c (action_row): Move the computation of rules never
10636 reduced to...
10637 (token_actions): here.
10638 * src/main.c (main): Make the parser before making the report, so
10639 that rules never reduced are computed.
10640 Call grammar_rules_never_reduced_report.
10641 * src/print.c (print_results): Report rules never reduced.
10642 * tests/conflicts.at, tests/reduce.at: Adjust.
10643
10644 2002-08-01 Akim Demaille <akim@epita.fr>
10645
10646 Instead of attaching lookaheads and duplicating the rules being
10647 reduced by a state, attach the lookaheads to the reductions.
10648
10649 * src/state.h (state_t): Remove the `lookaheads',
10650 `lookaheads_rule' member.
10651 (reductions_t): Add a `lookaheads' member.
10652 Use a regular array for the `rules'.
10653 * src/state.c (reductions_new): Initialize the lookaheads member
10654 to 0.
10655 (state_rule_lookaheads_print): Adjust.
10656 * src/state.h, src/state.c (state_reductions_find): New.
10657 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
10658 (count_rr_conflicts): Adjust.
10659 * src/lalr.c (LArule): Remove.
10660 (add_lookback_edge): Adjust.
10661 (state_lookaheads_count): New.
10662 (states_lookaheads_initialize): Merge into...
10663 (initialize_LA): this.
10664 (lalr_free): Adjust.
10665 * src/main.c (main): Don't free nullable and derives too early: it
10666 is used by --verbose.
10667 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
10668
10669 2002-08-01 Akim Demaille <akim@epita.fr>
10670
10671 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
10672 `rule_number_t**'.
10673 (set_derives, free_derives): Rename as...
10674 (derives_compute, derives_free): this.
10675 Adjust all dependencies.
10676 * src/nullable.c (set_nullable, free_nullable): Rename as...
10677 (nullable_compute, nullable_free): these.
10678 (rule_list_t): Store rule_t *, not rule_number_t.
10679 * src/state.c (state_rule_lookaheads_print): Directly compare rule
10680 pointers, instead of their numbers.
10681 * src/main.c (main): Call nullable_free, and derives_free earlier,
10682 as they were lo longer used.
10683
10684 2002-08-01 Akim Demaille <akim@epita.fr>
10685
10686 * lib/timevar.c (get_time): Include children time.
10687 * src/lalr.h (LA, LArule): Don't export them: used with the
10688 state_t.
10689 * src/lalr.c (LA, LArule): Static.
10690 * src/lalr.h, src/lalr.c (lalr_free): New.
10691 * src/main.c (main): Call it.
10692 * src/tables.c (pack_vector): Check whether loc is >= to the
10693 table_size, not >.
10694 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
10695 (tables_generate): do it, since that's also it which allocates
10696 them.
10697 Don't free LA and LArule, main does.
10698
10699 2002-07-31 Akim Demaille <akim@epita.fr>
10700
10701 Separate parser tables computation and output.
10702
10703 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
10704 (conflict_list, conflict_list_cnt, table, check, table_ninf)
10705 (yydefgoto, yydefact, high): Move to...
10706 * src/tables.h, src/tables.c: here.
10707 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
10708 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
10709 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
10710 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
10711 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
10712 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
10713 (action_row, save_row, token_actions, save_column, default_goto)
10714 (goto_actions, sort_actions, matching_state, pack_vector)
10715 (table_ninf_remap, pack_table, prepare_actions): Move to...
10716 * src/tables.c: here.
10717 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
10718 * src/output.c (token_actions, output_base, output_conflicts)
10719 (output_check): Merge into...
10720 (prepare_actions): this.
10721 (actions_output): Rename as...
10722 (user_actions_output): this.
10723 * src/main.c (main): Call tables_generate and tables_free.
10724
10725 2002-07-31 Akim Demaille <akim@epita.fr>
10726
10727 Steal GCC's --time-report support.
10728
10729 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
10730 stolen/adjusted from GCC.
10731 * m4/stage.m4: Remove time related checks.
10732 * m4/timevar.m4: New.
10733 * configure.in: Adjust.
10734 * src/system.h: Adjust to using timevar.h.
10735 * src/getargs.h, src/getargs.c: Support trace_time for
10736 --trace=time.
10737 * src/main.c (stage): Remove.
10738 (main): Replace `stage' invocations with timevar calls.
10739 * src/output.c: Insert pertinent timevar calls.
10740
10741 2002-07-31 Akim Demaille <akim@epita.fr>
10742
10743 Let --trace have arguments.
10744
10745 * src/getargs.h (enum trace_e): New.
10746 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
10747 (long_options, short_options): --trace/-T takes an optional
10748 argument.
10749 Change all the uses of trace_flag to reflect the new flags.
10750 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
10751
10752 Strengthen `stage' portability.
10753
10754 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
10755 * configure.in: Use it.
10756 Don't check for malloc.h and sys/times.h.
10757 * src/system.h: Include them when appropriate.
10758 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
10759 times and struct tms are available.
10760
10761 2002-07-30 Akim Demaille <akim@epita.fr>
10762
10763 In verbose parse error message, don't report `error' as an
10764 expected token.
10765 * tests/actions.at (Printers and Destructors): Adjust.
10766 * tests/calc.at (Calculator $1): Adjust.
10767 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
10768 error message, do not report the parser accepts the error token in
10769 that state.
10770
10771 2002-07-30 Akim Demaille <akim@epita.fr>
10772
10773 Normalize conflict related messages.
10774
10775 * src/complain.h, src/complain.c (warn, complain): New.
10776 * src/conflicts.c (conflicts_print): Use them.
10777 (conflict_report_yacc): New, extracted from...
10778 (conflicts_print): here.
10779 * tests/conflicts.at, tests/existing.at: Adjust.
10780
10781 2002-07-30 Akim Demaille <akim@epita.fr>
10782
10783 Report rules which are never reduced by the parser: those hidden
10784 by conflicts.
10785
10786 * src/LR0.c (save_reductions): Don't make the final state too
10787 different: save its reduction (accept) instead of having a state
10788 without any action (no shift or goto, no reduce).
10789 Note: the final state is now a ``regular'' state, i.e., the
10790 parsers now contain `reduce 0' as default reduction.
10791 Nevertheless, since they decide to `accept' when yystate =
10792 final_state, they still will not reduce rule 0.
10793 * src/print.c (print_actions, print_reduction): Adjust.
10794 * src/output.c (action_row): Track reduced rules.
10795 (token_actions): Report rules never reduced.
10796 * tests/conflicts.at, tests/regression.at: Adjust.
10797
10798 2002-07-30 Akim Demaille <akim@epita.fr>
10799
10800 `stage' was accidently included in a previous patch.
10801 Initiate its autoconfiscation.
10802
10803 * configure.in: Look for malloc.h and sys/times.h.
10804 * src/main.c (stage): Adjust.
10805 Report only when trace_flag.
10806
10807 2002-07-29 Akim Demaille <akim@epita.fr>
10808
10809 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
10810 state_number_t.
10811 (errs_t): symbol_t*, not symbol_number_t.
10812 (reductions_t): rule_t*, not rule_number_t.
10813 (FOR_EACH_SHIFT): New.
10814 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
10815 * src/print.c, src/print_graph.c: Adjust.
10816
10817 2002-07-29 Akim Demaille <akim@epita.fr>
10818
10819 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
10820
10821 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
10822 (endtoken, accept): these.
10823 * src/reader.c (reader): Set endtoken's default tag to "$end".
10824 Set undeftoken's tag to "$undefined" instead of "$undefined.".
10825 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
10826 Adjust.
10827
10828 2002-07-29 Akim Demaille <akim@epita.fr>
10829
10830 * src/reduce.c (reduce_grammar): When the language is empty,
10831 complain about the start symbol, not the axiom.
10832 Use its location.
10833 * tests/reduce.at (Empty Language): New.
10834
10835 2002-07-26 Akim Demaille <akim@epita.fr>
10836
10837 * src/reader.h, src/reader.c (gram_error): ... can't get
10838 yycontrol without making too strong assumptions on the parser
10839 itself.
10840 * src/output.c (prepare_tokens): Use the real 0th value of
10841 token_translations instead of `0'.
10842 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
10843 visible here.
10844 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
10845 for the time being: %locations ought to provide it to yyerror.
10846
10847 2002-07-25 Akim Demaille <akim@epita.fr>
10848
10849 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
10850 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
10851 * tests/regression.at (Web2c Actions): Adjust.
10852
10853 2002-07-25 Akim Demaille <akim@epita.fr>
10854
10855 Stop storing rules from 1 to nrules + 1.
10856
10857 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
10858 * src/nullable.c, src/output.c, src/print.c, src/reader.c
10859 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
10860 Iterate from 0 to nrules.
10861 Use rule_number_as_item_number and item_number_as_rule_number.
10862 Adjust to `derive' now containing possibly 0.
10863 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
10864 Handle the `- 1' part in rule numbers from/to item numbers.
10865 * src/conflicts.c (log_resolution): Fix the message which reversed
10866 shift and reduce.
10867 * src/output.c (action_row): Initialize default_rule to -1.
10868 (token_actions): Adjust.
10869 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
10870 expected output.
10871 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
10872
10873 2002-07-25 Akim Demaille <akim@epita.fr>
10874
10875 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
10876 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
10877 (b4_c_knr_arg_decl): New.
10878 * data/yacc.c: Use it to define yysymprint, yydestruct, and
10879 yyreport_parse_error.
10880
10881 2002-07-25 Akim Demaille <akim@epita.fr>
10882
10883 * data/yacc.c (yyreport_parse_error): New, extracted from...
10884 (yyparse): here.
10885 (yydestruct, yysymprint): Move above yyparse.
10886 Be K&R compliant.
10887
10888 2002-07-25 Akim Demaille <akim@epita.fr>
10889
10890 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
10891 replace...
10892 (b4_sint_type, b4_uint_type): these.
10893 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
10894 * tests/regression.at (Web2c Actions): Adjust.
10895
10896 2002-07-25 Akim Demaille <akim@epita.fr>
10897
10898 * src/gram.h (TIEM_NUMBER_MAX): New.
10899 (item_number_of_rule_number, rule_number_of_item_number): Rename
10900 as...
10901 (rule_number_as_item_number, item_number_as_rule_number): these.
10902 Adjust dependencies.
10903 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
10904 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
10905 (symbol_number_to_vector_number): New.
10906 (order): Of vector_number_t* type.
10907 (base_t, BASE_MAX, BASE_MIN): New.
10908 (froms, tos, width, pos, check): Of base_t type.
10909 (action_number_t, ACTION_MIN, ACTION_MAX): New.
10910 (actrow): Of action_number_t type.
10911 (conflrow): Of unsigned int type.
10912 (table_ninf, base_ninf): New.
10913 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
10914 (muscle_insert_int_table, muscle_insert_base_table)
10915 (muscle_insert_rule_number_table): New.
10916 (prepare_tokens): Output `toknum' as int_table.
10917 (action_row): Returns a rule_number_t.
10918 Use ACTION_MIN, not SHRT_MIN.
10919 (token_actions): yydefact is rule_number_t*.
10920 (table_ninf_remap): New.
10921 (pack_table): Use it for `base' and `table'.
10922 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
10923 replaced with...
10924 (YYPACT_NINF, YYTABLE_NINF): these.
10925 (yypact, yytable): Compute their types instead of hard-coded
10926 `short'.
10927 * tests/regression.at (Web2c Actions): Adjust.
10928
10929 2002-07-19 Akim Demaille <akim@epita.fr>
10930
10931 * src/scan-gram.l (id): Can start with an underscore.
10932
10933 2002-07-16 Akim Demaille <akim@epita.fr>
10934
10935 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
10936 Adjust all former `associativity' dependencies.
10937 * src/symtab.c (symbol_new): Default associativity is `undef', not
10938 `right'.
10939 (symbol_check_alias_consistence): Adjust.
10940
10941 2002-07-09 Akim Demaille <akim@epita.fr>
10942
10943 * doc/bison.texinfo: Properly set the ``header'' part.
10944 Use @dircategory ``GNU programming tools'' as per Texinfo's
10945 documentation.
10946 Use @copying.
10947
10948 2002-07-09 Akim Demaille <akim@epita.fr>
10949
10950 * lib/quotearg.h: Protect against multiple inclusions.
10951 * src/location.h (location_t): Add a `file' member.
10952 (LOCATION_RESET, LOCATION_PRINT): Adjust.
10953 * src/complain.c (warn_at, complain_at, fatal_at): Drop
10954 `error_one_per_line' support.
10955
10956 2002-07-09 Akim Demaille <akim@epita.fr>
10957
10958 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
10959 * src/reader.c (lineno): Remove.
10960 Adjust all dependencies.
10961 (get_merge_function): Take a location and use complain_at.
10962 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
10963 * tests/regression.at (Invalid inputs, Mixing %token styles):
10964 Adjust.
10965
10966 2002-07-09 Akim Demaille <akim@epita.fr>
10967
10968 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
10969 recovery rule, and forbid extensions when --yacc.
10970 (gram_error): Use complain_at.
10971 * src/reader.c (reader): Exit if there were parse errors.
10972
10973 2002-07-09 Akim Demaille <akim@epita.fr>
10974
10975 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
10976 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
10977 Reported by R Blake <blakers@mac.com>.
10978
10979 2002-07-09 Akim Demaille <akim@epita.fr>
10980
10981 * data/yacc.c: Output the copyright notive in the header.
10982
10983 2002-07-03 Akim Demaille <akim@epita.fr>
10984
10985 * src/output.c (froms, tos): Are state_number_t.
10986 (save_column): sp, sp1, and sp2 are state_number_t.
10987 (prepare): Rename `final' as `final_state_number', `nnts' as
10988 `nterms_number', `nrules' as `rules_number', `nstates' as
10989 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
10990 unused.
10991 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
10992 * data/lalr1.cc (nsym_): Remove, unused.
10993
10994 2002-07-03 Akim Demaille <akim@epita.fr>
10995
10996 * src/lalr.h, src/lalr.c (goto_number_t): New.
10997 * src/lalr.c (goto_list_t): New.
10998 Propagate them.
10999 * src/nullable.c (rule_list_t): New.
11000 Propagate.
11001 * src/types.h: Remove.
11002
11003 2002-07-03 Akim Demaille <akim@epita.fr>
11004
11005 * src/closure.c (print_fderives): Use rule_rhs_print.
11006 * src/derives.c (print_derives): Use rule_rhs_print.
11007 (rule_list_t): New, replaces `shorts'.
11008 (set_derives): Add comments.
11009 * tests/sets.at (Nullable, Firsts): Adjust.
11010
11011 2002-07-03 Akim Demaille <akim@epita.fr>
11012
11013 * src/output.c (prepare_actions): Free `tally' and `width'.
11014 (prepare_actions): Allocate and free `order'.
11015 * src/symtab.c (symbols_free): Free `symbols'.
11016 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
11017 * src/output.c (m4_invoke): Move to...
11018 * src/scan-skel.l: here.
11019 (<<EOF>>): Close yyout, and free its name.
11020
11021 2002-07-03 Akim Demaille <akim@epita.fr>
11022
11023 Fix some memory leaks, and fix a bug: state 0 was examined twice.
11024
11025 * src/LR0.c (new_state): Merge into...
11026 (state_list_append): this.
11027 (new_states): Merge into...
11028 (generate_states): here.
11029 (set_states): Don't ensure a proper `errs' state member here, do it...
11030 * src/conflicts.c (conflicts_solve): here.
11031 * src/state.h, src/state.c: Comment changes.
11032 (state_t): Rename member `shifts' as `transitions'.
11033 Adjust all dependencies.
11034 (errs_new): For consistency, also take the values as argument.
11035 (errs_dup): Remove.
11036 (state_errs_set): New.
11037 (state_reductions_set, state_transitions_set): Assert that no
11038 previous value was assigned.
11039 (state_free): New.
11040 (states_free): Use it.
11041 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
11042 temporary storage: use `errs' and `nerrs' as elsewhere.
11043 (set_conflicts): Allocate and free this `errs'.
11044
11045 2002-07-02 Akim Demaille <akim@epita.fr>
11046
11047 * lib/libiberty.h: New.
11048 * lib: Update the bitset implementation from upstream.
11049 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
11050 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
11051 * src/main.c: Adjust bitset stats calls.
11052
11053 2002-07-01 Paul Eggert <eggert@twinsun.com>
11054
11055 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
11056 char, so that negative chars don't collide with $.
11057
11058 2002-06-30 Akim Demaille <akim@epita.fr>
11059
11060 Have the GLR tests be `warning' checked, and fix the warnings.
11061
11062 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
11063 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
11064 (yyremoveDeletes): `yyi' and `yyj' are size_t.
11065 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
11066 (yyaddDeferredAction): static.
11067 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
11068 (yyreportParseError): yyprefix is const.
11069 yytokenp is used only when verbose.
11070 (yy__GNUC__): Replace with __GNUC__.
11071 (yypdumpstack): yyi is size_t.
11072 (yypreference): Un-yy local variables and arguments, to avoid
11073 clashes with `yyr1'. Anyway, we are not in the user name space.
11074 (yytname_size): be an int, as is compared with ints.
11075 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
11076 Use them.
11077 * tests/cxx-gram.at: Use quotation to protect $1.
11078 Use AT_COMPILE to enable warnings hunts.
11079 Prototype yylex and yyerror.
11080 `Use' argc.
11081 Include `string.h', not `strings.h'.
11082 Produce and prototype stmtMerge only when used.
11083 yylex takes a location.
11084
11085 2002-06-30 Akim Demaille <akim@epita.fr>
11086
11087 We spend a lot of time in quotearg, in particular when --verbose.
11088
11089 * src/symtab.c (symbol_get): Store a quoted version of the key.
11090 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
11091 Adjust all callers.
11092
11093 2002-06-30 Akim Demaille <akim@epita.fr>
11094
11095 * src/state.h (reductions_t): Rename member `nreds' as num.
11096 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
11097 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
11098
11099 2002-06-30 Akim Demaille <akim@epita.fr>
11100
11101 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
11102 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
11103 (shifts_to): Rename as...
11104 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
11105 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
11106 (TRANSITION_IS_DISABLED, transitions_to): these.
11107
11108 2002-06-30 Akim Demaille <akim@epita.fr>
11109
11110 * src/print.c (print_shifts, print_gotos): Merge into...
11111 (print_transitions): this.
11112 (print_transitions, print_errs, print_reductions): Align the
11113 lookaheads columns.
11114 (print_core, print_transitions, print_errs, print_state,
11115 print_grammar): Output empty lines separator before, not after.
11116 (state_default_rule_compute): Rename as...
11117 (state_default_rule): this.
11118 * tests/conflicts.at (Defaulted Conflicted Reduction),
11119 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
11120 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
11121
11122 2002-06-30 Akim Demaille <akim@epita.fr>
11123
11124 Display items as we display rules.
11125
11126 * src/gram.h, src/gram.c (rule_lhs_print): New.
11127 * src/gram.c (grammar_rules_partial_print): Use it.
11128 * src/print.c (print_core): Likewise.
11129 * tests/conflicts.at (Defaulted Conflicted Reduction),
11130 (Unresolved SR Conflicts): Adjust.
11131 (Unresolved SR Conflicts): Adjust and rename as...
11132 (Resolved SR Conflicts): this, as was meant.
11133 * tests/regression.at (Web2c Report): Adjust.
11134
11135 2002-06-30 Akim Demaille <akim@epita.fr>
11136
11137 * src/print.c (state_default_rule_compute): New, extracted from...
11138 (print_reductions): here.
11139 Pessimize, but clarify the code.
11140 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
11141
11142 2002-06-30 Akim Demaille <akim@epita.fr>
11143
11144 * src/output.c (action_row): Let default_rule be always a rule
11145 number.
11146
11147 2002-06-30 Akim Demaille <akim@epita.fr>
11148
11149 * src/closure.c (print_firsts, print_fderives, closure):
11150 Use BITSET_EXECUTE.
11151 * src/lalr.c (lookaheads_print): Likewise.
11152 * src/state.c (state_rule_lookaheads_print): Likewise.
11153 * src/print_graph.c (print_core): Likewise.
11154 * src/print.c (print_reductions): Likewise.
11155 * src/output.c (action_row): Likewise.
11156 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
11157
11158 2002-06-30 Akim Demaille <akim@epita.fr>
11159
11160 * src/print_graph.c: Use report_flag.
11161
11162 2002-06-30 Akim Demaille <akim@epita.fr>
11163
11164 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
11165 to...
11166 * src/relation.h, src/relation.c (traverse, relation_digraph)
11167 (relation_print, relation_transpose): New.
11168
11169 2002-06-30 Akim Demaille <akim@epita.fr>
11170
11171 * src/state.h, src/state.c (shifts_to): New.
11172 * src/lalr.c (build_relations): Use it.
11173
11174 2002-06-30 Akim Demaille <akim@epita.fr>
11175
11176 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
11177 (item_number_of_rule_number, rule_number_of_item_number): New.
11178 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
11179 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
11180 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
11181 Propagate their use.
11182 Much remains to be done, in particular wrt `shorts' from types.h.
11183
11184 2002-06-30 Akim Demaille <akim@epita.fr>
11185
11186 * src/symtab.c (symbol_new): Initialize the `printer' member.
11187
11188 2002-06-30 Akim Demaille <akim@epita.fr>
11189
11190 * src/LR0.c (save_reductions): Remove, replaced by...
11191 * src/state.h, src/state.c (state_reductions_set): New.
11192 (reductions, errs): Rename as...
11193 (reductions_t, errs_t): these.
11194 Adjust all dependencies.
11195
11196 2002-06-30 Akim Demaille <akim@epita.fr>
11197
11198 * src/LR0.c (state_list_t, state_list_append): New.
11199 (first_state, last_state): Now symbol_list_t.
11200 (this_state): Remove.
11201 (new_itemsets, append_states, save_reductions): Take a state_t as
11202 argument.
11203 (set_states, generate_states): Adjust.
11204 (save_shifts): Remove, replaced by...
11205 * src/state.h, src/state.c (state_shifts_set): New.
11206 (shifts): Rename as...
11207 (shifts_t): this.
11208 Adjust all dependencies.
11209 * src/state.h (state_t): Remove the `next' member.
11210
11211 2002-06-30 Akim Demaille <akim@epita.fr>
11212
11213 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
11214 escaped in slot 0.
11215
11216 2002-06-30 Akim Demaille <akim@epita.fr>
11217
11218 Use hash.h for the state hash table.
11219
11220 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
11221 (allocate_storage): Use state_hash_new.
11222 (free_storage): Use state_hash_free.
11223 (new_state, get_state): Adjust.
11224 * src/lalr.h, src/lalr.c (states): Move to...
11225 * src/states.h (state_t): Remove the `link' member, no longer
11226 used.
11227 * src/states.h, src/states.c: here.
11228 (state_hash_new, state_hash_free, state_hash_lookup)
11229 (state_hash_insert, states_free): New.
11230 * src/states.c (state_table, state_compare, state_hash): New.
11231 * src/output.c (output_actions): Do not free states now, since we
11232 still need to know the final_state number in `prepare', called
11233 afterwards. Do it...
11234 * src/main.c (main): here: call states_free after `output'.
11235
11236 2002-06-30 Akim Demaille <akim@epita.fr>
11237
11238 * src/state.h, src/state.c (state_new): New, extracted from...
11239 * src/LR0.c (new_state): here.
11240 * src/state.h (STATE_ALLOC): Move to...
11241 * src/state.c: here.
11242 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
11243 * src/state.h, src/state.c: here.
11244
11245 2002-06-30 Akim Demaille <akim@epita.fr>
11246
11247 * src/reader.c (gensym): Rename as...
11248 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
11249 (getsym): Rename as...
11250 (symbol_get): this.
11251
11252 2002-06-30 Akim Demaille <akim@epita.fr>
11253
11254 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
11255 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
11256 * src/output.c, src/print.c, src/print_graph.c: Propagate.
11257 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
11258
11259 2002-06-30 Akim Demaille <akim@epita.fr>
11260
11261 Make the test suite pass with warnings checked.
11262
11263 * tests/actions.at (Printers and Destructors): Improve.
11264 Avoid unsigned vs. signed issues.
11265 * tests/calc.at: Don't exercise the scanner here, do it...
11266 * tests/input.at (Torturing the Scanner): here.
11267
11268 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11269
11270 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
11271 reorganize first lines parallel to yacc.c.
11272
11273 2002-06-28 Akim Demaille <akim@epita.fr>
11274
11275 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
11276 (b4_token_enum, b4_token_defines): New, factored from...
11277 * data/lalr1.cc, data/yacc.c, glr.c: here.
11278
11279 2002-06-28 Akim Demaille <akim@epita.fr>
11280
11281 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
11282 unused variables.
11283 * src/output.c (merger_output): static.
11284
11285 2002-06-28 Akim Demaille <akim@epita.fr>
11286
11287 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
11288 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
11289 pacify GCC.
11290 * src/output.c (save_row): Initialize all the variables to pacify GCC.
11291
11292 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11293
11294 Accumulated changelog for new GLR parsing features.
11295
11296 * src/conflicts.c (count_total_conflicts): Change name to
11297 conflicts_total_count.
11298 * src/conflicts.h: Ditto.
11299 * src/output.c (token_actions): Use the new name.
11300 (output_conflicts): Change conflp => conflict_list_heads, and
11301 confl => conflict_list for better readability.
11302 * data/glr.c: Use the new names.
11303 * NEWS: Add self to GLR announcement.
11304
11305 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
11306
11307 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
11308 Akim Demaille.
11309
11310 * data/bison.glr: Change name to glr.c
11311 * data/glr.c: Renamed from bison.glr.
11312 * data/Makefile.am: Add glr.c
11313
11314 * src/getargs.c:
11315
11316 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
11317 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
11318
11319 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11320
11321 * data/bison.glr: Be sure to restore the
11322 current #line when returning to the skeleton contents after having
11323 exposed the input file's #line.
11324
11325 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11326
11327 * data/bison.glr: Bring up to date with changes to bison.simple.
11328
11329 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11330
11331 * data/bison.glr: Correct definitions that use b4_prefix.
11332 Various reformatting.
11333 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
11334 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
11335 yytokenp argument; now part of stack.
11336 (yychar): Define to behave as documented.
11337 (yyclearin): Ditto.
11338
11339 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11340
11341 * src/reader.h: Add declaration for free_merger_functions.
11342
11343 * src/reader.c (merge_functions): New variable.
11344 (get_merge_function): New function.
11345 (free_merger_functions): New function.
11346 (readgram): Check for %prec that is not followed by a symbol.
11347 Handle %dprec and %merge declarations.
11348 (packgram): Initialize dprec and merger fields in rules array.
11349
11350 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
11351 conflict_list_cnt, conflict_list_free): New variables.
11352 (table_grow): Also grow conflict_table.
11353 (prepare_rules): Output dprec and merger tables.
11354 (conflict_row): New function.
11355 (action_row): Output conflict lists for GLR parser. Don't use
11356 default reduction in conflicted states for GLR parser so that there
11357 are spaces for the conflict lists.
11358 (save_row): Also save conflict information.
11359 (token_actions): Allocate conflict list.
11360 (merger_output): New function.
11361 (pack_vector): Pack conflict table, too.
11362 (output_conflicts): New function to output yyconflp and yyconfl.
11363 (output_check): Allocate conflict_tos.
11364 (output_actions): Output conflict tables, also.
11365 (output_skeleton): Output b4_mergers definition.
11366 (prepare): Output b4_max_rhs_length definition.
11367 Use 'bison.glr' as default skeleton for GLR parsers.
11368
11369 * src/gram.c (glr_parser): New flag.
11370 (grammar_free): Call free_merger_functions.
11371
11372 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
11373 all pairs of conflicting reductions, rather than just all tokens
11374 causing conflicts. Needed to size conflict tables.
11375 (conflicts_output): Modify call to count_rr_conflicts for new
11376 interface.
11377 (conflicts_print): Ditto.
11378 (count_total_conflicts): New function.
11379
11380 * src/reader.h (merger_list): New type.
11381 (merge_functions): New variable.
11382
11383 * src/lex.h (tok_dprec, tok_merge): New token types.
11384
11385 * src/gram.h (rule_s): Add dprec and merger fields.
11386 (glr_parser): New flag.
11387
11388 * src/conflicts.h (count_total_conflicts): New function.
11389
11390 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
11391
11392 * doc/bison.texinfo (Generalized LR Parsing): New section.
11393 (GLR Parsers): New section.
11394 (Language and Grammar): Mention GLR parsing.
11395 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
11396 Correct typo ("tge" -> "the").
11397
11398 * data/bison.glr: New skeleton for GLR parsing.
11399
11400 * tests/cxx-gram.at: New tests for GLR parsing.
11401
11402 * tests/testsuite.at: Include cxx-gram.at.
11403
11404 * tests/Makefile.am: Add cxx-gram.at.
11405
11406 * src/parse-gram.y:
11407
11408 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
11409
11410 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
11411
11412 2002-06-27 Akim Demaille <akim@epita.fr>
11413
11414 * src/options.h, src/options.c: Remove.
11415 * src/getargs.c (short_options, long_options): New.
11416
11417 2002-06-27 Akim Demaille <akim@epita.fr>
11418
11419 * data/bison.simple, data/bison.c++: Rename as...
11420 * data/yacc.c, data/lalr1.cc: these.
11421 * doc/bison.texinfo (Environment Variables): Remove.
11422
11423 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
11424
11425 * src/getargs.c (report_argmatch): Initialize strtok().
11426
11427 2002-06-20 Akim Demaille <akim@epita.fr>
11428
11429 * data/bison.simple (b4_symbol_actions): New, replaces...
11430 (b4_symbol_destructor, b4_symbol_printer): these.
11431 (yysymprint): Be sure to call YYPRINT only for tokens, and using
11432 user token numbers.
11433
11434 2002-06-20 Akim Demaille <akim@epita.fr>
11435
11436 * data/bison.simple (yydestructor): Rename as...
11437 (yydestruct): this.
11438
11439 2002-06-20 Akim Demaille <akim@epita.fr>
11440
11441 * src/symtab.h, src/symtab.c (symbol_type_set)
11442 (symbol_destructor_set, symbol_precedence_set): The location is
11443 the last argument.
11444 Adjust all callers.
11445
11446 2002-06-20 Akim Demaille <akim@epita.fr>
11447
11448 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
11449 internals.
11450 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
11451 Takes a location.
11452 * src/symtab.h, src/symtab.c (symbol_class_set)
11453 (symbol_user_token_number_set): Likewise.
11454 Adjust all callers.
11455 Promote complain_at.
11456 * tests/input.at (Type Clashes): Adjust.
11457
11458 2002-06-20 Akim Demaille <akim@epita.fr>
11459
11460 * data/bison.simple (YYLEX): Fix the declaration when
11461 %pure-parser.
11462
11463 2002-06-20 Akim Demaille <akim@epita.fr>
11464
11465 * data/bison.simple (yysymprint): Don't print the token number,
11466 just its name.
11467 * tests/actions.at (Destructors): Rename as...
11468 (Printers and Destructors): this.
11469 Also exercise %printer.
11470
11471 2002-06-20 Akim Demaille <akim@epita.fr>
11472
11473 * data/bison.simple (YYDSYMPRINT): New.
11474 Use it to remove many of the #if YYDEBUG/if (yydebug).
11475
11476 2002-06-20 Akim Demaille <akim@epita.fr>
11477
11478 * src/symtab.h, src/symtab.c (symbol_t): printer and
11479 printer_location are new members.
11480 (symbol_printer_set): New.
11481 * src/parse-gram.y (PERCENT_PRINTER): New token.
11482 Handle its associated rule.
11483 * src/scan-gram.l: Adjust.
11484 (handle_destructor_at, handle_destructor_dollar): Rename as...
11485 (handle_symbol_code_at, handle_symbol_code_dollar): these.
11486 * src/output.c (symbol_printers_output): New.
11487 (output_skeleton): Call it.
11488 * data/bison.simple (yysymprint): New. Cannot be named yyprint
11489 since there are already many grammar files with a user `yyprint'.
11490 Replace the calls to YYPRINT to calls to yysymprint.
11491 * tests/calc.at: Adjust.
11492 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
11493 taking advantage of parser very internal details (stack size!).
11494
11495 2002-06-20 Akim Demaille <akim@epita.fr>
11496
11497 * src/scan-gram.l: Complete the scanner with the missing patterns
11498 to pacify Flex.
11499 Use `quote' and `symbol_tag_get' where appropriate.
11500
11501 2002-06-19 Akim Demaille <akim@epita.fr>
11502
11503 * tests/actions.at (Destructors): Augment to test locations.
11504 * data/bison.simple (yydestructor): Pass it the current location
11505 if locations are enabled.
11506 Prototype only when __STDC__ or C++.
11507 Change the argument names to move into the yy name space: there is
11508 user code here.
11509
11510 2002-06-19 Akim Demaille <akim@epita.fr>
11511
11512 * data/bison.simple (b4_pure_if): New.
11513 Use it instead of #ifdef YYPURE.
11514
11515 2002-06-19 Akim Demaille <akim@epita.fr>
11516
11517 * data/bison.simple (b4_location_if): New.
11518 Use it instead of #ifdef YYLSP_NEEDED.
11519
11520 2002-06-19 Akim Demaille <akim@epita.fr>
11521
11522 Prepare @$ in %destructor, but currently don't bind it in the
11523 skeleton, as %location use is not cleaned up yet.
11524
11525 * src/scan-gram.l (handle_dollar, handle_destructor_at)
11526 (handle_action_at): New.
11527 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
11528 a braced_code_t and a location as additional arguments.
11529 (handle_destructor_dollar): Instead of requiring `b4_eval', just
11530 unquote one when outputting `b4_dollar_dollar'.
11531 Adjust callers.
11532 * data/bison.simple (b4_eval): Remove.
11533 (b4_symbol_destructor): Adjust.
11534 * tests/input.at (Invalid @n): Adjust.
11535
11536 2002-06-19 Zack Weinberg <zack@codesourcery.com>
11537
11538 * doc/bison.texinfo: Document ability to have multiple
11539 prologue sections.
11540
11541 2002-06-18 Akim Demaille <akim@epita.fr>
11542
11543 * src/files.c (compute_base_names): When computing the output file
11544 names from the input file name, strip the directory part.
11545
11546 2002-06-18 Akim Demaille <akim@epita.fr>
11547
11548 * data/bison.simple.new: Comment changes.
11549 Reported by Andreas Schwab.
11550
11551 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
11552
11553 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
11554 there are no `label `yyoverflowlab' defined but not used' warnings
11555 when yyoverflow is defined.
11556
11557 2002-06-18 Akim Demaille <akim@epita.fr>
11558
11559 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
11560 new member.
11561 (symbol_destructor_set): Adjust.
11562 * src/output.c (symbol_destructors_output): Output the destructor
11563 locations.
11564 Output the symbol name.
11565 * data/bison.simple (b4_symbol_destructor): Adjust.
11566
11567 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
11568 and Akim Demaille <akim@epita.fr>
11569
11570 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
11571 what's left on the stack when the error recovery hits EOF.
11572 * tests/actions.at (Destructors): Complete to exercise this case.
11573
11574 2002-06-17 Akim Demaille <akim@epita.fr>
11575
11576 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
11577 arguments is really empty, not only equal to `[]'.
11578 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
11579 member.
11580 (symbol_destructor_set): New.
11581 * src/output.c (symbol_destructors_output): New.
11582 * src/reader.h (brace_code_t, current_braced_code): New.
11583 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
11584 (handle_dollar): Rename as...
11585 (handle_action_dollar): this.
11586 (handle_destructor_dollar): New.
11587 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
11588 (grammar_declaration): Use it.
11589 * data/bison.simple (yystos): Is always defined.
11590 (yydestructor): New.
11591 * tests/actions.at (Destructors): New.
11592 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
11593
11594 2002-06-17 Akim Demaille <akim@epita.fr>
11595
11596 * src/symlist.h, src/symlist.c (symbol_list_length): New.
11597 * src/scan-gram.l (handle_dollar, handle_at): Compute the
11598 rule_length only when needed.
11599 * src/output.c (actions_output, token_definitions_output): Output
11600 the full M4 block.
11601 * src/symtab.c: Don't access directly to the symbol tag, use
11602 symbol_tag_get.
11603 * src/parse-gram.y: Use symbol_list_free.
11604
11605 2002-06-17 Akim Demaille <akim@epita.fr>
11606
11607 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
11608 (symbol_list_prepend, get_type_name): Move to...
11609 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
11610 (symbol_list_prepend, symbol_list_n_type_name_get): here.
11611 Adjust all callers.
11612 (symbol_list_free): New.
11613 * src/scan-gram.l (handle_dollar): Takes a location.
11614 * tests/input.at (Invalid $n): Adjust.
11615
11616 2002-06-17 Akim Demaille <akim@epita.fr>
11617
11618 * src/reader.h, src/reader.c (symbol_list_new): Export it.
11619 (symbol_list_prepend): New.
11620 * src/parse-gram.y (%union): `list' is a new member.
11621 (symbols.1): New, replaces...
11622 (terms_to_prec.1, nterms_to_type.1): these.
11623 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
11624 Take a location as additional argument.
11625 Adjust all callers.
11626
11627 2002-06-15 Akim Demaille <akim@epita.fr>
11628
11629 * src/parse-gram.y: Move %token in the declaration section so that
11630 we don't depend upon CVS Bison.
11631
11632 2002-06-15 Akim Demaille <akim@epita.fr>
11633
11634 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
11635 * src/print.c (print_core): Use it.
11636
11637 2002-06-15 Akim Demaille <akim@epita.fr>
11638
11639 * src/conflicts.c (log_resolution): Accept the rule involved in
11640 the sr conflicts instead of the lookahead number that points to
11641 that rule.
11642 (flush_reduce): Accept the current lookahead vector as argument,
11643 instead of the index in LA.
11644 (resolve_sr_conflict): Accept the current number of lookahead
11645 bitset to consider for the STATE, instead of the index in LA.
11646 (set_conflicts): Adjust.
11647 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
11648
11649 2002-06-15 Akim Demaille <akim@epita.fr>
11650
11651 * src/state.h (state_t): Replace the `lookaheadsp' member, a
11652 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
11653 Adjust all dependencies.
11654 * src/lalr.c (initialize_lookaheads): Split into...
11655 (states_lookaheads_count, states_lookaheads_initialize): these.
11656 (lalr): Adjust.
11657
11658 2002-06-15 Akim Demaille <akim@epita.fr>
11659
11660 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
11661 out of...
11662 (grammar_rules_print): here.
11663 * src/reduce.c (reduce_output): Use it.
11664 * tests/reduce.at (Useless Rules, Reduced Automaton)
11665 (Underivable Rules): Adjust.
11666
11667 2002-06-15 Akim Demaille <akim@epita.fr>
11668
11669 Copy BYacc's nice way to report the grammar.
11670
11671 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
11672 New.
11673 Don't print the rules' location, it is confusing and useless.
11674 (rule_print): Use grammar_rhs_print.
11675 * src/print.c (print_grammar): Use grammar_rules_print.
11676
11677 2002-06-15 Akim Demaille <akim@epita.fr>
11678
11679 Complete and rationalize `useless thing' warnings.
11680
11681 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
11682 (symbol_tag_print): New.
11683 Use them everywhere in place of accessing directly the tag member.
11684 * src/gram.h, src/gram.c (rule_print): New.
11685 Use it where a rule used to be printed `by hand'.
11686 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
11687 (reduce_grammar_tables): Report the useless rules.
11688 (reduce_print): Useless things are a warning, not an error.
11689 Report it as such.
11690 * tests/reduce.at (Useless Nonterminals, Useless Rules):
11691 (Reduced Automaton, Underivable Rules): Adjust.
11692 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
11693 * tests/conflicts.at (Unresolved SR Conflicts)
11694 (Solved SR Conflicts): Adjust.
11695
11696 2002-06-15 Akim Demaille <akim@epita.fr>
11697
11698 Let symbols have a location.
11699
11700 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
11701 (getsym): Adjust.
11702 Adjust all callers.
11703 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
11704 Use location_t, not int.
11705 * src/symtab.c (symbol_check_defined): Take advantage of the
11706 location.
11707 * tests/regression.at (Invalid inputs): Adjust.
11708
11709 2002-06-15 Akim Demaille <akim@epita.fr>
11710
11711 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
11712 (input): Don't try to initialize yylloc here, do it in the
11713 scanner.
11714 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
11715 * src/gram.h (rule_t): Change line and action_line into location
11716 and action_location, of location_t type.
11717 Adjust all dependencies.
11718 * src/location.h, src/location.c (empty_location): New.
11719 * src/reader.h, src/reader.c (grammar_start_symbol_set)
11720 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
11721 (grammar_current_rule_symbol_append)
11722 (grammar_current_rule_action_append): Expect a location as argument.
11723 * src/reader.c (grammar_midrule_action): Adjust to attach an
11724 action's location as dummy symbol location.
11725 * src/symtab.h, src/symtab.c (startsymbol_location): New.
11726 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
11727 the line numbers.
11728
11729 2002-06-14 Akim Demaille <akim@epita.fr>
11730
11731 Grammar declarations may be found in the grammar section.
11732
11733 * src/parse-gram.y (rules_or_grammar_declaration): New.
11734 (declarations): Each declaration may end with a semicolon, not
11735 just...
11736 (grammar_declaration): `"%union"'.
11737 (grammar): Branch to rules_or_grammar_declaration.
11738
11739 2002-06-14 Akim Demaille <akim@epita.fr>
11740
11741 * src/main.c (main): Invoke scanner_free.
11742
11743 2002-06-14 Akim Demaille <akim@epita.fr>
11744
11745 * src/output.c (m4_invoke): Extracted from...
11746 (output_skeleton): here.
11747 Free tempfile.
11748
11749 2002-06-14 Akim Demaille <akim@epita.fr>
11750
11751 * src/parse-gram.y (directives, directive, gram)
11752 (grammar_directives, precedence_directives, precedence_directive):
11753 Rename as...
11754 (declarations, declaration, grammar, grammar_declaration)
11755 (precedence_declaration, precedence_declarator): these.
11756 (symbol_declaration): New.
11757
11758 2002-06-14 Akim Demaille <akim@epita.fr>
11759
11760 * src/files.c (action_obstack): Remove, unused.
11761 (output_obstack): Remove it, and all its dependencies, as it is no
11762 longer needed.
11763 * src/reader.c (epilogue_set): Build the epilogue in the
11764 muscle_obstack.
11765 * src/output.h, src/output.c (muscle_obstack): Move to...
11766 * src/muscle_tab.h, src/muscle_tab.h: here.
11767 (muscle_init): Initialize muscle_obstack.
11768 (muscle_free): New.
11769 * src/main.c (main): Call it.
11770
11771 2002-06-14 Akim Demaille <akim@epita.fr>
11772
11773 * src/location.h: New, extracted from...
11774 * src/reader.h: here.
11775 * src/Makefile.am (noinst_HEADERS): Merge into
11776 (bison_SOURCES): this.
11777 Add location.h.
11778 * src/parse-gram.y: Use location_t instead of Bison's.
11779 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
11780 Use location_t instead of ints.
11781
11782 2002-06-14 Akim Demaille <akim@epita.fr>
11783
11784 * data/bison.simple, data/bison.c++: Be sure to restore the
11785 current #line when returning to the skeleton contents after having
11786 exposed the input file's #line.
11787
11788 2002-06-12 Akim Demaille <akim@epita.fr>
11789
11790 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
11791 eager.
11792 * tests/actions.at (Exotic Dollars): New.
11793
11794 2002-06-12 Akim Demaille <akim@epita.fr>
11795
11796 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
11797 ['"/] too eagerly.
11798 * tests/input.at (Torturing the Scanner): New.
11799
11800 2002-06-11 Akim Demaille <akim@epita.fr>
11801
11802 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
11803 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
11804 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
11805 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
11806 * src/reader.c (reader): Use it.
11807
11808 2002-06-11 Akim Demaille <akim@epita.fr>
11809
11810 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
11811 Adjust all callers.
11812 (scanner_last_string_free): New.
11813
11814 2002-06-11 Akim Demaille <akim@epita.fr>
11815
11816 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
11817 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
11818 (last_string, YY_OBS_FREE): New.
11819 Use them when returning an ID.
11820
11821 2002-06-11 Akim Demaille <akim@epita.fr>
11822
11823 Have Bison grammars parsed by a Bison grammar.
11824
11825 * src/reader.c, src/reader.h (prologue_augment): New.
11826 * src/reader.c (copy_definition): Remove.
11827
11828 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
11829 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
11830 (grammar_current_rule_prec_set, grammar_current_rule_check)
11831 (grammar_current_rule_symbol_append)
11832 (grammar_current_rule_action_append): Export.
11833 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
11834 (symbol_list_action_append): Remove.
11835 Hook the routines from reader.
11836 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
11837 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
11838
11839 * src/reader.c (read_declarations): Remove, unused.
11840
11841 * src/parse-gram.y: Handle the epilogue.
11842 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
11843 (grammar_start_symbol_set): this.
11844 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
11845 * src/reader.c (readgram): Remove, unused.
11846 (reader): Adjust to insert eoftoken and axiom where appropriate.
11847
11848 * src/reader.c (copy_dollar): Replace with...
11849 * src/scan-gram.h (handle_dollar): this.
11850 * src/parse-gram.y: Remove `%thong'.
11851
11852 * src/reader.c (copy_at): Replace with...
11853 * src/scan-gram.h (handle_at): this.
11854
11855 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
11856 New.
11857
11858 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
11859 time being.
11860
11861 * src/reader.h, src/reader.c (grammar_rule_end): New.
11862
11863 * src/parse.y (current_type, current_class): New.
11864 Implement `%nterm', `%token' support.
11865 Merge `%term' into `%token'.
11866 (string_as_id): New.
11867 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
11868 type name.
11869
11870 * src/parse-gram.y: Be sure to handle properly the beginning of
11871 rules.
11872
11873 * src/parse-gram.y: Handle %type.
11874 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
11875
11876 * src/parse-gram.y: More directives support.
11877 * src/options.c: No longer handle source directives.
11878
11879 * src/parse-gram.y: Fix %output.
11880
11881 * src/parse-gram.y: Handle %union.
11882 Use the prologue locations.
11883 * src/reader.c (parse_union_decl): Remove.
11884
11885 * src/reader.h, src/reader.c (epilogue_set): New.
11886 * src/parse-gram.y: Use it.
11887
11888 * data/bison.simple, data/bison.c++: b4_stype is now either not
11889 defined, then default to int, or to the contents of %union,
11890 without `union' itself.
11891 Adjust.
11892 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
11893
11894 * src/output.c (actions_output): Don't output braces, as they are
11895 already handled by the scanner.
11896
11897 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
11898 characters to themselves.
11899
11900 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
11901 that the epilogue has a proper #line.
11902
11903 * src/parse-gram.y: Handle precedence/associativity.
11904
11905 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
11906 a terminal.
11907 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
11908 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
11909 at all to define terminals that cannot be emitted.
11910
11911 * src/scan-gram.l: Escape M4 characters.
11912
11913 * src/scan-gram.l: Working properly with escapes in user
11914 strings/characters.
11915
11916 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
11917 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
11918 grammar.
11919 Use more modest sizes, as for the time being the parser does not
11920 release memory, and therefore the process swallows a huge amount
11921 of memory.
11922
11923 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
11924 stricter %token grammar.
11925
11926 * src/symtab.h (associativity): Add `undef_assoc'.
11927 (symbol_precedence_set): Do nothing when passed an undef_assoc.
11928 * src/symtab.c (symbol_check_alias_consistence): Adjust.
11929
11930 * tests/regression.at (Invalid %directive): Remove, as it is now
11931 meaningless.
11932 (Invalid inputs): Adjust to the new error messages.
11933 (Token definitions): The new grammar doesn't allow too many
11934 eccentricities.
11935
11936 * src/lex.h, src/lex.c: Remove.
11937 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
11938 (copy_character, copy_string2, copy_string, copy_identifier)
11939 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
11940 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
11941 (parse_action): Remove.
11942 * po/POTFILES.in: Adjust.
11943
11944 2002-06-11 Akim Demaille <akim@epita.fr>
11945
11946 * src/reader.c (parse_action): Don't store directly into the
11947 rule's action member: return the action as a string.
11948 Don't require `rule_length' as an argument: compute it.
11949 (grammar_current_rule_symbol_append)
11950 (grammar_current_rule_action_append): New, eved out from
11951 (readgram): here.
11952 Remove `action_flag', `rulelength', unused now.
11953
11954 2002-06-11 Akim Demaille <akim@epita.fr>
11955
11956 * src/reader.c (grammar_current_rule_prec_set).
11957 (grammar_current_rule_check): New, eved out from...
11958 (readgram): here.
11959 Remove `xaction', `first_rhs': useless.
11960 * tests/input.at (Type clashes): New.
11961 * tests/existing.at (GNU Cim Grammar): Adjust.
11962
11963 2002-06-11 Akim Demaille <akim@epita.fr>
11964
11965 * src/reader.c (grammar_midrule_action): New, Eved out from
11966 (readgram): here.
11967
11968 2002-06-11 Akim Demaille <akim@epita.fr>
11969
11970 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
11971 New.
11972 (readgram): Use them as replacement of inlined code, crule and
11973 crule1.
11974
11975 2002-06-11 Akim Demaille <akim@epita.fr>
11976
11977 * src/reader.c (grammar_end, grammar_symbol_append): New.
11978 (readgram): Use them.
11979 Make the use of `p' as local as possible.
11980
11981 2002-06-10 Akim Demaille <akim@epita.fr>
11982
11983 GCJ's parser requires the tokens to be defined before the prologue.
11984
11985 * data/bison.simple: Output the token definition before the user's
11986 prologue.
11987 * tests/regression.at (Braces parsing, Duplicate string)
11988 (Mixing %token styles): Check the output from bison.
11989 (Early token definitions): New.
11990
11991 2002-06-10 Akim Demaille <akim@epita.fr>
11992
11993 * src/symtab.c (symbol_user_token_number_set): Don't complain when
11994 assigning twice the same user number to a token, so that we can
11995 use it in...
11996 * src/lex.c (lex): here.
11997 Also use `symbol_class_set' instead of hand written code.
11998 * src/reader.c (parse_assoc_decl): Likewise.
11999
12000 2002-06-10 Akim Demaille <akim@epita.fr>
12001
12002 * src/symtab.c, src/symtab.c (symbol_class_set)
12003 (symbol_user_token_number_set): New.
12004 * src/reader.c (parse_token_decl): Use them.
12005 Use a switch instead of ifs.
12006 Use a single argument.
12007
12008 2002-06-10 Akim Demaille <akim@epita.fr>
12009
12010 Remove `%thong' support as it is undocumented, unused, duplicates
12011 `%token's job, and creates useless e-mail traffic with people who
12012 want to know what it is, why it is undocumented, unused, and
12013 duplicates `%token's job.
12014
12015 * src/reader.c (parse_thong_decl): Remove.
12016 * src/options.c (option_table): Remove "thong".
12017 * src/lex.h (tok_thong): Remove.
12018
12019 2002-06-10 Akim Demaille <akim@epita.fr>
12020
12021 * src/symtab.c, src/symtab.c (symbol_type_set)
12022 (symbol_precedence_set): New.
12023 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
12024 (value_components_used): Remove, unused.
12025
12026 2002-06-09 Akim Demaille <akim@epita.fr>
12027
12028 Move symbols handling code out of the reader.
12029
12030 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
12031 (axiom): Move to...
12032 * src/symtab.h, src/symtab.c: here.
12033
12034 * src/gram.c (start_symbol): Remove: use startsymbol->number.
12035 * src/reader.c (startval): Rename as...
12036 * src/symtab.h, src/symtab.c (startsymbol): this.
12037 * src/reader.c: Adjust.
12038
12039 * src/reader.c (symbol_check_defined, symbol_make_alias)
12040 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
12041 (token_translations_init)
12042 Move to...
12043 * src/symtab.c: here.
12044 * src/reader.c (packsymbols): Move to...
12045 * src/symtab.h, src/symtab.c (symbols_pack): here.
12046 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
12047 argument.
12048
12049 2002-06-03 Akim Demaille <akim@epita.fr>
12050
12051 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
12052 then statements.
12053
12054 2002-06-03 Akim Demaille <akim@epita.fr>
12055
12056 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
12057 structs with non literals.
12058 * src/scan-skel.l: never-interactive.
12059 * src/conflicts.c (enum conflict_resolution_e): No trailing
12060 comma.
12061 * src/getargs.c (usage): Split long literal strings.
12062 Reported by Hans Aberg.
12063
12064 2002-05-28 Akim Demaille <akim@epita.fr>
12065
12066 * data/bison.c++: Use C++ ostreams.
12067 (cdebug_): New member.
12068
12069 2002-05-28 Akim Demaille <akim@epita.fr>
12070
12071 * src/output.c (output_skeleton): Be sure to allocate enough room
12072 for `/' _and_ for `\0' in full_skeleton.
12073
12074 2002-05-28 Akim Demaille <akim@epita.fr>
12075
12076 * data/bison.c++: Catch up with bison.simple:
12077 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12078 and Paul Eggert <eggert@twinsun.com>: `error' handing.
12079 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
12080 and popping traces.
12081
12082 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12083
12084 * src/output.c (output_skeleton): Put an explicit path in front of
12085 the skeleton file name, rather than relying on the -I directory,
12086 to partially alleviate effects of having a skeleton file lying around
12087 in the current directory.
12088
12089 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12090
12091 * src/conflicts.c (log_resolution): Correct typo:
12092 obstack_printf should be obstack_fgrow1.
12093
12094 2002-05-26 Akim Demaille <akim@epita.fr>
12095
12096 * src/state.h (state_t): `solved_conflicts' is a new member.
12097 * src/LR0.c (new_state): Set it to 0.
12098 * src/conflicts.h, src/conflicts.c (print_conflicts)
12099 (free_conflicts, solve_conflicts): Rename as...
12100 (conflicts_print, conflicts_free, conflicts_solve): these.
12101 Adjust callers.
12102 * src/conflicts.c (enum conflict_resolution_e)
12103 (solved_conflicts_obstack): New, used by...
12104 (log_resolution): this.
12105 Adjust to attach the conflict resolution to each state.
12106 Complete the description with the precedence/associativity
12107 information.
12108 (resolve_sr_conflict): Adjust.
12109 * src/print.c (print_state): Output its solved_conflicts.
12110 * tests/conflicts.at (Unresolved SR Conflicts)
12111 (Solved SR Conflicts): Exercise --report=all.
12112
12113 2002-05-26 Akim Demaille <akim@epita.fr>
12114
12115 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
12116 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
12117 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
12118 (token_number_t, item_number_as_token_number)
12119 (token_number_as_item_number, muscle_insert_token_number_table):
12120 Rename as...
12121 (symbol_number_t, item_number_as_symbol_number)
12122 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
12123 these, since it is more appropriate.
12124
12125 2002-05-26 Akim Demaille <akim@epita.fr>
12126
12127 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
12128 `Error:' lines.
12129 * data/bison.simple (yystos) [YYDEBUG]: New.
12130 (yyparse) [YYDEBUG]: Display the symbols which are popped during
12131 error recovery.
12132 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
12133
12134 2002-05-25 Akim Demaille <akim@epita.fr>
12135
12136 * doc/bison.texinfo (Debugging): Split into...
12137 (Tracing): this new section, its former contents, and...
12138 (Understanding): this new section.
12139 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
12140 by...
12141 (report_flag): this.
12142 Adjust all dependencies.
12143 (report_args, report_types, report_argmatch): New.
12144 (usage, getargs): Report/support -r, --report.
12145 * src/options.h
12146 (struct option_table_struct): Rename as..,
12147 (struct option_table_s): this.
12148 Rename the `set_flag' member to `flag' to match with getopt_long's
12149 struct.
12150 * src/options.c (option_table): Split verbose into an entry for
12151 %verbose, and another for --verbose.
12152 Support --report/-r, so remove -r from the obsolete --raw.
12153 * src/print.c: Attach full item sets and lookaheads reports to
12154 report_flag instead of trace_flag.
12155 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
12156
12157 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12158 and Paul Eggert <eggert@twinsun.com>
12159
12160 * data/bison.simple (yyparse): Correct error handling to conform to
12161 POSIX and yacc. Specifically, after syntax error is discovered,
12162 do not reduce further before shifting the error token.
12163 Clean up the code a bit by removing the labels yyerrdefault,
12164 yyerrhandle, yyerrpop.
12165 * NEWS: Document the above.
12166
12167 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12168
12169 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
12170 type; it isn't always big enough, since it doesn't necessarily
12171 include non-terminals.
12172 (yytranslate): Expand definition of yy_token_number_type, so that
12173 the latter can be removed.
12174 (yy_token_number_type): Remove, only one use.
12175 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
12176 don't use TokenNumberType as element type.
12177
12178 * tests/regression.at: Modify expected output to agree with change
12179 to yyr1 and yytranslate.
12180
12181 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
12182
12183 * src/reader.c (parse_action): Use copy_character instead of
12184 obstack_1grow.
12185
12186 2002-05-13 Akim Demaille <akim@epita.fr>
12187
12188 * tests/regression.at (Token definitions): Prototype yylex and
12189 yyerror.
12190
12191 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12192
12193 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
12194 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
12195 32-bit arithmetic.
12196 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
12197
12198 2002-05-07 Akim Demaille <akim@epita.fr>
12199
12200 * tests/synclines.at: Be sure to prototype yylex and yyerror to
12201 avoid GCC warnings.
12202
12203 2002-05-07 Akim Demaille <akim@epita.fr>
12204
12205 Kill GCC warnings.
12206
12207 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
12208 over the RHS of each rule.
12209 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
12210 * src/state.h (state_t): Member `nitems' is unsigned short.
12211 * src/LR0.c (get_state): Adjust.
12212 * src/reader.c (packgram): Likewise.
12213 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
12214 `Type'.
12215 (muscle_insert_int_table): Remove, unused.
12216 (prepare_rules): Remove `max'.
12217
12218 2002-05-06 Akim Demaille <akim@epita.fr>
12219
12220 * src/closure.c (print_firsts): Display of the symbol tags.
12221 (bitmatrix_print): Move to...
12222 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
12223 here.
12224 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
12225
12226 2002-05-06 Akim Demaille <akim@epita.fr>
12227
12228 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
12229 hash_do_for_each.
12230
12231 2002-05-06 Akim Demaille <akim@epita.fr>
12232
12233 * src/LR0.c (new_state, get_state): Instead of using the global
12234 `kernel_size' and `kernel_base', have two new arguments:
12235 `core_size' and `core'.
12236 Adjust callers.
12237
12238 2002-05-06 Akim Demaille <akim@epita.fr>
12239
12240 * src/reader.c (packgram): No longer end `ritem' with a 0
12241 sentinel: it is not used.
12242
12243 2002-05-05 Akim Demaille <akim@epita.fr>
12244
12245 New experimental feature: display the lookaheads in the report and
12246 graph.
12247
12248 * src/print (print_core): When --trace-flag, display the rules
12249 lookaheads.
12250 * src/print_graph.c (print_core): Likewise.
12251 Swap the arguments.
12252 Adjust caller.
12253
12254 2002-05-05 Akim Demaille <akim@epita.fr>
12255
12256 * tests/torture.at (Many lookaheads): New test.
12257
12258 2002-05-05 Akim Demaille <akim@epita.fr>
12259
12260 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
12261 (GENERATE_MUSCLE_INSERT_TABLE): this.
12262 (output_int_table, output_unsigned_int_table, output_short_table)
12263 (output_token_number_table, output_item_number_table): Replace with...
12264 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
12265 (muscle_insert_short_table, muscle_insert_token_number_table)
12266 (muscle_insert_item_number_table): these.
12267 Adjust all callers.
12268 (prepare_tokens): Don't free `translations', since...
12269 * src/reader.h, src/reader.c (grammar_free): do it.
12270 Move to...
12271 * src/gram.h, src/gram.c (grammar_free): here.
12272 * data/bison.simple, data/bison.c++: b4_token_number_max is now
12273 b4_translate_max.
12274
12275 2002-05-05 Akim Demaille <akim@epita.fr>
12276
12277 * src/output.c (output_unsigned_int_table): New.
12278 (prepare_rules): `i' is unsigned.
12279 `prhs', `rline', `r2' are unsigned int.
12280 Rename muscle `rhs_number_max' as `rhs_max'.
12281 Output muscles `prhs_max', `rline_max', and `r2_max'.
12282 Free rline and r1.
12283 * data/bison.simple, data/bison.c++: Adjust to use these muscles
12284 to compute types instead of constant types.
12285 * tests/regression.at (Web2c Actions): Adjust.
12286
12287 2002-05-04 Akim Demaille <akim@epita.fr>
12288
12289 * src/symtab.h (SALIAS, SUNDEF): Rename as...
12290 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
12291 Adjust dependencies.
12292 * src/output.c (token_definitions_output): Be sure not to output a
12293 `#define 'a'' when fed with `%token 'a' "a"'.
12294 * tests/regression.at (Token definitions): New.
12295
12296 2002-05-03 Paul Eggert <eggert@twinsun.com>
12297
12298 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
12299 for K&R C.
12300
12301 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
12302
12303 * Makefile.am (SUBDIRS): Remove intl.
12304 (EXTRA_DIST): Add config/config.rpath.
12305
12306 2002-05-03 Akim Demaille <akim@epita.fr>
12307
12308 * data/bison.simple (m4_if): Don't output empty enums.
12309 And actually, output valid enum definitions :(.
12310
12311 2002-05-03 Akim Demaille <akim@epita.fr>
12312
12313 * configure.bat: Remove, completely obsolete.
12314 * Makefile.am (EXTRA_DIST): Adjust.
12315 Don't distribute config.rpath...
12316 * config/Makefile.am (EXTRA_DIST): Do it.
12317
12318 2002-05-03 Akim Demaille <akim@epita.fr>
12319
12320 * configure.in (GETTEXT_VERSION): New.
12321 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
12322
12323 2002-05-03 Akim Demaille <akim@epita.fr>
12324
12325 * data/bison.simple (b4_token_enum): New.
12326 (b4_token_defines): Use it to output tokens both as #define and
12327 enums.
12328 Suggested by Paul Eggert.
12329 * src/output.c (token_definitions_output): Don't output spurious
12330 white spaces.
12331
12332 2002-05-03 Akim Demaille <akim@epita.fr>
12333
12334 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12335
12336 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
12337
12338 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
12339 Update the stack class, give a try to deque as the default container.
12340
12341 2002-05-02 Akim Demaille <akim@epita.fr>
12342
12343 * data/bison.simple (yyparse): Do not implement @$ = @1.
12344 (YYLLOC_DEFAULT): Adjust to do it.
12345 * doc/bison.texinfo (Location Default Action): Fix.
12346
12347 2002-05-02 Akim Demaille <akim@epita.fr>
12348
12349 * src/reader.c (parse_braces): Merge into...
12350 (parse_action): this.
12351
12352 2002-05-02 Akim Demaille <akim@epita.fr>
12353
12354 * configure.in (ALL_LINGUAS): Remove.
12355 * po/LINGUAS, hr.po: New.
12356
12357 2002-05-02 Akim Demaille <akim@epita.fr>
12358
12359 Remove the so called hairy (semantic) parsers.
12360
12361 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
12362 * src/gram.h, src/gram.c (semantic_parser): Remove.
12363 (rule_t): Remove the guard and guard_line members.
12364 * src/lex.h (token_t): remove tok_guard.
12365 * src/options.c (option_table): Remove %guard and %semantic_parser
12366 support.
12367 * src/output.c, src/output.h (guards_output): Remove.
12368 (prepare): Adjust.
12369 (token_definitions_output): Don't output the `T'
12370 tokens (???).
12371 (output_skeleton): Don't output the guards.
12372 * src/files.c, src/files.c (attrsfile): Remove.
12373 * src/reader.c (symbol_list): Remove the guard and guard_line
12374 members.
12375 Adjust dependencies.
12376 (parse_guard): Remove.
12377 * data/bison.hairy: Remove.
12378 * doc/bison.texinfo (Environment Variables): Remove occurrences of
12379 BISON_HAIRY.
12380
12381 2002-05-02 Akim Demaille <akim@epita.fr>
12382
12383 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
12384 (parse_guard): Rename the formal argument `stack_offset' as
12385 `rule_length', which is more readable.
12386 Adjust callers.
12387 (copy_at, copy_dollar): Instead of outputting the hard coded
12388 values of $$, $n and so forth, output invocation to b4_lhs_value,
12389 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
12390 Note: this patch partially drops `semantic-parser' support: it
12391 always does `rule_length - n', where semantic parsers ought to
12392 always use `-n'.
12393 * data/bison.simple, data/bison.c++ (b4_lhs_value)
12394 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
12395
12396 2002-05-02 Akim Demaille <akim@epita.fr>
12397
12398 * configure.in (AC_INIT): Bump to 1.49b.
12399 (AM_INIT_AUTOMAKE): Short invocation.
12400
12401 2002-05-02 Akim Demaille <akim@epita.fr>
12402
12403 Version 1.49a.
12404
12405 2002-05-01 Akim Demaille <akim@epita.fr>
12406
12407 * src/skeleton.h: Remove.
12408
12409 2002-05-01 Akim Demaille <akim@epita.fr>
12410
12411 * src/skeleton.h: Fix the #endif.
12412 Reported by Magnus Fromreide.
12413
12414 2002-04-26 Paul Eggert <eggert@twinsun.com>
12415
12416 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
12417 Define if we define YYSTYPE and YYLTYPE, respectively.
12418 (YYCOPY): Fix [] quoting problem in the non-GCC case.
12419
12420 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
12421
12422 * src/scan-skel.l: Postprocess quadrigraphs.
12423
12424 * src/reader.c (copy_character): New function, used to output
12425 single characters while replacing `[' and `]' with quadrigraphs, to
12426 avoid troubles with M4 quotes.
12427 (copy_comment): Output characters with copy_character.
12428 (read_additionnal_code): Likewise.
12429 (copy_string2): Likewise.
12430 (copy_definition): Likewise.
12431
12432 * tests/calc.at: Exercise M4 quoting.
12433
12434 2002-04-25 Akim Demaille <akim@epita.fr>
12435
12436 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
12437 between `!' and the command.
12438 Reported by Paul Eggert.
12439
12440 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
12441
12442 * tests/calc.at: Exercise prologue splitting.
12443
12444 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
12445 `b4_post_prologue' instead of `b4_prologue'.
12446
12447 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
12448 muscles.
12449 (output): Free pre_prologue_obstack and post_prologue_obstack.
12450 * src/files.h, src/files.c (attrs_obstack): Remove.
12451 (pre_prologue_obstack, post_prologue_obstack): New.
12452 * src/reader.c (copy_definition): Add a parameter to specify the
12453 obstack to fill, instead of using attrs_obstack unconditionally.
12454 (read_declarations): Pass pre_prologue_obstack to copy_definition if
12455 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
12456
12457 2002-04-23 Paul Eggert <eggert@twinsun.com>
12458
12459 * data/bison.simple: Remove unnecessary commentary and white
12460 space differences from 1_29-branch.
12461 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
12462
12463 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
12464 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
12465 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
12466 constructors or destructors.
12467
12468 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
12469
12470 2002-04-23 Akim Demaille <akim@epita.fr>
12471
12472 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
12473 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
12474 location with columns.
12475 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
12476 All reported by Paul Eggert.
12477
12478 2002-04-22 Akim Demaille <akim@epita.fr>
12479
12480 * src/reduce.c (dump_grammar): Move to...
12481 * src/gram.h, src/gram.c (grammar_dump): here.
12482 Be sure to separate long item numbers.
12483 Don't read the members of a rule's prec if its nil.
12484
12485 2002-04-22 Akim Demaille <akim@epita.fr>
12486
12487 * src/output.c (table_size, table_grow): New.
12488 (MAXTABLE): Remove, replace uses with table_size.
12489 (pack_vector): Instead of dying when the table is too big, grow it.
12490
12491 2002-04-22 Akim Demaille <akim@epita.fr>
12492
12493 * data/bison.simple (yyr1): Its type is that of a token number.
12494 * data/bison.c++ (r1_): Likewise.
12495 * tests/regression.at (Web2c Actions): Adjust.
12496
12497 2002-04-22 Akim Demaille <akim@epita.fr>
12498
12499 * src/reader.c (token_translations_init): 256 is now the default
12500 value for the error token, i.e., it will be assigned another
12501 number if the user assigned 256 to one of her tokens.
12502 (reader): Don't force 256 to error.
12503 * doc/bison.texinfo (Symbols): Adjust.
12504 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
12505 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
12506 etc. instead of 10, 20, 30 (which was used to `jump' over error
12507 (256) and undefined (2)).
12508
12509 2002-04-22 Akim Demaille <akim@epita.fr>
12510
12511 Propagate more token_number_t.
12512
12513 * src/gram.h (token_number_as_item_number)
12514 (item_number_as_token_number): New.
12515 * src/output.c (GENERATE_OUTPUT_TABLE): New.
12516 Use it to create output_item_number_table and
12517 output_token_number_table.
12518 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
12519 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
12520 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
12521 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
12522
12523 2002-04-22 Akim Demaille <akim@epita.fr>
12524
12525 * src/output.h, src/output.c (get_lines_number): Remove.
12526
12527 2002-04-19 Akim Demaille <akim@epita.fr>
12528
12529 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
12530 as Lex/Flex'.
12531 (Debugging): More details about enabling the debugging features.
12532 (Table of Symbols): Describe $$, $n, @$, and @n.
12533 Suggested by Tim Josling.
12534
12535 2002-04-19 Akim Demaille <akim@epita.fr>
12536
12537 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
12538
12539 2002-04-10 Akim Demaille <akim@epita.fr>
12540
12541 * src/system.h: Rely on HAVE_LIMITS_H.
12542 Suggested by Paul Eggert.
12543
12544 2002-04-09 Akim Demaille <akim@epita.fr>
12545
12546 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
12547 full stderr, and strip it according to the bison options, instead
12548 of composing the error message from different bits.
12549 This makes it easier to check for several error messages.
12550 Adjust all the invocations.
12551 Add an invocation exercising the error token.
12552 Add an invocation demonstrating a stupid error message.
12553 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
12554 Adjust the tests.
12555 Error message are for stderr, not stdout.
12556
12557 2002-04-09 Akim Demaille <akim@epita.fr>
12558
12559 * src/gram.h, src/gram.c (error_token_number): Remove, use
12560 errtoken->number.
12561 * src/reader.c (reader): Don't specify the user token number (2)
12562 for $undefined, as it uselessly prevents using it.
12563 * src/gram.h (token_number_t): Move to...
12564 * src/symtab.h: here.
12565 (state_t.number): Is a token_number_t.
12566 * src/print.c, src/reader.c: Use undeftoken->number instead of
12567 hard coded 2.
12568 (Even though this 2 is not the same as above: the number of the
12569 undeftoken remains being 2, it is its user token number which
12570 might not be 2).
12571 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
12572 `user_token_number_max'.
12573 Output `undef_token_number'.
12574 * data/bison.simple, data/bison.c++: Use them.
12575 Be sure to map invalid yylex return values to
12576 `undef_token_number'. This saves us from gratuitous SEGV.
12577
12578 * tests/conflicts.at (Solved SR Conflicts)
12579 (Unresolved SR Conflicts): Adjust.
12580 * tests/regression.at (Web2c Actions): Adjust.
12581
12582 2002-04-08 Akim Demaille <akim@epita.fr>
12583
12584 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
12585 Adding #line.
12586 Remove the duplicate `typedefs'.
12587 (RhsNumberType): Fix the declaration and various other typos.
12588 Use __ofile__.
12589 * data/bison.simple: Use __ofile__.
12590 * src/scan-skel.l: Handle __ofile__.
12591
12592 2002-04-08 Akim Demaille <akim@epita.fr>
12593
12594 * src/gram.h (item_number_t): New, the type of item numbers in
12595 RITEM. Note that it must be able to code symbol numbers as
12596 positive number, and the negation of rule numbers as negative
12597 numbers.
12598 Adjust all dependencies (pretty many).
12599 * src/reduce.c (rule): Remove this `short *' pointer: use
12600 item_number_t.
12601 * src/system.h (MINSHORT, MAXSHORT): Remove.
12602 Include `limits.h'.
12603 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
12604 (shortcpy): Remove.
12605 (MAXTABLE): Move to...
12606 * src/output.c (MAXTABLE): here.
12607 (prepare_rules): Use output_int_table to output rhs.
12608 * data/bison.simple, data/bison.c++: Adjust.
12609 * tests/torture.at (Big triangle): Move the limit from 254 to
12610 500.
12611 * tests/regression.at (Web2c Actions): Ajust.
12612
12613 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
12614 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
12615 passes, but produces negative #line number, once fixed, GCC is
12616 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
12617 C), it passes.
12618 * src/state.h (state_h): Code input lines on ints, not shorts.
12619
12620 2002-04-08 Akim Demaille <akim@epita.fr>
12621
12622 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
12623 and then the grammar.
12624
12625 2002-04-08 Akim Demaille <akim@epita.fr>
12626
12627 * src/system.h: No longer using strndup.
12628
12629 2002-04-07 Akim Demaille <akim@epita.fr>
12630
12631 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
12632 * src/output.c (output_table_data): Return the longest number.
12633 (prepare_tokens): Output `token_number_max').
12634 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
12635 New.
12636 Use them to define yy_token_number_type/TokenNumberType.
12637 Use this type for yytranslate.
12638 * tests/torture.at (Big triangle): Push the limit from 124 to
12639 253.
12640 * tests/regression.at (Web2c Actions): Adjust.
12641
12642 2002-04-07 Akim Demaille <akim@epita.fr>
12643
12644 * tests/torture.at (Big triangle): New.
12645 (GNU AWK Grammar, GNU Cim Grammar): Move to...
12646 * tests/existing.at: here.
12647
12648 2002-04-07 Akim Demaille <akim@epita.fr>
12649
12650 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
12651 nritems.
12652 Adjust dependencies.
12653
12654 2002-04-07 Akim Demaille <akim@epita.fr>
12655
12656 * src/reader.c: Normalize increments to prefix form.
12657
12658 2002-04-07 Akim Demaille <akim@epita.fr>
12659
12660 * src/reader.c, symtab.c: Remove debugging code.
12661
12662 2002-04-07 Akim Demaille <akim@epita.fr>
12663
12664 Rename all the `bucket's as `symbol_t'.
12665
12666 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
12667 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
12668 * src/symtab.c, src/symtab.h (bucket): Rename as...
12669 (symbol_t): this.
12670 (symbol_list_new, bucket_check_defined, bucket_make_alias)
12671 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
12672 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
12673 (buckets_new, buckets_free, buckets_do): Rename as...
12674 (symbol_list_new, symbol_check_defined, symbol_make_alias)
12675 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
12676 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
12677 (symbols_new, symbols_free, symbols_do): these.
12678
12679 2002-04-07 Akim Demaille <akim@epita.fr>
12680
12681 Use lib/hash for the symbol table.
12682
12683 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
12684 EOF.
12685 * src/lex.c (lex): Set the `number' member of new terminals.
12686 * src/reader.c (bucket_check_defined, bucket_make_alias)
12687 (bucket_check_alias_consistence, bucket_translation): New.
12688 (reader, grammar_free, readgram, token_translations_init)
12689 (packsymbols): Adjust.
12690 (reader): Number the predefined tokens.
12691 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
12692 for predefined tokens.
12693 * src/symtab.h (bucket): Remove all the hash table related
12694 members.
12695 * src/symtab.c (symtab): Replace by...
12696 (bucket_table): this.
12697 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
12698 (buckets_new, buckets_do): New.
12699
12700 2002-04-07 Akim Demaille <akim@epita.fr>
12701
12702 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
12703 (start_symbol, max_user_token_number, semantic_parser)
12704 (error_token_number): Initialize.
12705 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
12706 Initialize.
12707 (reader): Don't.
12708 (errtoken, eoftoken, undeftoken, axiom): Extern.
12709
12710 2002-04-07 Akim Demaille <akim@epita.fr>
12711
12712 * src/gram.h (rule_s): prec and precsym are now pointers
12713 to the bucket giving the priority/associativity.
12714 Member `associativity' removed: useless.
12715 * src/reduce.c, src/conflicts.c: Adjust.
12716
12717 2002-04-07 Akim Demaille <akim@epita.fr>
12718
12719 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
12720 Properly escape the symbols' TAG when outputting them.
12721
12722 2002-04-07 Akim Demaille <akim@epita.fr>
12723
12724 * src/lalr.h (LA): Is a bitsetv, not bitset*.
12725
12726 2002-04-07 Akim Demaille <akim@epita.fr>
12727
12728 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
12729 (LArule): this, which is an array to rule_t*.
12730 * src/print.c, src/conflicts.c: Adjust.
12731
12732 2002-04-07 Akim Demaille <akim@epita.fr>
12733
12734 * src/gram.h (rule_t): Rename `number' as `user_number'.
12735 `number' is a new member.
12736 Adjust dependencies.
12737 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
12738
12739 2002-04-07 Akim Demaille <akim@epita.fr>
12740
12741 As a result of the previous patch, it is no longer needed
12742 to reorder ritem itself.
12743
12744 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
12745
12746 2002-04-07 Akim Demaille <akim@epita.fr>
12747
12748 Be sure never to walk through RITEMS, but use only data related to
12749 the rules themselves. RITEMS should be banished.
12750
12751 * src/output.c (output_token_translations): Rename as...
12752 (prepare_tokens): this.
12753 In addition to `translate', prepare the muscles `tname' and
12754 `toknum', which were handled by...
12755 (output_rule_data): this.
12756 Remove, and move the remainder of its outputs into...
12757 (prepare_rules): this new routines, which also merges content from
12758 (output_gram): this.
12759 (prepare_rules): Be sure never to walk through RITEMS.
12760 (output_stos): Rename as...
12761 (prepare_stos): this.
12762 (output): Always invoke prepare_states, after all, just don't use it
12763 in the output if you don't need it.
12764
12765 2002-04-07 Akim Demaille <akim@epita.fr>
12766
12767 * src/LR0.c (new_state): Display `nstates' as the name of the
12768 newly created state.
12769 Adjust to initialize first_state and last_state if needed.
12770 Be sure to distinguish the initial from the final state.
12771 (new_states): Create the itemset of the initial state, and use
12772 new_state.
12773 * src/closure.c (closure): Now that the initial state has its
12774 items properly set, there is no need for a special case when
12775 creating `ruleset'.
12776
12777 As a result, now the rule 0, reducing to $axiom, is visible in the
12778 outputs. Adjust the test suite.
12779
12780 * tests/conflicts.at (Solved SR Conflicts)
12781 (Unresolved SR Conflicts): Adjust.
12782 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
12783 * tests/conflicts.at (S/R in initial): New.
12784
12785 2002-04-07 Akim Demaille <akim@epita.fr>
12786
12787 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
12788 the RHS of the rules.
12789 * src/output.c (output_gram): Likewise.
12790
12791 2002-04-07 Akim Demaille <akim@epita.fr>
12792
12793 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
12794 bucket.
12795 Adjust all dependencies.
12796 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
12797 `number' of the buckets too.
12798 * src/gram.h: Include `symtab.h'.
12799 (associativity): Move to...
12800 * src/symtab.h: here.
12801 No longer include `gram.h'.
12802
12803 2002-04-07 Akim Demaille <akim@epita.fr>
12804
12805 * src/gram.h, src/gram.c (rules_rhs_length): New.
12806 (ritem_longest_rhs): Use it.
12807 * src/gram.h (rule_t): `number' is a new member.
12808 * src/reader.c (packgram): Set it.
12809 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
12810 the end of `rules', and count them out of `nrules'.
12811 (reduce_output, dump_grammar): Adjust.
12812 * src/print.c (print_grammar): It is no longer needed to check for
12813 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
12814 * tests/reduce.at (Reduced Automaton): New test.
12815
12816 2002-04-07 Akim Demaille <akim@epita.fr>
12817
12818 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
12819 lacking `+ 1' to nrules, Bison reported as useless a token if it
12820 was used solely to set the precedence of the last rule...
12821
12822 2002-04-07 Akim Demaille <akim@epita.fr>
12823
12824 * data/bison.c++, data/bison.simple: Don't output the current file
12825 name in #line, to avoid useless diffs between two identical
12826 outputs under different names.
12827
12828 2002-04-07 Akim Demaille <akim@epita.fr>
12829
12830 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
12831 Normalize loops to using `< nrules + 1', not `<= nrules'.
12832
12833 2002-04-07 Akim Demaille <akim@epita.fr>
12834
12835 * TODO: Update.
12836
12837 2002-04-07 Akim Demaille <akim@epita.fr>
12838
12839 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
12840 bucket.value as bucket.number.
12841
12842 2002-04-07 Akim Demaille <akim@epita.fr>
12843
12844 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
12845 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
12846 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
12847 RHS, instead of being an index in RITEMS.
12848
12849 2002-04-04 Paul Eggert <eggert@twinsun.com>
12850
12851 * doc/bison.texinfo: Update copyright date.
12852 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
12853 (Symbols): Warn about running Bison in one character set,
12854 but compiling and/or running in an incompatible one.
12855 Warn about character code 256, too.
12856
12857 2002-04-03 Paul Eggert <eggert@twinsun.com>
12858
12859 * src/bison.data (YYSTACK_ALLOC): Depend on whether
12860 YYERROR_VERBOSE is nonzero, not whether it is defined.
12861
12862 Merge changes from bison-1_29-branch.
12863
12864 2002-03-20 Paul Eggert <eggert@twinsun.com>
12865
12866 Merge fixes from Debian bison_1.34-1.diff.
12867
12868 * configure.in (AC_PREREQ): 2.53.
12869
12870 2002-03-20 Akim Demaille <akim@epita.fr>
12871
12872 * src/conflicts.c (log_resolution): Argument `resolution' is const.
12873
12874 2002-03-19 Paul Eggert <eggert@twinsun.com>
12875
12876 * src/bison.simple (YYCOPY): New macro.
12877 (YYSTACK_RELOCATE): Use it.
12878 Remove Type arg; no longer needed. All callers changed.
12879 (yymemcpy): Remove; no longer needed.
12880
12881 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
12882 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
12883
12884 2002-03-19 Akim Demaille <akim@epita.fr>
12885
12886 Test and fix the #line outputs.
12887
12888 * tests/atlocal.at (GCC): New.
12889 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
12890 (Prologue synch line, %union synch line, Postprologue synch line)
12891 (Action synch line, Epilogue synch line): New tests.
12892 * src/reader.c (parse_union_decl): Define the muscle stype_line.
12893 * data/bison.simple, data/bison.c++: Use it.
12894
12895 2002-03-19 Akim Demaille <akim@epita.fr>
12896
12897 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
12898 (Solved SR Conflicts, %expect not enough, %expect right)
12899 (%expect too much): Move to...
12900 * tests/conflicts.at: this new file.
12901
12902 2002-03-19 Akim Demaille <akim@epita.fr>
12903
12904 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12905 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
12906 that we can move to enums for instance.
12907 * src/output.c (token_definitions_output): Output a list of
12908 `token-name, token-number' instead of the #define.
12909 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
12910
12911 2002-03-14 Akim Demaille <akim@epita.fr>
12912
12913 Use Gettext 0.11.1.
12914
12915 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
12916
12917 * data/bison.c++: Make the user able to add members to the generated
12918 parser by subclassing.
12919
12920 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
12921
12922 * src/reader.c (read_additionnal_code): `c' should be an integer, not
12923 a character.
12924 Reported by Nicolas Tisserand and Nicolas Burrus.
12925
12926 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12927
12928 * src/reader.c: Warn about lacking semi-colons, do not complain.
12929
12930 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12931
12932 * data/bison.c++: Remove a debug line.
12933
12934 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
12935
12936 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
12937 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
12938 provide a default implementation.
12939
12940 2002-03-04 Akim Demaille <akim@epita.fr>
12941
12942 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
12943 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
12944 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
12945 * tests/semantic.at (Parsing Guards): Similarly.
12946 * src/reader.at (readgram): Complain if the last rule is not ended
12947 with a semi-colon.
12948
12949 2002-03-04 Akim Demaille <akim@epita.fr>
12950
12951 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
12952 * src/closure.c: here.
12953 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
12954 RTC.
12955 * src/warshall.h, src/warshall.c: Remove.
12956 * tests/sets.at (Broken Closure): Adjust.
12957
12958 2002-03-04 Akim Demaille <akim@epita.fr>
12959
12960 * src/output.c (output_skeleton): tempdir is const.
12961 bytes_read is unused.
12962
12963 2002-03-04 Akim Demaille <akim@epita.fr>
12964
12965 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12966 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
12967 Update.
12968 From Michael Hayes.
12969
12970 2002-03-04 Akim Demaille <akim@epita.fr>
12971
12972 * src/closure.c (closure): `r' is unused.
12973
12974 2002-03-04 Akim Demaille <akim@epita.fr>
12975
12976 * tests/sets.at (Broken Closure): Add the ending `;'.
12977 * src/reader.at (readgram): Complain if a rule is not ended with a
12978 semi-colon.
12979
12980 2002-03-04 Akim Demaille <akim@epita.fr>
12981
12982 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
12983 (count_sr_conflicts): Use bitset_count.
12984 * src/reduce.c (inaccessable_symbols): Ditto.
12985 (bits_size): Remove.
12986 * src/warshall.h, src/warshall.c: Convert to bitsetv.
12987
12988 2002-03-04 Akim Demaille <akim@epita.fr>
12989
12990 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
12991 * src/reduce.c: Remove the `bitset_zero's following the
12992 `bitset_create's, as now it is performed by the latter.
12993
12994 2002-03-04 Akim Demaille <akim@epita.fr>
12995
12996 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
12997 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
12998 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
12999 latest sources from Michael.
13000
13001 2002-03-04 Akim Demaille <akim@epita.fr>
13002
13003 * src/output.c (output): Don't free the grammar.
13004 * src/reader.c (grammar_free): New.
13005 * src/main.c (main): Call it and don't free symtab here.
13006
13007 2002-03-04 Akim Demaille <akim@epita.fr>
13008
13009 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
13010 before returning.
13011 Reported by Benoit Perrot.
13012
13013 2002-03-04 Akim Demaille <akim@epita.fr>
13014
13015 Use bitset operations when possible, not loops over bits.
13016
13017 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
13018 bitset_or.
13019 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
13020 * src/reduce.c (useless_nonterminals): Formatting changes.
13021 * src/warshall.c (TC): Use bitset_or.
13022
13023 2002-03-04 Akim Demaille <akim@epita.fr>
13024
13025 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
13026 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
13027 Ditto.
13028
13029 2002-03-04 Akim Demaille <akim@epita.fr>
13030
13031 * src/lalr.c (F): Now a bitset*.
13032 Adjust all dependencies.
13033
13034 2002-03-04 Akim Demaille <akim@epita.fr>
13035
13036 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
13037 Adjust all dependencies.
13038
13039 2002-03-04 Akim Demaille <akim@epita.fr>
13040
13041 * src/L0.c, src/LR0.h (nstates): Be size_t.
13042 Adjust comparisons (signed vs unsigned).
13043 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
13044 bitset*.
13045 Adjust all dependencies.
13046
13047 2002-03-04 Akim Demaille <akim@epita.fr>
13048
13049 * src/closure.c (firsts): Now, also a bitset.
13050 Adjust all dependencies.
13051 (varsetsize): Remove, now unused.
13052 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
13053
13054 2002-03-04 Akim Demaille <akim@epita.fr>
13055
13056 * src/print.c: Convert to use bitset.h, not hand coded iterations
13057 over ints.
13058
13059 2002-03-04 Akim Demaille <akim@epita.fr>
13060
13061 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
13062
13063 2002-03-04 Akim Demaille <akim@epita.fr>
13064
13065 * src/closure.c (ruleset): Be a bitset.
13066 (rulesetsize): Remove.
13067
13068 2002-03-04 Akim Demaille <akim@epita.fr>
13069
13070 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
13071 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
13072 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
13073 * src/closure.c (fderives): Be an array of bitsets.
13074
13075 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
13076
13077 * data/bison.c++: Merge the two generated headers. Insert a copyright
13078 notice in each output file.
13079
13080 2002-02-28 Akim Demaille <akim@epita.fr>
13081
13082 * data/bison.c++: Copy the prologue of bison.simple to fetch
13083 useful M4 definitions, such as b4_header_guard.
13084
13085 2002-02-25 Akim Demaille <akim@epita.fr>
13086
13087 * src/getargs.c (version): Give the name of the authors, and use a
13088 translator friendly scheme for the bgr
13089 copyright notice.
13090
13091 2002-02-25 Akim Demaille <akim@epita.fr>
13092
13093 * src/output.c (header_output): Remove, now handled completely via
13094 M4.
13095
13096 2002-02-25 Akim Demaille <akim@epita.fr>
13097
13098 * m4/m4.m4: New, from CVS Autoconf.
13099 * configure.in: Invoke it.
13100 * src/output.c (output_skeleton): Use its result instead of the
13101 hard coded name.
13102
13103 2002-02-25 Akim Demaille <akim@epita.fr>
13104
13105 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
13106 Fileutils 4.1.5.
13107 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
13108 * src/output.c (output_skeleton): Use mkstemp to create a real
13109 temporary file.
13110 Move the filling of `skeleton' and its muscle to...
13111 (prepare): here.
13112 (output): Move the definition of the prologue muscle to...
13113 (prepare): here.
13114 * src/system.h (DEFAULT_TMPDIR): New.
13115
13116 2002-02-14 Paul Eggert <eggert@twinsun.com>
13117
13118 Remove the support for C++ namespace cleanliness; it was
13119 causing more problems than it was curing, since it didn't work
13120 properly on some nonstandard C++ compilers. This can wait
13121 for a proper C++ parser.
13122
13123 * NEWS: Document this.
13124 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
13125 of C++, as it's treated like C now.
13126 * src/bison.simple (YYSTD): Remove.
13127 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
13128 Treat C++ just like Standard C instead of trying to support
13129 namespace cleanliness.
13130
13131 2002-02-14 Akim Demaille <akim@epita.fr>
13132
13133 * tests/regression.at (else): Adjust to Andreas' change.
13134
13135 2002-02-14 Akim Demaille <akim@epita.fr>
13136
13137 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
13138
13139 2002-02-13 Andreas Schwab <schwab@suse.de>
13140
13141 * src/output.c (output_rule_data): Don't output NULL, it might
13142 not be defined yet.
13143
13144 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
13145
13146 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
13147 (Copyright notice): Update.
13148
13149 2002-02-11 Akim Demaille <akim@epita.fr>
13150
13151 * tests/regression.at (%nonassoc and eof): Don't include
13152 nonportable headers.
13153
13154 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
13155
13156 * data/bison.c++: Correct error recovery. Make the user able to
13157 initialize the starting location.
13158
13159 2002-02-07 Akim Demaille <akim@epita.fr>
13160
13161 * tests/input.at: New.
13162
13163 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
13164
13165 * data/bison.c++: Replace some direct m4 expansions by constants. Be
13166 more consistent when naming methods and variables. Put preprocessor
13167 directives around tables only needed for debugging.
13168
13169 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
13170
13171 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
13172 C++ parsers.
13173 (yy::b4_name::parse): Use print_.
13174
13175 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
13176
13177 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
13178
13179 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
13180
13181 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
13182 C++ parsers.
13183 (yy::b4_name::parse): Build verbose error messages, and use error_.
13184
13185 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
13186
13187 * data/bison.c++: Fix m4 quoting in comments.
13188
13189 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
13190
13191 * data/bison.c++: Adjust the parser code. Fix some muscles that were
13192 not expanded by m4.
13193
13194 2002-02-05 Akim Demaille <akim@epita.fr>
13195
13196 * data/bison.c++: Adjust to the M4 back end.
13197 More is certainly needed.
13198
13199 2002-02-05 Akim Demaille <akim@epita.fr>
13200
13201 Give a try to M4 as a back end.
13202
13203 * lib/readpipe.c: New, from wdiff.
13204 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
13205 BISON_HAIRY.
13206 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
13207 specific values. Now it is m4 that performs the lookup.
13208 * src/parse-skel.y: Remove.
13209 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
13210 * src/output.c (actions_output, guards_output)
13211 (token_definitions_output): No longer keeps track of the output
13212 line number, hence remove the second argument.
13213 (guards_output): Check against the guard member of a rule, not the
13214 action member.
13215 Adjust callers.
13216 (output_skeleton): Don't look for the skeleton location, let m4 do
13217 that.
13218 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
13219 file will be used.
13220 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
13221 (prepare): Given that for the time being changesyntax is not
13222 usable in M4, rename the muscles using `-' to `_'.
13223 Define `defines_flag', `output_parser_name' and `output_header_name'.
13224 * src/output.h (actions_output, guards_output)
13225 (token_definitions_output): Adjust prototypes.
13226 * src/scan-skel.l: Instead of scanning the skeletons, it now
13227 processes the output of m4: `__oline__' and `#output'.
13228 * data/bison.simple: Adjust to be used by M4(sugar).
13229 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
13230 to date.
13231 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
13232 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
13233 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
13234 shamelessly stolen from CVS Autoconf.
13235
13236 2002-02-05 Akim Demaille <akim@epita.fr>
13237
13238 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
13239 * configure.in: Check for the declarations of free and malloc.
13240 * src/muscle_tab.c: Adjust.
13241
13242 2002-02-05 Akim Demaille <akim@epita.fr>
13243
13244 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
13245 which have no values.
13246
13247 2002-02-05 Akim Demaille <akim@epita.fr>
13248
13249 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
13250 * data/: here.
13251
13252 2002-01-29 Paul Eggert <eggert@twinsun.com>
13253
13254 * src/bison.simple (YYSIZE_T): Do not define merely because
13255 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
13256 On some platforms, <alloca.h> does not declare YYSTD (size_t).
13257
13258 2002-01-27 Akim Demaille <akim@epita.fr>
13259
13260 Fix `%nonassoc and eof'.
13261
13262 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
13263 which were not properly copied! Replace
13264 memcpy (res->errs, src->errs, src->nerrs);
13265 with
13266 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
13267 !!!
13268 * tests/regression.at (%nonassoc and eof): Adjust to newest
13269 Autotest: `.' is not in the PATH.
13270
13271 2002-01-27 Akim Demaille <akim@epita.fr>
13272
13273 * tests/sets.at (AT_EXTRACT_SETS): New.
13274 (Nullable): Use it.
13275 (Firsts): New.
13276
13277 2002-01-26 Akim Demaille <akim@epita.fr>
13278
13279 * tests/actions.at, tests/calc.at, tests/headers.at,
13280 * tests/torture.at: Adjust to the newest Autotest which no longer
13281 forces `.' in the PATH.
13282
13283 2002-01-25 Akim Demaille <akim@epita.fr>
13284
13285 * tests/regression.at (%nonassoc and eof): New.
13286 Suggested by Robert Anisko.
13287
13288 2002-01-24 Akim Demaille <akim@epita.fr>
13289
13290 Bison dumps core when trying to complain about broken input files.
13291 Reported by Cris van Pelt.
13292
13293 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
13294 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
13295 into...
13296 (Invalid inputs): Strengthen: exercise parse_percent_token.
13297
13298 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
13299
13300 * src/Makefile.am: Add bison.c++.
13301 * src/bison.c++: New skeleton.
13302
13303 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
13304
13305 * po/it.po: New.
13306
13307 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
13308
13309 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
13310
13311 2002-01-20 Marc Autret <marc@gnu.org>
13312
13313 * src/files.c (compute_output_file_names): Fix
13314
13315 2002-01-20 Marc Autret <marc@gnu.org>
13316
13317 * tests/output.at: New test.
13318 * src/files.c (compute_base_names): Don't map extensions when
13319 the YACC flag is set, use defaults.
13320 Reported by Evgeny Stambulchik.
13321
13322 2002-01-20 Marc Autret <marc@gnu.org>
13323
13324 * src/system.h: Need to define __attribute__ away for non-GCC
13325 compilers as well (i.e., the vendor C compiler).
13326 Suggested by Albert Chin-A-Young.
13327
13328 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
13329
13330 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
13331 canonical definition.
13332 * src/system.h: Use the canonical definition for PARAMS (avoids
13333 a conflict with the macro from lib/hash.h).
13334
13335 2002-01-11 Akim Demaille <akim@epita.fr>
13336
13337 * configure.in: Use AC_FUNC_STRNLEN.
13338 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
13339
13340 2002-01-09 Akim Demaille <akim@epita.fr>
13341
13342 * src/files.c, src/files.h (output_infix): New.
13343 (tab_extension): Remove.
13344 (compute_base_names): Compute the former, drop the latter.
13345 * src/output.c (prepare): Insert the muscles `output-infix', and
13346 `output-suffix'.
13347 * src/parse-skel.y (string, string.1): New.
13348 (section.header): Use it.
13349 (section.yacc): Remove.
13350 (prefix): Remove too.
13351 * src/scan-skel.l: Adjust.
13352 * src/bison.simple, src/bison.hairy: Adjust.
13353
13354 2002-01-09 Akim Demaille <akim@epita.fr>
13355
13356 * configure.in (WERROR_CFLAGS): Compute it.
13357 * src/Makefile.am (CFLAGS): Pass it.
13358 * tests/atlocal.in (CFLAGS): Idem.
13359 * src/files.c: Fix a few warnings.
13360 (get_extension_index): Remove, unused.
13361
13362 2002-01-08 Akim Demaille <akim@epita.fr>
13363
13364 * src/getargs.c (AS_FILE_NAME): New.
13365 (getargs): Use it to convert DOSish file names.
13366 * src/files.c (base_name): Rename as full_base_name to avoid
13367 clashes with `base_name ()'.
13368 (filename_split): New.
13369 (compute_base_names): N-th rewrite, using filename_split.
13370
13371 2002-01-08 Akim Demaille <akim@epita.fr>
13372
13373 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
13374 New, stolen from the Fileutils 4.1.
13375 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
13376 * configure.in: Check for the presence of memrchr, and of its
13377 prototype.
13378
13379 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
13380
13381 * lib/hash.h (__P): Added definition for this macro.
13382 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
13383 BUILT_SOURCES, to ensure they are generated first.
13384 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
13385 %error-verbose to allow bootstrapping with bison 1.30x.
13386
13387 2002-01-06 Akim Demaille <akim@epita.fr>
13388
13389 * src/reader.c (parse_braces): Don't fetch the next char, the
13390 convention is to fetch on entry.
13391 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
13392 'switch' without a following semicolon.
13393 * tests/regression.at (braces parsing): New.
13394
13395 2002-01-06 Akim Demaille <akim@epita.fr>
13396
13397 Bison is dead wrong in its RR conflict reports.
13398
13399 * tests/torture.at (GNU Cim Grammar): New.
13400 * src/conflicts.c (count_rr_conflicts): Fix.
13401
13402 2002-01-06 Akim Demaille <akim@epita.fr>
13403
13404 Creating package.m4 from configure.ac causes too many problems.
13405
13406 * tests/Makefile.am (package.m4): Create it by hand,
13407 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
13408
13409 2002-01-06 Akim Demaille <akim@epita.fr>
13410
13411 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
13412 skeleton.h.
13413
13414 2002-01-04 Paul Eggert <eggert@twinsun.com>
13415
13416 * doc/bison.texinfo (Debugging):
13417 Remove YYSTDERR; it's no longer defined or used.
13418 Also, s/cstdio.h/cstdio/.
13419
13420 2002-01-03 Akim Demaille <akim@epita.fr>
13421
13422 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
13423
13424 2002-01-03 Akim Demaille <akim@epita.fr>
13425
13426 * src/parse-skel.y (process_skeleton): Don't bind the parser's
13427 tracing code to --trace, wait for a better --trace option, with
13428 args.
13429
13430 2002-01-03 Akim Demaille <akim@epita.fr>
13431
13432 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
13433 The ISO C++ standard is extremely clear about it: stderr is
13434 considered a macro, not a regular symbol (see table 94 `Header
13435 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
13436 Therefore std:: does not apply to it. It still does with fprintf.
13437 Also, s/cstdio.h/cstdio/.
13438
13439 2002-01-03 Akim Demaille <akim@epita.fr>
13440
13441 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
13442 for non system headers.
13443
13444 2002-01-02 Akim Demaille <akim@epita.fr>
13445
13446 Equip the skeleton chain with location tracking, runtime trace,
13447 pure parser and scanner.
13448
13449 * src/parse-skel.y: Request a pure parser, locations, and prefix
13450 renaming.
13451 (%union): Having several members with the same type does not help
13452 type mismatches, simplify.
13453 (YYPRINT, yyprint): New.
13454 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
13455 (skel_error): this.
13456 Handle locations.
13457 * src/scan-skel.l: Adjust to these changes.
13458 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
13459 (LOCATION_PRINT, skel_control_t): New.
13460
13461 2001-12-30 Akim Demaille <akim@epita.fr>
13462
13463 * src/parse-skel.y: Get rid of the shift/reduce conflict:
13464 replace `gb' with BLANKS.
13465 * src/scan-skel.l: Adjust.
13466
13467 2001-12-30 Akim Demaille <akim@epita.fr>
13468
13469 * src/system.h: We don't need nor want bcopy.
13470 Throw away MS-DOS crap: we don't need getpid.
13471 * configure.in: We don't need strndup. It was even causing
13472 problems: because Flex includes the headers *before* us,
13473 _GNU_SOURCE is not defined by config.h, and therefore strndup was
13474 not visible.
13475 * lib/xstrndup.c: New.
13476 * src/scan-skel.l: Use it.
13477 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
13478 * src/parse-skel.y: Use %directives instead of #defines.
13479
13480 2001-12-30 Akim Demaille <akim@epita.fr>
13481
13482 * src/skeleton.h: New.
13483 * src/output.c (output_parser, output_master_parser): Remove, dead
13484 code.
13485 * src/output.h (get_lines_number, actions_output, guards_output)
13486 (token_definitions_output): Prototype them.
13487 * src/parse-skel.y: Add the license notice.
13488 Include output.h and skeleton.h.
13489 (process_skeleton): Returns void, and takes a single parameter.
13490 * src/scan-skel.l: Add the license notice.
13491 Include skeleton.h.
13492 Don't use %option yylineno: it seems that then Flex imagines
13493 REJECT has been used, and therefore it won't reallocate its
13494 buffers (which makes no other sense to me than a bug). It results
13495 in warnings for `unused: yy_flex_realloc'.
13496
13497 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
13498
13499 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
13500 (MUSCLE_INSERT_PREFIX): ...to there.
13501 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
13502 (MUSCLE_INSERT_PREFIX): Move from here...
13503
13504 * src/bison.hairy: Add a section directive. Put braces around muscle
13505 names. This parser skeleton is still broken, but Bison should not
13506 choke on a bad muscle 'syntax'.
13507 * src/bison.simple: Add a section directive. Put braces around muscle
13508 names.
13509
13510 * src/files.h (strsuffix, stringappend): Add declarations.
13511 (tab_extension): Add declaration.
13512 (short_base_name): Add declaration.
13513
13514 * src/files.c (strsuffix, stringappend): No longer static. These
13515 functions are used in the skeleton parser.
13516 (tab_extension): New.
13517 (compute_base_names): Use the computations done in this function
13518 to guess if the generated parsers should have '.tab' in their
13519 names.
13520 (short_base_name): No longer static.
13521
13522 * src/output.c (output_skeleton): New.
13523 (output): Disable call to output_master_parser, and give a try to
13524 a new skeleton handling system.
13525 (guards_output, actions_output): No longer static.
13526 (token_definitions_output, get_lines_number): No longer static.
13527
13528 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
13529
13530 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
13531 parse-skel.y.
13532
13533 * src/parse-skel.y: New file.
13534 * src/scan-skel.l: New file.
13535
13536 2001-12-29 Akim Demaille <akim@epita.fr>
13537
13538 %name-prefix is broken.
13539
13540 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
13541 Adjust all dependencies.
13542 * tests/headers.at (export YYLTYPE): Strengthen this test: use
13543 %name-prefix.
13544
13545 Renaming yylval but not yylloc is not consistent. Now we do.
13546
13547 * src/bison.simple: Prefix yylloc if used.
13548 * doc/bison.texinfo (Decl Summary): Document that.
13549
13550 2001-12-29 Akim Demaille <akim@epita.fr>
13551
13552 * doc/bison.texinfo: Promote `%long-directive' over
13553 `%long_directive'.
13554 Remove all references to fixed-output-files, yacc is enough.
13555
13556 2001-12-29 Akim Demaille <akim@epita.fr>
13557
13558 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
13559 user prologue. These are defaults.
13560 * tests/actions.at (Mid-rule actions): Make sure the user can
13561 define YYDEBUG and YYERROR_VERBOSE.
13562
13563 2001-12-29 Akim Demaille <akim@epita.fr>
13564
13565 * src/output.c (header_output): Don't forget to export YYLTYPE and
13566 yylloc.
13567 * tests/headers.at (export YYLTYPE): New, make sure it does.
13568 * tests/regression.at (%union and --defines, Invalid CPP headers):
13569 Move to...
13570 * tests/headers.at: here.
13571
13572 2001-12-29 Akim Demaille <akim@epita.fr>
13573
13574 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
13575
13576 2001-12-29 Akim Demaille <akim@epita.fr>
13577
13578 * tests/actions.at (Mid-rule actions): Output on a single line
13579 instead of several.
13580
13581 2001-12-29 Akim Demaille <akim@epita.fr>
13582
13583 * doc/bison.texinfo: Formatting changes.
13584
13585 2001-12-29 Akim Demaille <akim@epita.fr>
13586
13587 Don't store the token defs in a muscle, just be ready to output it
13588 on command. Now possible via `symbols'. Fixes a memory leak.
13589
13590 * src/output.c (token_definitions_output): New.
13591 (output_parser, header_output): Use it.
13592 * src/reader.c (symbols_save): Remove.
13593
13594 2001-12-29 Akim Demaille <akim@epita.fr>
13595
13596 * src/bison.simple: Do not provide a default for YYSTYPE and
13597 YYLTYPE before the user's prologue. Otherwise it's hardly... a
13598 default.
13599
13600 2001-12-29 Akim Demaille <akim@epita.fr>
13601
13602 Mid-rule actions are simply... ignored!
13603
13604 * src/reader.c (readgram): Be sure to attach mid-rule actions to
13605 the empty-rule associated to the dummy symbol, not to the host
13606 rule.
13607 * tests/actions.at (Mid-rule actions): New.
13608
13609 2001-12-29 Akim Demaille <akim@epita.fr>
13610
13611 Memory leak.
13612
13613 * src/reader.c (reader): Free grammar.
13614
13615 2001-12-29 Akim Demaille <akim@epita.fr>
13616
13617 Memory leak.
13618
13619 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
13620 since it allocates it for each state, although only one is needed.
13621 (allocate_storage): Do it here.
13622
13623 2001-12-29 Akim Demaille <akim@epita.fr>
13624
13625 * src/options.h, src/options.c (create_long_option_table): Rename
13626 as...
13627 (long_option_table_new): this, with a clearer prototype.
13628 (percent_table): Remove, unused,
13629 * src/getargs.c (getargs): Adjust.
13630
13631 2001-12-29 Akim Demaille <akim@epita.fr>
13632
13633 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
13634 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
13635 as states.
13636
13637 2001-12-29 Akim Demaille <akim@epita.fr>
13638
13639 * src/lalr.c (build_relations): Rename `states' as `states1'.
13640 Sorry, I don't understand exactly what it is, no better name...
13641
13642 2001-12-29 Akim Demaille <akim@epita.fr>
13643
13644 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
13645 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
13646 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
13647 as rules.
13648
13649 2001-12-29 Akim Demaille <akim@epita.fr>
13650
13651 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
13652 ago.
13653
13654 2001-12-29 Akim Demaille <akim@epita.fr>
13655
13656 * src/reader.c, src/reader.h (user_toknums): Remove.
13657 Adjust all users to use symbols[i]->user_token_number.
13658
13659 2001-12-29 Akim Demaille <akim@epita.fr>
13660
13661 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
13662 Adjust all users to use symbols[i]->prec or ->assoc.
13663
13664 2001-12-29 Akim Demaille <akim@epita.fr>
13665
13666 * src/reader.c, src/reader.h (tags): Remove.
13667 Adjust all users to use symbols[i]->tag.
13668
13669 2001-12-29 Akim Demaille <akim@epita.fr>
13670
13671 * src/gram.h, src/gram.c (symbols): New, similar to state_table
13672 and rule_table.
13673 * src/reader.c (packsymbols): Fill this table.
13674 Drop sprec.
13675 * src/conflicts.c (resolve_sr_conflict): Adjust.
13676 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
13677 single table.
13678 Use symbols[i]->tag instead of tags[i].
13679
13680 2001-12-29 Akim Demaille <akim@epita.fr>
13681
13682 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
13683 In addition, put a comment in there, to replace...
13684 * tests/regression.at (%union and C comments): Remove.
13685
13686 2001-12-29 Akim Demaille <akim@epita.fr>
13687
13688 * tests/regression.at (Web2c Actions): Blindly move the actual
13689 output as expected output. The contents *seem* right to me, but I
13690 can't pretend reading perfectly parser tables... Nonetheless, all
13691 the other tests pass correctly, the table look OK, even though the
13692 presence of `$axiom' is to be noted: AFAICS it is useless (but
13693 harmless).
13694
13695 2001-12-29 Akim Demaille <akim@epita.fr>
13696
13697 * src/reader.c (readgram): Don't add the rule 0 if there were no
13698 rules read. In other words, add it _after_ having performed
13699 grammar sanity checks.
13700 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
13701
13702 2001-12-29 Akim Demaille <akim@epita.fr>
13703
13704 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
13705 visible, and some states have now a different number.
13706
13707 2001-12-29 Akim Demaille <akim@epita.fr>
13708
13709 * src/reader.c (readgram): Bind the initial rule's lineno to that
13710 of the first rule.
13711 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
13712 (Solved SR Conflicts): Adjust rule 0's line number.
13713
13714 2001-12-29 Akim Demaille <akim@epita.fr>
13715
13716 Fix the `GAWK Grammar' failure.
13717
13718 * src/LR0.c (final_state): Initialize to -1 so that we do compute
13719 the reductions of the first state which was mistakenly confused
13720 with the final state because precisely final_state was initialized
13721 to 0.
13722 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
13723 now noticed by Bison.
13724 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
13725 have a reduction on $default.
13726
13727 2001-12-29 Akim Demaille <akim@epita.fr>
13728
13729 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
13730 rule line numbers.
13731 * src/closure.c (print_closure): Likewise.
13732 * src/derives.c (print_derives): Likewise.
13733 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
13734 now.
13735
13736 2001-12-29 Akim Demaille <akim@epita.fr>
13737
13738 * src/lalr.c (lookaheads_print): New.
13739 (lalr): Call it when --trace-flag.
13740 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
13741 are dumped.
13742
13743 2001-12-29 Akim Demaille <akim@epita.fr>
13744
13745 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
13746 when walking through ritem, even via rule->rhs.
13747 * src/reduce.c (dump_grammar, useful_production, reduce_output)
13748 (useful_production, useless_nonterminals): Likewise.
13749 (reduce_grammar_tables): Likewise, plus update nritems.
13750 * src/nullable.c (set_nullable): Likewise.
13751 * src/lalr.c (build_relations): Likewise.
13752 * tests/sets.at (Nullable): Adjust.
13753 Fortunately, now, the $axiom is no longer nullable.
13754
13755 2001-12-29 Akim Demaille <akim@epita.fr>
13756
13757 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
13758 the 0-sentinel.
13759 * src/gram.c (ritem_longest_rhs): Likewise.
13760 * src/reduce.c (nonterminals_reduce): Likewise.
13761 * src/print_graph.c (print_graph): Likewise.
13762 * src/output.c (output_rule_data): Likewise.
13763 * src/nullable.c (set_nullable): Likewise.
13764
13765 2001-12-29 Akim Demaille <akim@epita.fr>
13766
13767 * src/output.c: Comment changes.
13768
13769 2001-12-27 Paul Eggert <eggert@twinsun.com>
13770
13771 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
13772 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
13773 Sparc, as they were causing more porting problems than the
13774 (minor) performance improvement was worth.
13775
13776 Also, catch up with 1.31's YYSTD.
13777
13778 2001-12-27 Akim Demaille <akim@epita.fr>
13779
13780 * src/output.c (output_gram): Rely on nritems, not the
13781 0-sentinel. See below.
13782 Use -1 as separator, not 0.
13783 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
13784 Rely on -1 as separator in yyrhs, instead of 0.
13785 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
13786 twice `Now at end of input', therefore there are two lines less to
13787 expect.
13788
13789 2001-12-27 Akim Demaille <akim@epita.fr>
13790
13791 * tests/regression.at (Unresolved SR Conflicts):
13792 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
13793 below.
13794
13795 2001-12-27 Akim Demaille <akim@epita.fr>
13796
13797 * src/LR0.c (new_state): Recognize the final state by the fact it
13798 is reached by eoftoken.
13799 (insert_start_shifting_state, insert_eof_shifting_state)
13800 (insert_accepting_state, augment_automaton): Remove, since now
13801 these states are automatically computed from the initial state.
13802 (generate_states): Adjust.
13803 * src/print.c: When reporting a rule number to the user, substract
13804 1, so that the axiom rule is rule 0, and the first user rule is 1.
13805 * src/reduce.c: Likewise.
13806 * src/print_graph.c (print_core): For the time being, just as for
13807 the report, depend upon --trace-flags to dump the full set of
13808 items.
13809 * src/reader.c (readgram): Once the grammar read, insert the rule
13810 0: `$axiom: START-SYMBOL $'.
13811 * tests/set.at: Adjust: rule 0 is now displayed, and since the
13812 number of the states has changed (the final state is no longer
13813 necessarily the last), catch up.
13814
13815 2001-12-27 Akim Demaille <akim@epita.fr>
13816
13817 Try to make the use of the eoftoken valid. Given that its value
13818 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
13819 is used instead of > 0 where appropriate, (ii), depend upon nritems
13820 instead of the 0-sentinel.
13821
13822 * src/gram.h, src/gram.c (nritems): New.
13823 Expected to be duplication of nitems, but for the time being...
13824 * src/reader.c (packgram): Assert nritems and nitems are equal.
13825 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
13826 * src/closure.c (print_closure, print_fderives): Likewise.
13827 * src/gram.c (ritem_print): Likewise.
13828 * src/print.c (print_core, print_grammar): Likewise.
13829 * src/print_graph.c: Likewise.
13830
13831 2001-12-27 Akim Demaille <akim@epita.fr>
13832
13833 * src/main.c (main): If there are complains after grammar
13834 reductions, then output the report anyway if requested, then die.
13835 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
13836 * src/reader.c (eoftoken): New.
13837 (parse_token_decl): If the token being defined has value `0', it
13838 is the eoftoken.
13839 (packsymbols): No longer hack `tags' to insert `$' by hand.
13840 Be sure to preserve the value of the eoftoken.
13841 (reader): Make sure eoftoken is defined.
13842 Initialize nsyms to 0: now eoftoken is created just like the others.
13843 * src/print.c (print_grammar): Don't special case the eof token.
13844 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
13845 lie anyway, albeit pleasant.
13846 * tests/calc.at: Exercise error messages with eoftoken.
13847 Change the grammar so that empty input is invalid.
13848 Adjust expectations.
13849 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
13850
13851 2001-12-27 Akim Demaille <akim@epita.fr>
13852
13853 * configure.in: Check the protos of strchr ans strspn.
13854 Replace strchr if needed.
13855 * src/system.h: Provide the protos of strchr, strspn and memchr if
13856 missing.
13857 * lib/strchr.c: New.
13858 * src/reader.c (symbols_save): Use strchr.
13859
13860 2001-12-27 Akim Demaille <akim@epita.fr>
13861
13862 * src/print.c, src/print_graph.c (escape): New.
13863 Use it to quote the TAGS outputs.
13864 * src/print_graph.c (print_state): Now errors are in red, and
13865 reductions in green.
13866 Prefer high to wide: output the state number on a line of its own.
13867
13868 2001-12-27 Akim Demaille <akim@epita.fr>
13869
13870 * src/state.h, src/state.c (reductions_new): New.
13871 * src/LR0.c (set_state_table): Let all the states have a
13872 `reductions', even if reduced to 0.
13873 (save_reductions): Adjust.
13874 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
13875 * src/print.c (print_reductions, print_actions): Adjust.
13876 * src/output.c (action_row): Adjust.
13877
13878 2001-12-27 Akim Demaille <akim@epita.fr>
13879
13880 * src/state.h, src/state.c (errs_new, errs_dup): New.
13881 * src/LR0.c (set_state_table): Let all the states have an errs,
13882 even if reduced to 0.
13883 * src/print.c (print_errs, print_reductions): Adjust.
13884 * src/output.c (output_actions, action_row): Adjust.
13885 * src/conflicts.c (resolve_sr_conflict): Adjust.
13886
13887 2001-12-27 Akim Demaille <akim@epita.fr>
13888
13889 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
13890
13891 2001-12-27 Akim Demaille <akim@epita.fr>
13892
13893 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
13894 * src/print.c: here.
13895 (lookaheadset, shiftset): New, used as additional storage by
13896 print_reductions.
13897 (print_results): Adjust.
13898 (print_shifts, print_gotos, print_errs): New, extracted from...
13899 (print_actions): here.
13900 * src/print_graph.c (print_actions): Remove dead code.
13901
13902 2001-12-27 Akim Demaille <akim@epita.fr>
13903
13904 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
13905 `$n' and `@n'.
13906
13907 2001-12-27 Akim Demaille <akim@epita.fr>
13908
13909 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
13910 (build_relations): Adjust.
13911
13912 2001-12-27 Akim Demaille <akim@epita.fr>
13913
13914 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
13915 duplication.
13916
13917 2001-12-27 Akim Demaille <akim@epita.fr>
13918
13919 * src/reader.c (packgram): Catch nitems overflows.
13920
13921 2001-12-27 Akim Demaille <akim@epita.fr>
13922
13923 * src/files.c, src/files.h (guard_obstack): Remove.
13924 * src/output.c (output): Adjust.
13925 * src/reader.c (parse_braces): New, factoring...
13926 (copy_action, copy_guard): these two which are renamed as...
13927 (parse_action, parse_guard): these.
13928 As a voluntary consequence, using braces around guards is now
13929 mandatory.
13930
13931 2001-12-27 Akim Demaille <akim@epita.fr>
13932
13933 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
13934 * src/reader.c (symbol_list): `guard' and `guard_line' are new
13935 members.
13936 (symbol_list_new): Adjust.
13937 (copy_action): action_line is the first line, not the last.
13938 (copy_guard): Just as for actions, store the `action' only, not
13939 the switch/case/break flesh.
13940 Don't parse the user action that might follow the guard, let...
13941 (readgram): do it, i.e., now, there can be an action after a
13942 guard.
13943 In other words the guard is just explicitly optional.
13944 (packgram): Adjust.
13945 * src/output.c (guards_output): New.
13946 (output_parser): Call it when needed.
13947 (output): Also free the guard and attrs obstacks.
13948 * src/files.c, src/files.h (obstack_save): Remove.
13949 (output_files): Remove.
13950 As a result, if one needs the former `.act' file, using an
13951 appropriate skeleton which requires actions and guards is now
13952 required.
13953 * src/main.c (main): Adjust.
13954 * tests/semantic.at: New.
13955 * tests/regression.at: Use `input.y' as input file name.
13956 Avoid 8+3 problems by requiring input.c when the test needs the
13957 parser.
13958
13959 2001-12-27 Akim Demaille <akim@epita.fr>
13960
13961 * src/reader.c (symbol_list_new): Be sure to initialize all the
13962 fields.
13963
13964 2001-12-27 Akim Demaille <akim@epita.fr>
13965
13966 All the hacks using a final pseudo state are now useless.
13967
13968 * src/LR0.c (set_state_table): state_table holds exactly nstates.
13969 * src/lalr.c (nLA): New.
13970 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
13971 instead of lookaheadsp from the pseudo state (nstate + 1).
13972
13973 2001-12-27 Akim Demaille <akim@epita.fr>
13974
13975 * src/output.c (action_row, token_actions): Use a state_t instead
13976 of a integer, and nlookaheads instead of the following state's
13977 lookaheadsp.
13978
13979 2001-12-27 Akim Demaille <akim@epita.fr>
13980
13981 * src/conflicts.c (log_resolution, flush_shift)
13982 (resolve_sr_conflict, set_conflicts, solve_conflicts)
13983 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
13984 (conflicts_print, print_reductions): Use a state_t instead of an
13985 integer when referring to a state.
13986 As much as possible, depend upon nlookaheads, instead of the
13987 `lookaheadsp' member of the following state (since lookaheads of
13988 successive states are successive, the difference between state n + 1
13989 and n served as the number of lookaheads for state n).
13990 * src/lalr.c (add_lookback_edge): Likewise.
13991 * src/print.c (print_core, print_actions, print_state)
13992 (print_results): Likewise.
13993 * src/print_graph.c (print_core, print_actions, print_state)
13994 (print_graph): Likewise.
13995 * src/conflicts.h: Adjust.
13996
13997 2001-12-27 Akim Demaille <akim@epita.fr>
13998
13999 * src/bison.hairy: Formatting/comment changes.
14000 ANSIfy.
14001 Remove `register' indications.
14002 Add plenty of `static'.
14003
14004 2001-12-27 Akim Demaille <akim@epita.fr>
14005
14006 * src/output.c (prepare): Drop the muscle `ntbase' which
14007 duplicates ntokens.
14008 * src/bison.simple: Formatting/comment changes.
14009 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
14010 is an undocumented synonym.
14011
14012 2001-12-22 Akim Demaille <akim@epita.fr>
14013
14014 * src/output.c (output_table_data): Change the prototype to use
14015 `int' for array ranges: some invocations do pass an int, not a
14016 short.
14017 Reported by Wayne Green.
14018
14019 2001-12-22 Akim Demaille <akim@epita.fr>
14020
14021 Some actions of web2c.y are improperly triggered.
14022 Reported by Mike Castle.
14023
14024 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
14025 * tests/regression.at (Web2c): Rename as...
14026 (Web2c Report): this.
14027 (Web2c Actions): New.
14028
14029 2001-12-22 Akim Demaille <akim@epita.fr>
14030
14031 Reductions in web2c.y are improperly reported.
14032 Reported by Mike Castle.
14033
14034 * src/conflicts.c (print_reductions): Fix.
14035 * tests/regression.at (Web2c): New.
14036
14037 2001-12-18 Akim Demaille <akim@epita.fr>
14038
14039 Some host fail on `assert (!"foo")', which expands to
14040 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
14041 Reported by Nelson Beebee.
14042
14043 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
14044 `#define it_succeeded 0' and `assert (it_succeeded)'.
14045
14046 2001-12-17 Marc Autret <autret_m@epita.fr>
14047
14048 * src/bison.simple: Don't hard code the skeleton line and filename.
14049 * src/output.c (output_parser): Rename 'line' as 'output_line'.
14050 New line counter 'skeleton_line' (skeleton-line muscle).
14051
14052 2001-12-17 Paul Eggert <eggert@twinsun.com>
14053
14054 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
14055 YYDEBUG must be defined to a nonzero value.
14056
14057 * src/bison.simple (yytname): Do not assume that the user defines
14058 YYDEBUG to a properly parenthesized expression.
14059
14060 2001-12-17 Akim Demaille <akim@epita.fr>
14061
14062 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
14063 nlookaheads is a new member.
14064 Adjust all users.
14065 * src/lalr.h (nlookaheads): Remove this orphan declaration.
14066 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
14067 state.
14068
14069 2001-12-17 Akim Demaille <akim@epita.fr>
14070
14071 * src/files.h, src/files.c (open_files, close_files): Remove.
14072 * src/main.c (main): Don't open/close files, nor invoke lex_free,
14073 let...
14074 * src/reader.c (reader): Do it.
14075
14076 2001-12-17 Akim Demaille <akim@epita.fr>
14077
14078 * src/conflicts.c (print_reductions): Formatting changes.
14079
14080 2001-12-17 Akim Demaille <akim@epita.fr>
14081
14082 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
14083 (flush_reduce): New.
14084 (resolve_sr_conflict): Adjust.
14085
14086 2001-12-17 Akim Demaille <akim@epita.fr>
14087
14088 * src/output.c (output_obstack): Be static and rename as...
14089 (format_obstack): this, to avoid any confusion with files.c's
14090 output_obstack.
14091 * src/reader.h (muscle_obstack): Move to...
14092 * src/output.h: here, since it's defined in output.c.
14093
14094 2001-12-17 Akim Demaille <akim@epita.fr>
14095
14096 * src/output.c (action_row, save_column, default_goto)
14097 (sort_actions, matching_state, pack_vector): Better variable
14098 locality.
14099
14100 2001-12-17 Akim Demaille <akim@epita.fr>
14101
14102 * src/output.c: Various formatting changes.
14103
14104 2001-12-17 Akim Demaille <akim@epita.fr>
14105
14106 * src/files.c (output_files): Free the output_obstack.
14107 * src/main.c (main): Call print and print_graph conditionally.
14108 * src/print.c (print): Work unconditionally.
14109 * src/print_graph.c (print_graph): Work unconditionally.
14110 * src/conflicts.c (log_resolution): Output only if verbose_flag.
14111
14112 2001-12-16 Marc Autret <autret_m@epita.fr>
14113
14114 * src/output.c (actions_output): Fix. When we use %no-lines,
14115 there is one less line per action.
14116
14117 2001-12-16 Marc Autret <autret_m@epita.fr>
14118
14119 * src/bison.simple: Remove a useless #line directive.
14120 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
14121 * src/output.c (get_lines_number): New.
14122 (output_parser): Adjust, now takes care about the lines of a
14123 output muscles.
14124 Fix line numbering.
14125 (actions_output): Computes the number of lines taken by actions.
14126 (output_master_parser): Insert new skeleton which is the name of
14127 the output parser file name.
14128
14129 2001-12-15 Marc Autret <autret_m@epita.fr>
14130
14131 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
14132
14133 2001-12-15 Marc Autret <autret_m@epita.fr>
14134
14135 * src/output.c (output_gram): Keep track of the hairy one.
14136
14137 2001-12-15 Akim Demaille <akim@epita.fr>
14138
14139 Make `make distcheck' work.
14140
14141 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
14142 system.h which uses libgettext.h.
14143
14144 2001-12-15 Akim Demaille <akim@epita.fr>
14145
14146 * src/nullable.c (set_nullable): Useless rules must be skipped,
14147 otherwise, since we range over their symbols, we might look at a
14148 nonterminal which no longer ``exists'', i.e., it is not counted in
14149 `nvars', hence we overflow our arrays.
14150
14151 2001-12-15 Akim Demaille <akim@epita.fr>
14152
14153 The header can also be produced directly, without any obstack!
14154 Yahoo!
14155
14156 * src/files.c, src/files.h (defines_obstack): Remove.
14157 (compute_header_macro): Global.
14158 (defines_obstack_save): Remove.
14159 * src/reader.c (parse_union_decl): No longer output to
14160 defines_obstack: its content can be found in the `stype' muscle
14161 anyway.
14162 (output_token_translations): Merge into...
14163 (symbols_output): this.
14164 Rename as...
14165 (symbols_save): this.
14166 (reader): Adjust.
14167 * src/output.c (header_output): New.
14168 (output): Call it.
14169
14170 2001-12-15 Akim Demaille <akim@epita.fr>
14171
14172 * src/reader.c (parse_union_decl): Instead of handling two obstack
14173 simultaneously, use one to define the `stype' muscle, and use the
14174 value of the latter to fill defines_obstack.
14175 (copy_comment): Remove.
14176 (copy_comment2): Work for a single obstack.
14177 Rename as...
14178 (copy_comment): this.
14179
14180 2001-12-15 Akim Demaille <akim@epita.fr>
14181
14182 * src/lex.c, src/lex.h (xgetc): No longer static.
14183 * src/reader.c (parse_union_decl): Revamp.
14184
14185 2001-12-15 Akim Demaille <akim@epita.fr>
14186
14187 Still making progress in separating Bison into (i) input, (ii)
14188 process, (iii) output: now we can directly output the parser file
14189 without using table_obstack at all.
14190
14191 * src/files.c, src/files.h (table_obstack): Bye bye.
14192 (parser_file_name): New.
14193 * src/files.c (compute_output_file_names): Compute it.
14194 * src/output.c (actions_output, output_parser)
14195 (output_master_parser): To a file instead of an obstack.
14196
14197 2001-12-15 Akim Demaille <akim@epita.fr>
14198
14199 Attach actions to rules, instead of pre-outputting them to
14200 actions_obstack.
14201
14202 * src/gram.h (rule_t): action and action_line are new members.
14203 * src/reader.c (symbol_list): Likewise.
14204 (copy_action): Save the actions within the rule.
14205 (packgram): Save them in rule_table.
14206 * src/output.c (actions_output): New.
14207 (output_parser): Use it on `%%actions'.
14208 (output_rule_data): Don't free rule_table.
14209 (output): Do it.
14210 (prepare): Don't save the `action' muscle.
14211 * src/bison.simple: s/%%action/%%actions/.
14212
14213 2001-12-15 Akim Demaille <akim@epita.fr>
14214
14215 * src/reader.c (copy_action): When --yacc, don't append a `;'
14216 to the user action: let it fail if lacking.
14217 Suggested by Arnold Robbins and Tom Tromey.
14218
14219 2001-12-14 Akim Demaille <akim@epita.fr>
14220
14221 * src/lex.c (literalchar): Simply return the char you decoded, non
14222 longer mess around with obstacks and int pointers.
14223 Adjust all callers.
14224
14225 2001-12-14 Akim Demaille <akim@epita.fr>
14226
14227 * src/lex.c (literalchar): Don't escape the special characters,
14228 just decode them, and keep them as char (before, eol was output as
14229 the 2 char string `\n' etc.).
14230 * src/output.c (output_rule_data): Use quotearg to output the
14231 token strings.
14232
14233 2001-12-13 Paul Eggert <eggert@twinsun.com>
14234
14235 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
14236 Do not infringe on the global user namespace when using C++.
14237 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
14238 All uses of `fprintf' and `stderr' changed.
14239
14240 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
14241
14242 2001-12-13 Akim Demaille <akim@epita.fr>
14243
14244 The computation of nullable is broken: it doesn't handle empty
14245 RHS's properly.
14246
14247 * tests/torture.at (GNU AWK Grammar): New.
14248 * tests/sets.at (Nullable): New.
14249 * src/nullable.c (set_nullable): Instead of blindly looping over
14250 `ritems', loop over the rules, and then over their rhs's.
14251
14252 Work around Autotest bugs.
14253
14254 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
14255 frame, because Autotest understand lines starting with a `+' as
14256 traces from the shell. Then, they are not processed properly.
14257 Admittedly an Autotest bug, but we don't have time to wait for
14258 Autotest to catch up.
14259 * tests/regression.at (Broken Closure): Adjust to the new table
14260 frames.
14261 Move to...
14262 * tests/sets.at: here.
14263
14264 2001-12-13 Akim Demaille <akim@epita.fr>
14265
14266 * src/closure.c (closure): Use nrules instead of playing tricks
14267 with BITS_PER_WORD.
14268
14269 2001-12-13 Akim Demaille <akim@epita.fr>
14270
14271 * src/print.c (print_actions): Output the handling of `$' as the
14272 traces do: shifting the token EOF. Before EOF was treated as a
14273 nonterminal.
14274 * tests/regression.at: Adjust some tests.
14275 * src/print_graph.c (print_core): Complete the set of items via
14276 closure. The next-to-final and final states are still unsatisfying,
14277 but that's to be addressed elsewhere.
14278 No longer output the rule numbers, but do output the state number.
14279 A single loop for the shifts + gotos is enough, but picked a
14280 distinct color for each.
14281 (print_graph): Initialize and finalize closure.
14282
14283 2001-12-13 Akim Demaille <akim@epita.fr>
14284
14285 * src/reader.c (readgram): Remove dead code, an strip useless
14286 braces.
14287 (get_type): Remove, unused.
14288
14289 2001-12-12 Akim Demaille <akim@epita.fr>
14290
14291 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
14292 on that of lib/error.c.
14293
14294 2001-12-12 Akim Demaille <akim@epita.fr>
14295
14296 Some hosts don't like `/' in includes.
14297
14298 * src/system.h: Include libgettext.h without qualifying the path.
14299 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
14300 $(top_srcdir).
14301
14302 2001-12-11 Marc Autret <autret_m@epita.fr>
14303
14304 * src/output.c (output_parser): Remove useless muscle.
14305
14306 2001-12-11 Marc Autret <autret_m@epita.fr>
14307
14308 * src/bison.simple: Remove #line just before %%epilogue. It
14309 is now handled in ...
14310 * src/reader.c (read_additionnal_code): Add the output of a
14311 #line for the epilogue.
14312
14313 2001-12-10 Marc Autret <autret_m@epita.fr>
14314
14315 * src/reader.c (copy_definition): Re-use CPP-outed code which
14316 replace precedent remove.
14317 * src/bison.simple: Remove #line before %%prologue because
14318 %%input-line is wrong at this time.
14319
14320 2001-12-10 Marc Autret <autret_m@epita.fr>
14321
14322 * src/reader.c (symbols_output): Clean up.
14323 * src/output.c (output_gram, output): Clean up.
14324
14325 2001-12-10 Akim Demaille <akim@epita.fr>
14326
14327 * src/lalr.c (initialize_lookaheads): New. Extracted from...
14328 * src/LR0.c (set_state_table): here.
14329 * src/lalr.c (lalr): Call it.
14330
14331 2001-12-10 Akim Demaille <akim@epita.fr>
14332
14333 * src/state.h (shifts): Remove the `number' member: shifts are
14334 attached to state, hence no longer need to be labelled with a
14335 state number.
14336
14337 2001-12-10 Akim Demaille <akim@epita.fr>
14338
14339 Now that states have a complete set of members, the linked list of
14340 shifts is useless: just fill directly the state's shifts member.
14341
14342 * src/state.h (shifts): Remove the `next' member.
14343 * src/LR0.c (first_state, last_state): Remove.
14344 Adjust the callers.
14345 (augment_automaton): Don't look for the shifts that must be added
14346 a shift on EOF: it is those of the state we looked for! But now,
14347 since shifts are attached, it is no longer needed to looking
14348 merely by its id: its number.
14349
14350 2001-12-10 Akim Demaille <akim@epita.fr>
14351
14352 * src/LR0.c (augment_automaton): Better variable locality.
14353 Remove an impossible branch: if there is a state corresponding to
14354 the start symbol being shifted, then there is shift for the start
14355 symbol from the initial state.
14356
14357 2001-12-10 Akim Demaille <akim@epita.fr>
14358
14359 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
14360 only when appropriate: when insert_start_shifting_state' is not
14361 invoked.
14362 * tests/regression.at (Rule Line Numbers): Adjust.
14363
14364 2001-12-10 Akim Demaille <akim@epita.fr>
14365
14366 * src/LR0.c (augment_automaton): Now that all states have shifts,
14367 merge the two cases addition shifts to the initial state.
14368
14369 2001-12-10 Akim Demaille <akim@epita.fr>
14370
14371 * src/lalr.c (set_state_table): Move to...
14372 * src/LR0.c: here.
14373 * src/lalr.c (lalr): Don't call it...
14374 * src/LR0.c (generate_states): do it.
14375 * src/LR0.h (first_state): Remove, only the table is used.
14376
14377 2001-12-10 Akim Demaille <akim@epita.fr>
14378
14379 * src/LR0.h (first_shift, first_reduction): Remove.
14380 * src/lalr.c: Don't use first_shift: find shifts through the
14381 states.
14382
14383 2001-12-10 Akim Demaille <akim@epita.fr>
14384
14385 * src/LR0.c: Attach shifts to states as soon as they are
14386 computed.
14387 * src/lalr.c (set_state_table): Instead of assigning shifts to
14388 state, just assert that the mapping was properly done.
14389
14390 2001-12-10 Akim Demaille <akim@epita.fr>
14391
14392 * src/LR0.c (insert_start_shift): Rename as...
14393 (insert_start_shifting_state): this.
14394 (insert_eof_shifting_state, insert_accepting_state): New.
14395 (augment_automaton): Adjust.
14396 Better locality of the variables.
14397 When looking if the start_symbol is shifted from the initial
14398 state, using `while (... symbol != start_symbol ...)' sounds
14399 better than `while (... symbol < start_symbol ...)': If fail
14400 to see how the order between symbols could be relevant!
14401
14402 2001-12-10 Akim Demaille <akim@epita.fr>
14403
14404 * src/getargs.h: Don't declare `spec_name_prefix' and
14405 `spec_file_prefix', declared by src/files.h.
14406 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
14407 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
14408 * src/output.c (prepare): Adjust.
14409 * src/reader.c (symbols_output): Likewise.
14410 * src/vmsgetargs.c: Vaguely adjust, but who cares?
14411
14412 2001-12-10 Akim Demaille <akim@epita.fr>
14413
14414 * src/muscle_tab.c (muscle_init): NULL is a better default than
14415 `"0"'.
14416
14417 2001-12-10 Akim Demaille <akim@epita.fr>
14418
14419 * src/reader.c (reader): Calling symbols_output once is enough.
14420
14421 2001-12-10 Akim Demaille <akim@epita.fr>
14422
14423 Now that states have a complete set of members, the linked list of
14424 reductions is useless: just fill directly the state's reductions
14425 member.
14426
14427 * src/state.h (struct reductions): Remove member `number' and
14428 `next'.
14429 * src/LR0.c (first_reduction, last_reduction): Remove.
14430 (save_reductions): Don't link the new reductions, store them in
14431 this_state.
14432 * src/lalr.c (set_state_table): No need to attach reductions to
14433 states, it's already done.
14434 * src/output.c (output_actions): No longer free the shifts, then
14435 the reductions, then the states: free all the states and their
14436 members.
14437
14438 2001-12-10 Akim Demaille <akim@epita.fr>
14439
14440 * src/options.c (OPTN, DRTV, BOTH): New.
14441 (option_table): Use them.
14442
14443 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
14444 the job of system.h.
14445 * src/options.c: Don't include stdio.h and xalloc.h for the same
14446 reasons.
14447
14448 2001-12-10 Akim Demaille <akim@epita.fr>
14449
14450 * src/output.c (output, prepare): Make sure the values of the
14451 muscles `action' and `prologue' are 0-terminated.
14452
14453 2001-12-10 Akim Demaille <akim@epita.fr>
14454
14455 Clean up GCC warnings.
14456
14457 * src/reader.c (copy_action): `buf' is not used.
14458 (parse_skel_decl): Be static.
14459 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
14460 * src/options.h (create_long_option_table): Have a real prototype.
14461 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
14462 (hash_delete_at): Return const void *.
14463 Adjust casts to preserve the const.
14464
14465 2001-12-10 Akim Demaille <akim@epita.fr>
14466
14467 * configure.in: Require 2.52g.
14468 M4 is not needed, but AUTOM4TE is.
14469 * m4/m4.m4: Remove.
14470 * tests/Makefile.am: Adjust.
14471
14472 2001-12-10 Akim Demaille <akim@epita.fr>
14473
14474 One structure for states is enough, even though theoretically
14475 there are LR(0) states and LALR(1) states.
14476
14477 * src/lalr.h (state_t): Remove.
14478 (state_table): Be state_t **, not state_t *.
14479 * src/state.h (core, CORE_ALLOC): Rename as...
14480 (state_t, STATE_ALLOC): this.
14481 Add the LALR(1) members: shifts, reductions, errs.
14482 * src/LR0.c (state_table): Rename as...
14483 (state_hash): this, to avoid name clashes with the global
14484 `state_table'.
14485 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
14486 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
14487
14488 2001-12-10 Akim Demaille <akim@epita.fr>
14489
14490 Bison dumps core on bash.y.
14491 Reported by Pascal Bart.
14492
14493 * src/warshall.c (bitmatrix_print): New.
14494 (TC): Use it.
14495 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
14496 j must be the outer loop.
14497 * tests/regression.at (Broken Closure): New.
14498
14499 2001-12-05 Akim Demaille <akim@epita.fr>
14500
14501 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
14502 its argument.
14503 Reported by Peter Hamorsky.
14504
14505 2001-12-05 Akim Demaille <akim@epita.fr>
14506
14507 * src/conflicts.c (err_table): Remove.
14508 (resolve_sr_conflict): Adjust.
14509 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
14510 Rename as...
14511 (state_t.reductions, state_t.shifts): this.
14512
14513 2001-12-05 Akim Demaille <akim@epita.fr>
14514
14515 * src/reduce.c (reduce_grammar_tables): No longer disable the
14516 removal of useless rules via CPP but via `if (0)', so that the
14517 compiler still check the code is valid.
14518 For instance, it should have noticed `rline' no longer exists: use
14519 the `line' member of rule_t.
14520 * src/gram.c (dummy, rline): Remove, unused.
14521
14522 2001-12-05 Akim Demaille <akim@epita.fr>
14523
14524 * src/output.c (pack_vector): Use assert, not berror.
14525 * src/main.c (berror): Remove, unused.
14526
14527 2001-12-05 Akim Demaille <akim@epita.fr>
14528
14529 New experimental feature: if --verbose --trace output all the
14530 items of a state, not only its kernel.
14531
14532 * src/print.c (print_core): If `trace_flag', then invoke closure
14533 before outputting the items of the state (print_core is no longer
14534 a correct name them).
14535 (print_results): Invoke new_closure/free_closure if needed.
14536
14537 2001-12-05 Akim Demaille <akim@epita.fr>
14538
14539 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
14540 * src/closure.c, src/closure.h (itemsetsize): Rename as...
14541 (nitemset): for consistency with the rest of the project.
14542
14543 2001-12-05 Akim Demaille <akim@epita.fr>
14544
14545 * src/closure.c (print_closure): Improve.
14546 (closure): Use it for printing input and output.
14547
14548 2001-12-05 Akim Demaille <akim@epita.fr>
14549
14550 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
14551 indexed by nonterminals.
14552
14553 2001-12-05 Akim Demaille <akim@epita.fr>
14554
14555 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
14556 what it was!).
14557 * src/warshall.h: Remove accidental duplication of the content.
14558
14559 2001-12-05 Akim Demaille <akim@epita.fr>
14560
14561 * src/closure.c (set_fderives): De-obfuscate.
14562
14563 2001-12-05 Akim Demaille <akim@epita.fr>
14564
14565 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
14566
14567 2001-12-05 Akim Demaille <akim@epita.fr>
14568
14569 * src/closure.c (set_firsts): De-obfuscate.
14570
14571 2001-12-05 Akim Demaille <akim@epita.fr>
14572
14573 * src/output.c (action_row): De-obfuscate
14574 using the good o' techniques: arrays not pointers, variable
14575 locality, BITISSET, RESETBIT etc.
14576
14577 2001-12-05 Akim Demaille <akim@epita.fr>
14578
14579 Pessimize the code to simplify it: from now on, all the states
14580 have a valid SHIFTS, which NSHIFTS is possibly 0.
14581
14582 * src/LR0.c (shifts_new): Be global and move to..
14583 * src/state.c, src/state.h: here.
14584 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
14585 * src/print_graph: Adjust.
14586
14587 2001-12-05 Akim Demaille <akim@epita.fr>
14588
14589 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
14590 * src/conflicts.c: Use it.
14591 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
14592 incorrectly ``simplified''.
14593
14594 2001-12-05 Akim Demaille <akim@epita.fr>
14595
14596 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
14597 using the good o' techniques: arrays not pointers, variable
14598 locality, BITISSET, RESETBIT etc.
14599
14600 2001-12-05 Akim Demaille <akim@epita.fr>
14601
14602 * src/state.h (SHIFT_SYMBOL): New.
14603 * src/conflicts.c: Use it to deobfuscate.
14604
14605 2001-12-05 Akim Demaille <akim@epita.fr>
14606
14607 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
14608 (print_reductions): De-obfuscate using the good o' techniques:
14609 arrays not pointers, variable locality, BITISSET.
14610
14611 2001-12-05 Akim Demaille <akim@epita.fr>
14612
14613 * src/conflicts.c (print_reductions): Arrays, not pointers.
14614 Use BITISSET.
14615
14616 2001-12-05 Akim Demaille <akim@epita.fr>
14617
14618 * src/conflicts.c (print_reductions): Pessimize, but clarify.
14619
14620 2001-12-05 Akim Demaille <akim@epita.fr>
14621
14622 * src/conflicts.c (print_reductions): Improve variable locality.
14623
14624 2001-12-05 Akim Demaille <akim@epita.fr>
14625
14626 * src/conflicts.c (print_reductions): Pessimize, but clarify.
14627
14628 2001-12-05 Akim Demaille <akim@epita.fr>
14629
14630 * src/conflicts.c (print_reductions): Improve variable locality.
14631
14632 2001-12-05 Akim Demaille <akim@epita.fr>
14633
14634 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
14635 * src/lalr.c: Use them.
14636
14637 2001-12-05 Akim Demaille <akim@epita.fr>
14638
14639 * src/LR0.c (augment_automaton): Formatting changes.
14640 Better variable locality.
14641
14642 2001-12-05 Akim Demaille <akim@epita.fr>
14643
14644 * src/lalr.c (matrix_print): New.
14645 (transpose): Use it.
14646 Use arrays instead of pointers.
14647
14648 2001-12-05 Akim Demaille <akim@epita.fr>
14649
14650 * src/lalr.c (maxrhs): Move to...
14651 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
14652 * src/lalr.c (build_relations): Adjust.
14653
14654 2001-12-05 Akim Demaille <akim@epita.fr>
14655
14656 * src/lalr.c (transpose): Free the memory allocated to the
14657 argument, as it is replaced by the results by the unique caller.
14658 (build_relations): Merely invoke transpose: it handles the memory
14659 deallocation.
14660 Improve variable locality.
14661 Avoid variables used as mere abbreviations.
14662 (compute_lookaheads): Use arrays instead of pointers.
14663
14664 2001-12-05 Akim Demaille <akim@epita.fr>
14665
14666 * src/lalr.c (initialize_F): Improve variable locality.
14667 Avoid variables used as mere abbreviations.
14668
14669 2001-12-05 Akim Demaille <akim@epita.fr>
14670
14671 * src/derives.c (print_derives): Display the ruleno.
14672 * src/lalr.c (initialize_F, transpose): Better variable locality
14673 to improve readability.
14674 Avoid variables used as mere abbreviations.
14675
14676 2001-12-05 Akim Demaille <akim@epita.fr>
14677
14678 * src/lalr.c (traverse): Use arrays instead of pointers.
14679
14680 2001-12-05 Akim Demaille <akim@epita.fr>
14681
14682 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
14683 the handling of squeue.
14684 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
14685
14686 2001-12-05 Akim Demaille <akim@epita.fr>
14687
14688 Because useless nonterminals are now kept alive (instead of being
14689 `destroyed'), we now sometimes examine them, and store information
14690 related to them. Hence we need to know their number, and adjust
14691 memory allocations.
14692
14693 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
14694 static.
14695 * src/LR0.c (allocate_itemsets): The memory allocated to
14696 `symbol_count' was used for two different purpose: once to count
14697 the number of occurrences of each symbol, and later reassigned to
14698 `shift_symbol', containing the symbol that can be shifted from a
14699 given state.
14700 Deobfuscate, i.e., allocate, use and free `symbol_count' here
14701 only, and...
14702 (new_itemsets): Allocate `shift_symbol' here.
14703 (allocate_itemsets): symbol_count includes useless nonterminals.
14704 Make room for them.
14705 (free_storage): Use `free', not `XFREE', for pointers that cannot
14706 be null.
14707
14708 2001-12-05 Akim Demaille <akim@epita.fr>
14709
14710 * src/nullable.c (set_nullable): Deobfuscate the handling of
14711 ritem.
14712 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
14713
14714 2001-12-05 Akim Demaille <akim@epita.fr>
14715
14716 * src/gram.c, src/gram.h (ritem_print): New.
14717 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
14718 (This useless function was defined only to work around VMS linkers
14719 that can't handle compilation units with variables only).
14720 * src/reduce.c (dump_grammar): Use it to trace the construction of
14721 ritem.
14722
14723 2001-12-04 Paul Eggert <eggert@twinsun.com>
14724
14725 * src/bison.simple (union yyalloc): Change member names
14726 to be the same as the stack names.
14727 (yyparse): yyptr is now union yyalloc *, not char *.
14728 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
14729 and may generate better code on some machines.
14730 (yystpcpy): Use prototype if __STDC__ is defined, not just
14731 if __cplusplus is defined.
14732
14733 2001-11-30 Akim Demaille <akim@epita.fr>
14734
14735 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
14736 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
14737 Gettext doesn't compile cleanly, and dies with -Werror.
14738 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
14739 Include WARNING_CFLAGS here.
14740 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
14741 before being defined.
14742
14743 2001-11-27 Paul Eggert <eggert@twinsun.com>
14744
14745 * lib/quotearg.h (quotearg_n, quotearg_n_style):
14746 First arg is int, not unsigned.
14747 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
14748 (SIZE_MAX, UINT_MAX): New macros.
14749 (quotearg_n_options): Abort if N is negative.
14750 Avoid overflow check on hosts where size_t is 64 bits and int
14751 is 32 bits, as overflow is impossible there.
14752 Fix off-by-one typo that caused unnecessary reallocation.
14753
14754 2001-11-29 Paul Eggert <eggert@twinsun.com>
14755
14756 Name space cleanup in generated parser.
14757
14758 * doc/bison.texinfo (Bison Parser): Discuss system headers
14759 and their effect on the user name space.
14760
14761 * src/bison.simple:
14762 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
14763 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
14764 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
14765
14766 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
14767 on user names when possible.
14768
14769 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
14770 Simplify test for whather <alloca.h> exists.
14771
14772 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
14773
14774 (<stdio.h>): Include if YYDEBUG.
14775
14776 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
14777 ! defined (yyoverflow) && ! defined (yymemcpy).
14778
14779 (yymemcpy, yyparse): Rename local variables as needed so that
14780 they all begin with 'yy'.
14781
14782 (yystrlen, yystpcpy): New functions.
14783
14784 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
14785 All uses changed.
14786
14787 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
14788 instead of relying on string.h functions. Use YYSTACK_ALLOC
14789 and YYSTACK_FREE instead of malloc and free.
14790
14791 2001-11-30 Akim Demaille <akim@epita.fr>
14792
14793 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
14794 before their first uses.
14795 (YYBISON, YYPURE): Move to the top of the output.
14796
14797 2001-11-30 Akim Demaille <akim@epita.fr>
14798
14799 * tests/reduce.at (Useless Nonterminals): Fix.
14800
14801 2001-11-30 Akim Demaille <akim@epita.fr>
14802
14803 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
14804 if body instead of `;' to pacify GCC's warnings.
14805
14806 2001-11-30 Akim Demaille <akim@epita.fr>
14807
14808 Instead of mapping the LHS of unused rules to -1, keep the LHS
14809 valid, but flag the rules as invalid.
14810
14811 * src/gram.h (rule_t): `useful' is a new member.
14812 * src/print.c (print_grammar): Adjust.
14813 * src/derives.c (set_derives): Likewise.
14814 * src/reader.c (packgram, reduce_output): Likewise.
14815 * src/reduce.c (reduce_grammar_tables): Likewise.
14816 * tests/reduce.at (Underivable Rules, Useless Rules): New.
14817
14818 2001-11-30 Akim Demaille <akim@epita.fr>
14819
14820 * src/reduce.c (reduce_output): Formatting changes.
14821 * src/print.c (print_results, print_grammar): Likewise.
14822 * tests/regression.at (Rule Line Numbers)
14823 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
14824
14825 2001-11-30 Akim Demaille <akim@epita.fr>
14826
14827 * src/reduce.c (nonterminals_reduce): Instead of throwing away
14828 useless nonterminals, move them at the end of the symbol arrays.
14829 (reduce_output): Adjust.
14830 * tests/reduce.at (Useless Nonterminals): Adjust.
14831
14832 2001-11-30 Akim Demaille <akim@epita.fr>
14833
14834 * src/reduce.c: Various comment/formatting changes.
14835 (nonterminals_reduce): New, extracted from...
14836 (reduce_grammar_tables): here.
14837 (reduce_grammar): Call nonterminals_reduce.
14838
14839 2001-11-29 Paul Eggert <eggert@twinsun.com>
14840
14841 * src/bison.simple (YYSTACK_REALLOC): Remove.
14842 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
14843 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
14844 New macros.
14845 (union yyalloc): New type.
14846 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
14847 an arbitrary restriction on hosts where size_t is wider than int.
14848
14849 (yyparse): Don't dump core if alloca or malloc fails; instead, report
14850 a parser stack overflow. Allocate just one block of memory for all
14851 three stacks, instead of allocating three blocks; this typically is
14852 faster and reduces fragmentation.
14853
14854 Do not limit the number of items in the stack to a value that fits
14855 in 'int', as this is an arbitrary limit on hosts with 64-bit
14856 size_t and 32-bit int.
14857
14858 2001-11-29 Marc Autret <autret_m@epita.fr>
14859
14860 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
14861 of defining YYERROR_VERBOSE.
14862 [AT_DATA]: $4 is now out of C declarations in the prologue.
14863
14864 2001-11-28 Marc Autret <autret_m@epita.fr>
14865
14866 * src/reader.c (parse_dquoted_param): New.
14867 (parse_skel_decl): Use it.
14868 * src/lex.h: Add its prototype.
14869 * src/lex.c (literalchar): Become not static.
14870
14871 2001-11-28 Marc Autret <autret_m@epita.fr>
14872
14873 * src/output.h: And put its extern declaration here.
14874 * src/output.c (error_verbose): Define here.
14875 (prepare): Echo name modification.
14876 * src/getargs.h: Clean its extern declaration.
14877 * src/getargs.c (error_verbose_flag): Remove.
14878 (getargs): Remove case 'e'.
14879 * src/options.c (option_table): 'error-verbose' is now seen as simple
14880 percent option.
14881 Include output.h.
14882
14883 * src/reader.c (read_declarations): Remove case tok_include.
14884 (parse_include_decl): Remove.
14885 * src/lex.h (token_t): Remove tok_include.
14886 * src/options.c (option_table): 'include' is now a simple command line
14887 option.
14888
14889 2001-11-28 Marc Autret <autret_m@epita.fr>
14890
14891 * src/bison.simple: Adjust muscle names.
14892 * src/muscle_tab.c (muscle_init): Also rename the muscles.
14893 * src/output.c (prepare): s/_/-/ for the muscles names.
14894 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
14895
14896 2001-11-28 Marc Autret <autret_m@epita.fr>
14897
14898 * src/bison.simple: Fix debug.
14899 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
14900
14901 2001-11-28 Akim Demaille <akim@epita.fr>
14902
14903 * src/LR0.c (shifts_new): New.
14904 (save_shifts, insert_start_shift, augment_automaton): Use it.
14905
14906 2001-11-28 Akim Demaille <akim@epita.fr>
14907
14908 * src/closure.c (closure): `b' and `ruleno' denote the same value:
14909 keep ruleno only.
14910
14911 2001-11-28 Akim Demaille <akim@epita.fr>
14912
14913 * src/closure.c (closure): Instead of looping over word in array
14914 then bits in words, loop over bits in array.
14915
14916 2001-11-28 Akim Demaille <akim@epita.fr>
14917
14918 * src/closure.c (closure): No longer optimize the special case
14919 where all the bits of `ruleset[r]' are set to 0, to make the code
14920 clearer.
14921
14922 2001-11-28 Akim Demaille <akim@epita.fr>
14923
14924 * src/closure.c (closure): `r' and `c' are new variables, used to
14925 de-obfuscate accesses to RULESET and CORE.
14926
14927 2001-11-28 Akim Demaille <akim@epita.fr>
14928
14929 * src/reduce.c (reduce_print): Use ngettext.
14930 (dump_grammar): Improve the trace accuracy.
14931
14932 2001-11-28 Akim Demaille <akim@epita.fr>
14933
14934 * src/reduce.c (dump_grammar): Don't translate trace messages.
14935
14936 2001-11-28 Akim Demaille <akim@epita.fr>
14937
14938 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
14939 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
14940 as all tags are free'ed afterwards.
14941 From Enrico Scholz.
14942
14943 2001-11-27 Paul Eggert <eggert@twinsun.com>
14944
14945 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
14946 use alloca when we didn't want to, and vice versa.
14947
14948 2001-11-27 Marc Autret <autret_m@epita.fr>
14949
14950 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
14951 initialization.
14952 * src/output.c (prepare): Remove its update.
14953
14954 2001-11-27 Marc Autret <autret_m@epita.fr>
14955
14956 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
14957 Use %error-verbose.
14958
14959 2001-11-27 Marc Autret <autret_m@epita.fr>
14960
14961 * src/bison.simple: Remove YYERROR_VERBOSE using.
14962 Use %%error_verbose.
14963 (yyparse): Likewise.
14964 * src/output.c (prepare): Give its final value.
14965 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
14966 * src/getargs.h: Add its extern declaration.
14967 * src/getargs.c (error_verbose_flag): New int.
14968 (getargs): Update to catch new case.
14969 * src/options.c (option_table): 'error-verbose' is a new option.
14970 (shortopts): Update.
14971
14972 2001-11-27 Akim Demaille <akim@epita.fr>
14973
14974 * src/system.h: Use intl/libgettext.h.
14975 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
14976
14977 2001-11-27 Akim Demaille <akim@epita.fr>
14978
14979 * tests/torture.at (Exploding the Stack Size with Malloc):
14980 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
14981
14982 2001-11-27 Akim Demaille <akim@epita.fr>
14983
14984 * src/files.c: Include error.h.
14985 Reported by Hans Aberg.
14986
14987 2001-11-26 Marc Autret <autret_m@epita.fr>
14988
14989 * src/reader.c (parse_include_decl): New, not yet implemented.
14990 (read_declarations): Add case tok_include.
14991 * src/getargs.h (include): Add its extern definition.
14992 * src/getargs.c (include): New const char *.
14993 (getargs): Add case '-I'.
14994 * src/options.c (option_table): Add include as command line and
14995 percent option.
14996 * src/lex.h (token_t): Add tok_include.
14997
14998 2001-11-26 Akim Demaille <akim@epita.fr>
14999
15000 * src/reader.c (readgram): Make sure rules for mid-rule actions
15001 have a lineno equal to that of their host rule.
15002 Reported by Hans Aberg.
15003 * tests/regression.at (Rule Line Numbers): New.
15004
15005 2001-11-26 Akim Demaille <akim@epita.fr>
15006
15007 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
15008 size_ts.
15009
15010 2001-11-26 Akim Demaille <akim@epita.fr>
15011
15012 * src/complain.c, src/complain.h (error): Remove, provided by
15013 lib/error.[ch].
15014
15015 2001-11-26 Akim Demaille <akim@epita.fr>
15016
15017 * src/reader.c (read_declarations): Don't abort on tok_illegal,
15018 issue an error message.
15019 * tests/regression.at (Invalid %directive): New.
15020 Reported by Hans Aberg.
15021
15022 2001-11-26 Akim Demaille <akim@epita.fr>
15023
15024 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
15025 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
15026
15027 2001-11-26 Akim Demaille <akim@epita.fr>
15028
15029 * src/conflicts.c (conflicts_print): Don't complain at all when
15030 there are no reduce/reduce conflicts, and as many shift/reduce
15031 conflicts as expected.
15032 * tests/regression.at (%expect right): Adjust.
15033
15034 2001-11-23 Akim Demaille <akim@epita.fr>
15035
15036 * lib/alloca.c: Update, from fileutils.
15037
15038 2001-11-23 Akim Demaille <akim@epita.fr>
15039
15040 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
15041
15042 2001-11-23 Akim Demaille <akim@epita.fr>
15043
15044 * src/system.h: Include alloca.h.
15045 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
15046
15047 2001-11-23 Akim Demaille <akim@epita.fr>
15048
15049 * src/print_graph.c (print_actions): Remove `rule', unused.
15050 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
15051 pacify GCC's signed < unsigned warnings.
15052 * src/closure.c (itemsetsize): Likewise.
15053 * src/reader.c (symbol_list_new): Static.
15054
15055 2001-11-23 Akim Demaille <akim@epita.fr>
15056
15057 Attaching lineno to buckets is stupid, since only one copy of each
15058 symbol is kept, only the line of the first occurrence is kept too.
15059
15060 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
15061 * src/reader.c (rline_allocated): Remove, unused.
15062 (symbol_list): Have a `line' member.
15063 (symbol_list_new): New.
15064 (readgram): Use it.
15065 * src/print.c (print_grammar): Output the rule line numbers.
15066 * tests/regression.at (Solved SR Conflicts)
15067 (Unresolved SR Conflicts): Adjust.
15068 Reported by Hans Aberg.
15069
15070 2001-11-22 Marc Autret <autret_m@epita.fr>
15071
15072 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
15073
15074 2001-11-22 Marc Autret <autret_m@epita.fr>
15075
15076 * src/muscle_tab.c (muscle_init): Remove initialization of
15077 skeleton muscle.
15078 * src/output.c (output_master_parser): Do it here.
15079
15080 2001-11-20 Akim Demaille <akim@epita.fr>
15081
15082 * po/sv.po: New.
15083 * configure.in (ALL_LINGUAS): Adjust.
15084 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
15085 longer contains strings to translate.
15086
15087 2001-11-19 Akim Demaille <akim@epita.fr>
15088
15089 * src/conflicts.c (conflicts_print): Add a missing \n.
15090
15091 2001-11-19 Akim Demaille <akim@epita.fr>
15092
15093 * src/nullable.c (nullable_print): New.
15094 (set_nullable): Call it when tracing.
15095 Better locality of variables.
15096
15097 2001-11-19 Akim Demaille <akim@epita.fr>
15098
15099 * src/print.c (print_actions): Better locality of variables.
15100
15101 2001-11-19 Akim Demaille <akim@epita.fr>
15102
15103 * src/derives.c (print_derives): Fix and enrich.
15104 * src/closure.c (print_fderives): Likewise.
15105
15106 2001-11-19 Akim Demaille <akim@epita.fr>
15107
15108 * src/closure.c (itemsetend): Remove, replaced with...
15109 (itemsetsize): new.
15110
15111 2001-11-19 Akim Demaille <akim@epita.fr>
15112
15113 * src/LR0.c (kernel_end): Remove, replaced with...
15114 (kernel_size): new.
15115
15116 2001-11-19 Akim Demaille <akim@epita.fr>
15117
15118 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
15119 to clarify.
15120
15121 2001-11-19 Akim Demaille <akim@epita.fr>
15122
15123 * src/closure.c (closure): Use arrays instead of pointers to clarify.
15124
15125 2001-11-19 Akim Demaille <akim@epita.fr>
15126
15127 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
15128 trace messages.
15129 * src/LR0.c: Likewise.
15130 (allocate_itemsets): Use arrays instead of pointers to clarify.
15131
15132 2001-11-19 Akim Demaille <akim@epita.fr>
15133
15134 * src/getargs.c (statistics_flag): Replace with...
15135 (trace_flag): New.
15136 (longopts): Accept --trace instead of --statistics.
15137 * src/getargs.h, src/options.c: Adjust.
15138 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
15139 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
15140
15141 2001-11-19 Akim Demaille <akim@epita.fr>
15142
15143 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
15144 pointers to clarify the code.
15145 (save_reductions, save_shifts): Factor common parts of alternatives.
15146
15147 2001-11-19 Akim Demaille <akim@epita.fr>
15148
15149 * src/LR0.c (new_state, get_state): Complete TRACE code.
15150 * src/closure.c: Include `reader.h' to get `tags', needed by the
15151 trace code.
15152 Rename the conditional DEBUG as TRACE.
15153 Output consistently TRACEs to stderr, not stdout.
15154 * src/derives.c: Likewise.
15155 * src/reduce.c: (inaccessable_symbols): Using if is better style
15156 than goto.
15157 Use `#if TRACE' instead of `#if 0' for tracing code.
15158
15159 2001-11-19 Akim Demaille <akim@epita.fr>
15160
15161 * src/system.h (LIST_FREE, shortcpy): New.
15162 * src/LR0.c: Use them.
15163 * src/output.c (free_itemsets, free_reductions, free_shifts):
15164 Remove, replaced by LIST_FREE.
15165
15166 2001-11-19 Akim Demaille <akim@epita.fr>
15167
15168 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
15169 (REDUCTIONS_ALLOC): New.
15170 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
15171 allocation.
15172
15173 2001-11-19 Akim Demaille <akim@epita.fr>
15174
15175 * src/LR0.c (new_state): Complete trace code.
15176 * src/nullable.c (set_nullable): Don't translate traces.
15177
15178 2001-11-19 Akim Demaille <akim@epita.fr>
15179
15180 * src/print_graph.c (print_core): Better locality of variables.
15181 * src/print.c (print_core): Likewise.
15182
15183 2001-11-19 Akim Demaille <akim@epita.fr>
15184
15185 * src/vcg.c: You do the output, so you are responsible of the
15186 handling of VCG syntax, in particular: use quotearg.
15187 * src/print_graph.c: Don't.
15188 (print_actions): Don't output the actions as part of the nodes,
15189 since that's the job of the edges.
15190 (print_state): Don't output by hand: fill the node description,
15191 and ask for its output.
15192
15193 2001-11-19 Akim Demaille <akim@epita.fr>
15194
15195 * src/bison.simple (yyparse): When verbosely reporting an error,
15196 no longer put additional quotes around token names.
15197 * tests/calc.at: Adjust.
15198
15199 2001-11-19 Akim Demaille <akim@epita.fr>
15200
15201 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
15202 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
15203 * src/output.c: Adjust.
15204
15205 2001-11-19 Akim Demaille <akim@epita.fr>
15206
15207 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
15208 (rule_t): this.
15209 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
15210
15211 2001-11-19 Akim Demaille <akim@epita.fr>
15212
15213 * src/gram.h (rule_t): New.
15214 (rule_table): New.
15215 (rrhs, rlhs): Remove, part of state_t.
15216 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
15217 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
15218 * src/reader.c, src/reduce.c: Adjust.
15219
15220 2001-11-19 Akim Demaille <akim@epita.fr>
15221
15222 * src/reader.c (symbols_output): New, extracted from...
15223 (packsymbols): Here.
15224 (reader): Call it.
15225
15226 2001-11-19 Akim Demaille <akim@epita.fr>
15227
15228 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
15229 (maxrhs): this new function.
15230
15231 2001-11-19 Akim Demaille <akim@epita.fr>
15232
15233 * src/lalr.c (F): New macro to access the variable F.
15234 Adjust.
15235
15236 2001-11-19 Akim Demaille <akim@epita.fr>
15237
15238 * src/lalr.h (LA): New macro to access the variable LA.
15239 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15240 * src/lalr.c: Adjust.
15241
15242 2001-11-19 Akim Demaille <akim@epita.fr>
15243
15244 * src/lalr.c (initialize_LA): Only initialize LA. Let...
15245 (set_state_table): handle the `lookaheads' members.
15246
15247 2001-11-19 Akim Demaille <akim@epita.fr>
15248
15249 * src/lalr.h (lookaheads): Removed array, whose contents is now
15250 a member of...
15251 (state_t): this structure.
15252 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15253 Adjust.
15254
15255 2001-11-19 Akim Demaille <akim@epita.fr>
15256
15257 * src/lalr.h (consistent): Removed array, whose contents is now
15258 a member of...
15259 (state_t): this structure.
15260 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15261 Adjust.
15262
15263 2001-11-19 Akim Demaille <akim@epita.fr>
15264
15265 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
15266 contents are now members of...
15267 (state_t): this structure.
15268 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
15269 Adjust.
15270
15271 2001-11-19 Akim Demaille <akim@epita.fr>
15272
15273 * src/lalr.h (state_t): New.
15274 (state_table): Be a state_t * instead of a core **.
15275 (accessing_symbol): Remove, part of state_t.
15276 * src/lalr.c: Adjust.
15277 (set_accessing_symbol): Merge into...
15278 (set_state_table): this.
15279 * src/print_graph.c, src/conflicts.c: Adjust.
15280
15281 2001-11-14 Akim Demaille <akim@epita.fr>
15282
15283 * tests/calc.at, tests/output.at, tests/regression.at,
15284 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
15285 now the tests are run in private dirs, therefore AC_CLEANUP and
15286 family can be simplified to 0-ary.
15287 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
15288 use abs. path to find config.h.
15289 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
15290 stderr, there can be way too much random noise.
15291 Instead pass -Werror to GCC and rely on the exit status.
15292 Reported by Wolfram Wagner.
15293
15294 2001-11-14 Akim Demaille <akim@epita.fr>
15295
15296 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
15297 defined only if yyoverflow is defined, to avoid `warning: unused
15298 variable `yyvs1''.
15299 Reported by The Test Suite.
15300
15301 2001-11-14 Akim Demaille <akim@epita.fr>
15302
15303 * src/print.c: Include reduce.h.
15304 Reported by Hans Aberg.
15305
15306 2001-11-14 Akim Demaille <akim@epita.fr>
15307
15308 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
15309 Revert a previous patch: these are really const.
15310 * src/conflicts.c (conflict_report): Additional useless pair of
15311 braces to pacify GCC's warnings for `if () if () {} else {}'.
15312 * src/lex.c (parse_percent_token): Replace equal_offset with
15313 arg_offset.
15314 arg is const.
15315 Be sure to strdup `arg' when used, since there is no reason for
15316 token_buffer not to change.
15317
15318 2001-11-14 Akim Demaille <akim@epita.fr>
15319
15320 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
15321 definition.
15322 * src/main.c (main): Use them.
15323 Suggested by Hans Aberg.
15324
15325 2001-11-12 Akim Demaille <akim@epita.fr>
15326
15327 * src/system.h (ngettext): Now that we use ngettext, be sure to
15328 provide a default definition when NLS are not used.
15329
15330 2001-11-12 Akim Demaille <akim@epita.fr>
15331
15332 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
15333 Use @kbd to denote user input.
15334 (Language and Grammar): ANSIfy the example.
15335 Adjust its layout for info/notinfo.
15336 (Location Tracking Calc): Output error messages to stderr.
15337 Output locations in a more GNUtically correct way.
15338 Fix a couple of Englishos.
15339 Adjust @group/@end group pairs.
15340
15341 2001-11-12 Akim Demaille <akim@epita.fr>
15342
15343 %expect was not functioning at all.
15344
15345 * src/conflicts.c (expected_conflicts): Set to -1.
15346 (conflict_report): Use ngettext.
15347 (conflicts_print): Check %expect and make its violation an error.
15348 * doc/bison.texinfo (Expect Decl): Adjust.
15349 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
15350 * tests/regression.at (%expect not enough, %expect right)
15351 (%expect too much): New.
15352
15353 2001-11-12 Akim Demaille <akim@epita.fr>
15354
15355 * tests/regression.at (Conflicts): Rename as...
15356 (Unresolved SR Conflicts): this.
15357 (Solved SR Conflicts): New.
15358
15359 2001-11-12 Akim Demaille <akim@epita.fr>
15360
15361 * src/reduce.c (print_results): Rename as...
15362 (reduce_output): This.
15363 Output to OUT, passed as argument, instead of output_obstack.
15364 (dump_grammar): Likewise.
15365 (reduce_free): New.
15366 Also free V1.
15367 (reduce_grammar): No longer call reduce_output, since...
15368 * src/print.c (print_results): do it.
15369 * src/main.c (main): Call reduce_free;
15370
15371 2001-11-12 Akim Demaille <akim@epita.fr>
15372
15373 * src/conflicts.c (print_reductions): Accept OUT as argument.
15374 Output to it, not to output_obstack.
15375 * src/print.c (print_actions): Adjust.
15376
15377 2001-11-12 Akim Demaille <akim@epita.fr>
15378
15379 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
15380 the result instead of using...
15381 (src_total, rrc_total, src_count, rrc_count): Remove.
15382 (any_conflicts): Remove.
15383 (print_conflicts): Split into...
15384 (conflicts_print, conflicts_output): New.
15385 * src/conflicts.h: Adjust.
15386 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
15387 * src/print.c (print_grammar): Issue `\n' between two rules.
15388 * tests/regression.at (Conflicts): New.
15389 Reported by Tom Lane.
15390
15391 2001-11-12 Akim Demaille <akim@epita.fr>
15392
15393 * tests/regression.at (Invalid input): Remove, duplicate with
15394 ``Invalid input: 1''.
15395
15396 2001-11-12 Akim Demaille <akim@epita.fr>
15397
15398 * tests/torture.at (AT_DATA_STACK_TORTURE)
15399 (Exploding the Stack Size with Alloca)
15400 (Exploding the Stack Size with Malloc): New.
15401
15402 2001-11-12 Akim Demaille <akim@epita.fr>
15403
15404 * src/bison.simple (YYSTACK_REALLOC): New.
15405 (yyparse) [!yyoverflow]: Use it and free the old stack.
15406 Reported by Per Allansson.
15407
15408 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
15409
15410 * src/bison.simple: Define type yystype instead of YYSTYPE, and
15411 define CPP macro, which substitute YYSTYPE by yystype.
15412 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
15413 with yyltype/YYLTYPE. This allows inclusion of the generated
15414 header within the parser if the compiler, such as GGC, accepts
15415 multiple equivalent #defines.
15416 From Akim.
15417
15418 2001-11-05 Akim Demaille <akim@epita.fr>
15419
15420 * src/reader.c (symbols_output): New, extracted from...
15421 (packsymbols): here.
15422 (reader): Adjust.
15423
15424 2001-11-05 Akim Demaille <akim@epita.fr>
15425
15426 * src/lex.c (parse_percent_token): s/quotearg/quote/.
15427
15428 2001-11-05 Akim Demaille <akim@epita.fr>
15429
15430 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
15431 pattern.
15432
15433 2001-11-05 Akim Demaille <akim@epita.fr>
15434
15435 * src/options.h (struct option_table_struct): set_flags is void*.
15436 * src/options.c (longopts): Support `--output' and `%output'.
15437 (usage): Adjust.
15438 * src/lex.h (tok_setopt): Remove, replaced with...
15439 (tok_intopt, tok_stropt): these new guys.
15440 * src/lex.c (getopt.h): Not needed.
15441 (token_buffer, unlexed_token_buffer): Not const.
15442 (percent_table): Promote `-' over `_' in directive names.
15443 Active `%name-prefix', `file-prefix', and `output'.
15444 (parse_percent_token): Accept possible arguments to directives.
15445 Promote `-' over `_' in directive names.
15446
15447 2001-11-04 Akim Demaille <akim@epita.fr>
15448
15449 * doc/bison.texinfo (Decl Summary): Split the list into
15450 `directives for grammars' and `directives for bison'.
15451 Sort'em.
15452 Add description of `%name-prefix', `file-prefix', and `output'.
15453 Promote `-' over `_' in directive names.
15454 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
15455 Simplify the description of `--name-prefix'.
15456 Promote `-' over `_' in directive names.
15457 Promote `--output' over `--output-file'.
15458 Fix the description of `--defines'.
15459 * tests/output.at: Exercise %file-prefix and %output.
15460
15461 2001-11-02 Akim Demaille <akim@epita.fr>
15462
15463 * doc/refcard.tex: Update.
15464
15465 2001-11-02 Akim Demaille <akim@epita.fr>
15466
15467 * src/symtab.h (SUNDEF): New.
15468 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
15469 stand for `uninitialized', instead of 0.
15470 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
15471 * src/lex.c (lex): Adjust.
15472
15473 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
15474 Number it 0.
15475 Let yylex return it instead of a plain 0.
15476 Reported by Dick Streefland.
15477
15478 2001-11-02 Akim Demaille <akim@epita.fr>
15479
15480 * tests/regression.at (Mixing %token styles): New test.
15481
15482 2001-11-02 Akim Demaille <akim@epita.fr>
15483
15484 * src/reader.c (parse_thong_decl): Formatting changes.
15485 (token_translations_init): New, extracted from...
15486 (packsymbols): Here.
15487 Adjust.
15488
15489 2001-11-01 Akim Demaille <akim@epita.fr>
15490
15491 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
15492 Check that `9foo.y' produces correct cpp guards.
15493 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
15494 guards.
15495 Reported by Wwp.
15496
15497 2001-11-01 Akim Demaille <akim@epita.fr>
15498
15499 * tests/regression.at (Invalid input: 2): New.
15500 * src/lex.c (unlexed_token_buffer): New.
15501 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
15502 too.
15503 Reported by Wwp.
15504
15505 2001-11-01 Akim Demaille <akim@epita.fr>
15506
15507 * tests/calc.at: Catch up with 1.30.
15508 * configure.in: Bump to 1.49a.
15509 Adjust to newer Autotest.
15510
15511 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
15512
15513 * src/conflicts.c: Move global variables rrc_total and src_total ...
15514 (print_conflicts): here.
15515 * src/output.c (output): Free global variable user_toknums.
15516 * src/lex.c (token_obstack): Become static.
15517
15518 2001-10-18 Akim Demaille <akim@epita.fr>
15519
15520 * tests/atlocal.in (GCC): Add.
15521 * tests/calc.at: s/m4_match/m4_bmatch/.
15522 s/m4_patsubst/m4_bpatsubst/.
15523 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
15524 * configure.in: AC_SUBST(GCC).
15525
15526 2001-10-14 Marc Autret <autret_m@epita.fr>
15527
15528 * src/options.c (create_long_option_table): Fix.
15529
15530 2001-10-10 Akim Demaille <akim@epita.fr>
15531
15532 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
15533
15534 2001-10-04 Akim Demaille <akim@epita.fr>
15535
15536 * src/reader.c (parse_union_decl): Push the caracters in
15537 union_obstack, not attrs_obstack.
15538
15539 2001-10-04 Akim Demaille <akim@epita.fr>
15540
15541 Merge in the branch 1.29.
15542
15543 * src/reader.c (packsymbols): Use a temporary obstack for
15544 `%%tokendef', since output_stack is already used elsewhere.
15545
15546 2001-10-02 Akim Demaille <akim@epita.fr>
15547
15548 Bump 1.29d.
15549
15550 2001-10-02 Akim Demaille <akim@epita.fr>
15551
15552 Version 1.29c.
15553
15554 2001-10-02 Akim Demaille <akim@epita.fr>
15555
15556 * tests/regression.at (Invalid CPP headers): New.
15557 From Alexander Belopolsky.
15558 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
15559
15560 2001-10-02 Akim Demaille <akim@epita.fr>
15561
15562 * tests/regression.at (Invalid input): New.
15563 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
15564 Reported by Shura.
15565
15566 2001-10-02 Akim Demaille <akim@epita.fr>
15567
15568 * tests/calc.at: Now that --debug works, the tests must be adjusted.
15569
15570 2001-10-02 Akim Demaille <akim@epita.fr>
15571
15572 * src/output.c (output_parser): Assert `skeleton'.
15573 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
15574 systems.
15575 From Shura.
15576
15577 2001-10-01 Marc Autret <autret_m@epita.fr>
15578
15579 * src/lex.h: Echo modifications.
15580 * src/lex.c (unlex): Parameter is now token_t.
15581 From Hans Aberg.
15582
15583 2001-10-01 Marc Autret <autret_m@epita.fr>
15584
15585 * src/main.c: Include lex.h.
15586 From Hans Aberg.
15587
15588 2001-09-29 Akim Demaille <akim@epita.fr>
15589
15590 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
15591
15592 2001-09-28 Akim Demaille <akim@epita.fr>
15593
15594 * tests/testsuite.at: Update to newer Autotest.
15595 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
15596
15597 2001-09-27 Akim Demaille <akim@epita.fr>
15598
15599 Position independent wrapper.
15600
15601 * tests/bison: Remove.
15602 * tests/bison.in: New.
15603 * configure.in: Adjust.
15604
15605 2001-09-27 Paul Eggert <eggert@twinsun.com>
15606
15607 Port quotearg fixes from tar 1.13.24.
15608
15609 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
15610 tm to be declared.
15611 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
15612 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
15613
15614 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
15615 * m4/mbrtowc.m4: New file.
15616 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
15617 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
15618
15619 2001-09-27 Akim Demaille <akim@epita.fr>
15620
15621 Bump to 1.29c.
15622
15623 2001-09-27 Akim Demaille <akim@epita.fr>
15624
15625 Version 1.29b.
15626
15627 2001-09-25 Akim Demaille <akim@epita.fr>
15628
15629 * src/system.h: Include `xalloc.h'.
15630 Remove it from the C files.
15631 * src/files.c (output_files): Free the obstacks.
15632 * src/lex.c (init_lex): Rename as...
15633 (lex_init): this.
15634 (lex_free): New.
15635 * src/main.c (main): Use it.
15636
15637 2001-09-24 Marc Autret <autret_m@epita.fr>
15638
15639 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
15640 to output informations in fout (FILE*).
15641 (open_graph, close_graph): Likewise.
15642 (output_graph, output_edge, output_node): Likewise.
15643 * src/vcg.h: Update function prototypes.
15644 * src/print_graph.c (print_graph): Open output graph file.
15645 (print_actions): Adjust.
15646 * src/files.h: Remove extern declaration.
15647 * src/files.c: Remove graph_obstack declaration.
15648 (open_files): Remove graph_obstack initialization.
15649 (output_files): Remove graph_obstack saving.
15650
15651 2001-09-24 Marc Autret <autret_m@epita.fr>
15652
15653 * src/files.c (compute_output_file_names): Fix.
15654
15655 2001-09-24 Marc Autret <autret_m@epita.fr>,
15656 Akim Demaille <akim@epita.fr>
15657
15658 * src/reader.c (reader): Remove call to free_symtab ().
15659 * src/main.c (main): Call it here.
15660 Include symtab.h.
15661 * src/conflicts.c (initialize_conflicts): Rename as...
15662 (solve_conflicts): this.
15663 * src/print.c (print_core, print_actions, print_state)
15664 (print_grammar): Dump to a file instead a `output_obstack'.
15665 (print_results): Dump `output_obstack', and then proceed with the
15666 FILE *.
15667 * src/files.c (compute_output_file_names, close_files): New.
15668 (output_files): Adjust.
15669 * src/main.c (main): Adjust.
15670
15671 2001-09-23 Marc Autret <autret_m@epita.fr>
15672
15673 * src/files.c (compute_header_macro): Computes header macro name
15674 from spec_defines_file when given.
15675
15676 2001-09-23 Marc Autret <autret_m@epita.fr>
15677
15678 * src/files.c (output_files): Add default extensions.
15679
15680 2001-09-22 Akim Demaille <akim@epita.fr>
15681
15682 * src/conflicts.c (finalize_conflicts): Rename as...
15683 (free_conflicts): this.
15684
15685 2001-09-22 Akim Demaille <akim@epita.fr>
15686
15687 * src/gram.c (gram_free): Rename back as...
15688 (dummy): this.
15689 (output_token_translations): Free `token_translations'.
15690 * src/symtab.c (free_symtab): Free the tag field.
15691
15692 2001-09-22 Akim Demaille <akim@epita.fr>
15693
15694 Remove `translations' as it is always set to true.
15695
15696 * src/gram.h: Adjust.
15697 * src/reader.c (packsymbols, parse_token_decl): Adjust
15698 * src/print.c (print_grammar): Adjust.
15699 * src/output.c (output_token_translations): Adjust.
15700 * src/lex.c (lex): Adjust.
15701 * src/gram.c: Be sure the set pointers to NULL.
15702 (dummy): Rename as...
15703 (gram_free): this.
15704
15705 2001-09-22 Akim Demaille <akim@epita.fr>
15706
15707 * configure.in: Invoke AM_LIB_DMALLOC.
15708 * src/system.h: Use dmalloc.
15709 * src/LR0.c: Be sure to have pointers initialized to NULL.
15710 (allocate_itemsets): Allocate kernel_items only if needed.
15711
15712 2001-09-22 Akim Demaille <akim@epita.fr>
15713
15714 * configure.in: Bump to 1.29b.
15715 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
15716 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
15717 need xmalloc.c in calc.y.
15718 From Pascal Bart.
15719
15720 2001-09-21 Akim Demaille <akim@epita.fr>
15721
15722 Version 1.29a.
15723 * Makefile.maint, config/config.guess, config/config.sub,
15724 * config/missing: Update from masters.
15725 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
15726 upon package.m4.
15727 * configure.in (ALL_LINGUAS): Add `tr'.
15728
15729 2001-09-21 Akim Demaille <akim@epita.fr>
15730
15731 * tests/Makefile.am (package.m4): Move to...
15732 ($(srcdir)/$(TESTSUITE)): here.
15733
15734 2001-09-20 Akim Demaille <akim@epita.fr>
15735
15736 * src/complain.c: No longer try to be standalone: use system.h.
15737 Don't assume __STDC__ is defined to 1. Just test if it is defined.
15738 * src/complain.h: Likewise.
15739 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
15740 Remove the unused variable `n'.
15741 From Albert Chin-A-Young.
15742
15743 2001-09-18 Marc Autret <autret_m@epita.fr>
15744
15745 * doc/bison.1: Update.
15746 * doc/bison.texinfo (Bison Options): Update --defines and --graph
15747 descriptions.
15748 (Option Cross Key): Update.
15749 Add --graph.
15750
15751 2001-09-18 Marc Autret <autret_m@epita.fr>
15752
15753 * tests/regression.at: New test (comment in %union).
15754
15755 2001-09-18 Marc Autret <autret_m@epita.fr>
15756
15757 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
15758 do that.
15759 Reported by Keith Browne.
15760
15761 2001-09-18 Marc Autret <autret_m@epita.fr>
15762
15763 * tests/output.at: Add tests for --defines and --graph.
15764
15765 2001-09-18 Marc Autret <autret_m@epita.fr>
15766
15767 * tests/output.at: Removes tests of %{header,src}_extension features.
15768
15769 2001-09-18 Akim Demaille <akim@epita.fr>
15770
15771 * tests/Makefile.am (package.m4): New.
15772 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
15773 (_AT_CHECK_CALC_ERROR): Likewise.
15774 Factor the `, ' part of verbose error messages.
15775
15776 2001-09-18 Marc Autret <autret_m@epita.fr>
15777
15778 * src/getargs.c (longopts): Declare --defines and --graph as options
15779 with optional arguments.
15780 * src/files.h: Add extern declarations.
15781 * src/files.c (spec_graph_file, spec_defines_file): New.
15782 (output_files): Update.
15783 Remove CPP-outed code.
15784
15785 2001-09-18 Marc Autret <autret_m@epita.fr>
15786
15787 Turn off %{source,header}_extension feature.
15788
15789 * src/files.c (compute_exts_from_gf): Update.
15790 (compute_exts_from_src): Update.
15791 (output_files): CPP-out useless code.
15792 * src/files.h: Remove {header,source}_extension extern declarations.
15793 * src/reader.c (parse_dquoted_param): CPP-out.
15794 (parse_header_extension_decl): Remove.
15795 (parse_source_extension_decl): Remove.
15796 (read_declarations): Remove cases tok_{hdrext,srcext}.
15797 * src/lex.c (percent_table): Remove {header,source}_extension entries.
15798 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
15799
15800 2001-09-10 Akim Demaille <akim@epita.fr>
15801
15802 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
15803 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
15804 (AT_CHECK_OUTPUT): this.
15805 Merely check ls' exit status, its output is useless.
15806
15807 2001-09-10 Akim Demaille <akim@epita.fr>
15808
15809 * tests/calc.at: Use m4_match.
15810 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
15811
15812 2001-09-10 Marc Autret <autret_m@epita.fr>,
15813 Akim Demaille <akim@epita.fr>
15814
15815 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
15816 enum color_e.
15817 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
15818 to `normal'.
15819 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
15820 * src/lex.h: Adjust prototype.
15821 (token_t): Add `tok_undef'.
15822 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
15823 (parse_percent_token): Now returns token_t.
15824 Add default statement in switch.
15825 (lex): Separate `c' as an input variable, from the token_t result
15826 part.
15827 (unlexed): Is a token_t.
15828
15829 2001-09-10 Akim Demaille <akim@epita.fr>
15830
15831 * configure.in: Bump to 1.29a.
15832
15833 2001-09-07 Akim Demaille <akim@epita.fr>
15834
15835 Version 1.29.
15836
15837 2001-08-30 Akim Demaille <akim@epita.fr>
15838
15839 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
15840 * m4/atconfig.m4: Remove.
15841 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
15842 * tests/bison: New.
15843 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
15844 m4_if, m4_patsubst, and m4_regexp.
15845 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
15846 `input' file instead of echo.
15847
15848 2001-08-29 Akim Demaille <akim@epita.fr>
15849
15850 Bump to 1.28e.
15851
15852 2001-08-29 Akim Demaille <akim@epita.fr>
15853
15854 Version 1.28d.
15855
15856 2001-08-29 Paul Eggert <eggert@twinsun.com>
15857
15858 * src/bison.simple (yyparse): Don't take the address of an
15859 item before the start of an array, as that doesn't conform to
15860 the C Standard.
15861
15862 2001-08-29 Robert Anisko <anisko_r@epita.fr>
15863
15864 * doc/bison.texinfo (Location Tracking Calc): New node.
15865
15866 2001-08-29 Paul Eggert <eggert@twinsun.com>
15867
15868 * src/output.c (output): Do not define const, as this now
15869 causes more problems than it cures.
15870
15871 2001-08-29 Akim Demaille <akim@epita.fr>
15872
15873 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
15874 the nodes.
15875 Be sure to tag the `detailmenu'.
15876
15877 2001-08-29 Akim Demaille <akim@epita.fr>
15878
15879 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
15880 download in a tmp dir.
15881
15882 2001-08-28 Marc Autret <autret_m@epita.fr>
15883
15884 * config/depcomp: New file.
15885
15886 2001-08-28 Marc Autret <autret_m@epita.fr>
15887
15888 * doc/bison.1 (mandoc): Adjust.
15889 From Juan Manuel Guerrero.
15890
15891 2001-08-28 Marc Autret <autret_m@epita.fr>
15892
15893 * src/print_graph.c (print_state): Fix.
15894
15895 2001-08-27 Marc Autret <autret_m@epita.fr>
15896
15897 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
15898 char * members.
15899 Echo modifications to the functions prototypes.
15900 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
15901
15902 2001-08-27 Marc Autret <autret_m@epita.fr>
15903
15904 * src/vcg.c: Include `xalloc.h'.
15905 (add_colorentry): New.
15906 (add_classname): New.
15907 (add_infoname): New.
15908 * src/vcg.h: Add new prototypes.
15909
15910 2001-08-27 Akim Demaille <akim@epita.fr>
15911
15912 * Makefile.maint: Sync. again with CVS Autoconf.
15913
15914 2001-08-27 Akim Demaille <akim@epita.fr>
15915
15916 * Makefile.maint: Formatting changes.
15917 (po-update, cvs-update, update): New targets.
15918 (AMTAR): Remove.
15919
15920 2001-08-27 Akim Demaille <akim@epita.fr>
15921
15922 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15923 * Makefile.maint: Sync. with CVS Autoconf.
15924
15925 2001-08-27 Marc Autret <autret_m@epita.fr>
15926
15927 * src/vcg.h (struct infoname_s): New.
15928 (struct colorentry_s): New.
15929 (graph_s): New fields {vertical,horizontal}_order in structure.
15930 Add `infoname' field.
15931 Add `colorentry' field;
15932 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
15933 (G_HORIZONTAL_ORDER): New.
15934 (G_INFONAME): New.
15935 (G_COLORENTRY): New.
15936 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
15937 Add output of `infoname'.
15938 Add output of `colorentry'.
15939
15940 2001-08-27 Marc Autret <autret_m@epita.fr>
15941
15942 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
15943 This one shadowed a global parameter.
15944
15945 2001-08-24 Marc Autret <autret_m@epita.fr>
15946
15947 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
15948 instead of `unsigned'.
15949 (print_state): Do not call obstack_object_size () in obstack_grow ()
15950 to avoid macro variables shadowing.
15951
15952 2001-08-23 Marc Autret <autret_m@epita.fr>
15953
15954 * src/lex.c (percent_table): Typo: s/naem/name/.
15955 Add graph option.
15956 Normalize new options declarations.
15957
15958 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
15959
15960 * tests/suite.at: Exercise %header_extension and %source_extension.
15961
15962 2001-08-16 Marc Autret <autret_m@epita.fr>
15963
15964 * src/reader.c (parse_dquoted_param): New.
15965 (parse_header_extension_decl): Use it.
15966 (parse_source_extension_decl): Likewise.
15967
15968 2001-08-16 Marc Autret <autret_m@epita.fr>
15969
15970 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
15971 (get_xxxx_str): Use assert () instead of complain ().
15972 Remove return invokations in default cases.
15973 (get_decision_str): Modify default behaviour. Remove second argument.
15974 Echo modifications on calls.
15975 (output_graph): Fix.
15976
15977 2001-08-16 Marc Autret <autret_m@epita.fr>
15978
15979 * src/getargs.c (usage): Update with ``-g, --graph''.
15980
15981 2001-08-16 Marc Autret <autret_m@epita.fr>
15982
15983 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
15984 (Option Cross Key): Likewise.
15985 * doc/bison.1: Update.
15986
15987 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
15988
15989 * src/output.c (output_master_parser): Don't finish action_obstack.
15990 (output_parser): Don't care about the muscle action, here.
15991 (prepare): Copy the action_obstack in the action muscle.
15992 (output): Free action_obstack.
15993
15994 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
15995
15996 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
15997 will contain `%union' declaration.
15998 (parse_union_decl): Delete #line directive output.
15999 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
16000 informations about %union.
16001 (parse_union_decl): Copy the union_obstack in the muscle stype.
16002 * src/bison.simple: Add new #line directive.
16003 Add typdef %%stype YYSTYPE.
16004
16005 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
16006
16007 * src/bison.simple: Add new `#line' directive.
16008
16009 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
16010
16011 * src/bison.simple: New `#line' directive.
16012 * src/output.c (output_parser): Support new dynamic muscle input_line.
16013
16014 2001-09-22 Marc Autret <autret_m@epita.fr>
16015
16016 * src/output.c (output_master_parser): New.
16017 (output_parser): Be more re-entrant.
16018
16019 2001-09-21 Marc Autret <autret_m@epita.fr>
16020
16021 * src/reader.c (copy_definition, parse_union_decl): Update and use
16022 `linef' muscle.
16023 (copy_action): Likewise.
16024 Use obstack_1grow ().
16025 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
16026
16027 2001-09-21 Marc Autret <autret_m@epita.fr>
16028
16029 * src/options.c (option_table): Adjust.
16030 * src/lex.c (parse_percent_token): Fix.
16031
16032 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
16033
16034 * src/options.c (symtab.h): Include it, need by lex.h.
16035
16036 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
16037
16038 * src/lex.c (parse_percent_token): Change type of variable `tx', which
16039 is now an option_table_struct*.
16040 (option_strcmp): New function option_strcmp.
16041 (parse_percent_token): Call option_strcmp.
16042 * src/getargs.c (xalloc.h, options.h): Include it.
16043 (getargs): Call create_long_option_table.
16044 (getargs): Free longopts at the end of the function.
16045 (shortopts): Move in options.c.
16046 * src/options.c (create_long_option_table): New function. Convert
16047 information from option_table to option structure.
16048 * src/reader.c (options.h): Include it.
16049
16050 * src/Makefile.am: Adjust.
16051 * src/options.c (option_table): Create from longopts and percent_table.
16052 * src/getargs.c (longopts): Delete.
16053 * src/lex.c (struct percent_table_struct): Delete.
16054 (percent_table): Delete.
16055 (options.h): Include it.
16056 * src/options.c: Create.
16057 * src/options.h: Create.
16058 Declare enum opt_access_e.
16059 Define struct option_table_struct.
16060
16061 2001-09-20 Marc Autret <autret_m@epita.fr>
16062
16063 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
16064 sections of Bison.
16065
16066 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
16067
16068 * src/bison.simple: s/%%filename/%%skeleton.
16069 * src/muscle_tab.c (getargs.h): Include it.
16070 (muscle_init): Insert new muscle skeleton.
16071
16072 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
16073
16074 * src/output.c (output_parser): Delete unused variable actions_dumped.
16075
16076 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
16077
16078 * src/output.c (output): Delete call to reader_output_yylsp.
16079 * src/reader.c (reader): Likewise.
16080 * src/reader.h: Delete declaration of reader_output_yylsp.
16081
16082 2001-09-02 Marc Autret <autret_m@epita.fr>
16083
16084 * src/reader.c: Include muscle_tab.h.
16085 (parse_union_decl): Update.
16086 (parse_macro_decl): Rename parse_muscle_decl.
16087 Update to use renamed functions and variable.
16088 (read_declarations, copy_action, read_additionnal_code, : Updated
16089 with correct variables and functions names.
16090 (packsymbols, reader): Likewise.
16091
16092 * src/reader.h (muscle_obstack): Extern declaration update.
16093
16094 * src/output.c: Include muscle_tab.h
16095 In all functions using macro_insert, change by using muscle_insert ().
16096 (macro_obstack): Rename muscle_obstack.
16097 Echo modifications in the whole file.
16098 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
16099 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
16100 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
16101
16102 * src/muscle_tab.h: Update double inclusion macros.
16103 (macro_entry_s): Rename muscle_entry_s.
16104 Update prototypes.
16105
16106 * src/muscle_tab.c: Include muscle_tab.h.
16107 Rename macro_tabble to muscle_table.
16108 (mhash1, mhash2, mcmp): Use muscle_entry.
16109 (macro_init): Rename muscle_init. Update.
16110 (macro_insert): Rename muscle_insert. Update.
16111 (macro_find): Rename muscle_find. Update.
16112
16113 * src/main.c: Include muscle_tab.h.
16114 (main): Call muscle_init ().
16115 * src/Makefile.am (bison_SOURCES): Echo modifications.
16116
16117 2001-09-02 Marc Autret <autret_m@epita.fr>
16118
16119 Now the files macro_tab.[ch] are named muscle_tab.[ch].
16120
16121 * src/muscle_tab.c, src/muscle_tab.h: Add files.
16122
16123 2001-09-02 Marc Autret <autret_m@epita.fr>
16124
16125 * src/macrotab.c, src/macrotab.h: Remove.
16126
16127 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
16128
16129 * src/reader.c (copy_guard): Use muscle to specify the `#line'
16130 filename.
16131
16132 2001-09-01 Marc Autret <autret_m@epita.fr>
16133
16134 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
16135 to an explicit value to activate the feature. We do it here.
16136
16137 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
16138
16139 * src/output.c (prepare): Delete the `filename' muscule insertion.
16140 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
16141 (parse_union_decl): Likewise.
16142 * src/macrotab.c (macro_init): Initialize filename by infile.
16143
16144 2001-08-31 Marc Autret <autret_m@epita.fr>
16145
16146 * src/bison.simple (YYLSP_NEEDED): New definition.
16147 * src/output.c (prepare): Add macro insertion of `locations_flag'
16148
16149 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
16150
16151 * src/output.c (prepare): Delete insertion of previous muscles,
16152 and insert the `prefix' muscles.
16153 * src/macrotab.c (macro_init): Likewise.
16154 (macro_init): Initialization prefix directive by `yy'.
16155 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
16156 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
16157 yylval, yydebug, yyerror, yynerrs and yyparse.
16158 New directive `#define' to substitute yydebug, ... with option
16159 name_prefix.
16160
16161 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
16162
16163 * src/main.c (main): Standardize.
16164 * src/output.c (output_table_data, output_parser): Likewise.
16165 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
16166
16167 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
16168
16169 * src/reader.c (read_additionnal_code): Rename %%user_code to
16170 %%epilogue.
16171 * src/output.c (output): Rename %%declarations to %%prologue.
16172 * src/bison.simple: Echo modifications.
16173
16174 2001-08-31 Marc Autret <autret_m@epita.fr>
16175
16176 * src/reader.c (readgram): CleanUp.
16177 (output_token_defines): Likewise.
16178 (packsymbols): Likewise.
16179 (reader): Likewise.
16180 * src/output.c (output): CPP-out useless code.
16181
16182 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
16183
16184 * src/reader.c (reader): Delete obsolete call to function
16185 output_trailers and output_headers.
16186 * src/output.h: Remove obsolete functions prototypes of output_headers
16187 and output_trailers.
16188
16189 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
16190
16191 * src/main.c: Include macrotab.h.
16192 * src/macrotab.h (macro_entry_s): Constify fields.
16193 Adjust functions prototypes.
16194 * src/macrotab.c (macro_insert): Constify key and value.
16195 (macro_find): Constify key.
16196 (macro_insert): Include 'xalloc.h'
16197 (macro_insert): Use XMALLOC.
16198 (macro_find): Constify return value.
16199 * src/output.c (output_table_data): Rename table to table_data.
16200 (output_parser): Constify macro_key, macro_value.
16201
16202 2001-08-30 Marc Autret <autret_m@epita.fr>
16203
16204 * src/reader.c (parse_skel_decl): New.
16205 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
16206 * src/lex.h (token_t): New token `tok_skel'.
16207 * src/lex.c (percent_table): Add skeleton option entry.
16208 Standardize.
16209
16210 2001-08-29 Marc Autret <autret_m@epita.fr>
16211
16212 * src/bison.simple: Add %%user_code directive at the end.
16213 * src/reader.c (read_additionnal_code): New.
16214 (reader): Use it.
16215 * src/output.c (output_program): Remove.
16216 (output): Update.
16217
16218 2001-08-28 Marc Autret <autret_m@epita.fr>
16219
16220 * src/output.c (output_actions): Clean up.
16221 (output_gram): CPP-out useless code.
16222 * src/reader.c (reader): Clean up, CPP-out useless code.
16223
16224 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
16225
16226 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
16227 directive.
16228 * src/bison.simple: Add `%%definitions'.
16229
16230 2001-08-28 Marc Autret <autret_m@epita.fr>
16231
16232 * config/depcomp: New file.
16233
16234 2001-08-27 Paul Eggert <eggert@twinsun.com>
16235
16236 * src/bison.simple (yyparse): Don't take the address of an
16237 item before the start of an array, as that doesn't conform to
16238 the C Standard.
16239
16240 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
16241
16242 * src/output.c (output): Remove the initialization of the macro
16243 obstack. It was done too late here.
16244
16245 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
16246 completely wrong.
16247 (reader): Initialize the macro obstack here, since we need it to grow
16248 '%define' directives.
16249
16250 * src/reader.h: Declare the macro obstack as extern.
16251
16252 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
16253
16254 * src/output.c (output_parser): Fix. Store single '%' characters in
16255 the output obstack instead of throwing them away.
16256
16257 2001-08-27 Akim Demaille <akim@epita.fr>
16258
16259 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
16260
16261 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16262
16263 * lib/Makefile.am: Adjust.
16264
16265 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16266
16267 * src/bison.simple: Update and add '%%' directives.
16268
16269 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16270
16271 * src/reader.c (reader): Remove calls to 'output_headers' and
16272 'output_trailers'. Remove some C output.
16273 (readgram): Disable a piece of code that was writing a default
16274 definition for 'YYSTYPE'.
16275 (reader_output_yylsp): Remove.
16276 (packsymbols): Output token defintions to a macro.
16277 (copy_definition): Disable C output.
16278
16279 * src/reader.c (parse_macro_decl): New function used to parse macro
16280 declarations.
16281 (copy_string2): Put the body of copy_string into this new function.
16282 Add a parameter to let the caller choose whether he wants to copy the
16283 string delimiters or not.
16284 (copy_string): Be a simple call to copy_string2 with the last argument
16285 bound to true.
16286 (read_declarations): Add case for macro definition.
16287 (copy_identifier): New.
16288 (parse_macro_decl): Read macro identifiers using copy_identifier
16289 rather than lex.
16290
16291 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16292
16293 * src/output.c (prepare): Add prefixed names.
16294 (output_parser): Output semantic actions.
16295 (output_parser): Fix bug on '%%line' directives.
16296
16297 * src/output.c (output_headers): Remove. The C code printed by this
16298 function should now be in the skeletons.
16299 (output_trailers): Remove.
16300 (output): Disable call to 'reader_output_yylsp'.
16301 (output_rule_data): Do not output tables to the table obstack.
16302
16303 * src/output.c: Remove some C dedicated output.
16304 Improve the use of macro and output obstacks.
16305 (output_defines): Remove.
16306
16307 * src/output.c (output_token_translations): Associate 'translate'
16308 table with a macro. No output to the table obstack.
16309 (output_gram): Same for 'rhs' and 'prhs'.
16310 (output_stos): Same for 'stos'.
16311 (output_rule_data): Same for 'r1' and 'r2'.
16312 (token_actions): Same for 'defact'.
16313 (goto_actions): Same for 'defgoto'.
16314 (output_base): Same for 'pact' and 'pgoto'.
16315 (output_table): Same for 'table'.
16316 (output_check): Same for 'check'.
16317
16318 * src/output.c (output_table_data): New function.
16319 (output_short_table): Remove.
16320 (output_short_or_char_table): Remove.
16321
16322 * src/output.c (output_parser): Replace most of the skeleton copy code
16323 with something new. Skeletons are now processed character by character
16324 rather than line by line, and Bison looks for '%%' macros. This is the
16325 first step in making Bison's output process (a lot) more flexible.
16326 (output_parser): Use the macro table.
16327
16328 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16329
16330 * src/main.c (main): Initialize the macro table.
16331
16332 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16333
16334 * src/lex.c (percent_table): Add tok_define.
16335 * src/lex.h: Add tok_define.
16336
16337 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16338
16339 * src/macrotab.c: New file.
16340 * src/macrotab.h: New file.
16341 * src/Makefile.am: Update.
16342
16343 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
16344
16345 * lib/hash.c: New file.
16346 * lib/hash.h: New file.
16347 * lib/Makefile.am: Update.
16348
16349 2001-08-15 Akim Demaille <akim@epita.fr>
16350
16351 Version 1.28c.
16352
16353 2001-08-15 Marc Autret <autret_m@epita.fr>
16354
16355 * src/reader.c (readgram): Indent output macro YYSTYPE.
16356 (packsymbols): Likewise.
16357 (output_token_defines): Likewise.
16358 * src/files.c: Standardize.
16359 (compute_header_macro): New.
16360 (defines_obstack_save): New. Use compute_header_macro.
16361 (output_files): Update. Use defines_obstack_save.
16362
16363 2001-08-15 Akim Demaille <akim@epita.fr>
16364
16365 * doc/bison.texinfo (Table of Symbols): Document
16366 YYSTACK_USE_ALLOCA.
16367
16368 2001-08-15 Akim Demaille <akim@epita.fr>
16369
16370 * missing: Update from CVS Automake.
16371 * config/config.guess, config/config.sub, config/texinfo.tex:
16372 Update from gnu.org.
16373
16374 2001-08-15 Akim Demaille <akim@epita.fr>
16375
16376 * Makefile.maint: Sync with CVS Autoconf.
16377
16378 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
16379
16380 * doc/bison.texinfo: Include GNU Free Documentation License from
16381 `fdl.texi'.
16382 * doc/fdl.texi: Add to package.
16383
16384 2001-08-14 Marc Autret <autret_m@epita.fr>
16385
16386 Turn on %{source,header}_extension features.
16387
16388 * src/lex.c (percent_table): Un-CPP out header_extension and
16389 source_extension.
16390 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
16391 (compute_exts_from_src): Remove conditions. It restores priorities
16392 between options.
16393
16394 2001-08-14 Marc Autret <autret_m@epita.fr>
16395
16396 * src/files.c (compute_base_names): Add extensions computing when
16397 `--file-prefix' used.
16398 Standardize function calls.
16399
16400 2001-08-13 Marc Autret <autret_m@epita.fr>
16401
16402 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
16403 defining it (defined but null disables alloca).
16404
16405 2001-08-13 Marc Autret <autret_m@epita.fr>
16406
16407 * src/bison.simple (_yy_memcpy): CPP reformat.
16408
16409 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
16410
16411 * tests/atconfig.in (CPPFLAGS): Fix.
16412
16413 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
16414
16415 * doc/bison.texinfo: Include GNU General Public License from
16416 `gpl.texi'.
16417 * doc/gpl.texi: Add to package.
16418
16419 2001-08-10 Marc Autret <autret_m@epita.fr>
16420
16421 * src/print_graph.h: Fix.
16422 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
16423
16424 2001-08-10 Akim Demaille <akim@epita.fr>
16425
16426 * src/system.h: Provide default declarations for stpcpy, strndup,
16427 and strnlen.
16428
16429 2001-08-10 Robert Anisko <anisko_r@epita.fr>
16430
16431 * doc/bison.texinfo (Locations): Update @$ stuff.
16432
16433 2001-08-09 Robert Anisko <anisko_r@epita.fr>
16434
16435 * src/bison.simple (YYLLOC_DEFAULT): Update.
16436 (yyparse): Adjust.
16437
16438 2001-08-08 Marc Autret <autret_m@epita.fr>
16439
16440 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
16441 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
16442 Reported by Fabrice Bauzac.
16443
16444 2001-08-08 Marc Autret <autret_m@epita.fr>
16445
16446 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
16447 * src/vcg.c (output_node): Fix.
16448 * src/vcg.h: Cleanup.
16449 * src/print_graph.c: Add comments.
16450 (node_output_size): New global variable. Simplify the formatting of
16451 the VCG graph output.
16452 (print_actions): Unused code is now used. It notifies the final state
16453 and no action states in the VCG graph. It also give the reduce actions.
16454 The `shift and goto' edges are red and the `go to state' edges are
16455 blue.
16456 Get the current node name and node_obstack by argument.
16457 (node_obstack): New variable.
16458 (print_state): Manage node_obstack.
16459 (print_core): Use node_obstack given by argument.
16460 A node is not only computed here but in print_actions also.
16461 (print_graph): CPP out useless code instead of commenting it.
16462
16463 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
16464
16465 * tests/atconfig.in (CPPFLAGS): Fix.
16466
16467 2001-08-07 Akim Demaille <akim@epita.fr>
16468
16469 * src/print_graph.c (quote): New.
16470 (print_core): Use it.
16471
16472 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
16473
16474 * src/vcg.c (complain.h): Include it.
16475 Unepitaize `return' invocations.
16476 [NDEBUG] (main): Remove.
16477 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
16478 * src/files.c (open_files): Initialize graph_obstack.
16479 * src/print_graph.c (print_actions): CPP out useless code.
16480 (print_core): Don't output the last `\n' in labels.
16481 Use `quote'.
16482 * src/files.c (output_files): Output the VCG file.
16483 * src/main.c (main): Invoke print_graph ();
16484
16485 2001-08-06 Marc Autret <autret_m@epita.fr>
16486
16487 Automaton VCG graph output.
16488 Using option ``-g'' or long option ``--graph'', you can generate
16489 a gram_filename.vcg file containing a VCG description of the LALR (1)
16490 automaton of your grammar.
16491
16492 * src/main.c: Call to print_graph() function.
16493 * src/getargs.h: Update.
16494 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
16495 (graph_flag): New flag.
16496 (longopts): Update.
16497 (getargs): Add case `g'.
16498 * src/files.c (graph_obstack): New obstack struct.
16499 (open_files): Initialize new obstack.
16500 (output_files): Saves graph_obstack if required.
16501 * src/files.h (graph_obstack): New extern declaration.
16502 * src/Makefile.am: Add new source files.
16503
16504 2001-08-06 Marc Autret <autret_m@epita.fr>
16505
16506 * src/print_graph.c, src/print_graph.h (graph): New.
16507 * src/vcg.h: New file.
16508 * src/vcg.c: New file, VCG graph handling.
16509
16510 2001-08-06 Marc Autret <autret_m@epita.fr>
16511
16512 Add of %source_extension and %header_extension which specify
16513 the source or/and the header output file extension.
16514
16515 * src/files.c (compute_base_names): Remove initialisation of
16516 src_extension and header_extension.
16517 (compute_exts_from_gf): Update.
16518 (compute_exts_from_src): Update.
16519 (output_files): Update.
16520 * src/reader.c (parse_header_extension_decl): New.
16521 (parse_source_extension_decl): New.
16522 (read_declarations): New case statements for the new tokens.
16523 * src/lex.c (percent_table): Add entries for %source_extension
16524 and %header_extension.
16525 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
16526
16527 2001-08-06 Marc Autret <autret_m@epita.fr>
16528
16529 * configure.in: Bump to 1.28c.
16530 * doc/bison.texinfo: Texinfo thingies.
16531
16532 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
16533
16534 * tests/atconfig.in (CPPFLAGS): Add.
16535 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
16536
16537 2001-08-03 Akim Demaille <akim@epita.fr>
16538
16539 Version 1.28b.
16540
16541 2001-08-03 Akim Demaille <akim@epita.fr>
16542
16543 * tests/Makefile.am (check-local): Ship testsuite.
16544 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
16545 Include `string.h'.
16546
16547 2001-08-03 Akim Demaille <akim@epita.fr>
16548
16549 * configure.in: Try using -Wformat when compiling.
16550
16551 2001-08-03 Akim Demaille <akim@epita.fr>
16552
16553 * configure.in: Bump to 1.28b.
16554
16555 2001-08-03 Akim Demaille <akim@epita.fr>
16556
16557 * src/complain.c: Adjust strerror_r portability issues.
16558
16559 2001-08-03 Akim Demaille <akim@epita.fr>
16560
16561 Version 1.28a.
16562
16563 2001-08-03 Akim Demaille <akim@epita.fr>
16564
16565 * src/getargs.c, src/getarg.h (skeleton)): Constify.
16566 * src/lex.c (literalchar): Avoid name clashes on `buf'.
16567 * src/getargs.c: Include complain.h.
16568 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
16569 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
16570
16571 2001-08-03 Akim Demaille <akim@epita.fr>
16572
16573 * src/reader.c (readgram): Display hidden chars in error messages.
16574
16575 2001-08-03 Akim Demaille <akim@epita.fr>
16576
16577 Update to gettext 0.10.39.
16578
16579 2001-08-03 Akim Demaille <akim@epita.fr>
16580
16581 * lib/strspn.c: New.
16582
16583 2001-08-01 Marc Autret <autret_m@epita.fr>
16584
16585 * doc/bison.texinfo: Update.
16586 * doc/bison.1 (mandoc): Update.
16587 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
16588 * src/files.c: Support output files extensions computing.
16589 (src_extension): New static variable.
16590 (header_extension): New static variable.
16591 (tr): New function.
16592 (get_extension_index): New function, gets the index of an extension
16593 filename in a string.
16594 (compute_exts_from_gf): New function, computes extensions from the
16595 grammar file extension.
16596 (compute_exts_from_src): New functions, computes extensions from the
16597 C source file extension, file given by ``-o'' option.
16598 (compute_base_names): Update.
16599 (output_files): Update.
16600
16601 2001-08-01 Robert Anisko <anisko_r@epita.fr>
16602
16603 * doc/bison.texi: Document @$.
16604 (Locations): New section.
16605
16606 2001-07-18 Akim Demaille <akim@epita.fr>
16607
16608 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
16609 * config/prev-version.txt, config/move-if-change: New.
16610 * Makefile.am: Adjust.
16611
16612 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
16613
16614 * src/bison.simple (yyparse): Suppress warning `comparaison
16615 between signed and unsigned'.
16616
16617 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
16618
16619 * src/getargs.h (raw_flag): Remove.
16620 * src/getargs.c: Die on `-r'/`--raw'.
16621 * src/lex.c (parse_percent_token): Die on `%raw'.
16622 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
16623 * tests/calc.at: Suppress test with option `--raw'.
16624
16625 2001-07-14 Akim Demaille <akim@epita.fr>
16626
16627 * config/: New.
16628 * configure.in: Require Autoconf 2.50.
16629 Update to gettext 0.10.38.
16630
16631 2001-03-16 Akim Demaille <akim@epita.fr>
16632
16633 * doc/bison.texinfo: ANSIfy the examples.
16634
16635 2001-03-16 Akim Demaille <akim@epita.fr>
16636
16637 * getargs.c (skeleton): New variable.
16638 (longopts): --skeleton is a new option.
16639 (shortopts, getargs): -S is a new option.
16640 * getargs.h: Declare skeleton.
16641 * output.c (output_parser): Use it.
16642
16643 2001-03-16 Akim Demaille <akim@epita.fr>
16644
16645 * m4/strerror_r.m4: New.
16646 * m4/error.m4: Run AC_FUNC_STRERROR_R.
16647 * lib/error.h, lib/error.c: Update.
16648
16649 2001-03-16 Akim Demaille <akim@epita.fr>
16650
16651 * src/getargs.c (longopts): Clean up.
16652
16653 2001-02-21 Akim Demaille <akim@epita.fr>
16654
16655 * src/reader.c (gensym): `gensym_count' is your own.
16656 Use a static buf to create the symbol name, as token_buffer is no
16657 longer a buffer.
16658
16659 2001-02-08 Akim Demaille <akim@epita.fr>
16660
16661 * src/conflicts.c (conflict_report): Be sure not to append to res
16662 between two calls, which could happen if both first sprintf were
16663 skipped, but not the first cp += strlen.
16664
16665 2001-02-08 Akim Demaille <akim@epita.fr>
16666
16667 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
16668 New, from fileutils 4.0.37.
16669 * configure.in: Require Autoconf 2.49c. I took some time before
16670 making this decision. This is the only way out for portability
16671 issues in Bison, it would mean way too much duplicate effort to
16672 import in Bison features implemented in 2.49c since 2.13.
16673 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
16674
16675 2001-02-02 Akim Demaille <akim@epita.fr>
16676
16677 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
16678 * lib/xalloc.h, lib/xmalloc.c: Update.
16679
16680 2001-01-19 Akim Demaille <akim@epita.fr>
16681
16682 Get rid of the ad hoc handling of token_buffer in the scanner: use
16683 the obstacks.
16684
16685 * src/lex.c (token_obstack): New.
16686 (init_lex): Initialize it. No longer call...
16687 (grow_token_buffer): this. Remove it.
16688 Adjust all the places which used it to use the obstack.
16689
16690 2001-01-19 Akim Demaille <akim@epita.fr>
16691
16692 * src/lex.h: Rename all the tokens:
16693 s/\bENDFILE\b/tok_eof/g;
16694 s/\bIDENTIFIER\b/tok_identifier/g;
16695 etc.
16696 Let them be enums, not #define, to ease debugging.
16697 Adjust all the code.
16698
16699 2001-01-18 Akim Demaille <akim@epita.fr>
16700
16701 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
16702 * src/lex.c (maxtoken, grow_token_buffer): Static.
16703
16704 2001-01-18 Akim Demaille <akim@epita.fr>
16705
16706 Since we now use obstacks, more % directives can be enabled.
16707
16708 * src/lex.c (percent_table): Also accept `%yacc',
16709 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
16710 `%debug'.
16711 Handle the actions for `%semantic_parser' and `%pure_parser' here,
16712 instead of returning a token.
16713 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
16714 * src/reader.c (read_declarations): Adjust.
16715 * src/files.c (open_files): Don't call `compute_base_names', don't
16716 compute `attrsfile' since they depend upon data which might be
16717 *in* the input file now.
16718 (output_files): Do it here.
16719 * src/output.c (output_headers): Document the fact that this patch
16720 introduces a guaranteed SEGV for semantic parsers.
16721 * doc/bison.texinfo: Document them.
16722 * tests/suite.at: Exercise these %options.
16723
16724 2000-12-20 Akim Demaille <akim@epita.fr>
16725
16726 Also handle the output file (--verbose) with obstacks.
16727
16728 * files.c (foutput): Remove.
16729 (output_obstack): New.
16730 Adjust all dependencies.
16731 * src/conflicts.c: Return a string.
16732 * src/system.h (obstack_grow_string): Rename as...
16733 (obstack_sgrow): this. Be ready to work with non literals.
16734 (obstack_fgrow4): New.
16735
16736 2000-12-20 Akim Demaille <akim@epita.fr>
16737
16738 * src/files.c (open_files): Fix the computation of short_base_name
16739 in the case of `-o foo.tab.c'.
16740
16741 2000-12-20 Akim Demaille <akim@epita.fr>
16742
16743 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
16744 (copy_dollar): Now that everything uses obstacks, get rid of the
16745 FILE * parameters.
16746
16747 2000-12-20 Akim Demaille <akim@epita.fr>
16748
16749 * src/files.c (open_files): Actually the `.output' file is based
16750 on the short_base_name, not base_name.
16751 * tests/suite.at (Checking output file names): Adjust.
16752
16753 2000-12-20 Akim Demaille <akim@epita.fr>
16754
16755 * src/bison.s1: Remove, we now use directly...
16756 * src/bison.simple: this.
16757 * src/Makefile.am: Use pkgdata instead of data.
16758
16759 2000-12-20 Akim Demaille <akim@epita.fr>
16760
16761 * src/files.c (guard_obstack): New.
16762 (open_files): Initialize it.
16763 (output_files): Dump it...
16764 * src/files.h: Export it.
16765 * src/reader.c (copy_guard): Use it.
16766
16767 2000-12-19 Akim Demaille <akim@epita.fr>
16768
16769 * src/files.c (outfile, defsfile, actfile): Removed as global
16770 vars.
16771 (open_files): Don't compute them.
16772 (output_files): Adjust.
16773 (base_name, short_base_name): Be global.
16774 Adjust dependencies.
16775
16776 2000-12-19 Akim Demaille <akim@epita.fr>
16777
16778 * src/files.c (strsuffix): New.
16779 (stringappend): Be just like strcat but allocate.
16780 (base_names): Eve out from open_files.
16781 Try to simplify the rather hairy computation of base_name and
16782 short_base_name.
16783 (open_files): Use it.
16784 * tests/suite.at (Checking output file names): New test.
16785
16786 2000-12-19 Akim Demaille <akim@epita.fr>
16787
16788 * src/system.h (obstack_grow_literal_string): Rename as...
16789 (obstack_grow_string): this.
16790 * src/output.c (output_parser): Recognize `%% actions' instead of
16791 `$'.
16792 * src/bison.s1: s/$/%% actions/.
16793 * src/bison.hairy: Likewise.
16794
16795 2000-12-19 Akim Demaille <akim@epita.fr>
16796
16797 * src/output.c (output_parser): Compute the `#line' lines when
16798 there are.
16799 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
16800 Suggested by Hans Aberg.
16801
16802 2000-12-19 Akim Demaille <akim@epita.fr>
16803
16804 Let the handling of the skeleton files be local to the procedures
16805 that use it.
16806
16807 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
16808 longer static.
16809 (fparser, open_extra_files): Remove.
16810 (open_files, output_files): Don't take care of fparser.
16811 * src/files.h: Adjust.
16812 * src/output.c (output_parser): Open and close the file to the
16813 skeleton.
16814 * src/reader.c (read_declarations): When %semantic_parser, open
16815 fguard.
16816
16817 2000-12-19 Akim Demaille <akim@epita.fr>
16818
16819 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
16820 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
16821
16822 2000-12-19 Akim Demaille <akim@epita.fr>
16823
16824 * src/files.c (open_files): Yipee! We no longer need all the code
16825 looking for `/tmp' since we have no tmp file.
16826
16827 2000-12-19 Akim Demaille <akim@epita.fr>
16828
16829 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
16830 New macros.
16831 * src/files.c (open_files): Less dependency on MSDOS etc.
16832
16833 2000-12-14 Akim Demaille <akim@epita.fr>
16834
16835 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
16836 Provide a default definition.
16837 Use it when executing the default @ action.
16838 * src/reader.c (reader_output_yylsp): No longer include
16839 `timestamp' and `text' in the default YYLTYPE.
16840
16841 2000-12-12 Akim Demaille <akim@epita.fr>
16842
16843 * src/reader.c (copy_definition, parse_union_decl, copy_action)
16844 (copy_guard): Quote the file names.
16845 Reported by Laurent Mascherpa.
16846
16847 2000-12-12 Akim Demaille <akim@epita.fr>
16848
16849 * src/output.c (output_headers, output_program, output): Be sure
16850 to escape special characters when outputting filenames.
16851 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
16852 (output_headers): Don't depend on them, Use ACTSTR.
16853
16854 2000-11-17 Akim Demaille <akim@epita.fr>
16855
16856 * lib/obstack.h: Formatting changes.
16857 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
16858 prevents type checking.
16859 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
16860 cast the value to (void *): assigning a `foo *' to a `void *'
16861 variable is valid.
16862 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
16863 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
16864 append characters.
16865
16866 2000-11-17 Akim Demaille <akim@epita.fr>
16867
16868 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
16869 as...
16870 (suite.m4, regression.m4, calc.m4): these.
16871 * tests/atgeneral.m4: Update from CVS Autoconf.
16872
16873 2000-11-17 Akim Demaille <akim@epita.fr>
16874
16875 * tests/regression.m4 (%union and --defines): New test,
16876 demonstrating a current bug in the obstack implementation.
16877
16878 2000-11-17 Akim Demaille <akim@epita.fr>
16879
16880 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
16881 macros.
16882 Use them to declare the variables which are global or local to
16883 `yyparse'.
16884
16885 2000-11-17 Akim Demaille <akim@epita.fr>
16886
16887 * acconfig.h: Remove, no longer used.
16888
16889 2000-11-07 Akim Demaille <akim@epita.fr>
16890
16891 * src: s/Copyright (C)/Copyright/g.
16892
16893 2000-11-07 Akim Demaille <akim@epita.fr>
16894
16895 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
16896 defining.
16897 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
16898
16899 2000-11-07 Akim Demaille <akim@epita.fr>
16900
16901 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
16902 Merge in a single CPP if/else.
16903
16904 2000-11-07 Akim Demaille <akim@epita.fr>
16905
16906 * src/output.c (output): Remove useless variables.
16907 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
16908 argument `data' for consistency with the prototypes.
16909 Qualify it `const'.
16910 (obstack_copy, obstack_copy0): Rename the second argument as
16911 `address' for consistency. Qualify it `const'.
16912 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
16913 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
16914 `const' their input argument (`data' or `address').
16915 Adjust the corresponding macros to include `const' in casts.
16916
16917 2000-11-03 Akim Demaille <akim@epita.fr>
16918
16919 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
16920 s/PFILE1/BISON_HAIRY/.
16921 Adjust dependencies.
16922
16923 2000-11-03 Akim Demaille <akim@epita.fr>
16924
16925 For some reason, this was not applied.
16926
16927 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16928 `unlink': it's no longer used.
16929
16930 2000-11-03 Akim Demaille <akim@epita.fr>
16931
16932 * src/files.c (skeleton_find): New function, eved out of...
16933 (open_files, open_extra_files): here.
16934
16935 2000-11-03 Akim Demaille <akim@epita.fr>
16936
16937 Don't use `atexit'.
16938
16939 * src/files.c (obstack_save): New function.
16940 (done): Rename as...
16941 (output_files): this.
16942 Use `obstack_save'.
16943 * src/main.c (main): Don't use `atexit' to register `done', since
16944 it no longer has to remove tmp files, just call `output_files'
16945 when there are no errors.
16946
16947 2000-11-02 Akim Demaille <akim@epita.fr>
16948
16949 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16950 `unlink': it's no longer used.
16951 * src/files.h: Formatting changes.
16952
16953 2000-11-02 Akim Demaille <akim@epita.fr>
16954
16955 Remove the last uses of mktemp and unlink/delete.
16956
16957 * src/files.c (fdefines, ftable): Removed.
16958 (defines_ostack, table_obstack): New.
16959 Adjust dependencies of the former into uses of the latter.
16960 * src/output.c (output_short_or_char_table, output_short_table):
16961 Convert to using obstacks.
16962 * src/reader.c (copy_comment2): Accept one FILE * and two
16963 obstacks.
16964 (output_token_defines, reader_output_yylsp): Use obstacks.
16965 * src/system.h (obstack_fgrow3): New.
16966 * po/POTFILES.in: Adjust.
16967
16968 2000-11-01 Akim Demaille <akim@epita.fr>
16969
16970 Change each use of `fattrs' into a use of `attrs_obstack'.
16971
16972 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
16973 * src/files.c (fattrs): Remove.
16974 (attrs_obstack): New.
16975 Adjust all dependencies.
16976 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
16977
16978 2000-11-01 Akim Demaille <akim@epita.fr>
16979
16980 Introduce obstacks.
16981 Change each use of `faction' into a use of `action_obstack'.
16982
16983 * lib/obstack.h, lib/obstack.c: New files.
16984 * src/files.c (faction): Remove.
16985 (action_obstack): New.
16986 Adjust all dependencies.
16987
16988 2000-10-20 Akim Demaille <akim@epita.fr>
16989
16990 * lib/quote.h (PARAMS): New macro. Use it.
16991
16992 2000-10-16 Akim Demaille <akim@epita.fr>
16993
16994 * src/output.c (output_short_or_char_table): New function.
16995 (output_short_table, output_token_translations): Use it.
16996 (goto_actions): Use output_short_table.
16997
16998 2000-10-16 Akim Demaille <akim@epita.fr>
16999
17000 * src/symtab.c (bucket_new): New function.
17001 (getsym): Use it.
17002
17003 * src/output.c (output_short_table): New argument to display the
17004 comment associated with the table.
17005 Adjust dependencies.
17006 (output_gram): Use it.
17007 (output_rule_data): Nicer output layout for YYTNAME.
17008
17009 2000-10-16 Akim Demaille <akim@epita.fr>
17010
17011 * src/lex.c (read_typename): New function.
17012 (lex): Use it.
17013 * src/reader.c (copy_dollar): Likewise.
17014
17015 2000-10-16 Akim Demaille <akim@epita.fr>
17016
17017 * src/reader.c (copy_comment2): Expect the input stream to be on
17018 the `/' which is suspected to open a comment, instead of being
17019 called after `//' or `/*' was read.
17020 (copy_comment, copy_definition, parse_union_decl, copy_action)
17021 (copy_guard): Adjust.
17022
17023 2000-10-16 Akim Demaille <akim@epita.fr>
17024
17025 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
17026 `read_signed_integer'.
17027
17028 2000-10-16 Akim Demaille <akim@epita.fr>
17029
17030 * src/reader.c (copy_dollar): New function.
17031 (copy_guard, copy_action): Use it.
17032
17033 2000-10-16 Akim Demaille <akim@epita.fr>
17034
17035 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
17036 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
17037 New files, from Fileutils 4.0.27.
17038 * src/main.c (printable_version): Remove.
17039 * src/lex.c, src/reader.c: Use `quote'.
17040
17041 2000-10-04 Akim Demaille <akim@epita.fr>
17042
17043 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
17044
17045 2000-10-04 Akim Demaille <akim@epita.fr>
17046
17047 * doc/bison.texinfo: Various typos spotted by Neil Booth.
17048
17049 2000-10-04 Akim Demaille <akim@epita.fr>
17050
17051 When a literal string is used to define two different tokens,
17052 `bison -v' segfaults.
17053 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
17054
17055 * tests/regression.m4: New file.
17056 Include the core of the sample provided by Piotr Gackiewicz.
17057 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
17058 properly.
17059
17060 2000-10-04 Akim Demaille <akim@epita.fr>
17061
17062 * src/reader.c (parse_expect_decl): Keep `count' within the size
17063 of `buffer'.
17064 From Neil Booth.
17065
17066 2000-10-02 Paul Eggert <eggert@twinsun.com>
17067
17068 * bison.s1 (yyparse): Assign the default value
17069 unconditionally, to avoid a GCC warning and make the parser a
17070 tad smaller.
17071
17072 2000-10-02 Akim Demaille <akim@epita.fr>
17073
17074 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
17075 options.
17076
17077 2000-10-02 Akim Demaille <akim@epita.fr>
17078
17079 * src/derives.c, src/print.c, src/reduce.c: To ease the
17080 translation, move some `\n' out of the translated strings.
17081
17082 2000-10-02 Akim Demaille <akim@epita.fr>
17083
17084 The location tracking mechanism is precious for parse error
17085 messages. Nevertheless, it is enabled only when `@n' is used in
17086 the grammar, which is a different issue (you can use it in error
17087 message, but not in the grammar per se). Therefore, there should
17088 be another means to enable it.
17089
17090 * src/getargs.c (getargs): Support `--locations'.
17091 (usage): Report it.
17092 * src/getargs.h (locationsflag): Export it.
17093 * src/lex.c (percent_table): Support `%locations'.
17094 * src/reader.c (yylsp_needed): Remove this variable, now replaced
17095 with `locationsflag'.
17096 * doc/bison.texinfo: Document `--locations' and `%locations'.
17097 Sort the options.
17098 * tests/calc.m4: Test it.
17099
17100 For regularity of the names, replace each
17101 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
17102 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
17103 In addition replace each `flag' with `_flag'.
17104
17105 2000-10-02 Akim Demaille <akim@epita.fr>
17106
17107 Also test parse error messages, including with YYERROR_VERBOSE.
17108
17109 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
17110 associative).
17111 Use it to check the computations.
17112 Use it to check `nonassoc' is honored.
17113 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
17114 `--yyerror-verbose'.
17115 (_AT_CHECK_CALC): Adjust to this option.
17116 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
17117
17118 2000-10-02 Akim Demaille <akim@epita.fr>
17119
17120 Test also `--verbose', `--defines' and `--name-prefix'. Testing
17121 the latter demonstrates a flaw in the handling of non debugging
17122 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
17123 was used in order to simplify:
17124
17125 #if YYDEBUG
17126 if (yydebug)
17127 {
17128 ...
17129 }
17130 #endif
17131
17132 into
17133
17134 if (yydebug)
17135 {
17136 ...
17137 }
17138
17139 unfortunately this leads to a CPP conflict when
17140 `--name-prefix=foo' is used since it produces `#define yydebug
17141 foodebug'.
17142
17143 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
17144 (YYDPRINTF): New macro.
17145 Spread its use.
17146 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
17147 the bison options.
17148 Also test `--verbose', `--defines' and `--name-prefix'.
17149
17150 2000-10-02 Akim Demaille <akim@epita.fr>
17151
17152 Improve the readability of the produced parsers.
17153
17154 * src/bison.s1: Formatting changes.
17155 Improve the comment related to the `$' mark.
17156 (yydefault): Don't fall through to `yyresume': `goto' there.
17157 * src/output.c (output_parser): When the `$' is met, skip the end
17158 of its line.
17159 New variable, `number_of_dollar_signs', to check there's exactly
17160 one `$' in the parser skeleton.
17161
17162 2000-10-02 Akim Demaille <akim@epita.fr>
17163
17164 * lib/xstrdup.c: New file, from the fileutils.
17165 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
17166 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
17167 instead of strlen + xmalloc + strcpy.
17168 * src/symtab.c (copys): Remove, use xstrdup instead.
17169
17170 2000-10-02 Akim Demaille <akim@epita.fr>
17171
17172 * src/gram.h (associativity): New enum type which replaces the
17173 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
17174 `right_assoc', `left_assoc' and `non_assoc'.
17175 Adjust all dependencies.
17176 * src/reader.c: Formatting changes.
17177 (LTYPESTR): Don't define it, use it as a literal in
17178 `reader_output_yylsp'.
17179 * src/symtab.h (symbol_class): New enum type which replaces the
17180 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
17181 `sunknown', `stoken and `snterm'.
17182
17183 2000-10-02 Akim Demaille <akim@epita.fr>
17184
17185 * src/getargs.c (fixed_outfiles): Rename as...
17186 (yaccflag): for consistency and accuracy.
17187 Adjust dependencies.
17188
17189 2000-10-02 Akim Demaille <akim@epita.fr>
17190
17191 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
17192 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
17193 difficult and introduced a lot of core dump. It turns out that
17194 Bison used an implementation of `xmalloc' based on `calloc', and
17195 at various places it does depend upon the initialization to 0. I
17196 have not tried to isolate the pertinent places, and all the former
17197 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
17198 someone should address this issue.
17199
17200 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
17201 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
17202 files.
17203 Adjust dependencies.
17204 * src/warshall.h: New file.
17205 Propagate.
17206
17207 2000-10-02 Akim Demaille <akim@epita.fr>
17208
17209 Various anti-`extern in *.c' changes.
17210
17211 * src/system.h: Include `assert.h'.
17212
17213 2000-10-02 Akim Demaille <akim@epita.fr>
17214
17215 * src/state.h (nstates, final_state, first_state, first_shift)
17216 (first_reduction): Move their exportation from here...
17217 * src/LR0.h: to here.
17218 Adjust dependencies.
17219 * src/getargs.c (statisticsflag): New variable.
17220 Add support for `--statistics'.
17221 Adjust dependencies.
17222
17223 Remove a lot of now useless `extern' statements in most files.
17224
17225 2000-10-02 Akim Demaille <akim@epita.fr>
17226
17227 * src/LR0.h: New file.
17228 Propagate its use.
17229
17230 2000-10-02 Akim Demaille <akim@epita.fr>
17231
17232 * src/print.h: New file.
17233 Propagate its use.
17234 * src/print.c: Formatting and ordering changes.
17235 (verbose, terse): Replace with...
17236 (print_results): this new function.
17237 Adjust dependencies.
17238
17239 2000-10-02 Akim Demaille <akim@epita.fr>
17240
17241 * src/conflicts.c (conflict_report): New function.
17242 (conflict_log, verbose_conflict_log): Replace with...
17243 (print_conflicts): this function.
17244 Adjust dependencies.
17245 * src/conflicts.h: New file.
17246 Propagate its inclusion.
17247
17248 2000-10-02 Akim Demaille <akim@epita.fr>
17249
17250 * src/nullable.h: New file.
17251 Propagate its inclusion.
17252 * src/nullable.c: Formatting changes.
17253
17254 2000-10-02 Akim Demaille <akim@epita.fr>
17255
17256 * src/reduce.h: New file.
17257 Propagate its inclusion.
17258 * src/reduce.c: Topological sort and other formatting changes.
17259 (bool, TRUE, FALSE): Move their definition to...
17260 * src/system.h: here.
17261
17262 2000-10-02 Akim Demaille <akim@epita.fr>
17263
17264 * src/files.c: Formatting changes.
17265 (tryopen, tryclose, openfiles): Rename as...
17266 (xfopen, xfclose, open_files): this.
17267 (stringappend): static.
17268 * src/files.h: Complete the list of exported symbols.
17269 Propagate its use.
17270
17271 2000-10-02 Akim Demaille <akim@epita.fr>
17272
17273 * src/reader.h: New file.
17274 Propagate its use instead of tedious list of `extern' and
17275 prototypes.
17276 * src/reader.c: Formatting changes, topological sort,
17277 s/register//.
17278
17279 2000-10-02 Akim Demaille <akim@epita.fr>
17280
17281 * src/lex.h: Prototype `lex.c' exported functions.
17282 * src/reader.c: Adjust.
17283 * src/lex.c: Formatting changes.
17284 (safegetc): Rename as...
17285 (xgetc): this.
17286
17287 2000-10-02 Akim Demaille <akim@epita.fr>
17288
17289 * src/lalr.h: New file.
17290 Propagate its inclusion instead of prototypes and `extern'.
17291 * src/lalr.c: Formatting changes, topological sorting etc.
17292
17293 2000-10-02 Akim Demaille <akim@epita.fr>
17294
17295 * src/output.c (token_actions): Introduce a temporary array,
17296 YYDEFACT, that makes it possible for this function to use
17297 output_short_table.
17298
17299 2000-10-02 Akim Demaille <akim@epita.fr>
17300
17301 `user_toknums' is output as a `short[]' in `output.c', while it is
17302 defined as a `int[]' in `reader.c'. For consistency with the
17303 other output tables, `user_toknums' is now defined as a table of
17304 shorts.
17305
17306 * src/reader.c (user_toknums): Be a short table instead of an int
17307 table.
17308 Adjust dependencies.
17309
17310 Factor the short table outputs.
17311
17312 * src/output.c (output_short_table): New function.
17313 * src/output.c (output_gram, output_stos, output_rule_data)
17314 (output_base, output_table, output_check): Use it.
17315
17316 2000-10-02 Akim Demaille <akim@epita.fr>
17317
17318 * src/output.c (output): Topological sort of the functions, in
17319 order to get rid of the `static' prototypes.
17320 No longer use `register'.
17321 * src/output.h: New file.
17322 Propagate its inclusion in files explicitly prototyping functions
17323 from output.c.
17324
17325 2000-09-21 Akim Demaille <akim@epita.fr>
17326
17327 * src/atgeneral.m4: Update from Autoconf.
17328
17329 2000-09-21 Akim Demaille <akim@epita.fr>
17330
17331 * src/closure.h: New file.
17332 * src/closure.c: Formatting changes, topological sort over the
17333 functions, use of closure.h.
17334 (initialize_closure, finalize_closure): Rename as...
17335 (new_closure, free_closure): these. Adjust dependencies.
17336 * src/LR0.c: Formatting changes, topological sort, use of
17337 cloture.h.
17338 (initialize_states): Rename as...
17339 (new_states): this.
17340 * src/Makefile.am (noinst_HEADERS): Adjust.
17341
17342 2000-09-20 Akim Demaille <akim@epita.fr>
17343
17344 * src/acconfig.h: Don't protect config.h against multiple
17345 inclusion.
17346 Don't define PARAMS.
17347 * src/system.h: Define PARAMS.
17348 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
17349 purpose of config.h. system.h must not try to fix wrong
17350 definitions in config.h.
17351
17352 2000-09-20 Akim Demaille <akim@epita.fr>
17353
17354 * src/derives.h: New file.
17355 * src/main.c, src/derives.h: Use it.
17356 Formatting changes.
17357 * src/Makefile.am (noinst_HEADERS): Adjust.
17358
17359 2000-09-20 Akim Demaille <akim@epita.fr>
17360
17361 * tests/atgeneral.m4: Update from Autoconf.
17362 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
17363 (AT_CHECK_CALC): New macros.
17364 Use these macros to test bison with options `', `--raw',
17365 `--debug', `--yacc', `--yacc --debug'.
17366
17367 2000-09-19 Akim Demaille <akim@epita.fr>
17368
17369 * src/output.c: Formatting changes.
17370 * src/machine.h: Remove, leaving its contents in...
17371 * src/system.h: here.
17372 Include stdio.h.
17373 Adjust all dependencies on stdio.h and machine.h.
17374 * src/getargs.h: New file.
17375 Let all `extern' declarations about getargs.c be replaced with
17376 inclusion of `getargs.h'.
17377 * src/Makefile.am (noinst_HEADERS): Adjust.
17378
17379 * tests/calc.m4 (yyin): Be initialized in main, not on the global
17380 scope.
17381 (yyerror): Returns void, not int.
17382 * doc/bison.texinfo: Formatting changes.
17383
17384 2000-09-19 Akim Demaille <akim@epita.fr>
17385
17386 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
17387 portable.
17388
17389 2000-09-18 Akim Demaille <akim@epita.fr>
17390
17391 * configure.in: Append WARNING_CFLAGS to CFLAGS.
17392 * src/Makefile.am (INCLUDES): Don't.
17393 Be ready to fetch headers in lib/.
17394
17395 2000-09-18 Akim Demaille <akim@epita.fr>
17396
17397 * doc/bison.texinfo: Update the copyright.
17398 ANSIfy and GNUify the examples.
17399 Remove the old menu.
17400
17401 2000-09-18 Akim Demaille <akim@epita.fr>
17402
17403 First set of tests: use the `calc' example from the documentation.
17404
17405 * src/bison.s1 (yyparse): Condition the code using `yytname' which
17406 is defined only when YYDEBUG is.
17407 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
17408 * src/files.c (tryopen, tryclose): Formatting changes.
17409 Move to the top and be static.
17410 * src/reader.c (read_signed_integer): Likewise.
17411 * tests/calc.m4: New file.
17412 * Makefile.am, suite.m4: Adjust.
17413 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
17414
17415 2000-09-18 Akim Demaille <akim@epita.fr>
17416
17417 Add support for an Autotest test suite for Bison.
17418
17419 * m4/m4.m4, m4/atconfig.m4: New files.
17420 * m4/Makefile.am (EXTRA_DIST): Adjust.
17421 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
17422 files.
17423 * src/getargs.c: Display a more standard --version message.
17424 * src/reader.c (reader): Formatting changes.
17425 No longer depend upon VERSION_STRING.
17426 * configure.in: No longer use `dnl'.
17427 Set up the test suite and the new directory `tests/.
17428 (VERSION_STRING): Remove.
17429
17430 2000-04-14 Akim Demaille <akim@epita.fr>
17431
17432 * src/reader.c (copy_comment2): New function, same as former
17433 `copy_comment', but outputs into two FILE *.
17434 (copy_comment): Use it.
17435 (parse_union_decl): Use it.
17436 (get_type, parse_start_decl): Use the same `invalid' message.
17437 (parse_start_decl, parse_union_decl): Use the same `multiple'
17438 message.
17439 (parse_union_decl, copy_guard, copy_action): Use the same
17440 `unmatched' message.
17441 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
17442
17443 2000-03-31 Akim Demaille <akim@epita.fr>
17444
17445 * src/files.c (tryopen, tryclose): Move to the top.
17446 Be static.
17447
17448 2000-03-31 Akim Demaille <akim@epita.fr>
17449
17450 * src/main.c (main): Don't call `done', exit does it.
17451
17452 2000-03-31 Akim Demaille <akim@epita.fr>
17453
17454 * allocate.c: s/return (foo)/return foo/.
17455 * lalr.c: Likewise.
17456 * LR0.c: Likewise.
17457 * output.c: Likewise.
17458 * reader.c: Likewise.
17459 * symtab.c: Likewise.
17460 * vmsgetargs.c: Likewise.
17461
17462 2000-03-31 Akim Demaille <akim@epita.fr>
17463
17464 Clean up the error reporting functions.
17465
17466 * src/report.c: New file.
17467 * src/report.h: Likewise.
17468 * src/Makefile.am: Adjust.
17469 * m4/error.m4: New file.
17470 * m4/Makefile.am: Adjust.
17471 * configure.in (jm_PREREQ_ERROR): Call it.
17472 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
17473 Remove.
17474 (fatal, fatals): Remove. All callers use complain.c::fatal.
17475 (warn, warni, warns, warnss, warnss): Remove. All callers use
17476 complain.c::complain.
17477 (toomany): Remove, use fatal instead.
17478 * src/files.c (done): No argument, use complain_message_count.
17479 * src/main.c (main): Register `done' to `atexit'.
17480
17481 * src/getargs.c (usage): More `fputs', less `fprintf'.
17482
17483 2000-03-28 Akim Demaille <akim@epita.fr>
17484
17485 * lib/: New directory.
17486 * Makefile.am (SUBDIRS): Adjust.
17487 * configure.in: Adjust.
17488 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
17489 useless.
17490 * src/alloca.c: Moved to lib/.
17491 * src/getopt.c: Likewise.
17492 * src/getopt1.c: Likewise.
17493 * src/getopt.h: Likewise.
17494 * src/ansi2knr.c: Likewise.
17495 * src/ansi2knr.1: Likewise.
17496 * src/Makefile.am: Adjust.
17497 * lib/Makefile.am: New file.
17498
17499 2000-03-28 Akim Demaille <akim@epita.fr>
17500
17501 * src/getargs.c (usage): Refresh the help message.
17502
17503 2000-03-17 Akim Demaille <akim@epita.fr>
17504
17505 * src/getopt1.c: Updated from textutils 2.0e
17506 * src/getopt.c: Likewise.
17507 * src/getopt.h: Likewise.
17508
17509 2000-03-17 Akim Demaille <akim@epita.fr>
17510
17511 * src/Makefile.am (bison.simple): Fix the awk program: quote only
17512 the file name, not the whole `#line LINE FILE'.
17513
17514 2000-03-17 Akim Demaille <akim@epita.fr>
17515
17516 On syntax errors, report the token on which we choked.
17517
17518 * src/bison.s1 (yyparse): In the label yyerrlab, when
17519 YYERROR_VERBOSE, add yychar in msg.
17520
17521 2000-03-17 Akim Demaille <akim@epita.fr>
17522
17523 * src/reader.c (copy_at): New function.
17524 (copy_guard): Use it.
17525 (copy_action): Use it.
17526
17527 2000-03-17 Akim Demaille <akim@epita.fr>
17528
17529 Be kind to translators, save some useless translations.
17530
17531 * src/main.c (banner): New function.
17532 (fatal_banner): Use it.
17533 (warn_banner): Use it.
17534
17535 2000-03-17 Akim Demaille <akim@epita.fr>
17536
17537 * src/reader.c (copy_definition): Use copy_string and
17538 copy_comment. Removed now unused `match', `ended',
17539 `cplus_comment'.
17540 (copy_comment, copy_string): Moved, to be visible from
17541 copy_definition.
17542
17543 2000-03-17 Akim Demaille <akim@epita.fr>
17544
17545 * src/reader.c (copy_string): Declare `static inline'. No
17546 problems with inline, since it is checked by configure.
17547 (copy_comment): Likewise.
17548
17549 2000-03-17 Akim Demaille <akim@epita.fr>
17550
17551 * src/reader.c (packsymbols): Formatting changes.
17552
17553 2000-03-17 Akim Demaille <akim@epita.fr>
17554
17555 * src/reader.c (copy_comment): New function, factored out from:
17556 (copy_action): Use it. Removed now unused `match', `ended',
17557 `cplus_comment'.
17558 (copy_guard): Likewise.
17559
17560 2000-03-17 Akim Demaille <akim@epita.fr>
17561
17562 * src/reader.c (copy_string): New function, factored out from:
17563 (copy_action): Use it.
17564 (copy_guard): Likewise.
17565
17566 2000-03-17 Akim Demaille <akim@epita.fr>
17567
17568 Change the handling of @s so that they behave exactly like $s.
17569 There is now a pseudo variable @$ (readble and writable), location
17570 of the lhs of the rule (by default ranging from the location of
17571 the first symbol of the rhs, to the location of the last symbol,
17572 or, if the rhs is empty, YYLLOC).
17573
17574 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
17575 yyval.
17576 (yyparse): When providing a default semantic action, provide a
17577 default location action.
17578 (after the $): No longer change `*YYLSP', just stack YYLOC the
17579 same way you stack YYVAL.
17580 * src/reader.c (read_declarations): Use warns.
17581 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
17582 (copy_action, case '@'): Likewise.
17583 Use a standard error message, to save useless work from
17584 translators.
17585
17586 2000-03-17 Akim Demaille <akim@epita.fr>
17587
17588 * src/bison.s1: Formatting and cosmetics changes.
17589 * src/reader.c: Likewise.
17590 Update the Copyright notice.
17591
17592 2000-03-17 Akim Demaille <akim@epita.fr>
17593
17594 * src/bison.s1 (#line): All set to `#line' only, since the
17595 Makefile now handles them.
17596
17597 2000-03-16 Akim Demaille <akim@epita.fr>
17598
17599 * src/output.c (output_rule_data): Output the documentation of
17600 some of the tables.
17601 (Copyright notice): Update.
17602 Formatting changes.
17603
17604 2000-03-16 Akim Demaille <akim@epita.fr>
17605
17606 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
17607 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
17608 One `#if YYDEBUG' remains, since it uses variables which are
17609 defined only if `YYDEBUG != 0'.
17610
17611 2000-03-16 Akim Demaille <akim@epita.fr>
17612
17613 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
17614 and related variables so that the similarities are highlighted.
17615
17616 2000-03-16 Akim Demaille <akim@epita.fr>
17617
17618 * src/bison.s1: Properly indent CPP directives.
17619
17620 2000-03-16 Akim Demaille <akim@epita.fr>
17621
17622 * src/bison.s1: Properly indent the `alloca' CPP section.
17623
17624 2000-03-16 Akim Demaille <akim@epita.fr>
17625
17626 Do not hard code values of directories in `configure.in'.
17627 Update the `configure' tool chain.
17628
17629 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
17630 src/makefile.am.
17631 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
17632 (AC_OUTPUT): Add m4/Makefile.
17633 Bump to bison 1.28a, 1.29 has never been released.
17634 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
17635 handled via src/Makefile.am.
17636 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
17637 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
17638 autoheader.
17639 * Makefile.am (SUBDIRS): Add m4.
17640 (ACLOCAL_AM_FLAGS): New variable.
17641 (AUTOMAKE_OPTIONS): Add check-news.
17642 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
17643 the proper line number and file name.
17644 (DEFS): Propagate the location of bison library files and of the
17645 locale files.
17646 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
17647 builddir.
17648 * acinclude.m4: Remove, replaced by the directory m4.
17649 * m4/Makefile.am (EXTRA_DIST): New variable.
17650 * m4/gettext.m4: New file, from the fileutils.
17651 * m4/lcmessage.m4: Likewise
17652 * m4/progtest.m4: Likewise.
17653 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
17654
17655 2000-03-10 Akim Demaille <akim@epita.fr>
17656
17657 * src/closure.c:
17658 Formatting changes of various comments.
17659 Respect the GNU coding standards at various places.
17660 Don't use `_()' when no translation is needed.
17661
17662 1999-12-13 Jesse Thilo <jthilo@gnu.org>
17663
17664 * src/files.c:
17665 OS/2 honors TMPDIR environment variable.
17666
17667 1999-12-13 Jesse Thilo <jthilo@gnu.org>
17668
17669 * doc/bison.texinfo: Tweaked spelling and grammar.
17670 Updated ISBN.
17671 Removed reference to price of printed copy.
17672 Mention BISON_SIMPLE and BISON_HAIRY.
17673
17674 1999-12-13 Jesse Thilo <jthilo@gnu.org>
17675
17676 * configure.in, NEWS:
17677 Bison 1.29 released.
17678
17679 1999-10-27 Jesse Thilo <jthilo@gnu.org>
17680
17681 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
17682 Added reference card.
17683
17684 1999-07-26 Jesse Thilo <jthilo@gnu.org>
17685
17686 * po/ru.po: Added Russian translation.
17687
17688 1999-07-26 Jesse Thilo <jthilo@gnu.org>
17689
17690 * configure.in: Added Russian translation.
17691
17692 1999-07-06 Jesse Thilo <jthilo@gnu.org>
17693
17694 * configure.in, NEWS, README:
17695 Released version 1.28.
17696
17697 1999-06-14 Jesse Thilo <jthilo@gnu.org>
17698
17699 * src/system.h:
17700 Squashed redefinition warning on some systems.
17701
17702 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
17703 Have configure build version string instead of relying on ANSI string
17704 concatentation.
17705
17706 1999-06-14 Jesse Thilo <jthilo@gnu.org>
17707
17708 * po/POTFILES.in: Got rid of version.c.
17709
17710 1999-06-14 Jesse Thilo <jthilo@gnu.org>
17711
17712 * acconfig.h, configure.in:
17713 Have configure build version string instead of relying on ANSI string
17714 concatentation.
17715
17716 1999-06-08 Jesse Thilo <jthilo@gnu.org>
17717
17718 * doc/bison.1:
17719 Dropped mention of `+' for long-named options.
17720
17721 1999-05-30 Jesse Thilo <jthilo@gnu.org>
17722
17723 * src/files.c: Added <unistd.h> for unlink().
17724
17725 * src/Makefile.am, src/system.h:
17726 I18n fixes.
17727
17728 1999-05-30 Jesse Thilo <jthilo@gnu.org>
17729
17730 * README: Added a FAQ list.
17731
17732 * configure.in, acconfig.h:
17733 I18n fixes.
17734
17735 1999-05-30 Jesse Thilo <jthilo@gnu.org>
17736
17737 * doc/FAQ, doc/Makefile.am:
17738 Added a FAQ list.
17739
17740 1999-05-19 Jesse Thilo <jthilo@gnu.org>
17741
17742 * src/alloc.h, src/symtab.h, src/version.c:
17743 Protected inclusion of "config.h" with HAVE_CONFIG_H.
17744
17745 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17746
17747 * src/.cvsignore, src/Makefile.am:
17748 Reorganized: sources in `src', documentation in `doc'.
17749
17750 * src/lex.c (literalchar):
17751 fixed the code for escaping double quotes (thanks
17752 Jonathan Czisny.)
17753
17754 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17755
17756 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
17757 Adjusted paths to reflect directory reorganization.
17758
17759 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17760
17761 * doc/.cvsignore, doc/Makefile.am:
17762 Reorganized: sources in `src', documentation in `doc'.
17763
17764 1999-04-18 Jesse Thilo <jthilo@gnu.org>
17765
17766 * configure.in:
17767 Updated AC_INIT file to reflect directory reorganization.
17768
17769 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
17770 Reorganized: sources in `src', documentation in `doc'.
17771
17772 1999-04-13 Jesse Thilo <jthilo@gnu.org>
17773
17774 * src/allocate.c:
17775 Don't declare calloc() and realloc() if not necessary.
17776
17777 1999-04-13 Jesse Thilo <jthilo@gnu.org>
17778
17779 * configure.in, acconfig.h, acinclude.m4:
17780 Don't declare calloc() and realloc() if not necessary.
17781
17782 1999-03-23 Jesse Thilo <jthilo@gnu.org>
17783
17784 * po/.cvsignore: Added i18n support.
17785
17786 1999-03-23 Jesse Thilo <jthilo@gnu.org>
17787
17788 * acconfig.h, configure.in, Makefile.am:
17789 Added i18n support.
17790
17791 1999-03-22 Jesse Thilo <jthilo@gnu.org>
17792
17793 * src/bison.s1: Fixed #line numbers.
17794
17795 1999-03-15 Jesse Thilo <jthilo@gnu.org>
17796
17797 * po/es.po, po/fr.po, po/nl.po, po/de.po:
17798 Added PO files from Translation Project.
17799
17800 1999-03-03 Jesse Thilo <jthilo@gnu.org>
17801
17802 * Makefile.am:
17803 Added support for non-ANSI compilers (ansi2knr).
17804
17805 1999-02-16 Jesse Thilo <jthilo@gnu.org>
17806
17807 * configure.in: Bumped version number to 1.27.
17808
17809 * Makefile.am:
17810 Added `bison.simple' to list of files removed by `make distclean'.
17811
17812 1999-02-12 Jesse Thilo <jthilo@gnu.org>
17813
17814 * src/files.c, src/files.h:
17815 Defined locations of parser files in config.h instead of Makefile.
17816
17817 1999-02-12 Jesse Thilo <jthilo@gnu.org>
17818
17819 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
17820 Defined locations of parser files in config.h instead of Makefile.
17821
17822 1999-02-09 Jesse Thilo <jthilo@gnu.org>
17823
17824 * Makefile.am:
17825 Removed inappropriate use of $< macro.
17826
17827 1999-02-05 Jesse Thilo <jthilo@gnu.org>
17828
17829 * po/Makefile.in.in, po/POTFILES.in:
17830 Add `po' directory skeleton.
17831
17832 1999-01-27 Jesse Thilo <jthilo@gnu.org>
17833
17834 * README: Document help-bison list.
17835
17836 * configure.in: Add check for mkstemp().
17837
17838 1999-01-20 Jesse Thilo <jthilo@gnu.org>
17839
17840 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
17841 Hush a few compiler warnings.
17842
17843 * src/files.c:
17844 Add tryclose(), which verifies that fclose was successful.
17845 Hush a couple of compiler warnings.
17846
17847 1999-01-20 Jesse Thilo <jthilo@gnu.org>
17848
17849 * Makefile.am, OChangeLog:
17850 ChangeLog is now automatically generated. Include the old version as
17851 OChangeLog.
17852
17853 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17854
17855 * 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:
17856 Update FSF address.
17857
17858 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17859
17860 * doc/bison.texinfo: Fix formatting glitch.
17861
17862 * doc/bison.texinfo: Update FSF address.
17863
17864 1999-01-14 Jesse Thilo <jthilo@gnu.org>
17865
17866 * acconfig.h: Update FSF address.
17867
17868 1999-01-08 Jesse Thilo <jthilo@gnu.org>
17869
17870 * src/system.h:
17871 Don't define PACKAGE here, since config.h defines it.
17872
17873 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17874
17875 * src/reader.c: Update copyright date.
17876
17877 * src/main.c:
17878 Ditch sprintf to statically-sized buffers in fatal/warn functions in
17879 favor of output directly to stderr (avoids buffer overruns).
17880
17881 * src/reader.c: Some checks for premature EOF.
17882
17883 * 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:
17884 Use prototypes if the compiler understands them.
17885
17886 * src/files.c: Honor TMPDIR on Unix hosts.
17887 Use prototypes if the compiler understands them.
17888
17889 * src/reader.c:
17890 Fix a couple of buffer overrun bugs.
17891 Use prototypes if the compiler understands them.
17892
17893 * src/system.h: Include unistd.h and ctype.h.
17894 Use #ifdef instead of #if for NLS symbols.
17895
17896 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17897
17898 * doc/bison.texinfo:
17899 Delete comment "consider using @set for edition number, etc..." since
17900 we now are doing so.
17901
17902 1998-12-30 Jesse Thilo <jthilo@gnu.org>
17903
17904 * configure.in:
17905 Use prototypes if the compiler understands them.
17906
17907 * NEWS: Document 1.26 highlights.
17908
17909 * Makefile.am: Require Automake 1.3 or later.
17910
17911 * acconfig.h:
17912 Use prototypes if the compiler understands them.
17913
17914 1998-12-29 Jesse Thilo <jthilo@gnu.org>
17915
17916 * src/version.c:
17917 Use VERSION symbol from automake for version number.
17918
17919 1998-12-29 Jesse Thilo <jthilo@gnu.org>
17920
17921 * acconfig.h, configure.in, version.cin:
17922 Use VERSION symbol from automake for version number.
17923
17924 1998-11-28 Jesse Thilo <jthilo@gnu.org>
17925
17926 * Makefile.am:
17927 Distribute original version of simple parser (bison.s1), not built
17928 version (bison.simple).
17929
17930 1998-11-28 Jesse Thilo <jthilo@gnu.org>
17931
17932 * doc/bison.texinfo: Add info dir entry.
17933
17934 * doc/bison.texinfo:
17935 Let automake put version number into documentation.
17936
17937 1998-11-26 Jesse Thilo <jthilo@gnu.org>
17938
17939 * src/bison.cld, src/build.com, src/vmshlp.mar:
17940 Add non-RCS files from /gd/gnu/bison.
17941
17942 1998-11-26 Jesse Thilo <jthilo@gnu.org>
17943
17944 * doc/bison.1:
17945 Document the BISON_HAIRY and BISON_SIMPLE variables.
17946
17947 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17948
17949 * src/version.c: Build version.c automatically.
17950
17951 * src/reader.c:
17952 Fix token numbering (used to start at 258, not 257).
17953
17954 * src/system.h: Include config.h.
17955
17956 * src/getargs.c: Update bug report address.
17957
17958 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
17959 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
17960
17961 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17962
17963 * Makefile.am:
17964 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17965
17966 * configure.in, version.cin:
17967 Build version.c automatically.
17968
17969 * AUTHORS: Add AUTHORS file.
17970
17971 * README: Update bug report address.
17972
17973 * bison.simple:
17974 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17975
17976 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
17977 Add automake stuff.
17978
17979 1998-11-25 Jesse Thilo <jthilo@gnu.org>
17980
17981 * doc/bison.texinfo: Clean up some formatting.
17982
17983 1998-05-05 Richard Stallman <rms@gnu.org>
17984
17985 * doc/bison.texinfo:
17986 Explain better why to make a pure parser.
17987
17988 1998-01-05 Richard Stallman <rms@gnu.org>
17989
17990 * src/files.c (openfiles):
17991 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
17992 find a temporary directory, if possible. Do not unlink files while
17993 they are open.
17994
17995 1997-08-25 Richard Stallman <rms@gnu.org>
17996
17997 * src/reader.c (stack_offset;):
17998 Change some warni to warns.
17999
18000 * src/lex.c (literalchar): Use warns, not warni.
18001
18002 1997-06-28 Richard Stallman <rms@gnu.org>
18003
18004 * src/bison.s1: Add a Bison version comment.
18005
18006 * src/main.c (fatal, warn, berror):
18007 Use program_name.
18008
18009 1997-06-28 Richard Stallman <rms@gnu.org>
18010
18011 * Makefile.in (bison_version): New variable.
18012 (dist): Use that variable.
18013 (bison.s1): Substitute the Bison version into bison.simple.
18014
18015 * bison.simple: Add a Bison version comment.
18016
18017 1997-06-18 Richard Stallman <rms@gnu.org>
18018
18019 * src/main.c (fatal, warn, berror):
18020 Make error messages standard.
18021 (toomany): Improve error message text.
18022
18023 * 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:
18024 new.h renamed to alloc.h.
18025
18026 1997-06-18 Richard Stallman <rms@gnu.org>
18027
18028 * Makefile.in: new.h renamed to alloc.h.
18029
18030 1997-05-24 Richard Stallman <rms@gnu.org>
18031
18032 * src/lex.c (literalchar):
18033 Fix the code for escaping \, " and '.
18034
18035 (lex): Avoid trouble when there are many chars
18036 to discard in a char literal with just several chars in it.
18037
18038 1997-05-17 Richard Stallman <rms@gnu.org>
18039
18040 * src/bison.s1:
18041 Use malloc, if using alloca is troublesome.
18042 (YYSTACK_USE_ALLOCA): New flag macro.
18043 Define it for some systems and compilers.
18044 (YYSTACK_ALLOC): New macro.
18045 (yyparse): Use YYSTACK_ALLOC to allocate stack.
18046 If it was malloc'd, free it.
18047
18048 1997-05-17 Richard Stallman <rms@gnu.org>
18049
18050 * bison.simple:
18051 Use malloc, if using alloca is troublesome.
18052 (YYSTACK_USE_ALLOCA): New flag macro.
18053 Define it for some systems and compilers.
18054 (YYSTACK_ALLOC): New macro.
18055 (yyparse): Use YYSTACK_ALLOC to allocate stack.
18056 If it was malloc'd, free it.
18057
18058 1997-04-23 Richard Stallman <rms@gnu.org>
18059
18060 * src/bison.s1:
18061 (alloca) [__hpux]: Always define as __builtin_alloca.
18062
18063 1997-04-23 Richard Stallman <rms@gnu.org>
18064
18065 * bison.simple:
18066 (alloca) [__hpux]: Always define as __builtin_alloca.
18067
18068 1997-04-22 Richard Stallman <rms@gnu.org>
18069
18070 * src/bison.s1:
18071 [__hpux]: Include alloca.h (right for HPUX 10)
18072 instead of declaring alloca (right for HPUX 9).
18073
18074 * src/bison.s1 (__yy_memcpy):
18075 Declare arg `count' as unsigned int.
18076 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
18077
18078 1997-04-22 Richard Stallman <rms@gnu.org>
18079
18080 * bison.simple:
18081 [__hpux]: Include alloca.h (right for HPUX 10)
18082 instead of declaring alloca (right for HPUX 9).
18083
18084 * bison.simple (__yy_memcpy):
18085 Declare arg `count' as unsigned int.
18086 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
18087
18088 1997-01-03 Richard Stallman <rms@gnu.org>
18089
18090 * src/allocate.c: [__STDC__ or _MSC_VER]:
18091 Declare calloc and realloc to return void *.
18092
18093 1997-01-02 Richard Stallman <rms@gnu.org>
18094
18095 * src/system.h:
18096 [_MSC_VER]: Include stdlib.h and process.h.
18097 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
18098
18099 * src/main.c (main): Return FAILURE as a value.
18100 (printable_version): Declare arg as int, not char.
18101
18102 1997-01-02 Richard Stallman <rms@gnu.org>
18103
18104 * Makefile.in (dist):
18105 Explicitly check for symlinks, and copy them.
18106
18107 1996-12-19 Richard Stallman <rms@gnu.org>
18108
18109 * src/files.c:
18110 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
18111
18112 1996-12-18 Paul Eggert <eggert@gnu.org>
18113
18114 * src/bison.s1 (yyparse):
18115 If __GNUC__ and YYPARSE_PARAM are both defined,
18116 declare yyparse to have a void * argument.
18117
18118 1996-12-18 Paul Eggert <eggert@gnu.org>
18119
18120 * bison.simple (yyparse):
18121 If __GNUC__ and YYPARSE_PARAM are both defined,
18122 declare yyparse to have a void * argument.
18123
18124 1996-12-17 Richard Stallman <rms@gnu.org>
18125
18126 * src/reduce.c (nbits): Add some casts.
18127
18128 1996-08-12 Richard Stallman <rms@gnu.org>
18129
18130 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
18131
18132 1996-08-12 Richard Stallman <rms@gnu.org>
18133
18134 * bison.simple: Test _MSDOS as well as _MSDOS_.
18135
18136 1996-07-31 Richard Stallman <rms@gnu.org>
18137
18138 * src/bison.s1:
18139 [__sun && __i386]: Include alloca.h.
18140
18141 1996-07-31 Richard Stallman <rms@gnu.org>
18142
18143 * bison.simple:
18144 [__sun && __i386]: Include alloca.h.
18145
18146 1996-07-30 Richard Stallman <rms@gnu.org>
18147
18148 * src/bison.s1: Comment change.
18149
18150 * src/bison.s1: Test _MSDOS_, not MSDOS.
18151
18152 1996-07-30 Richard Stallman <rms@gnu.org>
18153
18154 * bison.simple: Comment change.
18155
18156 * bison.simple: Test _MSDOS_, not MSDOS.
18157
18158 1996-06-01 Richard Stallman <rms@gnu.org>
18159
18160 * 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:
18161 Insert `_' macro around many string constants.
18162
18163 * src/main.c:
18164 Insert `_' macro around many string constants.
18165
18166 (main): Call setlocale, bindtextdomain and textdomain.
18167
18168 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
18169 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
18170 [ENABLE_NLS]: Include libintl.h.
18171 [ENABLE_NLS] (gettext): Define.
18172 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
18173 (N_, PACKAGE, LOCALEDIR): New macros.
18174
18175 1996-06-01 Richard Stallman <rms@gnu.org>
18176
18177 * POTFILES.in: New file.
18178
18179 * Makefile.in (allocate.o):
18180 Define target explicitly.
18181
18182 * Makefile.in (CFLAGS): Set to @CFLAGS@.
18183 (LDFLAGS): Set to @LDFLAGS@.
18184 (configure): Run autoconf only if preceding `cd' succeeds.
18185 (bison.s1): Redirect output to temporary file then move the
18186 temporary to the target, rather than redirecting directly to bison.s1.
18187 (clean): Remove config.status and config.log.
18188 (distclean): Don't remove config.status here.
18189
18190 1996-05-12 Richard Stallman <rms@gnu.org>
18191
18192 * src/bison.s1:
18193 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
18194
18195 1996-05-12 Richard Stallman <rms@gnu.org>
18196
18197 * bison.simple:
18198 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
18199
18200 1996-05-11 Richard Stallman <rms@gnu.org>
18201
18202 * src/bison.s1 (__yy_memcpy):
18203 Really reorder the args, as was supposedly done on Feb 14 1995.
18204 (yyparse): Calls changed accordingly.
18205
18206 1996-05-11 Richard Stallman <rms@gnu.org>
18207
18208 * Makefile.in (dist): Don't use $(srcdir).
18209
18210 * bison.simple (__yy_memcpy):
18211 Really reorder the args, as was supposedly done on Feb 14 1995.
18212 (yyparse): Calls changed accordingly.
18213
18214 1996-01-27 Richard Stallman <rms@gnu.org>
18215
18216 * src/output.c (output_rule_data):
18217 Test YYERROR_VERBOSE in the conditional
18218 around the definition of ttyname.
18219
18220 1995-12-29 Richard Stallman <rms@gnu.org>
18221
18222 * src/bison.s1:
18223 Fix line numbers in #line commands.
18224
18225 1995-12-29 Richard Stallman <rms@gnu.org>
18226
18227 * bison.simple:
18228 Fix line numbers in #line commands.
18229
18230 1995-12-27 Richard Stallman <rms@gnu.org>
18231
18232 * src/bison.s1 (YYPARSE_PARAM_DECL):
18233 In C++, make it always null.
18234 (YYPARSE_PARAM_ARG): New macro.
18235 (yyparse): Use YYPARSE_PARAM_ARG.
18236
18237 1995-12-27 Richard Stallman <rms@gnu.org>
18238
18239 * bison.simple (YYPARSE_PARAM_DECL):
18240 In C++, make it always null.
18241 (YYPARSE_PARAM_ARG): New macro.
18242 (yyparse): Use YYPARSE_PARAM_ARG.
18243
18244 1995-11-29 Richard Stallman <rms@gnu.org>
18245
18246 * doc/bison.texinfo:
18247 Describe literal string tokens, %raw, %no_lines, %token_table.
18248
18249 1995-11-29 Daniel Hagerty <hag@gnu.org>
18250
18251 * doc/bison.texinfo: Fixed update date
18252
18253 1995-10-16 Richard Stallman <rms@gnu.org>
18254
18255 * src/version.c: Version 1.25.
18256
18257 1995-10-16 Richard Stallman <rms@gnu.org>
18258
18259 * NEWS: *** empty log message ***
18260
18261 1995-10-16 Richard Stallman <rms@gnu.org>
18262
18263 * doc/bison.1, doc/bison.rnh:
18264 Add new options.
18265
18266 1995-10-15 Richard Stallman <rms@gnu.org>
18267
18268 * src/vmsgetargs.c, src/getargs.c:
18269 Added -n, -k, and -raw switches.
18270 (noparserflag, toknumflag, rawtoknumflag): New variables.
18271
18272 * src/symtab.h (SALIAS):
18273 New #define for adding aliases to %token.
18274 (struct bucket): Added `alias' field.
18275
18276 * src/reduce.c (reduce_grammar):
18277 Revise error message.
18278 (print_notices): Remove final `.' from error message.
18279
18280 * src/reader.c (reader_output_yylsp):
18281 New function.
18282 (readgram): Use `#if 0' around code that accepted %command
18283 inside grammar rules: The documentation doesn't allow it,
18284 and it will fail since the %command processors scan for the next %.
18285 (parse_token_decl): Extended the %token
18286 declaration to allow a multi-character symbol as an alias.
18287 (parse_thong_decl): New function.
18288 (read_declarations): Added %thong declarations.
18289 (read_declarations): Handle NOOP to deal with allowing
18290 % declarations as another means to specify the flags.
18291 (readgram): Allow %prec prior to semantics embedded in a rule.
18292 (skip_to_char, read_declarations, copy_definition)
18293 (parse_token_decl, parse_start_decl, parse_type_decl)
18294 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
18295 (get_type_name, copy_guard, copy_action, readgram)
18296 (get_type, packsymbols): Revised most error messages.
18297 Changed `fatal' to `warnxxx' to avoid aborting for error.
18298 Revised and use multiple warnxxx functions to avoid using VARARGS1.
18299 (read_declarations): Improve the error message for
18300 an invalid character. Do not abort.
18301 (read_declarations, copy_guard, copy_action): Use
18302 printable_version to avoid unprintable characters in printed output.
18303 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
18304 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
18305 Allow the type of a non-terminal can be given
18306 more than once, as long as all specifications give the same type.
18307
18308 * src/output.c:
18309 (output_headers, output_trailers, output, output_gram)
18310 (output_rule_data): Implement noparserflag variable.
18311 Implement toknumflag variable.
18312 (output): Call reader_output_yylsp to output LTYPESTR.
18313
18314 * src/main.c (main):
18315 If reader sees an error, don't process the grammar.
18316 (fatals): Updated to not use VARARGS1.
18317 (printable_version, int_to_string, warn, warni, warns, warnss)
18318 (warnsss): New error reporting functions. Avoid abort for error.
18319
18320 * src/lex.h:
18321 Added THONG and NOOP for alias processing.
18322 Added SETOPT for the new code that allows setting options with %flags.
18323
18324 * src/lex.c:
18325 Include getopt.h. Add some extern decls.
18326 (safegetc): New function to deal with EOF gracefully.
18327 (literalchar); new function to deal with reading \ escapes.
18328 (lex): Use literalchar.
18329 (lex): Implemented "..." tokens.
18330 (literalchar, lex, parse_percent_token): Made tokenbuffer
18331 always contain the token. This includes growing the token
18332 buffer while reading an integer.
18333 (parse_percent_token): Replaced if-else statement with percent_table.
18334 (parse_percent_token): Added % declarations as another
18335 way to specify the flags -n, -l, and -r. Also added hooks for
18336 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
18337 major changes to files.c.
18338 (lex) Retain in the incoming stream a character following
18339 an incorrect '/'.
18340 (skip_white_space, lex): Revised most error messages
18341 and changed fatal to warn to avoid aborting.
18342 (percent_table): Added %thong declarations.
18343
18344 * src/gram.h: Comment changes.
18345
18346 * src/files.c (openfiles, open_extra_files, done):
18347 Add faction flag
18348 and actfile file. Handle noparserflag. Both for -n switch.
18349
18350 * src/conflicts.c (resolve_sr_conflict):
18351 Remove use of alloca.
18352
18353 1995-06-01 Jim Meyering <meyering@gnu.org>
18354
18355 * doc/bison.texinfo: *** empty log message ***
18356
18357 1995-05-06 Richard Stallman <rms@gnu.org>
18358
18359 * src/bison.s1: Comment change.
18360
18361 1995-05-06 Richard Stallman <rms@gnu.org>
18362
18363 * bison.simple: Comment change.
18364
18365 1995-05-03 Richard Stallman <rms@gnu.org>
18366
18367 * src/version.c: Version now 1.24.
18368
18369 * src/bison.s1: Change distribution terms.
18370
18371 * src/version.c: Version now 1.23.
18372
18373 1995-05-03 Richard Stallman <rms@gnu.org>
18374
18375 * doc/bison.texinfo:
18376 Rewrite "Conditions for Using Bison".
18377 Update version to 1.24.
18378
18379 1995-05-03 Richard Stallman <rms@gnu.org>
18380
18381 * bison.simple: Change distribution terms.
18382
18383 1995-02-23 Richard Stallman <rms@gnu.org>
18384
18385 * src/files.c: Test __VMS_POSIX as well as VMS.
18386
18387 1995-02-14 Jim Meyering <meyering@gnu.org>
18388
18389 * src/bison.s1 (__yy_memcpy):
18390 Renamed from __yy_bcopy to avoid
18391 confusion. Reverse FROM and TO arguments to be consistent with
18392 those of memcpy.
18393
18394 1995-02-14 Jim Meyering <meyering@gnu.org>
18395
18396 * bison.simple (__yy_memcpy):
18397 Renamed from __yy_bcopy to avoid
18398 confusion. Reverse FROM and TO arguments to be consistent with
18399 those of memcpy.
18400
18401 1994-11-10 David J. MacKenzie <djm@gnu.org>
18402
18403 * NEWS: reformat
18404
18405 * NEWS: New file.
18406
18407 * Makefile.in (DISTFILES): Include NEWS.
18408
18409 * Makefile.in (DISTFILES):
18410 Include install-sh, not install.sh.
18411
18412 * configure.in: Update to Autoconf v2 macro names.
18413
18414 1994-10-05 David J. MacKenzie <djm@gnu.org>
18415
18416 * Makefile.in: fix typo
18417
18418 * Makefile.in (prefix, exec_prefix):
18419 Let configure set them.
18420
18421 1994-09-28 David J. MacKenzie <djm@gnu.org>
18422
18423 * Makefile.in: Set datadir to $(prefix)/share.
18424
18425 1994-09-15 Richard Stallman <rms@gnu.org>
18426
18427 * src/bison.s1:
18428 Update copyright notice and GPL version.
18429
18430 1994-09-15 Richard Stallman <rms@gnu.org>
18431
18432 * bison.simple:
18433 Update copyright notice and GPL version.
18434
18435 1994-07-12 Richard Stallman <rms@gnu.org>
18436
18437 * src/reduce.c, src/reader.c:
18438 entered into RCS
18439
18440 1994-05-05 David J. MacKenzie <djm@gnu.org>
18441
18442 * Makefile.in: entered into RCS
18443
18444 1994-03-26 Richard Stallman <rms@gnu.org>
18445
18446 * src/bison.s1: entered into RCS
18447
18448 1994-03-26 Richard Stallman <rms@gnu.org>
18449
18450 * bison.simple: entered into RCS
18451
18452 1994-03-25 Richard Stallman <rms@gnu.org>
18453
18454 * src/main.c: entered into RCS
18455
18456 1994-03-24 Richard Stallman <rms@gnu.org>
18457
18458 * src/conflicts.c: entered into RCS
18459
18460 1994-01-02 Richard Stallman <rms@gnu.org>
18461
18462 * Makefile.in: *** empty log message ***
18463
18464 1993-11-21 Richard Stallman <rms@gnu.org>
18465
18466 * src/bison.s1: *** empty log message ***
18467
18468 1993-11-21 Richard Stallman <rms@gnu.org>
18469
18470 * doc/bison.texinfo: entered into RCS
18471
18472 * doc/bison.texinfo: *** empty log message ***
18473
18474 1993-11-21 Richard Stallman <rms@gnu.org>
18475
18476 * bison.simple: *** empty log message ***
18477
18478 1993-10-25 David J. MacKenzie <djm@gnu.org>
18479
18480 * doc/bison.texinfo: *** empty log message ***
18481
18482 1993-10-19 Richard Stallman <rms@gnu.org>
18483
18484 * src/bison.s1: *** empty log message ***
18485
18486 1993-10-19 Richard Stallman <rms@gnu.org>
18487
18488 * bison.simple: *** empty log message ***
18489
18490 1993-10-14 Richard Stallman <rms@gnu.org>
18491
18492 * src/bison.s1: *** empty log message ***
18493
18494 1993-10-14 Richard Stallman <rms@gnu.org>
18495
18496 * bison.simple: *** empty log message ***
18497
18498 1993-09-14 David J. MacKenzie <djm@gnu.org>
18499
18500 * doc/bison.texinfo: *** empty log message ***
18501
18502 1993-09-13 Noah Friedman <friedman@gnu.org>
18503
18504 * Makefile.in: *** empty log message ***
18505
18506 1993-09-10 Richard Stallman <rms@gnu.org>
18507
18508 * src/conflicts.c: *** empty log message ***
18509
18510 * src/system.h: entered into RCS
18511
18512 1993-09-10 Richard Stallman <rms@gnu.org>
18513
18514 * doc/bison.1: entered into RCS
18515
18516 1993-09-06 Noah Friedman <friedman@gnu.org>
18517
18518 * src/version.c: entered into RCS
18519
18520 1993-09-06 Noah Friedman <friedman@gnu.org>
18521
18522 * Makefile.in: *** empty log message ***
18523
18524 1993-07-30 David J. MacKenzie <djm@gnu.org>
18525
18526 * Makefile.in: *** empty log message ***
18527
18528 1993-07-24 Richard Stallman <rms@gnu.org>
18529
18530 * src/bison.s1: *** empty log message ***
18531
18532 1993-07-24 Richard Stallman <rms@gnu.org>
18533
18534 * bison.simple: *** empty log message ***
18535
18536 1993-07-08 David J. MacKenzie <djm@gnu.org>
18537
18538 * Makefile.in: *** empty log message ***
18539
18540 1993-07-04 Richard Stallman <rms@gnu.org>
18541
18542 * src/bison.s1: *** empty log message ***
18543
18544 1993-07-04 Richard Stallman <rms@gnu.org>
18545
18546 * bison.simple: *** empty log message ***
18547
18548 1993-06-26 David J. MacKenzie <djm@gnu.org>
18549
18550 * src/getargs.c: entered into RCS
18551
18552 1993-06-26 David J. MacKenzie <djm@gnu.org>
18553
18554 * doc/bison.texinfo: *** empty log message ***
18555
18556 * doc/bison.1: New file.
18557
18558 1993-06-25 Richard Stallman <rms@gnu.org>
18559
18560 * src/getargs.c: New file.
18561
18562 1993-06-16 Richard Stallman <rms@gnu.org>
18563
18564 * src/bison.s1: *** empty log message ***
18565
18566 1993-06-16 Richard Stallman <rms@gnu.org>
18567
18568 * bison.simple: *** empty log message ***
18569
18570 1993-06-03 Richard Stallman <rms@gnu.org>
18571
18572 * src/bison.s1: New file.
18573
18574 1993-06-03 Richard Stallman <rms@gnu.org>
18575
18576 * doc/bison.texinfo: *** empty log message ***
18577
18578 1993-06-03 Richard Stallman <rms@gnu.org>
18579
18580 * bison.simple: New file.
18581
18582 1993-05-19 Richard Stallman <rms@gnu.org>
18583
18584 * doc/bison.texinfo: New file.
18585
18586 1993-05-07 Noah Friedman <friedman@gnu.org>
18587
18588 * Makefile.in: *** empty log message ***
18589
18590 1993-04-28 Noah Friedman <friedman@gnu.org>
18591
18592 * src/reader.c: *** empty log message ***
18593
18594 1993-04-23 Noah Friedman <friedman@gnu.org>
18595
18596 * src/alloc.h: entered into RCS
18597
18598 1993-04-20 David J. MacKenzie <djm@gnu.org>
18599
18600 * src/version.c: *** empty log message ***
18601
18602 * src/files.c, src/allocate.c:
18603 entered into RCS
18604
18605 * src/reader.c: *** empty log message ***
18606
18607 * src/lex.c: entered into RCS
18608
18609 * src/conflicts.c: New file.
18610
18611 * src/symtab.c: entered into RCS
18612
18613 * src/alloc.h: New file.
18614
18615 * src/LR0.c: entered into RCS
18616
18617 1993-04-18 Noah Friedman <friedman@gnu.org>
18618
18619 * src/reader.c: New file.
18620
18621 * src/version.c: *** empty log message ***
18622
18623 1993-04-18 Noah Friedman <friedman@gnu.org>
18624
18625 * Makefile.in: *** empty log message ***
18626
18627 1993-04-17 Noah Friedman <friedman@gnu.org>
18628
18629 * Makefile.in: *** empty log message ***
18630
18631 1993-04-15 Richard Stallman <rms@gnu.org>
18632
18633 * src/main.c, src/files.c:
18634 New file.
18635
18636 1993-04-15 Noah Friedman <friedman@gnu.org>
18637
18638 * configure.in: entered into RCS
18639
18640 * configure.in: *** empty log message ***
18641
18642 * configure.in: New file.
18643
18644 1993-04-14 Richard Stallman <rms@gnu.org>
18645
18646 * Makefile.in: New file.
18647
18648 1993-04-13 Richard Stallman <rms@gnu.org>
18649
18650 * src/version.c: New file.
18651
18652 1993-03-25 Richard Stallman <rms@gnu.org>
18653
18654 * src/output.c: entered into RCS
18655
18656 1992-09-25 Richard Stallman <rms@gnu.org>
18657
18658 * configure.bat: entered into RCS
18659
18660 1992-06-22 Richard Stallman <rms@gnu.org>
18661
18662 * src/vmsgetargs.c: entered into RCS
18663
18664 1992-06-22 Richard Stallman <rms@gnu.org>
18665
18666 * doc/bison.rnh: entered into RCS
18667
18668 1992-04-20 David J. MacKenzie <djm@gnu.org>
18669
18670 * README: entered into RCS
18671
18672 1992-01-22 Richard Stallman <rms@gnu.org>
18673
18674 * src/machine.h: entered into RCS
18675
18676 1991-12-21 Richard Stallman <rms@gnu.org>
18677
18678 * src/lalr.c, src/closure.c:
18679 entered into RCS
18680
18681 1991-12-20 Richard Stallman <rms@gnu.org>
18682
18683 * src/state.h: entered into RCS
18684
18685 1991-12-18 Richard Stallman <rms@gnu.org>
18686
18687 * src/print.c, src/nullable.c, src/derives.c:
18688 entered into RCS
18689
18690 1991-11-03 David J. MacKenzie <djm@gnu.org>
18691
18692 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
18693 entered into RCS
18694
18695 1988-09-09 Richard Stallman <rms@gnu.org>
18696
18697 * src/bison.hairy: entered into RCS
18698
18699 1987-12-16 Richard Stallman <rms@gnu.org>
18700
18701 * REFERENCES: entered into RCS
18702
18703
18704 -----
18705
18706 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
18707 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
18708 Free Software Foundation, Inc.
18709
18710 Copying and distribution of this file, with or without
18711 modification, are permitted provided the copyright notice and this
18712 notice are preserved.
18713
18714 $Id$