]> git.saurik.com Git - bison.git/blame - ChangeLog
* data/push.c (yypush_parse): Declare prototype regardless of
[bison.git] / ChangeLog
CommitLineData
16ca01f9
JD
12006-12-14 Bob Rossi <bob@brasko.net>
2
3 * data/push.c (yypush_parse): Declare prototype regardless of
4 %locations option.
5
ab8e7e1a
JD
62006-12-14 Bob Rossi <bob@brasko.net>
7
8 * data/push.c (yyparse): Remove the prototype and the #define when in
9 push-parser mode.
10
9bf32be3
JD
112006-12-13 Bob Rossi <bob@brasko.net>
12
13 * data/push.c (yypstate_init): Rename to...
14 (yypstate_new): ... this and use b4_c_function_def.
15 (yypstate_delete): New.
16 (yypush_parse): Change parameters yynval and yynlloc to be const.
17 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
18 yypstate_delete functions.
19
f02e2948
JD
202006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
21
22 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
23 strange test case titles. Reported by Bob Rossi.
24
38eb7751
PE
252006-12-13 Paul Eggert <eggert@cs.ucla.edu>
26
27 * TODO: Add pointer to Sylvain Schmitz's work on static detection
28 of potential ambiguities in GLR grammers.
29
bd9d212b
JD
302006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
31
32 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
33 `bison ', use m4_index instead of m4_substr since chopping up a string
34 containing M4-special characters causes problems here.
35
36 Fix a couple of bugs related to special characters in user-specified
37 file names, and make it easier for skeletons to compute output file
38 names with the same file name prefix as Bison-computed output file
39 names.
40 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
41 b4_parser_file_name and b4_spec_defines_file instead of
42 @output_parser_name@ and @output_header_name@, which are now redundant.
43 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
44 b4_parser_file_name, b4_spec_defines_file, and the new
45 @basename(FILENAME@) instead of @output_parser_name@ and
46 @output_header_name@, which inappropriately escaped the file names as
47 C string literals.
48 * src/files.c (all_but_ext): Remove static qualifier.
49 (compute_output_file_names): Move `free (all_but_ext)' to...
50 (output_file_names_free): ... here since all_but_ext is needed later.
51 * src/files.h (all_but_ext): Extern.
52 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
53 exactly what MUSCLE_INSERT_STRING used to do.
54 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
55 characters are escaped properly.
56 * src/output.c (prepare): Define muscle file_name_all_but_ext as
57 all_but_ext.
58 For pkgdatadir muscle, maintain previous functionality by using
59 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
60 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
61 digraphs would never be expanded. Hopefully no one has M4-special
62 characters in his Bison installation path.
63 * src/scan-skel.l: Don't parse @output_header_name@ and
64 @output_parser_name@ anymore since they're now redundant.
65 In @output, use decode_at_digraphs.
66 Parse a new @basename command that invokes last_component.
67 (decode_at_digraphs): New.
68 (BASE_QPUTS): Remove unused.
69 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
70 (Output file name): New tests.
71
3f7ca628
JD
722006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
73
74 Warn about output files that are generated by the skeletons and that
75 conflict with other output files.
76 * data/glr.c: Don't generate the header file here when glr.cc does.
77 * src/files.c (file_names, file_names_count): New static globals.
78 (compute_output_file_names): Invoke output_file_name_check for files
79 not generated by the skeletons and remove existing checks.
80 (output_file_name_check): New function that warns about conflicting
81 output file names.
82 (output_file_names_free): Free file_names.
83 * src/files.h (output_file_name_check): Declare.
84 * src/scan-skel.l: Invoke output_file_name_check for files generated by
85 the skeletons.
86 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
87 (Conflicting output files): New tests.
88
178e123e
PE
892006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
90
91 * doc/bison.texinfo: Fix a couple of typos.
92
932006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
94
95 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
96 Rename to...
97 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
98 update all uses.
99 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
100 (yypush_parse): Rename yypvars argument to yyps and remove redundant
101 local pv.
102 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
103 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
104
ea17f233
JD
1052006-12-07 Bob Rossi <bob@brasko.net>
106 and Joel Denny <jdenny@ces.clemson.edu>
107
108 * data/push.c (yypvarsinit): Change return type from void* to struct
109 yypvars*. No longer cast to void* on return.
110 (struct yypvars): Remove yylen since it need not be remembered between
111 yypushparse invocations.
112 (yypushparse): Don't copy between yylen and pv->yylen.
113
55a30bda
JD
1142006-12-05 Bob Rossi <bob@brasko.net>
115
116 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
117 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
118 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
119 (struct yypvars): Remove b4_declare_parser_variables.
120 (yypvarsinit): Remove init code for removed variables.
121 (global scope): Do not declare b4_declare_parser_variables if
122 push or pure mode.
123 (yypushparse): Add b4_declare_parser_variables.
124 Init new local variables, and remove init code for removed
125 yypvars variables.
126 (yyparse): Delete.
127 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
128 and yyparse for other modes.
129 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
130 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
131 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
132 (AT_PURE_LEX_IF): True if pure or push parser.
133
85894313
JD
1342006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
135
136 Document Yacc prologue alternatives and default %destructor's and
137 %printer's as experimental. Don't mention Java yet. Discussed at
138 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
139 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
140 (2.3a): Annotate this entry to say the old forms of these features were
141 also experimental.
142 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
143 Bison Symbols): Say they're experimental. Comment out any mention
144 of Java (we'll want this back eventually).
145
02975b9a
JD
1462006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
147
148 Support a file name argument to %defines. Deprecate `=' in
149 %file-prefix, %name-prefix, and %output. Discussed at
150 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
151 * NEWS (2.3a+): Mention.
152 * doc/bison.texinfo (Decl Summary, Bison Symbols): Add entry for new
153 form of %defines, and remove `=' from entries for %file-prefix,
154 %name-prefix, and %output.
155 * src/parse-gram.y (prologue_declaration): Implement.
156 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
157 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
158 all but one occurrence of %name-prefix.
159 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
160 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
161 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
162 occurrence of each of %file-prefix and %output. Add check for %defines
163 with argument.
164 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
165 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
166 Remove the `=' from %output.
167
287b314e
JD
1682006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
169
170 Don't escape $ in test case titles since Autoconf 2.61 now does that
171 correctly.
172 * tests/actions.at (Default %printer and %destructor are not for error
173 or $undefined): Here.
174 (Default %printer and %destructor are not for $accept): Here.
175 * tests/input.at (Invalid $n and @n): Here.
176
3ebecc24
JD
1772006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
178
179 Rename <!> to <>. Discussed starting at
180 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
181 * NEWS (2.3a+): Update.
182 * doc/bison.texinfo (Freeing Discarded Symbols, Bison Symbols):
183 Update.
184 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
185 * src/scan-gram.l (INITIAL): Implement.
186 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
187 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
188 comment.
189 * tests/actions.at (Default tagless %printer and %destructor,
190 Default tagged and per-type %printer and %destructor,
191 Default %printer and %destructor are not for error or $undefined,
192 Default %printer and %destructor are not for $accept,
193 Default %printer and %destructor for mid-rule values): Update.
194 * tests/input.at (Default %printer and %destructor redeclared,
195 Unused values with default %destructor): Update.
196
26b8a438
JD
1972006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
198
199 Don't let %prec take a nonterminal.
200 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
201 token.
202 * tests/input.at (%prec takes a token): New test checking that %prec
203 won't take a nonterminal.
204
07c39ae9
JD
2052006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
206
405d53b7
JD
207 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
208 it was double-quoted.
07c39ae9
JD
209 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
210 grammar is maintained with Bison's highest standards.
211 * src/getargs.c: Fix some typos in Doxygen comments.
212
580b8926
JD
2132006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
214
215 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
216 later. Reported by Paul Eggert in
217 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
218 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
219 * src/scan-code.l (translate_action): Don't bother invoking
220 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
221 (code_scanner_free): Instead of invoking
222 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
223 which frees more.
224 * src/scan-gram.l (gram_scanner_free): Likewise.
225 * src/scan-skel.l (scan_skel): Likewise.
226
4502eadc
JD
2272006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
228
229 * src/files.c (tr): Change return type to void.
230 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
231 has been called previously for the same key.
232 (muscle_find): Return storage instead of value so that
233 --enable-gcc-warnings doesn't produce warnings that the return discards
234 const. aver that the value and storage are the same since storage
235 could potentially be NULL when value is not.
236 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
237 same as 0.
238
7746c8f6
PE
2392006-11-08 Paul Eggert <eggert@cs.ucla.edu>
240
241 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
242 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
243 us a slightly cleaner distribution, and also works.
244 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
245 gnulib changes.
246
eb095650
PE
2472006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
248 and Paul Eggert <eggert@cs.ucla.edu>
249
250 Don't let Bison leak memory except when it complains.
251 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
252 (spec_defines_file, dir_prefix): Now char *, not const char *,
253 since they are freed.
254 * src/files.c: Likewise.
255 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
256 Likewise.
257 (tr): Now operates in-place. All uses changed.
258 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
259 values.
260 (compute_file_name_parts, compute_output_file_names): Don't store
261 read-only data in variables that will be freed.
262 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
263 src_extension, and header_extension.
264 (output_file_names_free): New public function to free
265 spec_verbose_file, spec_graph_file, spec_defines_file,
266 parser_file_name, and dir_prefix.
267 * src/getargs.c (getargs): Don't store read-only data in variables that
268 will be freed.
269 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
270 (which previously existed but was unused), and quotearg_free.
271 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
272 * src/muscle_tab.c: Likewise.
273 (muscle_entry): Make the value char const *,
274 and add a new storage member that is char * and can be freed.
275 (muscle_entry_free): New private function.
276 (muscle_init): Use it instead of free.
277 (muscle_insert, muscle_grow): Update and use new storage member.
278 (muscle_code_grow): Free the string passed to muscle_grow
279 since it's not needed anymore.
280 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
281 add a new `char *code' member.
282 ("{...}"): Declare semantic type as code.
283 * src/scan-code.h (translate_rule_action):
284 (translate_symbol_action, translate_code, translate_action): Return
285 `char const *' rather than `char *' since external code should not free
286 these strings.
287 * src/scan-code.l: Likewise.
288 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
289 which is "{...}" in the parser.
290 * tests/Makefile.am (maintainer-check-valgrind): Set
291 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
292 Valgrind.
293 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
294 complain.
295 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
296 expecting a non-zero exit status sets --leak-check=summary and
297 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
298 this case, and we don't want to hear about it.
299
ac564be4
PE
3002006-11-08 Paul Eggert <eggert@cs.ucla.edu>
301
302 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
303 instead of from the template, to simplify configuration a bit.
304 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
305 and m4/wint_t.m4, as they are needed with the latest gnulib.
306
17bd8a73
JD
3072006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
308
309 Disable unset/unused mid-rule value warnings by default, and recognize
310 --warnings=midrule-values to enable them. Discussed starting at
311 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
312 * NEWS (2.3a+): Mention.
313 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
314 warnings): Add entry for midrule-values subargument.
315 * src/reader.c (symbol_should_be_used): Don't return true just because
316 the value is a set/used mid-rule value unless
317 --warnings=midrule-values was specified.
318 * tests/input.at (Unused values, Unused values before symbol
319 declarations): Run tests with and without --warnings=midrule-values.
320
321 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
322 than LIST_FREE directly.
323
89eb3c76
JD
3242006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
325
326 Finish implementing --warnings=error, which should not be implied by
327 --warnings=all (or by its synonyms -W and --warnings without
328 subarguments).
329 * src/complain.c (set_warning_issued): New function to report that
330 warnings are being treated as errors and to record an error if so.
331 Invoke...
332 (warn_at, warn): ... here.
333 * src/getargs.c (warnings_args, warnings_types): Reorder so that
334 "error - warnings are errors" does not appear above "all - all of the
335 above".
336 (getargs): For -W and --warnings without subarguments, don't let
337 FLAGS_ARGMATCH set warnings_error in warnings_flag.
338 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
339
ba7560e2
JD
3402006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
341
342 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
343 empty subargument list. For example: `bison --warnings= parser.y'.
344
31283fc3
JD
3452006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
346
347 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
348 the parser header file so that gcc doesn't warn.
349
12e35840
JD
3502006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
351
352 Split the default %destructor/%printer into two kinds: <*> and <!>.
353 Discussed starting at
354 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
355 * NEWS (2.3a+): Mention.
356 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
357 previous change today related to mid-rules.
358 (Bison Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 359 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
360 (TYPE_TAG_ANY): Add as <*>.
361 (TYPE_TAG_NONE): Add as <!>.
362 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
363 for <*> and <!>.
364 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
365 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
366 * src/symlist.c (symbol_list_default_new): Split into tagged and
367 tagless versions.
368 (symbol_list_destructor_set, symbol_list_printer_set): Split
369 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
370 SYMLIST_DEFAULT_TAGLESS.
371 * src/symlist.h: Update symbol_list_default*_new prototypes.
372 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
373 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
374 * src/symtab.c (default_destructor, default_destructor_location,
375 default_printer, default_printer_location): Split each into tagged and
376 tagless versions.
377 (symbol_destructor_get, symbol_destructor_location_get,
378 symbol_printer_get, symbol_printer_location_get): Implement tagged
379 default and tagless default cases.
380 (default_destructor_set, default_printer_set): Split each into tagged
381 and tagless versions.
382 * src/symtab.h: Update prototypes.
383 * tests/actions.at (Default %printer and %destructor): Rename to...
384 (Default tagless %printer and %destructor): ... this, and extend.
385 (Per-type %printer and %destructor): Rename to...
386 (Default tagged and per-type %printer and %destructor): ... this, and
387 extend.
388 (Default %printer and %destructor for user-defined end token): Extend.
389 (Default %printer and %destructor are not for error or $undefined):
390 Update.
391 (Default %printer and %destructor are not for $accept): Update.
392 (Default %printer and %destructor for mid-rule values): Extend.
393 * tests/input.at (Default %printer and %destructor redeclared): Extend.
394 (Unused values with default %destructor): Extend.
395
f91b1629
JD
3962006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
397
398 Don't apply the default %destructor/%printer to an unreferenced midrule
399 value. Mentioned at
400 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
401 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
402 like $@n instead of just @n so that the default %destructor/%printer
403 logic doesn't see them as user-defined symbols.
404 (symbol_is_dummy): Check for both forms of the name.
405 * src/reader.c (packgram): Remove the `$' from each midrule symbol
406 name for which the midrule value is referenced in any action.
407 * tests/actions.at (Default %printer and %destructor for mid-rule
408 values): New test.
409 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
410 for change to dummy symbol names.
411
519d0004
JD
4122006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
413
414 Warn about unset midrule $$ if the corresponding $n is used.
415 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
416 $n usage.
417 (packgram): Before invoking grammar_rule_check on any rule, make sure
418 all actions have already been scanned in order to set `used' flags.
419 Otherwise, checking that a midrule's $$ is set will not always work
420 properly because the midrule check must forward-reference the midrule's
421 parent rule.
422 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
423 warning.
424
a501eca9
JD
4252006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
426
427 More improvements to the documentation of the prologue alternatives:
428 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
429 Bison manual.
430 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
431 some text to clarify the relative importance of the new directives and
432 to show how these directives may be viewed as code labels.
433
2cbe6b7f
JD
4342006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
435
436 Similar to the recently removed %before-header, add %code-top as the
437 alternative to the pre-prologue. Mentioned at
438 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
439 Also, let the prologue alternatives appear in the grammar section.
440 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
441 (prologue_declaration): Move the existing prologue alternatives to...
442 (grammar_declaration): ... here and add %code-top.
443 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
444
445 Clean up and extend documentation for the prologue alternatives.
446 * NEWS (2.3a+): Describe prologue alternatives.
447 * doc/bison.texinfo (Prologue): Move discussion of prologue
448 alternatives to...
449 (Prologue Alternatives): ... this new section, and extend it to discuss
450 all 4 directives in detail.
451 (Bison Symbols): Clean up discussion of prologue alternatives and add
452 %code-top.
453
e557d3ea
JMG
4542006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
455
456 DJGPP specific issues.
457
458 * djgpp/config.bat: config.hin has been moved to lib. Adjust
459 config.bat accordingly.
460 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
461 * djgpp/config.site: Likewise.
462
136a0f76
PB
4632006-10-16 Paolo Bonzini <bonzini@gnu.org>
464
27bd5d67
PB
465 Replace %*-header with %provides, %requires, %code. See discussion at
466 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
467
136a0f76
PB
468 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
469 (b4_user_start_header): Remove.
470 * data/glr.c: Use new macros instead of b4_*start_header
471 and b4_*end_header.
472 * data/glr.cc: Likewise.
473 * data/lalr1.cc: Likewise.
474 * data/push.c: Likewise.
475 * data/yacc.c: Likewise.
476
477 * doc/bison.texinfo: Remove %before-header, rename
478 %{start,end,after}-header to %requires, %provides, %code.
479
480 * src/parse-gram.y: Likewise (also rename token names accordingly).
481 * src/scan-gram.l: Likewise.
482 * tests/actions.at: Likewise.
483
10f429ef
PE
4842006-10-14 Paul Eggert <eggert@cs.ucla.edu>
485
486 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
487 Problem reported by Joel E. Denny.
488
4892006-10-14 Jim Meyering <jim@meyering.net>
490
491 (Sync from coreutils.)
492 Work also when the working directory (with e.g. coreutils sources)
493 is version controlled with git, rather than CVS.
494 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
495 rather than CVS.
496 In messages and comments, say e.g., "checked-out sources",
497 rather than "CVS sources".
498 (version_controlled_file): New function. Work for git as well as
499 for CVS. Don't use grep's -q option.
500 (slurp): Call it here, in place of CVS-specific code.
501
c4bd5bf7
JD
5022006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
503
504 Fix testsuite for ./configure --enable-gcc-warnings:
505 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
506 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
507 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
508 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
509 * test/regression.at (Diagnostic that expects two alternatives):
510 Likewise.
511
46356ea4
PE
5122006-10-12 Paul Eggert <eggert@cs.ucla.edu>
513
231ed89a
PE
514 * bootstrap.conf (gnulib_modules): Add config-h.
515 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
516 worry about HAVE_CONFIG_H.
517 * lib/abitset.c: Likewise.
518 * lib/bitset.c: Likewise.
519 * lib/bitset_stats.c: Likewise.
520 * lib/bitsetv-print.c: Likewise.
521 * lib/bitsetv.c: Likewise.
522 * lib/ebitset.c: Likewise.
523 * lib/get-errno.c: Likewise.
524 * lib/lbitset.c: Likewise.
525 * lib/subpipe.c: Likewise.
526 * lib/timevar.c: Likewise.
527 * lib/vbitset.c: Likewise.
528 * lib/bitset.c: Include "bitset.h" first, to test interface.
529 * lib/bitset_stats.c: Include "bitset_stats.h" first.
530 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
531 * lib/bitsetv.c: Include "bitsetv.h" first.
532 * lib/get-errno.c: Include "get-errno.h" first.
533 * m4/.cvsignore: Add config-h.m4.
534 * tests/actions.at (Default %printer and %destructor for ...):
535 Adjust expected line numbers in output to reflect removal of #if
536 HAVE_CONFIG_H lines.
537 * tests/glr-regression.at (Missed %merge type warnings when ...):
538 Likewise.
539 * tests/regression.at (Braced code in declaration in rules section):
540 Likewise.
541 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
542 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
543 Include <config.h> unconditionally.
544
46356ea4
PE
545 * bootstrap: Sync from coreutils, as follows:
546
547 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
548
549 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
550 variable was sometimes used without being initialized. This
551 messed up the installation of the INSTALL file in some cases.
552
553 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
554
555 * bootstrap (usage, main program, symlink_to_gnulib): Add option
556 --copy. Inspired by a suggestion from Bruno Haible.
557
558 2006-10-03 Jim Meyering <jim@meyering.net>
559
560 * bootstrap: Undo last change to this file, since now gnulib-tool
561 sticks with the automake default in generating dependencies.
562
dd4bf078
PE
5632006-10-12 Paul Eggert <eggert@cs.ucla.edu>
564
cf2a5f7c
PE
565 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
566 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
567
568 * doc/bison.1: Add copyright notice.
569
570 * data/glr.c: Don't include <stdarg.h>; not used.
571
35fe0834
PE
572 * NEWS: The -g and --graph options now output graphs in Graphviz
573 DOT format, not VCG format.
574 * doc/bison.1: Likewise.
575 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
576 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
577 of this change in
578 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
579 * TODO: Remove Graphviz entry.
580 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
581 remove vcg.c, vcg.h, vcg_defaults.h.
582 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
583 * src/graphviz.c, src/graphviz.h: New files.
584 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
585 * src/files.h: Make comment more generic.
586 * src/main.c (main): Likewise.
587 * src/print_graph.h: Likewise.
588 * src/getargs.c (usage): Make usage description more generic.
589 * src/print_graph.c: Include graphviz.h rather than vcg.h.
590 (static_graph, fgraph): Remove. All uses changed to pass
591 arguments instead of sharing a static var.
592 (print_core, print_actions, print_state, print_graph):
593 Output graphviz format rather than VCG format.
594 * tests/.cvsignore: Remove *.vcg; add *.dot.
595 * tests/output.at: Expect *.dot files, not *.vcg files.
596
dd4bf078
PE
597 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
598 accommodates the 2006-10-08 change.
599
efdd7421
PE
6002006-10-11 Bob Rossi <bob@brasko.net>
601
602 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
603 (b4_yyssa, b4_yyerror_range): New macros.
604 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
605 (yypvarsinit): Remove init of removed fields.
606 (yypushparse): Remove use of removed fields; use new macros instead.
607
96a1981a
PE
6082006-10-11 Paul Eggert <eggert@cs.ucla.edu>
609
610 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
611 in a push parser. Reindent slightly to match yacc.c better.
612
6132006-10-11 Bob Rossi <bob@brasko.net>
614
46356ea4
PE
615 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
616 yymsg_alloc fields.
617 (yypvarsinit, yypushparse): Remove init of removed fields.
618 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 619
c1630a8b
PE
6202006-10-09 Paul Eggert <eggert@cs.ucla.edu>
621
622 * THANKS: Add Paolo Bonzini and Bob Rossi.
623
90b9908d
PB
6242006-10-08 Paolo Bonzini <bonzini@gnu.org>
625
626 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
627 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
628 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
629 b4_define_user_cde and uses): Remove.
630 (b4_comment, b4_prefix, b4_sync_start): New.
631 * data/bison.m4: New file, with most of the content removed from c.m4.
632 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
633 * src/output.c (output_skeleton): Pass bison.m4.
634 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
635 only if specified.
636
cf806753
PE
6372006-10-05 Paul Eggert <eggert@cs.ucla.edu>
638
639 Fix test failure reported by Tom Lane in
640 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
641 and try to make such failures easier to catch in the future.
642 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
643 that's now the caller's responsibility.
644 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
645 Set yychar = YYEOF if it's negative.
646 * tests/actions.at (yylex): Abort if asked to read past EOF.
647 * tests/conflicts.at (yylex): Likewise.
648 * tests/cxx-type.at (yylex): Likewise.
649 * tests/glr-regression.at (yylex): Likewise.
650 * tests/input.at (yylex): Likewise.
651 * tests/regression.at (yylex): Likewise.
652 * tests/torture.at (yylex): Likewise.
653
0e2f006a
PE
6542006-10-01 Paul Eggert <eggert@cs.ucla.edu>
655
656 Fix problems with translating English-language diagnostics.
657 * bootstrap: Fix bug introduced in recent bootstrap changes, with
658 respect to bison-runtime pot generation. The YY_ stuff
659 wasn't being captured.
660 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
661 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
662 * runtime-po/POTFILES.in: Add data/push.c.
663
e3ddc1e3
PE
6642006-09-29 Paul Eggert <eggert@cs.ucla.edu>
665
666 Merge bootstrap changes from coreutils.
667
668 2006-09-28 Jim Meyering <jim@meyering.net>
669
670 Automatically generated dependencies are important even
671 when all of the sources in a directory come from gnulib.
672 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
673 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
674
675 2006-09-23 Jim Meyering <jim@meyering.net>
676
677 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
678
679 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
680
681 * bootstrap: Add support for --force.
682 (usage): New function. Describe usage less tersely.
683 (CVS_only_file): New var.
684
01e972b3
PE
6852006-09-21 Paul Eggert <eggert@cs.ucla.edu>
686
687 * data/push.c (YYPUSH_MORE): Make it an enum instead.
688 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
689 Adjust white space and comments to match GNU style better.
690
c63d3e90
PE
6912006-09-20 Bob Rossi <bob@brasko.net>
692
693 * data/push.c (yyresult_get): Remove function.
694 (YYPUSH_MORE): Add #define.
695 (yypushparse): Modify return value.
696
e70f46d1
PE
6972006-09-20 Paul Eggert <eggert@cs.ucla.edu>
698
699 * stamp-h.in: Remove; no longer needed.
700 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
701 Remove config.h, config.hin, intl (no longer created).
702 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
703 stamp-h1.
704
705 Sync bootstrap from coreutils, as follows:
706
707 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
708
709 * bootstrap (symlink_to_gnulib): New function.
710 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
711 to copies-of-gnulib.
712 (cp_mark_as_generated, slurp, gnulib_files):
713 Avoid making a copy if it's the same as the old version.
714 (gnulib_files): Add support for this variable (used by Bison).
715
a92be413
PE
7162006-09-20 Paul Eggert <eggert@cs.ucla.edu>
717
718 * src/getargs.c (usage): Rework to use conventions similar to
719 coreutils, to make translation a bit easier and the code a bit
720 smaller. Problem reported by Tim Van Holder.
721
4f82b42a
PE
7222006-09-15 Paul Eggert <eggert@cs.ucla.edu>
723
3b2942e6
PE
724 Use some of gnulib's new modules, taken from coreutils.
725
726 * bootstrap: Sync from coreutils, except add support for gnulib_files.
727 * bootstrap.conf: New file.
728 (gnulib_modules): Add configmake, inttypes, unistd.
729 (XGETTEXT_OPTIONS): Add complain, complain_at,
730 fatal, fatal_at, warn, warn_at, unexpected_end.
731 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
732 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
733 (gl_EARLY): Add.
734 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
735 (gl_INIT): Add
736 (GNULIB_AUTOCONF_SNIPPET): Remove.
737 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
738 the pickiest.
739 * lib/.cvsignore: Add inttypes_.h.
740 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
741 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
742 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
743 no-longer-necessary initializations.
744 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
745 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
746 use the unistd module.
747 * src/system.h: Likewise.
748 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
749 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
750 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
751 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
752 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
753 * src/system.h: Include inttypes.h unconditionally, now that we
754 use the inttypes module. Don't bother to include stdint.h, since
755 inttypes.h now does that for us.
756 (LOCALEDIR): Remove, now that we use the configmake module.
757 * src/getargs.c: Include configmake.h.
758 * src/main.c: Likewise.
759 * src/output.c: Likewise.
760 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
761 not from $abs_top_builddir, since config.h moved.
762
763
4f82b42a
PE
764 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
765 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
766
767 * src/parse-gram.y (symbol_declaration): Don't put statements
768 before declarations; it's not portable to C89.
769 * src/scan-code.l (handle_action_at): Likewise.
770
771 * src/scan-code.l: Always initialize braces_level; the old code
772 left it uninitialized and therefore had undefined behavior.
773
774 Don't attempt to redefine 'assert', since it runs afoul of
775 systems where standard headers (mistakenly) include <assert.h>.
776 Instead, define and use our own alternative, called 'aver'.
777 * src/reader.c: Don't include assert.h, since we no longer
778 use assert.
779 * src/scan-code.l: Likewise.
780 * src/system.h (assert): Remove, replacing with....
781 (aver): New function, taking a bool arg. All uses changed.
782 * src/tables.c (pack_vector): Ensure that aver arg is bool,
783 not merely an integer.
784
31c10e38
PE
7852006-09-15 Bob Rossi <bob@brasko.net>
786
787 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
788 * data/c.m4 (YYPUSH): New.
789 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
790 * src/getargs.c (push_parser): New var.
791 * src/getargs.h (push_parser): New declaration.
792 * src/output.c (prepare): Add macro insertion of `push_flag'.
793 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
794 (prologue_declaration): Parse %push-parser.
795 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
796 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
797 list of removed lines from the traces observed.
798 (AT_CHECK_CALC_LALR): Added push parser tests.
799
fa7b79c0
PE
8002006-09-13 Paul Eggert <eggert@cs.ucla.edu>
801
21fe08ca
PE
802 * NEWS: Version 2.3a.
803 * configure.ac (AC_INIT): Likewise.
804
e8ec4d9b
PE
805 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
806 "#define YYSTYPE int" that caused "make maintainer-check" to fail
807 due to header ordering dependencies. I don't know why the #define
808 was there.
809
fa7b79c0
PE
810 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
811 runtime cost when YYDEBUG is not defined, and so that some tests
812 that used to fail now work. Problem and initial suggestion by
813 Paolo Bonzini.
814 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
815 * data/glr.cc (b4_parser_class_name):
816 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
817 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
818 (yydebug_) [YYDEBUG]: New member.
819 (yycdebug_): Now defined only if YYDEBUG.
820 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
821 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
822 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
823 if YYYDEBUG.
824 (debug_stream, set_debug_stream, debug_level, set_debug_level):
825 Define only if YYDEBUG.
826 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
827 set_debug_level.
828 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
829 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
830 AT_CHECK_CALC_GLR_CC that are working now.
831
4ec13d60
PE
8322006-09-12 Paul Eggert <eggert@cs.ucla.edu>
833
834 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
835 We don't need them in glr.cc, and glr.c defines them.
836 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
837 assumes that defining it to anything is the same as defining
838 it to 1. Problem reported by Paolo Bonzini.
839
8e1687ae
PE
8402006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
841
842 * data/c.m4 (b4_null, b4_case): Define.
843 * src/output.c (prepare_symbols): Use b4_null.
844 (user_actions_output): Use b4_case.
845
3dc5e96b
PE
8462006-09-11 Paul Eggert <eggert@cs.ucla.edu>
847
aef3da86
PE
848 * data/glr.c (b4_shared_declarations): Put start-header first,
849 before any #includes that we generate, so that feature-test
850 macros work. Problem reported by Michael Deutschmann in
851 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
852 * data/lalr1.cc: Likewise.
853 * doc/bison.texinfo (Prologue): Document that feature-test macros
854 should be defined before any Bison declarations.
855 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
856 that depend on location.hh after, not before, Bison decls, since
857 we now include location.hh after the first user prologue.
858
3dc5e96b
PE
859 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
860 Sander Brandenburg in
861 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
862 Also, fix minor white space and comment issues.
aef3da86
PE
863 (Prologue): Mention that it's better to define feature-test macros
864 before Bison declarations. Problem reported by Michael Deutschmann.
865
866 * README-cvs: Fix typo: "&" should be "&&". Problem reported
867 by Jim Meyering.
868 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
869 This adjusts to recent gnulib changes.
3dc5e96b 870
b2a0b7ca
JD
8712006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
872
873 Finish implementation of per-type %destructor/%printer. Discussed
874 starting at
875 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
876 and
877 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
878 * NEWS (2.3+): Add a description of this feature to the default
879 %destructor/%printer description.
880 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
881 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
882 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
883 list node contains a semantic type.
884 * src/symtab.c, src/symtab.h: Extend with a table that associates
885 semantic types with their %destructor's and %printer's.
886 (semantic_type_from_uniqstr, semantic_type_get,
887 semantic_type_destructor_set, semantic_type_printer_set): New functions
888 composing the public interface of that table.
889 (symbol_destructor_get, symbol_destructor_location_get,
890 symbol_printer_get, symbol_printer_location_get): If there's no
891 per-symbol %destructor/%printer, look up the per-type before trying
892 the default.
893 * tests/actions.at (Per-type %printer and %destructor): New test case.
894 * tests/input.at (Default %printer and %destructor redeclared):
895 Extend to check that multiple occurrences of %symbol-default in a
896 single %destructor/%printer declaration is an error.
897 (Per-type %printer and %destructor redeclared, Unused values with
898 per-type %destructor): New test cases.
899
3be03b13
JD
9002006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
901
902 Require default %destructor/%printer to be declared using
903 %symbol-default instead of an empty symbol list, and start working on
904 new per-type %destructor/%printer. Discussed at
905 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
906 * NEWS (2.3+): Add %symbol-default to example.
907 * bison.texinfo (Freeing Discarded Symbols): Likewise.
908 (Bison Symbols): Add entry for %symbol-default.
909 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
910 (generic_symlist, generic_symlist_item): New nonterminals for creating
911 a list in which each item is a symbol, semantic type, or
912 %symbol-default.
913 (grammar_declaration): Use generic_symlist in %destructor and %printer
914 declarations instead of symbols.1 or an empty list.
915 (symbol_declaration, precedence_declaration, symbols.1): Update actions
916 for changes to symbol_list.
917 * src/reader.c: Update for changes to symbol_list.
918 * src/scan-code.l: Likewise.
919 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
920 * src/symlist.c, src/symlist.h: Extend such that a list node may
921 represent a semantic type or a %symbol-default in addition to just an
922 ordinary symbol. Add switched functions for setting %destructor's and
923 %printer's.
924 * tests/actions.at, tests/input.at: Add %symbol-default to all default
925 %destructor/%printer declarations.
926
3508ce36
JD
9272006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
928
929 Whether the default %destructor/%printer applies to a particular symbol
930 isn't a question of whether the user *declares* that symbol (in %token,
931 for example). It's a question of whether the user by any means
932 *defines* the symbol at all (by simply using a char token, for
933 example). $end is defined by Bison whereas any other token with token
934 number 0 is defined by the user. The error token is always defined by
935 Bison regardless of whether the user declares it with %token, but we
936 may one day let the user define error as a nonterminal instead.
937 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
938 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
939 the meaning of "user-defined".
940 * tests/actions.at (Default %printer and %destructor for user-declared
941 end token): Rename to...
942 (Default %printer and %destructor for user-defined end token): ...
943 this.
944
945 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
946 computation of whether to apply the default, don't maintain a list of
947 every Bison-defined symbol. Instead, just check for a first character
948 of '$', which a user symbol cannot have, and check for the error token.
949
9350499c
JD
9502006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
951
952 Don't apply the default %destructor or %printer to the error token,
953 $undefined, or $accept. This change fits the general rule that the
954 default %destructor and %printer are only for user-declared symbols,
955 and it solves several difficulties that are described in the new test
956 cases listed below.
957 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
958 * tests/actions.at (Default %printer and %destructor are not for error
959 or $undefined, Default %printer and %destructor are not for $accept):
960 New test cases.
961
4d7370cb
JD
9622006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
963
964 Allow %start after the first rule.
965 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
966 when parsing the first rule.
967 (check_and_convert_grammar): Search for it here after all grammar
968 declarations have been parsed. Skip midrules, which have dummy LHS
969 nonterminals.
970 * src/symtab.c (symbol_is_dummy): New function.
971 * src/symtab.h (symbol_is_dummy): Declare it.
972 * tests/input.at (%start after first rule): New test.
973
6d0ef4ec
JD
9742006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
975
976 Redo some of the previous commit: add back the ability to use
977 non-aliased/undeclared string literals since it might be useful to
978 those declaring %token-table.
979 * src/reader.c (check_and_convert_grammar): Undo changes in previous
980 commit: don't worry about complaints from symbols_pack.
981 * src/symtab.c (symbol_new, symbol_class_set,
982 symbol_check_alias_consistency): Undo changes in previous commit: count
983 each string literal as a new symbol and token, assign it a symbol
984 number, and don't complain about non-aliased string literals.
985 (symbols_pack): Since symbol_make_alias still does not decrement symbol
986 and token counts but does still set aliased tokens to the same number,
987 symbol_pack_processor now leaves empty slots in the symbols array.
988 Remove those slots.
989 * tests/regression.at (Undeclared string literal): Remove test case
990 added in previous commit since non-aliased string literals are allowed
991 again.
992 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
993 remove unnecessary string literal declarations.
994 * tests/sets.at (Firsts): Likewise.
995
965537bc
JD
9962006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
997
998 Don't allow an undeclared string literal, but allow a string literal to
999 be used before its declaration.
1000 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
1001 symbols_pack complained.
1002 * src/symtab.c (symbol_new): Don't count a string literal as a new
1003 symbol.
1004 (symbol_class_set): Don't count a string literal as a new token, and
1005 don't assign it a symbol number since symbol_make_alias does that.
1006 (symbol_make_alias): It's not necessary to decrement the symbol and
1007 token counts anymore. Don't assume that an alias declaration occurs
1008 before any uses of the identifier or string, and thus don't assert that
1009 one of them has the highest symbol number so far.
1010 (symbol_check_alias_consistency): Complain if there's a string literal
1011 that wasn't declared as an alias.
1012 (symbols_pack): Bail if symbol_check_alias_consistency failed since
1013 symbol_pack asserts that every token has been assigned a symbol number
1014 although undeclared string literals have not.
1015 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 1016 string literal): New test cases.
965537bc
JD
1017 (Characters Escapes, Web2c Actions): Declare string literals as
1018 aliases.
1019 * tests/sets.at (Firsts): Likewise.
1020
47aee066
JD
10212006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
1022
1023 In the grammar scanner, STRING_FINISH unclosed constructs and return
1024 them to the parser in order to improve error messages.
1025 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
1026 SC_BRACED_CODE, SC_PROLOGUE): Implement.
1027 * tests/input.at (Unclosed constructs): New test case.
1028 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
1029 seen.
1030
1031 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
1032 unused global.
1033
1f6b3679
JD
10342006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
1035
1036 Handle string aliases for character tokens correctly.
1037 * src/symtab.c (symbol_user_token_number_set): If the token has an
1038 alias, check and set its alias's user token number instead of its own,
1039 which is set to indicate the alias. Previously, every occurrence of
1040 the character token in the grammar overwrote that alias indicator with
1041 the character code.
1042 * tests/input.at (String aliases for character tokens): New test.
1043
219741d8
JD
10442006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
1045
1046 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
1047
11daa4e7
PE
10482006-08-11 Paul Eggert <eggert@cs.ucla.edu>
1049
1050 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
1051 to prevent failures when building on older platforms.
1052 Check for autopoint failure.
1053 Set XGETTEXT_OPTIONS to values that check for C format strings,
1054 so that translators are warned about them (this also helps
1055 prevent core dumps).
1056
1057 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
1058 function, since it simplifies our code a bit.
1059
1060 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
1061 rather than -W, so we don't get bogus warnings about sign comparisons.
1062 Add -Wpointer-arith, since that warning is useful (it reports code
1063 that does not conform to C89 and that some compilers reject).
1064 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
1065 since it's no longer needed.
1066
f9bfc42a
JD
10672006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
1068
1069 Clean up scanners a bit.
1070 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
1071 definitions so gcc won't warn when obstack_for_string is unused.
1072 * src/scan-code.l: config.h and system.h are already #include'd by
1073 scan-code-c.c, so get rid of them here.
1074 * src/scan-gram.l: Likewise.
1075 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
1076 definitions rather than duplicating the rest of it.
1077 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
1078
06e8700a
JD
10792006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
1080
1081 Suppress signed/unsigned comparison warnings for yycheck.
1082 * data/c.m4 (b4_safest_int_type): New macro.
1083 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
1084 a signed int type, cast it to b4_safest_int_type first.
1085 * data/yacc.c: Likewise.
1086 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
1087 also overwritten.
1088
9c437126
PE
10892006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
1090
1091 * doc/bison.texinfo: Fix some typos.
1092
284d8a13
PE
10932006-08-02 Paul Eggert <eggert@cs.ucla.edu>
1094
1095 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
1096 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
1097
1098 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
1099 the latest gnulib does this a different way.
1100 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
1101 translation was patched, so stop omitting it.
1102
ec5479ce
JD
11032006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1104
1105 Enable declaration of default %printer/%destructor. Make the parser
1106 use these for all user-declared grammar symbols for which the user does
1107 not declare a specific %printer/%destructor. Thus, the parser uses it
1108 for token 0 if the user declares it but not if Bison generates it as
1109 $end. Discussed starting at
1110 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
1111 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
1112 and
1113 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
1114 * NEWS (2.3+): Mention.
1115 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
1116 declare a %destructor for a mid-rule's semantic value. It's just
1117 impossible to declare one specific to it.
1118 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
1119 code. Describe default %destructor form.
1120 * src/parse-gram.y (grammar_declaration): Parse default
1121 %printer/%destructor declarations.
1122 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
1123 and symbol_destructor_location_get rather than accessing the destructor
1124 and destructor_location members of struct symbol.
1125 (symbol_printers_output): Likewise but for %printer's.
1126 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
1127 again.
1128 * src/symtab.c (default_destructor, default_destructor_location,
1129 default_printer, default_printer_location): New static global
1130 variables to record the default %destructor and %printer.
1131 (symbol_destructor_get, symbol_destructor_location_get,
1132 symbol_printer_get, symbol_printer_location_get): New functions to
1133 compute the appropriate %destructor and %printer for a symbol.
1134 (default_destructor_set, default_printer_set): New functions to set the
1135 default %destructor and %printer.
1136 * src/symtab.h: Prototype all those new functions.
1137 * tests/actions.at (Default %printer and %destructor): New test to
1138 check that the right %printer and %destructor are called, that they're
1139 not called for $end, and that $$ and @$ work correctly.
1140 (Default %printer and %destructor for user-declared end token): New
1141 test to check that the default %printer and %destructor are called for
1142 a user-declared end token.
1143 * tests/input.at (Default %printer and %destructor redeclared, Unused
1144 values with default %destructor): New tests to check related grammar
1145 warnings and errors.
1146
868d2d96
JD
11472006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1148
1149 Clean up handling of %destructor for the end token (token 0).
1150 Discussed starting at
1151 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
1152 and
1153 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
1154
1155 Make the skeletons consistent in how they pop the end token and invoke
1156 its %destructor.
1157 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
1158 state, which has token number 0, since this would invoke the
1159 %destructor for the end token.
1160 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
1161 until after shifting the end token, or else it won't be popped.
1162 * data/yacc.c (yyparse): Likewise.
1163
1164 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
1165 it's the end token. Upon termination, destroy an unshifted lookahead
1166 even when it's the end token.
1167 * data/lalr1.cc (yy::parser::parse): Likewise.
1168 * data/yacc.c (yyparse): Likewise.
1169
1170 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
1171 value warnings for the end token when the user gives the end token a
1172 %destructor.
1173
1174 * tests/actions.at (Printers and Destructors): Test all the above.
1175
62a9592d
PE
11762006-07-24 Paul Eggert <eggert@cs.ucla.edu>
1177
1178 Update to latest gnulib and gettext versions.
1179 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
1180 Add fopen-safer.
1181 (gnulib_files): Add m4/warning.m4. Don't worry about files
1182 overwritten by autopoint.
1183 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
1184 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
1185 rejects them.
1186 Don't use autoreconf; instead, invoke autopoint etc. by hand,
1187 so that we can remove the intl files at a better time.
1188 (intl_files_to_remove): Remove aclocal.m4, since it gets
1189 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
1190 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
1191 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
1192 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
1193 Remove datarootdir hack; no longer needed.
1194 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
1195 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
1196 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
1197 strdup.h.
1198 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
1199 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
1200
10d6970f
PE
12012006-07-20 Paul Eggert <eggert@cs.ucla.edu>
1202
1203 * bootstrap: Adjust to today's change to gnulib-tool by invoking
1204 it with --assume-autoconf='latest-stable'.
1205
50a33993
JD
12062006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
1207
1208 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
1209 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
1210 YYSTYPE' and `{'.
1211 * src/muscle_tab.h (muscle_grow): Replace the header comments with
1212 those from muscle_tab.c since the old ones are misleading.
1213
2ce4ed68
AD
12142006-07-13 Akim Demaille <akim@epita.fr>
1215
1216 Support %define "KEY" {VALUE}.
1217 * src/scan-code.h, src/scan-code.l (translate_action)
1218 (translate_rule_action, translate_symbol_action, translate_code):
1219 Return char *, not const char *.
1220 * src/parse-gram.y (declaration): Rename as...
1221 (prologue_declaration): this.
1222 (string_content): Remove this nonterminal, use STRING.
1223 (braceless, content, content.opt): New nonterminal.
1224 Use them.
1225 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
1226 as value.
1227 * src/scan-gram.l (getargs.h): Don't include it.
1228
db7e5eb5
PE
12292006-07-12 Paul Eggert <eggert@cs.ucla.edu>
1230
1231 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
1232 rather than a for-loop that declares a local bool variable. This
1233 should work around a compatibility problem with a Cray x1e C++
1234 compiler reported by Hung Nguyen in
1235 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
1236 The for-loop was introduced in the 2004-11-17 change but I don't
1237 know why it was needed.
1238
a5d80ba5
AD
12392006-07-12 Akim Demaille <akim@epita.fr>
1240
1241 * data/c.m4: Comment changes.
1242
23eb2a69
AD
12432006-07-10 Akim Demaille <akim@lrde.epita.fr>
1244
1245 * src/complain.c (error_message, ERROR_MESSAGE): New.
1246 To factor...
1247 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
1248 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
1249
ddc8ede1
PE
12502006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1251
1252 * NEWS: Instead of %union, you can define and use your own union type
1253 YYSTYPE if your grammar contains at least one <type> tag.
1254 Your YYSTYPE need not be a macro; it can be a typedef.
1255 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
1256 (Union Decl, Decl Summary): Document this.
1257 * data/glr.c (YYSTYPE): Implement this.
1258 * data/glr.cc (YYSTYPE): Likewise.
1259 * data/lalr1.cc (YYSTYPE): Likewise.
1260 * data/yacc.c (YYSTYPE): Likewise.
1261 * src/output.c (prepare): Output tag_seen_flag.
1262 * src/parse-gram.y (declaration, grammar_declaration):
1263 Use 'union_seen' rather than 'typed' to determine whether
1264 %union has been seen, since grammars can now be typed without
1265 %union.
1266 (symbol_declaration, type.opt, symbol_def):
1267 Keep track of whether a tag has been seen.
1268 * src/reader.c (union_seen, tag_seen): New vars.
1269 (typed): remove.
1270 * src/reader.h (union_seen, tag_seen, typed): Likewise.
1271 * src/scan-code.l (untyped_var_seen): New variable.
1272 (handle_action_dollar): Adjust to above changes.
1273 (handle_action_dollar, handle_action_at):
1274 Improve overflow checking for outlandish numbers.
1275 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
1276 avoid new diagnostics generated by above changes.
1277 * tests/regression.at (YYSTYPE typedef): Add test to check
1278 for type tags without %union.
1279
1280 * src/symlist.c (symbol_list_length): Return int, not unsigned
1281 int, since callers expect int. This may need to get revisited
1282 once we have proper integer overflow checking.
1283
1284 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
1285 object is now static.
1286
1287 * src/getargs.c (flags_argmatch): Return void, not int,
1288 to pacify ./configure --enable-gcc-warnings.
1289
1290 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
1291 since last_string is already defined to FLEX_PREFIX (last_string).
1292
7b42569e
AD
12932006-07-09 Akim Demaille <akim@lrde.epita.fr>
1294
1295 Implement --warnings/-W.
1296 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
1297 replaced by...
1298 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
1299 Adjust callers.
1300 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
1301 (warnings_args, warnings_types): New.
1302 (getargs, short_options, long_options): Accept -W/--warnings.
1303 Sort the options by alphabetical order, upper case letter right
1304 before its lower case.
1305
3b452f4e
JD
13062006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1307
1308 Change %merge result type clash warnings to errors. Discussed at
1309 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
1310 * src/reader.c (record_merge_function_type): Use complain_at.
1311 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1312 declared later): Update test case results.
1313
b8a41559
AD
13142006-07-09 Akim Demaille <akim@lrde.epita.fr>
1315
1316 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
1317 to be in alphabetical order.
1318 (trace_args): Spelling fixes.
1319
cd9e1ba2
PE
13202006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1321
1322 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
1323 so they don't collide with user-defined macros.
1324 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
1325 this was never guaranteed, and now that we're using gnulib stdint,
1326 which defines int_fast16_t to long int, the problem is exposed.
1327
cb48f191
PE
13282006-07-08 Paul Eggert <eggert@cs.ucla.edu>
1329
b8445a15
PE
1330 * data/c.m4 (b4_basename): Simplify a bit, since we don't
1331 need the full POSIX semantics (and weren't implementing them
1332 anyway).
1333
cb48f191
PE
1334 Adjust to Autoconf 2.60 and today's gnulib.
1335 * bootstrap (gnulib_modules): Add stdint.
1336 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
1337 no longer copies it.
1338 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
1339 since stdint needs the former and wcwidth (which is now required
1340 by mbswidth) needs the latter.
1341 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
1342 work around a compatibility glitch between gettext 0.14.6 and
1343 Autoconf 2.60.
1344 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
1345 Do not check for uintptr_t, since new stdint module does the right
1346 thing.
1347 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
1348 Add stdint.h, stdint_.h, wcwidth.h.
1349 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
1350 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
1351 stdint.m4, wchar_t.m4, wcwidth.m4.
1352 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
1353 usual order for ../lib/*.h files.
1354 (file_name_split): Use last_component, not base_name, to adjust
1355 to gnulib changes.
1356 * src/parse-gram.h: Include <strverscmp.h> in the usual order
1357 for ../lib/*.h files.
1358 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
1359 Define unconditionally, since we now assume the stdint module.
1360 * src/scan-skel.l: Include <dirname.h>.
1361 (BASE_QPUTS): Use last_component, not base_name.
1362 * src/system.h: Include <unlocked-io.h> in the usual order
1363 for ../lib/*.h files. Include <stdint.h> unconditionally,
1364 since we now use the stdint module.
1365 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
1366 HAVE_UINTPTR_T, since we now use the stdint module.
1367 (base_name): Remove decl, since files now include <dirname.h>
1368 to get the decl.
1369
cd48d21d
AD
13702006-07-08 Akim Demaille <akim@lrde.epita.fr>
1371
1372 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
1373 New, default to 1.
1374 * data/yacc.c, data/glr.c, data/location.cc: Use them.
1375 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
1376 default.
1377 * tests/calc.at: Adjust.
1378
8ec0a172
AD
13792006-07-08 Akim Demaille <akim@lrde.epita.fr>
1380
b8445a15 1381 * data/c.m4 (b4_basename): New.
8ec0a172
AD
1382 (b4_syncline): Also output the location of its invocation (from
1383 the skeleton).
1384 (b4_user_action, b4_define_user_action, b4_user_actions)
1385 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
1386 (b4_user_stype): New.
1387 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
1388
4a678af8
JD
13892006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1390
1391 In the grammar file, the first column is 1 not 0 on the first line as
1392 on every other line.
1393 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
1394 * tests/input.at (Torturing the Scanner): Update output.
1395
1396 * src/scan-gram.l (scanner_cursor): Declare it static.
1397
dd60572a
JD
13982006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1399
1400 In warnings, say "previous declaration" rather than "first
1401 declaration".
1402 * src/symtab.c (redeclaration): Do that here.
1403 * src/reader.c (record_merge_function_type): In the case of a result
1404 type clash, report the previous declaration rather than the very first
1405 one in the grammar file.
1406 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1407 declared later): Add a third declaration to check this behavior.
1408 * tests/input.at (Incompatible Aliases): Update output.
1409
2073e1b6
AD
14102006-06-27 Akim Demaille <akim@epita.fr>
1411
1412 * doc/Doxyfile.in: New.
1413 * doc/Makefile.am: Use it.
1414 * src/lalr.h, src/symtab.h: Initial doxygenation.
1415
8ee5b538
JD
14162006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1417
1418 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
1419 declared after the %merge. This continues the effort of the previous
1420 patch.
8ee5b538
JD
1421 * src/reader.c (get_merge_function): Don't set the merger type yet.
1422 (record_merge_function_type): New function for setting the merger type
1423 and checking for clashes.
1424 (grammar_current_rule_merge_set): Set the location of the %merge for
1425 the current rule.
1426 (packgram): Invoke record_merge_function_type for each rule now that
1427 all symbol type declarations have been parsed.
1428 * src/reader.h (merger_list.type_declaration_location): New member
1429 storing the location of the first %merge from which the type for this
1430 merging function was derived.
1431 * src/symlist.h (symbol_list.merger_declaration_location): New member
1432 storing the location of a rule's %merge, if any.
1433 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1434 declared later): New test to catch the error fixed by the above patch.
1435
ffa4ba3a
JD
14362006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1437
1438 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
1439 declarations appear after the rules. Discussed at
1440 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
1441 and
1442 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
1443 Don't mistake the type of $$ in a midrule to be that of its parent
1444 rule's $$.
ffa4ba3a
JD
1445 * src/reader.c (grammar_current_rule_end): Don't invoke
1446 grammar_rule_check yet since not all symbol declarations may have been
1447 parsed yet.
1448 (grammar_midrule_action): Likewise.
1449 Don't record whether the midrule's $$ has been used yet since actions
1450 haven't been translated yet.
1451 Record the midrule's parent rule and its RHS index within the parent
1452 rule.
1453 (grammar_current_rule_action_append): Don't translate the action yet
1454 since not all symbol declarations may have been parsed yet and, thus,
1455 warnings about types for $$, $n, @$, and @n can't be reported yet.
1456 (packgram): Translate the action and invoke grammar_rule_check now that
1457 all symbol declarations have been parsed.
1458 * src/scan-code.l (handle_action_dollar): Now that this is invoked
1459 after parsing the entire grammar file, the symbol list here in the case
1460 of a midrule is actually the midrule's empty RHS, so reference its
1461 parent rule's RHS where necessary.
1462 On the other hand, now that you can already know it's a midrule, you
1463 aren't forced to think $$ has the same type as its parent rule's $$.
1464 (handle_action_at): In the case of a midrule, reference the parent rule
1465 where necessary.
1466 * src/symlist.c (symbol_list_new): Initialize new midrule-related
1467 members.
1468 (symbol_list_length): Now that this is invoked after all rules have
1469 been parsed, a NULL symbol (rather than a NULL symbol list node)
1470 terminates a rule. symbol_list_print already does this correctly.
1471 * src/symlist.h (symbol_list.midrule_parent_rule,
1472 symbol_list.midrule_parent_rhs_index): New members so that midrules can
1473 remember their relationships with their parents.
1474 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
1475 fixed by the above patch.
1476 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
1477 implementing...
1478 (Unused values): ... this old test case and...
1479 (Unused values before symbol declarations): ... this new test case.
1480 This one is the same as `Unused values' except that all symbol
1481 declarations appear after the rules in order to catch the rest of the
1482 errors fixed by the above patch.
1483
e256e17f
JD
14842006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1485
300a1930
JD
1486 More cleanup.
1487 * src/reader.c (current_rule): Declare it static since it's no longer
1488 used outside this file.
1489 (grammar_current_rule_action_append): Remove redundant arguments from
1490 translate_rule_action invocation.
1491 * src/reader.h (current_rule): Remove this unused extern.
1492 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
1493 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 1494
381ecb06
JD
14952006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
1496
1497 Clean up yesterday's patch.
1498 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
1499 to...
1500 * src/reader.c (grammar_current_rule_action_append): ... here for
1501 consistency with grammar_current_rule_symbol_append.
1502 * tests/regression.at (Braced code in declaration in rules section):
1503 Make yyerror and yylex static as usual.
1504
4210cd0b
JD
15052006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
1506
1507 Fix bug that mistakes braced code in a declaration in the rules section
1508 to be a rule action. Mentioned at
1509 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
1510 * src/scan-gram.l: Move midrule action detection from the start of the
1511 scanning of any braced code to...
1512 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
1513 action. For readability, use $2 and @2 rather than the equivalent
1514 global variables.
1515 * tests/regression.at (Braced code in declaration in rules section):
1516 New test to catch the error fixed by the above patch.
1517
1518 Work on code readability some.
1519 * src/scan-code.l (current_rule): Get rid of this misleading and
1520 redundant declaration: it's actually extern'ed in reader.h.
1521 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
1522 translate_action): Add a rule argument and use it instead of the global
1523 current_rule.
1524 (translate_rule_action): This already receives current_rule through an
1525 argument, so pass it on to translate_action instead of assigning
1526 current_rule to current_rule.
1527 (translate_symbol_action, translate_code): Pass rule = NULL to
1528 translate_action.
1529
34f98f46
JD
15302006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
1531
1532 Rename %before-definitions to %start-header and %after-definitions to
1533 %end-header. Don't use these declarations to separate pre-prologue
1534 blocks from post-prologue blocks. Add new order-independent
1535 declarations %before-header and %after-header as alternatives to the
1536 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
1537 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
1538 * NEWS (2.3+): Update for these changes.
1539 * data/glr.c (b4_before_definitions): Update to...
1540 (b4_start_header): ... this.
1541 (b4_after_definitions): Update to...
1542 (b4_end_header): ... this.
1543 * data/glr.cc: Likewise.
1544 * data/lalr1.cc: Likewise.
1545 * data/yacc.c: Likewise.
1546 * doc/bison.texinfo (The prologue): Update names, and replace remaining
1547 prologue blocks with %*-header declarations.
1548 (Calc++ Parser): Likewise.
1549 (Bison Declaration Summary): Update names.
1550 (Bison Symbols): Update description.
1551 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
1552 (PERCENT_END_HEADER): ... this.
1553 (PERCENT_BEFORE_DEFINITIONS): Update to...
1554 (PERCENT_START_HEADER): ... this.
1555 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
1556 (declaration): Update token names and m4 macro names.
1557 When parsing %end-header and %start-header, invoke translate_code
1558 before muscle_code_grow, and no longer set global booleans to remember
1559 whether these declarations have been seen.
1560 Parse new %after-header and %before-header.
1561 * src/reader.c (before_definitions, after_definitions): Remove.
1562 (prologue_augment): Accept a new bool argument to specify whether to
1563 augment the pre-prologue or post-prologue.
1564 * src/reader.h (before_definitions, after_definitions): Remove these
1565 extern's.
1566 (prologue_augment): Add new bool argument.
1567 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
1568 (PERCENT_END_HEADER): ... this.
1569 (PERCENT_BEFORE_DEFINITIONS): Update to...
1570 (PERCENT_START_HEADER): ... this.
1571 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
1572 * tests/actions.at (Printers and Destructors): Update names.
1573
31b2b07e
JD
15742006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
1575
1576 Add comparison operators for C++ location classes. Discussed at
1577 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
1578 * data/c++.m4 (b4_define_location_comparison): New boolean %define
1579 declaration indicating whether filename_type has an operator==. If
1580 filename_type is `std::string', it defaults to `1', `0' otherwise.
1581 * data/location.cc: Iff b4_define_location_comparison is `1', add
1582 operator== and operator!= for class position and for class location.
1583
1584 Some minor fixes.
1585 * src/scan-action.l: Remove unused file.
1586 * src/symtab.c (symbol_printer_set): Use printer_location not
1587 destructor_location.
1588 * src/symtab.h (struct symbol): Replace incorrect source comment for
1589 printer members.
1590 * tests/input.at (Incompatible Aliases): Update output with correct
1591 printer location.
1592
9bc0dd67
JD
15932006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
1594
1595 Don't put the pre-prologue in the header file. For the yacc.c code
1596 file and the glr.c header and code files, move the pre-prologue before
1597 the token definitions. Add new %before-definitions and
1598 %after-definitions to declare code that will go in both the header file
1599 and code file. Discussed at
1600 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
1601 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
1602 and
1603 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
1604 * NEWS (2.3+): Describe these changes.
1605 * data/glr.c (b4_pre_prologue): Move from within to before...
1606 (b4_shared_declarations): ... this.
1607 Add new b4_before_definitions before b4_token_enums.
1608 Add new b4_after_definitions at the end.
1609 * data/glr.cc (b4_pre_prologue): Replace with...
1610 (b4_before_definitions): ... this in the header file.
1611 (b4_after_definitions): New near the end of the header file.
1612 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
1613 code file right before including the header file.
1614 (b4_before_definitions): New in the previous position of
1615 b4_pre_prologue in the header file.
1616 (b4_after_definitions): New near the end of the header file.
1617 * data/yacc.c: Clean up some m4 quoting especially in the header file.
1618 (b4_token_enums_defines): In the code file, move to right before
1619 YYSTYPE for consistency with the header file.
1620 (b4_before_definitions): New right before b4_token_enums_defines in
1621 both the header and code file.
1622 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
1623 header and code file.
1624 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
1625 of prologues for %union dependencies.
1626 (Bison Declaration Summary): In %defines description, mention the
1627 effect of %before-definitions and %after-definitions on the header
1628 file.
1629 (Calc++ Parser): Forward declare driver in a %before-definitions rather
1630 than in the pre-prologue so that make check succeeds.
1631 (Bison Symbols): Add entries for %before-definitions and
1632 %after-definitions.
1633 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
1634 %before-definitions.
1635 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
1636 (declaration): Parse those declarations and append to
1637 b4_before_definitions and b4_after_definitions, respectively.
1638 * src/reader.c (before_definitions, after_definitions): New bools to
1639 track whether those declarations have been seen.
1640 (prologue_augment): Add to the post-prologue if %union,
1641 %before-definitions, or %after-definitions has been seen.
1642 * src/reader.h (before_definitions, after_definitions): New extern's.
1643 * src/scan-gram.l: Scan the new declarations.
1644 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
1645 prologue block in a %before-definitions or a %after-definitions based
1646 on whether the %union is declared.
1647 * tests/regression.at (Early token definitions with --yacc, Early token
1648 definitions without --yacc): Move tests for token definitions into the
1649 post-prologue since token names are no longer defined in the
1650 pre-prologue.
1651
203b9274
AD
16522006-06-20 Akim Demaille <akim@epita.fr>
1653
1654 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
1655 (symbol_get): Use it.
1656 * src/parse-gram.y: Use it.
1657
a7ee59cf
JD
16582006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
1659
1660 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
1661 build succeeds when configured with --enable-gcc-warnings.
1662
5a2baae7
PE
16632006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1664
33ad1a9c
PE
1665 * src/parse-gram.y (char_name): New function.
1666 (CHAR, STRING, string_content): For %printer, properly escape.
1667 (ID): Prefer fputs to fprintf.
1668 (id): Reindent to be consistent with other rules.
1669 Properly quote char.
1670
5a2baae7
PE
1671 The Translation Project changed its way of publishing translations
1672 to maintainers. I haven't received any responses to my request
1673 for supporting the old way, or for documenting the new way. I
1674 have modified 'bootstrap' to use screen scraping
1675 (in this case, HTML scraping). This is unreliable and inelegant,
1676 but I don't see any better way. Yuck.
1677 * bootstrap (TP_URL, WGET_COMMAND): New vars.
1678 (get_translations): New function, which uses HTML scraping to
1679 deduce locations of latest translations.
1680 Use this function to grab both bison and bison-runtime .po files.
1681 Don't bother priming the pump for the runtime-po domain any more,
1682 as it's now translated better than bison is.
1683
58d7a1a1
AD
16842006-06-19 Akim Demaille <akim@epita.fr>
1685
1686 * src/scan-gram.l: No longer "parse" things after `%union' until
1687 `{'. Rather, return a single "%union" token.
1688 No longer make symbols: return strings, and leave the conversion
1689 to symbols to the parser.
1690 (SC_PRE_CODE, token_type): Remove.
1691 * src/parse-gram.y (%union): New field `character'.
1692 Sort tokens.
1693 (CHAR): New token.
1694 (ID, ID_COLON): Now that the scanner no longer makes them
1695 identifiers, adjust all uses to invoke symbol_get.
1696 (id_colon): New, wraps the conversion from string to symbol.
1697 (%union): Accept a possible union_name.
1698 (symbol): Now can be a char.
1699 * data/c.m4 (b4_union_name): Leave a default value.
1700 * data/glr.c, data/yacc.c: Use it.
1701
b931235e
JD
17022006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
1703
1704 For associating token numbers with token names for "yacc.c", don't use
1705 #define statements unless `--yacc' is specified; always use enum
1706 yytokentype. Most important discussions start at:
1707 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
1708 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
1709 and
1710 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
1711 * NEWS (2.3+): Mention.
1712 * data/c.m4 (b4_yacc_if): New.
1713 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
1714 token #define's.
1715 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
1716 on token name definitions.
1717 * src/getargs.c (usage): Capitalize `Yacc' in English.
1718 * src/output.c (prepare): Define b4_yacc_flag.
1719 * tests/regression.at (Early token definitions): Test that tokens names
1720 are defined before the pre-prologue not just before the post-prologue.
1721 Remove this test case and copy to...
1722 (Early token definitions with --yacc): ... this to test #define's.
1723 (Early token definitions without --yacc): ... and this to test enums.
1724
9e6e7ed2
PE
17252006-06-11 Paul Eggert <eggert@cs.ucla.edu>
1726
1727 * NEWS: Reword the post-2.3 change to not be so optimistic about
1728 removing the old "look-ahead" spelling.
1729 Update previous look-ahead/lookahead change reports.
1730 * REFERENCES: look-ahead -> lookahead (since that's
1731 what he actually wrote).
1732 * doc/refcard.tex: look ahead -> lookahead,
1733 look-ahead -> lookahead
1734
742e4900
JD
17352006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
1736
1737 For consistency, use `lookahead' instead of `look-ahead' or
1738 `look_ahead'. Discussed starting at
1739 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
1740 and then at
1741 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
1742 * NEWS: For the next release, note the change to `--report'.
1743 * TODO, doc/bison.1: Update English.
1744 * doc/bison.texinfo: Update English.
1745 (Understanding Your Parser, Bison Options): Document as
1746 `--report=lookahead' rather than `--report=look-ahead'.
1747 * src/conflicts.c: Update English in comments.
1748 (lookahead_set): Rename from look_ahead_set.
1749 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
1750 (resolve_sr_conflict): Rename local look_ahead_tokens to
1751 lookahead_tokens, and update other uses.
1752 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
1753 count_rr_conflicts, conflicts_free): Update uses.
1754 * src/getargs.c (report_args): Move "lookahead" before alternate
1755 spellings.
1756 (report_types): Update uses.
1757 (usage): For `--report' usage description, state `lookahead' spelling
1758 rather than `look-ahead'.
1759 * src/getargs.h (report.report_lookahead_tokens): Rename from
1760 report_look_ahead_tokens.
1761 * src/lalr.c: Update English in comments.
1762 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
1763 (state_lookahead_tokens_count): Rename from
1764 state_look_ahead_tokens_count.
1765 Rename local n_look_ahead_tokens to n_lookahead_tokens.
1766 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
1767 Rename local n_look_ahead_tokens to n_lookahead_tokens.
1768 Update other uses.
1769 Update English in output.
1770 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
1771 * src/print.c: Update English in comments.
1772 (lookahead_set): Rename from look_ahead_set.
1773 (print_reduction): Rename argument lookahead_token from
1774 look_ahead_token.
1775 (print_core, state_default_rule, print_reductions, print_results):
1776 Update uses.
1777 * src/print_graph.c: Update English in comments.
1778 (print_core): Update uses.
1779 * src/state.c: Update English in comments.
1780 (reductions_new): Update uses.
1781 (state_rule_lookahead_tokens_print): Rename from
1782 state_rule_look_ahead_tokens_print, and update other uses.
1783 * src/state.h: Update English in comments.
1784 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
1785 (state_rule_lookahead_tokens_print): Rename from
1786 state_rule_look_ahead_tokens_print.
1787 * src/tables.c: Update English in comments.
1788 (conflict_row, action_row): Update uses.
1789 * tests/glr-regression.at
1790 (Incorrect lookahead during deterministic GLR,
1791 Incorrect lookahead during nondeterministic GLR): Rename
1792 print_look_ahead to print_lookahead.
1793 * tests/torture.at: Update English in comments.
1794 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
1795 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
1796 (Many lookahead tokens): Update uses.
1797 * data/glr.c: Update English in comments.
1798 * lalr1.cc: Likewise.
1799 * yacc.c: Likewise.
1800 * src/conflicts.h: Likewise.
1801 * src/lalr.h: Likewise.
1802 * src/main.c: Likewise.
1803 * src/output.c: Likewise.
1804 * src/parse-gram.c: Likewise.
1805 * src/tables.h: Likewise.
1806 * tests/calc.at: Likewise.
1807
3c40d0b5
JD
18082006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
1809
1810 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
1811
5d278082
PE
18122006-06-07 Paul Eggert <eggert@cs.ucla.edu>
1813
1814 * TODO: Add request from Nelson H. F. Beebe to be able to install
1815 Bison without installing the yacc script.
1816
9e668899
JD
18172006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
1818
1819 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
1820 and yytext if they're already #define'd.
1821 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
1822 * src/scan-code-c.c: ... here.
1823 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
1824 <config.h>.
1825
0c8e079f
JD
18262006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
1827
1828 Get Bison to build again when configured with --enable-gcc-warnings.
1829 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
1830 missing #include's.
1831 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
1832 loc argument as it shadows a global.
1833 * src/scan-gram.l: Remove stray comma that prevents boundary_set
1834 invocation.
1835
1836 * src/.cvsignore: Add scan-code.c.
1837
2346344a
AD
18382006-06-07 Akim Demaille <akim@epita.fr>
1839
1840 * src/scan-gram.l: Move the "add a trailing ; to actions" code
1841 to...
1842 * src/scan-code.l: here.
1843 * tests/input.at (Torturing the Scanner): Fix another location
1844 error.
1845
4862bdfd
AD
18462006-06-07 Akim Demaille <akim@epita.fr>
1847
1848 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
1849
e9071366
AD
18502006-06-06 Akim Demaille <akim@epita.fr>
1851
1852 Extract the parsing of user actions from the grammar scanner.
1853 As a consequence, the relation between the grammar scanner and
1854 parser is much simpler. We can also split "composite tokens" back
1855 into simple tokens.
1856 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
1857 * src/scan-gram.l (add_column_width, adjust_location): Move to and
1858 rename as...
1859 * src/location.h, src/location.c (add_column_width)
1860 (location_compute): these.
1861 Fix the column count: the initial column is 0.
1862 (location_print): Be robust to ending column being 0.
1863 * src/location.h (boundary_set): New.
1864 * src/main.c: Adjust to scanner_free being renamed as
1865 gram_scanner_free.
1866 * src/output.c: Include scan-code.h.
1867 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
1868 Use boundary_set.
1869 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
1870 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
1871 which is now, again, a separate token.
1872 Adjust all dependencies.
1873 Whereever actions with $ and @ are used, use translate_code.
1874 (action): Remove this nonterminal which is now useless.
1875 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
1876 (grammar_current_rule_action_append): Use translate_code.
1877 (packgram): Bound check ruleno, itemno, and rule_length.
1878 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
1879 (last_string, last_braced_code_loc, max_left_semantic_context)
1880 (scanner_initialize, scanner_free, scanner_last_string_free)
1881 (gram_out, gram_lineno, YY_DECL_): Move to...
1882 * src/scan-gram.h: this new file.
1883 (YY_DECL): Rename as...
1884 (GRAM_DECL): this.
1885 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
1886 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
1887 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
1888 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
1889 Move these declarations, and...
1890 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
1891 these to...
1892 * src/flex-scanner.h: this new file.
1893 * src/scan-gram.l (rule_length, rule_length_overflow)
1894 (increment_rule_length): Remove.
1895 (last_braced_code_loc): Rename as...
1896 (gram_last_braced_code_loc): this.
1897 Adjust to the changes of the parser.
1898 Move all the handling of $ and @ into...
1899 * src/scan-code.l: here.
1900 * src/scan-gram.l (handle_dollar, handle_at): Remove.
1901 (handle_action_dollar, handle_action_at): Move to...
1902 * src/scan-code.l: here.
1903 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
1904 scan-code.h, scan-code-c.c, scan-gram.h.
1905 (EXTRA_bison_SOURCES): Add scan-code.l.
1906 (BUILT_SOURCES): Add scan-code.c.
1907 (yacc): Be robust to white spaces.
1908
1909 * tests/conflicts.at, tests/input.at, tests/reduce.at,
1910 * tests/regression.at: Adjust the column numbers.
1911 * tests/regression.at: Adjust the error message.
7891a7c4 1912
184e42f0
JD
19132006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
1914
1915 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
1916 Use Akim's wording from
1917 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
1918
7891a7c4
JD
19192006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
1920
1921 Between Bison releases, manually append `+' to the previous Bison
1922 release number, and use that as a signal to automatically print the
1923 ChangeLog's CVS Id keyword from --version. Discussed starting at
1924 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
1925 * ChangeLog: Add Id header.
1926 * configure.ac (AC_INIT): Append `+' to `2.3'.
1927 * src/.cvsignore: Add revision.c.
1928 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
1929 (BUILT_SOURCES): Add revision.c.
1930 (revision.c): New target rule. This file defines a new global variable
1931 named revision. It initializes it with either the Id from ChangeLog
1932 or, if VERSION doesn't contain `+', with the empty string.
1933 * src/getargs.c (version): Print the value of revision.
1934 * src/revision.h: Extern revision.
1935
4ad3ed84
PE
19362006-06-05 Paul Eggert <eggert@cs.ucla.edu>
1937
1938 * NEWS: Version 2.3.
1939 * configure.ac (AC_INIT): Likewise.
1940
02103984
PE
19412006-05-30 Paul Eggert <eggert@cs.ucla.edu>
1942
1943 * data/glr.c (YYRECOVERING): Define to be a function-like macro
1944 with no arguments, not as an object-like macro. This is for
1945 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
1946 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
1947 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
1948 Document this.
1949
2c08afa5
JD
19502006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
1951
1952 * src/getargs.c (usage): Back out yesterday's modification of the
1953 --help output so that we don't have to wait for translation before
1954 releasing 2.3.
1955
6077da58
PE
19562006-05-29 Paul Eggert <eggert@cs.ucla.edu>
1957
1958 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
1959 Problem reported by Akim Demaille.
1960
2a26b6c2
JD
19612006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
1962
1963 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
1964
aefef0d6
PE
19652006-05-26 Paul Eggert <eggert@cs.ucla.edu>
1966
1967 * data/yacc.c (yy_reduce_print): Omit trailing white space in
1968 generated source code. Problem reported by Frans Englich in
1969 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
1970
fcd8e201
PE
19712006-05-22 Paul Eggert <eggert@cs.ucla.edu>
1972
1973 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
1974 shell, not within 'make', so that 'make' by an ordinary builder
1975 (using GNU make) does not worry about configuring gzip. This also
1976 works around a bug reported independently by Keith Thompson and by
1977 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
1978 stderr rather than stdout, messing up the build logs.
1979
7b5cdcbd
JD
19802006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
1981
1982 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
1983 to make sure that YYID will never be unused. This fixes a 'make
1984 maintainer-check' failure caused by the recent changes to the 'Trivial
1985 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
1986 not used.
1987 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
1988
5ad0a449
JD
19892006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
1990
1991 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
1992 state before an empty RHS is always resolved here. Only the location
1993 of that state is guaranteed to be resolved, and that's enough. This
1994 fixes the remaining bug reported by Derek M. Jones in
1995 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
1996 * tests/glr-regression.at (Uninitialized location when reporting
1997 ambiguity): Test the above case.
1998 Also, the embedded comments in this test case claim it checks the case
1999 of an empty RHS that has inherited the initial location. However, the
2000 corresponding LHS was already resolved, so yyresolveLocations didn't
2001 actually have reason to modify it. Fix this by forcing
2002 nondeterministic operation at the beginning of the parse.
2003
50cce58e
PE
20042006-05-20 Paul Eggert <eggert@cs.ucla.edu>
2005
2006 * data/c.m4 (b4_yy_symbol_print_generate):
2007 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
2008 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
2009 of the bugs reported today by Derek M Jones in
2010 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
2011 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
2012 defined to be a type name without parens or brackets.
2013 (Location Type): Similarly for YYLTYPE.
2014 * tests/regression.at (Trivial grammars): Put in a test for this
2015 bug that will be caught by 'make maintainer-check' (though not,
2016 alas, by 'make check' unless your compiler is picky).
2017
ab8d9dc5
PE
20182006-05-19 Paul Eggert <eggert@cs.ucla.edu>
2019
0d2c8934 2020 * NEWS: Version 2.2.
ab8d9dc5
PE
2021 * configure.ac (AC_INIT): Likewise.
2022
9138c575
JD
20232006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
2024
2025 * data/glr.c (yyreportTree): Make room in yystates for the state
2026 preceding the RHS. This fixes the segmentation fault reported by Derek
2027 M. Jones in
2028 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
2029 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
2030 to the user. Reported for yyreportTree by Derek M. Jones later in the
2031 same thread.
2032 * THANKS: Add Derek M. Jones.
2033 Update my email address.
2034 Fix typo in Steve Murphy's name.
2035
276f48df
PE
20362006-05-14 Paul Eggert <eggert@cs.ucla.edu>
2037
d6645148
PE
2038 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
2039 checking against YYLAST that caused the parser to miss a potential
2040 alternative in its diagnostic.
2041 Problem reported by Maria Jose Moron Fernandez in
2042 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
2043 * data/lalr1.cc (yysyntax_error_): Likewise.
2044 * data/yacc.c (yysyntax_error): Likewise.
2045 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
2046 tokens, in case we run into an older C compiler.
2047 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
2048 Use them to check for the off-by-one error fixed above.
2049
276f48df
PE
2050 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
2051 YYSIZE_T, not size_t.
2052 * tests/regression.at (Trivial grammars): New test, to catch
2053 the error fixed by the above patch.
2054
cd8b5791
AD
20552006-05-14 Akim Demaille <akim@lrde.epita.fr>
2056
2057 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
2058 scheme.
2059 Reported by Steve Murphy.
2060
34376418
AD
20612006-05-14 Akim Demaille <akim@lrde.epita.fr>
2062
2063 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
2064 * data/glr.cc: b4_location_flag is now b4_locations_flag.
2065
327afc7c
AD
20662006-05-14 Akim Demaille <akim@lrde.epita.fr>
2067
2068 Implement --trace=m4.
2069 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
2070 * src/output.c (output_skeleton): When set, pass -dV to m4.
2071
2072 Factor the handling of flags in m4.
2073 * src/output.c (prepare): Rename the muscle names debug, defines,
2074 error_verbose to debug_flag, defines_flag, error_verbose_flag.
2075 * data/c.m4: Adjust.
2076 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
2077 Use b4_define_flag_if to define other b4_FLAG_if macros.
2078 (b4_location_if): As a consequence, rename as...
2079 (b4_locations_if): this, for consistency.
2080 Adjust all the skeletons.
2081
ba9ecd19
AD
20822006-05-14 Akim Demaille <akim@lrde.epita.fr>
2083
2084 * etc/bench.pm: Shorten bench names.
2085
4e83ea15
AD
20862006-05-14 Akim Demaille <akim@lrde.epita.fr>
2087
2088 * src/output.h, src/output.c (error_verbose): Move to...
2089 * src/getargs.h, src/getargs.c: here.
2090 Sort the flags.
2091 Adjust dependencies.
2092
6e93d810
PE
20932006-05-13 Paul Eggert <eggert@cs.ucla.edu>
2094
2095 * data/c.m4 (b4_copyright): Put the special exception for Bison
2096 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
2097 uses changed. Suggested by Akim Demaille. Also, wrap the
2098 copyright notice, in case it is longer than 80 columns. Replace
2099 comma by newline after title.
6e93d810 2100
eaea13f5
PE
21012006-05-11 Paul Eggert <eggert@cs.ucla.edu>
2102
2103 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
2104 incompatibility, not a bug. Mention that it wasn't fixed as of
2105 flex 2.5.33.
2106
3cf084ec
AD
21072006-05-11 Akim Demaille <akim@lrde.epita.fr>
2108
2109 * examples/extexi: Enforce the precedence of concatenation over
2110 >>.
0a9f1c7d 2111 Reported by Tommy Nordgren.
3cf084ec 2112
32c96bd7
AD
21132006-05-11 Akim Demaille <akim@lrde.epita.fr>
2114
2115 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
2116 with the member "token".
f94705b2 2117 Reported by Martin Nylin.
32c96bd7 2118
eaea13f5
PE
21192006-05-08 Paul Eggert <eggert@cs.ucla.edu>
2120
2121 * data/glr.c: Switch to Bison 2.2 special-exception language in
2122 the copyright notice. Use more-regular format for titles and
2123 copyright notices.
2124 * data/glr.cc: Likewise.
2125 * data/location.cc: Likewise.
2126 * data/yacc.cc: Likewise.
2127 * doc/bison.texinfo (Conditions): Document this.
2128 * NEWS: likewise. Upgrade version to 2.2.
2129
6e2d1146
AD
21302006-04-27 Akim Demaille <akim@lrde.epita.fr>
2131
2132 * data/glr.cc: Remove dead code.
2133
47671055
PE
21342006-04-25 Paul Eggert <eggert@cs.ucla.edu>
2135
2136 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
2137 that variable and the line breaks the bootstrap. Problem reported
2138 by Juan M. Guerrero.
2139
ed2e6384
AD
21402006-04-24 Akim Demaille <akim@lrde.epita.fr>
2141
2142 * doc/bison.texinfo (Multiple start-symbols): New.
2143
3cedc2dc
AD
21442006-04-24 Akim Demaille <akim@lrde.epita.fr>
2145
2146 * etc/README, etc/bench.pl: New.
2147
b2ddc3f3
AD
21482006-04-03 Akim Demaille <akim@lrde.epita.fr>
2149
2150 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
2151 rule.
2152 Reported by Mickael Labau.
2153 * tests/input.at (Torturing the Scanner): Test it.
2154
91e3ac9a
PE
21552006-03-16 Paul Eggert <eggert@cs.ucla.edu>
2156
2157 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
2158 Problem reported by Bob Rossi.
2159
21602006-03-13 Paul Eggert <eggert@cs.ucla.edu>
2161
2162 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
2163 and didn't really work.
2164 For the index, use @ifnotinfo, not @iftex.
2165 Minor cleanups of spacing and terminology.
2166
5cf61e93
AD
21672006-03-12 Akim Demaille <akim@lrde.epita.fr>
2168
2169 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
2170 of AT_NAME_PREFIX when %name-prefix is not used.
2171
aa08666d
AD
21722006-03-12 Akim Demaille <akim@lrde.epita.fr>
2173
2174 Apply --prefix to C++ skeletons too: they change the namespace.
2175 The test suite already exercize these cases.
2176 * data/c++.m4 (b4_namespace): New.
2177 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
2178 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
2179 * data/yacc.c, data/glr.c: Remove a useless `[]'.
2180 * doc/bison.texinfo: Document it.
2181 (Option Cross Key): Use @multitable in all formats. It looks
2182 nicer, even in TeX outputs.
2183 (Rules): Use the same code whatever the output type is.
2184 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
2185 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
2186 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 2187
45567173
AD
21882006-03-10 Akim Demaille <akim@lrde.epita.fr>
2189
2190 * TODO: Remove dead items.
2191
e9d8f881 21922006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
2193
2194 * doc/FAQ: Remove, merged into...
2195 * doc/bison.texinfo (FAQ): this.
2196 * doc/Makefile.am (EXTRA_DIST): Adjust.
2197
c095d689
AD
21982006-03-10 Akim Demaille <akim@lrde.epita.fr>
2199
2200 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
2201 even if empty.
2202 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
2203 * doc/bison.texinfo (Calc++ Scanner): Use it.
2204
6e0f8287
PE
22052006-03-09 Paul Eggert <eggert@cs.ucla.edu>
2206
2207 Fix two nits reported by twlevo, plus one more that I discovered.
2208
2209 * src/assoc.h (assoc_to_string): Give a name to the arg, as
2210 this is the usual Bison style.
2211 * src/location.h (location_print): Likewise.
2212
2213 * src/reader.h (token_name): Likewise.
2214
d6b771c3
PE
22152006-03-08 Paul Eggert <eggert@cs.ucla.edu>
2216
2217 Fix some nits reported by twlevo.
2218 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
2219 and "POSIX". Use more-modern syntax for URLs. Mention C++
2220 and ask for Java. Don't hardwire OS version numbers. Add
2221 copyright notice.
2222 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
2223 * src/conflicts.c (solved_conflicts_obstack): Now static.
2224
1e137b71
JD
22252006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2226
2227 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
2228 page. Say "you can use it" not "you may use it" as on the web page;
2229 we're describing capabilities not granting permission.
2230
73f2e47e
PE
22312006-03-06 Paul Eggert <eggert@cs.ucla.edu>
2232
6d05403d
PE
2233 * data/glr.c (yyresolveLocations): Rename local variables to avoid
2234 shadowing warnings. Use usual patter for iterating through RHS.
2235 * tests/glr-regression.at
2236 (Uninitialized location when reporting ambiguity):
2237 Modify yylex so that it uses its argument, rather than trying
2238 to rely on ARGSUSED (which doesn't work for gcc with warnings).
2239 const char -> char const.
2240
73f2e47e
PE
2241 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
2242 Don't use tabs inside commands; it messes up 'ps'.
2243 Problem reported by twlevo.
2244
8710fc41
JD
22452006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
2246
2247 * tests/glr-regression.at (Uninitialized location when reporting
2248 ambiguity): New test case.
2249 * data/glr.c (yyresolveLocations): New function, which uses
2250 YYLLOC_DEFAULT.
2251 (yyresolveValue): Invoke yyresolveLocations before reporting an
2252 ambiguity.
2253 * doc/bison.texinfo (Default Action for Locations): Note
2254 YYLLOC_DEFAULT's usage for ambiguity locations.
2255 (GLR Semantic Actions): Cross-reference those notes.
2256
ae952af2
JD
22572006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
2258
2259 * tests/glr-regression.at (Leaked semantic values when reporting
2260 ambiguity): Remove unnecessary union and type declarations.
2261 (Leaked lookahead after nondeterministic parse syntax error): New test
2262 case.
2263 * data/glr.c (yyparse): Check for zero stacks remaining before
2264 attempting to shift the lookahead so that you don't lose it.
2265
35ee866a
JD
22662006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2267
2268 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
2269 * tests/glr-regression.at (Leaked semantic values when reporting
2270 ambiguity): New test case.
2271 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
2272 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
2273 now unnecessary yystackp parameter.
2274 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
2275 destructors can be called.
2276
2277 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
2278 in existing testcases.
2279
520181ab
JD
22802006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2281
2282 Don't leak semantic values for parent RHS when a user action cuts the
2283 parser, and clean up related code a bit.
2284 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
2285 cuts parse): Rename to...
2286 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
2287 for leaked parent RHS values.
2288 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
2289 between an unresolved state (non-empty chain of semantic options) and
2290 an incomplete one (signaled by an empty chain).
ae952af2 2291 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
2292 successfully or unsuccessfully resolved yyGLRState to...
2293 (yyresolveValue): ... here so that yyresolveValue always leaves a
2294 yyGLRState with consistent data and thus is easier to understand.
2295 Remove the yyvalp and yylocp parameters since they are always just
2296 taken from the yys parameter. When reporting a discarded merged value
2297 in debugging output, note that it is incompletely merged. Document the
2298 interface.
2299 (yyresolveAction): If resolving any of the RHS states fails, destroy
2300 them all rather than leaking them. Thus, as long as user actions are
2301 written to clean up the RHS correctly, yyresolveAction always cleans up
2302 the RHS of a semantic option. Document the interface.
2303
18d9185c
PE
23042006-02-27 Paul Eggert <eggert@cs.ucla.edu>
2305
2306 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
2307 led to a segmentation fault in GNU Pascal. Problem reported
2308 by Waldek Hebisch.
2309
841a7737
JD
23102006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
2311
2312 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
2313 mid-rule action inside a nonterminal symbol in order to declare a
2314 destructor for its semantic value.
2315
fc3f467f
PE
23162006-02-16 Paul Eggert <eggert@cs.ucla.edu>
2317
2318 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
2319 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
2320 __cplusplus && ! defined _STDLIB_H && !
2321 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
2322 defined free))]: Include <stdlib.h> rather than rolling our own
2323 declarations of malloc and free, to avoid problems with
2324 incompatible declarations (using 'throw') C++'s stdlib.h. This
2325 should fix Debian bug 340012
2326 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
2327 reported by Guillaume Melquiond.
2328
a3af26dd
PE
23292006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2330
4d7bc38c
PE
2331 * NEWS: Clarify symbols versus types in unused-value warnings.
2332
a3af26dd
PE
2333 * configure.ac (AC_INIT): Bump version number.
2334
4e26c69e
PE
23352006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2336
2337 * NEWS: Version 2.1a.
2338 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
2339 since C99 requires this.
2340
498e897c
PE
23412006-02-11 Paul Eggert <eggert@cs.ucla.edu>
2342
2343 * m4/c-working.m4: New file.
2344 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
2345
57bb17ca
PE
23462006-02-10 Paul Eggert <eggert@cs.ucla.edu>
2347
2348 * Makefile.maint: Merge from coreutils.
2349
0be105dc
PE
23502006-02-09 Paul Eggert <eggert@cs.ucla.edu>
2351
2352 More portability fixes for problems summarized by Nelson H. F. Beebe.
2353
2354 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
2355 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
2356 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
2357 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
2358 messes up because C++ code is compiled in 32-bit mode but linked
2359 in 64-bit mode.
2360
6fc0c024
PE
23612006-02-08 Paul Eggert <eggert@cs.ucla.edu>
2362
2363 More portability fixes for problems summarized by Nelson H. F. Beebe.
2364
7870f699
PE
2365 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
2366 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
2367
6fc0c024
PE
2368 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
2369 nodist_PROGRAMS, since we don't need to actually compile the
2370 example if we're just doing a plain 'make'. This avoids bothering
2371 the installer unnecessarily about problems due to weird C++
2372 compilers.
2373
fe6c2fde
PE
23742006-02-06 Paul Eggert <eggert@cs.ucla.edu>
2375
2376 More portability fixes for problems summarized by Nelson H. F. Beebe.
2377
2378 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
2379 than #include "...", and compile with -I'.'. The old method was
2380 not portable, according to Posix and the C standard, and it does
2381 not work with Sun C 5.7, where previous #line directives affect
2382 the working directory used in later #include "..." directives.
2383
927b425b
JMG
23842006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2385
2386 Various DJGGP specific issues in /djgpp
2387
d9735e9e
PE
23882006-02-02 Paul Eggert <eggert@cs.ucla.edu>
2389
2390 More portability fixes for problems summarized by Nelson H. F. Beebe.
2391
2392 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
2393 '#include <map>' works and that you can apply ++ to iterators.
2394
5a6755af
PE
23952006-02-01 Paul Eggert <eggert@cs.ucla.edu>
2396
67a0dc4f
PE
2397 Work around portability problems summarized by Nelson H. F. Beebe in
2398 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
2399
8c86f0ef
PE
2400 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
2401 that '#include <string>' works.
2402
de35dd59
PE
2403 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
2404 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
2405 "warning: sorry: semantics of inline function static data `const
2406 unsigned char translate_table[262]' are wrong (you'll wind up with
2407 multiple copies)".
2408
67a0dc4f
PE
2409 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
2410 or, xor to not_, and_, or_, and xor_, respectively. This works
2411 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
2412 random system header somewhere that includes the equivalent of
2413 <iso646.h>.
2414
5a6755af
PE
2415 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
2416 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 2417 Suite Version 2.0.
5a6755af 2418
3f001415
JD
24192006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
2420
2421 During deterministic GLR operation, user actions should be able to
2422 influence the parse by changing yychar. To make this easier to fix and
2423 to make glr.c easier to evolve in general, don't maintain yytoken in
2424 parallel with yychar; just compute yytoken when needed.
2425 * tests/glr-regression.at (Incorrect lookahead during deterministic
2426 GLR): Check that setting yychar in a user action has the intended
2427 effect.
2428 * data/glr.c (yyGLRStack): Remove yytokenp member.
2429 (yyclearin): Don't set *yytokenp.
2430 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
2431 yychar rather than *yytokenp to determine the current lookahead.
2432 Compute yytoken locally when needed.
2433 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
2434 point to.
2435
2436 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
2437 after `--report' documentation.
2438
e2a8c0f5
PE
24392006-01-30 Paul Eggert <eggert@cs.ucla.edu>
2440
2441 * src/parse-gram.y (grammar_declaration): Location of printer
2442 symbol is @1, not list->location. Bug reported by twlevo.
2443 * tests/input.at (Incompatible Aliases): Adjust to above change.
2444
6b702268
PE
24452006-01-29 Paul Eggert <eggert@cs.ucla.edu>
2446
27622431
PE
2447 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
2448 all the test at once. This makes the output easier to read in the
2449 normal case.
2450
6b702268
PE
2451 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
2452 got from <http://bro-ids.org/download.html>. The bug is that
2453 when two actions appeared in succession, the second one was
2454 scanned before the first one was added to the grammar rule
2455 as a midrule action. Bison then output the incorrect warning
2456 "parse.y:905.17-906.36: warning: unused value: $3".
2457 * src/parse-gram.y (BRACED_CODE, action): These are no longer
2458 associated with a value.
2459 (rhs): Don't invoke grammar_current_rule_action_append.
2460 (action): Invoke it here instead.
2461 * src/reader.c (grammar_midrule_action): Now extern.
2462 (grammar_current_rule_action_append): Don't invoke
2463 grammar_midrule_action; that is now the scanner's job.
2464 * src/reader.h (last_string, last_braced_code_loc):
2465 (grammar_midrule_action): New decls.
2466 * src/scan-gram.l (last_string): Now extern, sigh.
2467 (last_braced_code_loc): New extern variable.
2468 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
2469 rule already has an action.
2470 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
2471 * tests/input.at (AT_CHECK_UNUSED_VALUES):
2472 Add some tests to check that the above changes fixed the bug.
2473
d40ba6c2
PE
24742006-01-27 Paul Eggert <eggert@cs.ucla.edu>
2475
2476 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
2477 All used changed. Check whether the symbol has a destructor,
2478 not whether it is typed.
2479 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
2480 that the values are still reported as unused. All line numbers
2481 adjusted.
2482
401aace6
PE
24832006-01-23 Paul Eggert <eggert@cs.ucla.edu>
2484
2485 Work around a bug in bro 0.8, which underparenthesizes its
2486 definition of YYLLOC_DEFAULT.
2487 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
2488 their arguments.
2489 * data/lalr1.cc: Likewise.
2490 * data/yacc.cc: Likewise.
2491
06f01bc4
PE
24922006-01-22 Paul Eggert <eggert@cs.ucla.edu>
2493
401aace6
PE
2494 Work around a bug in Pike 7.0, and give the Pike folks a
2495 better way to override the usual int widths.
2496 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
2497 user can override the types.
2498 (short): #undef, to work around a bug in Pike 7.0.
2499 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
2500 (union yyalloc.yyss): Use yytype_int16 rather than short.
2501 All uses changed.
2502 (yysigned_char): Remove.
2503 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
2504 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
2505 * tests/regression.at (Web2c Actions): Adjust to above changes.
2506
2507 * src/reader.c (check_and_convert_grammar): New function.
2508 (reader): Close the input file even if something went wrong during
2509 parsing. Minor file descriptor leak reported by twlevo.
2510
06f01bc4
PE
2511 * src/assoc.c (assoc_to_string): Use a default: abort (); case
2512 to pacify gcc -Wswitch-default.
2513 * src/scan-gram.l (adjust_location): Use a default: break; case
2514 to pacify gcc -Wswitch-default.
2515 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
2516 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
2517 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
2518 Move these decls to scan-skel.l, since they don't need to be
2519 visible elsewhere.
2520 * src/scan-skel.l: Accept the above decls.
2521 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
2522 is used.
2523
02650b7f
PE
25242006-01-21 Paul Eggert <eggert@cs.ucla.edu>
2525
2526 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
2527 since we don't want to insist on a version number at the start
2528 of the changelog every time.
2529 * Makefile.maint: Sync from coreutils a bit better.
2530 (sc_trailing_blank): Renamed from sc_trailing_space.
2531 All uses changed.
2532 (sc_no_if_have_config_h, sc_require_config_h):
2533 (sc_prohibit_assert_without_use): New rules.
2534 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
2535 (sc_dd_max_sym_length): Fix leading spaces in rule.
2536 (sc_system_h_headers): Prefix with @.
2537 (sc_useless_cpp_parens, m4-check): Output line numbers.
2538 (changelog-check): Allow version only in head.
2539 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
2540 satisfy new Makefile.maint rule.
2541 * data/glr.c: Likewise.
2542 * data/glr.cc: Likewise.
2543 * data/lalr1.cc: Likewise.
2544 * data/yacc.c: Likewise.
2545 * lib/ebitsetv.c: Likewise.
2546 * lib/lbitset.c: Likewise.
2547 * lib/subpipe.c: Likewise.
2548 * lib/timevar.c: Likewise.
2549 * src/system.h: Likewise.
2550 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
2551 * djgpp/Makefile.maint: Add copyright notice.
2552 * djgpp/README.in: Likewise.
2553 * djgpp/config.bat: Likewise.
2554 * djgpp/config.site: Likewise.
2555 * djgpp/config_h.sed: Likewise.
2556 * djgpp/djunpack.bat: Likewise.
2557 * djgpp/config.sed: Fix copyright notice to match standard format.
2558 * djgpp/subpipe.h: Likewise.
2559 * lib/bitsetv-print.c: Likewise.
2560 * lib/bitsetv.c: Likewise.
2561 * lib/subpipe.h: Likewise.
2562 * lib/timevar.c: Likewise.
2563 * lib/timevar.h: Likewise.
2564 * djgpp/subpipe.c: Use standard recipe for config.h.
2565 * lib/abitset.c: Likewise.
2566 * lib/bitset.c: Likewise.
2567 * lib/bitset_stats.c: Likewise.
2568 * lib/bitsetv-print.c: Likewise.
2569 * lib/bitsetv.c: Likewise.
2570 * lib/ebitsetv.c: Likewise.
2571 * lib/get-errno.c: Likewise.
2572 * lib/lbitset.c: Likewise.
2573 * lib/subpipe.c: Likewise.
2574 * lib/timevar.c: Likewise.
2575 * lib/vbitset.c: Likewise.
2576 * tests/local.at: Likewise.
2577 * src/scan-gram.l: Don't include verify.h, since system.h does
2578 that for us.
2579 * .x-sc_require_config_h: New file.
2580 * .x-sc_unmarked_diagnostics: New file.
2581
287c78f6
PE
25822006-01-20 Paul Eggert <eggert@cs.ucla.edu>
2583
287c78f6
PE
2584 Be a bit more systematic about using 'abort'.
2585 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
2586 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
2587 Put 'default: abort ();' before some other case, to satisfy older
2588 pedantic compilers.
2589 * lib/bitset_stats.c (bitset_stats_init): Likewise.
2590 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
2591 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
2592 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
2593 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
2594 (get_decision_str, get_orientation_str, get_node_alignment_str):
2595 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
2596 (get_linestyle_str, get_arrowstyle_str): Likewise.
2597 * src/conflicts.c (resolve_sr_conflict):
2598 Use a default case rather than one for the one remaining enum
2599 value, to catch invalid enum values as well.
2600 * src/lalr.c (set_goto_map, map_goto):
2601 Prefer "assert (FOO);" to "if (!FOO) abort ();".
2602 * src/nullable.c (nullable_compute, token_definitions_output):
2603 Likewise.
2604 * src/reader.c (packgram, reader): Likewise.
2605 * src/state.c (transitions_to, state_new, state_reduction_find):
2606 Likewise.
2607 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
2608 (symbol_pack): Likewise.
2609 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
2610 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
2611 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
2612 * src/system.h: Don't include <assert.h>.
2613 (assert): New macro.
2614
2615 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
2616 (Destructor Decl, Parser Function, Pure Calling):
2617 Describe rules for braces inside C code more carefully.
287c78f6 2618
c66dfadd
PE
26192006-01-19 Paul Eggert <eggert@cs.ucla.edu>
2620
c21493b8
PE
2621 Fix some porting glitches found by Nelson H. F. Beebe.
2622 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
2623 compilers that don't understand that abort () does not return.
2624 * src/state.c (transitions_to): Likewise.
2625 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
2626 that '#include <cstdlib>' works.
2627 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
2628 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
2629 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
2630 for the benefit of some pre-C99 compilers.
2631
b6e3facf
PE
2632 * bootstrap: Undo changes to gnulib files that autoreconf made.
2633
c66dfadd
PE
2634 Minor fixups to get 'make maintainer-check' to work.
2635 * configure.ac: Don't use -Wnested-externs, as it's incompatible
2636 with the new verify.h implementation.
2637 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
2638 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
2639 * data/yacc.c (YYUSE): Likewise.
2640 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
2641 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
2642 * src/parse-gram.y (declaration): Don't pass a string constant
2643 to a function that expects char *, since GCC might complain
2644 about the constant value.
2645 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
2646 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
2647 before #defining them.
2648 * tests/glr-regression.at
2649 (Incorrectly initialized location for empty right-hand side in GLR):
2650 In yyerror, use the msg arg.
2651 (Corrupted semantic options if user action cuts parse):
2652 (Incorrect lookahead during deterministic GLR):
2653 (Incorrect lookahead during nondeterministic GLR):
2654 Don't name a local var 'index'; it shadows string.h's 'index'.
2655
ed94ef2a
AD
26562006-01-19 Akim Demaille <akim@epita.fr>
2657
2658 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
2659 location, not just parts of it.
2660
e9ad4aec
PE
26612006-01-18 Paul Eggert <eggert@cs.ucla.edu>
2662
d6ca7905
PE
2663 * NEWS: Document the fact that multiple %unions are now allowed.
2664 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
2665 * TODO: This feature is now implemented, so remove it from
2666 the wishlist.
d6ca7905 2667
ef1b70e0
PE
2668 * Makefile.maint: Merge with coreutils Makefile.maint.
2669 (CVS_LIST): Use build-aux version if available.
2670 (VERSION_REGEXP): New macro.
2671 (syntax-check-rules): Add sc_no_if_have_config_h,
2672 sc_prohibit_assert_without_use, sc_require_config_h,
2673 sc_useless_cpp_parens.
2674 (sc_obsolete_symbols): Check for O_NDELAY.
2675 (sc_dd_max_sym_length): Track coreutils.
2676 (sc_unmarked_diagnostics): Look in all files, not just *.c.
2677 (sc_useless_cpp_parens): New rule.
2678 (news-date-check): Look for version or today's date.
2679 (changelog-check): Don't require version number near head.
2680 (copyright-check): Use current year instead of hardwiring 2005.
2681 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
2682 (announcement): Add --gpg-key-ID.
2683
2684 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
2685 with "file system".
2686
2073ce56 2687 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
2688 array. Problem reported by twlevo.
2689 * src/reader.c (packgram): Prepend a new sentinel before ritem.
2690 * src/lalr.c (build_relations): Rely on new sentinel.
2691 * src/gram.c (gram_free): Adjust to new sentinel.
2692
b7691f15
JD
26932006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
2694
2695 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
2696 yylookaheadNeeds. All uses updated.
2697 (yysplitStack): Rename local yynewLookaheadStatuses to
2698 yynewLookaheadNeeds.
2699 * data/glr-regression.at (Incorrect lookahead during nondeterministic
2700 GLR): In comments, change `lookahead status' to `lookahead need'.
2701
ddee1b06
PH
27022006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2703
2704 * data/glr.c (yysplitStack): A little stylistic rewrite.
2705
12f4614d
PH
27062006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2707
2708 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
2709
32c29292
JD
27102006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
2711
2712 * doc/bison.texinfo: Fix some typos.
2713 (GLR Semantic Actions): New subsection discussing special
2714 considerations because GLR semantic actions might be deferred.
2715 (Actions): Mention look-ahead usage of yylval.
2716 (Actions and Locations): Mention look-ahead usage of yylloc.
2717 (Special Features for Use in Actions): Add YYEOF entry and mention it
2718 in the yychar entry.
2719 In the yychar entry, remove mention of the local yychar case (pure
2720 parser) since this is irrelevant information when writing semantic
2721 actions and since it's already discussed in `Bison Symbols' where
2722 yychar is otherwise described as an external variable.
2723 In the yychar entry, don't call it the `current' look-ahead since it
2724 isn't when semantic actions are deferred.
2725 In the yychar and yyclearin entries, add note about deferred semantic
2726 actions.
2727 Add yylloc and yylval entries discussing look-ahead usage.
2728 (Look-Ahead Tokens): When discussing yychar, don't call it the
2729 `current' look-ahead, and do mention yylval and yylloc.
2730 (Error Recovery): Cross-reference `Action Features' when mentioning
2731 yyclearin.
2732 (Bison Symbols): In the yychar entry, don't call it the `current'
2733 look-ahead.
2734 In the yylloc and yylval entries, mention look-ahead usage.
2735
de366a2f 27362006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
2737
2738 * tests/glr-regression.at: Update copyright year to 2006.
2739
bf70fa87
JD
27402006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2741
2742 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
2743 use during nondeterministic operation to track which stacks have
2744 actually needed the current lookahead.
2745 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
2746 Allocate, deallocate, resize, and otherwise shuffle space for
2747 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
2748 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
2749 appropriately during nondeterministic operation.
2750 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
2751 members to store the current lookahead to be used by the deferred
2752 user action.
2753 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
2754 from which the RHS is taken. Set the lookahead members of the new
2755 yySemanticOption according to the lookahead status for stack yyk.
2756 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
2757 yyaddDeferredAction.
2758 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
2759 members of yySemanticOption before invoking yyuserAction, and then set
2760 them back to their current values afterward.
2761 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
2762 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
2763 * tests/glr-regression.at: Remove `.' from the ends of recent test case
2764 titles for consistency.
2765 (Leaked merged semantic value if user action cuts parse): In order to
2766 suppress lint warnings, use arguments in merge function, and assign
2767 char value < 128 in main.
2768 (Incorrect lookahead during deterministic GLR): New test case.
2769 (Incorrect lookahead during nondeterministic GLR): New test case.
2770
05449a2c
JD
27712006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2772
de366a2f 2773 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
2774 !yyvaluep as signal that no semantic value is available to print.
2775 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
2776 to print a semantic value.
2777
4158e0a1 27782006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 2779
4158e0a1
JD
2780 * tests/glr-regression.at: For consistency with my newer test cases,
2781 don't thank myself.
2782
d659304d
JD
27832006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
2784
2785 * data/glr.c (yyresolveValue): When merging semantic options, if at
2786 least one user action succeeds but a later one cuts the parse, then
2787 destroy the semantic value before returning rather than leaking it.
2788 (yyresolveStates): If a user action cuts the parse and thus
2789 yyresolveValue fails, ignore the (unset) semantic value rather than
2790 corrupting the yyGLRState, and empty the semantic options list since
2791 the user actions should have called all necessary destructors.
2792 Simplify code with YYCHK.
2793 * tests/glr-regression.at (Corrupted semantic options if user action
2794 cuts parse): New test case.
2795 (Undesirable destructors if user action cuts parse): New test case.
2796 Before applying any of this patch, this test case never actually failed
2797 for me... but only because the corrupted semantic options usually
2798 masked this bug.
2799 (Leaked merged semantic value if user action cuts parse): New test
2800 case.
2801
6ec2c0f2
AD
28022006-01-05 Akim Demaille <akim@epita.fr>
2803
2804 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
2805
1b9c21fb
PE
28062006-01-04 Paul Eggert <eggert@cs.ucla.edu>
2807
2808 * data/c.m4 (b4_c_modern): New macro, with a new provision for
2809 _MSC_VER. Problem reported by Cenzato Marco.
2810 (b4_c_function_def): Use it.
2811 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
2812 b4_c_modern.
2813 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
2814 than rolling our own.
2815
84866159
AD
28162006-01-04 Akim Demaille <akim@epita.fr>
2817
2818 Also warn about non-used mid-rule values.
2819 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
2820 member.
2821 (symbol_list_new): Adjust.
2822 * src/reader.c (symbol_typed_p): New.
2823 (grammar_rule_check): Use it.
2824 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
2825 Check its rule.
2826 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
2827 Use it.
2828 * tests/actions.at (Exotic Dollars): Adjust.
2829
378f4bd8
AD
28302006-01-04 Akim Demaille <akim@epita.fr>
2831
2832 * src/reader.c (grammar_midrule_action): If $$ is set in a
2833 mid-rule, move the `used' bit to its lhs.
2834 * tests/input.at (Unused values): New.
2835 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
2836
e2a21b6f
PE
28372006-01-03 Paul Eggert <eggert@cs.ucla.edu>
2838
54662697
PE
2839 * doc/bison.texinfo (Bison Options): Say more accurately what
2840 --yacc does.
2841 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
2842 about declarations in the grammar when in Yacc mode, as POSIX does
2843 not require a diagnostic when the grammar uses extensions.
2844
2845 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
2846
073f9288
PE
2847 Warn about dubious constructions like "%token T T".
2848 Reported by twlevo.
2849 * src/symtab.h (struct symbol.declared): New member.
2850 * src/symtab.c (symbol_new): Initialize it to false.
2851 (symbol_class_set): New arg DECLARING, specifying whether
2852 this is a declaration that we want to warn about, if there
2853 is more than one of them. All uses changed.
2854
1221b78a
PE
2855 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
2856 Allow multiple %union directives, whose contents concatenate.
2857 * src/parse-gram.y (grammar_declaration): Likewise.
2858 Use muscle_code_grow, so that we don't need stype_line any more.
2859 All uses changed.
2860
2861 * src/muscle_tab.c (muscle_grow): Fix comment.
2862
e2a21b6f
PE
2863 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
2864 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
2865 Update copyright year to 2006.
2866
8f7e3cf9
AD
28672006-01-03 Akim Demaille <akim@epita.fr>
2868
2869 Have glr.cc pass (some of) the calc.at tests.
2870 * data/glr.cc (b4_parse_param_orig): New.
2871 (b4_parse_param): Improve its definition, and bound it more
2872 clearly in the skeleton.
2873 (b4_epilogue): Append, instead of prepending, in order to keep
2874 #line consistency.
2875 Simplify the generation of auxiliary functions: locations and
2876 purity are mandated.
2877 (b4_global_tokens_and_yystype): Honor it.
2878 * data/location.cc (c++.m4): Don't include it.
2879 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
2880 and AT_SKEL_CC_IF.
2881 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
2882 AT_LALR1_CC_IF.
2883 Be sure to initialize the first position's filename.
2884 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
2885 mandated anyway.
2886 (AT_CHECK_CALC_GLR_CC): New.
2887 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
2888
3953ed88
AD
28892006-01-02 Akim Demaille <akim@epita.fr>
2890
2891 * src/output.c (output_skeleton): Don't hard wire the inclusion of
2892 c.m4.
0a96ba81 2893 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
2894 * data/glr.cc: Do not include stack.hh.
2895
9ecafbbf
AD
28962006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2897
2898 * data/glr.c: Reformat whitespace with tabs.
2899 (b4_lpure_formals): Remove this unused m4 macro.
2900 * tests/cxx-type.at: Reformat whitespace with tabs.
2901 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
2902 since it's a member. Rename type to isNterm for clarity.
2903
c4d497a0
AD
29042005-12-29 Akim <akim@sulaco.local>
2905
2906 Let glr.cc catch up with symbol_value_print.
2907 * data/glr.cc (b4_yysymprint_generate): Replace by...
2908 (b4_yy_symbol_print_generate): this.
2909 (yy_symbol_print, yy_symbol_value_print): Declare them.
2910
4517da37
PE
29112005-12-28 Paul Eggert <eggert@cs.ucla.edu>
2912
2913 * src/location.h (boundary): Note that a line or column equal
2914 to INT_MAX indicates an overflow.
2915 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
2916 (rule_length_overflow, increment_rule_length, add_column_width):
2917 New functions.
2918 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
2919 (<SC_BRACED_CODE>"}"):
2920 Use increment_rule_length rather than incrementing it by hand.
2921 (adjust_location, handle_syncline): Diagnose overflow.
2922 (handle_action_dollar, handle_action_at):
2923 Fix bug with monstrosities like $-2147483648.
2924 Remove now-unnecessary checks.
2925 (scan_integer): Verify assumptions and remove now-unnecessary checks.
2926 (convert_ucn_to_byte): Verify assumptions.
2927 (handle_syncline): New arg LOC. All callers changed.
2928 Don't store through a value derived from char const * pointer.
2929
2930 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
2931 GCC warnings.
2932
e3233bf6
PE
29332005-12-27 Paul Eggert <eggert@cs.ucla.edu>
2934
2935 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
2936 Remove unnecessary forward static decls.
2937
8f3596a6
AD
29382005-12-27 Akim Demaille <akim@epita.fr>
2939
2940 * src/reader.c (grammar_current_rule_check): Also check that $$
2941 is used.
2942 Take the rule to check as argument, hence rename as...
2943 (grammar_rule_check): this.
2944 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
2945 Rename as...
2946 (grammar_rule_begin, grammar_rule_end): these, for consistency.
2947 (grammar_midrule_action, grammar_symbol_append): Now static.
2948 * tests/torture.at (input): Don't rely on the default action
2949 being always performed.
2950 * tests/calc.at: "Set" $$ even when the action is "cut" with
2951 YYERROR or other.
2952 * tests/actions.at (Exotic Dollars): Instead of using unused
2953 values, check that the warning is issued.
2954
721be13c
PE
29552005-12-22 Paul Eggert <eggert@cs.ucla.edu>
2956
2957 * NEWS: Improve wording for unused-value warnings.
2958
a0af42fc
AD
29592005-12-22 Akim Demaille <akim@epita.fr>
2960
2961 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
2962 (b4_yysymprint_generate): Rename as...
2963 (b4_yy_symbol_print_generate): this.
2964 Generate yy_symbol_print instead of yysymprint.
2965 Generate also yy_symbol_value_print, and use it.
2966
affac613
AD
29672005-12-22 Akim Demaille <akim@epita.fr>
2968
721be13c 2969 * NEWS: Warn about unused values.
affac613
AD
2970 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
2971 a `used' member.
2972 (symbol_list_n_get, symbol_list_n_used_set): New.
2973 (symbol_list_n_type_name_get): Use symbol_list_n_get.
2974 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
2975 * src/reader.c (grammar_current_rule_check): Check that values are
2976 used.
2977 * src/symtab.c (symbol_print): Accept 0.
2978 * tests/existing.at: Remove the type information.
2979 Empty the actions.
2980 Remove useless actions (beware of mid-rule actions: perl -000
2981 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
2982 * tests/actions.at (Exotic Dollars): Use unused values.
2983 * tests/calc.at: Likewise.
2984 * tests/glr-regression.at (No users destructors if stack 0 deleted):
2985 Likewise.
2986
2987 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
2988 rule_useful_p.
2989
9d9b8b70
PE
29902005-12-21 Paul Eggert <eggert@cs.ucla.edu>
2991
8bb4c753
PE
2992 Undo 2005-12-01 tentative license wording change. The wording is
2993 still being reviewed by the lawyers, and we don't want to wait for
2994 them before publishing a test release. For now, revert to the
2995 previous wording.
2996 * NEWS: Undo 2005-12-01 change.
2997 * data/glr.c: Revert to previous license wording.
2998 * data/glr.cc: Likewise.
2999 * data/lalr1.cc: Likewise.
3000 * data/location.cc: Likewise.
3001 * data/yacc.c: Likewise.
3002
9d9b8b70
PE
3003 * NEWS: Reword %destructor vs YYABORT etc.
3004 * data/glr.c: Use American spacing, for consistency.
3005 * data/glr.cc: Likewise.
3006 * data/lalr1.cc: Likewise.
3007 * data/yacc.c: Likewise.
3008 * data/yacc.c: Reformat comments slightly.
3009 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
3010 for consistency. Fix some spelling errors and reword recently-included
3011 text slightly.
3012 * tests/cxx-type.at: Cast results of malloc, for C++.
3013
2c3b392a
AD
30142005-12-21 Joel E. Denny <address@hidden>
3015
3016 * tests/cxx-type.at: Construct a tree, count the parents of shared
3017 nodes, and free each node once and only once. Previously, the memory
3018 for semantic values was leaked instead.
3019
d6cff4dc
AD
30202005-12-21 Joel E. Denny <address@hidden>
3021
3022 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
3023 (yylval, yylloc): If pure, #define to yystackp->yyval and
3024 yystackp->yyloc similar to yychar and yynerrs.
3025 (yyparse): If pure, remove local yylval and yylloc. Add local
3026 yystackp to accommodate pure definitions of yylval and yylloc.
3027 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
3028 yylvalp and yyllocp to &yylval and &yylloc.
3029 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
3030 namespace. Previously, nerrs and char were missing, but lval and lloc
3031 weren't necessary.
3032 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
3033 yylvalp and yyllocp parameters since, if pure, these are now always
3034 accessible through yystackp. If not pure, they are still accessible
3035 globally.
3036 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
3037 `if (YYID (N))' to pacify lint.
3038
a85284cf
AD
30392005-12-21 Akim Demaille <akim@epita.fr>
3040
3041 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
3042 destroy the RHS symbols of a rule.
3043 * data/yacc.c (yylen): Initialize to 0.
3044 Keep its value to the number of items to possibly shift.
3045 In particular, a regular successful parse that ends on YYFINAL by
3046 a (internal) YYACCEPT must not have yylen != 0.
3047 (yyerrorlab, yyreturn): Pop the RHS.
3048 Reorder a bit to emphasize the `shifting' bits of code.
3049 (YYPOPSTACK): Now accept a number of items to pop.
3050 * data/lalr1.cc: Likewise.
3051 * data/glr.c: Formatting changes.
3052 Use goto instead of fall through.
3053 * doc/bison.texinfo (Destructor Decl): Complete.
3054
d508c281
JMG
30552005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3056
3057 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3058 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
3059 * djgpp/config.bat: Replace every occurence of the file name
3060 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3061 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3062 * djgpp/config.sed: Replace every occurence of the file name
3063 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3064 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3065 * djgpp/djunpack.bat: DJGPP specific file.
3066 * djgpp/fnchange.lst: DJGPP specific file.
3067 * djgpp/README.in: Add new information about how to unpack the bison
3068 source on MSDOS and other systems which have 8.3 file name restrictions
3069 using djunpack.bat and fnchange.lst.
3070
3e7a2cd9
PE
30712005-12-12 Paul Eggert <eggert@cs.ucla.edu>
3072
3073 * bootstrap (build_cvs_prefix): Remove; unused.
3074 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
3075 when getting gnulib.
3076
30772005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
3078
3079 * data/glr.c: Reorder typedef declarations for structs to match order
3080 of struct declarations.
3081 Rename yystack everywhere to yystackp except in yyparse where it's not
3082 a pointer.
3083 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
3084 consistency.
3085 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
3086 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
3087 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
3088 lint.
3089
877519f8
PE
30902005-12-09 Paul Eggert <eggert@cs.ucla.edu>
3091
0eca5a39
PE
3092 * tests/sets.at (Accept): Fix typos in regular expression used to
3093 sed out the final state number.
3094
2cec9080
PE
3095 Work around portability problem on Solaris 10: flex-generated
3096 files include <stdio.h> before <config.h>, which messes up
3097 because the latter defines __EXTENSIONS__. Address the problem
3098 by creating two new little files that include <config.h> first,
3099 then include the flex-generated files. Rewrite everyone else
3100 to include <config.h> first, as well.
3101 * lib/timevar.c: Always include "config.h".
3102 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
3103 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
3104 (EXTRA_bison_SOURCES): New macro.
3105 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
3106 * src/system.h: Don't include config.h.
3107 * src/LR0.c: Include <config.h> first.
3108 * src/assoc.c: Likewise.
3109 * src/closure.c: Likewise.
3110 * src/complain.c: Likewise.
3111 * src/conflicts.c: Likewise.
3112 * src/derives.c: Likewise.
3113 * src/files.c: Likewise.
3114 * src/getargs.c: Likewise.
3115 * src/gram.c: Likewise.
3116 * src/lalr.c: Likewise.
3117 * src/location.c: Likewise.
3118 * src/main.c: Likewise.
3119 * src/muscle_tab.c: Likewise.
3120 * src/nullable.c: Likewise.
3121 * src/output.c: Likewise.
3122 * src/parse-gram.y: Likewise.
3123 * src/print.c: Likewise.
3124 * src/print_graph.c: Likewise.
3125 * src/reader.c: Likewise.
3126 * src/reduce.c: Likewise.
3127 * src/relation.c: Likewise.
3128 * src/state.c: Likewise.
3129 * src/symlist.c: Likewise.
3130 * src/symtab.c: Likewise.
3131 * src/tables.c: Likewise.
3132 * src/uniqstr.c: Likewise.
3133 * src/vcg.c: Likewise.
3134
877519f8
PE
3135 * src/parse-gram.y: Fix minor problems uncovered by lint.
3136 (current_lhs, current_lhs_location): Now static.
3137 (current_assoc): Remove unused variable.
3138
3139 Cleanups so that Bison-generated parsers have less lint.
3140 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
3141 Prepend /*ARGSUSED*/, for lint's sake.
3142 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
3143 definition if 'lint' is defined.
3144 (YYID): New macro (or function, if lint).
3145 All uses of /*CONSTCOND*/0 replaced by YYID(0).
3146 * data/yacc.c: Likewise.
3147 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
3148 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
3149 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
3150 is C++ only.
3151 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
3152 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
3153 Use YYID(0) rather than 0, for lint.
3154 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
3155 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
3156
f5228370
PE
31572005-12-07 Paul Eggert <eggert@cs.ucla.edu>
3158
3159 * tests/glr-regression.at
3160 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
3161 Close memory leak reported by twlevo.
3162
69ce078b
PE
31632005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
3164
6ff99711
PE
3165 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
3166 all stacks.
3167 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
3168 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3169 New test case.
3170 (Duplicated user destructor for lookahead): This test now is expected
3171 to succeed.
3172
af3412cd
PE
31732005-12-01 Paul Eggert <eggert@cs.ucla.edu>
3174
32b5b719 3175 * NEWS: Document the following change.
af3412cd
PE
3176 * data/yacc.c: Say "parser skeleton" rather than "file", since
3177 it's no longer just a file.
3178 * data/glr.c: Grant a special exception for C GLR parsers, that
3179 reads like the already-existing exception for C LALR(1) parsers.
3180 * data/glr.cc: Likewise.
3181 * data/lalr1.cc: Likewise.
3182 * data/location.cc: Likewise.
3183 * data/yacc.c: Reword the "written by" statement to clarify that
3184 it was the parser skeleton, not the entire output file.
3185 * data/glr.c: Written by Paul Hilfinger.
3186 * data/glr.cc: Written by Akim Demaille.
3187 * data/lalr1.cc: Likewise.
3188
035aa4a0
PE
31892005-11-18 Paul Eggert <eggert@cs.ucla.edu>
3190
d9963c85
PE
3191 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
3192 Fix typos in previous change that broke 'make check'.
3193 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
3194 supported in C.
3195 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
3196 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
3197 We can revert this once things settle down.
3198
035aa4a0
PE
3199 * src/conflicts.c (conflicts_print): Don't print file name twice
3200 when %expect fails because there were no conflicts.
3201 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
3202 change.
3203 * tests/conflicts.at (%expect not enough, %expect too much):
3204 (%expect with reduce conflicts): Adjust to new behavior.
3205
32062005-11-18 Akim Demaille <akim@epita.fr>
3207
3208 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
3209 errors.
3210 * NEWS: Document this.
3211 * doc/bison.texinfo (Expect Decl): Likewise.
3212
d1ff7a7c
AD
32132005-11-16 Akim Demaille <akim@epita.fr>
3214
3215 Generalize the display of semantic values and locations in traces.
3216 * data/glr.c (yy_reduce_print): Fix indices (again).
3217 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
3218 literal integers.
3219 * data/lalr1.cc (yyreduce_print): Rename as...
3220 (yy_reduce_print): this.
3221 Display values and locations.
3222 * data/yacc.c (yy_reduce_print): Likewise.
3223 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
3224 (yysymprint): Move higher to be visible from yy_reduce_print).
3225 (yyparse): Adjust.
3226 * tests/calc.at: Adjust the expected length of the traces.
3227
6de5398d
AD
32282005-11-14 Akim Demaille <akim@epita.fr>
3229
3230 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
3231 from 1 to N, while values and location start at 0.
3232 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
3233
a1373f55
AD
32342005-11-14 Akim Demaille <akim@epita.fr>
3235
3236 * data/glr.c (yy_reduce_print): Fix the $ number.
3237
613d8952
AD
32382005-11-14 Akim Demaille <akim@epita.fr>
3239
3240 "Use" parse parameters.
3241 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
3242 * data/glr.c, data/glr.cc: Use them.
3243 * data/glr.c (YYUSE): Have a C++ definition that supports
3244 non-pointer types.
3245
b2741627
AD
32462005-11-14 Akim Demaille <akim@epita.fr>
3247
3248 * data/glr.c (yyexpandGLRStack): Declare only if defined.
3249
5059b5c8
AD
32502005-11-14 Akim Demaille <akim@epita.fr>
3251
42249483
AD
3252 * data/glr.cc: New.
3253 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 3254
4626a15d
AD
32552005-11-12 Akim Demaille <akim@epita.fr>
3256
3257 Let position and location be PODs.
3258 * data/location.cc (position::initialize, location::initialize): New.
3259 (position::position, location::location): Define only if
3260 b4_location_constructors is defined.
3261 * data/lalr1.cc (b4_location_constructors): Define it for backward
3262 compatibility.
3263 * doc/bison.texinfo (Initial Action Decl): Use initialize.
3264
32652005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
3266
3267 * data/lalr1.cc: Move the body of the ctor and dtor into the
3268 parser file (instead of the header).
3269 Wrap the implementations in a "namespace yy".
3270
32712005-11-12 Akim Demaille <akim@epita.fr>
3272
3273 Have glr.c include its header file when created.
3274 * data/glr.c (b4_shared_declarations): New.
3275 Output them verbatim in the parser if !%defines, otherwise
3276 output then in the header file, and include it instead.
3277
1989d947
AD
32782005-11-11 Akim Demaille <akim@epita.fr>
3279
3280 * data/glr.c: Comment changes.
3281
32822005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
3283
3284 When yydebug, report semantic and location values for reductions.
3285 * data/glr.c (yy_reduce_print): Report the semantic values and the
3286 locations.
3287 (YY_REDUCE_PRINT): Adjust.
3288 (yyglrReduce): Use them.
3289 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
3290 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
3291 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
3292 traces.
3293
02998094
AD
32942005-11-10 Akim Demaille <akim@epita.fr>
3295
3296 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
3297 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
3298 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
3299
5210672f
PE
33002005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
3301
3302 * m4/cxx.m4, examples/Makefile.am: Don't build
3303 examples/calc++ if no C++ compiler is available. (trivial change)
3304
a8991a1d
AD
33052005-11-09 Akim Demaille <akim@epita.fr>
3306
3307 * src/scan-skel.l: Use a couple of asserts.
3308
36b5e963
AD
33092005-11-03 Akim Demaille <akim@epita.fr>
3310
3311 In some (weird) cases, the final state number is incorrect.
3312 Reported by Alexandre Duret-Lutz.
3313 * src/LR0.c (state_list_append): Remove the computation of
3314 final_state.
3315 (save_reductions): Do it here.
3316 (get_state): Alpha conversion.
3317 (generate_states): Use a for loop.
3318 * src/gram.h (item_number_is_rule_number)
3319 (item_number_is_symbol_number): New.
3320 * src/state.c: Use assert.
3321 * src/system.h: Include assert.h.
3322 * tests/sets.at (Accept): New.
3323
44e7ead1
PH
33242005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3325
3326 * data/glr.c (yyfill): Adjust comment.
36b5e963 3327 (yyresolveAction): Initialize default location properly
44e7ead1
PH
3328 for empty right-hand sides.
3329 (yydoAction): Ditto.
3330 Add comment explaining apparently dead code.
36b5e963
AD
3331 * tests/glr-regression.at
3332 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 3333 New test.
36b5e963 3334
e10a80ee
PE
33352005-10-30 Paul Eggert <eggert@cs.ucla.edu>
3336
3337 * bootstrap (cleanup_gnulib): New function. Use it to clean up
3338 gnulib when interrupted. This fixes some race conditions and
3339 works around some portability problems (one noted by Paul
3340 Hilfinger).
3341
067b32ee
AD
33422005-10-22 Akim <akim@epita.fr>
3343
3344 * Makefile.cfg: Adjust to config -> build-aux.
3345 Reported by twledo.
3346
4b367315
AD
33472005-10-21 Akim Demaille <akim@epita.fr>
3348
3349 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
3350 the %parse-params.
3351 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
3352 * data/yacc.c (b4_Pure_if): Rename as...
3353 (b4_yacc_pure_if): this.
3354 (YY_SYMBOL_PRINT, yyparse): Adjust.
3355 * doc/bison.texinfo: Formatting changes.
3356
24cc23d9
AD
33572005-10-21 Akim Demaille <akim@epita.fr>
3358
3359 Finish the transition config -> build-aux.
3360 * configure.ac, Makefile.am: Use build-aux.
3361 * config/prev-version, config/announce-gen, config/Makefile.am:
3362 Move to...
3363 * build-aux/prev-version, build-aux/announce-gen,
3364 * build-aux/Makefile.am: here.
3365
d4476375
AD
33662005-10-14 Akim Demaille <akim@epita.fr>
3367
3368 * examples/calc++/test: Use set -x only when VERBOSE.
3369
302c0aee
PE
33702005-10-13 Paul Eggert <eggert@cs.ucla.edu>
3371
3372 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
3373 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
3374
7625ec2c
AD
33752005-10-13 Akim Demaille <akim@epita.fr>
3376
3377 * src/scan-skel.l: Output the base name parts of the parser and
3378 header file names.
302c0aee 3379 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
3380 additional checks.
3381 Use this to exercise C++ outputs in subdirs.
3382 Reported by Oleg Smolsky.
3383
ba0fe3c7
PE
33842005-10-12 Paul Eggert <eggert@cs.ucla.edu>
3385
3386 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
3387 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
3388 Problem reported by John P. Hartmann.
3389 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
3390 already defined it.
3391
9b8a5ce0
AD
33922005-10-12 Akim Demaille <akim@epita.fr>
3393
3394 * src/parse-gram.y (version_check): Exit 63 to please missing
3395 (stands for "version mismatch).
3396 * tests/input.at, doc/bison.texinfo: Adjust.
3397
4f6e011e
PE
33982005-10-10 Paul Eggert <eggert@cs.ucla.edu>
3399
3400 Work around portability problems with Visual Age C compiler
3401 (xlc and xlC_r) reported by John P. Hartmann.
3402 * data/location.cc (initial_column, initial_line): Remove.
3403 All uses replaced by 0 and 1.
3404 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
3405 that xlc complains about.
3406 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 3407 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 3408 as __STDC__.
4d7aa45e
PE
3409 * data/yacc.c (YYMODERN_C): New macro, which also looks at
3410 __STDC_VERSION__. Use it everywhere instead of looking at
3411 __STDC__ and __cplusplus.
4f6e011e 3412
a1b3bf8c
AD
34132005-10-10 Akim Demaille <akim@epita.fr>
3414
3415 * examples/calc++/test: Be quiet unless VERBOSE.
3416
412e44aa
PE
34172005-10-05 Paul Eggert <eggert@cs.ucla.edu>
3418
2a4647a3
PE
3419 * data/c.m4 (yydestruct, yysymprint):
3420 Use YYUSE instead of casting to void.
3421 * data/glr.c (YYUSE): New macro.
3422 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3423 Use it instead of rolling our own.
3424 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3425 (YYCHK1):
3426 Use /*CONSTCOND*/ to suppress lint warnings.
3427 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3428 (YY_STACK_PRINT): Use 'false' not '0'.
3429 (YYUSE): New macro.
3430 (yysymprint_, yydestruct_): Use it instead of rolling our own.
3431 * data/yacc.c (YYUSE): New macro.
3432 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
3433 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
3434 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
3435
3436
412e44aa
PE
3437 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
3438 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
3439
88c6637f
PE
34402005-10-04 Paul Eggert <eggert@cs.ucla.edu>
3441
2f4f028d
PE
3442 Undo the parts of the unlocked-I/O change that substituted
3443 putc or puts for printf. This might hurt performance a bit,
3444 but some people prefer the printf style.
3445 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
3446 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
3447 All uses replaced by YYFPRINTF and YYDPRINTF.
3448 * data/yacc.c: Likewise.
3449 * lib/bitset.c (bitset_print): Likewise.
3450 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
3451 putc and puts.
3452 * lib/lbitset.c (debug_lbitset): Likewise.
3453 * src/closure.c (print_firsts, print_fderives): Likewise.
3454 * src/gram.c (grammar_dump): Likewise.
3455 * src/lalr.c (look_ahead_tokens_print): Likewise.
3456 * src/output.c (escaped_output): Likewise.
3457 (user_actions_output): Break apart two printfs.
3458 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
3459 * src/reduce.c (reduce_print): Likewise.
3460 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
3461 * src/system.h: Include unlocked-io.h rathe than stdio.h.
3462
88c6637f
PE
3463 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3464 Use assignments rather than casts-to-void to suppress
3465 unused-variable warnings. This pacifies 'lint'.
3466 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
3467 unused-variable warnings.
3468
fb32e373
JMG
34692005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3470
3471 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3472
edb8f44f
PE
34732005-10-02 Paul Eggert <eggert@cs.ucla.edu>
3474
fb9c0b33
PE
3475 Use unlocked I/O for a minor performance improvement on hosts like
3476 GNU/Linux and Solaris that support unlocked I/O. The basic idea
3477 is to use the gnlib unlocked-io module, and to prefer putc and
3478 puts to printf when either will work (since the latter doesn't
3479 come in an unlocked flavor).
3480 * bootstrap (gnulib_modules): Add unlocked-io.
3481 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
3482 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
3483 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
3484 and similarly for puts and putc and printf.
3485 * data/yacc.c: Likewise.
3486 * lib/bitset.c (bitset_print): Likewise.
3487 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
3488 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
3489 to printf.
3490 * lib/lbitset.c (debug_lbitset): Likewise.
3491 * src/closure.c (print_firsts, print_fderives): Likewise.
3492 * src/gram.c (grammar_dump): Likewise.
3493 * src/lalr.c (look_ahead_tokens_print): Likewise.
3494 * src/output.c (escaped_output): Likewise.
3495 (user_actions_output): Coalesce two printfs.
2f4f028d 3496 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
3497 * src/reduce.c (reduce_print): Likewise.
3498 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 3499 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 3500
edb8f44f
PE
3501 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
3502 this confuses xgettext.
3503
b50d2359
AD
35042005-10-02 Akim Demaille <akim@epita.fr>
3505
3506 * bootstrap (gnulib_modules): Add strverscmp.
3507 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
3508 * m4/.cvsignore: Add strverscmp.m4.
3509 * src/parse-gram.y (%require): New token, new rule.
3510 (version_check): New.
3511 * src/scan-gram.l (%require): Adjust.
3512 * tests/input.at (AT_REQUIRE): New.
3513 Use it.
3514 * doc/bison.texinfo (Require Decl): New.
3515 (Calc++ Parser): Use %require.
3516
21667f64
AD
35172005-10-02 Akim Demaille <akim@epita.fr>
3518
3519 * data/location.cc: New.
3520
2b81e969
AD
35212005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
3522 Akim Demaille <akim@epita.fr>
3523
3524 Make sure -odir/foo.cc creates dir/location.hh etc.
3525 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
3526 (spec_file_prefix, spec_verbose_file, spec_graph_file)
3527 (spec_defines_file): Now const.
3528 (dir_prefix): New.
3529 (short_base_name): Remove.
3530 * src/files.c: Adjust.
3531 (dirname.h): Include.
3532 (base_name): Don't prototype it.
3533 (finput): Remove, duplicates gram_in.
3534 (full_base_name, short_base_name): Replace by...
3535 (all_but_ext, all_but_tab_ext): these.
3536 (compute_base_names): Rename as...
3537 (compute_file_name_parts): this.
3538 Update to compute the new variables, including dir_prefix.
3539 Adjust dependencies.
3540 * src/output.c (prepare): Output them.
3541 * src/reader.c: Adjust to use gram_in, not finput.
3542 * src/scan-skel.l (@dir_prefix@): New.
3543
ad6a9b97
JMG
35442005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3545
3546 * lib/subpipe.c: New function end_of_output_subpipe() added
3547 to allow support for non-posix systems. This is a no-op function
3548 for posix systems.
3549
3550 * lib/subpipe.h: New function end_of_output_subpipe() added
3551 to allow support for non-posix systems. This is a no-op function
3552 for posix systems.
3553
3554 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
3555 handle the lack of pipe/fork functionality on non-posix systems.
3556
3557 * djgpp/Makefile.maint: DJGPP specific file.
3558
3559 * djgpp/README.in: DJGPP specific file.
3560
3561 * djgpp/config.bat: DJGPP specific configuration file.
3562
3563 * djgpp/config.sed: DJGPP specific configuration file.
3564
3565 * djgpp/config.site: DJGPP specific configuration file.
3566
3567 * djgpp/config_h.sed: DJGPP specific configuration file.
3568
3569 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
3570
3571 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
3572
fc695704
AD
35732005-10-02 Akim Demaille <akim@epita.fr>
3574
3575 * data/location.cc: New, extract from...
3576 * data/lalr1.cc: here.
3577 (location.hh): Include it after the user prologue, in case the
3578 filename type is defined by the user.
3579 Forward declation location and position before the pre-prologue.
3580 (yyresult_): Rename as...
3581 (yyresult): this, it's a local variable, not an attribute.
3582 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
3583
35842005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
3585
3586 * examples/extexi: Restore the #line generation.
3587
fb9712a9
AD
35882005-09-30 Akim Demaille <akim@epita.fr>,
3589 Alexandre Duret-Lutz <adl@gnu.org>
3590
3591 Move the token type and YYSTYPE in the parser class.
3592 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
3593 (parser::token): New, from the moved free definition of tokens.
3594 (parser::semantic_value): Now a full definition instead of an
3595 indirection to YYSTYPE.
3596 (b4_post_prologue): No longer included in the header file, but
3597 in the implementation file.
3598 * doc/bison.texi (C+ Language Interface): Update.
3599 * src/parse-gram.y: Support unary %define.
3600 * tests/actions.at: Define global_tokens_and_yystype for backward
3601 compatibility until we update the tests.
3602 * tests/calc.at: Idem.
3603 (first_line, first_column, last_line, last_column): Define for lalr1.cc
3604 to simplify the code.
3605
55f0c7b1
PE
36062005-09-29 Paul Eggert <eggert@cs.ucla.edu>
3607
3608 Port to SunOS 4.1.4, which lacks strtoul and strerror.
3609 Ah, the good old days! Problem reported by Peter Klein.
3610 * bootstrap (gnulib_modules): Add strerror, strtoul.
3611 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
3612 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
3613
fb9712a9 36142005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
3615
3616 * data/c.m4 (b4_error_verbose_if): New.
3617 * data/lalr1.cc: Use it.
3618 (YYERROR_VERBOSE_IF): Remove.
3619 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
3620 parser members, replaced by...
3621 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
3622 local variables.
3623 (yysyntax_error_): Takes the state number as argument.
3624 (yyreduce_print_): Use the argument yyrule, not the former
3625 attribute yyn_.
3626
8a6f72f3
PE
36272005-09-26 Paul Eggert <eggert@cs.ucla.edu>
3628
3629 * bootstrap (gnulib_modules): Add verify.
3630 * lib/.cvsignore: Add verify.h.
3631 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
3632 * src/system.h (verify): Remove.
3633 Include verify.h instead.
3634 * src/tables.c (tables_generate): Use new API for 'verify'.
3635
0d50976f
PE
36362005-09-21 Paul Eggert <eggert@cs.ucla.edu>
3637
ebc3737e
PE
3638 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
3639 local variables whose names begin with 'yy'.
3640 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
3641 Trivial changes from Joel E. Denny.
3642
0d50976f
PE
3643 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
3644 it itself.
3645 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
3646 don't use alloca any more.
3647
3648 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
3649 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 3650 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
3651 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
3652 to match yacc.c, to test more hosts.
3653
a05b79df
PE
36542005-09-20 Paul Eggert <eggert@cs.ucla.edu>
3655
55289366
PE
3656 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
3657 doesn't affect behavior.
3658 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
3659 Solaris, AIX, MSC.
3660 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
3661 This works a bit better with glibc, if user code has already included
3662 stdlib.h.
3663 * doc/bison.texinfo (Bison Parser): Document that users can't
3664 arbitrarily use malloc and free for other purposes. Document
3665 that <alloca.h> and <malloc.h> might be included.
3666 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
3667 user must declare alloca.
3668
a05b79df
PE
3669 * HACKING (release): Forwarn the Translation Project about
3670 stable releses.
3671
3ab2ca22
AD
36722005-09-20 Akim Demaille <akim@epita.fr>
3673
3674 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
3675
a9739e7c
PE
36762005-09-19 Paul Eggert <eggert@cs.ucla.edu>
3677
a702593e
PE
3678 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
3679 (YYSTACK_ALLOC_MAXIMUM): Use it.
3680 (yysyntax_error): New function.
3681 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
3682 multiple syntax errors are reported, and alloca is being used.
3683 Instead, reallocate buffers twice as big each time, so that
3684 we waste at most half the allocated memory. Start with a small
3685 (128-byte) buffer that will suffice in most cases anyway.
3686 Use yysyntax_error to do most of the work.
3687
3688 * doc/bison.texinfo (Error Reporting, Table of Symbols):
3689 yynerrs is the number of errors reported, not the number of
3690 errors encountered.
3691
a9739e7c
PE
3692 * tests/glr-regression.at (Duplicated user destructor for lookahead):
3693 Mark it as expected to fail.
3694 Cast result of malloc; problem reported by twlevo@xs4all.nl.
3695 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
3696 Don't start user-code symbols with "yy", to avoid name space problems.
3697
f479c6c6
AD
36982005-09-19 Akim Demaille <akim@epita.fr>
3699
3700 Remove the traits, failed experiment.
3701 It never proved useful, and anyway because of the current
3702 definition, it was not possible to have several specialization of
3703 this traits, making it useless.
3704 * data/lalr1.cc (yy:traits): Remove.
3705 Inline its definitions in the parser class.
3706
e2586f82
AD
37072005-09-19 Akim Demaille <akim@epita.fr>
3708
3709 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
3710 least Mac OSX with a /usr/local install of gettext.
3711
2e8cf949
AD
37122005-09-19 Akim Demaille <akim@epita.fr>
3713
3714 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
3715 and yytoken for similarity with the other skeletons.
3716
c7fb0b90
AD
37172005-09-19 Akim Demaille <akim@epita.fr>
3718
4e26c69e 3719 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 3720
1bd0deda
PE
37212005-09-16 Paul Eggert <eggert@cs.ucla.edu>
3722
3723 * NEWS: Version 2.1.
3724
3725 * NEWS: Remove notice of yytname change, since it was never in an
3726 official release.
3727 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
3728 diagnostic.
3729 * src/output.c (prepare): Likewise.
3730 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
3731 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
3732 is not defined. This is an awful hack, but it's enough for now.
3733 All callers changed.
3734 * tests/glr-regression-at (make_value): Args are const pointers now,
3735 to avoid GCC warning.
3736 (Duplicated user destructor for lookahead): New test. Currently
3737 skipped. It fails on my host but I'm not sure it'll always fail.
3738
37392005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
3740
3741 * src/symtab.h (struct symbol): Declare the printer and destructor
3742 as const, to avoid accidental calls to free.
3743 (symbol_destructor_set, symbol_printer_set): Adjust.
3744 * src/symtab.c: Adjust.
3745
1bd0deda 37462005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
3747
3748 * data/c.m4 (b4_token_enums): New.
3749 (b4_token_defines): Rename as...
3750 (b4_token_enums_defines): this.
3751 (b4_token_defines): New, output only the #defines.
3752 * data/yacc.c, data/glr.c: Adjust.
3753 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
3754 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
3755 as default values.
3756
dbcdae2d
AD
37572005-09-16 Akim Demaille <akim@epita.fr>
3758
3759 * data/lalr1.cc (yylex_): Remove, inline its code.
3760 (yyreport_syntax_error_): Remove, replaced by...
3761 (yysyntax_error_): this which returns a string and leaves to the
3762 caller the call to the users' error function.
3763 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
3764 Move from members of the parser object...
3765 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
3766 to local variables of the parse function.
3767
70d8f291
AD
37682005-09-16 Akim Demaille <akim@epita.fr>
3769
3770 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
3771 since it's in Bison's name space.
3772
b47dbebe
PE
37732005-09-15 Paul Eggert <eggert@cs.ucla.edu>
3774
ae199bf1
PE
3775 * data/glr.c (yyresolveValue): Add default case to pacify
3776 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
3777
b47dbebe
PE
3778 * NEWS: Document when yyparse started to return 2.
3779 * doc/bison.texinfo (Parser Function): Document when yyparse
3780 returns 2.
3781
3782 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
3783 (b4_filename_type): Renamed back from b4_file_name_type. All uses
3784 changed.
3785 (class position): file_name -> filename (reverting). All uses changed.
3786
37872005-09-14 Paul Eggert <eggert@cs.ucla.edu>
3788
3789 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
3790 do anything if $@ exists. This reverts part of the 2005-07-07
3791 patch.
3792
00292f66
PE
37932005-09-11 Paul Eggert <eggert@cs.ucla.edu>
3794
3795 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
3796 contains obsolete information and isn't worth distributing as a
3797 separate file anyway.
3798 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
3799 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
3800 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
3801 (yyparse): Abort if user code uses longjmp to throw an unexpected
3802 value.
3803
a420f962
PE
38042005-09-09 Paul Eggert <eggert@cs.ucla.edu>
3805
00292f66
PE
3806 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
3807 Suggested by twlevo@xs4all.nl.
3808
127287e9
PE
3809 * data/glr.c (YYCHK1): Do not assume YYE is in range.
3810 This avoids a diagnostic from gcc -Wswitch-enum.
3811 Problem reported by twlevo@xs4all.nl.
3812
a420f962
PE
3813 * doc/bison.texinfo: Don't use "filename", as per GNU coding
3814 standards. Use "file name" or "file" or "name", depending on
3815 the context.
3816 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
3817 not to hack/foo.tab.c.
3818 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
3819 * data/glr.c: b4_filename -> b4_file_name.
3820 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
3821 All uses changed.
3822 (class position): filename -> file_name. All uses changed.
3823 * data/yacc.c: b4_filename -> b4_file_name.
3824 * lib/bitset.h: filename -> file_name in local vars.
3825 * lib/bitset_stats.c: Likewise.
3826 * src/files.c: Likewise.
3827 * src/scan-skel.l ("@output ".*\n): Likewise.
3828 * src/files.c (file_name_split): Renamed from filename_split.
3829 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
3830
38312005-09-08 Paul Eggert <eggert@cs.ucla.edu>
3832
3833 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
3834 to accommodate latest gnulib.
3835
3836 * tests/glr-regression.at (Duplicate representation of merged trees):
3837 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
3838
3839 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
3840 needed.
3841
42a6501d
PE
38422005-08-26 Paul Eggert <eggert@cs.ucla.edu>
3843
3844 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
3845 All uses changed. Invoke user destructor after an error during a
3846 split parse (trivial change from Joel E. Denny).
3847
3848 * tests/glr-regression.at
3849 (User destructor after an error during a split parse): New test case.
3850 Problem reported by Joel E. Denny in:
3851 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
3852
ef9a1faf
PE
38532005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3854
5b4aaf78
PE
3855 * README-cvs: Give URLs for recommended tools.
3856 Mention Gzip version problem, and bootstrapping issues.
3857 Remove troubleshooting section, as it's somewhat obsolete.
3858
b5240ba5
PE
3859 * bootstrap (no_cache): New var, to accommodate different wget
3860 variants. Use it instead of '-C off'. Problem reported by
3861 twlevo@xs4all.nl.
3862
ef9a1faf
PE
3863 * data/glr.c (yydestroyStackItem): New function.
3864 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
3865 debugging information. Problem reported by Joel E. Denny.
3866
e6efa9da
AD
38672005-08-25 Akim Demaille <akim@epita.fr>
3868
3869 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
3870
adc90f13
PE
38712005-08-24 Paul Eggert <eggert@cs.ucla.edu>
3872
3873 * data/glr.c (yyrecoverSyntaxError, yyreturn):
3874 Don't invoke destructor on unresolved entries.
3875 * tests/glr-regression.at
3876 (User destructor for unresolved GLR semantic value): New test case.
3877 Problem reported by Joel E. Denny in:
3878 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
3879
f9315de5
PE
38802005-08-21 Paul Eggert <eggert@cs.ucla.edu>
3881
15d29c1f
PE
3882 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
3883 Add strnlen.c.
3884 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
3885 lib-prefix.m4, po.m4.
3886
dd5f2af2
PE
3887 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
3888 in yydestruct diagnostic, since it might not be an error.
3889 Problem reported by Joel Denny near end of
3890 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 3891 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
3892 * data/yacc.c (yyreturn): Likewise.
3893 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
3894
3895 * src/files.c: Remove obsolete FIXME comment.
3896
3897 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
3898 with the other templates, and to fix bogus run-on messages such
3899 as the one reported at the end of
3900 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
3901 All callers changed to avoid the newline.
3902 (yyprocessOneStack): Output two lines rather than one, to accommodate
3903 the above change. This changes the debug output format slightly.
3904
f9315de5
PE
3905 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
3906 reported by Joel E. Denny in
3907 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
3908 (trivial change).
3909 * tests/glr-regression.at (Duplicate representation of merged trees):
3910 New test, from Joel E. Denny in:
3911 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
3912 * THANKS: Add Joel E. Denny.
3913
3914 * configure.ac (AC_INIT): Bump to 2.0c.
3915
04098407
PE
39162005-07-24 Paul Eggert <eggert@cs.ucla.edu>
3917
3918 * NEWS: Version 2.0b.
3919
ca5d2013
PE
3920 * Makefile.am (SUBDIRS): Put examples before tests, so that
3921 "make check" doesn't finish with "All 1 tests passed".
3922
3d54b576
PE
3923 * tests/regression.at (Token definitions): Don't rely on
3924 AT_PARSER_CHECK for data that contains backslashes. It currently
3925 uses 'echo', and 'echo' isn't portable if its argument contains
3926 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
3927 that the byte '\0xff' is not printable in the C locale; it is,
3928 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
3929 not printable, so use '\0x81' to test.
3930
d53ae497
PE
3931 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
3932 version of GCC, since the macro is used with non-GCC compilers.
3933
fc01665e
PE
3934 Fix core dump reported by Pablo De Napoli in
3935 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
3936 * tests/regression.at (Invalid inputs with {}): New test.
3937 * src/parse-gram.y (token_name): Translate type before using
3938 it as an index.
3939
04098407
PE
3940 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
3941 the user's name space. All uses changed to __attribute__
3942 ((__unused__)).
3943 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
3944 Add __attribute__ ((__noreturn__)).
3945
3946 * etc/clcommit: Remove. We weren't using it, and it failed
3947 "make maintainer-distcheck".
3948 * Makefile.maint: Merge from coreutils.
3949 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
3950 (syntax-check-rules): Change list of rules as described below.
3951 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
3952 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
3953 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
3954 (sc_trailing_space): New rules.
3955 (sc_xalloc_h_in_src): Remove.
3956 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
3957 (sc_space_tab, sc_error_exit_success, sc_changelog):
3958 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
3959 (makefile-check, po-check, author_mark_check):
3960 (makefile_path_separator_check, copyright-check):
3961 Use grep -n, to make it easier to find violations.
3962 Use CVS_LIST and CVS_LIST_EXCEPT.
3963 (header_regexp, h_re): Remove.
3964 (dd_c): New macro.
3965 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
3966 (my-distcheck): Use more-modern GCC flags.
3967 (signatures, %.asc): Remove.
3968 (rel-files, announcement): Remove signatures.
3969 Restore old updating code, even though we don't use it, so
3970 that we're the same as coreutils.
3971 (alpha, beta, major): Depend on news-date-check.
3972 Make the upload commands.
3973
3974 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
3975 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
3976 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
3977 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
3978 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
3979 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
3980 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
3981 * tests/sets.at: Likewise.
3982
3983 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
3984 we comment out the Autoconf version number.
3985 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
3986 it's error-prone and "make maintainer-distcheck" rejects it.
3987
3988 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
3989 Indent calls to "error" to pacify "make maintainer-distcheck",
3990 when the calls are not intended to be translated.
3991 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
3992
3993 * src/Makefile.am (DEFS): Use +=, to pacify
3994 "make maintainer-distcheck".
3995 (bison_SOURCES): Add scan-skel.h.
3996 (sc_tight_scope): New rule, from coreutils.
3997
3998 * src/files.c (src_extension, header_extension):
3999 Now static, not extern.
4000 * src/getargs.c (short_options): Likewise.
4001 * src/muscle_tab.c (muscle_table): Likewise.
4002 * src/parse-gram.y (current_class, current_type, current_prec):
4003 Likewise.
4004 * src/reader.c (grammar_end, previous_rule_end): Likewise.
4005 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
4006 * src/main.c (main): Cast bindtextdomain and textdomain calls to
4007 void, to avoid warning when NLS is disabled.
4008 * src/output.c: Include scan-skel.h.
4009 (scan_skel): Remove decl, since scan-skel.h does this.
4010 (output_skeleton):
4011 Indent calls to "error" to pacify "make maintainer-distcheck".
4012 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
4013 * src/reader.h (gram_end, gram_lineno): New decls to pacify
4014 "make maintainer-distcheck".
4015 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
4016 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
4017 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
4018 (skel_lex_destroy, scan_skel): Move these decls to...
4019 * src/scan-skel.h: New file.
4020 * src/uniqstr.c (uniqstr_assert):
4021 Indent calls to "error" to pacify "make maintainer-distcheck".
4022
4023 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
4024 not @VAR@.
4025
4026 * tests/torture.at: Revamp to avoid misuse of atoi that
4027 "make maintainer-distcheck" complained about.
4028
4029 * examples/extexi (message): Don't print a message more than once,
4030 and omit line-number decoration that makes Emacs compile think
4031 that informative messages are worth worrying about.
4032
40332005-07-22 Paul Eggert <eggert@cs.ucla.edu>
4034
4035 * configure.ac: Update version number.
4036
4037 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
4038 accidentally.
4039 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
4040 autogenerated by the maintainer.
4041 * examples/calc++/.cvsignore: Add *.yy.
4042
4043 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
4044 * lib/bitset_stats.c (bitset_stats_init): Likewise.
4045 * lib/bitsetv.c (bitsetv_alloc): Likewise.
4046
4047 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
4048
4049 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
4050 from maintainer-distcheck about casting the argument of 'free'.
4051
4052 * NEWS: Mention recent yytname changes.
4053 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
4054
4055 * bootstrap: For translations that have not yet been upgraded to
4056 the new runtime-po domain, prime the pump by extracting the
4057 relevant strings from the obsolete translations. This code can be
4058 removed once the bison-runtime domain has been translated by each
4059 team.
4060
4061 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
4062 now that token names are already quoted.
4063
4064 Fix problem reported by Anthony Heading.
4065 * data/glr.c (YYTOKEN_TABLE): New macro.
4066 (yytname): Define if YYTOKEN_TABLE.
4067 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
4068 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
4069 (YYERROR_VERBOSE): Define the same way the other skeletons do.
4070 * src/output.c (prepare_symbols): Output token_table_flag.
4071
0ffda363
PE
40722005-07-21 Paul Eggert <eggert@cs.ucla.edu>
4073
4074 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
4075 again if the first call fails.
4076
4077 * data/glr.c (yytnamerr): New function.
4078 (yyreportSyntaxError): Use it to dequote most string literals.
4079 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
4080 with other skeletons. All uses changed.
4081 (yytnameerr_): New function.
4082 (yyreport_syntax_error): Use it to dequote most string literals.
4083 * data/yacc.c (yytnamerr): New function.
4084 (yyerrlab): Use it to decode most string literals.
4085 * doc/bison.texinfo (Decl Summary, Calling Convention):
4086 Clarify quoting convention of yytname.
4087 * src/output.c (prepare_symbols): Quote all names. This undoes
4088 the 2005-04-17 change, which is now accomplished (mostly) via
4089 changes in the parsers as described above.
4090 * tests/regression.at (Token definitions, Web2c Actions):
4091 Undo most 2005-04-17 change here, too.
4092
40932005-07-20 Paul Eggert <eggert@cs.ucla.edu>
4094
4095 Fix more problems reported by twlevo@xs4all.nl.
4096 * tests/cxx-type.at: Don't pipe output of ./types through sed to
4097 remove trailing spaces. This loses the exit status of ./types,
4098 and isn't needed since ./types shouldn't be emitting trailing
4099 spaces.
4100 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
4101 as the stack isn't valid in that case.
4102
4103 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4104 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4105 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4106 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
4107 is used.
4108 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
4109 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
4110 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
4111 Likewise.
4112
4113 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
4114 overly-picky compilers that reject 'char *foo = "bar";'.
4115
4116 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
4117 to FILE * parameter, not to stderr. This fixes a typo introduced
4118 in the 2005-07-12 change.
4119
4120 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
4121 warnings from GCC 4.
4122
4123 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
4124 (yyglrShiftDefer, yysplitStack):
4125 Remove unused parameters b4_pure_formals. All uses changed.
4126 (yyglrShift): Remove unused parameters b4_user_formals.
4127 All uses changed.
4128 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
4129
6100a9aa
PE
41302005-07-18 Paul Eggert <eggert@cs.ucla.edu>
4131
258b75ca
PE
4132 Destructor cleanups and regularization among the three skeletons.
4133 * NEWS: Document the behavior changes.
4134 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
4135 stack before failing, as the cleanup code will do it for us now.
4136 * data/lalr1.cc (yyerrlab): Likewise.
4137 * data/glr.c (yyparse): Pop everything off the stack before
4138 freeing it, so that destructors get called properly.
4139 * data/lalr1.cc (yyreturn): Likewise.
4140 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
4141 This is more consistent.
4142 * doc/bison.texinfo (Destructor Decl): Mention more reasons
4143 why destructors might be called. 1.875 -> 2.1.
4144 (Destructor Decl, Decl Summary, Table of Symbols):
4145 Some English-language cleanups for %destructor.
4146 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
4147 Add output line for destructor of start symbol.
4148 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
4149 because of that same extra output line.
4150
1a059451
PE
4151 * NEWS: Document minor wording changes in diagnostics of
4152 Bison-generated parsers.
4153 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
4154 Remove unused formals. All uses changed.
4155 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
4156 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
4157 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
4158 Rename yyoverflowab to yyexhaustedlab.
4159 When memory exhaustion occurs during syntax-error reporting,
4160 report it separately rather than in a single diagnostic; this
4161 eases translation.
4162 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
4163 (Memory Exhausted): Renamed from Parser Stack Overflow.
4164 Revamp wording slightly to prefer "memory exhaustion".
4165 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
4166
97460c78
PE
4167 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
4168
30757c8c
PE
4169 Add i18n support to the GLR skeleton. Partially fix the C++
4170 skeleton; a C++ expert needs to finish this. Remove debugging
4171 msgids; there's little point to having them translated, since they
4172 can be understood only by someone who can read the
4173 (English-language) source code.
4174
4175 Generate runtime-po/bison-runtime.pot automatically, so that we
4176 don't have to worry about garbage getting in that file. We'll
4177 make sure after the next official release that old msgids don't
4178 get lost. See
4179 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
4180
4181 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
4182 Now auto-generated.
4183 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
4184 Fix typos in explanations of the runtime file.
4185 * bootstrap: Change gettext keyword from YYI18N to YY_.
4186 Use standard Makefile.in.in in runtime-po, since we'll arrange
4187 for backward-compatible bison-runtime.po files in a different way.
4188 * data/glr.c (YY_): New macro, from yacc.c.
4189 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
4190 Translate messages intended for users.
4191 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
4192 the wording in the other skeletons. We don't know that the memory
4193 is virtual.
4194 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
4195 Use same method that yacc.c uses.
4196 Don't translate debugging messages.
4197 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
4198 it doesn't work (yet), and requires C++ expertise to fix.
4199 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
4200 Move defn to a more logical place, to be consistent with other
4201 skeletons.
4202 Don't translate debugging messages.
4203 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
4204 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
4205 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
4206 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
4207
ac8c5689
PE
4208 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
4209 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
4210 void, not int.
4211 * tests/glr-regression.at (Badly Collapsed GLR States):
4212 Likewise.
4213 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4214 yylex should return 0 at EOF rather than aborting.
4215
6100a9aa
PE
4216 Improve tests for stack overflow in GLR parser.
4217 Problem reported by twlevo@xs4all.nl.
4218 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
4219 All uses removed.
4220 (yyStackOverflow): Just longjmp, but with value 2 so that caller
4221 can handle the problem.
4222 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
4223 (yyparse): New local variable yyresult to record the result.
4224 Use result of setjmp to set it, rather than storing itinto
4225 struct.
4226 (yyDone): Remove label.
4227 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
4228 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
4229 if YYABORT is used).
4230 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
4231 yyparse status; put status > 1 into diagnostic.
4232 Check that status==2 works.
4233 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
4234 Use exit status 3 for failure to open (which shouldn't happen).
4235
15f40952
PE
42362005-07-17 Paul Eggert <eggert@cs.ucla.edu>
4237
67fd79c4
PE
4238 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
4239 1 on syntax error; just let yyparse do its thing.
4240 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
4241 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
4242 (Exploding the Stack Size with Alloca):
4243 (Exploding the Stack Size with Malloc):
4244 Expect exit status 2, not 1, since the parser is supposed to blow
4245 its stack. Problem reported by twlevo@xs4all.nl.
4246
15f40952
PE
4247 * data/glr.c (yyparse): Don't assume that the initial calls
4248 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
4249 Print a stack-overflow message and fail instead.
4250 Initialize the line-number information before creating the stack,
4251 so that the stack-overflow message can report line zero safely.
4252
f32c66b5
PE
42532005-07-14 Paul Eggert <eggert@cs.ucla.edu>
4254
a22ff96f 4255 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
4256 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
4257 (yyuserMerge): Provide a default case if b4_mergers is empty.
4258 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
4259 * tests/glr-regression.at
4260 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 4261 Add casts to pacify C++ compilers.
1beb0b24
PE
4262 * tests/glr-regression.at (Improper merging of GLR delayed action
4263 sets): Declare yylex before using it.
f32c66b5 4264 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
4265 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
4266 test for valgrind; valgrind is independent of g++.
4267 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
4268 for compatibility with POSIX 1003.1-2001 (if running coreutils).
4269 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
4270 Use a destructor, so that we can expand the stack. Change
4271 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 4272
d741bd1b
PE
42732005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4274
4275 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
4276 a valgrind failure. Problem reported by twlevo@xs4all.nl.
4277
0410a6e0
PE
42782005-07-13 Paul Eggert <eggert@cs.ucla.edu>
4279
4280 * PACKAGING: New file, suggested by Bruno Haible and taken from
4281 similar wording in gettext's PACKAGING file.
4282 * NEWS: Mention PACKAGING.
4283 * Makefile.am (EXTRA_DIST): Add PACKAGING.
4284
f7ab6a50
PE
42852005-07-12 Paul Eggert <eggert@cs.ucla.edu>
4286
baf785db 4287 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
4288 * bootstrap: Get runtime translations into runtime-po.
4289 Create runtime-po files automatically, if possible.
4290 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
4291 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
4292 does not infringe on the user's name space.
4293 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
4294 * doc/bison.texinfo (Internationalization): Revamp the English
4295 and Texinfo syntax a bit, to try to make it clearer.
4296 (Bison Options, Option Cross Key): Mention --print-localedir.
4297 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
4298 YYENABLE_NLS. Quote a bit more.
4299 * runtime-po/.cvsignore: New file.
4300 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
4301 * runtime-po/Rules-quot: Remove; now created by bootstrap.
4302 * runtime-po/quot.sed: Likewise.
4303 * runtime-po/boldquot.sed: Likewise.
4304 * runtime-po/en@quot.header: Likewise.
4305 * runtime-po/en@boldquot.header: Likewise.
4306 * runtime-po/insert-header.sin: Likewise.
4307 * runtime-po/remove-potcdate.sin: Likewise.
4308 * runtime-po/Makevars: Likewise.
4309 * runtime-po/LINGUAS: Likewise.
4310 * runtime-po/de.po: Likewise; we will rely on the translation project
4311 to maintain this, so "bootstrap" should get it.
0410a6e0 4312 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
4313 its value.
4314 * src/main.c (main): Bind the bison-runtime domain, too.
4315
43162005-07-12 Bruno Haible <bruno@clisp.org>
4317
4318 * data/yacc.c: Include <libintl.h> when NLS is enabled.
4319 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
4320 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
4321 * runtime-po: New directory.
4322 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
4323 $(DOMAIN).pot-update rule, so that old messages are never dropped.
4324 * runtime-po/Rules-quot: New file, copied from po/.
4325 * runtime-po/quot.sed: Likewise.
4326 * runtime-po/boldquot.sed: Likewise.
4327 * runtime-po/en@quot.header: Likewise.
4328 * runtime-po/en@boldquot.header: Likewise.
4329 * runtime-po/insert-header.sin: Likewise.
4330 * runtime-po/remove-potcdate.sin: Likewise.
4331 * runtime-po/Makevars: New file.
4332 * runtime-po/POTFILES.in: New file.
4333 * runtime-po/LINGUAS: New file.
4334 * runtime-po/bison-runtime.pot: New file.
4335 * runtime-po/de.po: New file.
4336 * m4/bison.m4: New file.
4337 * Makefile.am (SUBDIRS): Add runtime-po.
4338 (aclocaldir, aclocal_DATA): New variables.
4339 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
4340 Define aclocaldir.
4341 * src/getargs.c (usage): Document --print-localedir option.
4342 (PRINT_LOCALEDIR_OPTION): New enum item.
4343 (long_options): Add --print-localedir option.
4344 (getargs): Handle --print-localedir option.
4345 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
4346 (Internationalization): New section.
4347
22dda0f0
AD
43482005-07-12 Akim Demaille <akim@epita.fr>
4349
4350 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
4351 for consistency with the rest of the code.
4352 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
4353 Add separators.
4354
82b248ad
AD
43552005-07-12 Akim Demaille <akim@epita.fr>
4356
4357 * src/parse-gram.y: Use %printer instead of YYPRINT.
4358
fa0e9314
AD
43592005-07-12 Akim Demaille <akim@epita.fr>
4360
867a3e00
AD
4361 * src/symtab.h, src/symtab.c (symbol_print): New.
4362 * src/symlist.h, src/symlist.c (symbol_list_print): New.
4363 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
4364
43652005-07-12 Akim Demaille <akim@epita.fr>
4366
4367 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
4368 b4_at_dollar and b4_dollar_dollar.
4369
e054b190
PE
43702005-07-11 Paul Eggert <eggert@cs.ucla.edu>
4371
4372 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
4373 and Pennello's paper.
4374
34160ec4
PE
43752005-07-09 Paul Eggert <eggert@cs.ucla.edu>
4376
407d4a75
PE
4377 * data/yacc.c (yyparse): Undo previous patch. Instead,
4378 set yylsp[0] and yyvsp[0] only if the initial action
4379 sets yylloc and yylval, respectively.
4380
34160ec4
PE
4381 * data/yacc.c (yyparse): In the initial action, set
4382 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
4383 This avoids the use of undefined variables if the initial
4384 action does not set yylloc and/or yylval.
4385
c3d5a4a7
PE
43862005-07-07 Paul Eggert <eggert@cs.ucla.edu>
4387
b34d96c1
PE
4388 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
4389 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
4390 Remove from CVS. These files are automatically generated.
4391 * examples/extexi: Clarify that this file is now part of Bison,
4392 not GNU M4, and that it works with any POSIX-compatible Awk.
4393 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
4394 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
4395 so that we also get calc++-parser.yy. Geneate it.
4396 Use $(AWK), not gawk, since any conforming Awk will do.
4397 Put comment before action, since older 'make' can't handle comment
4398 in action.
4399 $(BUILT_SOURCES): List all built sources, not just some of them.
4400 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
4401 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
4402 $($(calc_sources_generated)): Remove unnecessary test for existence
4403 of target. (This had a shell syntax error anyway; a stray "x".)
4404 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
4405 calc++-parser.yy.
4406 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
4407
c3d5a4a7
PE
4408 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
4409 implied by the other modules.
4410
828c373b
AD
44112005-07-06 Akim Demaille <akim@epita.fr>
4412
4413 Bind examples/calc++ to the package.
4414 * examples/calc++/Makefile: Remove, replaced by...
4415 * examples/calc++/Makefile.am: ... this new file.
4416 * examples/calc++/test: Remove input.
4417 * examples/calc++/compile: Remove.
4418 * examples/Makefile.am: New.
4419 * configure.ac, Makefile.am: Adjust.
4420 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
4421
63cb01d6
PE
44222005-07-05 Paul Eggert <eggert@cs.ucla.edu>
4423
fd2df2ed
PE
4424 * data/glr.c (yyFail): Drastically simplify; since the format argument
4425 never had any % directives, we can simply pass it to yyerror.
4426 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
4427 be modified later, as that is the usual style in glr.c.
4428 Problems reported by Paul Hilfinger.
4429
63cb01d6
PE
4430 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
4431 and size overflow errors.
4432 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
4433 in case the user prolog sets feature-test macros like _GNU_SOURCE.
4434 (YYSIZEMAX): New macro.
4435 (yystpcpy): New function, taken from yacc.c.
4436 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
4437 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
4438 so that we don't have to maintain their signatures.
4439 (yyFail): Check for buffer overflow, by using vsnprintf rather
4440 than vsprintf. Allocate a bigger buffer if possible.
4441 Report an error if buffer allocation fails.
4442 (yyStackOverflow): New function.
4443 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
4444 the initialization was successful. It might fail if storage was
4445 exhausted.
4446 (yyexpandGLRStack): Add more checks for storage allocation failure.
4447 Use yyStackOverflow to report failures.
4448 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
4449 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
4450 Don't assume stack number fits in int.
4451 (yysplitStack): Check for storage allocation failure.
4452 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
4453 can print diagnostics on storage allocation failure. All callers
4454 changed.
4455 (yyresolveValue): Use yybool for boolean.
4456 (yyreportSyntaxError): Check for size-calculation overflow.
4457 This code is taken from yacc.c.
4458 (yyparse): Check for storage allocation errors when allocating
4459 the initial stack.
4460
1c59e0a1
AD
44612005-07-05 Akim Demaille <akim@epita.fr>
4462
4463 Extract calc++ from the documentation.
4464 * doc/bison.texinfo (Calc++): Add the extraction marks.
4465 * examples/extexi: New, from the aborted GNU Programming 2E.
4466 Separate the different paragraph of a file with empty lines.
4467 * examples/Makefile: Use it to extract the whole calc++ example.
4468
8a0adb01
AD
44692005-06-24 Akim Demaille <akim@epita.fr>
4470
4471 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
4472 class typedefs.
4473
12545799
AD
44742005-06-22 Akim Demaille <akim@epita.fr>
4475
4476 * doc/bison.texinfo (C++ Language Interface): First stab.
4477 (C++ Parsers): Remove.
4478
99be0235
AD
44792005-06-22 Akim Demaille <akim@epita.fr>
4480
4481 * data/lalr1.cc (yylex_): Honor %lex-param.
4482
0ffd4fd1
AD
44832005-06-22 Akim Demaille <akim@epita.fr>
4484
4485 Start a set of simple examples.
4486 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
4487 * examples/calc++/calc++-driver.hh,
4488 * examples/calc++/calc++-parser.yy,
4489 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
4490 * examples/calc++/compile, examples/calc++/test: New.
4491
0925ebb4
PE
44922005-06-09 Paul Eggert <eggert@cs.ucla.edu>
4493
4494 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
4495 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
4496 which stems from the 2005-05-27 patch.
4497
43d3b664
PH
44982005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4499
4500 * data/glr.c: Modify treatment of unused parameters to permit use
4501 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
4502
3062864d
PE
45032005-05-30 Paul Eggert <eggert@cs.ucla.edu>
4504
4505 Fix infringement on user name space reported by Janos Zoltan Szabo.
4506 * data/yacc.c (yyparse): strlen -> yystrlen.
4507
989b5b8e
AD
45082005-05-30 Akim Demaille <akim@epita.fr>
4509
4510 * data/lalr1.cc (_): New.
4511 Translate the various messages.
4512
bedf57f5
PE
45132005-05-27 Paul Eggert <eggert@cs.ucla.edu>
4514
4515 Fix infringement on user name space reported by Bruno Haible.
4516 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
4517 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
4518 the user's name space.
4519 (alloca): Include <stdlib.h> to get it, if it's not built in.
4520 (YYMALLOC, YYFREE): Define only if needed.
4521 (malloc, free): Declare, but only if needed, as this infringes on
4522 the user name space.
4523
4d1801f1
PE
45242005-05-25 Paul Eggert <eggert@cs.ucla.edu>
4525
4526 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
4527 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
4528 with %d format.
4529 * lib/ebitset.c (min, max): Undef before defining.
4530 * lib/vbitset.c (min, max): Likewise.
4531 * lib/subpipe.c (create_subpipe): Save local variables in case
4532 vfork clobbers them.
4533
45342005-05-24 Bruno Haible <bruno@clisp.org>
4535
4536 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
4537 error message syntax used by gcc-4.0.
4538
b94a9e1e
PE
45392005-05-23 Paul Eggert <eggert@cs.ucla.edu>
4540
85ac3861
PE
4541 * README: Mention m4 1.4.3. Remove obsolete advice about
4542 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
4543
b94a9e1e
PE
4544 * bootstrap: Remove workaround for problem I encountered with
4545 gettext 0.14.1; it seems to be fixed now.
4546
51c30d21
PE
45472005-05-22 Paul Eggert <eggert@cs.ucla.edu>
4548
009ce67d
PE
4549 * NEWS: Version 2.0a.
4550
f2a97c62
PE
4551 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
4552 the previous change.
4553
c8775f93
PE
4554 Various maintainer cleanups.
4555 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
4556 conftest*, for benefit of CVS commands run at the same time as
4557 "configure". Add build-aux, since "bootstrap" now creates it and
4558 its subfiles.
4559 * Makefile.cfg (move_if_change): Remove.
4560 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
4561 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
4562 (po_repo, do-po-update, po-update, wget_files, get-targets):
4563 (config.guess-url_prefix, config.sub-url_prefix):
4564 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
4565 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
4566 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
4567 Remove.
4568 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
4569 this is now the recommended name.
4570 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
4571 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
4572 ylwrap. These files now go into build-aux.
4573 * config/move-if-change: Remove.
4574 * config/prev-version.txt: Bump from 1.75 to 2.0.
4575
3ea5f0ec
PE
4576 * bootstrap: Add stdio-safer, unistd-safer modules.
4577 Remove m4/glibc2.m4 (introduced by latest gnulib, but
4578 we don't need it).
4579 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
4580 fopen-safer.c, stdio-safer.h, unistd-safer.h.
4581 * lib/subpipe.c: Include "unistd-safer.h".
4582 (create_subpipe): Make sure all the newly-created
4583 file descriptors are > 2, so that diagnostics don't
4584 get sent down them (which might cause Bison to hang, in theory).
4585 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
4586 * src/files.c (xfopen): Use fopen_safer, not fopen.
4587
51c30d21
PE
4588 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
4589 yesterday's yacc.c fix.
4590
cea1469d
PE
45912005-05-21 Paul Eggert <eggert@cs.ucla.edu>
4592
3ea5f0ec
PE
4593 * data/glr.c, data/lalr1.cc: Update copyright date.
4594
cea1469d
PE
4595 Fix a destructor bug reported by Wolfgang Spraul in
4596 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
4597 * data/yacc.c (yyabortlab): Don't call destructor, and
4598 don't set yychar to EMPTY.
4599 (yyoverflowlab): Don't call destructor.
4600 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
4601 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
4602 since we no longer output the message "discarding lookahead token
4603 end of input ()".
4604
5e6f62f2
PH
46052005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4606
4607 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
4608 fix a small glitch in debugging output.
4609 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
4610 after YY_SYMBOL_PRINT where needed.
4611
4612 (struct yyGLRState): Add some comments.
4613 (struct yySemanticOption): Add some comments.
4614 (union yyGLRStackItem): Add comment.
4615
4616 (yymergeOptionSets): Correct this to properly perform the union,
4617 avoiding infinite reported by Michael Rosien.
4618 Update comment.
4619
4620 * tests/glr-regression.at: Add test for GLR merging error reported
4621 by M. Rosien.
cea1469d 4622
0fb669f9
PE
46232005-05-13 Paul Eggert <eggert@cs.ucla.edu>
4624
4625 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
4626 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
4627 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
4628 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
4629 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
4630 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
4631 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
4632 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
4633 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
4634 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
4635 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
4636 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
4637 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
4638 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
4639 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
4640 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
4641 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
4642 src/derives.h, src/files.c, src/files.h, src/getargs.c,
4643 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
4644 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
4645 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
4646 src/output.h, src/parse-gram.c, src/parse-gram.h,
4647 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
4648 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
4649 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
4650 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
4651 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
4652 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
4653 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
4654 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
4655 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
4656 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
4657 tests/reduce.at, tests/regression.at, tests/sets.at,
4658 tests/synclines.at, tests/testsuite.at, tests/torture.at:
4659 Update FSF postal mail address.
4660
51f4735e
PE
46612005-05-11 Paul Eggert <eggert@cs.ucla.edu>
4662
4663 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
4664 Problem reported by Ralf Menzel.
4665
80ce3401
PE
46662005-05-01 Paul Eggert <eggert@cs.ucla.edu>
4667
4668 * tests/actions.at: Test that stack overflow invokes destructors.
4669 From Marcus Holland-Moritz.
4670 * data/yacc.c (yyerrlab): Move the code that destroys the stack
4671 from here....
4672 (yyreturn): to here. That way, destructors are called properly
4673 even if the stack overflows, or the user calls YYACCEPT or
4674 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
4675 (yyoverflowlab): Destroy the lookahead.
4676
46772005-04-24 Paul Eggert <eggert@cs.ucla.edu>
4678
4679 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
4680
72f000b0
PE
46812005-04-17 Paul Eggert <eggert@cs.ucla.edu>
4682
4683 * NEWS: Bison-generated C parsers no longer quote literal strings
4684 associated with tokens.
4685 * src/output.c (prepare_symbols): Don't escape strings,
4686 since users don't want to see C escapes.
4687 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
4688 in diagnostics.
c19683bb 4689 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
4690 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
4691
1094323f
PE
46922005-04-16 Paul Eggert <eggert@cs.ucla.edu>
4693
4694 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
4695 the data size is known to be too small and we can't increase it.
4696 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
4697
ca407bdf
PE
46982005-04-15 Paul Eggert <eggert@cs.ucla.edu>
4699
4700 * src/parse-gram.y: Include quotearg.h.
4701 (string_as_id): Quote $1 before using it as a key, since the
4702 lexer no longer quotes it for us.
4703 (string_content): Don't strip quotes, since lexer no longer
4704 quotes it for us.
4705 * src/scan-gram.l: Include quotearg.h.
4706 ("\""): Omit quote.
4707 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
4708 a key, since the rest of the lexer doesn't quote it.
4709 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
4710 * tests/regression.at (Token definitions): Check for backslashes
4711 in token strings.
4712
4713 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
4714 (YYSIZE_T): Define to unsigned long int when using an older compiler.
4715 (yyparse): Revamp code to generate long syntax error message, to
4716 make it easier to translate, and to avoid problems with arithmetic
4717 overflow. Change "virtual memory" to "memory" in diagnostic, since
4718 we don't know whether the memory is virtual.
4719
1ce59070
PE
47202005-04-13 Paul Eggert <eggert@cs.ucla.edu>
4721
4722 * NEWS: Bison-generated C parsers now use the _ macro to
4723 translate strings.
4724 * data/yacc.c (_) [!defined _]: New macro.
4725 All English strings wrapped inside this macro.
4726 * doc/bison.texinfo (Bison Parser): Document _.
4727 * po/POTFILES.in: Include src/parse-gram.c, since it now
4728 includes translateable strings that parse-gram.y doesn't.
4729
a749a695
PE
47302005-04-12 Paul Eggert <eggert@cs.ucla.edu>
4731
4732 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
4733 reverting the 2004-10-11 change to this function.
4734 (symbol_check_alias_consistency): Don't call symbol_type_set
4735 if the type name is already correct.
4736 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
4737
8fb1053b
PE
47382005-03-25 Paul Eggert <eggert@cs.ucla.edu>
4739
4740 * tests/regression.at (Token definitions): Don't use a token named
4741 c, as that generates a "#define c ..." that runs afoul of buggy
4742 stdlib.h that uses the identifier c as a member of struct
4743 drand48_data. Problem reported by Horst Wente.
4744
ff498c4a
PE
47452005-03-21 Paul Eggert <eggert@cs.ucla.edu>
4746
4747 * bootstrap: Change translation URL from
4748 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
4749 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
4750 redirection glitches. Problem reported by twlevo@xs4all.nl.
4751
65211d70
PE
47522005-03-20 Paul Eggert <eggert@cs.ucla.edu>
4753
4754 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
4755 after operands; POSIX says this isn't portable for the c99 command.
4756
9577fb1f
PE
47572005-03-18 Paul Eggert <eggert@cs.ucla.edu>
4758
4759 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
4760 immediately if a data overrun has occurred; this may help us track
4761 down what may be a spurious failure on MacOS.
4762
78b178f7
PE
47632005-03-17 Paul Eggert <eggert@cs.ucla.edu>
4764
a2599d0f
PE
4765 Respond to problems reported by twlevo@xs4all.nl.
4766
4767 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
4768
78b178f7
PE
4769 * src/vcg.h: Comment fix.
4770 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
4771 (G_CMAX): Change to -1 instead of INT_MAX.
4772
4773 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 4774
7296e729
PE
47752005-03-15 Paul Eggert <eggert@cs.ucla.edu>
4776
4777 * src/tables.c (state_number_to_vector_number): Put it inside an
4778 "#if 0", since it's not currently used. Problem reported by
4779 Roland McGrath.
4780
05ac60f3
PE
47812005-03-06 Paul Eggert <eggert@cs.ucla.edu>
4782
4783 * src/output.c (escaped_output): Renamed from
4784 escaped_file_name_output, since we now use it for symbol tags as
4785 well. All uses changed.
4786 (symbol_destructors_output, symbol_printers_output):
4787 Escape symbol tags too.
4788 Problem reported by Matyas Forstner in
4789 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
4790
4791 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
4792 not needed.
4793 * src/output.c (user_actions_output, token_definitions_output,
4794 symbol_destructors_output, symbol_printers_output): Likewise.
4795 * src/reader.c (prologue_augment): Likewise.
4796 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
4797
4798 * src/vcg.c (output_edge): Don't quote linestyle arg.
4799 Problem reported by twlevo@xs4all.nl.
4800
7eb453ac
PE
48012005-02-28 Paul Eggert <eggert@cs.ucla.edu>
4802
4803 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
4804 example, reported by Derek M Jones. Also, make the example even
4805 more outrageous, to better illustrate how bad the problem is.
4806
4c04c52a
PE
48072005-02-24 Paul Eggert <eggert@cs.ucla.edu>
4808
4809 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
4810 putsym. Typo reported by Sebastian Piping.
4811
a61e1620
PE
48122005-02-23 Paul Eggert <eggert@cs.ucla.edu>
4813
4814 * doc/bison.texinfo (Language and Grammar): some -> same
4815 (Epilogue): int he -> in the
4816 Typos reported by Sebastian Piping via Justin Pence.
4817
9ec93868
PE
48182005-02-07 Paul Eggert <eggert@cs.ucla.edu>
4819
4820 * tests/glr-regression.at (Improper handling of embedded actions
4821 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
4822 embedded actions and $-N in GLR parsers", work around an Autoconf bug
4823 with dollar signs in test names.
4824 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
4825 for a similar reason.
4826
73ce7e7e
PE
48272005-01-28 Paul Eggert <eggert@cs.ucla.edu>
4828
4829 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
4830 wants to redefine G_VIEW.
4831
2e72b98e
PE
48322005-01-27 Paul Eggert <eggert@cs.ucla.edu>
4833
4834 * src/vcg.c (get_view_str): Remove case for normal_view.
4835 Problem reported by twlevo@xs4all.nl.
4836
e0d634e5
PE
48372005-01-24 Paul Eggert <eggert@cs.ucla.edu>
4838
ccf830a4
PE
4839 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
4840 Problem reported by twlevo@xs4all.nl.
4841
e0d634e5
PE
4842 * doc/bison.texinfo: Change @dircategory from "GNU programming
4843 tools" to "Software development". Requested by Richard Stallman
4844 via Karl Berry.
4845
7bbc8cb0
PE
48462005-01-23 Paul Eggert <eggert@cs.ucla.edu>
4847
4848 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
4849 Problem reported by twlevo@xs4all.nl.
4850
08b770bc
PE
48512005-01-21 Paul Eggert <eggert@cs.ucla.edu>
4852
4853 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
4854 keyword; it's not needed with modern compilers, and it doesn't
4855 affect correctness with older compilers. Suggested by
4856 twlevo@xs4all.nl.
4857
95f22ad2
PE
48582005-01-17 Paul Eggert <eggert@cs.ucla.edu>
4859
4860 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
4861 gcc -Wswitch-default.
4862 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
4863 * data/yacc.c (yyparse): Likewise.
4864
d229d15c
PE
48652005-01-12 Paul Eggert <eggert@cs.ucla.edu>
4866
4867 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
4868 already. Let config.h define any nonstandard values.
4869
ecadd90f
PE
48702005-01-10 Paul Eggert <eggert@cs.ucla.edu>
4871
4872 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
4873 for the benefit of slower hosts. Problem reported by
4874 Nelson H. F. Beebe.
4875
213744b5
PE
48762005-01-07 Paul Eggert <eggert@cs.ucla.edu>
4877
4878 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
4879 being defined and not used.
4880 * data/lalr1.cc (yyparse): Likewise.
4881 Use "if (false)" rather than "if (0)".
4882
249d3236
PE
48832005-01-05 Paul Eggert <eggert@cs.ucla.edu>
4884
4885 * TODO: Mention that we should allow NUL bytes in tokens.
4886
987cc1fb
PE
48872005-01-02 Paul Eggert <eggert@cs.ucla.edu>
4888
4889 * src/scan-skel.l (<<EOF>>): Don't close standard output.
4890 Problem reported by Hans Aberg.
4891
08fe02d9
PE
48922005-01-01 Paul Eggert <eggert@cs.ucla.edu>
4893
4894 * src/getargs.c (version): Happy new year; update overall
4895 program copyright date from 2004 to 2005.
4896
4897 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
4898 Problem reported by Hans Aberg.
4899 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
4900 (Output file names.): Add a test for the case when standard output
4901 is closed.
4902
010c0266
PE
49032004-12-26 Paul Eggert <eggert@cs.ucla.edu>
4904
4905 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
4906 to fix an oversight in the Bison 2.0 manual.
4907
da12206a
PE
49082004-12-25 Paul Eggert <eggert@cs.ucla.edu>
4909
4910 * NEWS: Version 2.0. Reformat the existing news items since
4911 1.875, so that related items are grouped together.
3a4734aa 4912 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
4913 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
4914
c935d934
PE
4915 * tests/torture.at (Exploding the Stack Size with Alloca): Set
4916 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
4917 otherwise, we're not testing alloca. Unfortunately there's no
4918 simple way to consult HAVE_ALLOCA here.
4919
da12206a
PE
4920 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
4921 for yymsg, too.
4922
4923 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
4924 hand. This avoids a warning about comparing int to size_t when
4925 GCC warnings are enabled.
4926
0a2c5137
PE
49272004-12-22 Paul Eggert <eggert@cs.ucla.edu>
4928
d7e14fc0
PE
4929 * NEWS: Bison-generated parsers no longer default to using the
4930 alloca function (when available) to extend the parser stack, due
4931 to widespread problems in unchecked stack-overflow detection.
4932 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
4933 responsibility to set it to a positive value. This lets the user
4934 specify a value that is not a preprocessor constant.
4935 * data/yacc.c (YYMAXDEPTH): Likewise.
4936 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
4937 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
4938 to be a compile-time constant. However, explain the constraints on it.
4939 Also, explain the constraints on YYINITDEPTH.
4940 (Table of Symbols): Explain that alloca is no longer the default.
4941 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
4942 to 1.
4943
0a2c5137
PE
4944 * doc/bison.texinfo (Location Default Action): Mention that n must
4945 be zero when k is zero. Suggested by Frank Heckenbach.
4946
e019c247
AD
49472004-12-22 Akim Demaille <akim@epita.fr>
4948
4949 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
4950 (parser::state_type, parser::semantic_type, parser::location_type):
4951 Private, not public.
4952 (parser::parse): Return ints, not bool.
4953 Returning a bool introduces a problem: 0 corresponds to false, and
4954 it seems weird to return false on success. Returning true changes
4955 the conventions for yyparse.
4956 Alternatively we could return void and send an exception.
4957 There is no clear consensus (yet?).
4958 (state_stack, semantic_stack, location_stack): Rename as...
4959 (state_stack_type, semantic_stack_type, location_stack_type): these.
4960 Private, not public.
4961 * tests/c++.at: New.
4962 * tests/testsuite.at, tests/Makefile.am: Adjust.
4963
72731bb7
AD
49642004-12-21 Akim Demaille <akim@epita.fr>
4965
4966 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
4967
9a0d8bec
AD
49682004-12-21 Akim Demaille <akim@epita.fr>
4969
4970 Don't impose std::string for filenames.
4971
4972 * data/lalr1.cc (b4_filename_type): New.
4973 (position::filename): Use it.
4974 (parser.hh): Move the inclusion of stack.hh and location.hh below
4975 the user code, so that needed headers for the filename type can be
4976 included first.
72731bb7
AD
4977 Forward declare them before the user code.
4978 * tests/Makefile.am (check-local, installcheck-local): Pass
4979 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 4980
99880de5
AD
49812004-12-20 Akim Demaille <akim@epita.fr>
4982
4983 Use more STL like names: my_class instead of MyClass.
4984
4985 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
4986 (SemanticStack, SemanticType, StateStack, StateType)
4987 (TokenNumberType, Stack, Slice, Traits, Parser::location)
4988 (Parser::value): Rename as...
4989 (location_stack, location_type, rhs_number_type, semantic_stack)
4990 (semantic_type, state_stack, state_type, token_number_type, stack)
4991 (slice, traits, parser::yylloc, parser::yylval): these.
4992
4993 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
4994
9bec482e
PE
49952004-12-19 Paul Eggert <eggert@cs.ucla.edu>
4996
4997 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
4998 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
4999
f6fbd3da
PE
50002004-12-17 Paul Eggert <eggert@cs.ucla.edu>
5001
5002 Remove uses of 'short int' and 'unsigned short int'. This raises
5003 some arbitrary limits. It uses more memory but nowadays that's
5004 not much of an issue.
5005
5006 This change does not affect the generated parsers; that's a different
5007 task, as some users will want to conserve memory there.
5008
5009 Ideally we should use size_t to represent all object counts, and
5010 something like ptrdiff_t to represent signed differences of object
5011 counts; but that will require more code-cleanup than I have the
5012 time to do right now.
5013
5014 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
5015 Use size_t, not int or short int, to count objects.
5016 * src/closure.c (nritemset, closure): Likewise.
5017 * src/closure.h (nritemset, closure): Likewise.
5018 * src/nullable.c (nullable_compute): Likewise.
5019 * src/print.c (print_core): Likewise.
5020 * src/print_graph.c (print_core): Likewise.
5021 * src/state.c (state_compare, state_hash): Likewise.
5022 * src/state.h (struct state): Likewise.
5023 * src/tables.c (default_goto, goto_actions): Likewise.
5024
5025 * src/gram.h (rule_number, rule): Use int, not short int.
5026 * src/output.c (prepare_rules): Likewise.
5027 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
5028 errs, reductions): Likewise.
5029 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
5030 Likewise.
5031 * src/tables.c (vector_number, tally, action_number,
5032 ACTION_NUMBER_MINIMUM): Likewise.
5033 * src/output.c (muscle_insert_short_int_table): Remove.
5034
efeed023
AD
50352004-12-17 Akim Demaille <akim@epita.fr>
5036
5037 * data/lalr1.cc: Extensive Doxygenation.
5038 (error_): Rename as...
5039 (error): this, since it is visible to the user.
5040 Adjust callers.
5041 (Parser::message): Now an automatic variable from...
5042 (Parser::yyreport_syntax_error_): here.
5043 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
5044 Parser::error.
5045 * tests/input.at: Escape $.
5046
bc82c5a5
PE
50472004-12-16 Paul Eggert <eggert@cs.ucla.edu>
5048
5049 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
5050 Parenthesize rhs to avoid obscure problems with mistakes like
5051 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
5052 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5053 b4_rhs_location): Likewise.
5054 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5055 b4_rhs_location): Likewise.
5056
fd19f271
AD
50572004-12-16 Akim Demaille <akim@epita.fr>
5058
5059 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
5060 yacc.c: be sure to stay within yycheck_.
5061 * tests/actions.at: Re-enable C++ tests.
5062
10454ea4
AD
50632004-12-16 Akim Demaille <akim@epita.fr>
5064
5065 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
5066 real.
5067
c5b95ccf
AD
50682004-12-16 Akim Demaille <akim@epita.fr>
5069
5070 Use #define to handle the %name-prefix.
5071
5072 * data/glr.c, data/yacc.c: Comment changes.
5073 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
5074 so that one can refer to yylex in the parser file, and have it
5075 renamed, as is the case with other skeletons.
5076
617a8f12
AD
50772004-12-16 Akim Demaille <akim@epita.fr>
5078
5079 Move lalr1.cc internals into yy*.
5080
5081 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
5082 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
5083 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
5084 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
5085 (empty_, final_, terror_, errcode_, ntokens_)
5086 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
5087 (looka_, ilooka_, error_range_, nerrs_):
5088 Rename as...
5089 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
5090 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
5091 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
5092 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
5093 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
5094 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
5095 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
5096 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
5097 these.
5098
1e547e6e
PE
50992004-12-15 Paul Eggert <eggert@cs.ucla.edu>
5100
5101 Fix some problems reported by twlevo at xs4all.
5102 * src/symtab.c (symbol_new): Report an error if the input grammar
5103 contains too many symbols. This is better than calling abort() later.
5104 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
5105 (struct node, struct graph):
5106 Rename member expand to stretch. All uses changed.
5107 (struct graph): Remove member layoutalgorithm. All uses removed.
5108 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
5109 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
5110 All uses changed.
5111 (N_STRETCH): Rename from N_EXPAND. All uses changed.
5112
735d6bd4
AD
51132004-12-15 Akim Demaille <akim@epita.fr>
5114
5115 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
5116 Add more Doxygen comments.
5117 (symprint_, stack_print_, reduce_print_, destruct_, pop)
5118 (report_syntax_error_, translate_): Rename as...
5119 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
5120 (yypop_, yyreport_syntax_error_, yytranslate_): this.
5121
2e1f5829
AD
51222004-12-15 Akim Demaille <akim@epita.fr>
5123
5124 * data/lalr1.cc (lex_): Rename as...
5125 (yylex_): this.
5126 Move the trace here.
5127 Take the %name-prefix into account.
5128 Reported by Alexandre Duret-Lutz.
5129
a3cb6248
AD
51302004-12-15 Akim Demaille <akim@epita.fr>
5131
5132 Simplify the C++ parser constructor.
5133
5134 * data/lalr1.cc (debug_): Rename as...
5135 (yydebug_): so that the parser's internals are always in the yy*
5136 pseudo namespace.
5137 Adjust uses.
5138 (b4_parse_param_decl): Remove the leading comma as it is now only
5139 called as unique argument list.
5140 (Parser::Parser): Remove the constructor accepting a location and
5141 an initial debugging level.
5142 Remove from the other ctor the argument for the debugging level.
5143 (debug_level_type, debug_level, set_debug_level): New.
5144
5145 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
5146 constructor calls.
5147
07fed891
AD
51482004-12-15 Akim Demaille <akim@epita.fr>
5149
5150 Remove b4_root related material: failure experiment
a3cb6248 5151 (which goal was to allow to derive from a class).
07fed891
AD
5152
5153 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
5154 definitions and uses.
5155
e603eaa5
PE
51562004-12-14 Paul Eggert <eggert@cs.ucla.edu>
5157
5158 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
5159 not 2, since it's not portable to subtract 1 from the start of an
5160 array. The new item 0 is never set or used. All uses changed.
5161
5162 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
5163 the default definition of YYLLOC_DEFAULT. Problem reported
5164 by Frank Heckenbach.
5165
fafb007d
PE
51662004-12-12 Paul Eggert <eggert@cs.ucla.edu>
5167
5168 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
5169 the normal case and one for the error case. Just use the
5170 first one uniformly. Problem reported by Frank Heckenbach.
5171 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
5172 use exactly the same macro in both places.
5173 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
5174 so that the normal-case YYRHSLOC works for the error case too.
5175 All uses changed.
5176 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
5177 (YYLLOC_DEFAULT): Use the same macro as glr.c.
5178 * doc/bison.texinfo (Location Default Action): Don't claim that
5179 we have an array of locations. Use the same macro for both glr
5180 and lalr parsers. Mention YYRHSLOC. Mention what happens when
5181 the index is 0.
5182
48814dcd
PE
51832004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5184
a4e1a53b
PE
5185 * HACKING: Update email addresses to send announcements to.
5186
48814dcd
PE
5187 * configure.ac (AC_INIT): Bump version to 1.875f.
5188
337116ba
PE
51892004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5190
5191 * NEWS: Version 1.875e.
5192 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
5193
5194 * src/scan-skel.l: Include "complain.h", for "fatal".
5195
5196 * src/relation.h (relation_print, relation_digraph):
5197 Relation sizes are of type relation_node, not size_t (this is
5198 merely a doc fix, since the two types are equivalent).
5199 (relation_transpose): Relation sizes are of type relation_node,
5200 not int.
5201 * src/relation.c: Likewise.
5202 (top, infinity): Now of type relation_node, not int.
5203 (traverse, relation_transpose): Use relation_node, not int.
5204
5205 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
5206 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
5207 (yyparse): Remove unused local introduced in 2004-10-25 patch.
5208
5209 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 5210 specifying whether the test should be skipped. Use it tp
337116ba 5211 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 5212 fail on some hosts, and should be skipped.
337116ba 5213
da2a7671
PE
52142004-12-08 Paul Eggert <eggert@cs.ucla.edu>
5215
5216 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
5217 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
5218 unless otherwise specified below.
5219
5220 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
5221 to allocate kernel_base, kernel_items, kernel_size, since
5222 they needn't be initialized to 0.
5223 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
5224 * src/closure.c (new_closure): Likewise, for itemset.
5225 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
5226 * src/lalr.c (set_goto_map): Likewise, for temp_map.
5227 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
5228 (build_relations): Likewise for edge, states1, includes.
5229 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
5230 * src/reader.c (packgram): Likewise, for ritem, rules.
5231 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
5232 * src/relation.c (relation_digraph): Likewise for VERTICES.
5233 (relation_transpose): Likewise for new_R, end_R.
5234 * src/symtab.c (symbols_token_translations_init): Likewise for
5235 token_translations.
5236 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
5237 (token_actions): Likewise for yydefact, actrow, conflrow,
5238 conflict_list.
5239 (save_column): Likewise for froms[symno], tos[symno].
5240 (goto_actions): Likewise for state_count.
5241 (pack_table): Likewise for base, pos, check.
5242 (tables_generate): Likewise for width.
5243
5244 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
5245 for initial core. Just have a separate core, so we needn't worry
5246 about whether kernel_size and kernel_base are initialized.
5247
5248 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
5249 kernel_size, kernel_items): Remove unnecessary initialization.
5250 * src/conflicts.c (conflicts): Likewise.
5251 * src/derives.c (derives): Likewise.
5252 * src/muscle_tablc (muscle_insert): Likewise.
5253 * src/relation.c (relation_digraph): Likewise.
5254 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
5255 conflrow, conflict_table, conflict_list, table, check):
5256 Likewise.
5257
5258 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
5259 This is because all callers pass unsigned int.
5260 * src/closure.h (new_closure): Likewise.
5261
5262 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
5263 (build_relations): Initialize includes[i] in all cases.
5264 * src/reader.c (packgram): Always initialize rules[ruleno].prec
5265 and rules[ruleno].precsym. Initialize members in order.
5266 * src/relation.c (relation_transpose): Always initialize new_R[i]
5267 and end_R[i].
5268 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
5269
5270 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
5271 conflict_list[0] was always 0, but now it isn't initialized.
5272
5273 * src/table.c (table_grow): When conflict_table grew, the grown
5274 area wasn't cleared. Fix this.
5275
5276 * lib/.cvsignore: Add strdup.c, strdup.h.
5277 * m4/.cvsignore: Add strdup.m4.
5278
00baeeac
PE
52792004-12-07 Paul Eggert <eggert@cs.ucla.edu>
5280
5281 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
5282 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
5283 GOTO_NUMBER_MAXIMUM, since we occasionally compute
5284 ngotos + 1 without checking for overflow.
5285 (build_relations): Use END_NODE, not -1, to denote end of edges.
5286 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
5287 build_relations): Use goto_number, not int, for goto numbers.
5288 * src/tables.c (save_column, default_goto): Likewise.
5289
be3d9d42
AD
52902004-11-23 Akim Demaille <akim@epita.fr>
5291
5292 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
5293 of #defining from yystype.
5294 Don't typedef yystype, C++ does not need it.
5295 This lets it possible to forward declare it as union.
5296
78e526d5
PE
52972004-11-23 Paul Eggert <eggert@cs.ucla.edu>
5298
5299 * bootstrap (gnulib_modules): Add extensions.
5300 Problem reported by Jim Meyering.
5301
afbb696d
PE
53022004-11-22 Paul Eggert <eggert@cs.ucla.edu>
5303
5304 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
5305 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
5306 src/system.h, src/tables.c: XFREE -> free, to accommodate
5307 recent change to gnulib xalloc.h.
78e526d5 5308 Problem reported by Jim Meyering.
afbb696d 5309
c1f8f16a
AD
53102004-11-17 Akim Demaille <akim@epita.fr>
5311
5312 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
5313
db7e5eb5 53142004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
5315 Alexandre Duret-Lutz <adl@gnu.org>
5316
5317 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
5318 changes.
5319 (YYCDEBUG): Adjust.
5320 Use it instead of cdebug_.
5321 (Parser::debug_stream, Parser::set_debug_stream): New.
5322 (Parser::symprint_): Define cdebug_ for temporary backward
5323 compatibility.
5324 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
5325 debug_stream ().
5326
68e11668
AD
53272004-11-17 Akim Demaille <akim@epita.fr>
5328
5329 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
5330 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
5331 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
5332 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
5333
97cbc73e
PE
53342004-10-27 Paul Eggert <eggert@cs.ucla.edu>
5335
5336 * data/glr.c (yyloc_default): Remove; not used.
5337 Problem reported by Frank Heckenbach.
5338
e342c3be
AD
53392004-10-25 Akim Demaille <akim@epita.fr>
5340
5341 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
5342 Introduce another definition to address simple location arrays.
5343 (yyGLRStack): New member: yyerror_range.
5344 (yyrecoverSyntaxError, yyparse): Update it.
5345 (yyrecoverSyntaxError): Use it when shifting the error token to
5346 have an accurate range, equivalent to the one computed by both
5347 yacc.c and lalr1.cc.
5348 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
5349 that column numbers start at column 0, as per GNU Coding
5350 Standards, the others tests, and the doc.
5351 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
5352 Adjust to the above change (first column is 0).
5353 And adjust the location of the "<error>", now covering the whole
5354 line.
5355
93602feb 53562004-10-22 Akim Demaille <akim@epita.fr>
04098407 5357 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
5358
5359 Remove some arbitrary limits on goto numbers and relations.
5360 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
5361 initial values, since they're never used.
5362 (set_goto_map): ngotos is now unsigned, so test for overflow
5363 by seeing whether it wraps around to zero.
5364 * src/lalr.h (goto_number): Now size_t, not short int.
5365 (GOTO_NUMBER_MAXIMUM): Remove.
5366 * src/relation.c (relation_print, traverse, relation_transpose):
5367 Check for END_NODE rather than looking at sign.
5368 * src/relation.h (END_NODE): New macro.
5369 (relation_node): Now size_t, not short int.
5370
dba08b04
PE
53712004-10-22 Paul Eggert <eggert@cs.ucla.edu>
5372
5373 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
5374 keyword, not an identifier. Problem reported by Baron Schwartz in
5375 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
5376
df09ef2e
AD
53772004-10-11 Akim Demaille <akim@epita.fr>
5378
5379 * src/symtab.c (symbol_check_alias_consistency): Also check
5380 type names, destructors, and printers.
5381 Reported by Alexandre Duret-Lutz.
5382 Recode the handling of associativity and precedence in terms
5383 of symbol_precedence_set.
5384 Accept no redeclaration at all, not even equal to the previous
5385 value.
5386 (redeclaration): New.
5387 Use it to factor redeclaration complaints.
5388 (symbol_make_alias): Don't set the type of the alias, let
5389 symbol_check_alias_consistency do it as for other features.
5390 * src/symtab.h (symbol): Add new member prec_location, and
5391 type_location.
5392 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
5393 * tests/input.at (Incompatible Aliases): New.
5394
146bc99d
PE
53952004-10-09 Paul Eggert <eggert@cs.ucla.edu>
5396
5397 .cvsignore fixes to accommodate gnulib changes,
5398 and the practice of naming build directories "_build".
5399 * .cvsignore: Add "_*". Sort.
5400 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
5401 * m4/.cvsignore: Add "*_gl.m4".
5402
e503aa60
AD
54032004-10-06 Akim Demaille <akim@epita.fr>
5404
5405 * src/parse-gram.y (add_param): Fix the truncation of trailing
5406 spaces.
5407
b4a20338
AD
54082004-10-05 Akim Demaille <akim@epita.fr>
5409
5410 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
5411 whether the reducion was empty or not. This leaves room to
5412 improve the use of YYLLOC_DEFAULT in such a case.
5413 lalr1.cc is still experimental, so changing this is acceptable.
5414 And finally, there are probably not many users who changed the
5415 handling of locations in GLR, so changing is admissible too.
5416
5417 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
5418 empty reduction, set @$ to an empty location ending the previously
5419 stacked symbol.
5420 Adjust uses to make sure the code is triggered on empty
5421 reductions.
5422 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
5423 expected output: empty reductions have empty locations.
5424
f85a5e6f
AD
54252004-09-29 Akim Demaille <akim@epita.fr>
5426
5427 * data/lalr1.cc: Move towards a more standard C++ coding style
5428 for templates: Class < T > -> Class<T>.
5429
b203fc2c
AD
54302004-09-29 Akim Demaille <akim@epita.fr>
5431
5432 * data/lalr1.cc: Reinstall the former ctor, for sake of
5433 compatibility, but warn it will be removed.
5434 Move towards a more standard C++ coding style (i.e., type *var ->
5435 type* var).
5436
5b7e1e73
PE
54372004-09-27 Paul Eggert <eggert@cs.ucla.edu>
5438
3fee967f
PE
5439 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
5440 since it's less likely to work if NULs are involved in the future.
5b7e1e73 5441
0dcca5c2
AD
54422004-09-27 Akim Demaille <akim@epita.fr>
5443
5444 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
5445
6dde1c82
AD
54462004-09-27 Akim Demaille <akim@epita.fr>
5447
5448 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 5449 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
5450 and argument names.
5451 (b4_cc_constructor_call): Likewise.
5452
b233d555
AD
54532004-09-24 Akim Demaille <akim@epita.fr>
5454
5455 * src/parse-gram.y (add_param): Strip the leading and trailing
5456 blanks from a formal argument declaration.
5457 (YY_LOCATION_PRINT): New.
5458
619404e3
AD
54592004-09-24 Akim Demaille <akim@epita.fr>
5460
5461 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
5462 after the location.
5463
dd8d9022
AD
54642004-09-24 Akim Demaille <akim@epita.fr>
5465
5466 * doc/bison.texinfo (Table of Symbols): Sort.
5467
0092f063
AD
54682004-09-21 Akim Demaille <akim@epita.fr>
5469
5470 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
5471 the useless parentheses.
5472 Suggested by Paul Eggert.
5473
451364ed
AD
54742004-09-20 Akim Demaille <akim@epita.fr>
5475
5476 Let the initial-action act on the look-ahead, and use it for the
5477 "initial push" (corresponding to an hypothetical beginning-of-file).
5478 And let lalr1.cc honor %initial-action.
5479
5480 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
5481 example.
5482 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
5483 (Parser::Parser): Remove the ctor that used to initialize it.
5484 (Parser::parse): Like in the other skeletons, issue the "starting
5485 parse" message before any action.
5486 Honor %initial-action.
5487 Initialize the stacks with the lookahead.
5488 * data/yacc.c: Let $$ and @$ in %initial-action designate the
5489 look-ahead.
5490 Push them in the stacks.
5491 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
5492
18d192f0
AD
54932004-09-20 Akim Demaille <akim@epita.fr>
5494
5495 * doc/bison.texinfo (Initial Action Decl): New.
5496
b8458aa5
AD
54972004-09-20 Akim Demaille <akim@epita.fr>
5498
5499 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
5500 clearer criterion to define it.
5501 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
5502 When reducing on an empty RHS, use the latest stacked location as
5503 location.
5504 yylloc is not always available.
5505 * data/glr.c: Likewise.
5506 Also, honor initial-actions.
5507
3fc16193
AD
55082004-09-20 Akim Demaille <akim@epita.fr>
5509
5510 * data/yacc.c (YY_LOCATION_PRINT): New.
5511 Define when we know YYLTYPE's structure, i.e., when the default
5512 YYLLOC_DEFAULT is used.
5513 * data/c.m4 (b4_yysymprint_generate): Use it.
5514 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
5515 value of the result.
5516 (error_start_): Replace with...
5517 (error_range_): this location array.
5518 This allows to replace code relying on the implementation of
5519 locations by portable code.
5520 * data/yacc.c (yylerrsp): Replace with...
5521 (yyerror_range): this.
5522 Every time a token is popped, update yyerror_range[0], to have an
5523 accurate location for the error token.
5524 * data/glr.c (YY_LOCATION_PRINT): New.
5525 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
5526 deference a pointer.
5527 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
5528 report the location in %printers.
5529
5530 * src/scan-skel.l: Instead of abort, report error messages to ease
5531 understanding skeleton scanning failures.
5532
ecfe33e7
AD
55332004-09-16 Akim Demaille <akim@epita.fr>
5534
5535 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
5536 (iterator, const_iterator): these, to be more in the C++ spirit.
5537 Also, return reverse iterators so that when displaying the stack
5538 we display its bottom first.
5539 (Parser::stack_print_, Parser::reduce_print_): Match the messages
5540 from yacc.c.
5541 We should probably use vector here though.
5542
1576d44d
AD
55432004-09-16 Akim Demaille <akim@epita.fr>
5544
5545 Have more complete shift traces.
5546
5547 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
5548 to report Shifts instead of ad hoc YYDPRINTF invocations,
5549 including for the error token.
5550 * data/lalr1.cc (symprint_): Output the location.
5551 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
5552 output the location within the %printer.
5553 Activate GLR tests, at least to make sure they compile properly.
5554 They still don't pass though.
5555 * tests/calc.at: Adjust expect verbose output, since now "Entering
5556 state..." is on a different line than the "Shifting" message.
5557
9c66f418
AD
55582004-09-08 Akim Demaille <akim@epita.fr>
5559
5560 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
5561 Bison directive from the Bison file to the invocation of this
5562 macro, so that these directives are passed to
5563 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
5564 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
5565 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
5566 the extra Bison directives instead of the whole series.
5567 Change the grammar so that there are recoverable errors, and
5568 unrecoverable errors. Now we can have the parser give up before
5569 consuming the whole input. As a result we now can observe that
5570 the lookahead is freed when needed.
5571 Change the parser source to parse argv[1] instead of a hard coded
5572 string.
5573 Simplify yylex, and give a value and location to EOF.
5574 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
5575 passed directives already coded in the file.
5576 Add some tests to check the location of "error".
5577 For some tests, the C++ parser is correct, and not yacc.c.
5578 For other tests, they provide different, but unsatisfying, values,
5579 so keep the C++ value so that at least one parser is "correct"
5580 according to the test suite.
5581 (Actions after errors): Remove, this is subsumed by the
5582 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
5583
52d5733f
AD
55842004-09-06 Akim Demaille <akim@epita.fr>
5585
5586 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 5587 (Parser::pop): New.
52d5733f
AD
5588 Use it.
5589
a0e68930
AD
55902004-09-06 Akim Demaille <akim@epita.fr>
5591
5592 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
5593 argument, an informative message.
5594 Call YY_SYMBOL_PRINT.
5595 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
5596 * data/lalr1.cc (destruct_): Likewise.
5597 In addition, no longer depend on b4_yysymprint_generate and
5598 b4_yydestruct_generate to generate these functions, do it "by
5599 hand".
5600
e757bb10
AD
56012004-09-03 Akim Demaille <akim@epita.fr>
5602
5603 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
5604 invoked, yydestruct the lookahead.
5605 * tests/calc.at (Calculator $1): Update the expected lengths of
5606 traces: there is an added line for the discarded lookahead.
5607 * doc/bison.texinfo (Destructor Decl): Some rewording.
5608 Define "discarded" symbols.
5609
0fe1f06d
AD
56102004-09-02 Akim Demaille <akim@epita.fr>
5611
5612 * data/lalr1.cc (translate_, destruct_): No reason to be static.
5613
284acc8b
AD
56142004-09-02 Akim Demaille <akim@epita.fr>
5615
5616 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
5617 (YYDSYMPRINTF): Rename as...
5618 (YY_SYMBOL_PRINT): this.
5619 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
5620 two.
5621 Use it instead of direct symprint_ calls.
5622 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
5623 one.
5624
a5eb1ed2
AD
56252004-09-02 Akim Demaille <akim@epita.fr>
5626
b7c72fe1
AD
5627 * data/lalr1.cc (b4_yysymprint_generate): New.
5628 (symprint_): New member function, defined when YYDEBUG.
5629 Use it consistently instead of token/nterm debugging output by
5630 hand.
a5eb1ed2
AD
5631 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
5632 %printer calls to use cdebug_ when using lalr1.cc.
5633
417141dd
AD
56342004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
5635
5636 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
5637 with #ifdef YYDEBUG.
5638
2fa09258
AD
56392004-08-26 Akim Demaille <akim@epita.fr>
5640
5641 * doc/bison.texinfo (Implementing Loops): Rename as...
5642 (Implementing Gotos/Loops): this.
5643
9378b508
PE
56442004-08-13 Paul Eggert <eggert@cs.ucla.edu>
5645
5646 Adjust to latest gnulib.
5647 * bootstrap (gnulib_modules): Add xalloc-die.
5648 Set LC_ALL=C so that file names sort consistently.
5649 Prefer the gnulib copies of gettext.m4, glibc21.m4,
5650 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
5651 uintmax_t.m4, ulonglong.m4.
5652 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
5653 po.m4 since we are now using _gl.m4 instead.
5654
87a8ad5c
PE
56552004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
5656
5657 * src/scan-action.l: Remove. Scanning of semantic actions is
5658 handled in scan-gram.l.
5659
dca81a78
PE
56602004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
5661
5662 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
5663
5664 * src/location.h (struct): The file member is a uniqstr.
5665 (equal_boundaries): Use UNIQSTR_EQ for comparison.
5666
c9cbf7c5
PE
56672004-07-22 Paul Eggert <eggert@cs.ucla.edu>
5668
5669 Fix bug with non-%union parsers that have printers or destructors,
5670 which led to a Bison core dump. Reported by Peter Fales in
5671 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 5672
c9cbf7c5
PE
5673 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
5674 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
5675 not to our own type.
5676 * src/output.c (symbol_destructors_output, symbol_printers_output):
5677 Don't assume %union.
5678 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
5679 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
5680 UNION-FLAG. All callers changed.
5681 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
5682 Use type char, not unsigned int, when declaring an array of char;
5683 this lets us remove a cast.
5684 (Printers and Destructors): Add non-%union test cases.
5685
fa7e68c3
PE
56862004-06-21 Paul Eggert <eggert@cs.ucla.edu>
5687
5688 * doc/bison.texinfo: Minor editorial changes, mostly to the new
5689 GLR writeups. E.g., avoid frenchspacing and the future tense,
5690 change "lookahead" to "look-ahead", and change "wrt" to "with
5691 respect to".
2fa09258 5692
fa7e68c3
PE
56932004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5694
5695 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
5696 New sections, split off from the GLR Parsers section. Put the new
5697 Simple GLR Parser near the start of the GLR section, for clarity.
5698 Rewrite connective text.
5699
99a9344e
PE
57002004-06-21 Frank Heckenbach <frank@g-n-u.de>
5701
5702 * doc/bison.texinfo (Simple GLR Parsers): New section.
5703
8dd162d3
PE
57042004-06-21 Paul Eggert <eggert@cs.ucla.edu>
5705
5706 * NEWS, TODO, doc/bison.texinfo:
5707 Use "look-ahead" instead of "lookahead", to be consistent.
5708 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
5709 while we're fixing "look-ahead".
5710 * src/conflicts.c (shift_set): Renamed from shiftset.
5711 (look_ahead_set): Renamed from lookaheadset.
5712 * src/print.c: Likewise.
5713 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
5714 name for "lookahead".
5715 (report_types, usage): Likewise.
5716 * src/getargs.h (report_look_ahead_tokens): Renamed from
5717 report_lookaheads.
5718 * src/lalr.c (compute_look_ahead_tokens): Renamed from
5719 compute_lookaheads.
5720 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
5721 (look_ahead_tokens_print): Renamed from lookaheads_print.
5722 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
5723 state_rule_lookaheads_print.
5724 * src/state.h: Likewise.
5725 (reductions.look_ahead_tokens): Renamed from lookaheads.
5726 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
5727 AT_DATA_LOOKAHEADS_GRAMMAR.
5728
57a90331
PE
57292004-06-03 Paul Eggert <eggert@cs.ucla.edu>
5730
5731 * README: Update location of patched M4 distribution.
5732
8ed3234a
PE
57332004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
5734
5735 Don't assume the C++ compiler takes the same arguments as the C compiler
5736 (trivial change).
5737 * configure.ac (O0CXXFLAGS): New var.
5738 * tests/atlocal.in (CXXFLAGS): Use it.
5739
07971983
PE
57402004-05-29 Paul Eggert <eggert@cs.ucla.edu>
5741
5742 Fix some "make check" problems with C++ reported by
5743 Albert Chin-A-Young for Tru64 C++ in this thread:
5744 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
5745
5746 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
5747 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
5748 Output to a .cc file for C++, not to a .c file.
5749 * tests/calc.at (AT_CHECK_CALC): Likewise.
5750 * tests/regression.at (AT_CHECK_DANCER): Likewise.
5751 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
5752
29058652
PE
57532004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
5754
5755 * tests/calc.at, tests/actions.at: Workaround for SGI
5756 C++ compiler. (trivial change)
5757
62cb8a99
PE
57582004-05-27 Paul Eggert <eggert@cs.ucla.edu>
5759
fd418816
PE
5760 Spent a few hours checking out which prerequisite versions the
5761 current sources actually require. I went all the way back to
5762 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
5763 a seemingly endless set of combinations of versions more recent
5764 than that. The bottom line is that the current sources require
5765 fairly recent versions of the build tools, and it'll be some work
5766 to change this.
5767 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
5768 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
5769 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
5770 Add comments explaining why those particular versions are
5771 currently needed.
2fa09258 5772
62cb8a99
PE
5773 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
5774 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 5775 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
5776
5777 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
5778 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
5779
caa52c10
PE
57802004-05-26 Paul Eggert <eggert@cs.ucla.edu>
5781
5782 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
5783 0.11.5. Suggested by Bruno Haible.
5784 * bootstrap: Remove gettext version checking.
5785
5786 * doc/bison.texinfo (Decl Summary): Also mention that %union
5787 can depend on prerequisite types. Problem reported by Tim
5788 Van Holder.
5789
4bfd5e4e
PE
57902004-05-25 Paul Eggert <eggert@cs.ucla.edu>
5791
2cef3017
PE
5792 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
5793 * README-alpha: Don't tell people not to package this.
5794
b9c85d5c
PE
5795 * bootstrap: Don't assume $(...) works; use `...` instead.
5796 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
5797 gettext better.
5798
4bfd5e4e
PE
5799 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
5800 put into the -d output file, and mention what to do if YYSTYPE is
5801 defined as a macro.
5802
6a36ff94
PE
58032004-05-24 Paul Eggert <eggert@cs.ucla.edu>
5804
6712933e
PE
5805 Undo change made earlier today: it caused autopoint to not bring
5806 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
5807 autopoint's.
5808
5809 * bootstrap: Check that gettext version matches what's in
5810 configure.ac. Warn users to ignore robots.txt ERROR 404.
5811 * bootstrap: Undo today's earlier change (logged below).
5812 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 5813
6a36ff94
PE
5814 The gettext version checking is causing more trouble than it's
5815 curing; remove it. Problem reported by Paul Hilfinger.
5816
5817 * bootstrap: Issue a warning that one can expect a message
5818 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
5819 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
5820
209ea708
PE
58212004-05-23 Paul Eggert <eggert@cs.ucla.edu>
5822
5823 Ensure that the C++ compiler used for testing actually works on a
5824 simple test program; if not, skip the C++-related tests. Problem
5825 reported by Vin Shelton in:
161a71f3 5826 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
5827
5828 * m4/cxx.m4: New file.
5829 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
5830 * tests/atlocal.in (BISON_CXX_WORKS): Add.
5831 * tests/local.at (AT_COMPILE_CXX): Use it.
5832
41ca2549
PE
58332004-05-21 Paul Eggert <eggert@cs.ucla.edu>
5834
383e69dc
PE
5835 * data/glr.c (yylloc): Output this macro even if locations are not
5836 being generated, as the GLR parser needs it even in that case.
5837 Problem reported by Troy A. Johnson
5838 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
5839
41ca2549
PE
5840 * configure.ac (AC_INIT): Update to 1.875e.
5841
e476c87d
PE
58422004-05-21 Paul Eggert <eggert@cs.ucla.edu>
5843
5844 * NEWS: Version 1.875d.
5845 * configure.ac (AC_INIT): Likewise.
5846 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
5847
5848 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
5849 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
5850 lalr1.cc runs afoul of the first, and the last two are no longer
5851 supported by GCC 3.4.0.
5852 * README: Mention GNU m4 1.4 or later; mention m4 patches.
5853 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
5854
233a88ad
PE
58552004-05-06 Paul Eggert <eggert@cs.ucla.edu>
5856
5857 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
5858 unsigned int, for compatibility with latest gnulib hash module.
5859 * src/state.c (state_hash, state_hasher): Likewise.
5860 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
5861 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 5862
12ffdd28
PE
58632004-05-03 Paul Eggert <eggert@cs.ucla.edu>
5864
5865 * NEWS: Unescaped newlines are no longer allowed in char & strings.
5866
5867 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
5868 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
5869 character and string literals.
5870 (unexpected_end): New function.
5871 (unexpected_eof): Use it.
5872 (unexpected_newline): New function.
5873 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
5874 actions.
e476c87d 5875
12ffdd28
PE
5876 * NEWS: Document %expect-rr.
5877
5878 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
5879 Fix typo by replacing $1 with $option.
5880 Remove more 'intl'-related files.
9668e2be 5881 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
5882
5883 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
5884 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
5885 strtoul.c.
5886 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
5887 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
5888 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
5889 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
5890 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
5891 * src/.cvsignore: Add *.output.
5892
5893 * src/parse-gram.y: Put copyright notice inside %{ %} so it
5894 gets copied to the output file.
e476c87d 5895
1f65350a
PE
58962004-04-28 Paul Eggert <eggert@twinsun.com>
5897
5898 Get files from the gnulib and po repositories, instead of relying
5899 on them being in our CVS. Upgrade to latest versions of gnulib
5900 and Automake.
5901
5902 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
5903 * bootstrap: Bootstrap from gnulib and po repositories.
5904 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
5905 * README-cvs: Document these changes. Remove version numbers from
5906 mentions of build tools, since they change so often. Mention Flex.
5907
5908 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
5909 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
5910 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
5911 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 5912 does this for us.
12ffdd28
PE
5913 (AC_ISC_POSIX): Remove; we no longer support this
5914 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
5915 (AC_HEADER_STDC): Remove: we now assume C89 or better.
5916 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
5917 Do not check for C89 headers, except for locale.h which is used
5918 by the Yacc library and must port to K&R hosts.
5919 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
5920 Do not check for C89 functions, except for setlocale which is
5921 used by the Yacc library.
5922 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
5923 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
5924 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
5925 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
5926 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
5927 AM_GNU_GETTEXT): Remove; now done by:
5928 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
5929 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
5930 for us.
5931
5932 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
5933 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
5934 Define to empty, as gnulib.mk will do the rest for us.
5935 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
5936 for us.
5937 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
5938 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
5939
5940 * src/files.c: Include gnulib's xstrndup.h.
5941
5942 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
5943 (REALLOC): Use xnrealloc, for likewise.
5944 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
5945 (strnlen, memrchr): Remove decls; functions no longer used.
5946 Include <stpcpy.h>.
5947
5948 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
5949 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
5950 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
5951 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
5952 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
5953 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
5954 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
5955 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
5956 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
5957 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
5958 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
5959 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
5960 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
5961 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
5962 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
5963 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
5964 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
5965 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
5966 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
5967 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
5968 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
5969 Remove, as these files are now generated automatically
5970 by bootstrap or automake.
5971
5972 * po/ChangeLog: Remove: all but one entry was a duplicate
5973 of this file, and I moved that 2000-11-02 entry here.
5974
5975 * config/.cvsignore: Add Makefile, depcomp, install-sh.
5976 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
5977 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
5978 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
5979 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
5980 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
5981 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
5982 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
5983 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
5984 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
5985 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
5986 xstrndup.h.
5987 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
5988 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
5989 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
5990 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
5991 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
5992 * src/.cvsignore: Remove *_.c.
5993
5994
5995 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
5996 support it. (The latest stable gzip doesn't.)
5997
59982004-04-27 Paul Eggert <eggert@twinsun.com>
5999
6000 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
6001 case, as stos_ is now used by destructors due to the 2004-02-09
6002 change.
6003
6004 Remove more K&R C support.
6005 * lib/libiberty.y (PARAMS): Remove. All uses removed.
6006 * lib/subpipe.c (errno): Remove decl.
6007 Include <stdlib.h> unconditionally.
6008 (EXIT_FAILURE): Remove macro.
6009 * src/complain.c (vfprintf, strerror): Remove.
6010 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
6011 unconditionally.
6012 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
6013 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
6014 (strchr, strspn, memchr): Remove decls.
6015 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
6016 unconditionally. Do not declare perror.
6017 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
6018 unconditionally.
6019
6020 * src/complain.c (_): Remove useless defn, as system.h defines this.
6021
6022 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
6023 with latest obstack.h.
6024 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
6025 to procedure types, as obstack.h now does that for us.
6026 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
6027
6028 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
6029 so that this include file can stand alone.
6030 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
6031 does this now. Include subpipe.h first after config.h, to
6032 test whether it can stand alone.
6033
6034 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
6035 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
6036 unused declaration.
6037
6038 * tests/synclines.at (%union synch line): Put a dummy member in
6039 the union, because empty unions aren't allowed in C. Caught
6040 by GCC 3.4.0.
6041
4f16766c
PE
60422004-04-13 Jim Meyering <jim@meyering.net>
6043
6044 * src/conflicts.c (conflicts_print): Correct format string typo:
6045 use `%%' to produce literal `%'. (trivial change)
6046
779e7ceb
PE
60472004-03-30 Paul Eggert <eggert@twinsun.com>
6048
6049 * src/getargs.c (version): Update copyright year to 2004.
6050
6051 * data/c.m4 (b4_int_type): Use 'short int' rather than
6052 'short', and similarly for 'long', 'unsigned', etc.
6053 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
6054 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
6055 yy_yypstack, yydumpstack): Likewise.
6056 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
6057 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
6058 Likewise.
6059 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
6060 yy_stack_print, yyparse): Likewise.
6061 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
6062 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
6063 * lib/bitset.c (bitset_print): Likewise.
6064 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
6065 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
6066 * lib/bitsetv.c (bitsetv_dump): Likewise.
6067 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
6068 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
6069 Likewise.
6070 * src/LR0.c (allocate_itemsets): Likewise.
6071 * src/gram.h (rule_number, rule): Likewise.
6072 * src/lalr.h (goto_number): Likewise.
6073 * src/nullable.c (nullable_compute): Likewise.
6074 * src/output.c (prepare_rules): Likewise.
6075 * src/relation.c (relation_print, relation_digraph): Likewise.
6076 * src/relation.h (relation_node): Likewise.
6077 * src/state.h (state_number, transitions, errs, reductions,
6078 struct state): Likewise.
6079 * src/symtab.h (symbol_number, struct symbol): Likewise.
6080 * src/tables.c (vector_number, tally, action_number,
6081 default_goto, goto_actions): Likewise.
6082 * tests/existing.at (GNU Cim Grammar): Likewise.
6083 * tests/regression.at (Web2c Actions): Likewise.
6084
6085 * src/output.c (muscle_insert_short_int_table): Renamed from
6086 muscle_insert_short_table. All uses changed.
6087
d6328241
PH
60882004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6089
6090 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
6091 (declaration): Replace expected_conflicts with expected_sr_conflicts.
6092 Add %expect-rr rule.
4f16766c 6093
d6328241
PH
6094 * src/scan-gram.l: Recognize %expect-rr.
6095
4f16766c 6096 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 6097 expected_conflicts.
4f16766c 6098 (expected_rr_conflicts): Declare.
d6328241
PH
6099
6100 * src/conflicts.c (expected_sr_conflicts): Rename from
6101 expected_conflicts.
6102 (expected_rr_conflicts): Define.
6103 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
6104 for GLR parsers.
6105 Use expected_sr_conflicts in place of expected_conflicts.
6106 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 6107
d6328241 6108 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 6109
1452af69
PE
61102004-03-08 Paul Eggert <eggert@gnu.org>
6111
6112 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 6113 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
6114
6115 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
6116 in lalr1.cc.
6117 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
6118 * src/scan-gram.l (scan_integer): New function.
6119 ({int}): Use it.
6120 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
6121 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
6122 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
6123 Say "long int", not "long", for uniformity with GNU style.
6124
006d217d
PE
61252004-02-25 Paul Eggert <eggert@twinsun.com>
6126
6127 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
6128 compilers. This fixes a problem with Intel's C++ compiler being
6129 chatty, reported by Guido Trentalancia in
161a71f3 6130 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 6131
c2729758
ADL
61322004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
6133
6134 Support %destructor and merge error locations in lalr1.cc.
6135
6136 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
6137 (Parser::stos_): Define unconditionally.
6138 (Parser::destruct_): New method. Generate its body with
6139 b4_yydestruct_generate.
6140 (Parser::error_start_): New attribute.
6141 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
6142 token which are discarded.
6143 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
6144 error_start_ when erroneous token are discarded.
6145 (Parser::parse) <yyerrlab1>: Compute the location of the error
6146 token so that it covers all the discarded tokens.
6147 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
6148 it can be called with `%skeleton "lalr1.cc"', and do that.
6149
dd0e0635
PE
61502004-02-02 Paul Eggert <eggert@twinsun.com>
6151
6152 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
6153 $(top_srcdir)/lib and ../lib. This fixes a bug reported
6154 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
6155 There's no need to mention top_builddir since Automake does that
6156 for us.
6157 (INCLUDES): Remove, as Automake says it's obsolescent.
6158 Contents migrated into AM_CPPFLAGS as described above.
6159 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
6160
61612004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6162
6163 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
6164 (yyreportSyntaxError): Handle case where lookahead token is
6165 YYEMPTY.
6166
be16239b
PH
61672004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6168
6169 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
6170 resulting parsers are compilable with C++.
6171
5fa90832
PE
61722003-12-23 Paul Eggert <eggert@twinsun.com>
6173
6174 * config/depcomp, config/install-sh: Sync with Automake 1.8.
6175 * src/output.c (output_skeleton): Rename local var.
6176 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
6177 Bison tokens, as this runs afoul of the 2003-10-07 change that
6178 disallowed NUL bytes in character constants or string literals.
6179
6180 * tests/local.at: Require Autoconf 2.59's Autotest.
6181 * tests/testsuite.at: Don't include local.at, since we now assume
6182 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
6183 including it.
6184 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
6185 multiple inclusion warnings.
dd0e0635 6186
b165c324
AD
61872003-12-02 Akim Demaille <akim@epita.fr>
6188
6189 * doc/bison.texinfo (How Can I Reset the Parser): More about start
6190 conditions.
6191 From Bruno Haible.
6192
26e06a21
ADL
61932003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
6194
6195 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
6196
92ac3705
PE
61972003-10-07 Paul Eggert <eggert@twinsun.com>
6198
6a5ecb38
PE
6199 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
6200 if testsuite doesn't exist.
6201
92ac3705
PE
6202 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
6203 literals, unfortunately.
6204 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
6205 Complain about NUL bytes in character constants or string literals.
6206
91d2c560
PE
62072003-10-05 Paul Eggert <eggert@twinsun.com>
6208
6209 * NEWS: Don't document %no-default-prec, as it's still
6210 too experimental.
6211 * doc/bison.texinfo: Document %no-default-prec only if
6212 the defaultprec flag is set. Normally it's not.
6213
0cc3da3a
PE
62142003-10-04 Paul Eggert <eggert@twinsun.com>
6215
6216 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
6217 non-modifiable lvalue, instead of a modifiable one.
6218 * doc/bison.texinfo (Actions): Document that $$ can
6219 be assigned to. Do not claim that $$ and $N are
6220 array element references: user code should not rely on this.
6221
22fccf95
PE
62222003-10-01 Paul Eggert <eggert@twinsun.com>
6223
6224 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
6225 (grammar_declaration): Use it.
6226 * src/scan-gram.l: New token %no-default-prec.
6227 * tests/conflicts.at: Revamp tests to use %no-default-prec.
6228 * NEWS, doc/bison.texinfo: Document the above.
6229
fc8f2965
AD
62302003-10-01 Akim Demaille <akim@epita.fr>
6231
6232 VCG no longer supports long_straight_phase.
6233
6234 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
6235 * src/print_graph.c (print_graph): Adjust.
6236
39a06c25
PE
62372003-09-30 Frank Heckenbach <frank@g-n-u.de>
6238 and Paul Eggert <eggert@twinsun.com>
6239
6240 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
6241 Table of Symbols): Document %default-prec.
6242 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
6243 (grammar_declaration): Set default_prec on %default-prec.
6244 * src/scan-gram.l (%default-prec): New token.
6245 * src/reader.h (default_prec): New flag.
6246 * src/reader.c: Likewise.
6247 (packgram): Handle it.
6248 * tests/conflicts.at (%default-prec without %prec,
6249 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 6250
39a06c25
PE
62512003-09-30 Paul Eggert <eggert@twinsun.com>
6252
6253 * tests/testsuite.at: Include local.at, not input.at, fixing
6254 a typo in the 2003-08-25 patch.
6255
62b6aef9
AD
62562003-08-27 Akim Demaille <akim@epita.fr>
6257
6258 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
6259 GCC warnings.
6260
89e1cc61
AD
62612003-08-26 Akim Demaille <akim@epita.fr>
6262
6263 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
6264 "<\#" to avoid magic from Gnus when posting parts of this script.
6265
a08460b0
AD
62662003-08-26 Akim Demaille <akim@epita.fr>
6267
6268 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
6269 (Parser::parse): here.
6270 Adjust: nerrs and errstatus is now replaced by...
6271 (Parser::nerrs_, Parser::errstatus_): New.
6272
603f1cfd
AD
62732003-08-25 Akim Demaille <akim@epita.fr>
6274
6275 * config/announce-gen, Makefile.cfg: New.
6276 * Makefile.am: Adjust.
6277 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
6278 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
6279
cd3684cf
AD
62802003-08-25 Akim Demaille <akim@epita.fr>
6281
6282 When reducing initial empty rules, Bison parser read an initial
6283 location that is not defined. This results in garbage, and that
6284 affects Bison's own parser. Therefore we need (i) to extend Bison
6285 to support a means to initialize this location, and (ii) to use
6286 this CVS Bison to fix CVS Bison's parser.
6287
6288 * src/reader.h, reader.c (epilogue_augment): Remove, replace
6289 with...
6290 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
6291 * src/parse-gram.y: Adjust.
6292 (%initial-action): New.
6293 (%error-verbose): Since we require CVS Bison, there is no reason
6294 not to use it.
6295 * src/scan-gram.l: Adjust.
6296 * src/Makefile.am (YACC): New, to make sure we use our own parser.
6297 * data/yacc.c (yyparse): Use b4_initial_action.
6298
4e03e201
AD
62992003-08-25 Akim Demaille <akim@epita.fr>
6300
6301 * doc/bison.texinfo: Don't promote stdout for error messages.
6302
8c182d05
AD
63032003-08-25 Akim Demaille <akim@epita.fr>
6304
6305 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
6306 From Alexandre Duret-Lutz.
6307
6a60c4cf
PE
63082003-08-25 Akim Demaille <akim@epita.fr>
6309
6310 Version 1.875c.
6311
25f66e1a
AD
63122003-08-25 Akim Demaille <akim@epita.fr>
6313
6314 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
6315 Use them.
6316
5348bfbe
AD
63172003-08-25 Akim Demaille <akim@epita.fr>
6318
6319 * data/lalr1.cc (Parser::reduce_print_): New.
6320 Use it.
6321
47301314
AD
63222003-08-25 Akim Demaille <akim@epita.fr>
6323
6324 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
6325 error recovery loops. This patch is based on
161a71f3 6326 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
6327 Also, augment the similarity between lalr1.cc and yacc.c.
6328 Note: the locations of error recovery rules are not correct yet.
6329
6330 * data/lalr1.cc: Comment changes to augment the similarity between
6331 lalr1.cc and yacc.c.
6332 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
6333 (yyerrlab1): Remove, but where it used to be (now the bottom part of
6334 yyerrlab), when hitting EOF, pop the whole stack here instead of
6335 merely falling thru the default error handling mechanism.
6336 (yyerrorlab): New label, with the old contents of YYERROR,
6337 plus the following change: pop the stack of rhs corresponding
6338 to the production that invoked YYERROR. That is how Yacc
6339 behaves (required by POSIX).
6340 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
6341 fail.
6342
1f7a61ff
AD
63432003-08-25 Akim Demaille <akim@epita.fr>
6344
6345 Tune local.at so that people can "autom4te -l autotest calc.at -o
6346 calc" for instance, to extract a sub test suite.
6347
6348 * tests/testsuite.at: Move the initialization, Autotest version
6349 requirement, and AT_TESTED invocation into...
6350 * tests/local.at: here.
6351 * tests/testsuite.at: Include it for compatibility with Autoconf
6352 2.57.
6353 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
6354 be ignore.
6355
327b5b56
PE
63562003-08-04 Paul Eggert <eggert@twinsun.com>
6357
6358 Rework code slightly to avoid gcc -Wtraditional warnings.
6359 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
6360 The returned value is now stored in *YY0. All callers changed.
6361 * src/output.c (merge_output): Adjust to the above change.
6362
0051e3ed
PE
63632003-07-26 Paul Eggert <eggert@twinsun.com>
6364
6365 * data/glr.c (YYASSERT): New macro.
6366 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
6367 yyresolveStates, yyprocessOneStack):
6368 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
6369 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 6370
137437c6
PE
63712003-07-25 Paul Eggert <eggert@twinsun.com>
6372
5b620e06
PE
6373 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
6374 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 6375 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
6376 by Frank Heckenbach, though I have omitted the structure-initialization
6377 part of his glr-knr.diff patch since I recall that the Portable
6378 C Compiler didn't require that change.
6379
137437c6
PE
6380 Let the user specify how to allocate and free memory.
6381 Derived from a suggestion by Frank Heckenbach in
161a71f3 6382 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
6383 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
6384 All uses of free, malloc, realloc changed to use these macros,
6385 and unnecessary casts removed.
6386 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
6387
ddb85ca5
PE
63882003-07-06 Matthias Mann <MatthiasMann@gmx.de>
6389
6390 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
6391 use s.empty() rather than s == "" to test for empty string; see
161a71f3 6392 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
6393 (trivial change)
6394
39910e09
AD
63952003-06-25 Akim Demaille <akim@epita.fr>
6396
6397 * config/depcomp, config/install-sh: Update from masters.
6398
0ae99356
PE
63992003-06-20 Paul Eggert <eggert@twinsun.com>
6400
6401 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
6402 and return properly parenthesized result.
6403 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
6404 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
6405 Remove unnecessary parentheses from uses.
6406 * doc/bison.texinfo (Location Default Action): Describe the
6407 conventions for parentheses.
6408
cd05d13c
PE
64092003-06-19 Paul Eggert <eggert@twinsun.com>
6410
81fd08ca
PE
6411 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
6412 yyreportTree): Do not assume that size_t is the same width as int,
6413 when printing sizes. Print sizes using an unsigned format.
6414 Problem reported by Frank Heckenbach in
161a71f3 6415 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 6416
cd05d13c
PE
6417 Port to Forte Developer 7 C compiler.
6418 * data/glr.c (struct YYLTYPE): If locations are not being used,
6419 declare a single dummy member, as empty structs do not conform
6420 to the C standard.
6421 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
6422 the Forte Developer 7 C compiler complains that end-of-loop
6423 code is not reached.
6424
4dcf140b
PE
64252003-06-17 Paul Eggert <eggert@twinsun.com>
6426
6427 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
6428 avoid warnings from picky compilers about redefinition of PARAMS.
6429
8dd76bee
PE
64302003-06-17 Paul Eggert <eggert@twinsun.com>
6431
6432 Version 1.875b.
6433
6434 * NEWS: Document 1.875b.
6435
6436 * lib/bbitset.h: Do not include config.h; that's the includer's job.
6437 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
6438 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
6439 Don't use 'index' in comments, as it's a builtin fn on some hosts.
6440 * lib/bitset_stats.c: Include gettext.h unconditionally, as
6441 per recent gettext manual's suggestion.
6442 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
6443 Use prototypes, not old-style definitions.
6444 * lib/lbitset.c (lbitset_unused_clear): Likewise.
6445 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
6446 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
6447 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
6448 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
6449 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
6450 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
6451 vbitset_or_and_cmp, vbitset_copy): Likewise.
6452
6453 * lib/libiberty.h: Do not include config.h; that's the includer's job.
6454 Do not include <stdlib.h>.
6455 (PARAMS): Define unconditionally for C89.
6456 (ATTRIBUTE_NORETURN): Remove.
6457 (ATTRIBUTE_UNUSED): Define unconditionally.
6458
6459 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 6460 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
6461 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
6462 * lib/vbitset.c, lib/vbitset.h: New files.
6463 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
6464 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
6465 from libbitset.
6466
6467 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
6468 `How Can I Reset @code{yyparse}', since texinfo does not allow
6469 arbitrary @ in node names.
6470
6471 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
6472 shouldn't be needed according to the gettext 0.12.1 documentation
6473 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 6474 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 6475 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 6476 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 6477
8dd76bee
PE
6478 * lib/.cvsignore: Add stdbool.h.
6479 * m4/.cvsignore: Add nls.m4, po.m4.
6480
6481 Upgrade to CVS gnulib.
6482 * stdbool_.h: File renamed from stdbool.h.in.
6483 * configure.ac (AM_STDBOOL_H): Invoke this instead of
6484 AC_HEADER_STDBOOL.
6485 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
6486 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
6487 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
6488 (MOSTLYCLEANFILES): New var.
6489 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
6490 (stdbool.h): New rule.
6491 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
6492 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
6493 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
6494 m4/quote.m4: Upgrade to today's gnulib.
6495
6496 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
6497 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
6498 the tests right now.
6499 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
6500 yyerror are declared before use; C99 requires this.
6501
25005f6a
PH
65022003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6503
6504 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
6505 first.
6506 (yyrecoverSyntaxError): Correct the logic for setting and testing
6507 yyerrState.
6508 Correct comment on handling EOF.
6509 Allow states with only a default reduction, rather than failing
8dd76bee 6510 (I can't quite reconstruct why these were not allowed before).
25005f6a 6511
137437c6 6512 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 6513 buffer overruns, corrupting state.
8dd76bee
PE
6514
6515 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
6516 definition.
6517 * src/reader.h (max_left_semantic_context): New variable declaration.
6518 * src/scan-gram.l (max_left_semantic_context): Define.
6519 (handle_action_dollar): Update max_left_semantic_context.
6520 * data/glr.c (YYMAXLEFT): New definition.
6521 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
6522 (yyresolveAction): Ditto.
6523
6524 Fixes to problems with location handling in GLR parsers reported by
6525 Frank Heckenbach (2003/06/05).
6526
6527 * data/glr.c (YYLTYPE): Make trivial if locations not used.
6528 (YYRHSLOC): Add parentheses, and define only if locations used.
6529 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
6530 locations not used.
6531 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
6532 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 6533
25005f6a
PH
6534 * tests/cxx-type.at: Exercise location information; update tests
6535 to differentiate output with and without locations.
8dd76bee 6536 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
6537 because default YYLTYPE not yet defined.
6538 Change semantic actions to compute strings, rather than printing
6539 them directly (to test proper passing of semantics values). Change
6540 output to prefix notation and update test data and expected results.
6541 (yylex): Track locations.
6542 (stmtMerge): Return value rather than printing, and include arguments
6543 in value.
8dd76bee 6544
711f40b7
PE
65452003-06-03 Paul Eggert <eggert@twinsun.com>
6546
6547 Avoid warnings generated by GCC 2.95.4 when Bison is
6548 configured with --enable-gcc-warnings.
6549 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
6550 yy::]b4_parser_class_name[::translate_,
6551 yy::Stack::operator[] (unsigned),
6552 yy::Stack::operator[] (unsigned) const,
6553 yy::Slice::operator[] (unsigned),
6554 yy::Slice::operator[] (unsigned) const):
6555 Rename local vars to avoid warnings.
6556 * tests/glr-regression.at (Improper handling of embedded actions
6557 and $-N in GLR parsers): Remove unused local variable from yylex.
6558 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
6559 (void) as arg when not pure, since we now assume C89 when building
6560 Bison. Pacify GCC by using parameter.
6561
ac695f7d
PE
65622003-06-02 Paul Eggert <eggert@twinsun.com>
6563
6564 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
6565 yy::Location::lines, yy::Location::columns): Rename arguments
6566 to avoid shadowing; this removes a warning generated by GCC 3.3.
6567
26ec81e0
PE
65682003-06-01 Paul Eggert <eggert@twinsun.com>
6569
6570 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
6571 to g++, as GCC 3.3 complains if you do it.
6572 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
6573 everything that WARNING_CFLAGS has, except omit warnings
6574 not suitable for C++.
6575 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
6576 * tests/atlocal.in (CXXFLAGS): New var.
6577 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
6578
6579 Fix a GLR parser bug I reported in February; see
161a71f3 6580 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
6581 The problem was that GLR parsers did not conform to the C standard,
6582 because actions like { $1 = $2 + $3; } expanded to expressions
6583 that invoked YYFILL in separate subexpressions, and YYFILL assigned
6584 to a local variable. The C standard says that expressions
6585 like (var = f ()) + (var = f ()) have undefined behavior.
6586 Another problem was that GCC sometimes issues warnings that
6587 yyfill and its parameters are unused.
6588
6589 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
6590 as possibly unused.
6591 (yyfill): New function.
6592 (YYFILL): Use it.
6593 (yyuserAction): Change type of yynormal to bool, so that it matches
6594 the new yyfill signature. Mark it as possibly unused.
6595
6596
6597 Follow up on a bug I reported in February, where a Bison-generated
6598 parser can loop. Provide a test case and a fix for yacc.c. I
6599 don't have a fix for lalr1.cc or for glr.c, unfortunately.
6600 The original bug report is in:
161a71f3 6601 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
6602
6603 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
6604 macro's size was becoming unwieldy.
6605 (yyerrlab): Do not discard an empty lookahead symbol, as this
6606 might destroy garbage.
6607 (yyerrorlab): New label, with the old contents of YYERROR,
6608 plus the following change: pop the stack of rhs corresponding
6609 to the production that invoked YYERROR. That is how Yacc
6610 behaves, and POSIX requires this behavior.
6611 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
6612 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
6613 Define 'alarm' to do nothing if unistd.h is not available.
6614 Add a new rule "exp: '-' error;" to test the above change to
6615 data/yacc.c. Use 'alarm' to abort any test taking longer than
6616 10 seconds, as it's probably looping.
6617 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
6618 Also, the new yacc.c generates two fewer diagnostics for an
6619 existing test.
6620
d0829076
PE
66212003-05-24 Paul Eggert <eggert@twinsun.com>
6622
c6ae27df
PE
6623 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
6624 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
6625 This fixes a problem reported by John Bowman when the Compaq/HP
6626 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
6627 -ansi -Wall -gall).
6628 * data/yacc.c (union yyalloc): Likewise.
6629 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 6630
d0829076
PE
6631 Switch from 'int' to 'bool' where that makes sense.
6632
6633 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
6634 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
6635 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
6636 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
6637 Return or accept bool, not int. All callers changed.
6638 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
6639 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
6640 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
6641 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
6642 bitset_or_and_cmp_): Likewise.
6643 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
6644 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
6645 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
6646 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
6647 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
6648 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
6649 bitset_stats_or_and_cmp): Likewise.
6650 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
6651 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
6652 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
6653 ebitset_xor_cmp): Likewise.
6654 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
6655 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
6656 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
6657 lbitset_xor_cmp): Likewise.
6658 * lib/bbitset.h: Include <stdbool.h>.
6659 (struct bitset_vtable): The following members now return bool, not
6660 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
6661 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
6662 or_and_cmp).
6663 * src/conflicts.c (count_rr_conflicts): Likewise.
6664 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
6665 All uses changed.
6666 * lib/ebitset.c (ebitset_obstack_init): Likewise.
6667 * lib/lbitset.c (lbitset_obstack_init): Likewise.
6668 * src/getargs.c (debug_flag, defines_flag, locations_flag,
6669 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
6670 graph_flag): Likewise.
6671 * src/getargs.h (debug_flag, defines_flag, locations_flag,
6672 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
6673 graph_flag): Likewise.
6674 * src/output.c (error_verbose): Likewise.
6675 * src/output.h (error_verbose): Likewise.
6676 * src/reader.c (start_flag, typed): Likewise.
6677 * src/reader.h (typed): Likewise.
6678 * src/getargs.c (LOCATIONS_OPTION): New constant.
6679 (long_options, getargs): Use it.
6680 * src/lalr.c (build_relations): Use bool, not int.
6681 * src/nullable.c (nullable_compute): Likewise.
6682 * src/print.c (print_reductions): Likewise.
6683 * src/tables.c (action_row, pack_vector): Likewise.
6684 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
6685 * src/output.c (prepare): Use it.
6686 * src/output.c (token_definitions_output,
6687 symbol_destructors_output, symbol_destructors_output): Use string,
6688 not boolean integer, to keep track of whether to output separator.
6689 * src/print_graph.c (print_core): Likewise.
6690 * src/state.c (state_rule_lookaheads_print): Likewise.
6691
6692 * config/install-sh: Sync from automake 1.7.5.
6693
6b2584b7
PE
66942003-05-14 Paul Eggert <eggert@twinsun.com>
6695
6696 * src/parse-gram.y (rules_or_grammar_declaration): Require a
6697 semicolon after a grammar declaration, in the interest of possible
6698 future changes to the Bison input language.
6699 Do not allow a stray semicolon at the start of the grammar.
6700 (rhses.1): Allow one or more semicolons after any rule, including
6701 just before "|" as required by POSIX.
6702 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
6703 grammar.
6704
caf37a36
ADL
67052003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
6706
6707 %parse-param support for lalr1.cc.
6708
6709 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
6710 b4_cc_constructor_calls, b4_cc_constructor_call,
6711 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
6712 definitions.
6713 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
6714 parse-param arguments.
6715 (yy::b4_parser_class_name): Declare instance variables to
6716 hold parse-param arguments.
6717 * tests/calc.at: s/value/semantic_value/ because value clashes
6718 with a member of yy::b4_parser_class_name. Adjust C++ code
6719 to handle %parse-param. Enable %parse-param test in C++.
6720
3ab37077
PE
67212003-05-12 Paul Eggert <eggert@twinsun.com>
6722
6723 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
6724 English a bit. Fix fclose typo. Change "const char" to "char
6725 const", and use ANSI C rather than K&R for "main". Suggest
6726 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
6727 and suggest yy_switch_to_buffer.
6728
67292003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
6730
6731 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
6732 C89. This avoids a diagnostic on compilers that define __STDC__
6733 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 6734 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 6735
e743727f
PE
67362003-05-03 Paul Eggert <eggert@twinsun.com>
6737
6738 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
6739 Do not overrun array bounds.
6740 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 6741 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 6742
916708d5
AD
67432003-04-29 Akim Demaille <akim@epita.fr>
6744
6745 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
6746 * src/getargs.c, src/getargs.h: here, as bool, not int.
6747 (nondeterministic_parser): New.
6748 * src/parse-gram.y, src/scan-gram.l: Support
6749 %nondeterministic-parser.
6750 * src/output.c (prepare): Use nondeterministic_parser instead
6751 of glr_parser where appropriate.
6752 * src/tables.c (conflict_row, action_row, save_row)
6753 (token_actions, token_actions, pack_vector): Ditto.
6754
a06ea4aa
AD
67552003-04-29 Akim Demaille <akim@epita.fr>
6756
6757 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
6758
211074ca
AD
67592003-04-29 Akim Demaille <akim@epita.fr>
6760
6761 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
6762 with %pure-parser and %locations to exercise the patch from Yakov
6763 Markovitch below.
6764
6175ffe3
PE
67652003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
6766
6767 * data/yacc.c: (b4_lex_param): Corrected for the case where
6768 %lex-param is provided and %pure-parser isn't.
6769
b1e95857
PE
67702003-04-27 Paul Eggert <eggert@twinsun.com>
6771
6772 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 6773 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
6774 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
6775 if it is not defined.
6776 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
6777
acda9df6
PE
67782003-04-26 Paul Eggert <eggert@twinsun.com>
6779
3470c57b
PE
6780 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
6781 Declare to be of type suitable for the ninf value itself, not of
6782 type suitable for the corresponding table, since the latter might
6783 be unsigned but the ninf value might be negative. This fixes a
6784 bug reported by Alexandre Duret-Lutz in
161a71f3 6785 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 6786
acda9df6
PE
6787 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
6788 invokes it. We shouldn't invoke it twice because it will attempt
6789 to put error.o in the archive twice. This fixes a glitch reported
6790 by Martin Mokrejs in
161a71f3 6791 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 6792
b5250f26
PE
67932003-04-21 Paul Eggert <eggert@twinsun.com>
6794
6795 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
6796 to gnulib.
6797
089ac0f1
PE
67982003-04-21 Yakov Markovitch <Markovitch@iso.ru>
6799
6800 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
6801 Fix obvious typo that results in uncompilable GLR parsers
6802 when both %pure-parser and %locations are used. (trivial change)
6803
5ededac6
PE
68042003-04-17 Paul Eggert <eggert@twinsun.com>
6805
1b8f2fff
PE
6806 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
6807 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
6808 Do not insert the expected token via unput, as this runs afoul
6809 of a POSIX-compatibility bug in flex 2.5.31.
6810 All uses changed to BEGIN the parent state,
6811 since we no longer insert the expected token via unput.
6812 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
6813 that is no longer emitted after the above change.
6814
5ededac6
PE
6815 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
6816 the first one. This change is from Paul Hilfinger, and it fixes
6817 regression reported by Werner Lemberg in
161a71f3 6818 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
6819
6820 (resolve_sr_conflict): Don't invoke state_errs_set
6821 unless one or more tokens have been explicitly made errors.
6822 Otherwise, the above change causes Bison to abort.
6823
6824 * tests/existing.at (GNU pic Grammar): New test case, taken from
6825 Lemberg's email.
6826
b8be9132
AD
68272003-03-31 Akim Demaille <akim@epita.fr>
6828
6829 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
6830
d423d460
AD
68312003-03-31 Akim Demaille <akim@epita.fr>
6832
6833 * src/output.c (prepare_symbols): Avoid trailing spaces in the
6834 output.
6835
c7e441b4
AD
68362003-03-31 Akim Demaille <akim@epita.fr>
6837
6838 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
6839 From Paul Hilfinger.
6840
231897ad
AD
68412003-03-29 Akim Demaille <akim@epita.fr>
6842
6843 * m4/error.m4: Do not put under dynamic conditions some code which
6844 expansion is under static control.
6845
5b066063
AD
68462003-03-29 Akim Demaille <akim@epita.fr>
6847
6848 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
6849
22a74fec
AD
68502003-03-29 Akim Demaille <akim@epita.fr>
6851
6852 * doc/bison.texinfo (Strings are Destroyed): New.
6853
0eee27e7
PE
68542003-03-13 Paul Eggert <eggert@twinsun.com>
6855
6856 * .cvsignore: Add configure.lineno.
6857 * src/.cvsignore: Add yacc.
6858 * tests/.cvsignore: Add testsuite.log.
6859 * doc/fdl.texi: Sync with latest FSF version.
6860
f61aad93
PE
68612003-03-12 Paul Eggert <eggert@twinsun.com>
6862
537636c7
PE
6863 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
6864 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
6865 cursor, instead of leaving it undefined. This fixes a bug
6866 reported by Tim Van Holder in
161a71f3 6867 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
6868 * tests/input.at (Torturing the Scanner): Test the scanner on
6869 an empty input file, which was Tim Van Holder's test case.
6870
6871 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
6872 <sys/resource.h> can be included, include sys/time.h and
6873 sys/times.h first, if available. This works around the SunOS
6874 4.1.4 porting bug reported by Bruce Becker in
161a71f3 6875 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
6876
6877 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
6878 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
6879 AC_HEADER_SYS_WAIT.
6880
f61aad93
PE
6881 Merge changes from gnulib. This was prompted because the CVS
6882 snapshot didn't build on Solaris 7 due to strnlen problems.
6883
6884 These changes need to be merged back into gnulib:
6885 * lib/hash.c: Include <stdbool.h> unconditionally.
6886 * m4/onceonly.m4 (m4_quote): New macro.
6887 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
6888 Quote AC_FOREACH variable-expansions properly.
6889 The 2003-01-03 obstack.h change also needs merging.
6890 {end of changes requiring merging}
5b066063 6891
f61aad93
PE
6892 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
6893 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
6894 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
6895 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
6896 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
6897 New files, imported from gnulib.
6898 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
6899 above.
6900
6901 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
6902 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
6903 gnulib sources.
6904
6905 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
6906 Add.
6907 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
6908 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
6909 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
6910 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
6911 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
6912 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
6913 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
6914 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
6915 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
6916 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
6917 (jm_PREREQ_ARGMATCH): Remove.
6918 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
6919 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
6920
6921 * src/system.h: Include <stdbool.h> unconditionally.
6922
6923 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
6924 assuming at least C89 in the bitset code for some time now.
6925
d2ffe116
AD
69262003-03-03 Akim Demaille <akim@epita.fr>
6927
6928 * ro.po: New.
6929
052826fd
AD
69302003-03-02 Akim Demaille <akim@epita.fr>
6931
6932 * doc/bison.texinfo (Table of Symbols): Reactivate the
6933 documentation for %lex-param, and %parse-param.
6934
c4749565
AD
69352003-03-02 Akim Demaille <akim@epita.fr>
6936
6937 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
6938 generate verbose error messages.
6939 Use the number of tokens as an upper bound in yytname, as it
6940 cannot be a non terminal.
6941
d5286af1
AD
69422003-03-02 Akim Demaille <akim@epita.fr>
6943
6944 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
6945 message.
6946
22e304a6
AD
69472003-03-02 Akim Demaille <akim@epita.fr>
6948
22e304a6
AD
6949 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
6950 Use them to exercise yycheck overrun.
6951 Based on Andrew Suffield's grammar.
6952
67a25fed
AD
69532003-03-02 Akim Demaille <akim@epita.fr>
6954
6955 Create tests/local.at for Bison generic testing macros.
6956
6957 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
6958 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
6959 This new file.
6960 * tests/calc.at (AT_CHECK_CALC): Adjust.
6961 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
6962 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
6963 * tests/local.at: here.
6964 (AT_COMPILE_CXX): Tags the tests using it as c++.
6965 Ignore the test if CXX is not functional.
6966
9c2b381f
PE
69672003-03-01 Paul Eggert <eggert@twinsun.com>
6968
6969 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
6970 not loc->end, since loc->end might contain garbage and this leads
6971 to undefined behavior on some platforms.
6972 (id_loc, token_start): Use (IF_LINTed) initial values that do not
6973 depend on *loc, so that the reader doesn't give the the false
6974 impression that *loc is initialized.
6975 (<INITIAL>"%%"): Do not bother setting code_start, since its value
6976 does not survive the return.
6977
0433ba88
AD
69782003-03-01 Akim Demaille <akim@epita.fr>
6979
6980 * src/scan-gram.l (code_start): Always initialize it when entering
6981 into yylex, as SC_EPILOGUE is activated *before* the corresponding
6982 yylex invocation. An alternative would be making it static, but
6983 then it starts with the second %%'s beginning, instead of its end.
6984
b305ea69
PE
69852003-02-28 Paul Eggert <eggert@twinsun.com>
6986
6987 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
6988 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 6989 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 6990
c3d25e01
PE
69912003-02-26 Paul Eggert <eggert@twinsun.com>
6992
6993 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
6994 Remove Sequent/Pyramid discussion (nobody uses them any more).
6995 Merge VMS and MS-DOS discussion; these ports may well be dead
6996 but let's keep mentioning them for now. Put <> around email
6997 addresses. Add copyright notice.
6998
c267ffbc
PE
69992003-02-24 Paul Eggert <eggert@twinsun.com>
7000
7001 * data/glr.c (yy_reduce_print): yylineno -> yylno,
7002 to avoid collision with flex use of yylineno.
7003 Problem reported by Bruce Lilly in
161a71f3 7004 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
7005 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
7006 * data/yacc.c (yy_reduce_print): Likewise.
7007
7008 * config/depcomp: Sync with Automake 1.7.3.
7009
f939fc12
AD
70102003-02-21 Akim Demaille <akim@epita.fr>
7011
7012 * data/lalr1.cc: Use temporary variables instead of casts to
7013 change integer types.
7014 Suggested by Paul Eggert.
7015
95923bd6
AD
70162003-02-21 Akim Demaille <akim@epita.fr>
7017
7018 * doc/bison.texinfo: Use "location" consistently to refer to @n,
7019 to avoid confusions with lalr1.cc's notion of Position.
7020 Suggested by Paul Eggert.
7021
2cdc240e
AD
70222003-02-20 Akim Demaille <akim@epita.fr>
7023
7024 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
7025 before initial_columns.
7026 (location.hh): Use consistent variable names when defining the
7027 operator<<.
7028 Use "last" so that we subtract from Positions, not from unsigned.
7029
5d003116
AD
70302003-02-20 Akim Demaille <akim@epita.fr>
7031
7032 * data/lalr1.cc (position.hh): New subfile, including the extended
7033 and Doxygen'ed documentation of class Position.
7034 (location.hh): Use it.
7035 Document a` la Doxygen.
ba1ecc07 7036 With the help of Benoit Perrot.
5d003116 7037
d02b25f9
AD
70382003-02-20 Akim Demaille <akim@epita.fr>
7039
7040 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
7041 AT_YACC_IF.
7042 Redefine AT_YYERROR_SEES_LOC_IF using it.
7043 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
7044 not defined.
7045 Don't use the location in yy::Parser::error_ and
7046 yy::Parser::print_ when not %locations.
7047 Activate more lalr1.cc tests.
7048
0d1c3a04
AD
70492003-02-19 Akim Demaille <akim@epita.fr>
7050
7051 * data/lalr1.cc: When displaying a line number, be sure to make it
7052 an int.
7053
60a777aa
AD
70542003-02-19 Akim Demaille <akim@epita.fr>
7055
7056 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
7057 Remove, useless.
7058 (YYABORT, YYACCEPT, YYERROR): New.
7059 * tests/calc.at: Renable the lalr1.cc test.
7060
0b86fc41
AD
70612003-02-19 Akim Demaille <akim@epita.fr>
7062
7063 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
7064 error recovery, mixing with/without pops and discarding of the
7065 lookahead.
7066 Exercise YYERROR.
7067 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
7068
da99a5dc
PE
70692003-02-17 Paul Eggert <eggert@twinsun.com>
7070
7071 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
7072 * tests/testsuite.at (AT_COMPILE): Use them.
7073 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 7074 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 7075
93b8c255
PE
70762003-02-12 Paul Eggert <eggert@twinsun.com>
7077
7078 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
7079 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 7080 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
7081 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
7082 Check for malloc failure, for consistency with yacc.c.
7083 (yytname_size): Remove, for consistency with yacc.c.
7084
7085 The bug still remains in data/lalr1.cc, as I didn't have time
7086 to fix it there.
7087
7548fed2
AD
70882003-02-06 Akim Demaille <akim@epita.fr>
7089
7090 * configure.ac (GXX): Rename as...
7091 (CXX): this, to keep the original Autoconf semantics.
7092 Require 2.57.
7093 * data/lalr1.cc: Fix b4_copyright invocations.
7094 If YYDEBUG is not defined, don't depend upon name_ being defined.
7095 (location.hh): Include string and iostream.
7096 (Position::filename): New member.
7097 (Position::Position ()): New.
7098 (operator<< (Position)): New.
7099 (operator- (Position, int)): New.
7100 (Location::first, Location::last): Rename as...
7101 (Location::begin, Location::end): these, to mock the conventional
7102 iterator names.
7103 (operator<< (Location)): New.
7104 * tests/atlocal.in (CXX): New.
7105 * tests/testsuite.at (AT_COMPILE_CXX): New.
7106 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
7107 locations in a more synthetic way.
7108 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
7109 lalr1.cc is used.
7110 Adjust the C locations to match those from Emacs: first column is
7111 column 0.
7112 Change all the expected results.
7113 Conform to the GCS: simplify the locations when applicable.
7114 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
7115 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
7116 these CPP macros with the m4 macros new defined by...
7117 (AT_CHECK_PUSHDEFS): this, i.e.:
7118 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 7119 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
7120 New macros.
7121 (AT_CHECK_POPDEFS): Undefine them.
7122 (AT_CHECK_CALC_LALR1_CC): New.
7123 Use it for the first lalr1.cc test.
7124
43a176ef
AD
71252003-02-04 Akim Demaille <akim@epita.fr>
7126
7127 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
7128 Location as is defined.
7129
fc049e9c
AD
71302003-02-04 Akim Demaille <akim@epita.fr>
7131
7132 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
7133 name_ being defined.
7134
a737b216
PE
71352003-02-03 Paul Eggert <eggert@twinsun.com>
7136
7137 * src/gram.h (start_symbol): Remove unused decl.
7138
7139 Use more-consistent naming conventions for local vars.
7140
7141 * src/derives.c (derives_compute): Change type of local var from
7142 int to rule_number.
7143 * src/gram.c (grammar_rules_partial_print): Likewise.
7144 * src/print.c (print_core): Likewise.
7145 * src/reduce.c (reduce_grammar_tables): Likewise.
7146
7147 * src/gram.c (grammar_dump): Change name of item_number *
7148 local var from r to rp.
7149 * src/nullable.c (nullable_compute): Likewise.
7150
7151 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
7152
7153 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
7154 for symbol or symbol_number var.
7155 * src/reader.c (grammar_start_symbol_set): Likewise.
7156 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
7157 Likewise.
7158 * src/state.c (transitions_to): Likewise.
7159 * src/state.h: Likewise.
7160 * src/tables.c (symbol_number_to_vector_number): Likewise.
7161
7162 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
7163 char * var.
7164
7165 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
7166 var.
7167
7168 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
7169 var.
7170
7171 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
7172 Use str, not s, for char * var. Use ch, not c, for character var.
7173 Use size for size var.
7174
7175 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
7176 char * var.
7177 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
7178 uniqstr var.
7179 * src/uniqstr.h: Likewise.
7180
7181 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
7182 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
7183 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
7184 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
7185 param to have same name as that of enum, so that we don't use
7186 "s" to stand for a non-state.
7187
68e93ad5
AD
71882003-02-02 Akim Demaille <akim@epita.fr>
7189
7190 * src/scan-skel.l: Scan more than one inert character per yylex
7191 invocation.
7192
92898986
PE
71932003-02-01 Paul Eggert <eggert@twinsun.com>
7194
7195 Version 1.875a.
7196
1d9d5d71
PE
7197 * po/LINGUAS: Add ms.
7198
0435d061
AD
71992003-01-30 Akim Demaille <akim@epita.fr>
7200
7201 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
7202
6029a57f
PH
72032003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7204
7205 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
7206 of $1.
0435d061
AD
7207
7208 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 7209 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 7210 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 7211
6029a57f
PH
7212 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
7213 (b4_rhs_location): Ditto.
0435d061 7214 (yyfill): New function to copy from stack tree into array
6029a57f 7215 incrementally.
0435d061
AD
7216 (yyuserAction): Modify to allow incremental move of semantic values
7217 to rhs array when in GLR mode.
7218 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
7219 as needed.
7220 Remove dummy use of yystack, as there is now a guaranteed use.
7221 (yydoAction): Modify to allow incremental move of semantic values
7222 to rhs array when in GLR mode.
7223 (yyresolveAction): Ditto.
7224 (yyglrShiftDefer): Update comment.
0435d061 7225 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
7226 (yyglrReduce): Ditto.
7227 (yydoAction): Ditto
0435d061 7228
6029a57f
PH
7229 * tests/glr-regr1.at: Rename to ...
7230 * tests/glr-regression.at: Add new regression test for the problems
7231 described above (adapted from S. Eken).
7232 Update copyright notice.
7233 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
7234 * tests/Makefile.am: Ditto.
7235
6cee6297
PE
72362003-01-28 Paul Eggert <eggert@twinsun.com>
7237
7238 * data/lalr1.cc: Do not use @output_header_name@ unless
7239 b4_defines_flag is set. This fixes two bugs reported by
7240 Tim Van Holder in
161a71f3
PE
7241 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
7242 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 7243
b2a836b5
PE
72442003-01-21 Paul Eggert <eggert@twinsun.com>
7245
7246 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
7247 we don't need to worry about yyerrlab1 being reported as an
7248 "unused label" by non-GCC C compilers. The downside is that if
7249 locations are used then a couple of statements are duplicated each
7250 time YYERROR is invoked, but the upside is that the warnings
7251 should vanish.
7252 (yyerrlab1): Move code to YERROR.
7253 (yyerrlab2): Remove. Change uses back to yyerrlab1.
7254 This reverts some of the 2002-12-27 change.
7255
4196b931
PE
72562003-01-17 Paul Eggert <eggert@twinsun.com>
7257
7258 * src/output.c (symbol_printers_output): Fix typo that led
7259 to core dump. Problem reported by Antonio Rus in
161a71f3 7260 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 7261
3ae831b4
AD
72622003-01-13 Akim Demaille <akim@epita.fr>,
7263 Quoc Peyrot <chojin@lrde.epita.fr>,
7264 Robert Anisko <anisko_r@lrde.epita.fr>
7265
7266 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
7267 when the stacks contain one element, as the loop would otherwise
7268 free the last state, and then use the top state (the one we just
7269 popped). This means that the initial elements will not be freed
7270 explicitly, as is the case in yacc.c; it is not a problem, as
7271 these elements have fake values.
7272
e3aa65c5
PE
72732003-01-11 Paul Eggert <eggert@twinsun.com>
7274
7275 * NEWS: %expect-violations are now just warnings, reverting
7276 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
7277 bootstrapping problem reported by Matthias Klose; see
161a71f3 7278 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
7279 * src/conflicts.c (conflicts_print): Likewise.
7280 * tests/conflicts.at (%expect not enough, %expect too much,
7281 %expect with reduce conflicts): Likewise.
7282 * doc/bison.texinfo (Expect Decl): Document this. Also mention
7283 that the warning is enabled if the number of conflicts changes
7284 (not necessarily increases).
7285
7286 * src/getargs.c (version): Update copyright year.
7287
f0057011
AD
72882003-01-09 Akim Demaille <akim@epita.fr>
7289
7290 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
7291
1ee6d2a0
PE
72922003-01-08 Paul Eggert <eggert@twinsun.com>
7293
7294 * Makefile.maint (WGETFLAGS):
7295 New macro, containing "-C off" to disable proxy caches.
7296 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
7297 (rel-check): Use $(WGET) instead of wget.
7298
d4fd77c4
PE
72992003-01-06 Paul Eggert <eggert@twinsun.com>
7300
7301 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
7302 the GLR paper of Scott, Johnstone and Hussain.
7303
464c6927
PE
73042003-01-04 Paul Eggert <eggert@twinsun.com>
7305
d600ee67
PE
7306 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
7307 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
7308 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
7309 (EXTRA_LIBRARIES): New var, for liby.a.
7310 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
7311 (EXTRA_SCRIPTS): New var, for yacc.
7312
464c6927
PE
7313 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
7314 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
7315 Problem reported by Nelson H. F. Beebe.
7316
73172003-01-03 Paul Eggert <eggert@twinsun.com>
7318
7319 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
7320 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7321 when compiling Bison 1.875's `bitset bset = obstack_alloc
7322 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
7323
7324 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
7325 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
7326 grow to a huge size with typical invocation.
d600ee67 7327
464c6927
PE
7328 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
7329 Use the pattern recommended by Autoconf 2.57, except also protect
7330 against double-definition.
7331 * src/system.h: Likewise.
7332 Portability issues reported by Nelson H. F. Beebe.
d600ee67 7333
464c6927
PE
7334 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
7335 All uses changed. Provide a definition in both C and C++.
7336 (yytrue, yyfalse): Define even if defined (__cplusplus).
7337
7338 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
7339 Reported by Nelson H. F. Beebe.
d600ee67 7340
464c6927
PE
7341 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
7342
0f42c7d5
PE
73432003-01-02 Paul Eggert <eggert@twinsun.com>
7344
7345 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
7346 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
7347 Bug reported by Nelson H. F. Beebe.
7348
dc546b0f
PE
73492003-01-01 Paul Eggert <eggert@twinsun.com>
7350
7351 * Version 1.875.
7352
2c09b6a7
PE
73532002-12-30 Paul Eggert <eggert@twinsun.com>
7354
7355 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
7356 Moved here from...
7357 (<INITIAL>","): Here. This causes stray "," to be treated
7358 more uniformly.
7359
dc546b0f 7360 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
7361 last brace in braced code when not in Yacc mode, for compatibility
7362 with Bison 1.35. This resurrects the 2001-12-15 patch to
7363 src/reader.c.
7364
7365 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
7366 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
7367
535c0f63
PE
73682002-12-28 Paul Eggert <eggert@twinsun.com>
7369
7370 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
7371 that of SYM's type. This fixes Debian bug 168069, reported by
7372 Thomas Olsson.
d600ee67 7373
963fcc17
PE
73742002-12-28 Paul Eggert <eggert@twinsun.com>
7375
7376 Version 1.75f.
7377
7378 Switch back to the Yacc style of conflict reports, undoing some
7379 of the 2002-07-30 change.
7380 * doc/bison.texinfo (Understanding): Use Yacc style for
7381 conflict reports. Also, use new way of locating rules.
7382 * src/conflicts.c (conflict_report):
7383 Renamed from conflict_report_yacc, removing the old
7384 'conflict_report'. Translate the entire conflict report at once,
7385 so that we don't assume that "," has the same interpretation in
7386 all languages.
7387 (conflicts_output): Use Yacc-style conflict report for each state,
7388 instead of our more-complicated style.
7389 (conflicts_print): Use Yacc-style conflict report, except print
7390 the input file name when not emulating Yacc.
7391 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
7392 Conflicted Reduction, %expect not enough, %expect too much,
7393 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
7394 * tests/existing.at (GNU Cim Grammar): Likewise.
7395 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
7396
7397 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
7398 fatal): Don't invoke fflush; it's not needed and it might even be
7399 harmful for stdout, as stdout might not be open.
7400 * src/reduce.c (reduce_print): Likewise.
7401
b1efe548
PE
74022002-12-27 Paul Eggert <eggert@twinsun.com>
7403
7404 Fix a bug where error locations were not being recorded correctly.
7405 This problem was originally reported by Paul Hilfinger in
161a71f3 7406 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
7407
7408 * data/yacc.c (yyparse): New local var yylerrsp, to record the
7409 top of the location stack's error locations.
7410 (yyerrlab): Set it. When discarding a token, push its location
7411 onto yylerrsp so that we don't lose track of the error's end.
7412 (yyerrlab1): Now is only the target of YYERROR, so that we can
7413 properly record the location of the action that failed. For GCC
7414 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
7415 GCC warning about yyerrlab1 being unused if YYERROR is unused.
7416 (yyerrlab2): New label, which yyerrlab now falls through to.
7417 Compute the error's location by applying YYLLOC_DEFAULT to
7418 the locations of all the symbols that went into the error.
7419 * doc/bison.texinfo (Location Default Action): Mention that
7420 YYLLOC_DEFAULT is also invoked for syntax errors.
7421 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7422 Error locations include the locations of all the tokens that were
7423 discarded, not just the last token.
d600ee67 7424
983c5c2c
PE
74252002-12-26 Paul Eggert <eggert@twinsun.com>
7426
b1efe548
PE
7427 * src/files.c: Include quote.h.
7428 (compute_output_file_names): Warn if we detect conflicting
7429 outputs to the same file. This should catch the misunderstanding
7430 exemplified by Debian Bug 165349, reported by Bruce Stephens..
7431
7432 * src/conflicts.c (conflicts_print): If the user specifies
7433 "%expect N", report an error if there are any reduce/reduce
7434 conflicts. This is what the manual says should happen.
7435 This fixes Debian bug 130890, reported by Anthony DeRobertis.
7436 * tests/conflicts.at (%expect with reduce conflicts): New test.
7437
983c5c2c
PE
7438 Don't use m4_include on relative file names, as it doesn't work as
7439 desired if there happens to be a file with that name under ".".
d600ee67 7440
983c5c2c
PE
7441 * m4sugar/version.m4: Remove; it was included but it wasn't used.
7442 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
7443 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
7444 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
7445 * src/output.c (output_skeleton): Use full path names when
7446 specifying a file to include; don't rely on include path, as
7447 it's unreliable when the working file contains a file with
7448 that name.
d600ee67 7449
983c5c2c
PE
74502002-12-25 Paul Eggert <eggert@twinsun.com>
7451
7452 Remove obsolete references to bison.simple and bison.hairy.
7453 Problem mentioned by Aubin Mahe in
161a71f3 7454 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
7455 * data/glr.c: Comment fix.
7456 * doc/bison.1: Remove references. Also, mention "yacc".
7457
7458 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
7459 with -g option.
7460
7461 * src/parse-gram.y (declaration): Use enum "report_states" rather
7462 than its numeric value 1.
7463
7464 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
7465 opening a new one. This fixes Debian bug 165349, reported by
7466 Bruce Stephens.
7467
23f2d9dc
PE
74682002-12-24 Paul Eggert <eggert@twinsun.com>
7469
7470 Version 1.75e.
7471
7472 * Makefile.maint (cvs-update): Don't assume that the shell
7473 supports $(...), as Solaris sh doesn't.
7474
7475 * src/parse-gram.y (lloc_default): Remove test for empty
7476 nonterminals at the end, since it didn't change the result.
7477
74782002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
7479
7480 If the user does not define YYSTYPE as a macro, Bison now declares it
7481 using typedef instead of defining it as a macro. POSIX requires this.
7482 For consistency, YYLTYPE is also declared instead of defined.
7483
7484 %union directives can now have a tag before the `{', e.g., the
7485 directive `%union foo {...}' now generates the C code
7486 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
7487 The default union tag is `YYSTYPE', for compatibility with Solaris 9
7488 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
7489 instead of `yyltype'.
7490
7491 `yystype' and `yyltype' are now obsolescent macros instead of being
7492 typedefs or tags; they are no longer documented and will be
7493 withdrawn in a future release.
7494
7495 * data/glr.c (b4_location_type): Remove.
7496 (YYSTYPE): Renamed from yystype.
7497 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
7498 (struct YYLTYPE): Renamed from struct yyltype.
7499 (YYLTYPE): Renamed from yyltype.
7500 (yyltype, yystype): New (and obsolescent) macros,
7501 for backward compatibility.
7502 * data/yacc.c: Likewise.
7503
7504 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
7505 does not specify a union tag. This is for compatibility with
7506 Solaris 9 yacc.
7507
7508 * src/parse-gram.y (add_param): 2nd arg is now char * not char
7509 const *, since it is now modified by stripping surrounding { }.
7510 (current_braced_code): Remove.
7511 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
7512 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
7513 trailing " {...}". Now of type <chars>.
7514 (grammar_declaration): Adjust to bundled tokens.
7515 (code_content): Remove; stripping is now done by add_param.
7516 (print_token_value): Print contents of bundled tokens.
7517 (token_name): New function.
7518
7519 * src/reader.h (braced_code, current_braced_code): Remove.
7520 (token_name): New decl.
7521
7522 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
7523 token_type, not braced_code code_kind. All uses changed.
7524 (SC_PRE_CODE): New state, for scanning after a keyword that
7525 has (or usually has) an immediately-following braced code.
7526 (token_type): New local var, to keep track of which token type
7527 to return when scanning braced code.
7528 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 7529 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
7530 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
7531 instead of returning a token type immediately.
7532 (<INITIAL>"{"): Set token type.
7533 (<SC_BRACED_CODE>"}"): Use it.
7534 (handle_action_dollar, handle_action_at): Now returns bool
7535 indicating success. Fail if ! current_rule; this prevents a core dump.
7536 (handle_symbol_code_dollar, handle_symbol_code_at):
7537 Remove; merge body into caller.
7538 (handle_dollar, handle_at): Complain in invalid contexts.
7539
7540 * NEWS, doc/bison.texinfo: Document the above.
7541 * NEWS: Fix years and program names in copyright notice.
7542
879ca4f8
PE
75432002-12-17 Paul Eggert <eggert@twinsun.com>
7544
7545 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
7546 Reporting, Table of Symbols): Omit mentions of %lex-param and
7547 %parse-param from the documentation for now.
7548
1c5fe69d
PE
75492002-12-15 Paul Eggert <eggert@twinsun.com>
7550
7551 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
7552 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
7553 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
7554 disagreed with the Bison documentation. Bug
7555 reported by Andrew Walrond.
d600ee67 7556
1c5fe69d
PE
7557 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
7558 as the caller now does that.
7559 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
7560 (YYEMPTY): Parenthesize right hand side, since others use it.
7561 (yyparse): Don't assume that our generated code is the only code
7562 that sets yychar.
7563
d1de5372
PE
75642002-12-13 Paul Eggert <eggert@twinsun.com>
7565
7566 Version 1.75d.
7567
7568 POSIX requires a "yacc" command.
7569 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
7570 (MOSTLYCLEANFILES): Add yacc.
7571 (yacc): New rule.
1c5fe69d 7572 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
7573 as an alias for bison y.
7574
7575 * po/LINGUAS: Add da.
d600ee67 7576
d1de5372
PE
7577 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
7578 problem with latest <getopt.h>.
7579 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
7580
7581 * doc/fdl.texi: Upgrade to 1.2.
7582 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
7583 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
7584 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
7585 gnulib.
7586 * config/install-sh: Sync with autotools.
7587
7588 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 7589 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
7590 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
7591 locations are requested.
7592 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
7593 locations are requested.
7594
d0f3fe23
PE
75952002-12-12 Paul Eggert <eggert@twinsun.com>
7596
7597 Remove unportable casts and storage allocation tricks.
7598 While we're at it, remove almost all casts, since they
7599 usually aren't needed and are a sign of trouble.
7600
7601 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
7602
7603 * src/derives.c (derives_compute): Do not subtract NTOKENS from
7604 the pointer DSET returned by malloc; this isn't portable.
7605 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
7606 Similarly for DERIVES.
7607 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
7608 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
7609 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
7610
7611 * src/derives.c (derives_compute): Do not bother invoking
7612 int_of_rule_number, since rule numbers are integers.
7613
7614 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
7615 rather than XMALLOC (char, N).
7616
7617 * src/files.c (filename_split): Rewrite to avoid cast.
7618
7619 * src/gram.h (symbol_number_as_item_number,
7620 item_number_as_symbol_number, rule_number_as_item_number,
7621 item_number_as_rule_number):
7622 Now inline functions rather than macros, to avoid casts.
7623 * src/state.h (state_number_as_int): Likewise.
7624 * src/tables.c (state_number_to_vector_number,
7625 symbol_number_to_vector_number): Likewise.
7626
7627 * src/gram.h (int_of_rule_number): Remove; no longer used.
7628
7629 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
7630 since the resulting storage is always stored into.
7631
7632 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
7633 where it's needed.
7634
7635 * src/muscle_tab.c (muscle_m4_output):
7636 Now inline. Return bool, not int.
7637 * src/state.c (state_compare): Likewise.
7638 * src/symtab.c (symbol_check_defined,
7639 symbol_check_alias_consistency, symbol_pack, symbol_translation,
7640 hash_compare_symbol, hash_symbol):
7641 Likewise.
7642 * src/uniqstr.c (uniqstr_print): Likewise.
7643 * src/muscle_tab.c (muscle_m4_output_processor):
7644 New function, to avoid casts.
7645 * src/state.c (state_comparator, stage_hasher): Likewise.
7646 * src/symtab.c (symbol_check_defined_processor,
7647 symbol_check_alias_consistency_processor, symbol_pack_processor,
7648 symbol_translation_processor, hash_symbol_comparator,
7649 hash_symbol_hasher): Likewise.
7650 * src/uniqstr.c (uniqstr_print_processor): Likewise.
7651 * src/muscle_tab.c (muscles_m4_output):
7652 Use new functions instead of casting old functions unportably.
7653 * src/state.c (state_hash_new): Likewise.
7654 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
7655 symbols_token_translations_init):
7656 Likewise.
7657 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
7658
7659 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
7660 var instead of casting to long, to avoid casts.
7661 (prepare_states): Use MALLOC rather than alloca, so that we don't
7662 have to worry about alloca.
7663 * src/state.c (state_hash_lookup): Likewise.
7664
7665 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
7666 local var instead of casting to unsigned char, to avoid casts.
7667
7668 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
7669 STATE_ALLOC): Remove.
7670 (transitions_new, errs_new, reductions_new, state_new): Use malloc
7671 rather than calloc, and use offsetof to avoid allocating slightly
7672 too much storage.
7673 (state_new): Initialize all members.
7674
7675 * src/state.c (state_hash): Use unsigned accumulator, not signed.
7676
7677 * src/symtab.c (symbol_free): Remove; unused.
7678 (symbol_get): Remove cast in lhs of assignment.
7679 (symbols_do): Now static. Accept generic arguments, not
7680 hashing-related ones.
7681
7682 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
7683 (symbol_processor): Remove.
7684 (symbols_do): Remove decl; now static.
7685
7686 * src/system.h (alloca): Remove; decl no longer needed.
7687 (<stddef.h>): Include, for offsetof.
7688 (<inttypes.>, <stdint.h>): Include if available.
7689 (uintptr_t): New type, if system lacks it.
7690 (CALLOC, MALLOC, REALLOC): New macros.
7691 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
7692 new macros.
7693
7694 * src/tables.c (table_size): Now int, to pacify GCC.
7695 (table_grow, table_ninf_remap): Use signed table size.
7696 (save_row): Don't bother initializing locals when not needed.
7697 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
7698 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
7699
7700 * src/vcg.h: Correct misspellings.
7701
7702 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
7703
7704
7705 * src/getargs.c (getargs): Don't assume EOF == -1.
7706
26b4a969
PE
77072002-12-09 Paul Eggert <eggert@twinsun.com>
7708
7709 Change identifier spellings to avoid collisions with names
7710 that are reserved by POSIX.
7711
7712 Don't use names ending in _t, since POSIX reserves them.
7713 For consistency, remove _e and _s endings -- they're weren't
7714 needed to remove ambiguity. All uses changed.
7715 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
7716 turn was just renamed from struniq_t.
7717 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
7718 which in turn was just renamed from struniq_processor_t.
7719 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
7720 in turn was renamed from hash_compare_struniq_t.
7721 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
7722 (state_list): Renamed from state_list_t.
7723 * src/assoc.h (assoc): Renamed from assoc_t.
7724 * src/conflicts.c (enum conflict_resolution): Renamed from
7725 enum conflict_resolution_e.
7726 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
7727 (rule_list): Renamed from rule_list_t.
7728 * src/getargs.h (enum trace): Renamed from enum trace_e.
7729 (enum report): Renamed from enum report_e.
7730 * src/gram.h (item_number): Renamed from item_number_t.
7731 (rule_number): Renamed from rule_number_t.
7732 (struct rule_s): Remove the "rule_s" part; not used.
7733 (rule): Renamed from rule_t.
7734 (rule_filter): Renamed from rule_filter_t.
7735 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
7736 (goto_list): Renamed from goto_list_t.
7737 * src/lalr.h (goto_number): Renamed from goto_number_t.
7738 * src/location.h (location): Renamed from location_t.
7739 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
7740 and moved here from:
7741 * src/muscle_tab.h (muscle_entry_t): here.
7742 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
7743 (rule_list): Renamed from rule_list_t.
7744 * src/print_graph.c (static_graph): Renamed from graph.
7745 * src/reader.h (braced_code): Renamed from braced_code_t.
7746 Remove brace_code_e tag.
7747 * src/relation.h (relation_node): Renamed from relation_node_t.
7748 (relation_nodes): Renamed from relation_nodes_t.
7749 (relation): Renamed from relation_t.
7750 * src/state.h (state_number): Renamed from state_number_t.
7751 (struct state): Renamed from struct state_s.
7752 (state): Renamed from state_t.
7753 (transitions): Renamed from transitions_t. Unused (and
7754 misspelled) transtion_s tag removed.
7755 (errs): Renamed from errs_t. Unused errs_s tag removed.
7756 (reductions): Renamed from reductions_t. Unused tag
7757 reductions_s removed.
7758 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
7759 (struct symbol_list): Renamed from struct symbol_list_s.
7760 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
7761 (struct symbol): Renamed from struct symbol_s.
7762 (symbol): Renamed from symbol_t.
7763 * src/tables.c (vector_number): Renamed from vector_number_t.
7764 (action_number): Renamed from action_t.
7765 * src/tables.h (base_number): Renamed from base_t.
7766 * src/vcg.h (enum color): Renamed from enum color_e.
7767 (enum textmode): Renamed from enum textmode_e.
7768 (enum shape): Renamed from enum shape_e.
7769 (struct colorentry): Renamed from struct colorentry_s.
7770 (struct classname): Renamed from struct classname_s.
7771 (struct infoname): Renamed from struct infoname_s.
7772 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
7773 (enum decision): Renamed from enum decision_e.
7774 (enum orientation): Renamed from enum orientation_e.
7775 (enum alignment): Renamed from enum alignment_e.
7776 (enum arrow_mode): Renamed from enum arrow_mode_e.
7777 (enum crossing_type): Renamed from enum crossing_type_e.
7778 (enum view): Renamed from enum view_e.
7779 (struct node): Renamed from struct node_s.
7780 (node): Renamed from node_t.
7781 (enum linestyle): Renamed from enum linestyle_e.
7782 (enum arrowstyle): Renamed from enum arrowstyle_e.
7783 (struct edge): Renamed from struct edge.
7784 (edge): Renamed from edge_t.
7785 (struct graph): Renamed from struct graph_s.
7786 (graph): Renamed from graph_t.
7787 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
7788 Rename value_t -> value.
7789 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
7790 value_t_as_yystype -> value_as_yystype.
7791
7792 Don't include <errno.h> in the mainstream code, since it
7793 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
7794 * lib/get-errno.c, lib/get-errno.h: New files.
7795 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
7796 get-errno.c.
7797 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
7798 * src/output.c (output_skeleton): Likewise.
7799 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
7800 instead of errno.
7801 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
7802 Likewise.
7803 (handle_action_dollar, handle_action_at): Likewise.
7804 * src/system.h: Do not include <errno.h>.
7805 (TAB_EXT): Renamed from EXT_TAB.
7806 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
7807
7808 Avoid str[a-z]*, since <string.h> reserves that name space.
7809 Change all instances of "struniq" in names to "uniqstr", and
7810 likewise for "STRUNIQ" and "UNIQSTR".
7811 * src/uniqstr.c: Renamed from src/struniq.c.
7812 * src/uniqstr.h: Renamed from src/struniq.h.
7813 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
7814 * src/files.c (strsuffix): Remove; unused.
7815 (concat2): Renamed from stringappend. Now static.
7816 * src/files.h (strsuffix, stringappend): Remove; unused.
7817 * src/parse-gram.y (<chars>): Renamed from <string>.
7818 (<uniqstr>): Renamed from <struniq>.
7819 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
7820 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
7821 (struct graph_s.expand): Renamed from struct graph_s.stretch.
7822 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
7823 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
7824 (N_EXPAND): Renamed from N_STRETCH.
7825
7826 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
7827 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
7828 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
7829 Remove; unused.
7830 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
7831 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
7832 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
7833 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
7834 (BASE_MAXIMUM): Renamed from BASE_MAX.
7835 (BASE_MINIMUM): Renamed from BASE_MIN.
7836 (ACTION_MAX): Remove; unused.
7837 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
7838 Unnecessary casts removed from above defines.
7839
7840
7841 Fix misspelling in names.
7842 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
7843 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
7844 G_NODE_ALIGNEMENT.
7845
7846
7847 * lib/timevar.c (timevar_report): Renamed from time_report,
7848 for consistency with other names.
7849 * lib/timevar.h (timevar_report): New decl.
7850 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
7851
7852
7853 Sort include-file uses.
7854
7855 Reorder all include files under src to be in the order "system.h".
7856 then the ../lib include files in angle brackets (alphabetized),
7857 then the . include files in double-quotes (alphabetized). Fix
7858 dependency breakages encountered in this process, as follows:
7859 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
7860 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
7861 * src/state.h: Include "symtab.h".
7862
996b1c7e
PE
78632002-12-08 Paul Eggert <eggert@twinsun.com>
7864
7865 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
7866 since this causes problems when __file__ contains character
7867 sequences like "@" that are treated specially by src/scan-skel.l.
7868 Instead, just use the file's basename. This fixes the bug
7869 reported by Martin Mokrejs in
161a71f3 7870 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 7871
e19c4e5d
PE
78722002-12-06 Paul Eggert <eggert@twinsun.com>
7873
7874 Add support for rules that do not have trailing semicolons, as
7875 POSIX requires. Improve the quality of locations in Bison
7876 diagnostics.
26b4a969 7877
e19c4e5d
PE
7878 * src/location.c: Include <quotearg.h>.
7879 (empty_location): Now const.
7880 (location_print): New function. Follow the recommendation of the
7881 GNU Coding Standards for locations that span file boundaries.
7882 * src/location.h: Do not include <quotearg.h>; no longer needed.
7883 (boundary): New type.
7884 (location_t): Use it. This allows locations to span file boundaries.
7885 All member uses changed: file -> start.file or end.file (as needed),
7886 first_line -> start.line, first_column -> start.column,
7887 last_line -> end.line, last_column -> end.column.
7888 (equal_boundaries): New function.
7889 (LOCATION_RESET, LOCATION_STEP): Remove.
7890 (LOCATION_PRINT): Remove. All callers changed to use location_print.
7891 (empty_location): Now const.
7892 (location_print): New decl.
7893 * src/parse-gram.y (lloc_default): New function, which handles
7894 empty locations more accurately.
7895 (YYLLOC_DEFAULT): Use it.
7896 (%token COLON): Remove.
7897 (%token ID_COLON): New token.
26b4a969 7898 (rules): Use it.
e19c4e5d
PE
7899 (declarations, rules): Remove trailing semicolon.
7900 (declaration, rules_or_grammar_declaration):
7901 Allow empty (";") declaration.
7902 (symbol_def): Remove empty actions; no longer needed.
7903 (rules_or_grammar_declaration): Remove trailing semicolon.
7904 (semi_colon.opt): Remove.
7905 * src/reader.h: Include location.h.
7906 (scanner_cursor): New decl.
7907 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
7908 rolling our own.
7909 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
7910 of *loc.
7911 (STEP): Remove. No longer needed, now that adjust_location does
7912 the work. All uses removed.
7913 (scanner_cursor): New var.
7914 (adjust_location): Renamed from extend_location. It now sets
7915 *loc and adjusts the scanner cursor. All uses changed.
7916 Don't bother testing for CR.
7917 (handle_syncline): Remove location arg; now updates scanner cursor.
7918 All callers changed.
7919 (unexpected_end_of_file): Now accepts start boundary of token or
7920 comment, not location. All callers changed. Update scanner cursor,
7921 not the location.
7922 (SC_AFTER_IDENTIFIER): New state.
7923 (context_state): Renamed from c_context. All uses changed.
7924 (id_loc, code_start, token_start): New local vars.
7925 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
7926 processing of Yacc white space and equivalents here.
7927 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
7928 instead of returning ID immediately, since we need to search for
7929 a subsequent colon.
7930 (<INITIAL>"'", "\""): Save token_start.
7931 (<INITIAL>"%{", "{", "%%"): Save code_start.
7932 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
7933 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
7934 BEGIN context_state at end, not INITIAL.
7935 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
7936 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
7937 Return correct token start.
7938 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
7939 the start of a character, string or multiline comment is found.
7940 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
7941 Reduction): Adjust reported locations to match the more-precise
7942 results now expected.
7943 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
7944 * tests/reduce.at (Useless Rules, Reduced Automaton,
7945 Underivable Rules): Likewise.
7946 * tests/regression.at (Invalid inputs): No longer `expecting ";"
7947 or "|"' now that so many other tokens are allowed by the new grammar.
7948
7949 * src/complain.h (current_file): Remove duplicate decl;
7950 current_file is now owned by files.h.
7951 * src/complain.c, src/scan-gram.l: Include files.h.
7952
79532002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 7954
e19c4e5d
PE
7955 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
7956 promotes to int; it might be unsigned int.
7957 * data/yacc.c (yy_reduce_print): Likewise.
7958
7959 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
7960 be #defined in the prologue, not in the Bison declarations.
7961 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 7962
b64755e3
PE
79632002-12-02 Paul Eggert <eggert@twinsun.com>
7964
7965 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
7966 * lib/strtoul.c: New file, from gnulib.
7967 This fixes a porting bug reported by Peter Klein in
161a71f3 7968 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 7969
6e746484
PE
79702002-11-30 Paul Eggert <eggert@twinsun.com>
7971
b64755e3
PE
7972 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
7973 and put only a forward declaration in the prologue. This is for
7974 consistency with the other scanner helper functions.
7975
6ba55592
PE
7976 Type clashes now generate warnings, not errors, since it
7977 appears that POSIX may allow some grammars with type clashes.
7978 * src/reader.c (grammar_current_rule_check): Warn about
7979 type clashes instead of complaining.
7980 * tests/input.at (Type Clashes): Expect warnings, not complaints.
7981
6e746484
PE
7982 Add Yacc library, since POSIX requires it.
7983 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
7984 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
7985 * lib/main.c, lib/yyerror.c: New files.
7986
7987 gram_error can be static; it need not be extern.
7988 * src/reader.h (gram_error): Remove decl.
7989 * src/parse-gram.y (gram_error): Now static. Add static decl.
7990 (print_token_value): Omit parameter names from forward decl,
7991 for consistency.
7992
88510f9c
PE
79932002-11-29 Paul Eggert <eggert@twinsun.com>
7994
6e746484
PE
7995 * doc/bison.texinfo: Emphasize that yylex and yyerror must
7996 be declared before being used. E.g., one should typically
7997 declare them in the prologue. Use GNU coding style in examples.
7998 Put "const" consistently after the type it modifies. Mention
7999 that C99 supports "inline". Mention that yyerror traditionally
8000 returns "int".
8001
88510f9c
PE
8002 %parse-param and %lex-param now take just one argument, the
8003 declaration; the argument name is deduced from the declaration.
8004
8005 * doc/bison.texinfo (Parser Function, Pure Calling, Error
8006 Reporting, Table of Symbols): Document this.
8007 * src/parse-gram.y (add_param): New function.
8008 (COMMA): Remove.
8009 (declaration): Implement new rule for %parse-param and %lex-param.
8010 * src/scan-gram.l: "," now elicits a warning, rather than being
8011 a token; this is more compatible with byacc.
8012 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
8013
bb92250c
PE
80142002-11-27 Paul Eggert <eggert@twinsun.com>
8015
8016 Rename identifiers to avoid real and potential collisions.
8017
8018 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
8019 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 8020 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
8021 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
8022 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
8023 * src/parse-gram.y (print_token_value): Renamed from yyprint.
8024 All uses changed.
8025 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
8026 The name "yycontrol" violates the name space rules, and this stuff
8027 wasn't being used anyway.
8028 (input): Remove action; this stuff wasn't being used.
8029 (gram_error): Rename local variable yylloc -> loc.
8030 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
8031 (YY_DECL): Don't use "yy" at start of local variables.
8032 All uses changed, e.g., yylloc -> loc.
8033 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
8034 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
8035 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
8036 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
8037
8038 * src/parse-gram.y (gram_error): loc is now const *.
8039 * src/reader.h (gram_error): Likewise.
8040
3af4feb2
PE
80412002-11-24 Paul Eggert <eggert@twinsun.com>
8042
8043 Version 1.75c.
8044
8045 * tests/actions.at (Actions after errors): Use an output format
8046 more similar to that of the Printers and Destructors test.
8047 Test the position of the ';' token too.
8048 (Printers and Destructors): Likewise.
8049 (Printers and Destructors: %glr-parser): Remove for now, to avoid
8050 unnecessarily alarming people when the test fails.
8051
8052 * data/yacc.c (yyerrlab1): Move this label down, so that the
8053 parser does not discard the lookahead token if the user code
8054 invokes YYERROR. This change is required for POSIX conformance.
8055
8056 * lib/error.c: Sync with gnulib.
8057
80582002-11-22 Paul Eggert <eggert@twinsun.com>
8059
8060 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
8061 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
8062 * lib/xmalloc.c: Likewise.
26b4a969 8063
58004308
PE
80642002-11-20 Paul Eggert <eggert@twinsun.com>
8065
8066 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
8067
80682002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 8069
58004308
PE
8070 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
8071 should use `if (! x) abort ();' rather than `assert (x);', and
8072 anyway it's one less thing to worry about configuring.
8073
8074 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
8075 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
8076 and replace all instances of assert with abort.
8077 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8078 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
8079
8080 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
8081 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
8082 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
8083 hash_find_entry, hash_rehash, hash_insert): Likewise.
8084 * src/conflicts.c (resolve_sr_conflict): Likewise.
8085 * src/lalr.c (set_goto_map, map_goto): Likewise.
8086 * src/nullable.c (nullable_compute): Likewise.
8087 * src/output.c (prepare_rules, token_definitions_output): Likewise.
8088 * src/reader.c (packgram, reader): Likewise.
8089 * src/state.c (state_new, state_free, state_transitions_set,
8090 state_reduction_find): Likewise.
8091 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
8092 symbol_pack): Likewise.
8093 * src/tables.c (conflict_row, pack_vector): Likewise.
8094 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
8095 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
8096 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
8097 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
8098
8099 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
8100 (ARGMATCH_CONSTRAINT): New macro.
8101 (ARGMATCH_ASSERT): Use it.
8102
8103 * src/system.h (verify): New macro.
8104 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
8105 rather than assert.
8106 * src/tables.c (tables_generate): Likewise.
8107
8108 * src/struniq.c (struniq_assert): Now returns void, and aborts
8109 if the assertion is false.
8110 (struniq_assert_p): Remove.
8111 * src/struniq.h: Likewise.
8112
76ae8198
PE
81132002-11-18 Paul Eggert <eggert@twinsun.com>
8114
8115 * data/glr.c (yygetLRActions): Replace `yyindex' with
8116 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
8117 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 8118 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 8119
d3c4e709
AD
81202002-11-18 Akim Demaille <akim@epita.fr>
8121
8122 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
8123 space.
8124 From Tim Van Holder.
8125
8d8a7238
PE
81262002-11-17 Paul Eggert <eggert@twinsun.com>
8127
8128 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
8129 to "SyntaxError" for consistency with my 2002-11-15 change.
8130
8131 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
8132 not define to {}, since this breaks the common use of `YYDPRINTF
8133 ((...));' if a single statement is desired (e.g. before `else').
8134 Work around GCC warnings by surrounding corresponding calls with
8135 {} if needed.
8136 (yyhasResolvedValue): Remove unused function.
8137 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
8138 loop body.
8139 (yyreportSyntaxError): Renamed from yyreportParseError.
8140 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
8141 All uses changed.
8142 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
8143 extern when possible. Remove unused initializations.
8144
b0937b22
AD
81452002-11-16 Akim Demaille <akim@epita.fr>
8146
8147 Augment the similarity between GLR and LALR traces.
8148
8149 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
8150 (YY_REDUCE_PRINT): New.
8151 (yyparse): Use them.
8152 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
8153 YYDPRINT here.
8154 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
8155 state reached after the reduction/recovery, since...
8156 (yyparse, yyprocessOneStack): Report the state we are entering in.
8157
c5e3e510
AD
81582002-11-16 Akim Demaille <akim@epita.fr>
8159
8160 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
8161 Add support for --trace=skeleton.
8162 * src/scan-skel.l: %option debug.
8163 Scan strings of non-@ or \n instead of character by character.
8164 (scan_skel): Handle trace_skeleton.
8165 (QPUTS): New.
8166 (@output_parser_name@, @output_header_name@): ``Restore'' their
8167 support (used to be M4 macros).
8168 * data/yacc.c: Quote larger chunks, a la glr.c.
8169 * data/lalr1.cc: Likewise.
8170 The header guards are no longer available, so use some other
8171 string than `YYLSP_NEEDED'.
8172
4c6cc1db
AD
81732002-11-16 Akim Demaille <akim@epita.fr>
8174
8175 Make the ``Printers and Destructors'' test more verbose, taking
8176 `yacc.c''s behavior as (possibly wrong) reference.
8177
8178 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
8179 instead of fprint on stdout.
8180 Set and report the last_line of the symbols.
8181 Consistently display values and locations.
8182
6d9e8019
PE
81832002-11-16 Paul Eggert <eggert@twinsun.com>
8184
8185 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
8186
6e649e65
PE
81872002-11-15 Paul Eggert <eggert@twinsun.com>
8188
b25d88f6
PE
8189 * tests/actions.at (Actions after errors): New test case.
8190
6e649e65
PE
8191 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
8192 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
8193 tests/action.at, tests/calc.at, tests/conflicts.at,
8194 tests/cxx-type.at, tests/regression.at:
8195 "parse error" -> "syntax error" for POSIX compatibility.
8196 "parsing stack overflow..." -> "parser stack overflow" so
8197 that code matches Bison documentation.
8198
0f39aab9
AD
81992002-11-15 Akim Demaille <akim@epita.fr>
8200
8201 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
8202 take two BRACED_CODE, not two string_content.
8203 Free the scanner's obstack when we are done.
8204 (code_content): New.
8205 * tests/calc.at: Adjust.
8206 * doc/bison.texinfo: Adjust.
8207 Also, make sure to include the `,' for these declarations.
8208
761c1926
AD
82092002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
8210
8211 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
8212 definition; avoids potential autoreconf problems.
8213
b0f98b10
AD
82142002-11-15 Akim Demaille <akim@epita.fr>
8215
8216 Always check the value returned by yyparse.
8217
8218 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
8219 returned by yyparse.
8220 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
8221 Adjust calls.
8222 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
8223 returned by yyparse.
8224
970785f1
PH
82252002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8226
8227 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
8228 on input.at test.
8229
8fcc7db1
PE
82302002-11-14 Paul Eggert <eggert@twinsun.com>
8231
7ec1b48e
PE
8232 * src/output.c (output_skeleton): Call xfopen instead of
8233 duplicating xfopen's body.
8234
cfff7583 8235 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 8236 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 8237
8fcc7db1
PE
8238 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
8239 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
8240 Group compiler. Instead, use "$CC -E bar.c". Include the .h
8241 file twice in the grammar, as an extra check.
8242
8243 * tests/input.at (Torturing the Scanner): Surround the
8244 backslash-newline tests with "#if 0", to make it less likely that
8245 we'll run into compiler bugs. Bring back solitary \ inside
8246 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 8247 test backslash-newline in C character constant.
8fcc7db1 8248
4e8d992c
AD
82492002-11-14 Akim Demaille <akim@epita.fr>
8250
8251 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
8252 status of the compiler.
f32b346d 8253 Calling `exit 1' is no longer needed.
4e8d992c
AD
8254 Reported by Nelson H. F. Beebe.
8255
9501dc6e
AD
82562002-11-14 Akim Demaille <akim@epita.fr>
8257
8258 * tests/atlocal.in (CPPFLAGS): We have config.h.
8259 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
8260 New.
8261 * tests/actions.at, tests/calc.at, tests/conflicts.at,
8262 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
8263 * tests/regression.at, tests/torture.at: Use them for all the
8264 grammars that are to be compiled.
8265 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
8266 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
8267 * doc/bison.texinfo (GLR Parsers): Document `inline'.
8268
18b519c0
AD
82692002-11-14 Akim Demaille <akim@epita.fr>
8270
8271 * doc/bison.texinfo: Various formatting changes (alignments in
8272 samples, additional @group/@end group, GCS in samples.
8273 Use @deffn instead of simple @table to define the directives,
8274 macros, variables etc.
8275
9a86cdb9
PE
82762002-11-13 Paul Eggert <eggert@twinsun.com>
8277
daa33def 8278 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 8279 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 8280
daa33def 8281 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 8282 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
8283 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
8284 * tests/headers.at (export YYLTYPE): Likewise.
8285
8286 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 8287 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 8288
9a86cdb9
PE
8289 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
8290 comments, since they're not portable. Use GNU coding style.
8291
9c1e26bd
AD
82922002-11-13 Akim Demaille <akim@epita.fr>
8293
8294 * data/yacc.c: Leave bigger chunks of quoted text.
8295 (YYDSYMPRINTF): New.
8296 Use it to report symbol activities.
8297 * data/glr.c (YYDSYMPRINTF): New.
8298 Use it.
8299
87f721cc
PE
83002002-11-12 Paul Eggert <eggert@twinsun.com>
8301
8302 Version 1.75b.
8303
8304 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
8305 (yyglrReduce): Return yyok, not 0.
8306 This should avoid the enumerated-type warnings reported
464c6927 8307 by Nelson H. F. Beebe in
161a71f3 8308 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
8309
8310 * lib/bbitset.h (BITSET_INLINE): Remove.
8311 * lib/bitset.h [! BITSET_INLINE]: Remove.
8312 (bitset_set, bitset_reset, bitset_test): Rename local vars
8313 to avoid shadowing warnings by GCC.
8314
8315 * data/glr.c (inline): Remove #define. It's the user's
8316 responsibility to #define it away, just like 'const'.
464c6927 8317 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 8318 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 8319
87f721cc
PE
8320 * Makefile.maint (po-check): Scan .l and .y files instead of the
8321 .c and the .h files that they generate. This fixes the bug
8322 reported by Tim Van Holder in:
161a71f3 8323 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
8324 Look for N_ as well as for _. Try to avoid matching #define for
8325 N_ and _.
8326 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
8327 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
8328 * src/scan-gram.l: Revamp regular expressions so that " and '
8329 do not confuse xgettext.
8330
8331 * src/struniq.h (struniq_new): Do not declare the return type
8332 to be 'const'; this violates the C standard.
8333 * src/struniq.c (struniq_new): Likewise.
8334
be14ade5
AD
83352002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
8336
8337 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
8338 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
8339 linker.
8340
05291fbc
AD
83412002-11-12 Akim Demaille <akim@epita.fr>
8342
8343 * Makefile.maint: Sync with Autoconf:
8344 (local_updates): New.
8345
1f5fd52e
AD
83462002-11-12 Akim Demaille <akim@epita.fr>
8347
8348 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
8349
283f1e64
AD
83502002-11-12 Akim Demaille <akim@epita.fr>
8351
8352 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
8353 locations.
8354
886b69d1
AD
83552002-11-12 Akim Demaille <akim@epita.fr>
8356
8357 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
8358 not yyvalue.
8359
3df37415
AD
83602002-11-12 Akim Demaille <akim@epita.fr>
8361
8362 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
8363 Use it to test the GLR parser.
8364
7bd6c77e
AD
83652002-11-12 Akim Demaille <akim@epita.fr>
8366
8367 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
8368 defines it.
8369 * data/glr.c (yystos): New.
8370 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
8371 (YYDSYMPRINT): New.
8372 (yyval): Don't define it, it is handled via M4.
8373 (yyrecoverParseError): Free verbosely the discarded symbols.
8374 * data/yacc.c (yysymprint): Remove, rather...
8375 (b4_yysymprint_generate): invoke.
8376 * data/c.m4 (b4_yysymprint_generate): New.
8377 Accept pointers as arguments, as opposed to the version from
8378 yacc.c.
8379 (b4_yydestruct_generate): Likewise.
8380 * tests/cations.at (Printers and Destructors): Use Bison directives
8381 instead of CPP macros.
8382 Don't rely on internal details.
8383
b0400cc6
AD
83842002-11-12 Akim Demaille <akim@epita.fr>
8385
8386 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
8387 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
8388 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
8389 it against YYEMPTY and so forth), work on yytoken (i.e., set
8390 it to YYEMPTY etc.).
8391 (yydestruct): Replace with a b4_yydestruct_generate invocation.
8392 (b4_symbol_actions): Remove.
8393 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
8394 for 0, end-of-input.
8395
72f889cc
AD
83962002-11-12 Akim Demaille <akim@epita.fr>
8397
8398 * doc/bison.texinfo (Destructor Decl): New.
8399
b1ae9233
AD
84002002-11-12 Akim Demaille <akim@epita.fr>
8401
8402 * src/tables.c (tables_generate): Use free for pointers that
8403 cannot be NULL, not XFREE.
8404 (pack_vector): Use assert, not fatal, for bound violations.
8405 * src/state.c (state_new): Likewise.
8406 * src/reader.c (reader): Likewise.
8407 * src/lalr.c (set_goto_map): Likewise.
72f889cc 8408 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
8409 the file name.
8410
7ec2d4cd
AD
84112002-11-12 Akim Demaille <akim@epita.fr>
8412
8413 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
8414 Restore.
8415 * src/scan-gram.l (last_string): Is global to the file, not to
8416 yylex.
8417 * src/parse-gram.y (input): Don't append the epilogue here,
8418 (epilogue.opt): do it here, and free the scanner's obstack.
8419 * src/reader.c (epilogue_set): Rename as...
8420 (epilogue_augment): this.
8421 * data/c.m4 (b4_epilogue): Defaults to empty.
8422
573a6cd3
AD
84232002-11-12 Akim Demaille <akim@epita.fr>
8424
8425 * src/getargs.c (long_options): Remove duplicates.
8426 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
8427 Remove.
8428 * doc/bison.rnh: Remove.
8429 * doc/bison.texinfo (VMS Invocation): Remove.
8430
95612cfa
AD
84312002-11-12 Akim Demaille <akim@epita.fr>
8432
8433 * src/struniq.h, src/struniq.c (struniq_t): Is const.
8434 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
8435
8436 Use struniq for symbols.
8437
8438 * src/symtab.h (symbol_t): The tag member is a struniq.
8439 (symbol_type_set): Adjust.
8440 * src/symtab.c (symbol_new): Takes a struniq.
8441 (symbol_free): Don't free the tag member.
8442 (hash_compare_symbol_t, hash_symbol_t): Rename as...
8443 (hash_compare_symbol, hash_symbol): these.
8444 Use the fact that tags as struniqs.
8445 (symbol_get): Use struniq_new.
8446 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
8447 Returns a strniq.
8448 * src/reader.h (merger_list, grammar_currentmerge_set): The name
8449 and type members are struniqs.
8450 * src/reader.c (get_merge_function)
8451 (grammar_current_rule_merge_set): Adjust.
8452 (TYPE, current_type): Are struniq.
8453
8454 Use struniq for file names.
8455
8456 * src/files.h, src/files.c (infile): Split into...
8457 (grammar_file, current_file): these.
8458 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
8459 * src/reduce.c (reduce_print): Likewise.
8460 * src/getargs.c (getargs): Likewise.
8461 * src/complain.h, src/complain.c: Likewise.
8462 * src/main.c (main): Call struniqs_new early enough to use it for
8463 file names.
8464 Don't free the input file name.
8465
3e6656f9
AD
84662002-11-12 Akim Demaille <akim@epita.fr>
8467
8468 * src/symtab.c (symbol_free): Remove dead deactivated code:
8469 type_name are properly removed.
8470 Don't use XFREE to free items that cannot be NULL.
8471 * src/struniq.h, src/struniq.c: New.
8472 * src/main.c (main): Initialize/free struniqs.
8473 * src/parse-gram.y (%union): Add astruniq member.
8474 (yyprint): Adjust.
8475 * src/scan-gram.l (<{tag}>): Return a struniq.
8476 Free the obstack bit that used to store it.
8477 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
8478
7672019c
PE
84792002-11-11 Paul Eggert <eggert@twinsun.com>
8480
8481 Revamp to fix many (but not all) of the C- and M4-related quoting
8482 problems. Among other things, this fixes the Bison bug reported
8483 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 8484 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
8485
8486 Use new @ escapes consistently. Represent brackets with @{ and @}
8487 rather than @<:@ and @:>@, since this works a bit better with dumb
8488 editors like vi. Represent @ with @@, since @ is now consistently
8489 an escape. Use @oline@ and @ofile@ rather than __oline__ and
8490 __ofile__, to avoid unexpected expansions. Similarly, use @output
8491 rather than #output.
8492
8493 * data/c.m4 (b4_copyright): Omit file name from comment, since
8494 the file name could contain "*/".
8495 (b4_synclines_flag): Don't quote the 2nd argument; it should already
8496 be quoted. All uses changed.
8497
8498 * data/glr.c: Use new @ escapes consistently.
8499 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
8500 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
8501 Remove, since they couldn't handle arbitrary characters in file
8502 names.
8503 * data/lalr1.cc: Likewise.
8504 * data/yacc.c: Likewise.
8505
8506 * src/files.c (output_infix): Remove; all uses removed.
8507 * src/files.h: Likewise.
8508
8509 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
8510 mishandled funny characters in file names, and anyway it isn't
8511 needed any more.
8512 * data/yacc.c: Likewise.
8513 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
8514
8515 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
8516 * data/yacc.c: Likewise.
8517
8518 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
8519 strings now.
8520 (muscle_init): Quote filename as a C string.
8521 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
8522 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
8523 * src/output.c (escaped_file_name_output): New function.
8524 (prepare_symbols): Quote tokens for M4.
8525 (prepare): Don't insert output_infix, output_prefix,
8526 output_parser_name, output_header_name; this is now down by scan-skel.
8527 Insert skeleton as a C string.
8528
8529 * src/output.c (user_actions_output, symbol_destructors_output,
8530 symbol_printers_output): Quote filenames for C and M4.
8531 * src/reader.c (prologue_augment, epilogue_set): Likewise.
8532
8533 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
8534 escapes other than \\ and \'; this simplifies the code.
8535 (<SC_STRING>): Likewise, for \\ and \".
8536 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
8537 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
8538 Use new escapes @{ and @} for [ and ].
8539
8540 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
8541 them with auto vars.
8542 Switch to new escape scheme, where @ is the escape character uniformly.
8543 Abort if a stray escape character is found. Avoid unbounded input
8544 buffer when parsing non-escaped text.
8545
8546 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
8547 __oline__, #output, $@, and @{ do not have unintended meanings.
8548
acea4f3b
PE
85492002-11-09 Paul Eggert <eggert@twinsun.com>
8550
8551 Fix the test failure due to GCC warnings described in
161a71f3 8552 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
8553 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
8554 evaluate to 0 if it's impossible for NINF to be in the respective
8555 table.
8556 (yygetLRActions, yyrecoverParseError): Use them.
8557
8558 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
8559 counted in the token inserted at end of file. Now takes
8560 location_t *, not location_t, so that the location can be
8561 adjusted. All uses changed.
8562
8563 * tests/regression.at (Invalid inputs): Adjust wording in
8564 diagnostic to match the new behavior.
8565
8566 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
8567 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
8568 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
8569 abort ();'. This reduces the runtime of the "Many lookaheads"
8570 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
8571 GCC 3.2.
8572
20ef1ad5
PE
85732002-11-07 Paul Eggert <eggert@twinsun.com>
8574
8575 * src/parse-gram.y (CHARACTER): Remove unused token.
8576 All uses removed.
8577
8578 * src/scan-gram.l: Remove stack option. We no longer use the
8579 stack, since the stack was never deeper than 1; instead, use the
8580 new auto var c_context to record the stacked value.
8581
8582 Remove nounput option. At an unexpected end of file, we now unput
8583 the minimal input necessary to end cleanly; this simplifies the
8584 code.
8585
8586 Avoid unbounded token sizes where this is easy.
8587
8588 (unexpected_end_of_file): New function.
8589 Use it to systematize the error message on unexpected EOF.
8590 (last-string): Now auto, not static.
8591 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
8592 (scanner_last_string_free): Remove; not used.
8593 (percent_percent_count): Move decl to just before use.
8594 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
8595 not the (never otherwised-used) CHARACTER.
8596
93724f13
AD
85972002-11-07 Akim Demaille <akim@epita.fr>
8598
8599 Let yyerror always receive the msg as last argument, so that
8600 yyerror can be variadic.
8601
8602 * data/yacc.c (b4_yyerror_args): New.
8603 Use it when calling yyerror.
8604 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
8605 Use it when calling yyerror.
8606 * doc/bison.texinfo (Error Reporting): Adjust.
8607 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
8608 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
8609
6e40b4eb
AD
86102002-11-06 Akim Demaille <akim@epita.fr>
8611
8612 #line should have quoted strings.
8613 Ideally, this should be done by m4_quotearg.
8614
8615 * src/scan-skel.l: Include quotearg.h.
8616 Quote __ofile__.
8617 * src/output.c (symbol_printers_output)
8618 (symbol_destructors_output): Quote the file name.
8619
2dfbfc12
AD
86202002-11-06 Akim Demaille <akim@epita.fr>
8621
8622 * tests/regression.at (Invalid inputs): Adjust to the recent
8623 messages.
8624
437c2d80
AD
86252002-11-06 Akim Demaille <akim@epita.fr>
8626
8627 Restore --no-lines.
8628 Reported by Jim Kent.
8629
8630 * data/c.m4 (b4_syncline): New.
8631 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
8632 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
8633 * src/output.c (user_actions_output): Likewise.
8634 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 8635 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 8636
900c5db5
AD
86372002-11-06 Akim Demaille <akim@epita.fr>
8638
8639 * src/main.c (main): Free `infile'.
8640 * src/scan-gram.l (handle_syncline): New.
8641 Recognize `#line'.
8642 * src/output.c (user_actions_output, symbol_destructors_output)
8643 (symbol_printers_output): Use the location's file name, not
8644 infile.
8645 * src/reader.c (prologue_augment, epilogue_set): Likewise.
8646
e183b123 86472002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 8648
e183b123 8649 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 8650 either has GLR conflict entries.
e183b123 8651
193eb6b7
PE
86522002-11-05 Paul Eggert <eggert@twinsun.com>
8653
e183b123
PE
8654 * src/scan-gram.l: Use more accurate diagnostics, e.g.
8655 "integer out of range" rather than "invalid value".
8656 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
8657 accordingly.
8658
193eb6b7
PE
8659 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
8660 Also, remove one static variable in the scanner.
8661
8662 * src/scan-gram.l (braces_level): Now auto, not static.
8663 Initialize to zero if the compiler is being picky.
8664 (INITIAL): Clear braces_level instead of incrementing it.
8665 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
8666 as POSIX 1003.1-2001 requires.
8667 * src/system.h (IF_LINT): New macro, taken from coreutils.
8668 * configure.ac: Define "lint" if --enable-gcc-warnings.
8669
29c01725
AD
86702002-11-05 Akim Demaille <akim@epita.fr>
8671
8672 * src/scan-gram.l: When it starts with `%', complain about the
8673 whole directive, not just that `invalid character: %'.
8674
8aeac3ca
AD
86752002-11-04 Akim Demaille <akim@epita.fr>
8676
8677 * Makefile.maint: Update from Autoconf.
8678 (update, cvs-update, po-update, do-po-update): New.
8679
793a58bb
AD
86802002-11-04 Akim Demaille <akim@epita.fr>
8681
8682 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
8683 and yyerror.
8684 Have yyerror `use' its arguments.
8685 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
8686 returns true when location & yacc & pure & parse-param.
8687 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
8688
c4d720cd
AD
86892002-11-04 Akim Demaille <akim@epita.fr>
8690
8691 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
8692 clashes.
8693 * src/scan-gram.l: Use [\'] instead of ['] to pacify
8694 font-lock-mode.
8695 Use complain_at.
8696 Use quote, not quote_n since LOCATION_PRINT no longer uses the
8697 slot 0.
8698
613a0dc5
PE
86992002-11-03 Paul Eggert <eggert@twinsun.com>
8700
8701 * src/reader.c (get_merge_function, grammar_current_rule_check):
8702 Use consistent diagnostics for reporting type name clashes.
8703 Quote the types with <>, for consistency with Yacc.
8704 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
8705
2a8d363a
AD
87062002-11-03 Akim Demaille <akim@epita.fr>
8707
8708 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
8709 New.
8710 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
8711 (b4_parse_param): Remove.
8712 Use b4_identification.
8713 Propagate b4_pure_args where needed to pass them to yyerror.
8714 * data/glr.m4 (b4_parse_param): Remove.
8715 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
8716 (b4_lpure_formals): New.
8717 Use b4_identification.
8718 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
8719 b4_user_formals and b4_user_args.
8720 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
8721 (yyreportAmbiguity): When using a pure parser, also need
8722 the location, and the parse-params.
8723 Adjust callers.
8724 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
8725 When using a pure parser, also need the parse-params.
8726 Adjust callers.
8727 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
8728 (%pure-parser + %parse-param) LALR and GLR parsers.
8729 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
8730 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
8731 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
8732 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
8733 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
8734 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
8735 * doc/bison.texinfo: Untabify the whole file.
8736 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
8737 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
8738 (Error Reporting): Adjust to these new directives.
8739 Document %error-verbose, deprecate YYERROR_VERBOSE.
8740
9e32add8
AD
87412002-11-03 Akim Demaille <akim@epita.fr>
8742
8743 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
8744 AT_CHECK_CALC_GLR invocations to use % directives, instead of
8745 command line options.
8746 * tests/cxx-type.at: Formatting changes.
8747
b02d90a5
PE
87482002-11-03 Paul Eggert <eggert@twinsun.com>
8749
8750 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
8751 to count columns correctly, and to check for invalid inputs.
9e32add8 8752
b02d90a5
PE
8753 Use mbsnwidth to count columns correctly. Account for tabs, too.
8754 Include mbswidth.h.
8755 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
8756 (extend_location): New function.
8757 (YY_LINES): Remove.
8758
8759 Handle CRLF in C code rather than in Lex code.
8760 (YY_INPUT): New macro.
8761 (no_cr_read): New function.
8762
8763 Scan UCNs, even though we don't fully handle them yet.
8764 (convert_ucn_to_byte): New function.
8765
8766 Handle backslash-newline correctly in C code.
8767 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
8768 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
8769 all uses changed.
8770 (tag, splice): New EREs. Do not allow NUL or newline in tags.
8771 Use {splice} wherever C allows backslash-newline.
8772 YY_STEP after space, newline, vertical-tab.
8773 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 8774
b02d90a5
PE
8775 (letter, id): Don't assume ASCII; e.g., spell out a-z.
8776
8777 ({int}, handle_action_dollar, handle_action_at): Check for integer
8778 overflow.
9e32add8 8779
b02d90a5
PE
8780 (YY_STEP): Omit trailing semicolon, so that it's more like C.
8781
8782 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
8783 as well as \000. Check for UCHAR_MAX, not 255.
8784 Allow \x with an arbitrary positive number of digits, as in C.
8785 Check for overflow here.
8786 Allow \? and UCNs, for compatibility with C.
8787
8788 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
8789 with quote slot used by complain_at.
8790
8791 * tests/input.at: Add tests for backslash-newline, m4 quotes
8792 in symbols, long literals, and funny escapes in strings.
8793
8794 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
8795 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
8796 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
8797 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
8798 * m4/mbswidth.m4: New file, from GNU coreutils.
8799
8800 * doc/bison.texinfo (Grammar Outline): Document // comments.
8801 (Symbols): Document that trigraphs have no special meaning in Bison,
8802 nor is backslash-newline allowed.
8803 (Actions): Document that trigraphs have no special meaning.
8804
8805 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
8806 no longer used.
8807
88082002-11-02 Paul Eggert <eggert@twinsun.com>
8809
8810 * src/reader.c: Don't include quote.h; not needed.
8811 (get_merge_function): Reword warning to be consistent with
8812 type clash diagnostic in grammar_current_rule_check.
8813
8814 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
8815 bug in trigraph handling.
8816
8817 * src/output.c (prepare_symbols): When printing token names,
8818 escape "[" as "@<:@" and likewise for "]".
8819
8820 * src/system.h (errno): Remove declaration, as we are now
8821 assuming C89 or better, and C89 guarantees errno.
8822
762b212b
PE
88232002-10-30 Paul Eggert <eggert@twinsun.com>
8824
8825 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
8826 Check for close failures.
8827 * src/files.h (xfclose): Return void, not int, since it always
8828 returned zero.
8829 * src/files.c (xfclose): Likewise. Report I/O error if ferror
8830 indicates one.
8831 * src/output.c (output_skeleton): Use xfclose rather than fclose
8832 and ferror. xfclose now checks ferror.
8833
8834 * data/glr.c (YYLEFTMOST_STATE): Remove.
8835 (yyreportTree): Use a stack-based leftmost state. This avoids
8836 our continuing battles with bogus warnings about initializers.
8837
56100c60
AD
88382002-10-30 Akim Demaille <akim@epita.fr>
8839
8840 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
8841 #if.
8842
51b4a04c
PH
88432002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8844
8845 * tests/glr-regr1.at: New test for reported regressions.
8846 * tests/testsuite.at: Add glr-regr1.at test.
8847 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 8848
bf1ebda2
PE
88492002-10-24 Paul Eggert <eggert@twinsun.com>
8850
5c16c6b1
PE
8851 Version 1.75a.
8852
bf1ebda2
PE
8853 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
8854 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
8855 we use malloc. Don't assume 'A' through 'Z' are contiguous.
8856 Don't assume strdup exists; POSIX says its an XSI extension.
8857 Check for buffer overflow on input.
8858
b526ee61
AD
88592002-10-24 Akim Demaille <akim@epita.fr>
8860
8861 * src/output.c (output_skeleton): Don't disable M4sugar comments
8862 too soon: it results in comments being expanded.
8863 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
8864 first output.
8865
f1886bb2
AD
88662002-10-24 Akim Demaille <akim@epita.fr>
8867
8868 * data/yacc.c (m4_int_type): New.
8869 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
8870 char' as only yacc.c wants K&R portability.
8871 * data/glr.c (yysigned_char): Remove.
8872 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
8873 Reported by Quoc Peyrot.
8874
c5576256
PE
88752002-10-23 Paul Eggert <eggert@twinsun.com>
8876
8877 * src/main.c (main): With --trace=time, report times even if a
8878 non-fatal error occurs. Formerly, the times were reported in some
8879 such cases but not in others.
8880 * src/reader.c (reader): Just return if a complaint has been issued,
8881 instead of exiting, so that 'main' can report times.
8882
27b0ffea
AD
88832002-10-22 Akim Demaille <akim@epita.fr>
8884
8885 * src/system.h: Include sys/types.
8886 Reported by Bert Deknuydt.
8887
223a7883
PE
88882002-10-23 Paul Eggert <eggert@twinsun.com>
8889
8890 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
8891 Suggested by Art Haas.
8892
88932002-10-22 Paul Eggert <eggert@twinsun.com>
8894
8895 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
8896 decl; not needed any more.
8897 * src/main.c (main): Use return to exit, undoing yesterday's change.
8898 The last OS that we could find where this wouldn't work is
8899 SunOS 3.5, and that's too old to worry about now.
8900
8901 * data/glr.c (struct yyltype): Define members even when not
8902 doing locations. This is more consistent with yacc.c, and it
8903 works around the following bug reports:
161a71f3
PE
8904 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
8905 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 8906
223a7883
PE
8907 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
8908 @acronym consistently. Standardize on "Yacc" instead of "YACC",
8909 "Algol" instead of "ALGOL". Give a bit more history about BNF.
8910
8b76775a
AD
89112002-10-22 Akim Demaille <akim@epita.fr>
8912
8913 * data/README: New.
8914
6db10d14
PE
89152002-10-21 Paul Eggert <eggert@twinsun.com>
8916
8917 Be consistent about 'bool'; the old code used an enum in one
8918 module and an int in another, and this violates the C standard.
8919 * m4/stdbool.m4: New file, from coreutils 4.5.3.
8920 * configure.ac (AC_HEADER_STDBOOL): Add.
8921 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
8922 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
8923 * src/symtab.c (hash_compare_symbol_t): Likewise.
8924 * src/system.h (bool, false, true): Use a definition consistent
8925 with ../lib/hash.c. All uses changed.
8926
8927 * src/complain.c (warning_issued): Renamed from warn_message_count,
8928 so that we needn't worry about integer overflow (!).
8929 Now of type bool. All uses changed.
8930 (complaint_issued): Renamed from complain_message_count; likewise.
8931
8932 * src/main.c (main): Use exit to exit with failure.
27b0ffea 8933
6db10d14
PE
8934 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
8935 rather than 1 and 0.
8936 * src/main.c (main): Likewise.
8937 * src/getargs.c (getargs): Likewise.
8938 * src/reader.c (reader): Likewise.
8939
8940 * src/getarg.c (getargs): Remove duplicate code for
8941 "Try `bison --help'".
8942
8943 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
8944 What was that "2" for?
8945
8946 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
8947 * src/getargs.c (usage): Likewise.
8948
8949 * src/getargs.c (getargs): When there are too few operands, report
8950 the last one. When there are too many, report the first extra
8951 one. This is how diffutils does it.
8952
92a060fd
PE
89532002-10-20 Paul Eggert <eggert@twinsun.com>
8954
8955 Remove K&R vestiges.
8956 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
8957 * src/complain.c (VA_START): Remove. Assume prototypes.
8958 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
8959 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
8960 fatal): Assume prototypes.
8961 * src/complain.h: Assume prototypes.
8962 * src/system.h (PARAMS): Remove.
8963 Include <limits.h> unconditionally, since it's guaranteeed even
8964 for a freestanding C89 compiler.
8965 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
8966 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 8967
e7cb57c0
AD
89682002-10-20 Akim Demaille <akim@epita.fr>
8969
8970 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
8971 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
8972 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
8973 (yyresolveStates, yyresolveAction, yyresolveStack)
8974 (yyprocessOneStack): Use them.
8975 (yy_reduce_print): New.
8976 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
8977
0245f82d
AD
89782002-10-20 Akim Demaille <akim@epita.fr>
8979
8980 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
8981 arguments and output `void'.
8982 (b4_c_function): Rename as...
8983 (b4_c_function_def): this.
8984 (b4_c_function_decl, b4_c_ansi_function_def)
8985 (b4_c_ansi_function_decl): New.
8986 Change the interpretation of the arguments: before `int, foo', now
8987 `int foo, foo'.
8988 * data/yacc.c (yyparse): Prototype and define thanks to these.
8989 Adjust b4_c_function_def uses.
8990 * data/glr.c (yyparse): Likewise, but ANSI only.
8991
39912f52
AD
89922002-10-20 Akim Demaille <akim@epita.fr>
8993
8994 * src/output.c (prepare): Move the definition of `tokens_number',
8995 `nterms_number', `undef_token_number', `user_token_number_max'
8996 to...
8997 (prepare_tokens): Here.
8998 (prepare_tokens): Rename as...
8999 (prepare_symbols): this.
9000 (prepare): Move the definition of `rules_number' to...
9001 (prepare_rules): here.
9002 (prepare): Move the definition of `last', `final_state_number',
9003 `states_number' to...
9004 (prepare_states): here.
9005 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
9006
20c1e2ad
AD
90072002-10-20 Akim Demaille <akim@epita.fr>
9008
9009 * src/tables.h, src/tables.c, src/output.c: Comment changes.
9010
21964f43
AD
90112002-10-20 Akim Demaille <akim@epita.fr>
9012
9013 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
9014 * data/c.m4: here.
9015
66d30cd4
AD
90162002-10-20 Akim Demaille <akim@epita.fr>
9017
9018 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
9019 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
9020 `pair'.
9021 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
9022 `name' to...
9023 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
9024 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
9025 These.
9026
95f2c9fe
PE
90272002-10-19 Paul Eggert <eggert@twinsun.com>
9028
9029 Do not create a temporary file, as that involves security and
9030 cleanup headaches. Instead, use a pair of pipes.
9031 Derived from a suggestion by Florian Krohm.
9032 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
9033 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
9034 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
9035 (BISON_PREREQ_SUBPIPE): Add.
9036 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
9037 Add subpipe.h, subpipe.c.
9038 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
9039 * po/POTFILES.in: Add lib/subpipe.c.
9040 * src/output.c: Include "subpipe.h".
9041 (m4_invoke): Remove decl.
9042 (scan_skel): New decl.
9043 (output_skeleton): Use pipe rather than temporary file for m4 input.
9044 Check that m4sugar.m4 is readable, to avoid deadlock.
9045 Check for pipe I/O error.
9046 * src/scan-skel.l (readpipe): Remove decl.
9047 (scan_skel): New function, to be used in place of m4_invoke.
9048 Read from stream rather than file.
66d30cd4 9049
95f2c9fe
PE
9050 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
9051 float, as this generates a warning on Solaris 8 + GCC 3.2 with
9052 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
9053 this generates a more-accurate value anyway.
9054
9055 * lib/timevar.c (timervar_accumulate): Rename locals to
9056 avoid confusion with similarly-named more-global.
9057 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
9058
9059 * src/output.c (prepare): Use xstrdup to convert char const *
9060 to char *, to avoid GCC warning.
9061
c19988b7
AD
90622002-10-19 Akim Demaille <akim@epita.fr>
9063
9064 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
9065 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
9066 Use them to have `calc.y' ready for %pure-parser.
9067 * data/yacc.c (YYLEX): Pass a yylex return type to
9068 b4_c_function_call.
9069
ae7453f2
AD
90702002-10-19 Akim Demaille <akim@epita.fr>
9071
9072 Prototype support of %lex-param and %parse-param.
9073
9074 * src/parse-gram.y: Add the definition of the %lex-param and
9075 %parse-param tokens, plus their rules.
9076 Drop the `_' version of %glr-parser.
9077 Add the "," token.
9078 * src/scan-gram.l (INITIAL): Scan them.
9079 * src/muscle_tab.c: Comment changes.
9080 (muscle_insert, muscle_find): Rename `pair' as `probe'.
9081 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
9082 (muscle_entry_s): The `value' member is no longer const.
9083 Adjust all dependencies.
9084 * src/muscle_tab.c (muscle_init): Adjust: use
9085 MUSCLE_INSERT_STRING.
9086 Initialize the obstack earlier.
9087 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
9088 (muscle_pair_list_grow): New.
9089 * data/c.m4 (b4_c_function_call, b4_c_args): New.
9090 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
9091 * tests/calc.at: Use %locations, not --locations.
9092 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
9093
0e575721
AD
90942002-10-19 Akim Demaille <akim@epita.fr>
9095
9096 * src/getargs.c (usage): Take status as argument and exit
9097 accordingly.
9098 Report the traditional `Try ... --help' message when status != 0.
9099 (usage, version): Don't take a FILE * as arg, it is pointless.
9100 (getargs): When there is an incorrect number of arguments, make it
9101 an error, and report it GNUlically thanks to `usage ()'.
9102
724ce7f5
PE
91032002-10-18 Paul Eggert <eggert@twinsun.com>
9104
3a781eb2
PE
9105 * data/glr.c (yyreportParseError): Don't assume that sprintf
9106 yields the length of the printed string, as this is not true
9107 on SunOS 4.1.4. Reported by Peter Klein.
9108
724ce7f5
PE
9109 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
9110 * tests/conflicts.at (%nonassoc and eof): Likewise.
9111 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
9112
473d0a75
AD
91132002-10-17 Akim Demaille <akim@epita.fr>
9114
9115 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
9116 * src/getargs.c (trace_types, trace_args): Adjust.
9117 * src/reader.c (grammar_current_rule_prec_set)
9118 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
9119 Standardize error messages.
9120 And s/@prec/%prec/!
9121 (reader): Use trace_flag to enable scanner/parser debugging,
9122 instead of an adhoc scheme.
9123 * src/scan-gram.l: Remove trailing debugging code.
9124
e76d2469
PE
91252002-10-16 Paul Eggert <eggert@twinsun.com>
9126
93e2236a
PE
9127 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
9128 MUSCLE_TAB_H.
9129
e76d2469
PE
9130 * NEWS: Officially drop support for building Bison with K&R C,
9131 since it didn't work anyway and it's not worth worrying about.
9132 * Makefile.maint (wget_files): Remove ansi2knr.c.
9133 (ansi2knr.c-url_prefix): Remove.
9134 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
9135 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9136 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9137
5bd1c419
PE
91382002-10-15 Paul Eggert <eggert@twinsun.com>
9139
9140 Stop using the "enum_" trick for K&R-style function definitions;
9141 it confused me, and I was the author! Instead, assume that people
9142 who want to use K&R C compilers (when using these modules in GCC,
9143 perhaps?) will run ansi2knr.
9144
9145 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
9146 All uses of "enum_" changed to "enum ".
9147 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9148 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 9149
5bd1c419
PE
9150 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
9151 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
9152 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
9153 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
9154 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
9155 abitset_not, abitset_ones, abitset_or, abitset_or_and,
9156 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
9157 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
9158 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
9159 Use function prototypes; this removes the need for declaring
9160 static functions simply to provide their prototypes.
9161 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
9162 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
9163 bitset_count_, bitset_create, bitset_dump, bitset_first,
9164 bitset_free, bitset_init, bitset_last, bitset_next,
9165 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
9166 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
9167 bitset_print, bitset_release_memory, bitset_toggle_,
9168 bitset_type_choose, bitset_type_get, bitset_type_name_get,
9169 debug_bitset): Likewise.
9170 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
9171 * lib/bitset_stats.c (bitset_log_histogram_print,
9172 bitset_percent_histogram_print, bitset_stats_and,
9173 bitset_stats_and_cmp, bitset_stats_and_or,
9174 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
9175 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
9176 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
9177 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
9178 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
9179 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
9180 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
9181 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
9182 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
9183 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
9184 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
9185 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
9186 bitset_stats_zero): Likewise.
9187 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9188 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9189 bitsetv_dump, debug_bitsetv): Likewise.
9190 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
9191 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
9192 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
9193 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
9194 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
9195 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
9196 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
9197 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
9198 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
9199 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
9200 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
9201 Likewise.
9202 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
9203 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
9204 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
9205 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
9206 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
9207 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
9208 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
9209 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
9210 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
9211 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
9212 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 9213
ae26e1f0
AD
92142002-10-14 Akim Demaille <akim@epita.fr>
9215
9216 Version 1.75.
9217
d43baf71
AD
92182002-10-14 Akim Demaille <akim@epita.fr>
9219
9220 * tests/Makefile.am (maintainer-check-posix): New.
9221
7ebc83e3
AD
92222002-10-14 Akim Demaille <akim@epita.fr>
9223
9224 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
9225 member.
9226
05846dae
AD
92272002-10-14 Akim Demaille <akim@epita.fr>
9228
9229 * src/tables.c (table_ninf_remap): base -> tab.
9230 Reported by Matt Rosing.
9231
1318e37d
PE
92322002-10-14 Paul Eggert <eggert@twinsun.com>
9233
447fbb17
PE
9234 * tests/action.at, tests/calc.at, tests/conflicts.at,
9235 tests/cxx-type.at, tests/headers.at, tests/input.at,
9236 tests/regression.at, tests/synclines.at, tests/torture.at:
9237 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
9238 so that the tests still work even if POSIXLY_CORRECT is set.
9239 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 9240
1318e37d
PE
9241 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
9242 for portability to K&R hosts. Fix typo: signed char is guaranteed
9243 only to 127, not to 128.
9244 * data/glr.c (yysigned_char): New type.
9245 * data/yacc.c (yysigned_char): Likewise.
9246 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
9247
cc0f0794
PE
92482002-10-13 Paul Eggert <eggert@twinsun.com>
9249
5038f418
PE
9250 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
9251 true due to limited range of data type" warning from GCC.
9252
cc0f0794
PE
9253 * data/c.m4 (b4_token_defines): Protect against double-inclusion
9254 by wrapping enum yytokentype's definition inside #ifndef
9255 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
9256
6fed0802
AD
92572002-10-13 Akim Demaille <akim@epita.fr>
9258
9259 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
9260 Un yy- yyrhs to avoid the name clash with the global YYRHS.
9261
32f0598d
AD
92622002-10-13 Akim Demaille <akim@epita.fr>
9263
9264 * Makefile.maint: Update from Autoconf 2.54.
9265 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
9266
7ea9a33f
AD
92672002-10-13 Akim Demaille <akim@epita.fr>
9268
9269 * src/print.c (print_state): Separate the list of solved conflicts
9270 from the other items.
9271 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
9272
ea99527d
AD
92732002-10-13 Akim Demaille <akim@epita.fr>
9274
9275 Let nondeterministic skeletons be usable with deterministic
9276 tables.
9277
9278 With the patch, GAWK compiled by GCC without -O2 passes its test
9279 suite using a GLR parser driven by LALR tables. It fails with -O2
9280 because `struct stat' gives two different answers on my machine:
9281 88 (definition of an auto var) and later 96 (memset on this var).
9282 Hence the stack is badly corrumpted. The headers inclusion is to
9283 blame: if I move the awk.h inclusion before GLR's system header
9284 inclusion, the two struct stat have the same size.
9285
9286 * src/tables.c (pack_table): Always create conflict_table.
9287 (token_actions): Always create conflict_list.
9288 * data/glr.c (YYFLAG): Remove, unused.
9289
f377f69f
AD
92902002-10-13 Akim Demaille <akim@epita.fr>
9291
9292 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
9293 (O0FLAGS): New.
9294 (VALGRIND, GXX): New.
9295 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
9296 * tests/bison.in: Run $PREBISON a pre-command.
9297 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
9298 (maintainer-check-g++): New.
9299 * Makefile.am (maintainer-check): New.
9300
2a1fe6ed
AD
93012002-10-13 Akim Demaille <akim@epita.fr>
9302
9303 * data/glr.c: Formatting changes.
9304 Tweak some trace messages to match yacc.c's.
9305
f50adbbd
AD
93062002-10-13 Akim Demaille <akim@epita.fr>
9307
9308 GLR parsers sometimes raise parse errors instead of performing the
9309 default reduction.
9310 Reported by Charles-Henry de Boysson.
9311
9312 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 9313 check the length of the traces when %glr.
f50adbbd
AD
9314 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
9315 GLR's traces.
9316 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
9317 Test GLR parsers.
9318 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
9319 (yyltype): Remove the yy prefix from the member names.
9320 (yytable): Complete its comment.
9321 (yygetLRActions): Map error action number from YYTABLE from
9322 YYTABLE_NINF to 0.
9323 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
9324 (which was a bug: it should have been YYTABEL_NINF, and yet it was
9325 not satisfying as we could compare an YYACTION computed from
9326 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
9327 only value for error actions.
9328 (yyreportParseError): In verbose parse error messages, don't issue
9329 `error' in the list of expected tokens.
9330 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
9331 next action to perform to match glr.c's decoding.
9332 (yytable): Complete its comment.
9333
bcbad5b9
PE
93342002-10-13 Paul Eggert <eggert@twinsun.com>
9335
9336 Fix problem reported by Henrik Grubbstroem in
161a71f3 9337 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
9338 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
9339 because the Bison parser reads the second action before reducing
9340 the first one.
9341 * src/scan-gram.l (rule_length): New static var.
9342 Use it to keep track of the rule length in the scanner, since
9343 we can't expect the parser to be in lock-step sync with the scanner.
9344 (handle_action_dollar, handle_action_at): Use this var.
9345 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 9346
14904b89
PE
93472002-10-12 Paul Eggert <eggert@twinsun.com>
9348
1fe611e5
PE
9349 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
9350 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
9351 Include <sys/time.h> when checking for clock_t and struct tms.
9352 Use same include order as source.
9353 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 9354 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 9355
1fe611e5
PE
9356 * lib/timevar.c: Update copyright date and clarify comments.
9357 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 9358
1fe611e5
PE
9359 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
9360 GCC version as of today, then merge Bison's changes.
9361 Change "GCC" to "Bison" in copyright notice. timevar.def's
9362 author is Akim, so change that too.
9363
98194095
PE
9364 * src/reader.c (grammar_current_rule_check):
9365 Don't worry about the default action if $$ is untyped.
9366 Prevents bogus warnings reported by Jim Gifford in
161a71f3 9367 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 9368
14904b89
PE
9369 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
9370 * data/glr.c, data/lalr1.cc, data/yacc.c:
9371 Output token definitions before the first part of user declarations.
9372 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 9373 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 9374
ff6dca18
PE
93752002-10-11 Paul Eggert <eggert@twinsun.com>
9376
9377 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
9378 (yyparse): here. This undoes some of the 2002-07-25 change.
9379 Compatibility problem reported by Ralf S. Engelschall with
9380 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
9381
eb714592
AD
93822002-10-11 Akim Demaille <akim@epita.fr>
9383
9384 * tests/regression.at Characters Escapes): New.
9385 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
9386 characters.
9387 Reported by Jan Nieuwenhuizen.
9388
b7195100
AD
93892002-10-11 Akim Demaille <akim@epita.fr>
9390
9391 * po/id.po: New.
9392
f28a0f2d
PE
93932002-10-10 Paul Eggert <eggert@twinsun.com>
9394
9395 Portability fixes for bitsets; this also avoids several GCC
9396 warnings.
9397
9398 * lib/abitset.c: Include <stddef.h>, for offsetof.
9399 * lib/lbitset.c: Likewise.
9400
9401 * lib/abitset.c (abitset_bytes): Return a size that is aligned
9402 properly for vectors of objects. Do not assume that adding a
9403 header size to a multiple of a word size yields a value that is
9404 properly aligned for the whole union.
9405 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9406
9407 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
9408 unique names for structures.
9409 * lib/ebitset.c (ebitset_bytes): Likewise.
9410 * lib/lbitset.c (lbitset_bytes): Likewise.
9411
9412 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
9413 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
9414 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
9415 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
9416 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
9417 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
9418 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
9419 to improve the type-checking that GCC can do.
9420 * lib/bitset.c (bitset_op4_cmp): Likewise.
9421 * lib/bitset_stats.c (bitset_stats_count,
9422 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
9423 bitset_stats_copy, bitset_stats_disjoint_p,
9424 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
9425 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
9426 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
9427 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
9428 bitset_stats_and_or_cmp, bitset_stats_andn_or,
9429 bitset_stats_andn_or_cmp, bitset_stats_or_and,
9430 bitset_stats_or_and_cmp): Likewise.
9431 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
9432 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
9433 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
9434 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
9435
9436 * lib/abitset.h: Include bitset.h, not bbitset.h.
9437 * lib/ebitset.h: Likewise.
9438 * lib/lbitset.h: Likewise.
9439
9440 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
9441 All instances of parameters of type enum bitset_opts are now of
9442 type enum_bitset_opts, to conform to the C Standard, and similarly
9443 for enum_bitset_type.
9444 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9445 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
9446
9447 Do not use "struct bitset_struct" to mean different things in
9448 different modules. Not only is this confusing, it violates
9449 the C Standard, which requires that structure types in different
9450 modules must be compatible if one is to be passed to the other.
9451 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
9452 All instances of "struct bitset_struct *" replaced with "bitset".
9453 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
9454 (union bitset_union, struct abitset_struct, struct ebitset_struct,
9455 struct lbitset_struct, struct bitset_stats_struct): New types.
9456 All uses of struct bitset_struct changed to union bitset_union,
9457 etc.
ba0fe3c7 9458 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
9459 struct bitset_struct): Remove.
9460 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
9461 struct bitset_struct): Remove.
9462 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
9463 bitset_struct): Remove.
9464 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
9465 Likewise.
9466
9467 Do not call a function of type T using a call that assumes the
9468 function is of a different type U. Standard C requires that a
9469 function must be called with a type that is compatible with its
9470 definition.
9471 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9472 New decls.
9473 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9474 New functions.
9475 * lib/ebitset.c (PFV): Remove.
9476 * lib/lbitset.c (PFV): Likewise.
9477 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
9478 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
9479 decls.
9480 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
9481 (ebitset_vtable): Use them.
9482 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
9483 lbitset_xor): New functions.
9484 (lbitset_vtable): Use them.
9485
9486 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
9487 Declare.
9488
9489 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
9490 GCC warning.
9491 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
9492 Use offsetof, for simplicity.
9493
6fbe4984
PE
94942002-10-06 Paul Eggert <eggert@twinsun.com>
9495
9496 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
9497 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 9498 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
9499 which was inadvertently undone by the 2002-09-30 patch.
9500 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
9501 the same width as int.
9502
420f93c8
PE
95032002-10-04 Paul Eggert <eggert@twinsun.com>
9504
9505 Version 1.50.
9506
9507 * configure.ac (AC_INIT), NEWS: Increment version number.
9508
9509 * doc/bison.texinfo: Minor spelling, grammar, and white space
9510 fixes.
9511 (Symbols): Mention that any negative value returned from yylex
9512 signifies end-of-input. Warn about negative chars. Mention
9513 the portable Standard C character set.
9514
9515 The GNU coding standard says CFLAGS and YFLAGS are reserved
9516 for the installer to set.
9517 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
9518 * src/Makefile.am (AM_CFLAGS): Likewise.
9519 (AM_YFLAGS): Renamed from YFLAGS.
9520
9521 Fix some MAX and MIN problems.
9522 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
9523 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
9524 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
9525 * src/reader.c (reader): Use it.
9526
9527 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
9528 POSIX 1003.1-2001 has removed fgrep.
9529
95302002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
9531
9532 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
9533 interpreted as signed.
9534 * lib/ebitset.c (ebitset_list): Fix bug.
9535
ff68026d
PE
95362002-10-01 Paul Eggert <eggert@twinsun.com>
9537
9538 More fixes for 64-bit hosts and large bitsets.
9539
9540 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
9541 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
9542 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
9543 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
9544 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
9545 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
9546 bitset_count_): Likewise.
9547 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
9548 bitset_first, bitset_last): Likewise.
9549 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
9550 bitset_stats_list_reverse, bitset_stats_size,
9551 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
9552 Likewise.
9553 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9554 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9555 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9556 bitsetv_reflexive_transitive_closure): Likewise.
9557 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
9558 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
9559 Likewise.
9560 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
9561 Likewise.
420f93c8 9562
ff68026d
PE
9563 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
9564 Use size_t, not unsigned int, to count bytes.
9565 * lib/abitset.h (abitset_bytes): Likewise.
9566 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
9567 Likewise.
9568 * lib/bitset.h (bitset_bytes): Likewise.
9569 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
9570 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
9571 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9572 * lib/ebitset.c (ebitset_bytes): Likewise.
9573 * lib/ebitset.h (ebitset_bytes): Likewise.
9574 * lib/lbitset.c (lbitset_bytes): Likewise.
9575 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 9576
ff68026d
PE
9577 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
9578 abitset_subset_p, abitset_disjoint_p, abitset_and,
9579 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
9580 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
9581 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
9582 abitset_or_and, abitset_or_and_cmp):
9583 Use bitset_windex instead of unsigned int.
9584 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
9585 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
9586 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
9587 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
9588 Likewise.
9589 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 9590
ff68026d
PE
9591 * lib/bitset.c (bitset_print):
9592 Use proper printf formats for widths of integer types.
9593 * lib/bitset_stats.c (bitset_percent_histogram_print,
9594 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
9595 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9596 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
9597 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 9598
ff68026d
PE
9599 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
9600 BITSET_SIZE_MAX): New macros.
9601 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
9602 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
9603 to BITSET_WINDEX_MAX.
9604
9605 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
9606 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
9607 since we now return the bitset_bindex type (not int).
9608
9609 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
9610 when computing sizes.
9611 * lib/ebitset.c (ebitset_elts_grow): Likewise.
9612
9613 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
9614 and avoid cast to unsigned.
9615
6aa452a6
AD
96162002-09-30 Akim Demaille <akim@epita.fr>
9617
9618 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
9619 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
9620 Updates from Michael Hayes.
9621
927f7817
AD
96222002-09-30 Art Haas <ahaas@neosoft.com>
9623
9624 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
9625 invocations.
9626 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
9627 defined.
9628
9738f41e
AD
96292002-09-27 Akim Demaille <akim@epita.fr>
9630
9631 Version 1.49c.
9632
a5c75d7f
AD
96332002-09-27 Akim Demaille <akim@epita.fr>
9634
9635 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
9636 (Because of AC_LIBSOURCE).
9637
8280e179
AD
96382002-09-27 Akim Demaille <akim@epita.fr>
9639
9640 Playing with Autoscan.
9641
9642 * configure.ac: Remove the old LIBOBJ tweaks.
9643 (AC_REPLACE_FUNCS): Add strrchr and strtol.
9644 * lib/strrchr.c: New.
9645 * lib/strtol.c: New, from the Coreutils 4.5.1.
9646
ae64af35
AD
96472002-09-27 Akim Demaille <akim@epita.fr>
9648
9649 Playing with Autoscan.
9650
9651 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
9652 * lib/Makefile.am (libbison_a_SOURCES): No longer include
9653 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
9654 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
9655 Coreutils 4.5.1.
9656
d1a1114f
AD
96572002-09-24 Akim Demaille <akim@epita.fr>
9658
9659 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
9660 (Frequently Asked Questions, Parser Stack Overflow): New.
9661
b906441c
AD
96622002-09-13 Akim Demaille <akim@epita.fr>
9663
9664 Playing with autoscan.
9665
9666 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
9667 * src/files.c (skeleton_find): Remove, unused.
9668 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
9669 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
9670
bd701811
AD
96712002-09-13 Akim Demaille <akim@epita.fr>
9672
9673 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
9674 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
9675
e0a13e7b
AD
96762002-09-13 Akim Demaille <akim@epita.fr>
9677
9678 * configure.ac: Require 2.54.
9679 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
9680 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
9681 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
9682 Remove, provided by Autoconf macros.
9683
c97011bf
AD
96842002-09-12 Akim Demaille <akim@epita.fr>
9685
9686 * m4/prereq.m4: Update, from Coreutils 4.5.1.
9687
d862b1be
AD
96882002-09-12 Akim Demaille <akim@epita.fr>
9689
9690 * m4/prereq.m4: Update, from Fileutils 4.1.5.
9691 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
9692 Reported by Martin Mokrejs.
9693
3d38c03a
AD
96942002-09-10 Akim Demaille <akim@epita.fr>
9695
9696 * src/parse-gram.y: Associate a human readable string to each
9697 token type.
9698 * tests/regression.at (Invalid inputs): Adjust.
9699
b6347355
AD
97002002-09-10 Gary V. Vaughan <gary@gnu.org>
9701
9702 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
9703 with an Autoconf-2.5x style configure.ac.
9704
09ba4ab2
PE
97052002-09-06 Paul Eggert <eggert@twinsun.com>
9706
9707 * doc/bison.texinfo (Conditions): Make explicit that the GPL
9708 exception applies only to yacc.c. This is a modification of a
9709 patch originally suggested by Akim Demaille.
9710
21846f69
AD
97112002-09-06 Akim Demaille <akim@epita.fr>
9712
09ba4ab2
PE
9713 * data/c.m4 (b4_copyright): Move the GPL exception comment from
9714 here to...
9715 * data/yacc.c: here.
9716
21846f69
AD
9717 * data/lalr1.cc (struct yyltype): Don't define it, since we use
9718 LocationType.
9719 (b4_ltype): Default to yy::Location from location.hh.
9720
c0ad8bf3
AD
97212002-09-04 Jim Meyering <jim@meyering.net>
9722
9723 * data/yacc.c: Guard the declaration of yytoknum also with
9724 `#ifdef YYPRINT', so it is declared only when used.
9725
3a93251e
AD
97262002-09-04 Akim Demaille <akim@epita.fr>
9727
9728 * configure.in: Rename as...
9729 * configure.ac: this.
9730 Bump to 1.49c.
9731
427c0dda
AD
97322002-09-04 Akim Demaille <akim@epita.fr>
9733
9734 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
9735 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
9736 translate maintainer only messages.
9737
6a254321
PE
97382002-08-12 Paul Eggert <eggert@twinsun.com>
9739
645e30d1
PE
9740 Version 1.49b.
9741
6a254321
PE
9742 * Makefile.am (SUBDIRS): Remove intl.
9743 (DISTCLEANFILES): Remove.
9744 * NEWS: Mention that GNU M4 is now required. Clarify what is
9745 meant by "larger grammars". Mention the pt_BR translation.
9746 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
9747 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
9748 Bump version from 0.11.2 to 0.11.5.
9749 (BISON_PREREQ_STAGE): Remove.
9750 (AM_GNU_GETTEXT): Use external gettext.
9751 (AC_OUTPUT): Remove intl/Makefile.
9752
9753 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
9754
9755 * data/glr.c: Include string.h, for strlen.
9756 (yyreportParseError): Use size_t for yysize.
9757 (yy_yypstack): No longer nested inside yypstates, as nested
9758 functions are not portable. Do not assume size_t is the
9759 same width as int.
9760 (yypstates): Do not assume that ptrdiff_t is the same width
9761 as int, and similarly for yyposn and YYINDEX.
9762
9763 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
9764
9765 * lib/Makefile.am (INCLUDES): Do not include from the intl
9766 directory, which has been removed.
9767 * src/Makefile.am (INCLUDES): Likewise.
9768
9769 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
9770 (bitsets_sources, additional_bitsets_sources, timevars_sources):
9771 New vars.
9772
9773 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
9774 * tests/Makefile.am (EXTRA_DIST): Likewise.
9775
9776 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
9777 Do not assume that bitset_windex is the same width as unsigned.
9778
9779 * lib/abitset.c (abitset_unused_clear): Do not assume that
9780 bitset_word is the same width as int.
9781 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
9782 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
9783 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
9784 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
9785 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
9786
9787 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
9788 portability to one's complement hosts!).
9789 * lib/ebitset.c (ebitset_op1): Likewise.
9790 * lib/lbitset.c (lbitset_op1): Likewise.
9791
9792 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
9793 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
9794 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
9795 Sync with fileutils.
9796 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
9797 lib/gettext.h: Sync with diffutils.
9798
9799 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
9800 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
9801
9802 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
9803 PROTOTYPES to check for prototypes, and "defined __STDC__" to
9804 check for void *.
9805
9806 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
9807 size_t; the old version tried to do this but casted improperly.
9808 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
9809 (bitset_test): Now returns int, not unsigned long.
9810
9811 * lib/bitset_stats.c: Include "gettext.h".
9812 (_): New macro.
9813 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
9814 name locals "index", as it generates unnecessary warnings on some
9815 hosts that have an "index" function.
9816
9817 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
9818 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
9819 they need translation.
9820 * src/LR0.c (state_list_append, new_itemsets, get_state,
9821 append_states, generate_states): Likewise.
9822 * src/assoc.c (assoc_to_string): Likewise.
9823 * src/closure.c (print_closure, set_firsts, closure): Likewise.
9824 * src/gram.c (grammar_dump): Likewise.
9825 * src/injections.c (injections_compute): Likewise.
9826 * src/lalr.c (lookaheads_print): Likewise.
9827 * src/relation.c (relation_transpose): Likewise.
9828 * src/scan-gram.l: Likewise.
9829 * src/tables.c (table_grow, pack_vector): Likewise.
9830
9831 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
9832 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
9833 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
9834 * m4/mbstate_t.m4: Sync with fileutils.
9835 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
9836
9837 * po/LINGUAS: Add pt_BR.
9838 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
9839 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
9840 lib/timevar.c.
9841 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
9842 manual recommends.
9843 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
9844
9845 * src/complain.c (strerror_r): Remove decl; not needed.
9846 (strerror): Use same pattern as ../lib/error.c.
9847
9848 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
9849
9850 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
9851
9852 * src/main.c (main): Cast result of bindtextdomain and textdomain
9853 to void, to avoid a GCC warning when --disable-nls is in effect.
9854
9855 * src/scan-gram.l: Use strings rather than escapes when possible,
9856 to minimize the number of warnings from xgettext.
9857 (handle_action_dollar, handle_action_at): Don't use isdigit,
9858 as it mishandles negative chars and it may not work as expected
9859 outside the C locale.
9860
9861 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
9862 this is a GCC extension and is not portable to other compilers.
9863
9864 * src/system.h (alloca): Use same pattern as ../lib/error.c.
9865 Do not include <ctype.h>; no longer needed.
9866 Do not include <malloc.h>; no longer needed (and generates
9867 warnings on OpenBSD 3.0).
9868
9869 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
9870 it's not portable.
9871
9872 * tests/regression.at: Do not use 'cc -c input.c -o input';
9873 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
9874
9875 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
9876 exit status as failure, not just exit status 1. Sun C exits
9877 with status 2 sometimes.
9878
9879 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
9880 Use it for the two large tests.
9881
c8f002c7
AD
98822002-08-02 Akim Demaille <akim@epita.fr>
9883
9884 * src/conflicts.c (conflicts_output): Don't output rules never
9885 reduced here, since anyway that computation doesn't work.
9886 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
9887 (rule_useless_p, rule_never_reduced_p): New.
9888 (grammar_rules_partial_print): Use a filter instead of a range.
9889 Display the title only if needed.
9890 (grammar_rules_print): Adjust.
9891 (grammar_rules_never_reduced_report): New.
9892 * src/tables.c (action_row): Move the computation of rules never
9893 reduced to...
9894 (token_actions): here.
9895 * src/main.c (main): Make the parser before making the report, so
9896 that rules never reduced are computed.
9897 Call grammar_rules_never_reduced_report.
9898 * src/print.c (print_results): Report rules never reduced.
9899 * tests/conflicts.at, tests/reduce.at: Adjust.
9900
cd08e51e
AD
99012002-08-01 Akim Demaille <akim@epita.fr>
9902
9903 Instead of attaching lookaheads and duplicating the rules being
9904 reduced by a state, attach the lookaheads to the reductions.
9905
9906 * src/state.h (state_t): Remove the `lookaheads',
9907 `lookaheads_rule' member.
9908 (reductions_t): Add a `lookaheads' member.
9909 Use a regular array for the `rules'.
9910 * src/state.c (reductions_new): Initialize the lookaheads member
9911 to 0.
9912 (state_rule_lookaheads_print): Adjust.
9913 * src/state.h, src/state.c (state_reductions_find): New.
9914 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
9915 (count_rr_conflicts): Adjust.
9916 * src/lalr.c (LArule): Remove.
9917 (add_lookback_edge): Adjust.
9918 (state_lookaheads_count): New.
9919 (states_lookaheads_initialize): Merge into...
9920 (initialize_LA): this.
9921 (lalr_free): Adjust.
9922 * src/main.c (main): Don't free nullable and derives too early: it
9923 is used by --verbose.
9924 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
9925
bb0027a9
AD
99262002-08-01 Akim Demaille <akim@epita.fr>
9927
9928 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
9929 `rule_number_t**'.
9930 (set_derives, free_derives): Rename as...
9931 (derives_compute, derives_free): this.
9932 Adjust all dependencies.
9933 * src/nullable.c (set_nullable, free_nullable): Rename as...
9934 (nullable_compute, nullable_free): these.
9935 (rule_list_t): Store rule_t *, not rule_number_t.
9936 * src/state.c (state_rule_lookaheads_print): Directly compare rule
9937 pointers, instead of their numbers.
9938 * src/main.c (main): Call nullable_free, and derives_free earlier,
9939 as they were lo longer used.
9940
3325ddc4
AD
99412002-08-01 Akim Demaille <akim@epita.fr>
9942
9943 * lib/timevar.c (get_time): Include children time.
9944 * src/lalr.h (LA, LArule): Don't export them: used with the
9945 state_t.
9946 * src/lalr.c (LA, LArule): Static.
9947 * src/lalr.h, src/lalr.c (lalr_free): New.
9948 * src/main.c (main): Call it.
9949 * src/tables.c (pack_vector): Check whether loc is >= to the
9950 table_size, not >.
9951 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
9952 (tables_generate): do it, since that's also it which allocates
9953 them.
9954 Don't free LA and LArule, main does.
9955
c6f1a33c
AD
99562002-07-31 Akim Demaille <akim@epita.fr>
9957
9958 Separate parser tables computation and output.
9959
9960 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
9961 (conflict_list, conflict_list_cnt, table, check, table_ninf)
9962 (yydefgoto, yydefact, high): Move to...
9963 * src/tables.h, src/tables.c: here.
9964 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
9965 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
9966 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
9967 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
9968 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
9969 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
9970 (action_row, save_row, token_actions, save_column, default_goto)
9971 (goto_actions, sort_actions, matching_state, pack_vector)
9972 (table_ninf_remap, pack_table, prepare_actions): Move to...
9973 * src/tables.c: here.
9974 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
9975 * src/output.c (token_actions, output_base, output_conflicts)
9976 (output_check): Merge into...
9977 (prepare_actions): this.
9978 (actions_output): Rename as...
9979 (user_actions_output): this.
9980 * src/main.c (main): Call tables_generate and tables_free.
9981
1509d42f
AD
99822002-07-31 Akim Demaille <akim@epita.fr>
9983
9984 Steal GCC's --time-report support.
9985
9986 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
9987 stolen/adjusted from GCC.
9988 * m4/stage.m4: Remove time related checks.
9989 * m4/timevar.m4: New.
9990 * configure.in: Adjust.
9991 * src/system.h: Adjust to using timevar.h.
9992 * src/getargs.h, src/getargs.c: Support trace_time for
9993 --trace=time.
9994 * src/main.c (stage): Remove.
9995 (main): Replace `stage' invocations with timevar calls.
9996 * src/output.c: Insert pertinent timevar calls.
9997
273a74fa
AD
99982002-07-31 Akim Demaille <akim@epita.fr>
9999
10000 Let --trace have arguments.
10001
10002 * src/getargs.h (enum trace_e): New.
10003 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
10004 (long_options, short_options): --trace/-T takes an optional
10005 argument.
10006 Change all the uses of trace_flag to reflect the new flags.
10007 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
10008
10009 Strengthen `stage' portability.
10010
10011 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
10012 * configure.in: Use it.
10013 Don't check for malloc.h and sys/times.h.
10014 * src/system.h: Include them when appropriate.
10015 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
10016 times and struct tms are available.
10017
217598da
AD
100182002-07-30 Akim Demaille <akim@epita.fr>
10019
10020 In verbose parse error message, don't report `error' as an
10021 expected token.
10022 * tests/actions.at (Printers and Destructors): Adjust.
10023 * tests/calc.at (Calculator $1): Adjust.
10024 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
10025 error message, do not report the parser accepts the error token in
10026 that state.
10027
52489d44
AD
100282002-07-30 Akim Demaille <akim@epita.fr>
10029
10030 Normalize conflict related messages.
10031
10032 * src/complain.h, src/complain.c (warn, complain): New.
10033 * src/conflicts.c (conflicts_print): Use them.
10034 (conflict_report_yacc): New, extracted from...
10035 (conflicts_print): here.
10036 * tests/conflicts.at, tests/existing.at: Adjust.
10037
e8832397
AD
100382002-07-30 Akim Demaille <akim@epita.fr>
10039
10040 Report rules which are never reduced by the parser: those hidden
10041 by conflicts.
10042
10043 * src/LR0.c (save_reductions): Don't make the final state too
10044 different: save its reduction (accept) instead of having a state
10045 without any action (no shift or goto, no reduce).
10046 Note: the final state is now a ``regular'' state, i.e., the
10047 parsers now contain `reduce 0' as default reduction.
10048 Nevertheless, since they decide to `accept' when yystate =
10049 final_state, they still will not reduce rule 0.
10050 * src/print.c (print_actions, print_reduction): Adjust.
10051 * src/output.c (action_row): Track reduced rules.
10052 (token_actions): Report rules never reduced.
10053 * tests/conflicts.at, tests/regression.at: Adjust.
10054
caf23d24
AD
100552002-07-30 Akim Demaille <akim@epita.fr>
10056
10057 `stage' was accidently included in a previous patch.
10058 Initiate its autoconfiscation.
10059
10060 * configure.in: Look for malloc.h and sys/times.h.
10061 * src/main.c (stage): Adjust.
10062 Report only when trace_flag.
10063
640748ee
AD
100642002-07-29 Akim Demaille <akim@epita.fr>
10065
10066 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
10067 state_number_t.
10068 (errs_t): symbol_t*, not symbol_number_t.
10069 (reductions_t): rule_t*, not rule_number_t.
10070 (FOR_EACH_SHIFT): New.
10071 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
10072 * src/print.c, src/print_graph.c: Adjust.
10073
88bce5a2
AD
100742002-07-29 Akim Demaille <akim@epita.fr>
10075
10076 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
10077
10078 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
10079 (endtoken, accept): these.
10080 * src/reader.c (reader): Set endtoken's default tag to "$end".
10081 Set undeftoken's tag to "$undefined" instead of "$undefined.".
10082 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
10083 Adjust.
10084
1bfb97db
AD
100852002-07-29 Akim Demaille <akim@epita.fr>
10086
10087 * src/reduce.c (reduce_grammar): When the language is empty,
10088 complain about the start symbol, not the axiom.
10089 Use its location.
10090 * tests/reduce.at (Empty Language): New.
10091
fc5734fe
AD
100922002-07-26 Akim Demaille <akim@epita.fr>
10093
10094 * src/reader.h, src/reader.c (gram_error): ... can't get
10095 yycontrol without making too strong assumptions on the parser
10096 itself.
10097 * src/output.c (prepare_tokens): Use the real 0th value of
10098 token_translations instead of `0'.
10099 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
10100 visible here.
10101 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
10102 for the time being: %locations ought to provide it to yyerror.
10103
3650b4b8
AD
101042002-07-25 Akim Demaille <akim@epita.fr>
10105
10106 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
10107 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
10108 * tests/regression.at (Web2c Actions): Adjust.
10109
4b3d3a8e
AD
101102002-07-25 Akim Demaille <akim@epita.fr>
10111
10112 Stop storing rules from 1 to nrules + 1.
10113
10114 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
10115 * src/nullable.c, src/output.c, src/print.c, src/reader.c
10116 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
10117 Iterate from 0 to nrules.
10118 Use rule_number_as_item_number and item_number_as_rule_number.
10119 Adjust to `derive' now containing possibly 0.
10120 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
10121 Handle the `- 1' part in rule numbers from/to item numbers.
10122 * src/conflicts.c (log_resolution): Fix the message which reversed
10123 shift and reduce.
10124 * src/output.c (action_row): Initialize default_rule to -1.
10125 (token_actions): Adjust.
10126 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
10127 expected output.
10128 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
10129
4a2a22f4
AD
101302002-07-25 Akim Demaille <akim@epita.fr>
10131
10132 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
10133 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
10134 (b4_c_knr_arg_decl): New.
10135 * data/yacc.c: Use it to define yysymprint, yydestruct, and
10136 yyreport_parse_error.
10137
b8df3223
AD
101382002-07-25 Akim Demaille <akim@epita.fr>
10139
10140 * data/yacc.c (yyreport_parse_error): New, extracted from...
10141 (yyparse): here.
10142 (yydestruct, yysymprint): Move above yyparse.
10143 Be K&R compliant.
10144
a762e609
AD
101452002-07-25 Akim Demaille <akim@epita.fr>
10146
10147 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
10148 replace...
10149 (b4_sint_type, b4_uint_type): these.
10150 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
10151 * tests/regression.at (Web2c Actions): Adjust.
10152
12b0043a
AD
101532002-07-25 Akim Demaille <akim@epita.fr>
10154
10155 * src/gram.h (TIEM_NUMBER_MAX): New.
10156 (item_number_of_rule_number, rule_number_of_item_number): Rename
10157 as...
10158 (rule_number_as_item_number, item_number_as_rule_number): these.
10159 Adjust dependencies.
10160 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
10161 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
10162 (symbol_number_to_vector_number): New.
10163 (order): Of vector_number_t* type.
10164 (base_t, BASE_MAX, BASE_MIN): New.
10165 (froms, tos, width, pos, check): Of base_t type.
10166 (action_number_t, ACTION_MIN, ACTION_MAX): New.
10167 (actrow): Of action_number_t type.
10168 (conflrow): Of unsigned int type.
10169 (table_ninf, base_ninf): New.
10170 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
10171 (muscle_insert_int_table, muscle_insert_base_table)
10172 (muscle_insert_rule_number_table): New.
10173 (prepare_tokens): Output `toknum' as int_table.
10174 (action_row): Returns a rule_number_t.
10175 Use ACTION_MIN, not SHRT_MIN.
10176 (token_actions): yydefact is rule_number_t*.
10177 (table_ninf_remap): New.
10178 (pack_table): Use it for `base' and `table'.
10179 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
10180 replaced with...
10181 (YYPACT_NINF, YYTABLE_NINF): these.
10182 (yypact, yytable): Compute their types instead of hard-coded
10183 `short'.
10184 * tests/regression.at (Web2c Actions): Adjust.
10185
5dde258a
AD
101862002-07-19 Akim Demaille <akim@epita.fr>
10187
10188 * src/scan-gram.l (id): Can start with an underscore.
10189
a945ec39
AD
101902002-07-16 Akim Demaille <akim@epita.fr>
10191
10192 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
10193 Adjust all former `associativity' dependencies.
10194 * src/symtab.c (symbol_new): Default associativity is `undef', not
10195 `right'.
10196 (symbol_check_alias_consistence): Adjust.
10197
fae437e8
AD
101982002-07-09 Akim Demaille <akim@epita.fr>
10199
10200 * doc/bison.texinfo: Properly set the ``header'' part.
10201 Use @dircategory ``GNU programming tools'' as per Texinfo's
10202 documentation.
10203 Use @copying.
10204
1a715ef2
AD
102052002-07-09 Akim Demaille <akim@epita.fr>
10206
10207 * lib/quotearg.h: Protect against multiple inclusions.
10208 * src/location.h (location_t): Add a `file' member.
10209 (LOCATION_RESET, LOCATION_PRINT): Adjust.
10210 * src/complain.c (warn_at, complain_at, fatal_at): Drop
10211 `error_one_per_line' support.
10212
a5d50994
AD
102132002-07-09 Akim Demaille <akim@epita.fr>
10214
10215 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
10216 * src/reader.c (lineno): Remove.
10217 Adjust all dependencies.
10218 (get_merge_function): Take a location and use complain_at.
10219 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
10220 * tests/regression.at (Invalid inputs, Mixing %token styles):
10221 Adjust.
10222
b275314e
AD
102232002-07-09 Akim Demaille <akim@epita.fr>
10224
10225 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
10226 recovery rule, and forbid extensions when --yacc.
10227 (gram_error): Use complain_at.
10228 * src/reader.c (reader): Exit if there were parse errors.
10229
865b9df1
AD
102302002-07-09 Akim Demaille <akim@epita.fr>
10231
10232 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
10233 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
10234 Reported by R Blake <blakers@mac.com>.
10235
c76e14da
AD
102362002-07-09 Akim Demaille <akim@epita.fr>
10237
10238 * data/yacc.c: Output the copyright notive in the header.
10239
7db2ed2d
AD
102402002-07-03 Akim Demaille <akim@epita.fr>
10241
10242 * src/output.c (froms, tos): Are state_number_t.
10243 (save_column): sp, sp1, and sp2 are state_number_t.
10244 (prepare): Rename `final' as `final_state_number', `nnts' as
10245 `nterms_number', `nrules' as `rules_number', `nstates' as
10246 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
10247 unused.
10248 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
10249 * data/lalr1.cc (nsym_): Remove, unused.
10250
e68e0410
AD
102512002-07-03 Akim Demaille <akim@epita.fr>
10252
10253 * src/lalr.h, src/lalr.c (goto_number_t): New.
10254 * src/lalr.c (goto_list_t): New.
10255 Propagate them.
10256 * src/nullable.c (rule_list_t): New.
10257 Propagate.
10258 * src/types.h: Remove.
10259
e1a4f3a4
AD
102602002-07-03 Akim Demaille <akim@epita.fr>
10261
10262 * src/closure.c (print_fderives): Use rule_rhs_print.
10263 * src/derives.c (print_derives): Use rule_rhs_print.
10264 (rule_list_t): New, replaces `shorts'.
10265 (set_derives): Add comments.
10266 * tests/sets.at (Nullable, Firsts): Adjust.
10267
536545f3
AD
102682002-07-03 Akim Demaille <akim@epita.fr>
10269
10270 * src/output.c (prepare_actions): Free `tally' and `width'.
10271 (prepare_actions): Allocate and free `order'.
10272 * src/symtab.c (symbols_free): Free `symbols'.
10273 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
10274 * src/output.c (m4_invoke): Move to...
10275 * src/scan-skel.l: here.
10276 (<<EOF>>): Close yyout, and free its name.
10277
8b752b00
AD
102782002-07-03 Akim Demaille <akim@epita.fr>
10279
10280 Fix some memory leaks, and fix a bug: state 0 was examined twice.
10281
10282 * src/LR0.c (new_state): Merge into...
10283 (state_list_append): this.
10284 (new_states): Merge into...
10285 (generate_states): here.
10286 (set_states): Don't ensure a proper `errs' state member here, do it...
10287 * src/conflicts.c (conflicts_solve): here.
10288 * src/state.h, src/state.c: Comment changes.
10289 (state_t): Rename member `shifts' as `transitions'.
10290 Adjust all dependencies.
10291 (errs_new): For consistency, also take the values as argument.
10292 (errs_dup): Remove.
10293 (state_errs_set): New.
10294 (state_reductions_set, state_transitions_set): Assert that no
10295 previous value was assigned.
10296 (state_free): New.
10297 (states_free): Use it.
10298 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
10299 temporary storage: use `errs' and `nerrs' as elsewhere.
10300 (set_conflicts): Allocate and free this `errs'.
10301
613f5e1a
AD
103022002-07-02 Akim Demaille <akim@epita.fr>
10303
10304 * lib/libiberty.h: New.
10305 * lib: Update the bitset implementation from upstream.
10306 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
10307 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
10308 * src/main.c: Adjust bitset stats calls.
10309
26e0cadc
PE
103102002-07-01 Paul Eggert <eggert@twinsun.com>
10311
10312 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
10313 char, so that negative chars don't collide with $.
10314
1154cced
AD
103152002-06-30 Akim Demaille <akim@epita.fr>
10316
10317 Have the GLR tests be `warning' checked, and fix the warnings.
10318
10319 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
10320 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
10321 (yyremoveDeletes): `yyi' and `yyj' are size_t.
10322 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
10323 (yyaddDeferredAction): static.
10324 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
10325 (yyreportParseError): yyprefix is const.
10326 yytokenp is used only when verbose.
10327 (yy__GNUC__): Replace with __GNUC__.
10328 (yypdumpstack): yyi is size_t.
10329 (yypreference): Un-yy local variables and arguments, to avoid
10330 clashes with `yyr1'. Anyway, we are not in the user name space.
10331 (yytname_size): be an int, as is compared with ints.
10332 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
10333 Use them.
10334 * tests/cxx-gram.at: Use quotation to protect $1.
10335 Use AT_COMPILE to enable warnings hunts.
10336 Prototype yylex and yyerror.
10337 `Use' argc.
10338 Include `string.h', not `strings.h'.
10339 Produce and prototype stmtMerge only when used.
10340 yylex takes a location.
10341
97650f4e
AD
103422002-06-30 Akim Demaille <akim@epita.fr>
10343
10344 We spend a lot of time in quotearg, in particular when --verbose.
10345
10346 * src/symtab.c (symbol_get): Store a quoted version of the key.
10347 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
10348 Adjust all callers.
10349
d2576365
AD
103502002-06-30 Akim Demaille <akim@epita.fr>
10351
10352 * src/state.h (reductions_t): Rename member `nreds' as num.
10353 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
10354 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
10355
ccaf65bc
AD
103562002-06-30 Akim Demaille <akim@epita.fr>
10357
10358 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
10359 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
10360 (shifts_to): Rename as...
10361 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
10362 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
10363 (TRANSITION_IS_DISABLED, transitions_to): these.
10364
87675353
AD
103652002-06-30 Akim Demaille <akim@epita.fr>
10366
10367 * src/print.c (print_shifts, print_gotos): Merge into...
10368 (print_transitions): this.
10369 (print_transitions, print_errs, print_reductions): Align the
10370 lookaheads columns.
10371 (print_core, print_transitions, print_errs, print_state,
10372 print_grammar): Output empty lines separator before, not after.
10373 (state_default_rule_compute): Rename as...
10374 (state_default_rule): this.
10375 * tests/conflicts.at (Defaulted Conflicted Reduction),
10376 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
10377 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
10378
ce4ccb4b
AD
103792002-06-30 Akim Demaille <akim@epita.fr>
10380
10381 Display items as we display rules.
10382
10383 * src/gram.h, src/gram.c (rule_lhs_print): New.
10384 * src/gram.c (grammar_rules_partial_print): Use it.
10385 * src/print.c (print_core): Likewise.
10386 * tests/conflicts.at (Defaulted Conflicted Reduction),
10387 (Unresolved SR Conflicts): Adjust.
10388 (Unresolved SR Conflicts): Adjust and rename as...
10389 (Resolved SR Conflicts): this, as was meant.
10390 * tests/regression.at (Web2c Report): Adjust.
10391
bc933ef1
AD
103922002-06-30 Akim Demaille <akim@epita.fr>
10393
10394 * src/print.c (state_default_rule_compute): New, extracted from...
10395 (print_reductions): here.
10396 Pessimize, but clarify the code.
10397 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
10398
53d4308d
AD
103992002-06-30 Akim Demaille <akim@epita.fr>
10400
10401 * src/output.c (action_row): Let default_rule be always a rule
10402 number.
10403
574fb2d5
AD
104042002-06-30 Akim Demaille <akim@epita.fr>
10405
10406 * src/closure.c (print_firsts, print_fderives, closure):
10407 Use BITSET_EXECUTE.
10408 * src/lalr.c (lookaheads_print): Likewise.
10409 * src/state.c (state_rule_lookaheads_print): Likewise.
10410 * src/print_graph.c (print_core): Likewise.
10411 * src/print.c (print_reductions): Likewise.
10412 * src/output.c (action_row): Likewise.
10413 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
10414
05811fd7
AD
104152002-06-30 Akim Demaille <akim@epita.fr>
10416
10417 * src/print_graph.c: Use report_flag.
10418
0e4d5753
AD
104192002-06-30 Akim Demaille <akim@epita.fr>
10420
10421 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
10422 to...
10423 * src/relation.h, src/relation.c (traverse, relation_digraph)
10424 (relation_print, relation_transpose): New.
10425
24c7d800
AD
104262002-06-30 Akim Demaille <akim@epita.fr>
10427
10428 * src/state.h, src/state.c (shifts_to): New.
10429 * src/lalr.c (build_relations): Use it.
10430
9222837b
AD
104312002-06-30 Akim Demaille <akim@epita.fr>
10432
10433 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
10434 (item_number_of_rule_number, rule_number_of_item_number): New.
10435 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
10436 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
10437 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
10438 Propagate their use.
10439 Much remains to be done, in particular wrt `shorts' from types.h.
10440
260008e5
AD
104412002-06-30 Akim Demaille <akim@epita.fr>
10442
10443 * src/symtab.c (symbol_new): Initialize the `printer' member.
10444
8a731ca8
AD
104452002-06-30 Akim Demaille <akim@epita.fr>
10446
10447 * src/LR0.c (save_reductions): Remove, replaced by...
10448 * src/state.h, src/state.c (state_reductions_set): New.
10449 (reductions, errs): Rename as...
10450 (reductions_t, errs_t): these.
10451 Adjust all dependencies.
10452
32e1e0a4
AD
104532002-06-30 Akim Demaille <akim@epita.fr>
10454
10455 * src/LR0.c (state_list_t, state_list_append): New.
10456 (first_state, last_state): Now symbol_list_t.
10457 (this_state): Remove.
10458 (new_itemsets, append_states, save_reductions): Take a state_t as
10459 argument.
10460 (set_states, generate_states): Adjust.
10461 (save_shifts): Remove, replaced by...
10462 * src/state.h, src/state.c (state_shifts_set): New.
10463 (shifts): Rename as...
10464 (shifts_t): this.
10465 Adjust all dependencies.
10466 * src/state.h (state_t): Remove the `next' member.
10467
e5fb6710
AD
104682002-06-30 Akim Demaille <akim@epita.fr>
10469
10470 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
10471 escaped in slot 0.
10472
c7ca99d4
AD
104732002-06-30 Akim Demaille <akim@epita.fr>
10474
10475 Use hash.h for the state hash table.
10476
10477 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
10478 (allocate_storage): Use state_hash_new.
10479 (free_storage): Use state_hash_free.
10480 (new_state, get_state): Adjust.
10481 * src/lalr.h, src/lalr.c (states): Move to...
10482 * src/states.h (state_t): Remove the `link' member, no longer
10483 used.
10484 * src/states.h, src/states.c: here.
10485 (state_hash_new, state_hash_free, state_hash_lookup)
10486 (state_hash_insert, states_free): New.
10487 * src/states.c (state_table, state_compare, state_hash): New.
10488 * src/output.c (output_actions): Do not free states now, since we
10489 still need to know the final_state number in `prepare', called
10490 afterwards. Do it...
10491 * src/main.c (main): here: call states_free after `output'.
10492
df0e7316
AD
104932002-06-30 Akim Demaille <akim@epita.fr>
10494
10495 * src/state.h, src/state.c (state_new): New, extracted from...
10496 * src/LR0.c (new_state): here.
10497 * src/state.h (STATE_ALLOC): Move to...
10498 * src/state.c: here.
10499 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
10500 * src/state.h, src/state.c: here.
10501
39f41916
AD
105022002-06-30 Akim Demaille <akim@epita.fr>
10503
10504 * src/reader.c (gensym): Rename as...
10505 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
10506 (getsym): Rename as...
10507 (symbol_get): this.
10508
d57650a5
AD
105092002-06-30 Akim Demaille <akim@epita.fr>
10510
10511 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
10512 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
10513 * src/output.c, src/print.c, src/print_graph.c: Propagate.
10514 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
10515
5a08f1ce
AD
105162002-06-30 Akim Demaille <akim@epita.fr>
10517
10518 Make the test suite pass with warnings checked.
10519
10520 * tests/actions.at (Printers and Destructors): Improve.
10521 Avoid unsigned vs. signed issues.
10522 * tests/calc.at: Don't exercise the scanner here, do it...
10523 * tests/input.at (Torturing the Scanner): here.
10524
720623af
PH
105252002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10526
88e7e941 10527 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
10528 reorganize first lines parallel to yacc.c.
10529
fb8135fa
AD
105302002-06-28 Akim Demaille <akim@epita.fr>
10531
10532 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
10533 (b4_token_enum, b4_token_defines): New, factored from...
10534 * data/lalr1.cc, data/yacc.c, glr.c: here.
10535
41442480
AD
105362002-06-28 Akim Demaille <akim@epita.fr>
10537
10538 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
10539 unused variables.
10540 * src/output.c (merger_output): static.
10541
e0e5bf84
AD
105422002-06-28 Akim Demaille <akim@epita.fr>
10543
ba0fe3c7 10544 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
10545 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
10546 pacify GCC.
10547 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 10548
676385e2
PH
105492002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10550
10551 Accumulated changelog for new GLR parsing features.
10552
6a254321 10553 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
10554 conflicts_total_count.
10555 * src/conflicts.h: Ditto.
10556 * src/output.c (token_actions): Use the new name.
10557 (output_conflicts): Change conflp => conflict_list_heads, and
10558 confl => conflict_list for better readability.
10559 * data/glr.c: Use the new names.
10560 * NEWS: Add self to GLR announcement.
e0e5bf84 10561
676385e2
PH
10562 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
10563
10564 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
10565 Akim Demaille.
10566
10567 * data/bison.glr: Change name to glr.c
10568 * data/glr.c: Renamed from bison.glr.
10569 * data/Makefile.am: Add glr.c
e0e5bf84
AD
10570
10571 * src/getargs.c:
10572
676385e2 10573 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 10574 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 10575
676385e2
PH
10576 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10577
10578 * data/bison.glr: Be sure to restore the
10579 current #line when returning to the skeleton contents after having
10580 exposed the input file's #line.
10581
10582 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10583
10584 * data/bison.glr: Bring up to date with changes to bison.simple.
10585
10586 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10587
10588 * data/bison.glr: Correct definitions that use b4_prefix.
10589 Various reformatting.
10590 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
10591 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
10592 yytokenp argument; now part of stack.
10593 (yychar): Define to behave as documented.
10594 (yyclearin): Ditto.
e0e5bf84 10595
676385e2
PH
10596 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10597
10598 * src/reader.h: Add declaration for free_merger_functions.
10599
10600 * src/reader.c (merge_functions): New variable.
10601 (get_merge_function): New function.
10602 (free_merger_functions): New function.
10603 (readgram): Check for %prec that is not followed by a symbol.
10604 Handle %dprec and %merge declarations.
10605 (packgram): Initialize dprec and merger fields in rules array.
10606
10607 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
10608 conflict_list_cnt, conflict_list_free): New variables.
10609 (table_grow): Also grow conflict_table.
e0e5bf84 10610 (prepare_rules): Output dprec and merger tables.
676385e2 10611 (conflict_row): New function.
e0e5bf84 10612 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
10613 default reduction in conflicted states for GLR parser so that there
10614 are spaces for the conflict lists.
10615 (save_row): Also save conflict information.
10616 (token_actions): Allocate conflict list.
10617 (merger_output): New function.
10618 (pack_vector): Pack conflict table, too.
10619 (output_conflicts): New function to output yyconflp and yyconfl.
10620 (output_check): Allocate conflict_tos.
10621 (output_actions): Output conflict tables, also.
10622 (output_skeleton): Output b4_mergers definition.
10623 (prepare): Output b4_max_rhs_length definition.
10624 Use 'bison.glr' as default skeleton for GLR parsers.
10625
10626 * src/gram.c (glr_parser): New flag.
10627 (grammar_free): Call free_merger_functions.
10628
10629 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
10630 all pairs of conflicting reductions, rather than just all tokens
10631 causing conflicts. Needed to size conflict tables.
e0e5bf84 10632 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
10633 interface.
10634 (conflicts_print): Ditto.
10635 (count_total_conflicts): New function.
10636
10637 * src/reader.h (merger_list): New type.
10638 (merge_functions): New variable.
10639
10640 * src/lex.h (tok_dprec, tok_merge): New token types.
10641
10642 * src/gram.h (rule_s): Add dprec and merger fields.
10643 (glr_parser): New flag.
10644
10645 * src/conflicts.h (count_total_conflicts): New function.
10646
10647 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
10648
10649 * doc/bison.texinfo (Generalized LR Parsing): New section.
10650 (GLR Parsers): New section.
10651 (Language and Grammar): Mention GLR parsing.
10652 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
10653 Correct typo ("tge" -> "the").
10654
10655 * data/bison.glr: New skeleton for GLR parsing.
10656
10657 * tests/cxx-gram.at: New tests for GLR parsing.
10658
10659 * tests/testsuite.at: Include cxx-gram.at.
10660
10661 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 10662
676385e2
PH
10663 * src/parse-gram.y:
10664
10665 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
10666
10667 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 10668
b5480d74 106692002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
10670
10671 * src/options.h, src/options.c: Remove.
10672 * src/getargs.c (short_options, long_options): New.
10673
60491a94
AD
106742002-06-27 Akim Demaille <akim@epita.fr>
10675
10676 * data/bison.simple, data/bison.c++: Rename as...
10677 * data/yacc.c, data/lalr1.cc: these.
10678 * doc/bison.texinfo (Environment Variables): Remove.
10679
9be0c25b
AD
106802002-06-25 Raja R Harinath <harinath@cs.umn.edu>
10681
10682 * src/getargs.c (report_argmatch): Initialize strtok().
10683
1ae72863
AD
106842002-06-20 Akim Demaille <akim@epita.fr>
10685
10686 * data/bison.simple (b4_symbol_actions): New, replaces...
10687 (b4_symbol_destructor, b4_symbol_printer): these.
10688 (yysymprint): Be sure to call YYPRINT only for tokens, and using
10689 user token numbers.
10690
87542d29
AD
106912002-06-20 Akim Demaille <akim@epita.fr>
10692
10693 * data/bison.simple (yydestructor): Rename as...
10694 (yydestruct): this.
10695
1a31ed21
AD
106962002-06-20 Akim Demaille <akim@epita.fr>
10697
10698 * src/symtab.h, src/symtab.c (symbol_type_set)
10699 (symbol_destructor_set, symbol_precedence_set): The location is
10700 the last argument.
10701 Adjust all callers.
10702
e776192e
AD
107032002-06-20 Akim Demaille <akim@epita.fr>
10704
10705 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
10706 internals.
10707 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
10708 Takes a location.
10709 * src/symtab.h, src/symtab.c (symbol_class_set)
10710 (symbol_user_token_number_set): Likewise.
10711 Adjust all callers.
10712 Promote complain_at.
10713 * tests/input.at (Type Clashes): Adjust.
10714
5c1180b3
AD
107152002-06-20 Akim Demaille <akim@epita.fr>
10716
10717 * data/bison.simple (YYLEX): Fix the declaration when
10718 %pure-parser.
10719
e3170060
AD
107202002-06-20 Akim Demaille <akim@epita.fr>
10721
10722 * data/bison.simple (yysymprint): Don't print the token number,
10723 just its name.
10724 * tests/actions.at (Destructors): Rename as...
10725 (Printers and Destructors): this.
10726 Also exercise %printer.
10727
253862fd
AD
107282002-06-20 Akim Demaille <akim@epita.fr>
10729
10730 * data/bison.simple (YYDSYMPRINT): New.
10731 Use it to remove many of the #if YYDEBUG/if (yydebug).
10732
366eea36
AD
107332002-06-20 Akim Demaille <akim@epita.fr>
10734
10735 * src/symtab.h, src/symtab.c (symbol_t): printer and
10736 printer_location are new members.
10737 (symbol_printer_set): New.
10738 * src/parse-gram.y (PERCENT_PRINTER): New token.
10739 Handle its associated rule.
10740 * src/scan-gram.l: Adjust.
10741 (handle_destructor_at, handle_destructor_dollar): Rename as...
10742 (handle_symbol_code_at, handle_symbol_code_dollar): these.
10743 * src/output.c (symbol_printers_output): New.
10744 (output_skeleton): Call it.
10745 * data/bison.simple (yysymprint): New. Cannot be named yyprint
10746 since there are already many grammar files with a user `yyprint'.
10747 Replace the calls to YYPRINT to calls to yysymprint.
10748 * tests/calc.at: Adjust.
10749 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
10750 taking advantage of parser very internal details (stack size!).
10751
4f25ebb0
AD
107522002-06-20 Akim Demaille <akim@epita.fr>
10753
10754 * src/scan-gram.l: Complete the scanner with the missing patterns
10755 to pacify Flex.
10756 Use `quote' and `symbol_tag_get' where appropriate.
10757
93b68a0e
AD
107582002-06-19 Akim Demaille <akim@epita.fr>
10759
10760 * tests/actions.at (Destructors): Augment to test locations.
10761 * data/bison.simple (yydestructor): Pass it the current location
10762 if locations are enabled.
10763 Prototype only when __STDC__ or C++.
10764 Change the argument names to move into the yy name space: there is
10765 user code here.
10766
58612f1d
AD
107672002-06-19 Akim Demaille <akim@epita.fr>
10768
74310291
AD
10769 * data/bison.simple (b4_pure_if): New.
10770 Use it instead of #ifdef YYPURE.
10771
107722002-06-19 Akim Demaille <akim@epita.fr>
10773
10774 * data/bison.simple (b4_location_if): New.
58612f1d
AD
10775 Use it instead of #ifdef YYLSP_NEEDED.
10776
f25bfb75
AD
107772002-06-19 Akim Demaille <akim@epita.fr>
10778
10779 Prepare @$ in %destructor, but currently don't bind it in the
10780 skeleton, as %location use is not cleaned up yet.
10781
10782 * src/scan-gram.l (handle_dollar, handle_destructor_at)
10783 (handle_action_at): New.
10784 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
10785 a braced_code_t and a location as additional arguments.
10786 (handle_destructor_dollar): Instead of requiring `b4_eval', just
10787 unquote one when outputting `b4_dollar_dollar'.
10788 Adjust callers.
10789 * data/bison.simple (b4_eval): Remove.
10790 (b4_symbol_destructor): Adjust.
10791 * tests/input.at (Invalid @n): Adjust.
10792
c732d2c6
AD
107932002-06-19 Zack Weinberg <zack@codesourcery.com>
10794
10795 * doc/bison.texinfo: Document ability to have multiple
10796 prologue sections.
10797
8c165d89
AD
107982002-06-18 Akim Demaille <akim@epita.fr>
10799
10800 * src/files.c (compute_base_names): When computing the output file
10801 names from the input file name, strip the directory part.
10802
ca98bf57
AD
108032002-06-18 Akim Demaille <akim@epita.fr>
10804
10805 * data/bison.simple.new: Comment changes.
10806 Reported by Andreas Schwab.
10807
0bfb02ff
AD
108082002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
10809
10810 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
10811 there are no `label `yyoverflowlab' defined but not used' warnings
10812 when yyoverflow is defined.
10813
24c0aad7
AD
108142002-06-18 Akim Demaille <akim@epita.fr>
10815
10816 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
10817 new member.
10818 (symbol_destructor_set): Adjust.
10819 * src/output.c (symbol_destructors_output): Output the destructor
10820 locations.
10821 Output the symbol name.
10822 * data/bison.simple (b4_symbol_destructor): Adjust.
10823
5719c109
AD
108242002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
10825 and Akim Demaille <akim@epita.fr>
10826
10827 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
10828 what's left on the stack when the error recovery hits EOF.
10829 * tests/actions.at (Destructors): Complete to exercise this case.
10830
9280d3ef
AD
108312002-06-17 Akim Demaille <akim@epita.fr>
10832
10833 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
10834 arguments is really empty, not only equal to `[]'.
10835 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
10836 member.
10837 (symbol_destructor_set): New.
10838 * src/output.c (symbol_destructors_output): New.
10839 * src/reader.h (brace_code_t, current_braced_code): New.
10840 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
10841 (handle_dollar): Rename as...
10842 (handle_action_dollar): this.
10843 (handle_destructor_dollar): New.
10844 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
10845 (grammar_declaration): Use it.
10846 * data/bison.simple (yystos): Is always defined.
10847 (yydestructor): New.
10848 * tests/actions.at (Destructors): New.
10849 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
10850
dafdc66f
AD
108512002-06-17 Akim Demaille <akim@epita.fr>
10852
10853 * src/symlist.h, src/symlist.c (symbol_list_length): New.
10854 * src/scan-gram.l (handle_dollar, handle_at): Compute the
10855 rule_length only when needed.
10856 * src/output.c (actions_output, token_definitions_output): Output
10857 the full M4 block.
10858 * src/symtab.c: Don't access directly to the symbol tag, use
10859 symbol_tag_get.
10860 * src/parse-gram.y: Use symbol_list_free.
10861
56c47203
AD
108622002-06-17 Akim Demaille <akim@epita.fr>
10863
10864 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
10865 (symbol_list_prepend, get_type_name): Move to...
10866 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
10867 (symbol_list_prepend, symbol_list_n_type_name_get): here.
10868 Adjust all callers.
10869 (symbol_list_free): New.
10870 * src/scan-gram.l (handle_dollar): Takes a location.
10871 * tests/input.at (Invalid $n): Adjust.
10872
1e0bab92
AD
108732002-06-17 Akim Demaille <akim@epita.fr>
10874
10875 * src/reader.h, src/reader.c (symbol_list_new): Export it.
10876 (symbol_list_prepend): New.
10877 * src/parse-gram.y (%union): `list' is a new member.
10878 (symbols.1): New, replaces...
10879 (terms_to_prec.1, nterms_to_type.1): these.
10880 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
10881 Take a location as additional argument.
10882 Adjust all callers.
10883
04e60654
AD
108842002-06-15 Akim Demaille <akim@epita.fr>
10885
10886 * src/parse-gram.y: Move %token in the declaration section so that
10887 we don't depend upon CVS Bison.
10888
10e5b8bd
AD
108892002-06-15 Akim Demaille <akim@epita.fr>
10890
10891 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
10892 * src/print.c (print_core): Use it.
10893
9801d40c
AD
108942002-06-15 Akim Demaille <akim@epita.fr>
10895
10896 * src/conflicts.c (log_resolution): Accept the rule involved in
10897 the sr conflicts instead of the lookahead number that points to
10898 that rule.
10899 (flush_reduce): Accept the current lookahead vector as argument,
10900 instead of the index in LA.
10901 (resolve_sr_conflict): Accept the current number of lookahead
10902 bitset to consider for the STATE, instead of the index in LA.
10903 (set_conflicts): Adjust.
10904 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
10905
c0263492
AD
109062002-06-15 Akim Demaille <akim@epita.fr>
10907
10908 * src/state.h (state_t): Replace the `lookaheadsp' member, a
10909 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
10910 Adjust all dependencies.
10911 * src/lalr.c (initialize_lookaheads): Split into...
10912 (states_lookaheads_count, states_lookaheads_initialize): these.
10913 (lalr): Adjust.
10914
9757c359
AD
109152002-06-15 Akim Demaille <akim@epita.fr>
10916
10917 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
10918 out of...
10919 (grammar_rules_print): here.
10920 * src/reduce.c (reduce_output): Use it.
10921 * tests/reduce.at (Useless Rules, Reduced Automaton)
10922 (Underivable Rules): Adjust.
10923
6b98e4b5
AD
109242002-06-15 Akim Demaille <akim@epita.fr>
10925
10926 Copy BYacc's nice way to report the grammar.
10927
10928 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
10929 New.
10930 Don't print the rules' location, it is confusing and useless.
10931 (rule_print): Use grammar_rhs_print.
10932 * src/print.c (print_grammar): Use grammar_rules_print.
10933
6b98e4b5
AD
109342002-06-15 Akim Demaille <akim@epita.fr>
10935
10936 Complete and rationalize `useless thing' warnings.
10937
10938 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
10939 (symbol_tag_print): New.
10940 Use them everywhere in place of accessing directly the tag member.
10941 * src/gram.h, src/gram.c (rule_print): New.
10942 Use it where a rule used to be printed `by hand'.
10943 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
10944 (reduce_grammar_tables): Report the useless rules.
10945 (reduce_print): Useless things are a warning, not an error.
10946 Report it as such.
10947 * tests/reduce.at (Useless Nonterminals, Useless Rules):
10948 (Reduced Automaton, Underivable Rules): Adjust.
10949 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
10950 * tests/conflicts.at (Unresolved SR Conflicts)
10951 (Solved SR Conflicts): Adjust.
10952
ee000ba4
AD
109532002-06-15 Akim Demaille <akim@epita.fr>
10954
10955 Let symbols have a location.
10956
10957 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
10958 (getsym): Adjust.
10959 Adjust all callers.
10960 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
10961 Use location_t, not int.
10962 * src/symtab.c (symbol_check_defined): Take advantage of the
10963 location.
10964 * tests/regression.at (Invalid inputs): Adjust.
10965
8efe435c
AD
109662002-06-15 Akim Demaille <akim@epita.fr>
10967
10968 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
10969 (input): Don't try to initialize yylloc here, do it in the
10970 scanner.
10971 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
10972 * src/gram.h (rule_t): Change line and action_line into location
10973 and action_location, of location_t type.
10974 Adjust all dependencies.
10975 * src/location.h, src/location.c (empty_location): New.
10976 * src/reader.h, src/reader.c (grammar_start_symbol_set)
10977 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
10978 (grammar_current_rule_symbol_append)
10979 (grammar_current_rule_action_append): Expect a location as argument.
10980 * src/reader.c (grammar_midrule_action): Adjust to attach an
10981 action's location as dummy symbol location.
10982 * src/symtab.h, src/symtab.c (startsymbol_location): New.
10983 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
10984 the line numbers.
10985
1921f1d7
AD
109862002-06-14 Akim Demaille <akim@epita.fr>
10987
10988 Grammar declarations may be found in the grammar section.
10989
10990 * src/parse-gram.y (rules_or_grammar_declaration): New.
10991 (declarations): Each declaration may end with a semicolon, not
10992 just...
10993 (grammar_declaration): `"%union"'.
10994 (grammar): Branch to rules_or_grammar_declaration.
10995
4515534c
AD
109962002-06-14 Akim Demaille <akim@epita.fr>
10997
10998 * src/main.c (main): Invoke scanner_free.
10999
f958596b
AD
110002002-06-14 Akim Demaille <akim@epita.fr>
11001
11002 * src/output.c (m4_invoke): Extracted from...
11003 (output_skeleton): here.
11004 Free tempfile.
11005
2c569025
AD
110062002-06-14 Akim Demaille <akim@epita.fr>
11007
11008 * src/parse-gram.y (directives, directive, gram)
11009 (grammar_directives, precedence_directives, precedence_directive):
11010 Rename as...
11011 (declarations, declaration, grammar, grammar_declaration)
11012 (precedence_declaration, precedence_declarator): these.
11013 (symbol_declaration): New.
11014
592e8d4d
AD
110152002-06-14 Akim Demaille <akim@epita.fr>
11016
11017 * src/files.c (action_obstack): Remove, unused.
11018 (output_obstack): Remove it, and all its dependencies, as it is no
11019 longer needed.
11020 * src/reader.c (epilogue_set): Build the epilogue in the
11021 muscle_obstack.
11022 * src/output.h, src/output.c (muscle_obstack): Move to...
11023 * src/muscle_tab.h, src/muscle_tab.h: here.
11024 (muscle_init): Initialize muscle_obstack.
11025 (muscle_free): New.
11026 * src/main.c (main): Call it.
11027
0c15323d
AD
110282002-06-14 Akim Demaille <akim@epita.fr>
11029
11030 * src/location.h: New, extracted from...
11031 * src/reader.h: here.
11032 * src/Makefile.am (noinst_HEADERS): Merge into
11033 (bison_SOURCES): this.
11034 Add location.h.
11035 * src/parse-gram.y: Use location_t instead of Bison's.
11036 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
11037 Use location_t instead of ints.
11038
e96c9728
AD
110392002-06-14 Akim Demaille <akim@epita.fr>
11040
11041 * data/bison.simple, data/bison.c++: Be sure to restore the
11042 current #line when returning to the skeleton contents after having
11043 exposed the input file's #line.
11044
75d1fe16
AD
110452002-06-12 Akim Demaille <akim@epita.fr>
11046
11047 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
11048 eager.
11049 * tests/actions.at (Exotic Dollars): New.
11050
6c35d22c
AD
110512002-06-12 Akim Demaille <akim@epita.fr>
11052
11053 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
11054 ['"/] too eagerly.
11055 * tests/input.at (Torturing the Scanner): New.
11056
1d6412ad
AD
110572002-06-11 Akim Demaille <akim@epita.fr>
11058
11059 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
11060 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
11061 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
11062 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
11063 * src/reader.c (reader): Use it.
11064
4cdb01db
AD
110652002-06-11 Akim Demaille <akim@epita.fr>
11066
11067 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
11068 Adjust all callers.
11069 (scanner_last_string_free): New.
11070
44995b2e
AD
110712002-06-11 Akim Demaille <akim@epita.fr>
11072
11073 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
11074 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
11075 (last_string, YY_OBS_FREE): New.
11076 Use them when returning an ID.
11077
e9955c83
AD
110782002-06-11 Akim Demaille <akim@epita.fr>
11079
11080 Have Bison grammars parsed by a Bison grammar.
11081
11082 * src/reader.c, src/reader.h (prologue_augment): New.
11083 * src/reader.c (copy_definition): Remove.
11084
11085 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
11086 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
11087 (grammar_current_rule_prec_set, grammar_current_rule_check)
11088 (grammar_current_rule_symbol_append)
11089 (grammar_current_rule_action_append): Export.
11090 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
11091 (symbol_list_action_append): Remove.
11092 Hook the routines from reader.
11093 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
11094 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
11095
11096 * src/reader.c (read_declarations): Remove, unused.
11097
11098 * src/parse-gram.y: Handle the epilogue.
11099 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
11100 (grammar_start_symbol_set): this.
11101 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
11102 * src/reader.c (readgram): Remove, unused.
11103 (reader): Adjust to insert eoftoken and axiom where appropriate.
11104
11105 * src/reader.c (copy_dollar): Replace with...
11106 * src/scan-gram.h (handle_dollar): this.
11107 * src/parse-gram.y: Remove `%thong'.
11108
11109 * src/reader.c (copy_at): Replace with...
11110 * src/scan-gram.h (handle_at): this.
11111
11112 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
11113 New.
11114
11115 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
11116 time being.
11117
11118 * src/reader.h, src/reader.c (grammar_rule_end): New.
11119
11120 * src/parse.y (current_type, current_class): New.
11121 Implement `%nterm', `%token' support.
11122 Merge `%term' into `%token'.
11123 (string_as_id): New.
11124 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
11125 type name.
11126
11127 * src/parse-gram.y: Be sure to handle properly the beginning of
11128 rules.
11129
11130 * src/parse-gram.y: Handle %type.
11131 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
11132
11133 * src/parse-gram.y: More directives support.
11134 * src/options.c: No longer handle source directives.
11135
11136 * src/parse-gram.y: Fix %output.
11137
11138 * src/parse-gram.y: Handle %union.
11139 Use the prologue locations.
11140 * src/reader.c (parse_union_decl): Remove.
11141
11142 * src/reader.h, src/reader.c (epilogue_set): New.
11143 * src/parse-gram.y: Use it.
11144
11145 * data/bison.simple, data/bison.c++: b4_stype is now either not
11146 defined, then default to int, or to the contents of %union,
11147 without `union' itself.
11148 Adjust.
11149 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
11150
11151 * src/output.c (actions_output): Don't output braces, as they are
11152 already handled by the scanner.
11153
11154 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
11155 characters to themselves.
11156
11157 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
11158 that the epilogue has a proper #line.
11159
11160 * src/parse-gram.y: Handle precedence/associativity.
11161
11162 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
11163 a terminal.
11164 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
11165 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
11166 at all to define terminals that cannot be emitted.
11167
11168 * src/scan-gram.l: Escape M4 characters.
11169
11170 * src/scan-gram.l: Working properly with escapes in user
11171 strings/characters.
11172
11173 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
11174 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
11175 grammar.
11176 Use more modest sizes, as for the time being the parser does not
11177 release memory, and therefore the process swallows a huge amount
11178 of memory.
11179
11180 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
11181 stricter %token grammar.
11182
11183 * src/symtab.h (associativity): Add `undef_assoc'.
11184 (symbol_precedence_set): Do nothing when passed an undef_assoc.
11185 * src/symtab.c (symbol_check_alias_consistence): Adjust.
11186
11187 * tests/regression.at (Invalid %directive): Remove, as it is now
11188 meaningless.
11189 (Invalid inputs): Adjust to the new error messages.
11190 (Token definitions): The new grammar doesn't allow too many
11191 eccentricities.
11192
11193 * src/lex.h, src/lex.c: Remove.
11194 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
11195 (copy_character, copy_string2, copy_string, copy_identifier)
11196 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
11197 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
11198 (parse_action): Remove.
11199 * po/POTFILES.in: Adjust.
11200
2e047461
AD
112012002-06-11 Akim Demaille <akim@epita.fr>
11202
cd05d13c 11203 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
11204 rule's action member: return the action as a string.
11205 Don't require `rule_length' as an argument: compute it.
11206 (grammar_current_rule_symbol_append)
11207 (grammar_current_rule_action_append): New, eved out from
11208 (readgram): here.
11209 Remove `action_flag', `rulelength', unused now.
11210
9af3fbce
AD
112112002-06-11 Akim Demaille <akim@epita.fr>
11212
11213 * src/reader.c (grammar_current_rule_prec_set).
11214 (grammar_current_rule_check): New, eved out from...
11215 (readgram): here.
11216 Remove `xaction', `first_rhs': useless.
11217 * tests/input.at (Type clashes): New.
11218 * tests/existing.at (GNU Cim Grammar): Adjust.
11219
1485e106
AD
112202002-06-11 Akim Demaille <akim@epita.fr>
11221
11222 * src/reader.c (grammar_midrule_action): New, Eved out from
11223 (readgram): here.
11224
da4160c3
AD
112252002-06-11 Akim Demaille <akim@epita.fr>
11226
11227 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
11228 New.
11229 (readgram): Use them as replacement of inlined code, crule and
11230 crule1.
11231
f6d0f937
AD
112322002-06-11 Akim Demaille <akim@epita.fr>
11233
11234 * src/reader.c (grammar_end, grammar_symbol_append): New.
11235 (readgram): Use them.
11236 Make the use of `p' as local as possible.
11237
69078d4b
AD
112382002-06-10 Akim Demaille <akim@epita.fr>
11239
11240 GCJ's parser requires the tokens to be defined before the prologue.
11241
11242 * data/bison.simple: Output the token definition before the user's
11243 prologue.
11244 * tests/regression.at (Braces parsing, Duplicate string)
11245 (Mixing %token styles): Check the output from bison.
11246 (Early token definitions): New.
11247
5e424082
AD
112482002-06-10 Akim Demaille <akim@epita.fr>
11249
11250 * src/symtab.c (symbol_user_token_number_set): Don't complain when
11251 assigning twice the same user number to a token, so that we can
11252 use it in...
11253 * src/lex.c (lex): here.
11254 Also use `symbol_class_set' instead of hand written code.
11255 * src/reader.c (parse_assoc_decl): Likewise.
11256
44536b35
AD
112572002-06-10 Akim Demaille <akim@epita.fr>
11258
11259 * src/symtab.c, src/symtab.c (symbol_class_set)
11260 (symbol_user_token_number_set): New.
11261 * src/reader.c (parse_token_decl): Use them.
11262 Use a switch instead of ifs.
11263 Use a single argument.
11264
8b9f2372
AD
112652002-06-10 Akim Demaille <akim@epita.fr>
11266
11267 Remove `%thong' support as it is undocumented, unused, duplicates
11268 `%token's job, and creates useless e-mail traffic with people who
11269 want to know what it is, why it is undocumented, unused, and
11270 duplicates `%token's job.
11271
11272 * src/reader.c (parse_thong_decl): Remove.
11273 * src/options.c (option_table): Remove "thong".
11274 * src/lex.h (tok_thong): Remove.
11275
3ae2b51f
AD
112762002-06-10 Akim Demaille <akim@epita.fr>
11277
11278 * src/symtab.c, src/symtab.c (symbol_type_set)
11279 (symbol_precedence_set): New.
11280 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
11281 (value_components_used): Remove, unused.
11282
2f1afb73
AD
112832002-06-09 Akim Demaille <akim@epita.fr>
11284
11285 Move symbols handling code out of the reader.
11286
11287 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
11288 (axiom): Move to...
11289 * src/symtab.h, src/symtab.c: here.
11290
11291 * src/gram.c (start_symbol): Remove: use startsymbol->number.
11292 * src/reader.c (startval): Rename as...
11293 * src/symtab.h, src/symtab.c (startsymbol): this.
11294 * src/reader.c: Adjust.
11295
11296 * src/reader.c (symbol_check_defined, symbol_make_alias)
11297 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11298 (token_translations_init)
11299 Move to...
11300 * src/symtab.c: here.
11301 * src/reader.c (packsymbols): Move to...
11302 * src/symtab.h, src/symtab.c (symbols_pack): here.
11303 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
11304 argument.
11305
e9bca3ad
AD
113062002-06-03 Akim Demaille <akim@epita.fr>
11307
11308 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
11309 then statements.
11310
86eff183
AD
113112002-06-03 Akim Demaille <akim@epita.fr>
11312
11313 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
11314 structs with non literals.
11315 * src/scan-skel.l: never-interactive.
11316 * src/conflicts.c (enum conflict_resolution_e): No trailing
11317 comma.
11318 * src/getargs.c (usage): Split long literal strings.
11319 Reported by Hans Aberg.
11320
717be197
AD
113212002-05-28 Akim Demaille <akim@epita.fr>
11322
11323 * data/bison.c++: Use C++ ostreams.
11324 (cdebug_): New member.
11325
670ddffd
AD
113262002-05-28 Akim Demaille <akim@epita.fr>
11327
11328 * src/output.c (output_skeleton): Be sure to allocate enough room
11329 for `/' _and_ for `\0' in full_skeleton.
11330
769b430f
AD
113312002-05-28 Akim Demaille <akim@epita.fr>
11332
11333 * data/bison.c++: Catch up with bison.simple:
11334 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11335 and Paul Eggert <eggert@twinsun.com>: `error' handing.
11336 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
11337 and popping traces.
11338
7067cb36
PH
113392002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11340
11341 * src/output.c (output_skeleton): Put an explicit path in front of
11342 the skeleton file name, rather than relying on the -I directory,
11343 to partially alleviate effects of having a skeleton file lying around
11344 in the current directory.
769b430f 11345
4a713ec2
PH
113462002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11347
769b430f 11348 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
11349 obstack_printf should be obstack_fgrow1.
11350
b408954b
AD
113512002-05-26 Akim Demaille <akim@epita.fr>
11352
11353 * src/state.h (state_t): `solved_conflicts' is a new member.
11354 * src/LR0.c (new_state): Set it to 0.
11355 * src/conflicts.h, src/conflicts.c (print_conflicts)
11356 (free_conflicts, solve_conflicts): Rename as...
11357 (conflicts_print, conflicts_free, conflicts_solve): these.
11358 Adjust callers.
11359 * src/conflicts.c (enum conflict_resolution_e)
11360 (solved_conflicts_obstack): New, used by...
11361 (log_resolution): this.
11362 Adjust to attach the conflict resolution to each state.
11363 Complete the description with the precedence/associativity
11364 information.
11365 (resolve_sr_conflict): Adjust.
11366 * src/print.c (print_state): Output its solved_conflicts.
11367 * tests/conflicts.at (Unresolved SR Conflicts)
11368 (Solved SR Conflicts): Exercise --report=all.
11369
a49aecd5
AD
113702002-05-26 Akim Demaille <akim@epita.fr>
11371
11372 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
11373 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
11374 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
11375 (token_number_t, item_number_as_token_number)
11376 (token_number_as_item_number, muscle_insert_token_number_table):
11377 Rename as...
11378 (symbol_number_t, item_number_as_symbol_number)
11379 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
11380 these, since it is more appropriate.
11381
5504898e
AD
113822002-05-26 Akim Demaille <akim@epita.fr>
11383
11384 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
11385 `Error:' lines.
11386 * data/bison.simple (yystos) [YYDEBUG]: New.
11387 (yyparse) [YYDEBUG]: Display the symbols which are popped during
11388 error recovery.
11389 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
11390
ec3bc396
AD
113912002-05-25 Akim Demaille <akim@epita.fr>
11392
11393 * doc/bison.texinfo (Debugging): Split into...
11394 (Tracing): this new section, its former contents, and...
11395 (Understanding): this new section.
11396 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
11397 by...
11398 (report_flag): this.
11399 Adjust all dependencies.
11400 (report_args, report_types, report_argmatch): New.
11401 (usage, getargs): Report/support -r, --report.
11402 * src/options.h
11403 (struct option_table_struct): Rename as..,
11404 (struct option_table_s): this.
11405 Rename the `set_flag' member to `flag' to match with getopt_long's
11406 struct.
11407 * src/options.c (option_table): Split verbose into an entry for
11408 %verbose, and another for --verbose.
11409 Support --report/-r, so remove -r from the obsolete --raw.
11410 * src/print.c: Attach full item sets and lookaheads reports to
11411 report_flag instead of trace_flag.
11412 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
11413
78df8250
PE
114142002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11415 and Paul Eggert <eggert@twinsun.com>
769b430f 11416
78df8250
PE
11417 * data/bison.simple (yyparse): Correct error handling to conform to
11418 POSIX and yacc. Specifically, after syntax error is discovered,
11419 do not reduce further before shifting the error token.
11420 Clean up the code a bit by removing the labels yyerrdefault,
11421 yyerrhandle, yyerrpop.
11422 * NEWS: Document the above.
11423
c0c9ea05
PH
114242002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11425
11426 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
11427 type; it isn't always big enough, since it doesn't necessarily
11428 include non-terminals.
769b430f 11429 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
11430 the latter can be removed.
11431 (yy_token_number_type): Remove, only one use.
11432 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
11433 don't use TokenNumberType as element type.
769b430f 11434
c0c9ea05
PH
11435 * tests/regression.at: Modify expected output to agree with change
11436 to yyr1 and yytranslate.
769b430f 11437
6390a83f
FK
114382002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
11439
11440 * src/reader.c (parse_action): Use copy_character instead of
11441 obstack_1grow.
11442
db7c8e9a
AD
114432002-05-13 Akim Demaille <akim@epita.fr>
11444
11445 * tests/regression.at (Token definitions): Prototype yylex and
11446 yyerror.
11447
fcc61800
PH
114482002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11449
158c687b 11450 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
11451 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
11452 32-bit arithmetic.
11453 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
11454
5683e9b2
AD
114552002-05-07 Akim Demaille <akim@epita.fr>
11456
11457 * tests/synclines.at: Be sure to prototype yylex and yyerror to
11458 avoid GCC warnings.
11459
0c2d3f4c
AD
114602002-05-07 Akim Demaille <akim@epita.fr>
11461
11462 Kill GCC warnings.
11463
11464 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
11465 over the RHS of each rule.
11466 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
11467 * src/state.h (state_t): Member `nitems' is unsigned short.
11468 * src/LR0.c (get_state): Adjust.
11469 * src/reader.c (packgram): Likewise.
11470 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
11471 `Type'.
11472 (muscle_insert_int_table): Remove, unused.
11473 (prepare_rules): Remove `max'.
11474
1565b720
AD
114752002-05-06 Akim Demaille <akim@epita.fr>
11476
11477 * src/closure.c (print_firsts): Display of the symbol tags.
11478 (bitmatrix_print): Move to...
11479 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
11480 here.
11481 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
11482
cfaee611
AD
114832002-05-06 Akim Demaille <akim@epita.fr>
11484
11485 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
11486 hash_do_for_each.
11487
458be8e0
AD
114882002-05-06 Akim Demaille <akim@epita.fr>
11489
11490 * src/LR0.c (new_state, get_state): Instead of using the global
11491 `kernel_size' and `kernel_base', have two new arguments:
11492 `core_size' and `core'.
11493 Adjust callers.
11494
a900a624
AD
114952002-05-06 Akim Demaille <akim@epita.fr>
11496
11497 * src/reader.c (packgram): No longer end `ritem' with a 0
11498 sentinel: it is not used.
11499
d4e7d3a1
AD
115002002-05-05 Akim Demaille <akim@epita.fr>
11501
11502 New experimental feature: display the lookaheads in the report and
11503 graph.
11504
11505 * src/print (print_core): When --trace-flag, display the rules
11506 lookaheads.
11507 * src/print_graph.c (print_core): Likewise.
11508 Swap the arguments.
11509 Adjust caller.
11510
39ceb25b
AD
115112002-05-05 Akim Demaille <akim@epita.fr>
11512
11513 * tests/torture.at (Many lookaheads): New test.
11514
5372019f
AD
115152002-05-05 Akim Demaille <akim@epita.fr>
11516
11517 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
11518 (GENERATE_MUSCLE_INSERT_TABLE): this.
11519 (output_int_table, output_unsigned_int_table, output_short_table)
11520 (output_token_number_table, output_item_number_table): Replace with...
11521 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
11522 (muscle_insert_short_table, muscle_insert_token_number_table)
11523 (muscle_insert_item_number_table): these.
11524 Adjust all callers.
11525 (prepare_tokens): Don't free `translations', since...
11526 * src/reader.h, src/reader.c (grammar_free): do it.
11527 Move to...
11528 * src/gram.h, src/gram.c (grammar_free): here.
11529 * data/bison.simple, data/bison.c++: b4_token_number_max is now
11530 b4_translate_max.
11531
5df5f6d5
AD
115322002-05-05 Akim Demaille <akim@epita.fr>
11533
11534 * src/output.c (output_unsigned_int_table): New.
11535 (prepare_rules): `i' is unsigned.
11536 `prhs', `rline', `r2' are unsigned int.
11537 Rename muscle `rhs_number_max' as `rhs_max'.
11538 Output muscles `prhs_max', `rline_max', and `r2_max'.
11539 Free rline and r1.
11540 * data/bison.simple, data/bison.c++: Adjust to use these muscles
11541 to compute types instead of constant types.
11542 * tests/regression.at (Web2c Actions): Adjust.
11543
b87f8b21
AD
115442002-05-04 Akim Demaille <akim@epita.fr>
11545
11546 * src/symtab.h (SALIAS, SUNDEF): Rename as...
11547 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
11548 Adjust dependencies.
11549 * src/output.c (token_definitions_output): Be sure not to output a
11550 `#define 'a'' when fed with `%token 'a' "a"'.
11551 * tests/regression.at (Token definitions): New.
11552
8bb936e4
PE
115532002-05-03 Paul Eggert <eggert@twinsun.com>
11554
11555 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
11556 for K&R C.
11557
115582002-05-03 gettextize <bug-gnu-gettext@gnu.org>
11559
11560 * Makefile.am (SUBDIRS): Remove intl.
11561 (EXTRA_DIST): Add config/config.rpath.
11562
53c71a12
AD
115632002-05-03 Akim Demaille <akim@epita.fr>
11564
11565 * data/bison.simple (m4_if): Don't output empty enums.
11566 And actually, output valid enum definitions :(.
11567
289dd0cf
AD
115682002-05-03 Akim Demaille <akim@epita.fr>
11569
11570 * configure.bat: Remove, completely obsolete.
11571 * Makefile.am (EXTRA_DIST): Adjust.
11572 Don't distribute config.rpath...
11573 * config/Makefile.am (EXTRA_DIST): Do it.
11574
db85e524
AD
115752002-05-03 Akim Demaille <akim@epita.fr>
11576
11577 * configure.in (GETTEXT_VERSION): New.
11578 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
11579
83ccf991
AD
115802002-05-03 Akim Demaille <akim@epita.fr>
11581
11582 * data/bison.simple (b4_token_enum): New.
11583 (b4_token_defines): Use it to output tokens both as #define and
11584 enums.
11585 Suggested by Paul Eggert.
11586 * src/output.c (token_definitions_output): Don't output spurious
11587 white spaces.
11588
1f418995
AD
115892002-05-03 Akim Demaille <akim@epita.fr>
11590
11591 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
11592
45119f04
RA
115932002-05-02 Robert Anisko <robert@lrde.epita.fr>
11594
11595 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
11596 Update the stack class, give a try to deque as the default container.
11597
b2d52318
AD
115982002-05-02 Akim Demaille <akim@epita.fr>
11599
11600 * data/bison.simple (yyparse): Do not implement @$ = @1.
11601 (YYLLOC_DEFAULT): Adjust to do it.
11602 * doc/bison.texinfo (Location Default Action): Fix.
11603
3a8b4109
AD
116042002-05-02 Akim Demaille <akim@epita.fr>
11605
11606 * src/reader.c (parse_braces): Merge into...
11607 (parse_action): this.
11608
84614e13
AD
116092002-05-02 Akim Demaille <akim@epita.fr>
11610
11611 * configure.in (ALL_LINGUAS): Remove.
11612 * po/LINGUAS, hr.po: New.
11613
fdbcd8e2
AD
116142002-05-02 Akim Demaille <akim@epita.fr>
11615
11616 Remove the so called hairy (semantic) parsers.
11617
11618 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
11619 * src/gram.h, src/gram.c (semantic_parser): Remove.
11620 (rule_t): Remove the guard and guard_line members.
11621 * src/lex.h (token_t): remove tok_guard.
11622 * src/options.c (option_table): Remove %guard and %semantic_parser
11623 support.
11624 * src/output.c, src/output.h (guards_output): Remove.
11625 (prepare): Adjust.
11626 (token_definitions_output): Don't output the `T'
11627 tokens (???).
11628 (output_skeleton): Don't output the guards.
11629 * src/files.c, src/files.c (attrsfile): Remove.
11630 * src/reader.c (symbol_list): Remove the guard and guard_line
11631 members.
11632 Adjust dependencies.
11633 (parse_guard): Remove.
11634 * data/bison.hairy: Remove.
11635 * doc/bison.texinfo (Environment Variables): Remove occurrences of
11636 BISON_HAIRY.
11637
82b6cb3f
AD
116382002-05-02 Akim Demaille <akim@epita.fr>
11639
11640 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
11641 (parse_guard): Rename the formal argument `stack_offset' as
11642 `rule_length', which is more readable.
11643 Adjust callers.
11644 (copy_at, copy_dollar): Instead of outputting the hard coded
11645 values of $$, $n and so forth, output invocation to b4_lhs_value,
11646 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
11647 Note: this patch partially drops `semantic-parser' support: it
11648 always does `rule_length - n', where semantic parsers ought to
11649 always use `-n'.
82b6cb3f
AD
11650 * data/bison.simple, data/bison.c++ (b4_lhs_value)
11651 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
11652
6cbfbcc5
AD
116532002-05-02 Akim Demaille <akim@epita.fr>
11654
11655 * configure.in (AC_INIT): Bump to 1.49b.
11656 (AM_INIT_AUTOMAKE): Short invocation.
11657
b8548114
AD
116582002-05-02 Akim Demaille <akim@epita.fr>
11659
11660 Version 1.49a.
11661
c20cd1fa
AD
116622002-05-01 Akim Demaille <akim@epita.fr>
11663
11664 * src/skeleton.h: Remove.
11665
8a9566d4
AD
116662002-05-01 Akim Demaille <akim@epita.fr>
11667
11668 * src/skeleton.h: Fix the #endif.
11669 Reported by Magnus Fromreide.
11670
8c6d399a
PE
116712002-04-26 Paul Eggert <eggert@twinsun.com>
11672
11673 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
11674 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 11675 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 11676
2b7ed18a
RA
116772002-04-25 Robert Anisko <robert@lrde.epita.fr>
11678
11679 * src/scan-skel.l: Postprocess quadrigraphs.
11680
11681 * src/reader.c (copy_character): New function, used to output
11682 single characters while replacing `[' and `]' with quadrigraphs, to
11683 avoid troubles with M4 quotes.
11684 (copy_comment): Output characters with copy_character.
11685 (read_additionnal_code): Likewise.
11686 (copy_string2): Likewise.
11687 (copy_definition): Likewise.
11688
11689 * tests/calc.at: Exercise M4 quoting.
11690
34a89c50
AD
116912002-04-25 Akim Demaille <akim@epita.fr>
11692
11693 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
11694 between `!' and the command.
11695 Reported by Paul Eggert.
11696
0dd1580a
RA
116972002-04-24 Robert Anisko <robert@lrde.epita.fr>
11698
11699 * tests/calc.at: Exercise prologue splitting.
11700
11701 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
11702 `b4_post_prologue' instead of `b4_prologue'.
11703
11704 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
11705 muscles.
11706 (output): Free pre_prologue_obstack and post_prologue_obstack.
11707 * src/files.h, src/files.c (attrs_obstack): Remove.
11708 (pre_prologue_obstack, post_prologue_obstack): New.
11709 * src/reader.c (copy_definition): Add a parameter to specify the
11710 obstack to fill, instead of using attrs_obstack unconditionally.
11711 (read_declarations): Pass pre_prologue_obstack to copy_definition if
11712 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
11713
83c1796f
PE
117142002-04-23 Paul Eggert <eggert@twinsun.com>
11715
11716 * data/bison.simple: Remove unnecessary commentary and white
11717 space differences from 1_29-branch.
11718 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
11719
11720 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
11721 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
11722 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
11723 constructors or destructors.
11724
11725 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
11726
1207eeac
AD
117272002-04-23 Akim Demaille <akim@epita.fr>
11728
11729 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
11730 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
11731 location with columns.
11732 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
11733 All reported by Paul Eggert.
11734
78ab8f67
AD
117352002-04-22 Akim Demaille <akim@epita.fr>
11736
11737 * src/reduce.c (dump_grammar): Move to...
11738 * src/gram.h, src/gram.c (grammar_dump): here.
11739 Be sure to separate long item numbers.
11740 Don't read the members of a rule's prec if its nil.
11741
133c20e2
AD
117422002-04-22 Akim Demaille <akim@epita.fr>
11743
11744 * src/output.c (table_size, table_grow): New.
11745 (MAXTABLE): Remove, replace uses with table_size.
11746 (pack_vector): Instead of dying when the table is too big, grow it.
11747
9515e8a7
AD
117482002-04-22 Akim Demaille <akim@epita.fr>
11749
11750 * data/bison.simple (yyr1): Its type is that of a token number.
11751 * data/bison.c++ (r1_): Likewise.
11752 * tests/regression.at (Web2c Actions): Adjust.
11753
23c5a174
AD
117542002-04-22 Akim Demaille <akim@epita.fr>
11755
11756 * src/reader.c (token_translations_init): 256 is now the default
11757 value for the error token, i.e., it will be assigned another
11758 number if the user assigned 256 to one of her tokens.
11759 (reader): Don't force 256 to error.
11760 * doc/bison.texinfo (Symbols): Adjust.
11761 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
11762 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
11763 etc. instead of 10, 20, 30 (which was used to `jump' over error
11764 (256) and undefined (2)).
11765
5fbb0954
AD
117662002-04-22 Akim Demaille <akim@epita.fr>
11767
11768 Propagate more token_number_t.
11769
11770 * src/gram.h (token_number_as_item_number)
11771 (item_number_as_token_number): New.
11772 * src/output.c (GENERATE_OUTPUT_TABLE): New.
11773 Use it to create output_item_number_table and
11774 output_token_number_table.
11775 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
11776 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
11777 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
11778 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
11779
4f940944
AD
117802002-04-22 Akim Demaille <akim@epita.fr>
11781
11782 * src/output.h, src/output.c (get_lines_number): Remove.
11783
3ded9a63
AD
117842002-04-19 Akim Demaille <akim@epita.fr>
11785
11786 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
11787 as Lex/Flex'.
11788 (Debugging): More details about enabling the debugging features.
11789 (Table of Symbols): Describe $$, $n, @$, and @n.
11790 Suggested by Tim Josling.
11791
e0c471a9
AD
117922002-04-19 Akim Demaille <akim@epita.fr>
11793
11794 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
11795
fecc10cd
AD
117962002-04-10 Akim Demaille <akim@epita.fr>
11797
11798 * src/system.h: Rely on HAVE_LIMITS_H.
11799 Suggested by Paul Eggert.
11800
51dec47b
AD
118012002-04-09 Akim Demaille <akim@epita.fr>
11802
11803 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
11804 full stderr, and strip it according to the bison options, instead
11805 of composing the error message from different bits.
11806 This makes it easier to check for several error messages.
11807 Adjust all the invocations.
11808 Add an invocation exercising the error token.
11809 Add an invocation demonstrating a stupid error message.
11810 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
11811 Adjust the tests.
11812 Error message are for stderr, not stdout.
11813
007a50a4
AD
118142002-04-09 Akim Demaille <akim@epita.fr>
11815
11816 * src/gram.h, src/gram.c (error_token_number): Remove, use
11817 errtoken->number.
11818 * src/reader.c (reader): Don't specify the user token number (2)
11819 for $undefined, as it uselessly prevents using it.
11820 * src/gram.h (token_number_t): Move to...
11821 * src/symtab.h: here.
11822 (state_t.number): Is a token_number_t.
11823 * src/print.c, src/reader.c: Use undeftoken->number instead of
11824 hard coded 2.
11825 (Even though this 2 is not the same as above: the number of the
11826 undeftoken remains being 2, it is its user token number which
11827 might not be 2).
11828 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
11829 `user_token_number_max'.
11830 Output `undef_token_number'.
11831 * data/bison.simple, data/bison.c++: Use them.
11832 Be sure to map invalid yylex return values to
11833 `undef_token_number'. This saves us from gratuitous SEGV.
11834
11835 * tests/conflicts.at (Solved SR Conflicts)
11836 (Unresolved SR Conflicts): Adjust.
11837 * tests/regression.at (Web2c Actions): Adjust.
11838
06446ccf
AD
118392002-04-08 Akim Demaille <akim@epita.fr>
11840
11841 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
11842 Adding #line.
11843 Remove the duplicate `typedefs'.
11844 (RhsNumberType): Fix the declaration and various other typos.
11845 Use __ofile__.
11846 * data/bison.simple: Use __ofile__.
11847 * src/scan-skel.l: Handle __ofile__.
11848
62a3e4f0
AD
118492002-04-08 Akim Demaille <akim@epita.fr>
11850
11851 * src/gram.h (item_number_t): New, the type of item numbers in
11852 RITEM. Note that it must be able to code symbol numbers as
11853 positive number, and the negation of rule numbers as negative
11854 numbers.
11855 Adjust all dependencies (pretty many).
11856 * src/reduce.c (rule): Remove this `short *' pointer: use
11857 item_number_t.
11858 * src/system.h (MINSHORT, MAXSHORT): Remove.
11859 Include `limits.h'.
11860 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
11861 (shortcpy): Remove.
11862 (MAXTABLE): Move to...
11863 * src/output.c (MAXTABLE): here.
11864 (prepare_rules): Use output_int_table to output rhs.
11865 * data/bison.simple, data/bison.c++: Adjust.
11866 * tests/torture.at (Big triangle): Move the limit from 254 to
11867 500.
11868 * tests/regression.at (Web2c Actions): Ajust.
11869
11870 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
11871 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
11872 passes, but produces negative #line number, once fixed, GCC is
11873 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
11874 C), it passes.
11875 * src/state.h (state_h): Code input lines on ints, not shorts.
11876
bb88b0fc
AD
118772002-04-08 Akim Demaille <akim@epita.fr>
11878
11879 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
11880 and then the grammar.
11881
9a636f47
AD
118822002-04-08 Akim Demaille <akim@epita.fr>
11883
11884 * src/system.h: No longer using strndup.
11885
680e8701
AD
118862002-04-07 Akim Demaille <akim@epita.fr>
11887
11888 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
11889 * src/output.c (output_table_data): Return the longest number.
11890 (prepare_tokens): Output `token_number_max').
11891 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
11892 New.
11893 Use them to define yy_token_number_type/TokenNumberType.
11894 Use this type for yytranslate.
11895 * tests/torture.at (Big triangle): Push the limit from 124 to
11896 253.
11897 * tests/regression.at (Web2c Actions): Adjust.
11898
817e9f41
AD
118992002-04-07 Akim Demaille <akim@epita.fr>
11900
11901 * tests/torture.at (Big triangle): New.
11902 (GNU AWK Grammar, GNU Cim Grammar): Move to...
11903 * tests/existing.at: here.
11904
5123689b
AD
119052002-04-07 Akim Demaille <akim@epita.fr>
11906
11907 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
11908 nritems.
11909 Adjust dependencies.
11910
f3849179
AD
119112002-04-07 Akim Demaille <akim@epita.fr>
11912
11913 * src/reader.c: Normalize increments to prefix form.
11914
bd02036a
AD
119152002-04-07 Akim Demaille <akim@epita.fr>
11916
11917 * src/reader.c, symtab.c: Remove debugging code.
11918
db8837cb
AD
119192002-04-07 Akim Demaille <akim@epita.fr>
11920
11921 Rename all the `bucket's as `symbol_t'.
11922
11923 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
11924 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
11925 * src/symtab.c, src/symtab.h (bucket): Rename as...
11926 (symbol_t): this.
11927 (symbol_list_new, bucket_check_defined, bucket_make_alias)
11928 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
11929 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
11930 (buckets_new, buckets_free, buckets_do): Rename as...
11931 (symbol_list_new, symbol_check_defined, symbol_make_alias)
11932 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11933 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
11934 (symbols_new, symbols_free, symbols_do): these.
11935
72a23c97
AD
119362002-04-07 Akim Demaille <akim@epita.fr>
11937
11938 Use lib/hash for the symbol table.
11939
11940 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
11941 EOF.
11942 * src/lex.c (lex): Set the `number' member of new terminals.
11943 * src/reader.c (bucket_check_defined, bucket_make_alias)
11944 (bucket_check_alias_consistence, bucket_translation): New.
11945 (reader, grammar_free, readgram, token_translations_init)
11946 (packsymbols): Adjust.
11947 (reader): Number the predefined tokens.
11948 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
11949 for predefined tokens.
11950 * src/symtab.h (bucket): Remove all the hash table related
11951 members.
11952 * src/symtab.c (symtab): Replace by...
11953 (bucket_table): this.
11954 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
11955 (buckets_new, buckets_do): New.
11956
280a38c3
AD
119572002-04-07 Akim Demaille <akim@epita.fr>
11958
11959 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
11960 (start_symbol, max_user_token_number, semantic_parser)
11961 (error_token_number): Initialize.
11962 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
11963 Initialize.
11964 (reader): Don't.
11965 (errtoken, eoftoken, undeftoken, axiom): Extern.
11966
03b31c0c
AD
119672002-04-07 Akim Demaille <akim@epita.fr>
11968
11969 * src/gram.h (rule_s): prec and precsym are now pointers
11970 to the bucket giving the priority/associativity.
11971 Member `associativity' removed: useless.
11972 * src/reduce.c, src/conflicts.c: Adjust.
11973
8b3df748
AD
119742002-04-07 Akim Demaille <akim@epita.fr>
11975
11976 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
11977 Properly escape the symbols' TAG when outputting them.
11978
e601aa1d
AD
119792002-04-07 Akim Demaille <akim@epita.fr>
11980
11981 * src/lalr.h (LA): Is a bitsetv, not bitset*.
11982
b0299a2e
AD
119832002-04-07 Akim Demaille <akim@epita.fr>
11984
11985 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
11986 (LArule): this, which is an array to rule_t*.
11987 * src/print.c, src/conflicts.c: Adjust.
11988
d7e1f00c
AD
119892002-04-07 Akim Demaille <akim@epita.fr>
11990
11991 * src/gram.h (rule_t): Rename `number' as `user_number'.
11992 `number' is a new member.
11993 Adjust dependencies.
11994 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
11995
cc9305dd
AD
119962002-04-07 Akim Demaille <akim@epita.fr>
11997
11998 As a result of the previous patch, it is no longer needed
11999 to reorder ritem itself.
12000
12001 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
12002
b0940840
AD
120032002-04-07 Akim Demaille <akim@epita.fr>
12004
12005 Be sure never to walk through RITEMS, but use only data related to
12006 the rules themselves. RITEMS should be banished.
12007
12008 * src/output.c (output_token_translations): Rename as...
12009 (prepare_tokens): this.
12010 In addition to `translate', prepare the muscles `tname' and
12011 `toknum', which were handled by...
12012 (output_rule_data): this.
12013 Remove, and move the remainder of its outputs into...
12014 (prepare_rules): this new routines, which also merges content from
12015 (output_gram): this.
12016 (prepare_rules): Be sure never to walk through RITEMS.
12017 (output_stos): Rename as...
12018 (prepare_stos): this.
12019 (output): Always invoke prepare_states, after all, just don't use it
12020 in the output if you don't need it.
12021
643a5994
AD
120222002-04-07 Akim Demaille <akim@epita.fr>
12023
12024 * src/LR0.c (new_state): Display `nstates' as the name of the
12025 newly created state.
12026 Adjust to initialize first_state and last_state if needed.
12027 Be sure to distinguish the initial from the final state.
12028 (new_states): Create the itemset of the initial state, and use
12029 new_state.
12030 * src/closure.c (closure): Now that the initial state has its
12031 items properly set, there is no need for a special case when
12032 creating `ruleset'.
12033
12034 As a result, now the rule 0, reducing to $axiom, is visible in the
12035 outputs. Adjust the test suite.
12036
12037 * tests/conflicts.at (Solved SR Conflicts)
12038 (Unresolved SR Conflicts): Adjust.
12039 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
12040 * tests/conflicts.at (S/R in initial): New.
12041
b4c4ccc2
AD
120422002-04-07 Akim Demaille <akim@epita.fr>
12043
12044 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
12045 the RHS of the rules.
12046 * src/output.c (output_gram): Likewise.
12047
bba97eb2
AD
120482002-04-07 Akim Demaille <akim@epita.fr>
12049
12050 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
12051 bucket.
12052 Adjust all dependencies.
12053 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
12054 `number' of the buckets too.
12055 * src/gram.h: Include `symtab.h'.
12056 (associativity): Move to...
12057 * src/symtab.h: here.
12058 No longer include `gram.h'.
12059
c3b407f4
AD
120602002-04-07 Akim Demaille <akim@epita.fr>
12061
12062 * src/gram.h, src/gram.c (rules_rhs_length): New.
12063 (ritem_longest_rhs): Use it.
12064 * src/gram.h (rule_t): `number' is a new member.
12065 * src/reader.c (packgram): Set it.
12066 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
12067 the end of `rules', and count them out of `nrules'.
12068 (reduce_output, dump_grammar): Adjust.
12069 * src/print.c (print_grammar): It is no longer needed to check for
12070 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
12071 * tests/reduce.at (Reduced Automaton): New test.
12072
11652ab3
AD
120732002-04-07 Akim Demaille <akim@epita.fr>
12074
12075 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
12076 lacking `+ 1' to nrules, Bison reported as useless a token if it
12077 was used solely to set the precedence of the last rule...
12078
26b23c1a
AD
120792002-04-07 Akim Demaille <akim@epita.fr>
12080
12081 * data/bison.c++, data/bison.simple: Don't output the current file
12082 name in #line, to avoid useless diffs between two identical
12083 outputs under different names.
12084
18bcecb0
AD
120852002-04-07 Akim Demaille <akim@epita.fr>
12086
12087 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
12088 Normalize loops to using `< nrules + 1', not `<= nrules'.
12089
fa770c86
AD
120902002-04-07 Akim Demaille <akim@epita.fr>
12091
12092 * TODO: Update.
12093
d9b739c3
AD
120942002-04-07 Akim Demaille <akim@epita.fr>
12095
12096 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
12097 bucket.value as bucket.number.
12098
99013900
AD
120992002-04-07 Akim Demaille <akim@epita.fr>
12100
12101 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
12102 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
12103 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
12104 RHS, instead of being an index in RITEMS.
12105
e966383b
PE
121062002-04-04 Paul Eggert <eggert@twinsun.com>
12107
12108 * doc/bison.texinfo: Update copyright date.
12109 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
12110 (Symbols): Warn about running Bison in one character set,
12111 but compiling and/or running in an incompatible one.
12112 Warn about character code 256, too.
12113
121142002-04-03 Paul Eggert <eggert@twinsun.com>
12115
12116 * src/bison.data (YYSTACK_ALLOC): Depend on whether
12117 YYERROR_VERBOSE is nonzero, not whether it is defined.
12118
12119 Merge changes from bison-1_29-branch.
c307773e 12120
8d6c48b9
PE
121212002-03-20 Paul Eggert <eggert@twinsun.com>
12122
12123 Merge fixes from Debian bison_1.34-1.diff.
12124
12125 * configure.in (AC_PREREQ): 2.53.
12126
e53c6322
AD
121272002-03-20 Akim Demaille <akim@epita.fr>
12128
12129 * src/conflicts.c (log_resolution): Argument `resolution' is const.
12130
9ffbeca7
PE
121312002-03-19 Paul Eggert <eggert@twinsun.com>
12132
21db0b2a
PE
12133 * src/bison.simple (YYCOPY): New macro.
12134 (YYSTACK_RELOCATE): Use it.
12135 Remove Type arg; no longer needed. All callers changed.
12136 (yymemcpy): Remove; no longer needed.
12137
9ffbeca7
PE
12138 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
12139 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
12140
642cb8f8
AD
121412002-03-19 Akim Demaille <akim@epita.fr>
12142
12143 Test and fix the #line outputs.
12144
12145 * tests/atlocal.at (GCC): New.
12146 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 12147 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
12148 (Action synch line, Epilogue synch line): New tests.
12149 * src/reader.c (parse_union_decl): Define the muscle stype_line.
12150 * data/bison.simple, data/bison.c++: Use it.
12151
3c31a486
AD
121522002-03-19 Akim Demaille <akim@epita.fr>
12153
12154 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
12155 (Solved SR Conflicts, %expect not enough, %expect right)
12156 (%expect too much): Move to...
12157 * tests/conflicts.at: this new file.
12158
0d8bed56
AD
121592002-03-19 Akim Demaille <akim@epita.fr>
12160
12161 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12162 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
12163 that we can move to enums for instance.
12164 * src/output.c (token_definitions_output): Output a list of
12165 `token-name, token-number' instead of the #define.
12166 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
12167
9208d17f
AD
121682002-03-14 Akim Demaille <akim@epita.fr>
12169
12170 Use Gettext 0.11.1.
12171
af27eacb
RA
121722002-03-09 Robert Anisko <robert@lrde.epita.fr>
12173
12174 * data/bison.c++: Make the user able to add members to the generated
12175 parser by subclassing.
12176
9101a310
RA
121772002-03-05 Robert Anisko <robert@lrde.epita.fr>
12178
12179 * src/reader.c (read_additionnal_code): `c' should be an integer, not
12180 a character.
12181 Reported by Nicolas Tisserand and Nicolas Burrus.
12182
fff9bf0b
RA
121832002-03-04 Robert Anisko <robert@lrde.epita.fr>
12184
12185 * src/reader.c: Warn about lacking semi-colons, do not complain.
12186
64dba31e
RA
121872002-03-04 Robert Anisko <robert@lrde.epita.fr>
12188
12189 * data/bison.c++: Remove a debug line.
12190
374f5a14
RA
121912002-03-04 Robert Anisko <robert@lrde.epita.fr>
12192
12193 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
12194 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
12195 provide a default implementation.
12196
bfcf1f3a
AD
121972002-03-04 Akim Demaille <akim@epita.fr>
12198
12199 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
12200 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
12201 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
12202 * tests/semantic.at (Parsing Guards): Similarly.
12203 * src/reader.at (readgram): Complain if the last rule is not ended
12204 with a semi-colon.
12205
65ccf9fc
AD
122062002-03-04 Akim Demaille <akim@epita.fr>
12207
12208 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
12209 * src/closure.c: here.
12210 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
12211 RTC.
12212 * src/warshall.h, src/warshall.c: Remove.
12213 * tests/sets.at (Broken Closure): Adjust.
12214
d0039cbc
AD
122152002-03-04 Akim Demaille <akim@epita.fr>
12216
12217 * src/output.c (output_skeleton): tempdir is const.
12218 bytes_read is unused.
12219
345cea78
AD
122202002-03-04 Akim Demaille <akim@epita.fr>
12221
12222 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12223 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
12224 Update.
12225 From Michael Hayes.
12226
564801f7
AD
122272002-03-04 Akim Demaille <akim@epita.fr>
12228
12229 * src/closure.c (closure): `r' is unused.
12230
e5352bc7
AD
122312002-03-04 Akim Demaille <akim@epita.fr>
12232
12233 * tests/sets.at (Broken Closure): Add the ending `;'.
12234 * src/reader.at (readgram): Complain if a rule is not ended with a
12235 semi-colon.
12236
914feea9
AD
122372002-03-04 Akim Demaille <akim@epita.fr>
12238
12239 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
12240 (count_sr_conflicts): Use bitset_count.
12241 * src/reduce.c (inaccessable_symbols): Ditto.
12242 (bits_size): Remove.
12243 * src/warshall.h, src/warshall.c: Convert to bitsetv.
12244
f0250de6
AD
122452002-03-04 Akim Demaille <akim@epita.fr>
12246
12247 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
12248 * src/reduce.c: Remove the `bitset_zero's following the
12249 `bitset_create's, as now it is performed by the latter.
12250
ef017502
AD
122512002-03-04 Akim Demaille <akim@epita.fr>
12252
12253 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
12254 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
12255 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
12256 latest sources from Michael.
12257
76514394
AD
122582002-03-04 Akim Demaille <akim@epita.fr>
12259
12260 * src/output.c (output): Don't free the grammar.
12261 * src/reader.c (grammar_free): New.
12262 * src/main.c (main): Call it and don't free symtab here.
12263
55024580
AD
122642002-03-04 Akim Demaille <akim@epita.fr>
12265
12266 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
12267 before returning.
12268 Reported by Benoit Perrot.
12269
f9abaa2c
AD
122702002-03-04 Akim Demaille <akim@epita.fr>
12271
12272 Use bitset operations when possible, not loops over bits.
12273
12274 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
12275 bitset_or.
12276 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
12277 * src/reduce.c (useless_nonterminals): Formatting changes.
12278 * src/warshall.c (TC): Use bitset_or.
12279
0e721e75
AD
122802002-03-04 Akim Demaille <akim@epita.fr>
12281
12282 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
12283 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
12284 Ditto.
12285
0fb1ffb1
AD
122862002-03-04 Akim Demaille <akim@epita.fr>
12287
12288 * src/lalr.c (F): Now a bitset*.
12289 Adjust all dependencies.
12290
b86796bf
AD
122912002-03-04 Akim Demaille <akim@epita.fr>
12292
12293 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
12294 Adjust all dependencies.
12295
602bbf31
AD
122962002-03-04 Akim Demaille <akim@epita.fr>
12297
12298 * src/L0.c, src/LR0.h (nstates): Be size_t.
12299 Adjust comparisons (signed vs unsigned).
12300 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
12301 bitset*.
12302 Adjust all dependencies.
12303
d8a0245c
AD
123042002-03-04 Akim Demaille <akim@epita.fr>
12305
12306 * src/closure.c (firsts): Now, also a bitset.
12307 Adjust all dependencies.
12308 (varsetsize): Remove, now unused.
12309 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
12310
34ba9743
AD
123112002-03-04 Akim Demaille <akim@epita.fr>
12312
12313 * src/print.c: Convert to use bitset.h, not hand coded iterations
12314 over ints.
12315
ed86e78c
AD
123162002-03-04 Akim Demaille <akim@epita.fr>
12317
12318 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
12319
dfdb1797
AD
123202002-03-04 Akim Demaille <akim@epita.fr>
12321
12322 * src/closure.c (ruleset): Be a bitset.
12323 (rulesetsize): Remove.
12324
7086e707
AD
123252002-03-04 Akim Demaille <akim@epita.fr>
12326
12327 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12328 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
12329 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
12330 * src/closure.c (fderives): Be an array of bitsets.
12331
98254360
RA
123322002-02-28 Robert Anisko <robert@lrde.epita.fr>
12333
12334 * data/bison.c++: Merge the two generated headers. Insert a copyright
12335 notice in each output file.
12336
a75c057f
AD
123372002-02-28 Akim Demaille <akim@epita.fr>
12338
12339 * data/bison.c++: Copy the prologue of bison.simple to fetch
12340 useful M4 definitions, such as b4_header_guard.
12341
06b00abc
AD
123422002-02-25 Akim Demaille <akim@epita.fr>
12343
12344 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
12345 translator friendly scheme for the bgr
12346 copyright notice.
06b00abc 12347
70e7d534
AD
123482002-02-25 Akim Demaille <akim@epita.fr>
12349
12350 * src/output.c (header_output): Remove, now handled completely via
12351 M4.
12352
abe017f6
AD
123532002-02-25 Akim Demaille <akim@epita.fr>
12354
12355 * m4/m4.m4: New, from CVS Autoconf.
12356 * configure.in: Invoke it.
12357 * src/output.c (output_skeleton): Use its result instead of the
12358 hard coded name.
12359
381fb12e
AD
123602002-02-25 Akim Demaille <akim@epita.fr>
12361
12362 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
12363 Fileutils 4.1.5.
12364 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
12365 * src/output.c (output_skeleton): Use mkstemp to create a real
12366 temporary file.
12367 Move the filling of `skeleton' and its muscle to...
12368 (prepare): here.
12369 (output): Move the definition of the prologue muscle to...
12370 (prepare): here.
12371 * src/system.h (DEFAULT_TMPDIR): New.
12372
6f38107f
PE
123732002-02-14 Paul Eggert <eggert@twinsun.com>
12374
12375 Remove the support for C++ namespace cleanliness; it was
12376 causing more problems than it was curing, since it didn't work
12377 properly on some nonstandard C++ compilers. This can wait
12378 for a proper C++ parser.
12379
12380 * NEWS: Document this.
12381 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
12382 of C++, as it's treated like C now.
12383 * src/bison.simple (YYSTD): Remove.
12384 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
12385 Treat C++ just like Standard C instead of trying to support
12386 namespace cleanliness.
12387
80cce3da
AD
123882002-02-14 Akim Demaille <akim@epita.fr>
12389
12390 * tests/regression.at (else): Adjust to Andreas' change.
12391
842e8679
AD
123922002-02-14 Akim Demaille <akim@epita.fr>
12393
12394 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
12395
4bda3f10
AD
123962002-02-13 Andreas Schwab <schwab@suse.de>
12397
12398 * src/output.c (output_rule_data): Don't output NULL, it might
12399 not be defined yet.
12400
4162fa07 124012002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 12402
4162fa07
RA
12403 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
12404 (Copyright notice): Update.
b418ecd8 12405
bd16a5dc
AD
124062002-02-11 Akim Demaille <akim@epita.fr>
12407
12408 * tests/regression.at (%nonassoc and eof): Don't include
12409 nonportable headers.
12410
8d69a1a3
RA
124112002-02-08 Robert Anisko <robert@lrde.epita.fr>
12412
12413 * data/bison.c++: Correct error recovery. Make the user able to
12414 initialize the starting location.
12415
9b2d0677
AD
124162002-02-07 Akim Demaille <akim@epita.fr>
12417
12418 * tests/input.at: New.
12419
69e2658b
RA
124202002-02-07 Robert Anisko <robert@lrde.epita.fr>
12421
12422 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 12423 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
12424 directives around tables only needed for debugging.
12425
4aacc3a7
RA
124262002-02-07 Robert Anisko <robert@lrde.epita.fr>
12427
12428 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
12429 C++ parsers.
12430 (yy::b4_name::parse): Use print_.
12431
762a801e
RA
124322002-02-07 Robert Anisko <robert@lrde.epita.fr>
12433
12434 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
12435
4bb2bc3f
RA
124362002-02-07 Robert Anisko <robert@lrde.epita.fr>
12437
12438 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
12439 C++ parsers.
12440 (yy::b4_name::parse): Build verbose error messages, and use error_.
12441
6b45a3ca
RA
124422002-02-06 Robert Anisko <robert@lrde.epita.fr>
12443
12444 * data/bison.c++: Fix m4 quoting in comments.
12445
50997c6e
RA
124462002-02-06 Robert Anisko <robert@lrde.epita.fr>
12447
12448 * data/bison.c++: Adjust the parser code. Fix some muscles that were
12449 not expanded by m4.
12450
3f3eed27
AD
124512002-02-05 Akim Demaille <akim@epita.fr>
12452
12453 * data/bison.c++: Adjust to the M4 back end.
12454 More is certainly needed.
12455
be2a1a68
AD
124562002-02-05 Akim Demaille <akim@epita.fr>
12457
12458 Give a try to M4 as a back end.
12459
12460 * lib/readpipe.c: New, from wdiff.
12461 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
12462 BISON_HAIRY.
12463 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
12464 specific values. Now it is m4 that performs the lookup.
12465 * src/parse-skel.y: Remove.
12466 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
12467 * src/output.c (actions_output, guards_output)
12468 (token_definitions_output): No longer keeps track of the output
12469 line number, hence remove the second argument.
12470 (guards_output): Check against the guard member of a rule, not the
12471 action member.
12472 Adjust callers.
12473 (output_skeleton): Don't look for the skeleton location, let m4 do
12474 that.
12475 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
12476 file will be used.
12477 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
12478 (prepare): Given that for the time being changesyntax is not
12479 usable in M4, rename the muscles using `-' to `_'.
12480 Define `defines_flag', `output_parser_name' and `output_header_name'.
12481 * src/output.h (actions_output, guards_output)
12482 (token_definitions_output): Adjust prototypes.
12483 * src/scan-skel.l: Instead of scanning the skeletons, it now
12484 processes the output of m4: `__oline__' and `#output'.
12485 * data/bison.simple: Adjust to be used by M4(sugar).
12486 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
12487 to date.
12488 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
12489 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
12490 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
12491 shamelessly stolen from CVS Autoconf.
12492
beda758b
AD
124932002-02-05 Akim Demaille <akim@epita.fr>
12494
12495 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
12496 * configure.in: Check for the declarations of free and malloc.
12497 * src/muscle_tab.c: Adjust.
12498
5ece6d43
AD
124992002-02-05 Akim Demaille <akim@epita.fr>
12500
12501 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
12502 which have no values.
12503
5bb18f9a
AD
125042002-02-05 Akim Demaille <akim@epita.fr>
12505
12506 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
12507 * data/: here.
12508
894dd62e
PE
125092002-01-29 Paul Eggert <eggert@twinsun.com>
12510
12511 * src/bison.simple (YYSIZE_T): Do not define merely because
12512 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
12513 On some platforms, <alloca.h> does not declare YYSTD (size_t).
12514
82841af7
AD
125152002-01-27 Akim Demaille <akim@epita.fr>
12516
12517 Fix `%nonassoc and eof'.
12518
12519 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
12520 which were not properly copied! Replace
12521 memcpy (res->errs, src->errs, src->nerrs);
12522 with
12523 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
12524 !!!
12525 * tests/regression.at (%nonassoc and eof): Adjust to newest
12526 Autotest: `.' is not in the PATH.
12527
318b76e9
AD
125282002-01-27 Akim Demaille <akim@epita.fr>
12529
12530 * tests/sets.at (AT_EXTRACT_SETS): New.
12531 (Nullable): Use it.
12532 (Firsts): New.
12533
30d2f3d5
AD
125342002-01-26 Akim Demaille <akim@epita.fr>
12535
12536 * tests/actions.at, tests/calc.at, tests/headers.at,
12537 * tests/torture.at: Adjust to the newest Autotest which no longer
12538 forces `.' in the PATH.
12539
30f8c395
AD
125402002-01-25 Akim Demaille <akim@epita.fr>
12541
12542 * tests/regression.at (%nonassoc and eof): New.
12543 Suggested by Robert Anisko.
12544
29ae55f1
AD
125452002-01-24 Akim Demaille <akim@epita.fr>
12546
12547 Bison dumps core when trying to complain about broken input files.
12548 Reported by Cris van Pelt.
12549
12550 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
12551 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
12552 into...
12553 (Invalid inputs): Strengthen: exercise parse_percent_token.
12554
2b548aa6
RA
125552002-01-24 Robert Anisko <robert.anisko@epita.fr>
12556
12557 * src/Makefile.am: Add bison.c++.
12558 * src/bison.c++: New skeleton.
12559
bb0146c2
AD
125602002-01-21 Paolo Bonzini <bonzini@gnu.org>
12561
12562 * po/it.po: New.
12563
bec30531
AD
125642002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
12565
12566 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
12567
fc6edc45
MA
125682002-01-20 Marc Autret <marc@gnu.org>
12569
12570 * src/files.c (compute_output_file_names): Fix
12571
5e5d5415
MA
125722002-01-20 Marc Autret <marc@gnu.org>
12573
12574 * tests/output.at: New test.
12575 * src/files.c (compute_base_names): Don't map extensions when
12576 the YACC flag is set, use defaults.
12577 Reported by Evgeny Stambulchik.
12578
44ea3fbd
MA
125792002-01-20 Marc Autret <marc@gnu.org>
12580
ba0fe3c7
PE
12581 * src/system.h: Need to define __attribute__ away for non-GCC
12582 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
12583 Suggested by Albert Chin-A-Young.
12584
338963d1
TVH
125852002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
12586
12587 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
12588 canonical definition.
12589 * src/system.h: Use the canonical definition for PARAMS (avoids
12590 a conflict with the macro from lib/hash.h).
12591
c57b2479
AD
125922002-01-11 Akim Demaille <akim@epita.fr>
12593
12594 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 12595 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 12596
b85810ae
AD
125972002-01-09 Akim Demaille <akim@epita.fr>
12598
12599 * src/files.c, src/files.h (output_infix): New.
12600 (tab_extension): Remove.
12601 (compute_base_names): Compute the former, drop the latter.
12602 * src/output.c (prepare): Insert the muscles `output-infix', and
12603 `output-suffix'.
12604 * src/parse-skel.y (string, string.1): New.
12605 (section.header): Use it.
12606 (section.yacc): Remove.
12607 (prefix): Remove too.
12608 * src/scan-skel.l: Adjust.
12609 * src/bison.simple, src/bison.hairy: Adjust.
12610
cae60122
AD
126112002-01-09 Akim Demaille <akim@epita.fr>
12612
12613 * configure.in (WERROR_CFLAGS): Compute it.
12614 * src/Makefile.am (CFLAGS): Pass it.
12615 * tests/atlocal.in (CFLAGS): Idem.
12616 * src/files.c: Fix a few warnings.
12617 (get_extension_index): Remove, unused.
12618
ae404801
AD
126192002-01-08 Akim Demaille <akim@epita.fr>
12620
12621 * src/getargs.c (AS_FILE_NAME): New.
12622 (getargs): Use it to convert DOSish file names.
12623 * src/files.c (base_name): Rename as full_base_name to avoid
12624 clashes with `base_name ()'.
12625 (filename_split): New.
12626 (compute_base_names): N-th rewrite, using filename_split.
12627
22312b71
AD
126282002-01-08 Akim Demaille <akim@epita.fr>
12629
12630 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
12631 New, stolen from the Fileutils 4.1.
12632 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
12633 * configure.in: Check for the presence of memrchr, and of its
12634 prototype.
12635
a67cef01
TVH
126362002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
12637
12638 * lib/hash.h (__P): Added definition for this macro.
12639 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
12640 BUILT_SOURCES, to ensure they are generated first.
12641 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
12642 %error-verbose to allow bootstrapping with bison 1.30x.
12643
2b25d624
AD
126442002-01-06 Akim Demaille <akim@epita.fr>
12645
12646 * src/reader.c (parse_braces): Don't fetch the next char, the
12647 convention is to fetch on entry.
12648 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
12649 'switch' without a following semicolon.
12650 * tests/regression.at (braces parsing): New.
12651
3460813b
AD
126522002-01-06 Akim Demaille <akim@epita.fr>
12653
12654 Bison is dead wrong in its RR conflict reports.
12655
12656 * tests/torture.at (GNU Cim Grammar): New.
12657 * src/conflicts.c (count_rr_conflicts): Fix.
12658
73784c64
AD
126592002-01-06 Akim Demaille <akim@epita.fr>
12660
12661 Creating package.m4 from configure.ac causes too many problems.
12662
12663 * tests/Makefile.am (package.m4): Create it by hand,
12664 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
12665
25d81090
AD
126662002-01-06 Akim Demaille <akim@epita.fr>
12667
12668 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
12669 skeleton.h.
12670
a9b8959e
PE
126712002-01-04 Paul Eggert <eggert@twinsun.com>
12672
12673 * doc/bison.texinfo (Debugging):
12674 Remove YYSTDERR; it's no longer defined or used.
12675 Also, s/cstdio.h/cstdio/.
12676
25d81090
AD
126772002-01-03 Akim Demaille <akim@epita.fr>
12678
12679 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
12680
1109455c
AD
126812002-01-03 Akim Demaille <akim@epita.fr>
12682
12683 * src/parse-skel.y (process_skeleton): Don't bind the parser's
12684 tracing code to --trace, wait for a better --trace option, with
12685 args.
12686
7ea5e977
AD
126872002-01-03 Akim Demaille <akim@epita.fr>
12688
12689 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
12690 The ISO C++ standard is extremely clear about it: stderr is
12691 considered a macro, not a regular symbol (see table 94 `Header
12692 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
12693 Therefore std:: does not apply to it. It still does with fprintf.
12694 Also, s/cstdio.h/cstdio/.
12695
fab5b110
AD
126962002-01-03 Akim Demaille <akim@epita.fr>
12697
12698 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
12699 for non system headers.
12700
aed7fd9b
AD
127012002-01-02 Akim Demaille <akim@epita.fr>
12702
12703 Equip the skeleton chain with location tracking, runtime trace,
12704 pure parser and scanner.
12705
12706 * src/parse-skel.y: Request a pure parser, locations, and prefix
12707 renaming.
12708 (%union): Having several members with the same type does not help
12709 type mismatches, simplify.
12710 (YYPRINT, yyprint): New.
12711 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
12712 (skel_error): this.
12713 Handle locations.
12714 * src/scan-skel.l: Adjust to these changes.
12715 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
12716 (LOCATION_PRINT, skel_control_t): New.
12717
24fad99e
AD
127182001-12-30 Akim Demaille <akim@epita.fr>
12719
12720 * src/parse-skel.y: Get rid of the shift/reduce conflict:
12721 replace `gb' with BLANKS.
12722 * src/scan-skel.l: Adjust.
12723
a4b36db4
AD
127242001-12-30 Akim Demaille <akim@epita.fr>
12725
12726 * src/system.h: We don't need nor want bcopy.
12727 Throw away MS-DOS crap: we don't need getpid.
12728 * configure.in: We don't need strndup. It was even causing
12729 problems: because Flex includes the headers *before* us,
12730 _GNU_SOURCE is not defined by config.h, and therefore strndup was
12731 not visible.
12732 * lib/xstrndup.c: New.
12733 * src/scan-skel.l: Use it.
12734 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
12735 * src/parse-skel.y: Use %directives instead of #defines.
12736
1239777d
AD
127372001-12-30 Akim Demaille <akim@epita.fr>
12738
12739 * src/skeleton.h: New.
12740 * src/output.c (output_parser, output_master_parser): Remove, dead
12741 code.
12742 * src/output.h (get_lines_number, actions_output, guards_output)
12743 (token_definitions_output): Prototype them.
12744 * src/parse-skel.y: Add the license notice.
12745 Include output.h and skeleton.h.
12746 (process_skeleton): Returns void, and takes a single parameter.
12747 * src/scan-skel.l: Add the license notice.
12748 Include skeleton.h.
12749 Don't use %option yylineno: it seems that then Flex imagines
12750 REJECT has been used, and therefore it won't reallocate its
12751 buffers (which makes no other sense to me than a bug). It results
12752 in warnings for `unused: yy_flex_realloc'.
12753
9b3add5b
RA
127542001-12-30 Robert Anisko <robert.anisko@epita.fr>
12755
12756 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
12757 (MUSCLE_INSERT_PREFIX): ...to there.
12758 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
12759 (MUSCLE_INSERT_PREFIX): Move from here...
12760
12761 * src/bison.hairy: Add a section directive. Put braces around muscle
12762 names. This parser skeleton is still broken, but Bison should not
12763 choke on a bad muscle 'syntax'.
12764 * src/bison.simple: Add a section directive. Put braces around muscle
12765 names.
12766
12767 * src/files.h (strsuffix, stringappend): Add declarations.
12768 (tab_extension): Add declaration.
12769 (short_base_name): Add declaration.
12770
12771 * src/files.c (strsuffix, stringappend): No longer static. These
12772 functions are used in the skeleton parser.
12773 (tab_extension): New.
12774 (compute_base_names): Use the computations done in this function
fab5b110 12775 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
12776 names.
12777 (short_base_name): No longer static.
12778
12779 * src/output.c (output_skeleton): New.
12780 (output): Disable call to output_master_parser, and give a try to
12781 a new skeleton handling system.
12782 (guards_output, actions_output): No longer static.
12783 (token_definitions_output, get_lines_number): No longer static.
12784
12785 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
12786
fab5b110 12787 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
12788 parse-skel.y.
12789
12790 * src/parse-skel.y: New file.
12791 * src/scan-skel.l: New file.
12792
b5b61c61
AD
127932001-12-29 Akim Demaille <akim@epita.fr>
12794
12795 %name-prefix is broken.
12796
12797 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
12798 Adjust all dependencies.
12799 * tests/headers.at (export YYLTYPE): Strengthen this test: use
12800 %name-prefix.
12801
12802 Renaming yylval but not yylloc is not consistent. Now we do.
12803
12804 * src/bison.simple: Prefix yylloc if used.
12805 * doc/bison.texinfo (Decl Summary): Document that.
12806
8c9a50be
AD
128072001-12-29 Akim Demaille <akim@epita.fr>
12808
12809 * doc/bison.texinfo: Promote `%long-directive' over
12810 `%long_directive'.
12811 Remove all references to fixed-output-files, yacc is enough.
12812
d99361e6
AD
128132001-12-29 Akim Demaille <akim@epita.fr>
12814
12815 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
12816 user prologue. These are defaults.
12817 * tests/actions.at (Mid-rule actions): Make sure the user can
12818 define YYDEBUG and YYERROR_VERBOSE.
12819
b9cecb91
AD
128202001-12-29 Akim Demaille <akim@epita.fr>
12821
12822 * src/output.c (header_output): Don't forget to export YYLTYPE and
12823 yylloc.
12824 * tests/headers.at (export YYLTYPE): New, make sure it does.
12825 * tests/regression.at (%union and --defines, Invalid CPP headers):
12826 Move to...
12827 * tests/headers.at: here.
12828
aea13e97
AD
128292001-12-29 Akim Demaille <akim@epita.fr>
12830
12831 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
12832
931394cb
AD
128332001-12-29 Akim Demaille <akim@epita.fr>
12834
12835 * tests/actions.at (Mid-rule actions): Output on a single line
12836 instead of several.
12837
704a47c4
AD
128382001-12-29 Akim Demaille <akim@epita.fr>
12839
12840 * doc/bison.texinfo: Formatting changes.
12841
091e20bb
AD
128422001-12-29 Akim Demaille <akim@epita.fr>
12843
12844 Don't store the token defs in a muscle, just be ready to output it
12845 on command. Now possible via `symbols'. Fixes a memory leak.
12846
12847 * src/output.c (token_definitions_output): New.
12848 (output_parser, header_output): Use it.
12849 * src/reader.c (symbols_save): Remove.
12850
cce71710
AD
128512001-12-29 Akim Demaille <akim@epita.fr>
12852
12853 * src/bison.simple: Do not provide a default for YYSTYPE and
12854 YYLTYPE before the user's prologue. Otherwise it's hardly... a
12855 default.
12856
82c035a8
AD
128572001-12-29 Akim Demaille <akim@epita.fr>
12858
12859 Mid-rule actions are simply... ignored!
12860
12861 * src/reader.c (readgram): Be sure to attach mid-rule actions to
12862 the empty-rule associated to the dummy symbol, not to the host
12863 rule.
12864 * tests/actions.at (Mid-rule actions): New.
12865
8419d367
AD
128662001-12-29 Akim Demaille <akim@epita.fr>
12867
12868 Memory leak.
12869
12870 * src/reader.c (reader): Free grammar.
12871
375d5806
AD
128722001-12-29 Akim Demaille <akim@epita.fr>
12873
12874 Memory leak.
12875
12876 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
12877 since it allocates it for each state, although only one is needed.
12878 (allocate_storage): Do it here.
12879
f51cb8ff
AD
128802001-12-29 Akim Demaille <akim@epita.fr>
12881
12882 * src/options.h, src/options.c (create_long_option_table): Rename
12883 as...
12884 (long_option_table_new): this, with a clearer prototype.
12885 (percent_table): Remove, unused,
12886 * src/getargs.c (getargs): Adjust.
12887
29e88316
AD
128882001-12-29 Akim Demaille <akim@epita.fr>
12889
12890 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
12891 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
12892 as states.
12893
b9f71f19
AD
128942001-12-29 Akim Demaille <akim@epita.fr>
12895
12896 * src/lalr.c (build_relations): Rename `states' as `states1'.
12897 Sorry, I don't understand exactly what it is, no better name...
12898
1a2b5d37
AD
128992001-12-29 Akim Demaille <akim@epita.fr>
12900
12901 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
12902 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
12903 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
12904 as rules.
12905
1cca533e
AD
129062001-12-29 Akim Demaille <akim@epita.fr>
12907
12908 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
12909 ago.
12910
c03ae966
AD
129112001-12-29 Akim Demaille <akim@epita.fr>
12912
12913 * src/reader.c, src/reader.h (user_toknums): Remove.
12914 Adjust all users to use symbols[i]->user_token_number.
12915
5a670b1e
AD
129162001-12-29 Akim Demaille <akim@epita.fr>
12917
12918 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
12919 Adjust all users to use symbols[i]->prec or ->assoc.
12920
ad949da9
AD
129212001-12-29 Akim Demaille <akim@epita.fr>
12922
12923 * src/reader.c, src/reader.h (tags): Remove.
12924 Adjust all users to use symbols[i]->tag.
12925
0e78e603
AD
129262001-12-29 Akim Demaille <akim@epita.fr>
12927
12928 * src/gram.h, src/gram.c (symbols): New, similar to state_table
12929 and rule_table.
12930 * src/reader.c (packsymbols): Fill this table.
12931 Drop sprec.
12932 * src/conflicts.c (resolve_sr_conflict): Adjust.
12933 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
12934 single table.
12935 Use symbols[i]->tag instead of tags[i].
12936
213e640e
AD
129372001-12-29 Akim Demaille <akim@epita.fr>
12938
12939 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
12940 In addition, put a comment in there, to replace...
12941 * tests/regression.at (%union and C comments): Remove.
12942
e7b8bef1
AD
129432001-12-29 Akim Demaille <akim@epita.fr>
12944
12945 * tests/regression.at (Web2c Actions): Blindly move the actual
12946 output as expected output. The contents *seem* right to me, but I
12947 can't pretend reading perfectly parser tables... Nonetheless, all
12948 the other tests pass correctly, the table look OK, even though the
12949 presence of `$axiom' is to be noted: AFAICS it is useless (but
12950 harmless).
12951
b68e7744
AD
129522001-12-29 Akim Demaille <akim@epita.fr>
12953
12954 * src/reader.c (readgram): Don't add the rule 0 if there were no
12955 rules read. In other words, add it _after_ having performed
12956 grammar sanity checks.
12957 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
12958
78d5bae9
AD
129592001-12-29 Akim Demaille <akim@epita.fr>
12960
12961 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
12962 visible, and some states have now a different number.
12963
ff442794
AD
129642001-12-29 Akim Demaille <akim@epita.fr>
12965
12966 * src/reader.c (readgram): Bind the initial rule's lineno to that
12967 of the first rule.
12968 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
12969 (Solved SR Conflicts): Adjust rule 0's line number.
12970
610ab194
AD
129712001-12-29 Akim Demaille <akim@epita.fr>
12972
12973 Fix the `GAWK Grammar' failure.
12974
12975 * src/LR0.c (final_state): Initialize to -1 so that we do compute
12976 the reductions of the first state which was mistakenly confused
12977 with the final state because precisely final_state was initialized
12978 to 0.
12979 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
12980 now noticed by Bison.
12981 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
12982 have a reduction on $default.
12983
29d29c8f
AD
129842001-12-29 Akim Demaille <akim@epita.fr>
12985
12986 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
12987 rule line numbers.
12988 * src/closure.c (print_closure): Likewise.
12989 * src/derives.c (print_derives): Likewise.
12990 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
12991 now.
12992
7c6b64d0
AD
129932001-12-29 Akim Demaille <akim@epita.fr>
12994
12995 * src/lalr.c (lookaheads_print): New.
12996 (lalr): Call it when --trace-flag.
12997 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
12998 are dumped.
12999
3d4daee3
AD
130002001-12-29 Akim Demaille <akim@epita.fr>
13001
13002 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
13003 when walking through ritem, even via rule->rhs.
13004 * src/reduce.c (dump_grammar, useful_production, reduce_output)
13005 (useful_production, useless_nonterminals): Likewise.
13006 (reduce_grammar_tables): Likewise, plus update nritems.
13007 * src/nullable.c (set_nullable): Likewise.
13008 * src/lalr.c (build_relations): Likewise.
13009 * tests/sets.at (Nullable): Adjust.
13010 Fortunately, now, the $axiom is no longer nullable.
13011
9e7f6bbd
AD
130122001-12-29 Akim Demaille <akim@epita.fr>
13013
13014 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
13015 the 0-sentinel.
13016 * src/gram.c (ritem_longest_rhs): Likewise.
13017 * src/reduce.c (nonterminals_reduce): Likewise.
13018 * src/print_graph.c (print_graph): Likewise.
13019 * src/output.c (output_rule_data): Likewise.
13020 * src/nullable.c (set_nullable): Likewise.
13021
255ef638
AD
130222001-12-29 Akim Demaille <akim@epita.fr>
13023
13024 * src/output.c: Comment changes.
13025
0d8a7363
AD
130262001-12-27 Paul Eggert <eggert@twinsun.com>
13027
13028 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
13029 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
13030 Sparc, as they were causing more porting problems than the
13031 (minor) performance improvement was worth.
13032
13033 Also, catch up with 1.31's YYSTD.
13034
3db472b9
AD
130352001-12-27 Akim Demaille <akim@epita.fr>
13036
13037 * src/output.c (output_gram): Rely on nritems, not the
13038 0-sentinel. See below.
13039 Use -1 as separator, not 0.
13040 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
13041 Rely on -1 as separator in yyrhs, instead of 0.
13042 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
13043 twice `Now at end of input', therefore there are two lines less to
13044 expect.
13045
b365aa05
AD
130462001-12-27 Akim Demaille <akim@epita.fr>
13047
13048 * tests/regression.at (Unresolved SR Conflicts):
13049 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
13050 below.
13051
30171f79
AD
130522001-12-27 Akim Demaille <akim@epita.fr>
13053
13054 * src/LR0.c (new_state): Recognize the final state by the fact it
13055 is reached by eoftoken.
13056 (insert_start_shifting_state, insert_eof_shifting_state)
13057 (insert_accepting_state, augment_automaton): Remove, since now
13058 these states are automatically computed from the initial state.
13059 (generate_states): Adjust.
13060 * src/print.c: When reporting a rule number to the user, substract
13061 1, so that the axiom rule is rule 0, and the first user rule is 1.
13062 * src/reduce.c: Likewise.
13063 * src/print_graph.c (print_core): For the time being, just as for
13064 the report, depend upon --trace-flags to dump the full set of
13065 items.
13066 * src/reader.c (readgram): Once the grammar read, insert the rule
13067 0: `$axiom: START-SYMBOL $'.
13068 * tests/set.at: Adjust: rule 0 is now displayed, and since the
13069 number of the states has changed (the final state is no longer
13070 necessarily the last), catch up.
13071
75142d45
AD
130722001-12-27 Akim Demaille <akim@epita.fr>
13073
13074 Try to make the use of the eoftoken valid. Given that its value
13075 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
13076 is used instead of > 0 where appropriate, (ii), depend upon nritems
13077 instead of the 0-sentinel.
13078
13079 * src/gram.h, src/gram.c (nritems): New.
13080 Expected to be duplication of nitems, but for the time being...
13081 * src/reader.c (packgram): Assert nritems and nitems are equal.
13082 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
13083 * src/closure.c (print_closure, print_fderives): Likewise.
13084 * src/gram.c (ritem_print): Likewise.
13085 * src/print.c (print_core, print_grammar): Likewise.
13086 * src/print_graph.c: Likewise.
13087
b7c49edf
AD
130882001-12-27 Akim Demaille <akim@epita.fr>
13089
13090 * src/main.c (main): If there are complains after grammar
13091 reductions, then output the report anyway if requested, then die.
13092 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
13093 * src/reader.c (eoftoken): New.
13094 (parse_token_decl): If the token being defined has value `0', it
13095 is the eoftoken.
13096 (packsymbols): No longer hack `tags' to insert `$' by hand.
13097 Be sure to preserve the value of the eoftoken.
13098 (reader): Make sure eoftoken is defined.
13099 Initialize nsyms to 0: now eoftoken is created just like the others.
13100 * src/print.c (print_grammar): Don't special case the eof token.
13101 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
13102 lie anyway, albeit pleasant.
13103 * tests/calc.at: Exercise error messages with eoftoken.
13104 Change the grammar so that empty input is invalid.
13105 Adjust expectations.
13106 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
13107
ec2da99f
AD
131082001-12-27 Akim Demaille <akim@epita.fr>
13109
13110 * configure.in: Check the protos of strchr ans strspn.
13111 Replace strchr if needed.
13112 * src/system.h: Provide the protos of strchr, strspn and memchr if
13113 missing.
13114 * lib/strchr.c: New.
13115 * src/reader.c (symbols_save): Use strchr.
13116
8adfa272
AD
131172001-12-27 Akim Demaille <akim@epita.fr>
13118
13119 * src/print.c, src/print_graph.c (escape): New.
13120 Use it to quote the TAGS outputs.
13121 * src/print_graph.c (print_state): Now errors are in red, and
13122 reductions in green.
13123 Prefer high to wide: output the state number on a line of its own.
13124
80dac38c
AD
131252001-12-27 Akim Demaille <akim@epita.fr>
13126
13127 * src/state.h, src/state.c (reductions_new): New.
13128 * src/LR0.c (set_state_table): Let all the states have a
13129 `reductions', even if reduced to 0.
13130 (save_reductions): Adjust.
13131 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
13132 * src/print.c (print_reductions, print_actions): Adjust.
13133 * src/output.c (action_row): Adjust.
13134
2cec70b9
AD
131352001-12-27 Akim Demaille <akim@epita.fr>
13136
13137 * src/state.h, src/state.c (errs_new, errs_dup): New.
13138 * src/LR0.c (set_state_table): Let all the states have an errs,
13139 even if reduced to 0.
13140 * src/print.c (print_errs, print_reductions): Adjust.
13141 * src/output.c (output_actions, action_row): Adjust.
13142 * src/conflicts.c (resolve_sr_conflict): Adjust.
13143
13ca549a
AD
131442001-12-27 Akim Demaille <akim@epita.fr>
13145
13146 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
13147
5092aba5
AD
131482001-12-27 Akim Demaille <akim@epita.fr>
13149
13150 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
13151 * src/print.c: here.
13152 (lookaheadset, shiftset): New, used as additional storage by
13153 print_reductions.
13154 (print_results): Adjust.
13155 (print_shifts, print_gotos, print_errs): New, extracted from...
13156 (print_actions): here.
13157 * src/print_graph.c (print_actions): Remove dead code.
13158
11e2beca
AD
131592001-12-27 Akim Demaille <akim@epita.fr>
13160
13161 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
13162 `$n' and `@n'.
13163
dac3c910
AD
131642001-12-27 Akim Demaille <akim@epita.fr>
13165
13166 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
13167 (build_relations): Adjust.
13168
d0b0fefa
AD
131692001-12-27 Akim Demaille <akim@epita.fr>
13170
13171 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
13172 duplication.
13173
adc8c848
AD
131742001-12-27 Akim Demaille <akim@epita.fr>
13175
13176 * src/reader.c (packgram): Catch nitems overflows.
13177
14d293ac
AD
131782001-12-27 Akim Demaille <akim@epita.fr>
13179
13180 * src/files.c, src/files.h (guard_obstack): Remove.
13181 * src/output.c (output): Adjust.
13182 * src/reader.c (parse_braces): New, factoring...
13183 (copy_action, copy_guard): these two which are renamed as...
13184 (parse_action, parse_guard): these.
13185 As a voluntary consequence, using braces around guards is now
13186 mandatory.
13187
f499b062
AD
131882001-12-27 Akim Demaille <akim@epita.fr>
13189
13190 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
13191 * src/reader.c (symbol_list): `guard' and `guard_line' are new
13192 members.
13193 (symbol_list_new): Adjust.
13194 (copy_action): action_line is the first line, not the last.
13195 (copy_guard): Just as for actions, store the `action' only, not
13196 the switch/case/break flesh.
13197 Don't parse the user action that might follow the guard, let...
13198 (readgram): do it, i.e., now, there can be an action after a
13199 guard.
13200 In other words the guard is just explicitly optional.
13201 (packgram): Adjust.
13202 * src/output.c (guards_output): New.
13203 (output_parser): Call it when needed.
13204 (output): Also free the guard and attrs obstacks.
13205 * src/files.c, src/files.h (obstack_save): Remove.
13206 (output_files): Remove.
13207 As a result, if one needs the former `.act' file, using an
13208 appropriate skeleton which requires actions and guards is now
13209 required.
13210 * src/main.c (main): Adjust.
13211 * tests/semantic.at: New.
13212 * tests/regression.at: Use `input.y' as input file name.
13213 Avoid 8+3 problems by requiring input.c when the test needs the
13214 parser.
13215
d945f5cd
AD
132162001-12-27 Akim Demaille <akim@epita.fr>
13217
13218 * src/reader.c (symbol_list_new): Be sure to initialize all the
13219 fields.
13220
d200e455
AD
132212001-12-27 Akim Demaille <akim@epita.fr>
13222
13223 All the hacks using a final pseudo state are now useless.
13224
13225 * src/LR0.c (set_state_table): state_table holds exactly nstates.
13226 * src/lalr.c (nLA): New.
13227 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
13228 instead of lookaheadsp from the pseudo state (nstate + 1).
13229
f9507c28
AD
132302001-12-27 Akim Demaille <akim@epita.fr>
13231
13232 * src/output.c (action_row, token_actions): Use a state_t instead
13233 of a integer, and nlookaheads instead of the following state's
13234 lookaheadsp.
13235
065fbd27
AD
132362001-12-27 Akim Demaille <akim@epita.fr>
13237
13238 * src/conflicts.c (log_resolution, flush_shift)
13239 (resolve_sr_conflict, set_conflicts, solve_conflicts)
13240 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
13241 (conflicts_print, print_reductions): Use a state_t instead of an
13242 integer when referring to a state.
13243 As much as possible, depend upon nlookaheads, instead of the
13244 `lookaheadsp' member of the following state (since lookaheads of
13245 successive states are successive, the difference between state n + 1
13246 and n served as the number of lookaheads for state n).
13247 * src/lalr.c (add_lookback_edge): Likewise.
13248 * src/print.c (print_core, print_actions, print_state)
13249 (print_results): Likewise.
13250 * src/print_graph.c (print_core, print_actions, print_state)
13251 (print_graph): Likewise.
13252 * src/conflicts.h: Adjust.
13253
1b177bd7
AD
132542001-12-27 Akim Demaille <akim@epita.fr>
13255
13256 * src/bison.hairy: Formatting/comment changes.
13257 ANSIfy.
13258 Remove `register' indications.
13259 Add plenty of `static'.
13260
7742ddeb
AD
132612001-12-27 Akim Demaille <akim@epita.fr>
13262
13263 * src/output.c (prepare): Drop the muscle `ntbase' which
13264 duplicates ntokens.
13265 * src/bison.simple: Formatting/comment changes.
13266 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
13267 is an undocumented synonym.
13268
1fa14068
AD
132692001-12-22 Akim Demaille <akim@epita.fr>
13270
13271 * src/output.c (output_table_data): Change the prototype to use
13272 `int' for array ranges: some invocations do pass an int, not a
13273 short.
13274 Reported by Wayne Green.
13275
b9752825
AD
132762001-12-22 Akim Demaille <akim@epita.fr>
13277
13278 Some actions of web2c.y are improperly triggered.
13279 Reported by Mike Castle.
13280
13281 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
13282 * tests/regression.at (Web2c): Rename as...
13283 (Web2c Report): this.
13284 (Web2c Actions): New.
13285
776209d6
AD
132862001-12-22 Akim Demaille <akim@epita.fr>
13287
13288 Reductions in web2c.y are improperly reported.
13289 Reported by Mike Castle.
13290
13291 * src/conflicts.c (print_reductions): Fix.
13292 * tests/regression.at (Web2c): New.
13293
275fc3ad
AD
132942001-12-18 Akim Demaille <akim@epita.fr>
13295
13296 Some host fail on `assert (!"foo")', which expands to
13297 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
13298 Reported by Nelson Beebee.
13299
13300 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
13301 `#define it_succeeded 0' and `assert (it_succeeded)'.
13302
897668ee
MA
133032001-12-17 Marc Autret <autret_m@epita.fr>
13304
13305 * src/bison.simple: Don't hard code the skeleton line and filename.
13306 * src/output.c (output_parser): Rename 'line' as 'output_line'.
13307 New line counter 'skeleton_line' (skeleton-line muscle).
13308
ab3399e0
PE
133092001-12-17 Paul Eggert <eggert@twinsun.com>
13310
13311 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
13312 YYDEBUG must be defined to a nonzero value.
13313
13314 * src/bison.simple (yytname): Do not assume that the user defines
13315 YYDEBUG to a properly parenthesized expression.
13316
3877f72b
AD
133172001-12-17 Akim Demaille <akim@epita.fr>
13318
13319 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
13320 nlookaheads is a new member.
13321 Adjust all users.
13322 * src/lalr.h (nlookaheads): Remove this orphan declaration.
13323 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
13324 state.
776209d6 13325
331dbc1b
AD
133262001-12-17 Akim Demaille <akim@epita.fr>
13327
13328 * src/files.h, src/files.c (open_files, close_files): Remove.
13329 * src/main.c (main): Don't open/close files, nor invoke lex_free,
13330 let...
13331 * src/reader.c (reader): Do it.
776209d6 13332
be750e4c
AD
133332001-12-17 Akim Demaille <akim@epita.fr>
13334
13335 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 13336
709ae8c6
AD
133372001-12-17 Akim Demaille <akim@epita.fr>
13338
13339 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
13340 (flush_reduce): New.
13341 (resolve_sr_conflict): Adjust.
776209d6 13342
f87685c3
AD
133432001-12-17 Akim Demaille <akim@epita.fr>
13344
13345 * src/output.c (output_obstack): Be static and rename as...
13346 (format_obstack): this, to avoid any confusion with files.c's
13347 output_obstack.
13348 * src/reader.h (muscle_obstack): Move to...
13349 * src/output.h: here, since it's defined in output.c.
13350
837491d8
AD
133512001-12-17 Akim Demaille <akim@epita.fr>
13352
13353 * src/output.c (action_row, save_column, default_goto)
13354 (sort_actions, matching_state, pack_vector): Better variable
13355 locality.
13356
796d61fb
AD
133572001-12-17 Akim Demaille <akim@epita.fr>
13358
13359 * src/output.c: Various formatting changes.
776209d6 13360
64d15509
AD
133612001-12-17 Akim Demaille <akim@epita.fr>
13362
13363 * src/files.c (output_files): Free the output_obstack.
13364 * src/main.c (main): Call print and print_graph conditionally.
13365 * src/print.c (print): Work unconditionally.
13366 * src/print_graph.c (print_graph): Work unconditionally.
13367 * src/conflicts.c (log_resolution): Output only if verbose_flag.
13368
fbc8ecb7
MA
133692001-12-16 Marc Autret <autret_m@epita.fr>
13370
13371 * src/output.c (actions_output): Fix. When we use %no-lines,
13372 there is one less line per action.
13373
f0440388
MA
133742001-12-16 Marc Autret <autret_m@epita.fr>
13375
13376 * src/bison.simple: Remove a useless #line directive.
13377 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
13378 * src/output.c (get_lines_number): New.
776209d6 13379 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
13380 output muscles.
13381 Fix line numbering.
13382 (actions_output): Computes the number of lines taken by actions.
13383 (output_master_parser): Insert new skeleton which is the name of
13384 the output parser file name.
13385
a79986b8
MA
133862001-12-15 Marc Autret <autret_m@epita.fr>
13387
13388 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
13389
4ec8e00f
MA
133902001-12-15 Marc Autret <autret_m@epita.fr>
13391
13392 * src/output.c (output_gram): Keep track of the hairy one.
13393
1a4648ff
AD
133942001-12-15 Akim Demaille <akim@epita.fr>
13395
13396 Make `make distcheck' work.
13397
13398 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
13399 system.h which uses libgettext.h.
13400
9c2c67e6
AD
134012001-12-15 Akim Demaille <akim@epita.fr>
13402
13403 * src/nullable.c (set_nullable): Useless rules must be skipped,
13404 otherwise, since we range over their symbols, we might look at a
13405 nonterminal which no longer ``exists'', i.e., it is not counted in
13406 `nvars', hence we overflow our arrays.
13407
93ede233
AD
134082001-12-15 Akim Demaille <akim@epita.fr>
13409
13410 The header can also be produced directly, without any obstack!
13411 Yahoo!
13412
13413 * src/files.c, src/files.h (defines_obstack): Remove.
13414 (compute_header_macro): Global.
13415 (defines_obstack_save): Remove.
13416 * src/reader.c (parse_union_decl): No longer output to
13417 defines_obstack: its content can be found in the `stype' muscle
13418 anyway.
13419 (output_token_translations): Merge into...
13420 (symbols_output): this.
13421 Rename as...
13422 (symbols_save): this.
13423 (reader): Adjust.
13424 * src/output.c (header_output): New.
13425 (output): Call it.
13426
2666f928
AD
134272001-12-15 Akim Demaille <akim@epita.fr>
13428
13429 * src/reader.c (parse_union_decl): Instead of handling two obstack
13430 simultaneously, use one to define the `stype' muscle, and use the
13431 value of the latter to fill defines_obstack.
13432 (copy_comment): Remove.
13433 (copy_comment2): Work for a single obstack.
13434 Rename as...
13435 (copy_comment): this.
13436
428046f8
AD
134372001-12-15 Akim Demaille <akim@epita.fr>
13438
13439 * src/lex.c, src/lex.h (xgetc): No longer static.
13440 * src/reader.c (parse_union_decl): Revamp.
13441
ea52d706
AD
134422001-12-15 Akim Demaille <akim@epita.fr>
13443
13444 Still making progress in separating Bison into (i) input, (ii)
13445 process, (iii) output: now we can directly output the parser file
13446 without using table_obstack at all.
13447
13448 * src/files.c, src/files.h (table_obstack): Bye bye.
13449 (parser_file_name): New.
13450 * src/files.c (compute_output_file_names): Compute it.
13451 * src/output.c (actions_output, output_parser)
13452 (output_master_parser): To a file instead of an obstack.
13453
3f96f4dc
AD
134542001-12-15 Akim Demaille <akim@epita.fr>
13455
13456 Attach actions to rules, instead of pre-outputting them to
13457 actions_obstack.
13458
13459 * src/gram.h (rule_t): action and action_line are new members.
13460 * src/reader.c (symbol_list): Likewise.
13461 (copy_action): Save the actions within the rule.
13462 (packgram): Save them in rule_table.
13463 * src/output.c (actions_output): New.
13464 (output_parser): Use it on `%%actions'.
13465 (output_rule_data): Don't free rule_table.
13466 (output): Do it.
13467 (prepare): Don't save the `action' muscle.
13468 * src/bison.simple: s/%%action/%%actions/.
13469
51576fb3
AD
134702001-12-15 Akim Demaille <akim@epita.fr>
13471
13472 * src/reader.c (copy_action): When --yacc, don't append a `;'
13473 to the user action: let it fail if lacking.
dee049eb 13474 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 13475
2648a72d
AD
134762001-12-14 Akim Demaille <akim@epita.fr>
13477
13478 * src/lex.c (literalchar): Simply return the char you decoded, non
13479 longer mess around with obstacks and int pointers.
13480 Adjust all callers.
13481
92790e5b
AD
134822001-12-14 Akim Demaille <akim@epita.fr>
13483
13484 * src/lex.c (literalchar): Don't escape the special characters,
13485 just decode them, and keep them as char (before, eol was output as
13486 the 2 char string `\n' etc.).
13487 * src/output.c (output_rule_data): Use quotearg to output the
13488 token strings.
13489
927c1557
PE
134902001-12-13 Paul Eggert <eggert@twinsun.com>
13491
13492 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
13493 Do not infringe on the global user namespace when using C++.
13494 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
13495 All uses of `fprintf' and `stderr' changed.
13496
13497 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
13498
ed8e1f68
AD
134992001-12-13 Akim Demaille <akim@epita.fr>
13500
13501 The computation of nullable is broken: it doesn't handle empty
13502 RHS's properly.
13503
13504 * tests/torture.at (GNU AWK Grammar): New.
13505 * tests/sets.at (Nullable): New.
13506 * src/nullable.c (set_nullable): Instead of blindly looping over
13507 `ritems', loop over the rules, and then over their rhs's.
13508
13509 Work around Autotest bugs.
13510
13511 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
13512 frame, because Autotest understand lines starting with a `+' as
13513 traces from the shell. Then, they are not processed properly.
13514 Admittedly an Autotest bug, but we don't have time to wait for
13515 Autotest to catch up.
13516 * tests/regression.at (Broken Closure): Adjust to the new table
13517 frames.
13518 Move to...
13519 * tests/sets.at: here.
13520
cb581495
AD
135212001-12-13 Akim Demaille <akim@epita.fr>
13522
13523 * src/closure.c (closure): Use nrules instead of playing tricks
13524 with BITS_PER_WORD.
13525
2e729273
AD
135262001-12-13 Akim Demaille <akim@epita.fr>
13527
13528 * src/print.c (print_actions): Output the handling of `$' as the
13529 traces do: shifting the token EOF. Before EOF was treated as a
13530 nonterminal.
13531 * tests/regression.at: Adjust some tests.
13532 * src/print_graph.c (print_core): Complete the set of items via
13533 closure. The next-to-final and final states are still unsatisfying,
13534 but that's to be addressed elsewhere.
13535 No longer output the rule numbers, but do output the state number.
13536 A single loop for the shifts + gotos is enough, but picked a
13537 distinct color for each.
13538 (print_graph): Initialize and finalize closure.
13539
107f7dfb
AD
135402001-12-13 Akim Demaille <akim@epita.fr>
13541
13542 * src/reader.c (readgram): Remove dead code, an strip useless
13543 braces.
13544 (get_type): Remove, unused.
13545
9b53a24f
AD
135462001-12-12 Akim Demaille <akim@epita.fr>
13547
13548 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
13549 on that of lib/error.c.
13550
dbfb6dcd
AD
135512001-12-12 Akim Demaille <akim@epita.fr>
13552
13553 Some hosts don't like `/' in includes.
13554
13555 * src/system.h: Include libgettext.h without qualifying the path.
13556 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
13557 $(top_srcdir).
13558
c25fb648
MA
135592001-12-11 Marc Autret <autret_m@epita.fr>
13560
13561 * src/output.c (output_parser): Remove useless muscle.
13562
710ddc4f
MA
135632001-12-11 Marc Autret <autret_m@epita.fr>
13564
13565 * src/bison.simple: Remove #line just before %%epilogue. It
13566 is now handled in ...
13567 * src/reader.c (read_additionnal_code): Add the output of a
13568 #line for the epilogue.
13569
e83d80b8
MA
135702001-12-10 Marc Autret <autret_m@epita.fr>
13571
927c1557 13572 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
13573 replace precedent remove.
13574 * src/bison.simple: Remove #line before %%prologue because
13575 %%input-line is wrong at this time.
13576
971d5158
MA
135772001-12-10 Marc Autret <autret_m@epita.fr>
13578
13579 * src/reader.c (symbols_output): Clean up.
927c1557 13580 * src/output.c (output_gram, output): Clean up.
971d5158 13581
5edafffd
AD
135822001-12-10 Akim Demaille <akim@epita.fr>
13583
13584 * src/lalr.c (initialize_lookaheads): New. Extracted from...
13585 * src/LR0.c (set_state_table): here.
13586 * src/lalr.c (lalr): Call it.
13587
0279f8e9
AD
135882001-12-10 Akim Demaille <akim@epita.fr>
13589
13590 * src/state.h (shifts): Remove the `number' member: shifts are
13591 attached to state, hence no longer need to be labelled with a
13592 state number.
13593
190c4f5f
AD
135942001-12-10 Akim Demaille <akim@epita.fr>
13595
13596 Now that states have a complete set of members, the linked list of
13597 shifts is useless: just fill directly the state's shifts member.
13598
13599 * src/state.h (shifts): Remove the `next' member.
13600 * src/LR0.c (first_state, last_state): Remove.
13601 Adjust the callers.
13602 (augment_automaton): Don't look for the shifts that must be added
13603 a shift on EOF: it is those of the state we looked for! But now,
13604 since shifts are attached, it is no longer needed to looking
13605 merely by its id: its number.
13606
2a73b93d
AD
136072001-12-10 Akim Demaille <akim@epita.fr>
13608
13609 * src/LR0.c (augment_automaton): Better variable locality.
13610 Remove an impossible branch: if there is a state corresponding to
13611 the start symbol being shifted, then there is shift for the start
13612 symbol from the initial state.
13613
74392f6a
AD
136142001-12-10 Akim Demaille <akim@epita.fr>
13615
13616 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
13617 only when appropriate: when insert_start_shifting_state' is not
13618 invoked.
13619 * tests/regression.at (Rule Line Numbers): Adjust.
13620
37c82725
AD
136212001-12-10 Akim Demaille <akim@epita.fr>
13622
13623 * src/LR0.c (augment_automaton): Now that all states have shifts,
13624 merge the two cases addition shifts to the initial state.
13625
6a164e0c
AD
136262001-12-10 Akim Demaille <akim@epita.fr>
13627
13628 * src/lalr.c (set_state_table): Move to...
13629 * src/LR0.c: here.
13630 * src/lalr.c (lalr): Don't call it...
13631 * src/LR0.c (generate_states): do it.
13632 * src/LR0.h (first_state): Remove, only the table is used.
13633
7215de24
AD
136342001-12-10 Akim Demaille <akim@epita.fr>
13635
13636 * src/LR0.h (first_shift, first_reduction): Remove.
13637 * src/lalr.c: Don't use first_shift: find shifts through the
13638 states.
13639
80e25d4d
AD
136402001-12-10 Akim Demaille <akim@epita.fr>
13641
13642 * src/LR0.c: Attach shifts to states as soon as they are
13643 computed.
13644 * src/lalr.c (set_state_table): Instead of assigning shifts to
13645 state, just assert that the mapping was properly done.
13646
0ab3728b
AD
136472001-12-10 Akim Demaille <akim@epita.fr>
13648
13649 * src/LR0.c (insert_start_shift): Rename as...
13650 (insert_start_shifting_state): this.
13651 (insert_eof_shifting_state, insert_accepting_state): New.
13652 (augment_automaton): Adjust.
13653 Better locality of the variables.
13654 When looking if the start_symbol is shifted from the initial
13655 state, using `while (... symbol != start_symbol ...)' sounds
13656 better than `while (... symbol < start_symbol ...)': If fail
13657 to see how the order between symbols could be relevant!
13658
78af9bbc
AD
136592001-12-10 Akim Demaille <akim@epita.fr>
13660
13661 * src/getargs.h: Don't declare `spec_name_prefix' and
13662 `spec_file_prefix', declared by src/files.h.
13663 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
13664 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
13665 * src/output.c (prepare): Adjust.
13666 * src/reader.c (symbols_output): Likewise.
13667 * src/vmsgetargs.c: Vaguely adjust, but who cares?
13668
bdef2a41
AD
136692001-12-10 Akim Demaille <akim@epita.fr>
13670
13671 * src/muscle_tab.c (muscle_init): NULL is a better default than
13672 `"0"'.
13673
3735969c
AD
136742001-12-10 Akim Demaille <akim@epita.fr>
13675
13676 * src/reader.c (reader): Calling symbols_output once is enough.
13677
49701457
AD
136782001-12-10 Akim Demaille <akim@epita.fr>
13679
13680 Now that states have a complete set of members, the linked list of
13681 reductions is useless: just fill directly the state's reductions
13682 member.
13683
13684 * src/state.h (struct reductions): Remove member `number' and
13685 `next'.
13686 * src/LR0.c (first_reduction, last_reduction): Remove.
13687 (save_reductions): Don't link the new reductions, store them in
13688 this_state.
13689 * src/lalr.c (set_state_table): No need to attach reductions to
13690 states, it's already done.
13691 * src/output.c (output_actions): No longer free the shifts, then
13692 the reductions, then the states: free all the states and their
13693 members.
13694
0edad749
AD
136952001-12-10 Akim Demaille <akim@epita.fr>
13696
13697 * src/options.c (OPTN, DRTV, BOTH): New.
13698 (option_table): Use them.
13699
0edad749
AD
13700 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
13701 the job of system.h.
13702 * src/options.c: Don't include stdio.h and xalloc.h for the same
13703 reasons.
13704
5449dd0f
AD
137052001-12-10 Akim Demaille <akim@epita.fr>
13706
13707 * src/output.c (output, prepare): Make sure the values of the
13708 muscles `action' and `prologue' are 0-terminated.
13709
a870c567
AD
137102001-12-10 Akim Demaille <akim@epita.fr>
13711
13712 Clean up GCC warnings.
13713
13714 * src/reader.c (copy_action): `buf' is not used.
13715 (parse_skel_decl): Be static.
13716 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
13717 * src/options.h (create_long_option_table): Have a real prototype.
13718 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
13719 (hash_delete_at): Return const void *.
13720 Adjust casts to preserve the const.
13721
80df8768
AD
137222001-12-10 Akim Demaille <akim@epita.fr>
13723
13724 * configure.in: Require 2.52g.
13725 M4 is not needed, but AUTOM4TE is.
13726 * m4/m4.m4: Remove.
13727 * tests/Makefile.am: Adjust.
13728
f693ad14
AD
137292001-12-10 Akim Demaille <akim@epita.fr>
13730
13731 One structure for states is enough, even though theoretically
13732 there are LR(0) states and LALR(1) states.
13733
13734 * src/lalr.h (state_t): Remove.
13735 (state_table): Be state_t **, not state_t *.
13736 * src/state.h (core, CORE_ALLOC): Rename as...
13737 (state_t, STATE_ALLOC): this.
13738 Add the LALR(1) members: shifts, reductions, errs.
13739 * src/LR0.c (state_table): Rename as...
13740 (state_hash): this, to avoid name clashes with the global
13741 `state_table'.
13742 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
13743 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
13744
74ffbcb6
AD
137452001-12-10 Akim Demaille <akim@epita.fr>
13746
13747 Bison dumps core on bash.y.
13748 Reported by Pascal Bart.
13749
13750 * src/warshall.c (bitmatrix_print): New.
13751 (TC): Use it.
ba0fe3c7 13752 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
13753 j must be the outer loop.
13754 * tests/regression.at (Broken Closure): New.
13755
07708e19
AD
137562001-12-05 Akim Demaille <akim@epita.fr>
13757
13758 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
13759 its argument.
ba1ecc07 13760 Reported by Peter Hamorsky.
07708e19 13761
92b16366
AD
137622001-12-05 Akim Demaille <akim@epita.fr>
13763
13764 * src/conflicts.c (err_table): Remove.
13765 (resolve_sr_conflict): Adjust.
13766 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
13767 Rename as...
13768 (state_t.reductions, state_t.shifts): this.
13769
076ab033
AD
137702001-12-05 Akim Demaille <akim@epita.fr>
13771
13772 * src/reduce.c (reduce_grammar_tables): No longer disable the
13773 removal of useless rules via CPP but via `if (0)', so that the
13774 compiler still check the code is valid.
13775 For instance, it should have noticed `rline' no longer exists: use
13776 the `line' member of rule_t.
13777 * src/gram.c (dummy, rline): Remove, unused.
13778
3843c413
AD
137792001-12-05 Akim Demaille <akim@epita.fr>
13780
13781 * src/output.c (pack_vector): Use assert, not berror.
13782 * src/main.c (berror): Remove, unused.
13783
43168960
AD
137842001-12-05 Akim Demaille <akim@epita.fr>
13785
13786 New experimental feature: if --verbose --trace output all the
13787 items of a state, not only its kernel.
13788
13789 * src/print.c (print_core): If `trace_flag', then invoke closure
13790 before outputting the items of the state (print_core is no longer
13791 a correct name them).
13792 (print_results): Invoke new_closure/free_closure if needed.
13793
b2872512
AD
137942001-12-05 Akim Demaille <akim@epita.fr>
13795
13796 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
13797 * src/closure.c, src/closure.h (itemsetsize): Rename as...
13798 (nitemset): for consistency with the rest of the project.
13799
23cbcc6c
AD
138002001-12-05 Akim Demaille <akim@epita.fr>
13801
13802 * src/closure.c (print_closure): Improve.
13803 (closure): Use it for printing input and output.
13804
03ec521c
AD
138052001-12-05 Akim Demaille <akim@epita.fr>
13806
13807 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
13808 indexed by nonterminals.
13809
3a7456dd
AD
138102001-12-05 Akim Demaille <akim@epita.fr>
13811
13812 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
13813 what it was!).
13814 * src/warshall.h: Remove accidental duplication of the content.
13815
1cbcf2e7
AD
138162001-12-05 Akim Demaille <akim@epita.fr>
13817
13818 * src/closure.c (set_fderives): De-obfuscate.
13819
84182270
AD
138202001-12-05 Akim Demaille <akim@epita.fr>
13821
13822 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
13823
3f6f053c
AD
138242001-12-05 Akim Demaille <akim@epita.fr>
13825
13826 * src/closure.c (set_firsts): De-obfuscate.
13827
7a5350ba
AD
138282001-12-05 Akim Demaille <akim@epita.fr>
13829
13830 * src/output.c (action_row): De-obfuscate
13831 using the good o' techniques: arrays not pointers, variable
13832 locality, BITISSET, RESETBIT etc.
13833
d954473d
AD
138342001-12-05 Akim Demaille <akim@epita.fr>
13835
13836 Pessimize the code to simplify it: from now on, all the states
13837 have a valid SHIFTS, which NSHIFTS is possibly 0.
13838
13839 * src/LR0.c (shifts_new): Be global and move to..
13840 * src/state.c, src/state.h: here.
13841 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
13842 * src/print_graph: Adjust.
13843
9839bbe5
AD
138442001-12-05 Akim Demaille <akim@epita.fr>
13845
13846 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
13847 * src/conflicts.c: Use it.
13848 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
13849 incorrectly ``simplified''.
13850
9f136c07
AD
138512001-12-05 Akim Demaille <akim@epita.fr>
13852
13853 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
13854 using the good o' techniques: arrays not pointers, variable
13855 locality, BITISSET, RESETBIT etc.
13856
b608206e
AD
138572001-12-05 Akim Demaille <akim@epita.fr>
13858
13859 * src/state.h (SHIFT_SYMBOL): New.
13860 * src/conflicts.c: Use it to deobfuscate.
13861
52afa962
AD
138622001-12-05 Akim Demaille <akim@epita.fr>
13863
13864 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
13865 (print_reductions): De-obfuscate using the good o' techniques:
13866 arrays not pointers, variable locality, BITISSET.
13867
e74dc321
AD
138682001-12-05 Akim Demaille <akim@epita.fr>
13869
13870 * src/conflicts.c (print_reductions): Arrays, not pointers.
13871 Use BITISSET.
13872
768fca83
AD
138732001-12-05 Akim Demaille <akim@epita.fr>
13874
13875 * src/conflicts.c (print_reductions): Pessimize, but clarify.
13876
a17e599f
AD
138772001-12-05 Akim Demaille <akim@epita.fr>
13878
13879 * src/conflicts.c (print_reductions): Improve variable locality.
13880
a04bc341
AD
138812001-12-05 Akim Demaille <akim@epita.fr>
13882
13883 * src/conflicts.c (print_reductions): Pessimize, but clarify.
13884
c8ea038e
AD
138852001-12-05 Akim Demaille <akim@epita.fr>
13886
13887 * src/conflicts.c (print_reductions): Improve variable locality.
13888
aa2aab3c
AD
138892001-12-05 Akim Demaille <akim@epita.fr>
13890
13891 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
13892 * src/lalr.c: Use them.
13893
b178c8cc
AD
138942001-12-05 Akim Demaille <akim@epita.fr>
13895
13896 * src/LR0.c (augment_automaton): Formatting changes.
13897 Better variable locality.
13898
f67d13aa
AD
138992001-12-05 Akim Demaille <akim@epita.fr>
13900
13901 * src/lalr.c (matrix_print): New.
13902 (transpose): Use it.
13903 Use arrays instead of pointers.
13904
c2713865
AD
139052001-12-05 Akim Demaille <akim@epita.fr>
13906
13907 * src/lalr.c (maxrhs): Move to...
13908 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
13909 * src/lalr.c (build_relations): Adjust.
13910
9887c18a
AD
139112001-12-05 Akim Demaille <akim@epita.fr>
13912
13913 * src/lalr.c (transpose): Free the memory allocated to the
13914 argument, as it is replaced by the results by the unique caller.
13915 (build_relations): Merely invoke transpose: it handles the memory
13916 deallocation.
13917 Improve variable locality.
13918 Avoid variables used as mere abbreviations.
13919 (compute_lookaheads): Use arrays instead of pointers.
13920
4d4f699c
AD
139212001-12-05 Akim Demaille <akim@epita.fr>
13922
13923 * src/lalr.c (initialize_F): Improve variable locality.
13924 Avoid variables used as mere abbreviations.
13925
80a69750
AD
139262001-12-05 Akim Demaille <akim@epita.fr>
13927
13928 * src/derives.c (print_derives): Display the ruleno.
13929 * src/lalr.c (initialize_F, transpose): Better variable locality
13930 to improve readability.
13931 Avoid variables used as mere abbreviations.
13932
fe961097
AD
139332001-12-05 Akim Demaille <akim@epita.fr>
13934
13935 * src/lalr.c (traverse): Use arrays instead of pointers.
13936
e3e4e814
AD
139372001-12-05 Akim Demaille <akim@epita.fr>
13938
13939 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
13940 the handling of squeue.
13941 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
13942
630e182b
AD
139432001-12-05 Akim Demaille <akim@epita.fr>
13944
13945 Because useless nonterminals are now kept alive (instead of being
13946 `destroyed'), we now sometimes examine them, and store information
13947 related to them. Hence we need to know their number, and adjust
13948 memory allocations.
13949
13950 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
13951 static.
13952 * src/LR0.c (allocate_itemsets): The memory allocated to
13953 `symbol_count' was used for two different purpose: once to count
13954 the number of occurrences of each symbol, and later reassigned to
13955 `shift_symbol', containing the symbol that can be shifted from a
13956 given state.
13957 Deobfuscate, i.e., allocate, use and free `symbol_count' here
13958 only, and...
13959 (new_itemsets): Allocate `shift_symbol' here.
13960 (allocate_itemsets): symbol_count includes useless nonterminals.
13961 Make room for them.
13962 (free_storage): Use `free', not `XFREE', for pointers that cannot
13963 be null.
13964
81b51460
AD
139652001-12-05 Akim Demaille <akim@epita.fr>
13966
13967 * src/nullable.c (set_nullable): Deobfuscate the handling of
13968 ritem.
13969 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
13970
3067fbef
AD
139712001-12-05 Akim Demaille <akim@epita.fr>
13972
13973 * src/gram.c, src/gram.h (ritem_print): New.
13974 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
13975 (This useless function was defined only to work around VMS linkers
13976 that can't handle compilation units with variables only).
13977 * src/reduce.c (dump_grammar): Use it to trace the construction of
13978 ritem.
13979
c2bea5f9
PE
139802001-12-04 Paul Eggert <eggert@twinsun.com>
13981
7d27c823
PE
13982 * src/bison.simple (union yyalloc): Change member names
13983 to be the same as the stack names.
13984 (yyparse): yyptr is now union yyalloc *, not char *.
13985 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
13986 and may generate better code on some machines.
c2bea5f9
PE
13987 (yystpcpy): Use prototype if __STDC__ is defined, not just
13988 if __cplusplus is defined.
35687a9d 13989
2c8a9dfa
AD
139902001-11-30 Akim Demaille <akim@epita.fr>
13991
13992 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
13993 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
13994 Gettext doesn't compile cleanly, and dies with -Werror.
13995 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
13996 Include WARNING_CFLAGS here.
13997 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
13998 before being defined.
13999
f4e421e6
AD
140002001-11-27 Paul Eggert <eggert@twinsun.com>
14001
14002 * lib/quotearg.h (quotearg_n, quotearg_n_style):
14003 First arg is int, not unsigned.
14004 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
14005 (SIZE_MAX, UINT_MAX): New macros.
14006 (quotearg_n_options): Abort if N is negative.
14007 Avoid overflow check on hosts where size_t is 64 bits and int
14008 is 32 bits, as overflow is impossible there.
14009 Fix off-by-one typo that caused unnecessary reallocation.
14010
7093d0f5
AD
140112001-11-29 Paul Eggert <eggert@twinsun.com>
14012
14013 Name space cleanup in generated parser.
14014
14015 * doc/bison.texinfo (Bison Parser): Discuss system headers
14016 and their effect on the user name space.
14017
14018 * src/bison.simple:
14019 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
14020 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
14021 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
14022
14023 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
14024 on user names when possible.
14025
14026 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
14027 Simplify test for whather <alloca.h> exists.
14028
14029 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
14030
14031 (<stdio.h>): Include if YYDEBUG.
14032
14033 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
14034 ! defined (yyoverflow) && ! defined (yymemcpy).
14035
14036 (yymemcpy, yyparse): Rename local variables as needed so that
14037 they all begin with 'yy'.
14038
14039 (yystrlen, yystpcpy): New functions.
14040
14041 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
14042 All uses changed.
14043
14044 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
14045 instead of relying on string.h functions. Use YYSTACK_ALLOC
14046 and YYSTACK_FREE instead of malloc and free.
14047
fd51e5ff
AD
140482001-11-30 Akim Demaille <akim@epita.fr>
14049
14050 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
14051 before their first uses.
14052 (YYBISON, YYPURE): Move to the top of the output.
14053
7d13ff5f
AD
140542001-11-30 Akim Demaille <akim@epita.fr>
14055
14056 * tests/reduce.at (Useless Nonterminals): Fix.
14057
892a3995
AD
140582001-11-30 Akim Demaille <akim@epita.fr>
14059
14060 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
14061 if body instead of `;' to pacify GCC's warnings.
14062
68f1e3ed
AD
140632001-11-30 Akim Demaille <akim@epita.fr>
14064
14065 Instead of mapping the LHS of unused rules to -1, keep the LHS
14066 valid, but flag the rules as invalid.
14067
14068 * src/gram.h (rule_t): `useful' is a new member.
14069 * src/print.c (print_grammar): Adjust.
14070 * src/derives.c (set_derives): Likewise.
14071 * src/reader.c (packgram, reduce_output): Likewise.
14072 * src/reduce.c (reduce_grammar_tables): Likewise.
14073 * tests/reduce.at (Underivable Rules, Useless Rules): New.
14074
d2d1b42b
AD
140752001-11-30 Akim Demaille <akim@epita.fr>
14076
14077 * src/reduce.c (reduce_output): Formatting changes.
14078 * src/print.c (print_results, print_grammar): Likewise.
14079 * tests/regression.at (Rule Line Numbers)
14080 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
14081
760b53a8
AD
140822001-11-30 Akim Demaille <akim@epita.fr>
14083
14084 * src/reduce.c (nonterminals_reduce): Instead of throwing away
14085 useless nonterminals, move them at the end of the symbol arrays.
14086 (reduce_output): Adjust.
14087 * tests/reduce.at (Useless Nonterminals): Adjust.
14088
00238958
AD
140892001-11-30 Akim Demaille <akim@epita.fr>
14090
14091 * src/reduce.c: Various comment/formatting changes.
14092 (nonterminals_reduce): New, extracted from...
14093 (reduce_grammar_tables): here.
14094 (reduce_grammar): Call nonterminals_reduce.
14095
396452de
PE
140962001-11-29 Paul Eggert <eggert@twinsun.com>
14097
14098 * src/bison.simple (YYSTACK_REALLOC): Remove.
14099 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
14100 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
14101 New macros.
14102 (union yyalloc): New type.
14103 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
14104 an arbitrary restriction on hosts where size_t is wider than int.
14105
14106 (yyparse): Don't dump core if alloca or malloc fails; instead, report
14107 a parser stack overflow. Allocate just one block of memory for all
14108 three stacks, instead of allocating three blocks; this typically is
14109 faster and reduces fragmentation.
14110
14111 Do not limit the number of items in the stack to a value that fits
14112 in 'int', as this is an arbitrary limit on hosts with 64-bit
14113 size_t and 32-bit int.
14114
147e184c
MA
141152001-11-29 Marc Autret <autret_m@epita.fr>
14116
14117 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
14118 of defining YYERROR_VERBOSE.
14119 [AT_DATA]: $4 is now out of C declarations in the prologue.
14120
426cf563
MA
141212001-11-28 Marc Autret <autret_m@epita.fr>
14122
14123 * src/reader.c (parse_dquoted_param): New.
14124 (parse_skel_decl): Use it.
14125 * src/lex.h: Add its prototype.
14126 * src/lex.c (literalchar): Become not static.
14127
c7925b99
MA
141282001-11-28 Marc Autret <autret_m@epita.fr>
14129
14130 * src/output.h: And put its extern declaration here.
14131 * src/output.c (error_verbose): Define here.
14132 (prepare): Echo name modification.
14133 * src/getargs.h: Clean its extern declaration.
14134 * src/getargs.c (error_verbose_flag): Remove.
14135 (getargs): Remove case 'e'.
14136 * src/options.c (option_table): 'error-verbose' is now seen as simple
14137 percent option.
14138 Include output.h.
14139
14140 * src/reader.c (read_declarations): Remove case tok_include.
14141 (parse_include_decl): Remove.
14142 * src/lex.h (token_t): Remove tok_include.
14143 * src/options.c (option_table): 'include' is now a simple command line
14144 option.
14145
5b5d1929
MA
141462001-11-28 Marc Autret <autret_m@epita.fr>
14147
14148 * src/bison.simple: Adjust muscle names.
14149 * src/muscle_tab.c (muscle_init): Also rename the muscles.
14150 * src/output.c (prepare): s/_/-/ for the muscles names.
14151 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
14152
8850be4b
MA
141532001-11-28 Marc Autret <autret_m@epita.fr>
14154
14155 * src/bison.simple: Fix debug.
14156 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
14157
4a38e613
AD
141582001-11-28 Akim Demaille <akim@epita.fr>
14159
14160 * src/LR0.c (shifts_new): New.
14161 (save_shifts, insert_start_shift, augment_automaton): Use it.
14162
4b35e1c1
AD
141632001-11-28 Akim Demaille <akim@epita.fr>
14164
14165 * src/closure.c (closure): `b' and `ruleno' denote the same value:
14166 keep ruleno only.
14167
d2b04478
AD
141682001-11-28 Akim Demaille <akim@epita.fr>
14169
14170 * src/closure.c (closure): Instead of looping over word in array
14171 then bits in words, loop over bits in array.
14172
2c4c30aa
AD
141732001-11-28 Akim Demaille <akim@epita.fr>
14174
14175 * src/closure.c (closure): No longer optimize the special case
14176 where all the bits of `ruleset[r]' are set to 0, to make the code
14177 clearer.
14178
576890b7
AD
141792001-11-28 Akim Demaille <akim@epita.fr>
14180
14181 * src/closure.c (closure): `r' and `c' are new variables, used to
14182 de-obfuscate accesses to RULESET and CORE.
14183
cb487d7d
AD
141842001-11-28 Akim Demaille <akim@epita.fr>
14185
14186 * src/reduce.c (reduce_print): Use ngettext.
14187 (dump_grammar): Improve the trace accuracy.
14188
6013d43f
AD
141892001-11-28 Akim Demaille <akim@epita.fr>
14190
14191 * src/reduce.c (dump_grammar): Don't translate trace messages.
14192
cb4956ee
AD
141932001-11-28 Akim Demaille <akim@epita.fr>
14194
14195 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
14196 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
14197 as all tags are free'ed afterwards.
14198 From Enrico Scholz.
14199
648185ab
PE
142002001-11-27 Paul Eggert <eggert@twinsun.com>
14201
14202 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
14203 use alloca when we didn't want to, and vice versa.
14204
68254a03
MA
142052001-11-27 Marc Autret <autret_m@epita.fr>
14206
9113b58f
AD
14207 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
14208 initialization.
68254a03
MA
14209 * src/output.c (prepare): Remove its update.
14210
04d843a2
MA
142112001-11-27 Marc Autret <autret_m@epita.fr>
14212
14213 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
14214 Use %error-verbose.
14215
d2079671 142162001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
14217
14218 * src/bison.simple: Remove YYERROR_VERBOSE using.
14219 Use %%error_verbose.
14220 (yyparse): Likewise.
14221 * src/output.c (prepare): Give its final value.
14222 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
14223 * src/getargs.h: Add its extern declaration.
14224 * src/getargs.c (error_verbose_flag): New int.
14225 (getargs): Update to catch new case.
14226 * src/options.c (option_table): 'error-verbose' is a new option.
14227 (shortopts): Update.
14228
e0327bc8
AD
142292001-11-27 Akim Demaille <akim@epita.fr>
14230
14231 * src/system.h: Use intl/libgettext.h.
14232 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
14233
000f1a3c
AD
142342001-11-27 Akim Demaille <akim@epita.fr>
14235
14236 * tests/torture.at (Exploding the Stack Size with Malloc):
14237 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
14238
26cfe0be
AD
142392001-11-27 Akim Demaille <akim@epita.fr>
14240
14241 * src/files.c: Include error.h.
14242 Reported by Hans Aberg.
14243
f6bd5427
MA
142442001-11-26 Marc Autret <autret_m@epita.fr>
14245
d2079671 14246 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
14247 (read_declarations): Add case tok_include.
14248 * src/getargs.h (include): Add its extern definition.
14249 * src/getargs.c (include): New const char *.
14250 (getargs): Add case '-I'.
14251 * src/options.c (option_table): Add include as command line and
14252 percent option.
14253 * src/lex.h (token_t): Add tok_include.
14254
2ca209c1
AD
142552001-11-26 Akim Demaille <akim@epita.fr>
14256
14257 * src/reader.c (readgram): Make sure rules for mid-rule actions
14258 have a lineno equal to that of their host rule.
14259 Reported by Hans Aberg.
14260 * tests/regression.at (Rule Line Numbers): New.
14261
0e41b407
AD
142622001-11-26 Akim Demaille <akim@epita.fr>
14263
14264 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
14265 size_ts.
14266
142672001-11-26 Akim Demaille <akim@epita.fr>
14268
14269 * src/complain.c, src/complain.h (error): Remove, provided by
14270 lib/error.[ch].
14271
e0c40012
AD
142722001-11-26 Akim Demaille <akim@epita.fr>
14273
14274 * src/reader.c (read_declarations): Don't abort on tok_illegal,
14275 issue an error message.
14276 * tests/regression.at (Invalid %directive): New.
14277 Reported by Hans Aberg.
14278
5e147124
AD
142792001-11-26 Akim Demaille <akim@epita.fr>
14280
14281 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
14282 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
14283
a034c8b8
AD
142842001-11-26 Akim Demaille <akim@epita.fr>
14285
14286 * src/conflicts.c (conflicts_print): Don't complain at all when
14287 there are no reduce/reduce conflicts, and as many shift/reduce
14288 conflicts as expected.
14289 * tests/regression.at (%expect right): Adjust.
14290
c64a20f3
AD
142912001-11-23 Akim Demaille <akim@epita.fr>
14292
14293 * lib/alloca.c: Update, from fileutils.
14294
5b0d29bb
AD
142952001-11-23 Akim Demaille <akim@epita.fr>
14296
14297 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
14298
722c4bfe
AD
142992001-11-23 Akim Demaille <akim@epita.fr>
14300
14301 * src/system.h: Include alloca.h.
14302 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
14303
6255b435
AD
143042001-11-23 Akim Demaille <akim@epita.fr>
14305
14306 * src/print_graph.c (print_actions): Remove `rule', unused.
14307 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
14308 pacify GCC's signed < unsigned warnings.
14309 * src/closure.c (itemsetsize): Likewise.
14310 * src/reader.c (symbol_list_new): Static.
14311
b29b2ed5
AD
143122001-11-23 Akim Demaille <akim@epita.fr>
14313
14314 Attaching lineno to buckets is stupid, since only one copy of each
14315 symbol is kept, only the line of the first occurrence is kept too.
14316
14317 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
14318 * src/reader.c (rline_allocated): Remove, unused.
14319 (symbol_list): Have a `line' member.
14320 (symbol_list_new): New.
14321 (readgram): Use it.
14322 * src/print.c (print_grammar): Output the rule line numbers.
14323 * tests/regression.at (Solved SR Conflicts)
14324 (Unresolved SR Conflicts): Adjust.
14325 Reported by Hans Aberg.
14326
a81b1d4a
MA
143272001-11-22 Marc Autret <autret_m@epita.fr>
14328
14329 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
14330
c1ecb3c1
MA
143312001-11-22 Marc Autret <autret_m@epita.fr>
14332
14333 * src/muscle_tab.c (muscle_init): Remove initialization of
14334 skeleton muscle.
14335 * src/output.c (output_master_parser): Do it here.
14336
fbe01355
AD
143372001-11-20 Akim Demaille <akim@epita.fr>
14338
14339 * po/sv.po: New.
14340 * configure.in (ALL_LINGUAS): Adjust.
14341 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
14342 longer contains strings to translate.
14343
81e895c0
AD
143442001-11-19 Akim Demaille <akim@epita.fr>
14345
14346 * src/conflicts.c (conflicts_print): Add a missing \n.
14347
6bb1878b
AD
143482001-11-19 Akim Demaille <akim@epita.fr>
14349
14350 * src/nullable.c (nullable_print): New.
14351 (set_nullable): Call it when tracing.
14352 Better locality of variables.
14353
d9ec2d07
AD
143542001-11-19 Akim Demaille <akim@epita.fr>
14355
14356 * src/print.c (print_actions): Better locality of variables.
14357
720e5c1b
AD
143582001-11-19 Akim Demaille <akim@epita.fr>
14359
14360 * src/derives.c (print_derives): Fix and enrich.
14361 * src/closure.c (print_fderives): Likewise.
14362
fb908786
AD
143632001-11-19 Akim Demaille <akim@epita.fr>
14364
14365 * src/closure.c (itemsetend): Remove, replaced with...
14366 (itemsetsize): new.
14367
125ecb56
AD
143682001-11-19 Akim Demaille <akim@epita.fr>
14369
14370 * src/LR0.c (kernel_end): Remove, replaced with...
14371 (kernel_size): new.
14372
d8cf039f
AD
143732001-11-19 Akim Demaille <akim@epita.fr>
14374
14375 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
14376 to clarify.
14377
7bec0760
AD
143782001-11-19 Akim Demaille <akim@epita.fr>
14379
14380 * src/closure.c (closure): Use arrays instead of pointers to clarify.
14381
c87d4863
AD
143822001-11-19 Akim Demaille <akim@epita.fr>
14383
14384 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
14385 trace messages.
14386 * src/LR0.c: Likewise.
14387 (allocate_itemsets): Use arrays instead of pointers to clarify.
14388
9bfe901c
AD
143892001-11-19 Akim Demaille <akim@epita.fr>
14390
14391 * src/getargs.c (statistics_flag): Replace with...
14392 (trace_flag): New.
14393 (longopts): Accept --trace instead of --statistics.
14394 * src/getargs.h, src/options.c: Adjust.
14395 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
14396 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
14397
97db7bd4
AD
143982001-11-19 Akim Demaille <akim@epita.fr>
14399
cc72668c 14400 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
14401 pointers to clarify the code.
14402 (save_reductions, save_shifts): Factor common parts of alternatives.
14403
2c5f66ed
AD
144042001-11-19 Akim Demaille <akim@epita.fr>
14405
14406 * src/LR0.c (new_state, get_state): Complete TRACE code.
14407 * src/closure.c: Include `reader.h' to get `tags', needed by the
14408 trace code.
14409 Rename the conditional DEBUG as TRACE.
14410 Output consistently TRACEs to stderr, not stdout.
14411 * src/derives.c: Likewise.
14412 * src/reduce.c: (inaccessable_symbols): Using if is better style
14413 than goto.
14414 Use `#if TRACE' instead of `#if 0' for tracing code.
14415
300f275f
AD
144162001-11-19 Akim Demaille <akim@epita.fr>
14417
14418 * src/system.h (LIST_FREE, shortcpy): New.
14419 * src/LR0.c: Use them.
14420 * src/output.c (free_itemsets, free_reductions, free_shifts):
14421 Remove, replaced by LIST_FREE.
14422
f59c437a
AD
144232001-11-19 Akim Demaille <akim@epita.fr>
14424
14425 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
14426 (REDUCTIONS_ALLOC): New.
14427 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
14428 allocation.
14429
6986fd9e
AD
144302001-11-19 Akim Demaille <akim@epita.fr>
14431
14432 * src/LR0.c (new_state): Complete trace code.
14433 * src/nullable.c (set_nullable): Don't translate traces.
14434
4bc30f78
AD
144352001-11-19 Akim Demaille <akim@epita.fr>
14436
14437 * src/print_graph.c (print_core): Better locality of variables.
14438 * src/print.c (print_core): Likewise.
14439
08a946e0
AD
144402001-11-19 Akim Demaille <akim@epita.fr>
14441
14442 * src/vcg.c: You do the output, so you are responsible of the
14443 handling of VCG syntax, in particular: use quotearg.
14444 * src/print_graph.c: Don't.
14445 (print_actions): Don't output the actions as part of the nodes,
14446 since that's the job of the edges.
14447 (print_state): Don't output by hand: fill the node description,
9bfe901c 14448 and ask for its output.
08a946e0 14449
f0473484
AD
144502001-11-19 Akim Demaille <akim@epita.fr>
14451
cc72668c
AD
14452 * src/bison.simple (yyparse): When verbosely reporting an error,
14453 no longer put additional quotes around token names.
f0473484
AD
14454 * tests/calc.at: Adjust.
14455
e41dc700
AD
144562001-11-19 Akim Demaille <akim@epita.fr>
14457
14458 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
14459 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
14460 * src/output.c: Adjust.
14461
652a871c
AD
144622001-11-19 Akim Demaille <akim@epita.fr>
14463
14464 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
14465 (rule_t): this.
14466 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
14467
b2ed6e58
AD
144682001-11-19 Akim Demaille <akim@epita.fr>
14469
14470 * src/gram.h (rule_t): New.
14471 (rule_table): New.
14472 (rrhs, rlhs): Remove, part of state_t.
14473 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
14474 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14475 * src/reader.c, src/reduce.c: Adjust.
14476
edad7067
AD
144772001-11-19 Akim Demaille <akim@epita.fr>
14478
14479 * src/reader.c (symbols_output): New, extracted from...
14480 (packsymbols): Here.
14481 (reader): Call it.
14482
3feec034
AD
144832001-11-19 Akim Demaille <akim@epita.fr>
14484
14485 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
14486 (maxrhs): this new function.
14487
ddcd5fdf
AD
144882001-11-19 Akim Demaille <akim@epita.fr>
14489
cc72668c 14490 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
14491 Adjust.
14492
bb527fc2
AD
144932001-11-19 Akim Demaille <akim@epita.fr>
14494
cc72668c 14495 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
14496 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14497 * src/lalr.c: Adjust.
14498
a845a697
AD
144992001-11-19 Akim Demaille <akim@epita.fr>
14500
14501 * src/lalr.c (initialize_LA): Only initialize LA. Let...
14502 (set_state_table): handle the `lookaheads' members.
14503
f004bf6a
AD
145042001-11-19 Akim Demaille <akim@epita.fr>
14505
cc72668c
AD
14506 * src/lalr.h (lookaheads): Removed array, whose contents is now
14507 a member of...
f004bf6a
AD
14508 (state_t): this structure.
14509 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14510 Adjust.
14511
de326cc0
AD
145122001-11-19 Akim Demaille <akim@epita.fr>
14513
cc72668c
AD
14514 * src/lalr.h (consistent): Removed array, whose contents is now
14515 a member of...
de326cc0
AD
14516 (state_t): this structure.
14517 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14518 Adjust.
14519
90b4416b
AD
145202001-11-19 Akim Demaille <akim@epita.fr>
14521
cc72668c
AD
14522 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
14523 contents are now members of...
90b4416b
AD
14524 (state_t): this structure.
14525 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14526 Adjust.
14527
9703cc49
AD
145282001-11-19 Akim Demaille <akim@epita.fr>
14529
14530 * src/lalr.h (state_t): New.
14531 (state_table): Be a state_t * instead of a core **.
14532 (accessing_symbol): Remove, part of state_t.
14533 * src/lalr.c: Adjust.
14534 (set_accessing_symbol): Merge into...
14535 (set_state_table): this.
14536 * src/print_graph.c, src/conflicts.c: Adjust.
14537
d803322e
AD
145382001-11-14 Akim Demaille <akim@epita.fr>
14539
14540 * tests/calc.at, tests/output.at, tests/regression.at,
14541 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
14542 now the tests are run in private dirs, therefore AC_CLEANUP and
14543 family can be simplified to 0-ary.
14544 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
14545 use abs. path to find config.h.
14546 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
14547 stderr, there can be way too much random noise.
14548 Instead pass -Werror to GCC and rely on the exit status.
14549 Reported by Wolfram Wagner.
14550
3d76b07d
AD
145512001-11-14 Akim Demaille <akim@epita.fr>
14552
14553 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
14554 defined only if yyoverflow is defined, to avoid `warning: unused
14555 variable `yyvs1''.
14556 Reported by The Test Suite.
14557
09b503c8
AD
145582001-11-14 Akim Demaille <akim@epita.fr>
14559
14560 * src/print.c: Include reduce.h.
14561 Reported by Hans Aberg.
14562
145632001-11-14 Akim Demaille <akim@epita.fr>
14564
14565 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
14566 Revert a previous patch: these are really const.
14567 * src/conflicts.c (conflict_report): Additional useless pair of
14568 braces to pacify GCC's warnings for `if () if () {} else {}'.
14569 * src/lex.c (parse_percent_token): Replace equal_offset with
14570 arg_offset.
14571 arg is const.
14572 Be sure to strdup `arg' when used, since there is no reason for
14573 token_buffer not to change.
14574
0f37a994
AD
145752001-11-14 Akim Demaille <akim@epita.fr>
14576
14577 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
14578 definition.
14579 * src/main.c (main): Use them.
14580 Suggested by Hans Aberg.
14581
d39d93b8
AD
145822001-11-12 Akim Demaille <akim@epita.fr>
14583
14584 * src/system.h (ngettext): Now that we use ngettext, be sure to
14585 provide a default definition when NLS are not used.
14586
9edcd895
AD
145872001-11-12 Akim Demaille <akim@epita.fr>
14588
14589 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
14590 Use @kbd to denote user input.
14591 (Language and Grammar): ANSIfy the example.
14592 Adjust its layout for info/notinfo.
14593 (Location Tracking Calc): Output error messages to stderr.
14594 Output locations in a more GNUtically correct way.
14595 Fix a couple of Englishos.
14596 Adjust @group/@end group pairs.
14597
7da99ede
AD
145982001-11-12 Akim Demaille <akim@epita.fr>
14599
e3aa65c5 14600 %expect was not functioning at all.
7da99ede
AD
14601
14602 * src/conflicts.c (expected_conflicts): Set to -1.
14603 (conflict_report): Use ngettext.
14604 (conflicts_print): Check %expect and make its violation an error.
14605 * doc/bison.texinfo (Expect Decl): Adjust.
14606 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
14607 * tests/regression.at (%expect not enough, %expect right)
14608 (%expect too much): New.
14609
ba9dda1a
AD
146102001-11-12 Akim Demaille <akim@epita.fr>
14611
14612 * tests/regression.at (Conflicts): Rename as...
14613 (Unresolved SR Conflicts): this.
14614 (Solved SR Conflicts): New.
14615
337c5bd1
AD
146162001-11-12 Akim Demaille <akim@epita.fr>
14617
14618 * src/reduce.c (print_results): Rename as...
14619 (reduce_output): This.
14620 Output to OUT, passed as argument, instead of output_obstack.
14621 (dump_grammar): Likewise.
14622 (reduce_free): New.
14623 Also free V1.
14624 (reduce_grammar): No longer call reduce_output, since...
14625 * src/print.c (print_results): do it.
14626 * src/main.c (main): Call reduce_free;
14627
c73a41af
AD
146282001-11-12 Akim Demaille <akim@epita.fr>
14629
14630 * src/conflicts.c (print_reductions): Accept OUT as argument.
14631 Output to it, not to output_obstack.
14632 * src/print.c (print_actions): Adjust.
14633
0df87bb6
AD
146342001-11-12 Akim Demaille <akim@epita.fr>
14635
14636 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
14637 the result instead of using...
14638 (src_total, rrc_total, src_count, rrc_count): Remove.
14639 (any_conflicts): Remove.
14640 (print_conflicts): Split into...
14641 (conflicts_print, conflicts_output): New.
14642 * src/conflicts.h: Adjust.
14643 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 14644 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
14645 * tests/regression.at (Conflicts): New.
14646 Reported by Tom Lane.
14647
e4d3d4de
AD
146482001-11-12 Akim Demaille <akim@epita.fr>
14649
14650 * tests/regression.at (Invalid input): Remove, duplicate with
14651 ``Invalid input: 1''.
14652
6d7d248e
AD
146532001-11-12 Akim Demaille <akim@epita.fr>
14654
14655 * tests/torture.at (AT_DATA_STACK_TORTURE)
14656 (Exploding the Stack Size with Alloca)
14657 (Exploding the Stack Size with Malloc): New.
14658
e9e4c321
AD
146592001-11-12 Akim Demaille <akim@epita.fr>
14660
14661 * src/bison.simple (YYSTACK_REALLOC): New.
14662 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 14663 Reported by Per Allansson.
e9e4c321 14664
5f7e0832
AD
146652001-11-12 Pascal Bart <pascal.bart@epita.fr>
14666
14667 * src/bison.simple: Define type yystype instead of YYSTYPE, and
14668 define CPP macro, which substitute YYSTYPE by yystype.
14669 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
14670 with yyltype/YYLTYPE. This allows inclusion of the generated
14671 header within the parser if the compiler, such as GGC, accepts
14672 multiple equivalent #defines.
14673 From Akim.
14674
e3f1699f
AD
146752001-11-05 Akim Demaille <akim@epita.fr>
14676
14677 * src/reader.c (symbols_output): New, extracted from...
14678 (packsymbols): here.
14679 (reader): Adjust.
14680
65be0866
AD
146812001-11-05 Akim Demaille <akim@epita.fr>
14682
14683 * src/lex.c (parse_percent_token): s/quotearg/quote/.
14684
e4d910bf
AD
146852001-11-05 Akim Demaille <akim@epita.fr>
14686
14687 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
14688 pattern.
14689
951366c1
AD
146902001-11-05 Akim Demaille <akim@epita.fr>
14691
14692 * src/options.h (struct option_table_struct): set_flags is void*.
14693 * src/options.c (longopts): Support `--output' and `%output'.
14694 (usage): Adjust.
14695 * src/lex.h (tok_setopt): Remove, replaced with...
14696 (tok_intopt, tok_stropt): these new guys.
14697 * src/lex.c (getopt.h): Not needed.
14698 (token_buffer, unlexed_token_buffer): Not const.
14699 (percent_table): Promote `-' over `_' in directive names.
14700 Active `%name-prefix', `file-prefix', and `output'.
14701 (parse_percent_token): Accept possible arguments to directives.
14702 Promote `-' over `_' in directive names.
14703
d8988b2f
AD
147042001-11-04 Akim Demaille <akim@epita.fr>
14705
14706 * doc/bison.texinfo (Decl Summary): Split the list into
14707 `directives for grammars' and `directives for bison'.
14708 Sort'em.
14709 Add description of `%name-prefix', `file-prefix', and `output'.
14710 Promote `-' over `_' in directive names.
14711 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
14712 Simplify the description of `--name-prefix'.
14713 Promote `-' over `_' in directive names.
14714 Promote `--output' over `--output-file'.
14715 Fix the description of `--defines'.
14716 * tests/output.at: Exercise %file-prefix and %output.
14717
6468d18e
AD
147182001-11-02 Akim Demaille <akim@epita.fr>
14719
14720 * doc/refcard.tex: Update.
14721
6b7e85b9
AD
147222001-11-02 Akim Demaille <akim@epita.fr>
14723
14724 * src/symtab.h (SUNDEF): New.
14725 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
14726 stand for `uninitialized', instead of 0.
14727 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
14728 * src/lex.c (lex): Adjust.
14729
14730 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
14731 Number it 0.
14732 Let yylex return it instead of a plain 0.
14733 Reported by Dick Streefland.
14734
cd5aafcf
AD
147352001-11-02 Akim Demaille <akim@epita.fr>
14736
14737 * tests/regression.at (Mixing %token styles): New test.
14738
037ca2f1
AD
147392001-11-02 Akim Demaille <akim@epita.fr>
14740
14741 * src/reader.c (parse_thong_decl): Formatting changes.
14742 (token_translations_init): New, extracted from...
14743 (packsymbols): Here.
14744 Adjust.
14745
270a173c
AD
147462001-11-01 Akim Demaille <akim@epita.fr>
14747
14748 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
14749 Check that `9foo.y' produces correct cpp guards.
14750 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
14751 guards.
14752 Reported by Wwp.
14753
561f9a30
AD
147542001-11-01 Akim Demaille <akim@epita.fr>
14755
14756 * tests/regression.at (Invalid input: 2): New.
14757 * src/lex.c (unlexed_token_buffer): New.
14758 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
14759 too.
14760 Reported by Wwp.
14761
f987e9d2
AD
147622001-11-01 Akim Demaille <akim@epita.fr>
14763
14764 * tests/calc.at: Catch up with 1.30.
14765 * configure.in: Bump to 1.49a.
14766 Adjust to newer Autotest.
14767
0846f581
PB
147682001-10-19 Pascal Bart <pascal.bart@epita.fr>
14769
14770 * src/conflicts.c: Move global variables rrc_total and src_total ...
14771 (print_conflicts): here.
14772 * src/output.c (output): Free global variable user_toknums.
14773 * src/lex.c (token_obstack): Become static.
14774
3c1a79b3
AD
147752001-10-18 Akim Demaille <akim@epita.fr>
14776
14777 * tests/atlocal.in (GCC): Add.
14778 * tests/calc.at: s/m4_match/m4_bmatch/.
14779 s/m4_patsubst/m4_bpatsubst/.
14780 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
14781 * configure.in: AC_SUBST(GCC).
14782
5d52e7d0
MA
147832001-10-14 Marc Autret <autret_m@epita.fr>
14784
14785 * src/options.c (create_long_option_table): Fix.
14786
631aa1d3
AD
147872001-10-10 Akim Demaille <akim@epita.fr>
14788
14789 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
14790
f6ec6d13
AD
147912001-10-04 Akim Demaille <akim@epita.fr>
14792
14793 * src/reader.c (parse_union_decl): Push the caracters in
14794 union_obstack, not attrs_obstack.
14795
342b8b6e
AD
147962001-10-04 Akim Demaille <akim@epita.fr>
14797
14798 Merge in the branch 1.29.
14799
14800 * src/reader.c (packsymbols): Use a temporary obstack for
14801 `%%tokendef', since output_stack is already used elsewhere.
14802
14803 2001-10-02 Akim Demaille <akim@epita.fr>
14804
14805 Bump 1.29d.
14806
14807 2001-10-02 Akim Demaille <akim@epita.fr>
14808
14809 Version 1.29c.
14810
14811 2001-10-02 Akim Demaille <akim@epita.fr>
14812
14813 * tests/regression.at (Invalid CPP headers): New.
14814 From Alexander Belopolsky.
14815 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
14816
14817 2001-10-02 Akim Demaille <akim@epita.fr>
14818
14819 * tests/regression.at (Invalid input): New.
14820 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
14821 Reported by Shura.
14822
14823 2001-10-02 Akim Demaille <akim@epita.fr>
14824
14825 * tests/calc.at: Now that --debug works, the tests must be adjusted.
14826
14827 2001-10-02 Akim Demaille <akim@epita.fr>
14828
14829 * src/output.c (output_parser): Assert `skeleton'.
14830 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
14831 systems.
14832 From Shura.
14833
14834 2001-10-01 Marc Autret <autret_m@epita.fr>
14835
14836 * src/lex.h: Echo modifications.
14837 * src/lex.c (unlex): Parameter is now token_t.
14838 From Hans Aberg.
14839
14840 2001-10-01 Marc Autret <autret_m@epita.fr>
14841
14842 * src/main.c: Include lex.h.
14843 From Hans Aberg.
14844
14845 2001-09-29 Akim Demaille <akim@epita.fr>
14846
14847 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
14848
14849 2001-09-28 Akim Demaille <akim@epita.fr>
14850
14851 * tests/testsuite.at: Update to newer Autotest.
14852 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
14853
14854 2001-09-27 Akim Demaille <akim@epita.fr>
14855
14856 Position independent wrapper.
14857
14858 * tests/bison: Remove.
14859 * tests/bison.in: New.
14860 * configure.in: Adjust.
14861
14862 2001-09-27 Paul Eggert <eggert@twinsun.com>
14863
14864 Port quotearg fixes from tar 1.13.24.
14865
14866 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
14867 tm to be declared.
14868 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
14869 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
14870
14871 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
14872 * m4/mbrtowc.m4: New file.
14873 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
14874 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
14875
14876 2001-09-27 Akim Demaille <akim@epita.fr>
14877
14878 Bump to 1.29c.
14879
14880 2001-09-27 Akim Demaille <akim@epita.fr>
14881
14882 Version 1.29b.
14883
14884 2001-09-25 Akim Demaille <akim@epita.fr>
14885
14886 * src/system.h: Include `xalloc.h'.
14887 Remove it from the C files.
14888 * src/files.c (output_files): Free the obstacks.
14889 * src/lex.c (init_lex): Rename as...
14890 (lex_init): this.
14891 (lex_free): New.
14892 * src/main.c (main): Use it.
14893
14894 2001-09-24 Marc Autret <autret_m@epita.fr>
14895
14896 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
14897 to output informations in fout (FILE*).
14898 (open_graph, close_graph): Likewise.
14899 (output_graph, output_edge, output_node): Likewise.
14900 * src/vcg.h: Update function prototypes.
14901 * src/print_graph.c (print_graph): Open output graph file.
14902 (print_actions): Adjust.
14903 * src/files.h: Remove extern declaration.
14904 * src/files.c: Remove graph_obstack declaration.
14905 (open_files): Remove graph_obstack initialization.
14906 (output_files): Remove graph_obstack saving.
14907
14908 2001-09-24 Marc Autret <autret_m@epita.fr>
14909
14910 * src/files.c (compute_output_file_names): Fix.
14911
14912 2001-09-24 Marc Autret <autret_m@epita.fr>,
14913 Akim Demaille <akim@epita.fr>
14914
14915 * src/reader.c (reader): Remove call to free_symtab ().
14916 * src/main.c (main): Call it here.
14917 Include symtab.h.
14918 * src/conflicts.c (initialize_conflicts): Rename as...
14919 (solve_conflicts): this.
14920 * src/print.c (print_core, print_actions, print_state)
14921 (print_grammar): Dump to a file instead a `output_obstack'.
14922 (print_results): Dump `output_obstack', and then proceed with the
14923 FILE *.
14924 * src/files.c (compute_output_file_names, close_files): New.
14925 (output_files): Adjust.
14926 * src/main.c (main): Adjust.
14927
14928 2001-09-23 Marc Autret <autret_m@epita.fr>
14929
14930 * src/files.c (compute_header_macro): Computes header macro name
14931 from spec_defines_file when given.
14932
14933 2001-09-23 Marc Autret <autret_m@epita.fr>
14934
14935 * src/files.c (output_files): Add default extensions.
14936
14937 2001-09-22 Akim Demaille <akim@epita.fr>
14938
14939 * src/conflicts.c (finalize_conflicts): Rename as...
14940 (free_conflicts): this.
14941
14942 2001-09-22 Akim Demaille <akim@epita.fr>
14943
14944 * src/gram.c (gram_free): Rename back as...
14945 (dummy): this.
14946 (output_token_translations): Free `token_translations'.
14947 * src/symtab.c (free_symtab): Free the tag field.
14948
14949 2001-09-22 Akim Demaille <akim@epita.fr>
14950
14951 Remove `translations' as it is always set to true.
14952
14953 * src/gram.h: Adjust.
14954 * src/reader.c (packsymbols, parse_token_decl): Adjust
14955 * src/print.c (print_grammar): Adjust.
14956 * src/output.c (output_token_translations): Adjust.
14957 * src/lex.c (lex): Adjust.
14958 * src/gram.c: Be sure the set pointers to NULL.
14959 (dummy): Rename as...
14960 (gram_free): this.
14961
14962 2001-09-22 Akim Demaille <akim@epita.fr>
14963
14964 * configure.in: Invoke AM_LIB_DMALLOC.
14965 * src/system.h: Use dmalloc.
14966 * src/LR0.c: Be sure to have pointers initialized to NULL.
14967 (allocate_itemsets): Allocate kernel_items only if needed.
14968
14969 2001-09-22 Akim Demaille <akim@epita.fr>
14970
14971 * configure.in: Bump to 1.29b.
14972 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
14973 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
14974 need xmalloc.c in calc.y.
14975 From Pascal Bart.
14976
14977 2001-09-21 Akim Demaille <akim@epita.fr>
14978
14979 Version 1.29a.
14980 * Makefile.maint, config/config.guess, config/config.sub,
14981 * config/missing: Update from masters.
14982 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
14983 upon package.m4.
14984 * configure.in (ALL_LINGUAS): Add `tr'.
14985
14986 2001-09-21 Akim Demaille <akim@epita.fr>
14987
14988 * tests/Makefile.am (package.m4): Move to...
14989 ($(srcdir)/$(TESTSUITE)): here.
14990
14991 2001-09-20 Akim Demaille <akim@epita.fr>
14992
14993 * src/complain.c: No longer try to be standalone: use system.h.
14994 Don't assume __STDC__ is defined to 1. Just test if it is defined.
14995 * src/complain.h: Likewise.
14996 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
14997 Remove the unused variable `n'.
14998 From Albert Chin-A-Young.
14999
15000 2001-09-18 Marc Autret <autret_m@epita.fr>
15001
15002 * doc/bison.1: Update.
15003 * doc/bison.texinfo (Bison Options): Update --defines and --graph
15004 descriptions.
15005 (Option Cross Key): Update.
15006 Add --graph.
15007
15008 2001-09-18 Marc Autret <autret_m@epita.fr>
15009
15010 * tests/regression.at: New test (comment in %union).
15011
15012 2001-09-18 Marc Autret <autret_m@epita.fr>
15013
15014 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
15015 do that.
15016 Reported by Keith Browne.
15017
15018 2001-09-18 Marc Autret <autret_m@epita.fr>
15019
15020 * tests/output.at: Add tests for --defines and --graph.
15021
15022 2001-09-18 Marc Autret <autret_m@epita.fr>
15023
15024 * tests/output.at: Removes tests of %{header,src}_extension features.
15025
15026 2001-09-18 Akim Demaille <akim@epita.fr>
15027
15028 * tests/Makefile.am (package.m4): New.
15029 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
15030 (_AT_CHECK_CALC_ERROR): Likewise.
15031 Factor the `, ' part of verbose error messages.
15032
15033 2001-09-18 Marc Autret <autret_m@epita.fr>
15034
15035 * src/getargs.c (longopts): Declare --defines and --graph as options
15036 with optional arguments.
15037 * src/files.h: Add extern declarations.
15038 * src/files.c (spec_graph_file, spec_defines_file): New.
15039 (output_files): Update.
15040 Remove CPP-outed code.
15041
15042 2001-09-18 Marc Autret <autret_m@epita.fr>
15043
15044 Turn off %{source,header}_extension feature.
15045
15046 * src/files.c (compute_exts_from_gf): Update.
15047 (compute_exts_from_src): Update.
15048 (output_files): CPP-out useless code.
15049 * src/files.h: Remove {header,source}_extension extern declarations.
15050 * src/reader.c (parse_dquoted_param): CPP-out.
15051 (parse_header_extension_decl): Remove.
15052 (parse_source_extension_decl): Remove.
15053 (read_declarations): Remove cases tok_{hdrext,srcext}.
15054 * src/lex.c (percent_table): Remove {header,source}_extension entries.
15055 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
15056
15057 2001-09-10 Akim Demaille <akim@epita.fr>
15058
15059 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
15060 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
15061 (AT_CHECK_OUTPUT): this.
15062 Merely check ls' exit status, its output is useless.
15063
15064 2001-09-10 Akim Demaille <akim@epita.fr>
15065
15066 * tests/calc.at: Use m4_match.
15067 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
15068
15069 2001-09-10 Marc Autret <autret_m@epita.fr>,
15070 Akim Demaille <akim@epita.fr>
15071
15072 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
15073 enum color_e.
15074 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
15075 to `normal'.
15076 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
15077 * src/lex.h: Adjust prototype.
15078 (token_t): Add `tok_undef'.
15079 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
15080 (parse_percent_token): Now returns token_t.
15081 Add default statement in switch.
15082 (lex): Separate `c' as an input variable, from the token_t result
15083 part.
15084 (unlexed): Is a token_t.
15085
15086 2001-09-10 Akim Demaille <akim@epita.fr>
15087
15088 * configure.in: Bump to 1.29a.
15089
15090 2001-09-07 Akim Demaille <akim@epita.fr>
15091
15092 Version 1.29.
15093
15094 2001-08-30 Akim Demaille <akim@epita.fr>
15095
15096 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
15097 * m4/atconfig.m4: Remove.
15098 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
15099 * tests/bison: New.
15100 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
15101 m4_if, m4_patsubst, and m4_regexp.
15102 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
15103 `input' file instead of echo.
15104
15105 2001-08-29 Akim Demaille <akim@epita.fr>
15106
15107 Bump to 1.28e.
15108
15109 2001-08-29 Akim Demaille <akim@epita.fr>
15110
15111 Version 1.28d.
15112
15113 2001-08-29 Paul Eggert <eggert@twinsun.com>
15114
15115 * src/bison.simple (yyparse): Don't take the address of an
15116 item before the start of an array, as that doesn't conform to
15117 the C Standard.
15118
15119 2001-08-29 Robert Anisko <anisko_r@epita.fr>
15120
15121 * doc/bison.texinfo (Location Tracking Calc): New node.
15122
15123 2001-08-29 Paul Eggert <eggert@twinsun.com>
15124
15125 * src/output.c (output): Do not define const, as this now
15126 causes more problems than it cures.
15127
15128 2001-08-29 Akim Demaille <akim@epita.fr>
15129
15130 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
15131 the nodes.
15132 Be sure to tag the `detailmenu'.
15133
15134 2001-08-29 Akim Demaille <akim@epita.fr>
15135
15136 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
15137 download in a tmp dir.
15138
15139 2001-08-28 Marc Autret <autret_m@epita.fr>
15140
15141 * config/depcomp: New file.
15142
15143 2001-08-28 Marc Autret <autret_m@epita.fr>
15144
15145 * doc/bison.1 (mandoc): Adjust.
15146 From Juan Manuel Guerrero.
15147
15148 2001-08-28 Marc Autret <autret_m@epita.fr>
15149
15150 * src/print_graph.c (print_state): Fix.
15151
15152 2001-08-27 Marc Autret <autret_m@epita.fr>
15153
15154 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
15155 char * members.
15156 Echo modifications to the functions prototypes.
15157 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
15158
15159 2001-08-27 Marc Autret <autret_m@epita.fr>
15160
15161 * src/vcg.c: Include `xalloc.h'.
15162 (add_colorentry): New.
15163 (add_classname): New.
15164 (add_infoname): New.
15165 * src/vcg.h: Add new prototypes.
15166
15167 2001-08-27 Akim Demaille <akim@epita.fr>
15168
15169 * Makefile.maint: Sync. again with CVS Autoconf.
15170
15171 2001-08-27 Akim Demaille <akim@epita.fr>
15172
15173 * Makefile.maint: Formatting changes.
15174 (po-update, cvs-update, update): New targets.
15175 (AMTAR): Remove.
15176
15177 2001-08-27 Akim Demaille <akim@epita.fr>
15178
15179 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15180 * Makefile.maint: Sync. with CVS Autoconf.
15181
15182 2001-08-27 Marc Autret <autret_m@epita.fr>
15183
15184 * src/vcg.h (struct infoname_s): New.
15185 (struct colorentry_s): New.
15186 (graph_s): New fields {vertical,horizontal}_order in structure.
15187 Add `infoname' field.
15188 Add `colorentry' field;
15189 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
15190 (G_HORIZONTAL_ORDER): New.
15191 (G_INFONAME): New.
15192 (G_COLORENTRY): New.
15193 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
15194 Add output of `infoname'.
15195 Add output of `colorentry'.
15196
15197 2001-08-27 Marc Autret <autret_m@epita.fr>
15198
15199 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
15200 This one shadowed a global parameter.
15201
15202 2001-08-24 Marc Autret <autret_m@epita.fr>
15203
15204 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
15205 instead of `unsigned'.
15206 (print_state): Do not call obstack_object_size () in obstack_grow ()
15207 to avoid macro variables shadowing.
15208
15209 2001-08-23 Marc Autret <autret_m@epita.fr>
15210
15211 * src/lex.c (percent_table): Typo: s/naem/name/.
15212 Add graph option.
15213 Normalize new options declarations.
15214
15215 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
15216
15217 * tests/suite.at: Exercise %header_extension and %source_extension.
15218
15219 2001-08-16 Marc Autret <autret_m@epita.fr>
15220
15221 * src/reader.c (parse_dquoted_param): New.
15222 (parse_header_extension_decl): Use it.
15223 (parse_source_extension_decl): Likewise.
15224
15225 2001-08-16 Marc Autret <autret_m@epita.fr>
15226
15227 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
15228 (get_xxxx_str): Use assert () instead of complain ().
15229 Remove return invokations in default cases.
15230 (get_decision_str): Modify default behaviour. Remove second argument.
15231 Echo modifications on calls.
15232 (output_graph): Fix.
15233
15234 2001-08-16 Marc Autret <autret_m@epita.fr>
15235
15236 * src/getargs.c (usage): Update with ``-g, --graph''.
15237
15238 2001-08-16 Marc Autret <autret_m@epita.fr>
15239
15240 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
15241 (Option Cross Key): Likewise.
15242 * doc/bison.1: Update.
15243
1c8c2190
PB
152442001-09-25 Pascal Bart <pascal.bart@epita.fr>
15245
15246 * src/output.c (output_master_parser): Don't finish action_obstack.
15247 (output_parser): Don't care about the muscle action, here.
15248 (prepare): Copy the action_obstack in the action muscle.
15249 (output): Free action_obstack.
15250
180d45ba
PB
152512001-09-23 Pascal Bart <pascal.bart@epita.fr>
15252
15253 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
15254 will contain `%union' declaration.
15255 (parse_union_decl): Delete #line directive output.
15256 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
15257 informations about %union.
15258 (parse_union_decl): Copy the union_obstack in the muscle stype.
15259 * src/bison.simple: Add new #line directive.
15260 Add typdef %%stype YYSTYPE.
15261
c51d1a19
PB
152622001-09-23 Pascal Bart <pascal.bart@epita.fr>
15263
15264 * src/bison.simple: Add new `#line' directive.
15265
6f9344da
PB
152662001-09-22 Pascal Bart <pascal.bart@epita.fr>
15267
15268 * src/bison.simple: New `#line' directive.
15269 * src/output.c (output_parser): Support new dynamic muscle input_line.
15270
652def80
MA
152712001-09-22 Marc Autret <autret_m@epita.fr>
15272
15273 * src/output.c (output_master_parser): New.
15274 (output_parser): Be more re-entrant.
15275
25b222fa
MA
152762001-09-21 Marc Autret <autret_m@epita.fr>
15277
15278 * src/reader.c (copy_definition, parse_union_decl): Update and use
15279 `linef' muscle.
15280 (copy_action): Likewise.
15281 Use obstack_1grow ().
15282 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
15283
6bc35ae5
MA
152842001-09-21 Marc Autret <autret_m@epita.fr>
15285
15286 * src/options.c (option_table): Adjust.
15287 * src/lex.c (parse_percent_token): Fix.
15288
c0629aa1
PB
152892001-09-20 Pascal Bart <pascal.bart@epita.fr>
15290
15291 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 15292
82b6d266
PB
152932001-09-20 Pascal Bart <pascal.bart@epita.fr>
15294
15295 * src/lex.c (parse_percent_token): Change type of variable `tx', which
15296 is now an option_table_struct*.
15297 (option_strcmp): New function option_strcmp.
15298 (parse_percent_token): Call option_strcmp.
15299 * src/getargs.c (xalloc.h, options.h): Include it.
15300 (getargs): Call create_long_option_table.
15301 (getargs): Free longopts at the end of the function.
15302 (shortopts): Move in options.c.
15303 * src/options.c (create_long_option_table): New function. Convert
15304 information from option_table to option structure.
15305 * src/reader.c (options.h): Include it.
15306
15307 * src/Makefile.am: Adjust.
15308 * src/options.c (option_table): Create from longopts and percent_table.
15309 * src/getargs.c (longopts): Delete.
15310 * src/lex.c (struct percent_table_struct): Delete.
15311 (percent_table): Delete.
15312 (options.h): Include it.
15313 * src/options.c: Create.
15314 * src/options.h: Create.
15315 Declare enum opt_access_e.
15316 Define struct option_table_struct.
15317
75f5aaea
MA
153182001-09-20 Marc Autret <autret_m@epita.fr>
15319
15320 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
15321 sections of Bison.
15322
f508cb0a
PB
153232001-09-19 Pascal Bart <pascal.bart@epita.fr>
15324
15325 * src/bison.simple: s/%%filename/%%skeleton.
15326 * src/muscle_tab.c (getargs.h): Include it.
15327 (muscle_init): Insert new muscle skeleton.
15328
13105fc1
PB
153292001-09-18 Pascal Bart <pascal.bart@epita.fr>
15330
15331 * src/output.c (output_parser): Delete unused variable actions_dumped.
15332
b0c4483e
PB
153332001-09-07 Pascal Bart <pascal.bart@epita.fr>
15334
15335 * src/output.c (output): Delete call to reader_output_yylsp.
15336 * src/reader.c (reader): Likewise.
ba0fe3c7 15337 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 15338
11d82f03
MA
153392001-09-02 Marc Autret <autret_m@epita.fr>
15340
15341 * src/reader.c: Include muscle_tab.h.
15342 (parse_union_decl): Update.
15343 (parse_macro_decl): Rename parse_muscle_decl.
15344 Update to use renamed functions and variable.
15345 (read_declarations, copy_action, read_additionnal_code, : Updated
15346 with correct variables and functions names.
15347 (packsymbols, reader): Likewise.
342b8b6e 15348
11d82f03 15349 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 15350
11d82f03
MA
15351 * src/output.c: Include muscle_tab.h
15352 In all functions using macro_insert, change by using muscle_insert ().
15353 (macro_obstack): Rename muscle_obstack.
15354 Echo modifications in the whole file.
15355 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
15356 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
15357 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
15358
15359 * src/muscle_tab.h: Update double inclusion macros.
15360 (macro_entry_s): Rename muscle_entry_s.
15361 Update prototypes.
342b8b6e 15362
11d82f03
MA
15363 * src/muscle_tab.c: Include muscle_tab.h.
15364 Rename macro_tabble to muscle_table.
15365 (mhash1, mhash2, mcmp): Use muscle_entry.
15366 (macro_init): Rename muscle_init. Update.
15367 (macro_insert): Rename muscle_insert. Update.
15368 (macro_find): Rename muscle_find. Update.
15369
15370 * src/main.c: Include muscle_tab.h.
15371 (main): Call muscle_init ().
15372 * src/Makefile.am (bison_SOURCES): Echo modifications.
15373
93a37297
MA
153742001-09-02 Marc Autret <autret_m@epita.fr>
15375
f753cd62 15376 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 15377
f753cd62
MA
15378 * src/muscle_tab.c, src/muscle_tab.h: Add files.
15379
153802001-09-02 Marc Autret <autret_m@epita.fr>
15381
15382 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 15383
682d48cd
PB
153842001-09-01 Pascal Bart <pascal.bart@epita.fr>
15385
342b8b6e 15386 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
15387 filename.
15388
087c8fda
MA
153892001-09-01 Marc Autret <autret_m@epita.fr>
15390
15391 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
15392 to an explicit value to activate the feature. We do it here.
15393
dda680cb
PB
153942001-08-31 Pascal Bart <pascal.bart@epita.fr>
15395
15396 * src/output.c (prepare): Delete the `filename' muscule insertion.
15397 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
15398 (parse_union_decl): Likewise.
15399 * src/macrotab.c (macro_init): Initialize filename by infile.
15400
9e644e64
MA
154012001-08-31 Marc Autret <autret_m@epita.fr>
15402
15403 * src/bison.simple (YYLSP_NEEDED): New definition.
15404 * src/output.c (prepare): Add macro insertion of `locations_flag'
15405
17da6427
PB
154062001-08-31 Pascal Bart <pascal.bart@epita.fr>
15407
15408 * src/output.c (prepare): Delete insertion of previous muscles,
15409 and insert the `prefix' muscles.
15410 * src/macrotab.c (macro_init): Likewise.
15411 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 15412 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
15413 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
15414 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 15415 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
15416 name_prefix.
15417
e8cb70b9
PB
154182001-08-31 Pascal Bart <pascal.bart@epita.fr>
15419
15420 * src/main.c (main): Standardize.
15421 * src/output.c (output_table_data, output_parser): Likewise.
15422 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
15423
63c2d5de
MA
154242001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
15425
342b8b6e 15426 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
15427 %%epilogue.
15428 * src/output.c (output): Rename %%declarations to %%prologue.
15429 * src/bison.simple: Echo modifications.
342b8b6e 15430
d8cb5183
MA
154312001-08-31 Marc Autret <autret_m@epita.fr>
15432
15433 * src/reader.c (readgram): CleanUp.
15434 (output_token_defines): Likewise.
15435 (packsymbols): Likewise.
15436 (reader): Likewise.
15437 * src/output.c (output): CPP-out useless code.
15438
6c686258
PB
154392001-08-31 Pascal Bart <pascal.bart@epita.fr>
15440
342b8b6e 15441 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
15442 output_trailers and output_headers.
15443 * src/output.h: Remove obsolete functions prototypes of output_headers
15444 and output_trailers.
15445
8f451ef7
PB
154462001-08-30 Pascal Bart <pascal.bart@epita.fr>
15447
15448 * src/main.c: Include macrotab.h.
342b8b6e 15449 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
15450 Adjust functions prototypes.
15451 * src/macrotab.c (macro_insert): Constify key and value.
15452 (macro_find): Constify key.
15453 (macro_insert): Include 'xalloc.h'
15454 (macro_insert): Use XMALLOC.
15455 (macro_find): Constify return value.
15456 * src/output.c (output_table_data): Rename table to table_data.
15457 (output_parser): Constify macro_key, macro_value.
15458
997b6fd0 154592001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
15460
15461 * src/reader.c (parse_skel_decl): New.
342b8b6e 15462 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
15463 * src/lex.h (token_t): New token `tok_skel'.
15464 * src/lex.c (percent_table): Add skeleton option entry.
15465 Standardize.
15466
ff48177d
MA
154672001-08-29 Marc Autret <autret_m@epita.fr>
15468
15469 * src/bison.simple: Add %%user_code directive at the end.
15470 * src/reader.c (read_additionnal_code): New.
15471 (reader): Use it.
15472 * src/output.c (output_program): Remove.
15473 (output): Update.
15474
b33160bf
MA
154752001-08-28 Marc Autret <autret_m@epita.fr>
15476
15477 * src/output.c (output_actions): Clean up.
4e5caae2 15478 (output_gram): CPP-out useless code.
b33160bf
MA
15479 * src/reader.c (reader): Clean up, CPP-out useless code.
15480
d1a2daf7
PB
154812001-08-28 Pascal Bart <pascal.bart@epita.fr>
15482
342b8b6e 15483 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 15484 directive.
d1a2daf7
PB
15485 * src/bison.simple: Add `%%definitions'.
15486
2b763dfe
MA
154872001-08-28 Marc Autret <autret_m@epita.fr>
15488
15489 * config/depcomp: New file.
15490
f1a87ef6
PE
154912001-08-27 Paul Eggert <eggert@twinsun.com>
15492
15493 * src/bison.simple (yyparse): Don't take the address of an
15494 item before the start of an array, as that doesn't conform to
15495 the C Standard.
15496
82e236e2
RA
154972001-08-27 Robert Anisko <robert.anisko@epita.fr>
15498
f1a87ef6 15499 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
15500 obstack. It was done too late here.
15501
15502 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
15503 completely wrong.
15504 (reader): Initialize the macro obstack here, since we need it to grow
15505 '%define' directives.
15506
15507 * src/reader.h: Declare the macro obstack as extern.
15508
b0cfa28a
RA
155092001-08-27 Robert Anisko <robert.anisko@epita.fr>
15510
15511 * src/output.c (output_parser): Fix. Store single '%' characters in
15512 the output obstack instead of throwing them away.
15513
6fc74234
AD
155142001-08-27 Akim Demaille <akim@epita.fr>
15515
15516 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15517
9c76d118
RA
155182001-08-25 Robert Anisko <robert.anisko@epita.fr>
15519
15520 * lib/Makefile.am: Adjust.
15521
a8289c62
RA
155222001-08-25 Robert Anisko <robert.anisko@epita.fr>
15523
15524 * src/bison.simple: Update and add '%%' directives.
15525
b6610515
RA
155262001-08-25 Robert Anisko <robert.anisko@epita.fr>
15527
15528 * src/reader.c (reader): Remove calls to 'output_headers' and
15529 'output_trailers'. Remove some C output.
15530 (readgram): Disable a piece of code that was writing a default
15531 definition for 'YYSTYPE'.
15532 (reader_output_yylsp): Remove.
15533 (packsymbols): Output token defintions to a macro.
15534 (copy_definition): Disable C output.
6fc74234 15535
b6610515
RA
15536 * src/reader.c (parse_macro_decl): New function used to parse macro
15537 declarations.
15538 (copy_string2): Put the body of copy_string into this new function.
15539 Add a parameter to let the caller choose whether he wants to copy the
15540 string delimiters or not.
15541 (copy_string): Be a simple call to copy_string2 with the last argument
15542 bound to true.
15543 (read_declarations): Add case for macro definition.
15544 (copy_identifier): New.
6fc74234 15545 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
15546 rather than lex.
15547
26f609ff
RA
155482001-08-25 Robert Anisko <robert.anisko@epita.fr>
15549
15550 * src/output.c (prepare): Add prefixed names.
15551 (output_parser): Output semantic actions.
15552 (output_parser): Fix bug on '%%line' directives.
6fc74234 15553
26f609ff
RA
15554 * src/output.c (output_headers): Remove. The C code printed by this
15555 function should now be in the skeletons.
15556 (output_trailers): Remove.
15557 (output): Disable call to 'reader_output_yylsp'.
15558 (output_rule_data): Do not output tables to the table obstack.
15559
15560 * src/output.c: Remove some C dedicated output.
15561 Improve the use of macro and output obstacks.
15562 (output_defines): Remove.
6fc74234 15563
26f609ff
RA
15564 * src/output.c (output_token_translations): Associate 'translate'
15565 table with a macro. No output to the table obstack.
15566 (output_gram): Same for 'rhs' and 'prhs'.
15567 (output_stos): Same for 'stos'.
15568 (output_rule_data): Same for 'r1' and 'r2'.
15569 (token_actions): Same for 'defact'.
15570 (goto_actions): Same for 'defgoto'.
15571 (output_base): Same for 'pact' and 'pgoto'.
15572 (output_table): Same for 'table'.
15573 (output_check): Same for 'check'.
6fc74234 15574
26f609ff
RA
15575 * src/output.c (output_table_data): New function.
15576 (output_short_table): Remove.
15577 (output_short_or_char_table): Remove.
6fc74234 15578
26f609ff
RA
15579 * src/output.c (output_parser): Replace most of the skeleton copy code
15580 with something new. Skeletons are now processed character by character
15581 rather than line by line, and Bison looks for '%%' macros. This is the
15582 first step in making Bison's output process (a lot) more flexible.
15583 (output_parser): Use the macro table.
15584
6f43b113
RA
155852001-08-25 Robert Anisko <robert.anisko@epita.fr>
15586
15587 * src/main.c (main): Initialize the macro table.
15588
dd3127cf
RA
155892001-08-25 Robert Anisko <robert.anisko@epita.fr>
15590
15591 * src/lex.c (percent_table): Add tok_define.
15592 * src/lex.h: Add tok_define.
15593
aa321494
RA
155942001-08-25 Robert Anisko <robert.anisko@epita.fr>
15595
15596 * src/macrotab.c: New file.
15597 * src/macrotab.h: New file.
15598 * src/Makefile.am: Update.
15599
68bd3b6b
RA
156002001-08-25 Robert Anisko <robert.anisko@epita.fr>
15601
15602 * lib/hash.c: New file.
15603 * lib/hash.h: New file.
15604 * lib/Makefile.am: Update.
15605
45f8dd1e
AD
156062001-08-15 Akim Demaille <akim@epita.fr>
15607
15608 Version 1.28c.
15609
40a64a7a 156102001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
15611
15612 * src/reader.c (readgram): Indent output macro YYSTYPE.
15613 (packsymbols): Likewise.
15614 (output_token_defines): Likewise.
15615 * src/files.c: Standardize.
15616 (compute_header_macro): New.
15617 (defines_obstack_save): New. Use compute_header_macro.
15618 (output_files): Update. Use defines_obstack_save.
15619
f9a8293a
AD
156202001-08-15 Akim Demaille <akim@epita.fr>
15621
15622 * doc/bison.texinfo (Table of Symbols): Document
15623 YYSTACK_USE_ALLOCA.
15624
150ca7a7
AD
156252001-08-15 Akim Demaille <akim@epita.fr>
15626
15627 * missing: Update from CVS Automake.
15628 * config/config.guess, config/config.sub, config/texinfo.tex:
15629 Update from gnu.org.
15630
69b5cec4
AD
156312001-08-15 Akim Demaille <akim@epita.fr>
15632
15633 * Makefile.maint: Sync with CVS Autoconf.
15634
f2b5126e
PB
156352001-08-14 Pascal Bart <pascal.bart@epita.fr>
15636
69b5cec4 15637 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
15638 `fdl.texi'.
15639 * doc/fdl.texi: Add to package.
15640
4ecbf796
MA
156412001-08-14 Marc Autret <autret_m@epita.fr>
15642
15643 Turn on %{source,header}_extension features.
15644
69b5cec4 15645 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
15646 source_extension.
15647 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 15648 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
15649 between options.
15650
95fb5662
MA
156512001-08-14 Marc Autret <autret_m@epita.fr>
15652
15653 * src/files.c (compute_base_names): Add extensions computing when
15654 `--file-prefix' used.
15655 Standardize function calls.
15656
78d09da9
MA
156572001-08-13 Marc Autret <autret_m@epita.fr>
15658
69b5cec4 15659 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
15660 defining it (defined but null disables alloca).
15661
5a009f2c
MA
156622001-08-13 Marc Autret <autret_m@epita.fr>
15663
15664 * src/bison.simple (_yy_memcpy): CPP reformat.
15665
1e41465a
PB
156662001-08-13 Pascal Bart <pascal.bart@epita.fr>
15667
15668 * tests/atconfig.in (CPPFLAGS): Fix.
15669
c67a198d
PB
156702001-08-10 Pascal Bart <pascal.bart@epita.fr>
15671
79282c6c 15672 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
15673 `gpl.texi'.
15674 * doc/gpl.texi: Add to package.
15675
09a6de7e
MA
156762001-08-10 Marc Autret <autret_m@epita.fr>
15677
15678 * src/print_graph.h: Fix.
15679 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
15680
b77b9ee0
AD
156812001-08-10 Akim Demaille <akim@epita.fr>
15682
15683 * src/system.h: Provide default declarations for stpcpy, strndup,
15684 and strnlen.
15685
3e259915
MA
156862001-08-10 Robert Anisko <anisko_r@epita.fr>
15687
15688 * doc/bison.texinfo (Locations): Update @$ stuff.
15689
ca96bc2d
MA
156902001-08-09 Robert Anisko <anisko_r@epita.fr>
15691
15692 * src/bison.simple (YYLLOC_DEFAULT): Update.
15693 (yyparse): Adjust.
15694
fdc6758b
MA
156952001-08-08 Marc Autret <autret_m@epita.fr>
15696
b77b9ee0 15697 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
15698 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
15699 Reported by Fabrice Bauzac.
957d4dbf 15700
600cad3b
MA
157012001-08-08 Marc Autret <autret_m@epita.fr>
15702
15703 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
15704 * src/vcg.c (output_node): Fix.
15705 * src/vcg.h: Cleanup.
15706 * src/print_graph.c: Add comments.
b77b9ee0 15707 (node_output_size): New global variable. Simplify the formatting of
600cad3b 15708 the VCG graph output.
b77b9ee0 15709 (print_actions): Unused code is now used. It notifies the final state
600cad3b 15710 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 15711 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
15712 blue.
15713 Get the current node name and node_obstack by argument.
15714 (node_obstack): New variable.
15715 (print_state): Manage node_obstack.
15716 (print_core): Use node_obstack given by argument.
15717 A node is not only computed here but in print_actions also.
15718 (print_graph): CPP out useless code instead of commenting it.
15719
976e528f
AD
157202001-08-07 Pascal Bart <pascal.bart@epita.fr>
15721
15722 * tests/atconfig.in (CPPFLAGS): Fix.
15723
20e8e5ca
AD
157242001-08-07 Akim Demaille <akim@epita.fr>
15725
15726 * src/print_graph.c (quote): New.
15727 (print_core): Use it.
15728
957d4dbf 157292001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 15730
3e3da797
AD
15731 * src/vcg.c (complain.h): Include it.
15732 Unepitaize `return' invocations.
c4b66126 15733 [NDEBUG] (main): Remove.
79282c6c 15734 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
15735 * src/files.c (open_files): Initialize graph_obstack.
15736 * src/print_graph.c (print_actions): CPP out useless code.
15737 (print_core): Don't output the last `\n' in labels.
15738 Use `quote'.
15739 * src/files.c (output_files): Output the VCG file.
15740 * src/main.c (main): Invoke print_graph ();
3e3da797 15741
957d4dbf 157422001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
15743
15744 Automaton VCG graph output.
15745 Using option ``-g'' or long option ``--graph'', you can generate
15746 a gram_filename.vcg file containing a VCG description of the LALR (1)
15747 automaton of your grammar.
15748
15749 * src/main.c: Call to print_graph() function.
15750 * src/getargs.h: Update.
15751 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
15752 (graph_flag): New flag.
15753 (longopts): Update.
15754 (getargs): Add case `g'.
15755 * src/files.c (graph_obstack): New obstack struct.
15756 (open_files): Initialize new obstack.
15757 (output_files): Saves graph_obstack if required.
15758 * src/files.h (graph_obstack): New extern declaration.
15759 * src/Makefile.am: Add new source files.
15760
927c1557 157612001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
15762
15763 * src/print_graph.c, src/print_graph.h (graph): New.
15764 * src/vcg.h: New file.
15765 * src/vcg.c: New file, VCG graph handling.
15766
7333d403
AD
157672001-08-06 Marc Autret <autret_m@epita.fr>
15768
15769 Add of %source_extension and %header_extension which specify
15770 the source or/and the header output file extension.
15771
15772 * src/files.c (compute_base_names): Remove initialisation of
15773 src_extension and header_extension.
15774 (compute_exts_from_gf): Update.
15775 (compute_exts_from_src): Update.
15776 (output_files): Update.
15777 * src/reader.c (parse_header_extension_decl): New.
15778 (parse_source_extension_decl): New.
15779 (read_declarations): New case statements for the new tokens.
15780 * src/lex.c (percent_table): Add entries for %source_extension
15781 and %header_extension.
15782 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
15783
84163231
AD
157842001-08-06 Marc Autret <autret_m@epita.fr>
15785
15786 * configure.in: Bump to 1.28c.
15787 * doc/bison.texinfo: Texinfo thingies.
15788
8303fc42
AD
157892001-08-04 Pascal Bart <pascal.bart@epita.fr>
15790
15791 * tests/atconfig.in (CPPFLAGS): Add.
15792 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
15793
70a84437
AD
157942001-08-03 Akim Demaille <akim@epita.fr>
15795
15796 Version 1.28b.
15797
2ce10144
AD
157982001-08-03 Akim Demaille <akim@epita.fr>
15799
15800 * tests/Makefile.am (check-local): Ship testsuite.
15801 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
15802 Include `string.h'.
15803
1e3e4bc1
AD
158042001-08-03 Akim Demaille <akim@epita.fr>
15805
15806 * configure.in: Try using -Wformat when compiling.
15807
42b45b7f
AD
158082001-08-03 Akim Demaille <akim@epita.fr>
15809
15810 * configure.in: Bump to 1.28b.
15811
8f13fe33
AD
158122001-08-03 Akim Demaille <akim@epita.fr>
15813
15814 * src/complain.c: Adjust strerror_r portability issues.
15815
b37ba92c
AD
158162001-08-03 Akim Demaille <akim@epita.fr>
15817
15818 Version 1.28a.
15819
b0ce6046
AD
158202001-08-03 Akim Demaille <akim@epita.fr>
15821
15822 * src/getargs.c, src/getarg.h (skeleton)): Constify.
15823 * src/lex.c (literalchar): Avoid name clashes on `buf'.
15824 * src/getargs.c: Include complain.h.
15825 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
15826 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
15827
d01c415b
AD
158282001-08-03 Akim Demaille <akim@epita.fr>
15829
15830 * src/reader.c (readgram): Display hidden chars in error messages.
15831
459dd1a6
AD
158322001-08-03 Akim Demaille <akim@epita.fr>
15833
15834 Update to gettext 0.10.39.
15835
53b74c0c
AD
158362001-08-03 Akim Demaille <akim@epita.fr>
15837
15838 * lib/strspn.c: New.
15839
234a3be3
AD
158402001-08-01 Marc Autret <autret_m@epita.fr>
15841
15842 * doc/bison.texinfo: Update.
15843 * doc/bison.1 (mandoc): Update.
15844 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
15845 * src/files.c: Support output files extensions computing.
15846 (src_extension): New static variable.
15847 (header_extension): New static variable.
15848 (tr): New function.
15849 (get_extension_index): New function, gets the index of an extension
15850 filename in a string.
15851 (compute_exts_from_gf): New function, computes extensions from the
15852 grammar file extension.
15853 (compute_exts_from_src): New functions, computes extensions from the
15854 C source file extension, file given by ``-o'' option.
15855 (compute_base_names): Update.
15856 (output_files): Update.
15857
847bf1f5
AD
158582001-08-01 Robert Anisko <anisko_r@epita.fr>
15859
d995fee7 15860 * doc/bison.texi: Document @$.
847bf1f5
AD
15861 (Locations): New section.
15862
d074a105
AD
158632001-07-18 Akim Demaille <akim@epita.fr>
15864
15865 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
15866 * config/prev-version.txt, config/move-if-change: New.
15867 * Makefile.am: Adjust.
15868
3419715d
AD
158692001-07-08 Pascal Bart <pascal.bart@epita.fr>
15870
15871 * src/bison.simple (yyparse): Suppress warning `comparaison
15872 between signed and unsigned'.
15873
62ab6972
AD
158742001-07-05 Pascal Bart <pascal.bart@epita.fr>
15875
15876 * src/getargs.h (raw_flag): Remove.
15877 * src/getargs.c: Die on `-r'/`--raw'.
15878 * src/lex.c (parse_percent_token): Die on `%raw'.
15879 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
15880 * tests/calc.at: Suppress test with option `--raw'.
15881
1e24cc5b
AD
158822001-07-14 Akim Demaille <akim@epita.fr>
15883
15884 * config/: New.
15885 * configure.in: Require Autoconf 2.50.
15886 Update to gettext 0.10.38.
15887
32dfccf8
AD
158882001-03-16 Akim Demaille <akim@epita.fr>
15889
15890 * doc/bison.texinfo: ANSIfy the examples.
15891
cd5bd6ac
AD
158922001-03-16 Akim Demaille <akim@epita.fr>
15893
15894 * getargs.c (skeleton): New variable.
15895 (longopts): --skeleton is a new option.
15896 (shortopts, getargs): -S is a new option.
15897 * getargs.h: Declare skeleton.
15898 * output.c (output_parser): Use it.
15899
5141b016
AD
159002001-03-16 Akim Demaille <akim@epita.fr>
15901
15902 * m4/strerror_r.m4: New.
15903 * m4/error.m4: Run AC_FUNC_STRERROR_R.
15904 * lib/error.h, lib/error.c: Update.
15905
447992b9
AD
159062001-03-16 Akim Demaille <akim@epita.fr>
15907
15908 * src/getargs.c (longopts): Clean up.
15909
274d42ce
AD
159102001-02-21 Akim Demaille <akim@epita.fr>
15911
15912 * src/reader.c (gensym): `gensym_count' is your own.
15913 Use a static buf to create the symbol name, as token_buffer is no
15914 longer a buffer.
15915
22c821f3
AD
159162001-02-08 Akim Demaille <akim@epita.fr>
15917
15918 * src/conflicts.c (conflict_report): Be sure not to append to res
15919 between two calls, which could happen if both first sprintf were
15920 skipped, but not the first cp += strlen.
15921
18569462
AD
159222001-02-08 Akim Demaille <akim@epita.fr>
15923
15924 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
15925 New, from fileutils 4.0.37.
15926 * configure.in: Require Autoconf 2.49c. I took some time before
15927 making this decision. This is the only way out for portability
15928 issues in Bison, it would mean way too much duplicate effort to
15929 import in Bison features implemented in 2.49c since 2.13.
15930 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
15931
0d8f3c8a
AD
159322001-02-02 Akim Demaille <akim@epita.fr>
15933
15934 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 15935 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 15936
f17bcd1f
AD
159372001-01-19 Akim Demaille <akim@epita.fr>
15938
15939 Get rid of the ad hoc handling of token_buffer in the scanner: use
15940 the obstacks.
15941
15942 * src/lex.c (token_obstack): New.
15943 (init_lex): Initialize it. No longer call...
15944 (grow_token_buffer): this. Remove it.
15945 Adjust all the places which used it to use the obstack.
15946
511e79b3
AD
159472001-01-19 Akim Demaille <akim@epita.fr>
15948
15949 * src/lex.h: Rename all the tokens:
15950 s/\bENDFILE\b/tok_eof/g;
15951 s/\bIDENTIFIER\b/tok_identifier/g;
15952 etc.
15953 Let them be enums, not #define, to ease debugging.
15954 Adjust all the code.
15955
0d6508ef
AD
159562001-01-18 Akim Demaille <akim@epita.fr>
15957
15958 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
15959 * src/lex.c (maxtoken, grow_token_buffer): Static.
15960
6deb4447
AD
159612001-01-18 Akim Demaille <akim@epita.fr>
15962
15963 Since we now use obstacks, more % directives can be enabled.
15964
15965 * src/lex.c (percent_table): Also accept `%yacc',
15966 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
15967 `%debug'.
15968 Handle the actions for `%semantic_parser' and `%pure_parser' here,
15969 instead of returning a token.
15970 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
15971 * src/reader.c (read_declarations): Adjust.
15972 * src/files.c (open_files): Don't call `compute_base_names', don't
15973 compute `attrsfile' since they depend upon data which might be
15974 *in* the input file now.
15975 (output_files): Do it here.
15976 * src/output.c (output_headers): Document the fact that this patch
15977 introduces a guaranteed SEGV for semantic parsers.
15978 * doc/bison.texinfo: Document them.
15979 * tests/suite.at: Exercise these %options.
15980
ff4423cc
AD
159812000-12-20 Akim Demaille <akim@epita.fr>
15982
15983 Also handle the output file (--verbose) with obstacks.
15984
15985 * files.c (foutput): Remove.
15986 (output_obstack): New.
15987 Adjust all dependencies.
15988 * src/conflicts.c: Return a string.
15989 * src/system.h (obstack_grow_string): Rename as...
15990 (obstack_sgrow): this. Be ready to work with non literals.
15991 (obstack_fgrow4): New.
15992
956dba3a
AD
159932000-12-20 Akim Demaille <akim@epita.fr>
15994
15995 * src/files.c (open_files): Fix the computation of short_base_name
15996 in the case of `-o foo.tab.c'.
15997
337bab46
AD
159982000-12-20 Akim Demaille <akim@epita.fr>
15999
16000 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
16001 (copy_dollar): Now that everything uses obstacks, get rid of the
16002 FILE * parameters.
16003
5d3214b8
AD
160042000-12-20 Akim Demaille <akim@epita.fr>
16005
16006 * src/files.c (open_files): Actually the `.output' file is based
16007 on the short_base_name, not base_name.
16008 * tests/suite.at (Checking output file names): Adjust.
16009
29092a57
AD
160102000-12-20 Akim Demaille <akim@epita.fr>
16011
16012 * src/bison.s1: Remove, we now use directly...
16013 * src/bison.simple: this.
16014 * src/Makefile.am: Use pkgdata instead of data.
16015
ea5607fd
AD
160162000-12-20 Akim Demaille <akim@epita.fr>
16017
16018 * src/files.c (guard_obstack): New.
16019 (open_files): Initialize it.
16020 (output_files): Dump it...
16021 * src/files.h: Export it.
16022 * src/reader.c (copy_guard): Use it.
16023
27110317
AD
160242000-12-19 Akim Demaille <akim@epita.fr>
16025
16026 * src/files.c (outfile, defsfile, actfile): Removed as global
16027 vars.
16028 (open_files): Don't compute them.
16029 (output_files): Adjust.
16030 (base_name, short_base_name): Be global.
16031 Adjust dependencies.
16032
19c50364
AD
160332000-12-19 Akim Demaille <akim@epita.fr>
16034
16035 * src/files.c (strsuffix): New.
16036 (stringappend): Be just like strcat but allocate.
16037 (base_names): Eve out from open_files.
16038 Try to simplify the rather hairy computation of base_name and
16039 short_base_name.
16040 (open_files): Use it.
16041 * tests/suite.at (Checking output file names): New test.
16042
573c1d9f
AD
160432000-12-19 Akim Demaille <akim@epita.fr>
16044
16045 * src/system.h (obstack_grow_literal_string): Rename as...
16046 (obstack_grow_string): this.
16047 * src/output.c (output_parser): Recognize `%% actions' instead of
16048 `$'.
16049 * src/bison.s1: s/$/%% actions/.
16050 * src/bison.hairy: Likewise.
16051
ef7ddedd
AD
160522000-12-19 Akim Demaille <akim@epita.fr>
16053
16054 * src/output.c (output_parser): Compute the `#line' lines when
16055 there are.
16056 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
16057 Suggested by Hans Aberg.
16058
ff61dabd
AD
160592000-12-19 Akim Demaille <akim@epita.fr>
16060
16061 Let the handling of the skeleton files be local to the procedures
16062 that use it.
16063
16064 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
16065 longer static.
16066 (fparser, open_extra_files): Remove.
16067 (open_files, output_files): Don't take care of fparser.
16068 * src/files.h: Adjust.
16069 * src/output.c (output_parser): Open and close the file to the
16070 skeleton.
16071 * src/reader.c (read_declarations): When %semantic_parser, open
16072 fguard.
16073
55b96341
AD
160742000-12-19 Akim Demaille <akim@epita.fr>
16075
16076 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
16077 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
16078
358c15b7
AD
160792000-12-19 Akim Demaille <akim@epita.fr>
16080
16081 * src/files.c (open_files): Yipee! We no longer need all the code
16082 looking for `/tmp' since we have no tmp file.
16083
7de3329e
AD
160842000-12-19 Akim Demaille <akim@epita.fr>
16085
16086 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
16087 New macros.
16088 * src/files.c (open_files): Less dependency on MSDOS etc.
16089
3abcd459
AD
160902000-12-14 Akim Demaille <akim@epita.fr>
16091
16092 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
16093 Provide a default definition.
16094 Use it when executing the default @ action.
16095 * src/reader.c (reader_output_yylsp): No longer include
16096 `timestamp' and `text' in the default YYLTYPE.
16097
2a91a95e
AD
160982000-12-12 Akim Demaille <akim@epita.fr>
16099
16100 * src/reader.c (copy_definition, parse_union_decl, copy_action)
16101 (copy_guard): Quote the file names.
16102 Reported by Laurent Mascherpa.
16103
14d3eb9b
AD
161042000-12-12 Akim Demaille <akim@epita.fr>
16105
16106 * src/output.c (output_headers, output_program, output): Be sure
16107 to escape special characters when outputting filenames.
16108 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
16109 (output_headers): Don't depend on them, Use ACTSTR.
16110
d7045ec6
AD
161112000-11-17 Akim Demaille <akim@epita.fr>
16112
16113 * lib/obstack.h: Formatting changes.
16114 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
16115 prevents type checking.
16116 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
16117 cast the value to (void *): assigning a `foo *' to a `void *'
16118 variable is valid.
16119 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
16120 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
16121 append characters.
16122
6fd54b73
AD
161232000-11-17 Akim Demaille <akim@epita.fr>
16124
16125 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
16126 as...
16127 (suite.m4, regression.m4, calc.m4): these.
16128 * tests/atgeneral.m4: Update from CVS Autoconf.
16129
4c50eae6
AD
161302000-11-17 Akim Demaille <akim@epita.fr>
16131
16132 * tests/regression.m4 (%union and --defines): New test,
16133 demonstrating a current bug in the obstack implementation.
16134
a35f64ea
AD
161352000-11-17 Akim Demaille <akim@epita.fr>
16136
16137 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
16138 macros.
16139 Use them to declare the variables which are global or local to
16140 `yyparse'.
16141
7de23534
AD
161422000-11-17 Akim Demaille <akim@epita.fr>
16143
16144 * acconfig.h: Remove, no longer used.
16145
aa7815f5
AD
161462000-11-07 Akim Demaille <akim@epita.fr>
16147
16148 * src: s/Copyright (C)/Copyright/g.
16149
5af1f549
AD
161502000-11-07 Akim Demaille <akim@epita.fr>
16151
16152 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
16153 defining.
16154 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
16155
553e2b22
AD
161562000-11-07 Akim Demaille <akim@epita.fr>
16157
16158 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
16159 Merge in a single CPP if/else.
16160
8a4f41d6
AD
161612000-11-07 Akim Demaille <akim@epita.fr>
16162
16163 * src/output.c (output): Remove useless variables.
16164 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
16165 argument `data' for consistency with the prototypes.
16166 Qualify it `const'.
16167 (obstack_copy, obstack_copy0): Rename the second argument as
16168 `address' for consistency. Qualify it `const'.
16169 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
16170 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
16171 `const' their input argument (`data' or `address').
16172 Adjust the corresponding macros to include `const' in casts.
16173
095a3fb5
AD
161742000-11-03 Akim Demaille <akim@epita.fr>
16175
16176 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
16177 s/PFILE1/BISON_HAIRY/.
16178 Adjust dependencies.
16179
d1cdce7c
AD
161802000-11-03 Akim Demaille <akim@epita.fr>
16181
090c5ebf 16182 For some reason, this was not applied.
d1cdce7c
AD
16183
16184 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16185 `unlink': it's no longer used.
16186
9311529b
AD
161872000-11-03 Akim Demaille <akim@epita.fr>
16188
16189 * src/files.c (skeleton_find): New function, eved out of...
16190 (open_files, open_extra_files): here.
16191
d8880f69
AD
161922000-11-03 Akim Demaille <akim@epita.fr>
16193
16194 Don't use `atexit'.
16195
16196 * src/files.c (obstack_save): New function.
16197 (done): Rename as...
16198 (output_files): this.
16199 Use `obstack_save'.
16200 * src/main.c (main): Don't use `atexit' to register `done', since
16201 it no longer has to remove tmp files, just call `output_files'
16202 when there are no errors.
16203
0dbb648e
AD
162042000-11-02 Akim Demaille <akim@epita.fr>
16205
16206 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16207 `unlink': it's no longer used.
16208 * src/files.h: Formatting changes.
16209
896fe5c1
AD
162102000-11-02 Akim Demaille <akim@epita.fr>
16211
16212 Remove the last uses of mktemp and unlink/delete.
16213
16214 * src/files.c (fdefines, ftable): Removed.
16215 (defines_ostack, table_obstack): New.
16216 Adjust dependencies of the former into uses of the latter.
16217 * src/output.c (output_short_or_char_table, output_short_table):
16218 Convert to using obstacks.
16219 * src/reader.c (copy_comment2): Accept one FILE * and two
16220 obstacks.
16221 (output_token_defines, reader_output_yylsp): Use obstacks.
16222 * src/system.h (obstack_fgrow3): New.
1f65350a 16223 * po/POTFILES.in: Adjust.
896fe5c1 16224
dd60faec
AD
162252000-11-01 Akim Demaille <akim@epita.fr>
16226
16227 Change each use of `fattrs' into a use of `attrs_obstack'.
16228
16229 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
16230 * src/files.c (fattrs): Remove.
16231 (attrs_obstack): New.
16232 Adjust all dependencies.
16233 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
16234
8c7ebe49
AD
162352000-11-01 Akim Demaille <akim@epita.fr>
16236
16237 Introduce obstacks.
16238 Change each use of `faction' into a use of `action_obstack'.
16239
16240 * lib/obstack.h, lib/obstack.c: New files.
16241 * src/files.c (faction): Remove.
16242 (action_obstack): New.
16243 Adjust all dependencies.
16244
77aee789
AD
162452000-10-20 Akim Demaille <akim@epita.fr>
16246
16247 * lib/quote.h (PARAMS): New macro. Use it.
16248
43591cec
AD
162492000-10-16 Akim Demaille <akim@epita.fr>
16250
16251 * src/output.c (output_short_or_char_table): New function.
16252 (output_short_table, output_token_translations): Use it.
16253 (goto_actions): Use output_short_table.
16254
1e9798d5
AD
162552000-10-16 Akim Demaille <akim@epita.fr>
16256
16257 * src/symtab.c (bucket_new): New function.
16258 (getsym): Use it.
16259
16260 * src/output.c (output_short_table): New argument to display the
16261 comment associated with the table.
16262 Adjust dependencies.
16263 (output_gram): Use it.
16264 (output_rule_data): Nicer output layout for YYTNAME.
16265
f282676b
AD
162662000-10-16 Akim Demaille <akim@epita.fr>
16267
16268 * src/lex.c (read_typename): New function.
16269 (lex): Use it.
16270 * src/reader.c (copy_dollar): Likewise.
16271
550a72a3
AD
162722000-10-16 Akim Demaille <akim@epita.fr>
16273
16274 * src/reader.c (copy_comment2): Expect the input stream to be on
16275 the `/' which is suspected to open a comment, instead of being
16276 called after `//' or `/*' was read.
16277 (copy_comment, copy_definition, parse_union_decl, copy_action)
16278 (copy_guard): Adjust.
16279
131e2fef
AD
162802000-10-16 Akim Demaille <akim@epita.fr>
16281
16282 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
16283 `read_signed_integer'.
16284
79282c5a
AD
162852000-10-16 Akim Demaille <akim@epita.fr>
16286
16287 * src/reader.c (copy_dollar): New function.
16288 (copy_guard, copy_action): Use it.
16289
ff4a34be
AD
162902000-10-16 Akim Demaille <akim@epita.fr>
16291
16292 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
16293 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
16294 New files, from Fileutils 4.0.27.
16295 * src/main.c (printable_version): Remove.
16296 * src/lex.c, src/reader.c: Use `quote'.
16297
162982000-10-04 Akim Demaille <akim@epita.fr>
16299
16300 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
16301
14ded682
AD
163022000-10-04 Akim Demaille <akim@epita.fr>
16303
16304 * doc/bison.texinfo: Various typos spotted by Neil Booth.
16305
8e03724b
AD
163062000-10-04 Akim Demaille <akim@epita.fr>
16307
16308 When a literal string is used to define two different tokens,
16309 `bison -v' segfaults.
16310 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
16311
16312 * tests/regression.m4: New file.
16313 Include the core of the sample provided by Piotr Gackiewicz.
16314 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
16315 properly.
16316
a9e64249
AD
163172000-10-04 Akim Demaille <akim@epita.fr>
16318
16319 * src/reader.c (parse_expect_decl): Keep `count' within the size
16320 of `buffer'.
16321 From Neil Booth.
16322
da9abf43
AD
163232000-10-02 Paul Eggert <eggert@twinsun.com>
16324
16325 * bison.s1 (yyparse): Assign the default value
16326 unconditionally, to avoid a GCC warning and make the parser a
16327 tad smaller.
16328
c33638bb
AD
163292000-10-02 Akim Demaille <akim@epita.fr>
16330
16331 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
16332 options.
16333
444c570a
AD
163342000-10-02 Akim Demaille <akim@epita.fr>
16335
16336 * src/derives.c, src/print.c, src/reduce.c: To ease the
16337 translation, move some `\n' out of the translated strings.
16338
89cab50d
AD
163392000-10-02 Akim Demaille <akim@epita.fr>
16340
16341 The location tracking mechanism is precious for parse error
16342 messages. Nevertheless, it is enabled only when `@n' is used in
16343 the grammar, which is a different issue (you can use it in error
16344 message, but not in the grammar per se). Therefore, there should
16345 be another means to enable it.
16346
16347 * src/getargs.c (getargs): Support `--locations'.
16348 (usage): Report it.
16349 * src/getargs.h (locationsflag): Export it.
16350 * src/lex.c (percent_table): Support `%locations'.
16351 * src/reader.c (yylsp_needed): Remove this variable, now replaced
16352 with `locationsflag'.
16353 * doc/bison.texinfo: Document `--locations' and `%locations'.
16354 Sort the options.
16355 * tests/calc.m4: Test it.
16356
16357 For regularity of the names, replace each
16358 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
16359 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
16360 In addition replace each `flag' with `_flag'.
16361
d6c2cba0
AD
163622000-10-02 Akim Demaille <akim@epita.fr>
16363
16364 Also test parse error messages, including with YYERROR_VERBOSE.
16365
16366 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
16367 associative).
16368 Use it to check the computations.
16369 Use it to check `nonassoc' is honored.
16370 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
16371 `--yyerror-verbose'.
16372 (_AT_CHECK_CALC): Adjust to this option.
16373 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
16374
5a35a6cb
AD
163752000-10-02 Akim Demaille <akim@epita.fr>
16376
16377 Test also `--verbose', `--defines' and `--name-prefix'. Testing
16378 the latter demonstrates a flaw in the handling of non debugging
16379 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
16380 was used in order to simplify:
16381
16382 #if YYDEBUG
16383 if (yydebug)
16384 {
16385 ...
16386 }
16387 #endif
16388
16389 into
16390
16391 if (yydebug)
16392 {
16393 ...
16394 }
16395
16396 unfortunately this leads to a CPP conflict when
16397 `--name-prefix=foo' is used since it produces `#define yydebug
16398 foodebug'.
16399
16400 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
16401 (YYDPRINTF): New macro.
16402 Spread its use.
16403 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
16404 the bison options.
16405 Also test `--verbose', `--defines' and `--name-prefix'.
16406
71da9eea
AD
164072000-10-02 Akim Demaille <akim@epita.fr>
16408
16409 Improve the readability of the produced parsers.
16410
16411 * src/bison.s1: Formatting changes.
16412 Improve the comment related to the `$' mark.
16413 (yydefault): Don't fall through to `yyresume': `goto' there.
16414 * src/output.c (output_parser): When the `$' is met, skip the end
16415 of its line.
16416 New variable, `number_of_dollar_signs', to check there's exactly
16417 one `$' in the parser skeleton.
16418
95e36146
AD
164192000-10-02 Akim Demaille <akim@epita.fr>
16420
16421 * lib/xstrdup.c: New file, from the fileutils.
16422 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
16423 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
16424 instead of strlen + xmalloc + strcpy.
16425 * src/symtab.c (copys): Remove, use xstrdup instead.
16426
d7020c20
AD
164272000-10-02 Akim Demaille <akim@epita.fr>
16428
16429 * src/gram.h (associativity): New enum type which replaces the
16430 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
16431 `right_assoc', `left_assoc' and `non_assoc'.
16432 Adjust all dependencies.
16433 * src/reader.c: Formatting changes.
16434 (LTYPESTR): Don't define it, use it as a literal in
16435 `reader_output_yylsp'.
16436 * src/symtab.h (symbol_class): New enum type which replaces the
16437 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
16438 `sunknown', `stoken and `snterm'.
16439
1916f98e
AD
164402000-10-02 Akim Demaille <akim@epita.fr>
16441
16442 * src/getargs.c (fixed_outfiles): Rename as...
16443 (yaccflag): for consistency and accuracy.
16444 Adjust dependencies.
16445
d7913476
AD
164462000-10-02 Akim Demaille <akim@epita.fr>
16447
16448 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
16449 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
16450 difficult and introduced a lot of core dump. It turns out that
16451 Bison used an implementation of `xmalloc' based on `calloc', and
16452 at various places it does depend upon the initialization to 0. I
16453 have not tried to isolate the pertinent places, and all the former
16454 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
16455 someone should address this issue.
16456
16457 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
16458 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
16459 files.
16460 Adjust dependencies.
16461 * src/warshall.h: New file.
16462 Propagate.
16463
340ef489
AD
164642000-10-02 Akim Demaille <akim@epita.fr>
16465
16466 Various anti-`extern in *.c' changes.
16467
16468 * src/system.h: Include `assert.h'.
16469
b2ca4022
AD
164702000-10-02 Akim Demaille <akim@epita.fr>
16471
16472 * src/state.h (nstates, final_state, first_state, first_shift)
16473 (first_reduction): Move their exportation from here...
16474 * src/LR0.h: to here.
16475 Adjust dependencies.
16476 * src/getargs.c (statisticsflag): New variable.
16477 Add support for `--statistics'.
16478 Adjust dependencies.
16479
16480 Remove a lot of now useless `extern' statements in most files.
16481
403b315b
AD
164822000-10-02 Akim Demaille <akim@epita.fr>
16483
16484 * src/LR0.h: New file.
16485 Propagate its use.
16486
07a58c13
AD
164872000-10-02 Akim Demaille <akim@epita.fr>
16488
16489 * src/print.h: New file.
16490 Propagate its use.
16491 * src/print.c: Formatting and ordering changes.
16492 (verbose, terse): Replace with...
16493 (print_results): this new function.
16494 Adjust dependencies.
16495
0619caf0
AD
164962000-10-02 Akim Demaille <akim@epita.fr>
16497
16498 * src/conflicts.c (conflict_report): New function.
16499 (conflict_log, verbose_conflict_log): Replace with...
16500 (print_conflicts): this function.
16501 Adjust dependencies.
16502 * src/conflicts.h: New file.
16503 Propagate its inclusion.
16504
3519ec76
AD
165052000-10-02 Akim Demaille <akim@epita.fr>
16506
16507 * src/nullable.h: New file.
16508 Propagate its inclusion.
16509 * src/nullable.c: Formatting changes.
16510
015acc48
AD
165112000-10-02 Akim Demaille <akim@epita.fr>
16512
16513 * src/reduce.h: New file.
16514 Propagate its inclusion.
16515 * src/reduce.c: Topological sort and other formatting changes.
16516 (bool, TRUE, FALSE): Move their definition to...
16517 * src/system.h: here.
16518
8963a27b
AD
165192000-10-02 Akim Demaille <akim@epita.fr>
16520
16521 * src/files.c: Formatting changes.
16522 (tryopen, tryclose, openfiles): Rename as...
16523 (xfopen, xfclose, open_files): this.
16524 (stringappend): static.
16525 * src/files.h: Complete the list of exported symbols.
16526 Propagate its use.
16527
a70083a3
AD
165282000-10-02 Akim Demaille <akim@epita.fr>
16529
16530 * src/reader.h: New file.
16531 Propagate its use instead of tedious list of `extern' and
16532 prototypes.
16533 * src/reader.c: Formatting changes, topological sort,
16534 s/register//.
16535
abadc117
AD
165362000-10-02 Akim Demaille <akim@epita.fr>
16537
16538 * src/lex.h: Prototype `lex.c' exported functions.
16539 * src/reader.c: Adjust.
16540 * src/lex.c: Formatting changes.
16541 (safegetc): Rename as...
16542 (xgetc): this.
16543
720d742f
AD
165442000-10-02 Akim Demaille <akim@epita.fr>
16545
16546 * src/lalr.h: New file.
16547 Propagate its inclusion instead of prototypes and `extern'.
16548 * src/lalr.c: Formatting changes, topological sorting etc.
16549
f2acea59
AD
165502000-10-02 Akim Demaille <akim@epita.fr>
16551
16552 * src/output.c (token_actions): Introduce a temporary array,
16553 YYDEFACT, that makes it possible for this function to use
16554 output_short_table.
16555
d019d655
AD
165562000-10-02 Akim Demaille <akim@epita.fr>
16557
16558 `user_toknums' is output as a `short[]' in `output.c', while it is
16559 defined as a `int[]' in `reader.c'. For consistency with the
16560 other output tables, `user_toknums' is now defined as a table of
16561 shorts.
16562
16563 * src/reader.c (user_toknums): Be a short table instead of an int
16564 table.
16565 Adjust dependencies.
16566
16567 Factor the short table outputs.
16568
16569 * src/output.c (output_short_table): New function.
16570 * src/output.c (output_gram, output_stos, output_rule_data)
16571 (output_base, output_table, output_check): Use it.
16572
6c89f1c1
AD
165732000-10-02 Akim Demaille <akim@epita.fr>
16574
16575 * src/output.c (output): Topological sort of the functions, in
16576 order to get rid of the `static' prototypes.
16577 No longer use `register'.
16578 * src/output.h: New file.
16579 Propagate its inclusion in files explicitly prototyping functions
16580 from output.c.
16581
d9efd181
AD
165822000-09-21 Akim Demaille <akim@epita.fr>
16583
16584 * src/atgeneral.m4: Update from Autoconf.
16585
c29240e7 165862000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
16587
16588 * src/closure.h: New file.
16589 * src/closure.c: Formatting changes, topological sort over the
16590 functions, use of closure.h.
16591 (initialize_closure, finalize_closure): Rename as...
16592 (new_closure, free_closure): these. Adjust dependencies.
16593 * src/LR0.c: Formatting changes, topological sort, use of
16594 cloture.h.
16595 (initialize_states): Rename as...
16596 (new_states): this.
16597 * src/Makefile.am (noinst_HEADERS): Adjust.
16598
499daa50
AD
165992000-09-20 Akim Demaille <akim@epita.fr>
16600
16601 * src/acconfig.h: Don't protect config.h against multiple
16602 inclusion.
16603 Don't define PARAMS.
16604 * src/system.h: Define PARAMS.
16605 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
16606 purpose of config.h. system.h must not try to fix wrong
16607 definitions in config.h.
16608
cc84fd5d
AD
166092000-09-20 Akim Demaille <akim@epita.fr>
16610
16611 * src/derives.h: New file.
16612 * src/main.c, src/derives.h: Use it.
16613 Formatting changes.
16614 * src/Makefile.am (noinst_HEADERS): Adjust.
16615
db5b3a89
AD
166162000-09-20 Akim Demaille <akim@epita.fr>
16617
16618 * tests/atgeneral.m4: Update from Autoconf.
16619 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
16620 (AT_CHECK_CALC): New macros.
16621 Use these macros to test bison with options `', `--raw',
16622 `--debug', `--yacc', `--yacc --debug'.
16623
ceed8467
AD
166242000-09-19 Akim Demaille <akim@epita.fr>
16625
16626 * src/output.c: Formatting changes.
16627 * src/machine.h: Remove, leaving its contents in...
16628 * src/system.h: here.
16629 Include stdio.h.
16630 Adjust all dependencies on stdio.h and machine.h.
16631 * src/getargs.h: New file.
16632 Let all `extern' declarations about getargs.c be replaced with
16633 inclusion of `getargs.h'.
16634 * src/Makefile.am (noinst_HEADERS): Adjust.
16635
16636 * tests/calc.m4 (yyin): Be initialized in main, not on the global
16637 scope.
16638 (yyerror): Returns void, not int.
16639 * doc/bison.texinfo: Formatting changes.
16640
05a1d24b
AD
166412000-09-19 Akim Demaille <akim@epita.fr>
16642
16643 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
16644 portable.
16645
cbd25751
AD
166462000-09-18 Akim Demaille <akim@epita.fr>
16647
16648 * configure.in: Append WARNING_CFLAGS to CFLAGS.
16649 * src/Makefile.am (INCLUDES): Don't.
16650 Be ready to fetch headers in lib/.
16651
13863333
AD
166522000-09-18 Akim Demaille <akim@epita.fr>
16653
16654 * doc/bison.texinfo: Update the copyright.
16655 ANSIfy and GNUify the examples.
16656 Remove the old menu.
16657
0d533154
AD
166582000-09-18 Akim Demaille <akim@epita.fr>
16659
16660 First set of tests: use the `calc' example from the documentation.
16661
16662 * src/bison.s1 (yyparse): Condition the code using `yytname' which
16663 is defined only when YYDEBUG is.
16664 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
16665 * src/files.c (tryopen, tryclose): Formatting changes.
16666 Move to the top and be static.
16667 * src/reader.c (read_signed_integer): Likewise.
16668 * tests/calc.m4: New file.
16669 * Makefile.am, suite.m4: Adjust.
16670 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
16671
e79137ac
AD
166722000-09-18 Akim Demaille <akim@epita.fr>
16673
16674 Add support for an Autotest test suite for Bison.
16675
16676 * m4/m4.m4, m4/atconfig.m4: New files.
16677 * m4/Makefile.am (EXTRA_DIST): Adjust.
16678 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
16679 files.
16680 * src/getargs.c: Display a more standard --version message.
16681 * src/reader.c (reader): Formatting changes.
16682 No longer depend upon VERSION_STRING.
16683 * configure.in: No longer use `dnl'.
16684 Set up the test suite and the new directory `tests/.
16685 (VERSION_STRING): Remove.
16686
27821bff
AD
166872000-04-14 Akim Demaille <akim@epita.fr>
16688
16689 * src/reader.c (copy_comment2): New function, same as former
16690 `copy_comment', but outputs into two FILE *.
16691 (copy_comment): Use it.
16692 (parse_union_decl): Use it.
16693 (get_type, parse_start_decl): Use the same `invalid' message.
16694 (parse_start_decl, parse_union_decl): Use the same `multiple'
16695 message.
16696 (parse_union_decl, copy_guard, copy_action): Use the same
16697 `unmatched' message.
16698 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
16699
cfe5fbc0
AD
167002000-03-31 Akim Demaille <akim@epita.fr>
16701
16702 * src/files.c (tryopen, tryclose): Move to the top.
16703 Be static.
16704
cb7db13e
AD
167052000-03-31 Akim Demaille <akim@epita.fr>
16706
16707 * src/main.c (main): Don't call `done', exit does it.
16708
a0f6b076
AD
167092000-03-31 Akim Demaille <akim@epita.fr>
16710
36281465
AD
16711 * allocate.c: s/return (foo)/return foo/.
16712 * lalr.c: Likewise.
16713 * LR0.c: Likewise.
16714 * output.c: Likewise.
16715 * reader.c: Likewise.
16716 * symtab.c: Likewise.
16717 * vmsgetargs.c: Likewise.
16718
167192000-03-31 Akim Demaille <akim@epita.fr>
16720
16721 Clean up the error reporting functions.
a0f6b076
AD
16722
16723 * src/report.c: New file.
16724 * src/report.h: Likewise.
16725 * src/Makefile.am: Adjust.
16726 * m4/error.m4: New file.
16727 * m4/Makefile.am: Adjust.
16728 * configure.in (jm_PREREQ_ERROR): Call it.
16729 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
16730 Remove.
16731 (fatal, fatals): Remove. All callers use complain.c::fatal.
16732 (warn, warni, warns, warnss, warnss): Remove. All callers use
16733 complain.c::complain.
16734 (toomany): Remove, use fatal instead.
16735 * src/files.c (done): No argument, use complain_message_count.
16736 * src/main.c (main): Register `done' to `atexit'.
16737
16738 * src/getargs.c (usage): More `fputs', less `fprintf'.
16739
18539825
AD
167402000-03-28 Akim Demaille <akim@epita.fr>
16741
16742 * lib/: New directory.
16743 * Makefile.am (SUBDIRS): Adjust.
16744 * configure.in: Adjust.
16745 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
16746 useless.
16747 * src/alloca.c: Moved to lib/.
16748 * src/getopt.c: Likewise.
16749 * src/getopt1.c: Likewise.
16750 * src/getopt.h: Likewise.
16751 * src/ansi2knr.c: Likewise.
16752 * src/ansi2knr.1: Likewise.
16753 * src/Makefile.am: Adjust.
16754 * lib/Makefile.am: New file.
16755
9f306f2a
AD
167562000-03-28 Akim Demaille <akim@epita.fr>
16757
16758 * src/getargs.c (usage): Refresh the help message.
16759
0ba347b6
AD
167602000-03-17 Akim Demaille <akim@epita.fr>
16761
16762 * src/getopt1.c: Updated from textutils 2.0e
16763 * src/getopt.c: Likewise.
16764 * src/getopt.h: Likewise.
16765
dbe7f271
AD
167662000-03-17 Akim Demaille <akim@epita.fr>
16767
16768 * src/Makefile.am (bison.simple): Fix the awk program: quote only
16769 the file name, not the whole `#line LINE FILE'.
16770
75bbe78d
AD
167712000-03-17 Akim Demaille <akim@epita.fr>
16772
16773 On syntax errors, report the token on which we choked.
16774
aa5fd0ee
AD
16775 * src/bison.s1 (yyparse): In the label yyerrlab, when
16776 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 16777
7b306f52
AD
167782000-03-17 Akim Demaille <akim@epita.fr>
16779
aa5fd0ee 16780 * src/reader.c (copy_at): New function.
7b306f52
AD
16781 (copy_guard): Use it.
16782 (copy_action): Use it.
16783
e87b5700
AD
167842000-03-17 Akim Demaille <akim@epita.fr>
16785
16786 Be kind to translators, save some useless translations.
16787
aa5fd0ee 16788 * src/main.c (banner): New function.
e87b5700
AD
16789 (fatal_banner): Use it.
16790 (warn_banner): Use it.
16791
ae3c3164
AD
167922000-03-17 Akim Demaille <akim@epita.fr>
16793
aa5fd0ee
AD
16794 * src/reader.c (copy_definition): Use copy_string and
16795 copy_comment. Removed now unused `match', `ended',
16796 `cplus_comment'.
ae3c3164
AD
16797 (copy_comment, copy_string): Moved, to be visible from
16798 copy_definition.
16799
4dc58e7c
AD
168002000-03-17 Akim Demaille <akim@epita.fr>
16801
aa5fd0ee
AD
16802 * src/reader.c (copy_string): Declare `static inline'. No
16803 problems with inline, since it is checked by configure.
4dc58e7c
AD
16804 (copy_comment): Likewise.
16805
0a6384c4
AD
168062000-03-17 Akim Demaille <akim@epita.fr>
16807
aa5fd0ee 16808 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 16809
3cef001a
AD
168102000-03-17 Akim Demaille <akim@epita.fr>
16811
aa5fd0ee 16812 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
16813 (copy_action): Use it. Removed now unused `match', `ended',
16814 `cplus_comment'.
16815 (copy_guard): Likewise.
16816
ca36d2ef
AD
168172000-03-17 Akim Demaille <akim@epita.fr>
16818
aa5fd0ee 16819 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
16820 (copy_action): Use it.
16821 (copy_guard): Likewise.
16822
6666f98f
AD
168232000-03-17 Akim Demaille <akim@epita.fr>
16824
16825 Change the handling of @s so that they behave exactly like $s.
16826 There is now a pseudo variable @$ (readble and writable), location
16827 of the lhs of the rule (by default ranging from the location of
16828 the first symbol of the rhs, to the location of the last symbol,
16829 or, if the rhs is empty, YYLLOC).
16830
16831 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
16832 yyval.
16833 (yyparse): When providing a default semantic action, provide a
16834 default location action.
16835 (after the $): No longer change `*YYLSP', just stack YYLOC the
16836 same way you stack YYVAL.
16837 * src/reader.c (read_declarations): Use warns.
16838 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
16839 (copy_action, case '@'): Likewise.
16840 Use a standard error message, to save useless work from
16841 translators.
16842
41aca2e0
AD
168432000-03-17 Akim Demaille <akim@epita.fr>
16844
aa5fd0ee
AD
16845 * src/bison.s1: Formatting and cosmetics changes.
16846 * src/reader.c: Likewise.
41aca2e0
AD
16847 Update the Copyright notice.
16848
dc08c1d5
AD
168492000-03-17 Akim Demaille <akim@epita.fr>
16850
aa5fd0ee
AD
16851 * src/bison.s1 (#line): All set to `#line' only, since the
16852 Makefile now handles them.
dc08c1d5 16853
9ee3c97b
AD
168542000-03-16 Akim Demaille <akim@epita.fr>
16855
16856 * src/output.c (output_rule_data): Output the documentation of
16857 some of the tables.
16858 (Copyright notice): Update.
16859 Formatting changes.
16860
0de741ca
AD
168612000-03-16 Akim Demaille <akim@epita.fr>
16862
16863 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
16864 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
16865 One `#if YYDEBUG' remains, since it uses variables which are
16866 defined only if `YYDEBUG != 0'.
16867
bb10be54
AD
168682000-03-16 Akim Demaille <akim@epita.fr>
16869
16870 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
16871 and related variables so that the similarities are highlighted.
16872
b07b484a
AD
168732000-03-16 Akim Demaille <akim@epita.fr>
16874
16875 * src/bison.s1: Properly indent CPP directives.
16876
361f60b3
AD
168772000-03-16 Akim Demaille <akim@epita.fr>
16878
16879 * src/bison.s1: Properly indent the `alloca' CPP section.
16880
8c44d3ec
AD
168812000-03-16 Akim Demaille <akim@epita.fr>
16882
16883 Do not hard code values of directories in `configure.in'.
16884 Update the `configure' tool chain.
16885
16886 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
16887 src/makefile.am.
16888 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
16889 (AC_OUTPUT): Add m4/Makefile.
16890 Bump to bison 1.28a, 1.29 has never been released.
16891 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
16892 handled via src/Makefile.am.
16893 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
16894 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
16895 autoheader.
16896 * Makefile.am (SUBDIRS): Add m4.
16897 (ACLOCAL_AM_FLAGS): New variable.
16898 (AUTOMAKE_OPTIONS): Add check-news.
16899 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
16900 the proper line number and file name.
16901 (DEFS): Propagate the location of bison library files and of the
16902 locale files.
16903 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
16904 builddir.
16905 * acinclude.m4: Remove, replaced by the directory m4.
16906 * m4/Makefile.am (EXTRA_DIST): New variable.
16907 * m4/gettext.m4: New file, from the fileutils.
16908 * m4/lcmessage.m4: Likewise
16909 * m4/progtest.m4: Likewise.
16910 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
16911
f95997e7
AD
169122000-03-10 Akim Demaille <akim@epita.fr>
16913
16914 * src/closure.c:
16915 Formatting changes of various comments.
16916 Respect the GNU coding standards at various places.
16917 Don't use `_()' when no translation is needed.
16918
169191999-12-13 Jesse Thilo <jthilo@gnu.org>
16920
16921 * src/files.c:
16922 OS/2 honors TMPDIR environment variable.
16923
169241999-12-13 Jesse Thilo <jthilo@gnu.org>
16925
16926 * doc/bison.texinfo: Tweaked spelling and grammar.
16927 Updated ISBN.
16928 Removed reference to price of printed copy.
16929 Mention BISON_SIMPLE and BISON_HAIRY.
16930
169311999-12-13 Jesse Thilo <jthilo@gnu.org>
16932
16933 * configure.in, NEWS:
16934 Bison 1.29 released.
16935
169361999-10-27 Jesse Thilo <jthilo@gnu.org>
16937
16938 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
16939 Added reference card.
16940
169411999-07-26 Jesse Thilo <jthilo@gnu.org>
16942
16943 * po/ru.po: Added Russian translation.
16944
169451999-07-26 Jesse Thilo <jthilo@gnu.org>
16946
16947 * configure.in: Added Russian translation.
16948
169491999-07-06 Jesse Thilo <jthilo@gnu.org>
16950
16951 * configure.in, NEWS, README:
16952 Released version 1.28.
16953
169541999-06-14 Jesse Thilo <jthilo@gnu.org>
16955
16956 * src/system.h:
16957 Squashed redefinition warning on some systems.
16958
16959 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
16960 Have configure build version string instead of relying on ANSI string
16961 concatentation.
16962
169631999-06-14 Jesse Thilo <jthilo@gnu.org>
16964
16965 * po/POTFILES.in: Got rid of version.c.
16966
169671999-06-14 Jesse Thilo <jthilo@gnu.org>
16968
16969 * acconfig.h, configure.in:
16970 Have configure build version string instead of relying on ANSI string
16971 concatentation.
16972
169731999-06-08 Jesse Thilo <jthilo@gnu.org>
16974
16975 * doc/bison.1:
16976 Dropped mention of `+' for long-named options.
16977
169781999-05-30 Jesse Thilo <jthilo@gnu.org>
16979
16980 * src/files.c: Added <unistd.h> for unlink().
16981
16982 * src/Makefile.am, src/system.h:
16983 I18n fixes.
16984
169851999-05-30 Jesse Thilo <jthilo@gnu.org>
16986
16987 * README: Added a FAQ list.
16988
16989 * configure.in, acconfig.h:
16990 I18n fixes.
16991
169921999-05-30 Jesse Thilo <jthilo@gnu.org>
16993
16994 * doc/FAQ, doc/Makefile.am:
16995 Added a FAQ list.
16996
169971999-05-19 Jesse Thilo <jthilo@gnu.org>
16998
16999 * src/alloc.h, src/symtab.h, src/version.c:
17000 Protected inclusion of "config.h" with HAVE_CONFIG_H.
17001
170021999-04-18 Jesse Thilo <jthilo@gnu.org>
17003
17004 * src/.cvsignore, src/Makefile.am:
17005 Reorganized: sources in `src', documentation in `doc'.
17006
17007 * src/lex.c (literalchar):
17008 fixed the code for escaping double quotes (thanks
17009 Jonathan Czisny.)
17010
170111999-04-18 Jesse Thilo <jthilo@gnu.org>
17012
17013 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
17014 Adjusted paths to reflect directory reorganization.
17015
170161999-04-18 Jesse Thilo <jthilo@gnu.org>
17017
17018 * doc/.cvsignore, doc/Makefile.am:
17019 Reorganized: sources in `src', documentation in `doc'.
17020
170211999-04-18 Jesse Thilo <jthilo@gnu.org>
17022
17023 * configure.in:
17024 Updated AC_INIT file to reflect directory reorganization.
17025
17026 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
17027 Reorganized: sources in `src', documentation in `doc'.
17028
170291999-04-13 Jesse Thilo <jthilo@gnu.org>
17030
17031 * src/allocate.c:
17032 Don't declare calloc() and realloc() if not necessary.
17033
170341999-04-13 Jesse Thilo <jthilo@gnu.org>
17035
17036 * configure.in, acconfig.h, acinclude.m4:
17037 Don't declare calloc() and realloc() if not necessary.
17038
170391999-03-23 Jesse Thilo <jthilo@gnu.org>
17040
17041 * po/.cvsignore: Added i18n support.
17042
170431999-03-23 Jesse Thilo <jthilo@gnu.org>
17044
17045 * acconfig.h, configure.in, Makefile.am:
17046 Added i18n support.
17047
170481999-03-22 Jesse Thilo <jthilo@gnu.org>
17049
17050 * src/bison.s1: Fixed #line numbers.
17051
170521999-03-15 Jesse Thilo <jthilo@gnu.org>
17053
17054 * po/es.po, po/fr.po, po/nl.po, po/de.po:
17055 Added PO files from Translation Project.
17056
170571999-03-03 Jesse Thilo <jthilo@gnu.org>
17058
17059 * Makefile.am:
17060 Added support for non-ANSI compilers (ansi2knr).
17061
170621999-02-16 Jesse Thilo <jthilo@gnu.org>
17063
17064 * configure.in: Bumped version number to 1.27.
17065
17066 * Makefile.am:
17067 Added `bison.simple' to list of files removed by `make distclean'.
17068
170691999-02-12 Jesse Thilo <jthilo@gnu.org>
17070
17071 * src/files.c, src/files.h:
17072 Defined locations of parser files in config.h instead of Makefile.
17073
170741999-02-12 Jesse Thilo <jthilo@gnu.org>
17075
17076 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
17077 Defined locations of parser files in config.h instead of Makefile.
17078
170791999-02-09 Jesse Thilo <jthilo@gnu.org>
17080
17081 * Makefile.am:
17082 Removed inappropriate use of $< macro.
17083
170841999-02-05 Jesse Thilo <jthilo@gnu.org>
17085
17086 * po/Makefile.in.in, po/POTFILES.in:
17087 Add `po' directory skeleton.
17088
170891999-01-27 Jesse Thilo <jthilo@gnu.org>
17090
17091 * README: Document help-bison list.
17092
17093 * configure.in: Add check for mkstemp().
17094
170951999-01-20 Jesse Thilo <jthilo@gnu.org>
17096
17097 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
17098 Hush a few compiler warnings.
17099
17100 * src/files.c:
17101 Add tryclose(), which verifies that fclose was successful.
17102 Hush a couple of compiler warnings.
17103
171041999-01-20 Jesse Thilo <jthilo@gnu.org>
17105
17106 * Makefile.am, OChangeLog:
17107 ChangeLog is now automatically generated. Include the old version as
17108 OChangeLog.
17109
171101999-01-14 Jesse Thilo <jthilo@gnu.org>
17111
17112 * 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:
17113 Update FSF address.
17114
171151999-01-14 Jesse Thilo <jthilo@gnu.org>
17116
17117 * doc/bison.texinfo: Fix formatting glitch.
17118
17119 * doc/bison.texinfo: Update FSF address.
17120
171211999-01-14 Jesse Thilo <jthilo@gnu.org>
17122
17123 * acconfig.h: Update FSF address.
17124
171251999-01-08 Jesse Thilo <jthilo@gnu.org>
17126
17127 * src/system.h:
17128 Don't define PACKAGE here, since config.h defines it.
17129
171301998-12-30 Jesse Thilo <jthilo@gnu.org>
17131
17132 * src/reader.c: Update copyright date.
17133
17134 * src/main.c:
17135 Ditch sprintf to statically-sized buffers in fatal/warn functions in
17136 favor of output directly to stderr (avoids buffer overruns).
17137
17138 * src/reader.c: Some checks for premature EOF.
17139
17140 * 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:
17141 Use prototypes if the compiler understands them.
17142
17143 * src/files.c: Honor TMPDIR on Unix hosts.
17144 Use prototypes if the compiler understands them.
17145
17146 * src/reader.c:
17147 Fix a couple of buffer overrun bugs.
17148 Use prototypes if the compiler understands them.
17149
17150 * src/system.h: Include unistd.h and ctype.h.
17151 Use #ifdef instead of #if for NLS symbols.
17152
171531998-12-30 Jesse Thilo <jthilo@gnu.org>
17154
17155 * doc/bison.texinfo:
17156 Delete comment "consider using @set for edition number, etc..." since
17157 we now are doing so.
17158
171591998-12-30 Jesse Thilo <jthilo@gnu.org>
17160
17161 * configure.in:
17162 Use prototypes if the compiler understands them.
17163
17164 * NEWS: Document 1.26 highlights.
17165
17166 * Makefile.am: Require Automake 1.3 or later.
17167
17168 * acconfig.h:
17169 Use prototypes if the compiler understands them.
17170
171711998-12-29 Jesse Thilo <jthilo@gnu.org>
17172
17173 * src/version.c:
17174 Use VERSION symbol from automake for version number.
17175
171761998-12-29 Jesse Thilo <jthilo@gnu.org>
17177
17178 * acconfig.h, configure.in, version.cin:
17179 Use VERSION symbol from automake for version number.
17180
171811998-11-28 Jesse Thilo <jthilo@gnu.org>
17182
17183 * Makefile.am:
17184 Distribute original version of simple parser (bison.s1), not built
17185 version (bison.simple).
17186
171871998-11-28 Jesse Thilo <jthilo@gnu.org>
17188
17189 * doc/bison.texinfo: Add info dir entry.
17190
17191 * doc/bison.texinfo:
17192 Let automake put version number into documentation.
17193
171941998-11-26 Jesse Thilo <jthilo@gnu.org>
17195
17196 * src/bison.cld, src/build.com, src/vmshlp.mar:
17197 Add non-RCS files from /gd/gnu/bison.
17198
171991998-11-26 Jesse Thilo <jthilo@gnu.org>
17200
17201 * doc/bison.1:
17202 Document the BISON_HAIRY and BISON_SIMPLE variables.
17203
172041998-11-25 Jesse Thilo <jthilo@gnu.org>
17205
17206 * src/version.c: Build version.c automatically.
17207
17208 * src/reader.c:
17209 Fix token numbering (used to start at 258, not 257).
17210
17211 * src/system.h: Include config.h.
17212
17213 * src/getargs.c: Update bug report address.
17214
17215 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
17216 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
17217
172181998-11-25 Jesse Thilo <jthilo@gnu.org>
17219
17220 * Makefile.am:
17221 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17222
17223 * configure.in, version.cin:
17224 Build version.c automatically.
17225
17226 * AUTHORS: Add AUTHORS file.
17227
17228 * README: Update bug report address.
17229
17230 * bison.simple:
17231 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17232
17233 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
17234 Add automake stuff.
17235
172361998-11-25 Jesse Thilo <jthilo@gnu.org>
17237
17238 * doc/bison.texinfo: Clean up some formatting.
17239
172401998-05-05 Richard Stallman <rms@gnu.org>
17241
17242 * doc/bison.texinfo:
17243 Explain better why to make a pure parser.
17244
172451998-01-05 Richard Stallman <rms@gnu.org>
17246
17247 * src/files.c (openfiles):
17248 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
17249 find a temporary directory, if possible. Do not unlink files while
17250 they are open.
17251
172521997-08-25 Richard Stallman <rms@gnu.org>
17253
17254 * src/reader.c (stack_offset;):
17255 Change some warni to warns.
17256
17257 * src/lex.c (literalchar): Use warns, not warni.
17258
172591997-06-28 Richard Stallman <rms@gnu.org>
17260
17261 * src/bison.s1: Add a Bison version comment.
17262
17263 * src/main.c (fatal, warn, berror):
17264 Use program_name.
17265
172661997-06-28 Richard Stallman <rms@gnu.org>
17267
17268 * Makefile.in (bison_version): New variable.
17269 (dist): Use that variable.
17270 (bison.s1): Substitute the Bison version into bison.simple.
17271
17272 * bison.simple: Add a Bison version comment.
17273
172741997-06-18 Richard Stallman <rms@gnu.org>
17275
17276 * src/main.c (fatal, warn, berror):
17277 Make error messages standard.
17278 (toomany): Improve error message text.
17279
17280 * 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:
17281 new.h renamed to alloc.h.
17282
172831997-06-18 Richard Stallman <rms@gnu.org>
17284
17285 * Makefile.in: new.h renamed to alloc.h.
17286
172871997-05-24 Richard Stallman <rms@gnu.org>
17288
17289 * src/lex.c (literalchar):
17290 Fix the code for escaping \, " and '.
17291
17292 (lex): Avoid trouble when there are many chars
17293 to discard in a char literal with just several chars in it.
17294
172951997-05-17 Richard Stallman <rms@gnu.org>
17296
17297 * src/bison.s1:
17298 Use malloc, if using alloca is troublesome.
17299 (YYSTACK_USE_ALLOCA): New flag macro.
17300 Define it for some systems and compilers.
17301 (YYSTACK_ALLOC): New macro.
17302 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17303 If it was malloc'd, free it.
17304
173051997-05-17 Richard Stallman <rms@gnu.org>
17306
17307 * bison.simple:
17308 Use malloc, if using alloca is troublesome.
17309 (YYSTACK_USE_ALLOCA): New flag macro.
17310 Define it for some systems and compilers.
17311 (YYSTACK_ALLOC): New macro.
17312 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17313 If it was malloc'd, free it.
17314
173151997-04-23 Richard Stallman <rms@gnu.org>
17316
17317 * src/bison.s1:
17318 (alloca) [__hpux]: Always define as __builtin_alloca.
17319
173201997-04-23 Richard Stallman <rms@gnu.org>
17321
17322 * bison.simple:
17323 (alloca) [__hpux]: Always define as __builtin_alloca.
17324
173251997-04-22 Richard Stallman <rms@gnu.org>
17326
17327 * src/bison.s1:
17328 [__hpux]: Include alloca.h (right for HPUX 10)
17329 instead of declaring alloca (right for HPUX 9).
17330
17331 * src/bison.s1 (__yy_memcpy):
17332 Declare arg `count' as unsigned int.
17333 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17334
173351997-04-22 Richard Stallman <rms@gnu.org>
17336
17337 * bison.simple:
17338 [__hpux]: Include alloca.h (right for HPUX 10)
17339 instead of declaring alloca (right for HPUX 9).
17340
17341 * bison.simple (__yy_memcpy):
17342 Declare arg `count' as unsigned int.
17343 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17344
173451997-01-03 Richard Stallman <rms@gnu.org>
17346
17347 * src/allocate.c: [__STDC__ or _MSC_VER]:
17348 Declare calloc and realloc to return void *.
17349
173501997-01-02 Richard Stallman <rms@gnu.org>
17351
17352 * src/system.h:
17353 [_MSC_VER]: Include stdlib.h and process.h.
17354 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
17355
17356 * src/main.c (main): Return FAILURE as a value.
17357 (printable_version): Declare arg as int, not char.
17358
173591997-01-02 Richard Stallman <rms@gnu.org>
17360
17361 * Makefile.in (dist):
17362 Explicitly check for symlinks, and copy them.
17363
173641996-12-19 Richard Stallman <rms@gnu.org>
17365
17366 * src/files.c:
17367 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
17368
173691996-12-18 Paul Eggert <eggert@gnu.org>
17370
17371 * src/bison.s1 (yyparse):
17372 If __GNUC__ and YYPARSE_PARAM are both defined,
17373 declare yyparse to have a void * argument.
17374
173751996-12-18 Paul Eggert <eggert@gnu.org>
17376
17377 * bison.simple (yyparse):
17378 If __GNUC__ and YYPARSE_PARAM are both defined,
17379 declare yyparse to have a void * argument.
17380
173811996-12-17 Richard Stallman <rms@gnu.org>
17382
17383 * src/reduce.c (nbits): Add some casts.
17384
173851996-08-12 Richard Stallman <rms@gnu.org>
17386
17387 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
17388
173891996-08-12 Richard Stallman <rms@gnu.org>
17390
17391 * bison.simple: Test _MSDOS as well as _MSDOS_.
17392
173931996-07-31 Richard Stallman <rms@gnu.org>
17394
17395 * src/bison.s1:
17396 [__sun && __i386]: Include alloca.h.
17397
173981996-07-31 Richard Stallman <rms@gnu.org>
17399
17400 * bison.simple:
17401 [__sun && __i386]: Include alloca.h.
17402
174031996-07-30 Richard Stallman <rms@gnu.org>
17404
17405 * src/bison.s1: Comment change.
17406
17407 * src/bison.s1: Test _MSDOS_, not MSDOS.
17408
174091996-07-30 Richard Stallman <rms@gnu.org>
17410
17411 * bison.simple: Comment change.
17412
17413 * bison.simple: Test _MSDOS_, not MSDOS.
17414
174151996-06-01 Richard Stallman <rms@gnu.org>
17416
17417 * 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:
17418 Insert `_' macro around many string constants.
17419
17420 * src/main.c:
17421 Insert `_' macro around many string constants.
17422
17423 (main): Call setlocale, bindtextdomain and textdomain.
17424
17425 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
17426 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
17427 [ENABLE_NLS]: Include libintl.h.
17428 [ENABLE_NLS] (gettext): Define.
17429 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
17430 (N_, PACKAGE, LOCALEDIR): New macros.
17431
174321996-06-01 Richard Stallman <rms@gnu.org>
17433
17434 * POTFILES.in: New file.
17435
17436 * Makefile.in (allocate.o):
17437 Define target explicitly.
17438
17439 * Makefile.in (CFLAGS): Set to @CFLAGS@.
17440 (LDFLAGS): Set to @LDFLAGS@.
17441 (configure): Run autoconf only if preceding `cd' succeeds.
17442 (bison.s1): Redirect output to temporary file then move the
17443 temporary to the target, rather than redirecting directly to bison.s1.
17444 (clean): Remove config.status and config.log.
17445 (distclean): Don't remove config.status here.
17446
174471996-05-12 Richard Stallman <rms@gnu.org>
17448
17449 * src/bison.s1:
17450 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17451
174521996-05-12 Richard Stallman <rms@gnu.org>
17453
17454 * bison.simple:
17455 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17456
174571996-05-11 Richard Stallman <rms@gnu.org>
17458
17459 * src/bison.s1 (__yy_memcpy):
17460 Really reorder the args, as was supposedly done on Feb 14 1995.
17461 (yyparse): Calls changed accordingly.
17462
174631996-05-11 Richard Stallman <rms@gnu.org>
17464
17465 * Makefile.in (dist): Don't use $(srcdir).
17466
17467 * bison.simple (__yy_memcpy):
17468 Really reorder the args, as was supposedly done on Feb 14 1995.
17469 (yyparse): Calls changed accordingly.
17470
174711996-01-27 Richard Stallman <rms@gnu.org>
17472
17473 * src/output.c (output_rule_data):
17474 Test YYERROR_VERBOSE in the conditional
17475 around the definition of ttyname.
17476
174771995-12-29 Richard Stallman <rms@gnu.org>
17478
17479 * src/bison.s1:
17480 Fix line numbers in #line commands.
17481
174821995-12-29 Richard Stallman <rms@gnu.org>
17483
17484 * bison.simple:
17485 Fix line numbers in #line commands.
17486
174871995-12-27 Richard Stallman <rms@gnu.org>
17488
17489 * src/bison.s1 (YYPARSE_PARAM_DECL):
17490 In C++, make it always null.
17491 (YYPARSE_PARAM_ARG): New macro.
17492 (yyparse): Use YYPARSE_PARAM_ARG.
17493
174941995-12-27 Richard Stallman <rms@gnu.org>
17495
17496 * bison.simple (YYPARSE_PARAM_DECL):
17497 In C++, make it always null.
17498 (YYPARSE_PARAM_ARG): New macro.
17499 (yyparse): Use YYPARSE_PARAM_ARG.
17500
175011995-11-29 Richard Stallman <rms@gnu.org>
17502
17503 * doc/bison.texinfo:
17504 Describe literal string tokens, %raw, %no_lines, %token_table.
17505
175061995-11-29 Daniel Hagerty <hag@gnu.org>
17507
17508 * doc/bison.texinfo: Fixed update date
17509
175101995-10-16 Richard Stallman <rms@gnu.org>
17511
17512 * src/version.c: Version 1.25.
17513
175141995-10-16 Richard Stallman <rms@gnu.org>
17515
17516 * NEWS: *** empty log message ***
17517
175181995-10-16 Richard Stallman <rms@gnu.org>
17519
17520 * doc/bison.1, doc/bison.rnh:
17521 Add new options.
17522
175231995-10-15 Richard Stallman <rms@gnu.org>
17524
17525 * src/vmsgetargs.c, src/getargs.c:
17526 Added -n, -k, and -raw switches.
17527 (noparserflag, toknumflag, rawtoknumflag): New variables.
17528
17529 * src/symtab.h (SALIAS):
17530 New #define for adding aliases to %token.
17531 (struct bucket): Added `alias' field.
17532
17533 * src/reduce.c (reduce_grammar):
17534 Revise error message.
17535 (print_notices): Remove final `.' from error message.
17536
17537 * src/reader.c (reader_output_yylsp):
17538 New function.
17539 (readgram): Use `#if 0' around code that accepted %command
17540 inside grammar rules: The documentation doesn't allow it,
17541 and it will fail since the %command processors scan for the next %.
17542 (parse_token_decl): Extended the %token
17543 declaration to allow a multi-character symbol as an alias.
17544 (parse_thong_decl): New function.
17545 (read_declarations): Added %thong declarations.
17546 (read_declarations): Handle NOOP to deal with allowing
17547 % declarations as another means to specify the flags.
17548 (readgram): Allow %prec prior to semantics embedded in a rule.
17549 (skip_to_char, read_declarations, copy_definition)
17550 (parse_token_decl, parse_start_decl, parse_type_decl)
17551 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
17552 (get_type_name, copy_guard, copy_action, readgram)
17553 (get_type, packsymbols): Revised most error messages.
17554 Changed `fatal' to `warnxxx' to avoid aborting for error.
17555 Revised and use multiple warnxxx functions to avoid using VARARGS1.
17556 (read_declarations): Improve the error message for
17557 an invalid character. Do not abort.
17558 (read_declarations, copy_guard, copy_action): Use
17559 printable_version to avoid unprintable characters in printed output.
17560 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
17561 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
17562 Allow the type of a non-terminal can be given
17563 more than once, as long as all specifications give the same type.
17564
17565 * src/output.c:
17566 (output_headers, output_trailers, output, output_gram)
17567 (output_rule_data): Implement noparserflag variable.
17568 Implement toknumflag variable.
17569 (output): Call reader_output_yylsp to output LTYPESTR.
17570
17571 * src/main.c (main):
17572 If reader sees an error, don't process the grammar.
17573 (fatals): Updated to not use VARARGS1.
17574 (printable_version, int_to_string, warn, warni, warns, warnss)
17575 (warnsss): New error reporting functions. Avoid abort for error.
17576
17577 * src/lex.h:
17578 Added THONG and NOOP for alias processing.
17579 Added SETOPT for the new code that allows setting options with %flags.
17580
17581 * src/lex.c:
17582 Include getopt.h. Add some extern decls.
17583 (safegetc): New function to deal with EOF gracefully.
17584 (literalchar); new function to deal with reading \ escapes.
17585 (lex): Use literalchar.
17586 (lex): Implemented "..." tokens.
17587 (literalchar, lex, parse_percent_token): Made tokenbuffer
17588 always contain the token. This includes growing the token
17589 buffer while reading an integer.
17590 (parse_percent_token): Replaced if-else statement with percent_table.
17591 (parse_percent_token): Added % declarations as another
17592 way to specify the flags -n, -l, and -r. Also added hooks for
17593 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
17594 major changes to files.c.
17595 (lex) Retain in the incoming stream a character following
17596 an incorrect '/'.
17597 (skip_white_space, lex): Revised most error messages
17598 and changed fatal to warn to avoid aborting.
17599 (percent_table): Added %thong declarations.
17600
17601 * src/gram.h: Comment changes.
17602
17603 * src/files.c (openfiles, open_extra_files, done):
17604 Add faction flag
17605 and actfile file. Handle noparserflag. Both for -n switch.
17606
17607 * src/conflicts.c (resolve_sr_conflict):
17608 Remove use of alloca.
17609
176101995-06-01 Jim Meyering <meyering@gnu.org>
17611
17612 * doc/bison.texinfo: *** empty log message ***
17613
176141995-05-06 Richard Stallman <rms@gnu.org>
17615
17616 * src/bison.s1: Comment change.
17617
176181995-05-06 Richard Stallman <rms@gnu.org>
17619
17620 * bison.simple: Comment change.
17621
176221995-05-03 Richard Stallman <rms@gnu.org>
17623
17624 * src/version.c: Version now 1.24.
17625
17626 * src/bison.s1: Change distribution terms.
17627
17628 * src/version.c: Version now 1.23.
17629
176301995-05-03 Richard Stallman <rms@gnu.org>
17631
17632 * doc/bison.texinfo:
17633 Rewrite "Conditions for Using Bison".
17634 Update version to 1.24.
17635
176361995-05-03 Richard Stallman <rms@gnu.org>
17637
17638 * bison.simple: Change distribution terms.
17639
176401995-02-23 Richard Stallman <rms@gnu.org>
17641
17642 * src/files.c: Test __VMS_POSIX as well as VMS.
17643
176441995-02-14 Jim Meyering <meyering@gnu.org>
17645
17646 * src/bison.s1 (__yy_memcpy):
17647 Renamed from __yy_bcopy to avoid
17648 confusion. Reverse FROM and TO arguments to be consistent with
17649 those of memcpy.
17650
176511995-02-14 Jim Meyering <meyering@gnu.org>
17652
17653 * bison.simple (__yy_memcpy):
17654 Renamed from __yy_bcopy to avoid
17655 confusion. Reverse FROM and TO arguments to be consistent with
17656 those of memcpy.
17657
176581994-11-10 David J. MacKenzie <djm@gnu.org>
17659
17660 * NEWS: reformat
17661
17662 * NEWS: New file.
17663
17664 * Makefile.in (DISTFILES): Include NEWS.
17665
17666 * Makefile.in (DISTFILES):
17667 Include install-sh, not install.sh.
17668
17669 * configure.in: Update to Autoconf v2 macro names.
17670
176711994-10-05 David J. MacKenzie <djm@gnu.org>
17672
17673 * Makefile.in: fix typo
17674
17675 * Makefile.in (prefix, exec_prefix):
17676 Let configure set them.
17677
176781994-09-28 David J. MacKenzie <djm@gnu.org>
17679
17680 * Makefile.in: Set datadir to $(prefix)/share.
17681
176821994-09-15 Richard Stallman <rms@gnu.org>
17683
17684 * src/bison.s1:
17685 Update copyright notice and GPL version.
17686
176871994-09-15 Richard Stallman <rms@gnu.org>
17688
17689 * bison.simple:
17690 Update copyright notice and GPL version.
17691
176921994-07-12 Richard Stallman <rms@gnu.org>
17693
17694 * src/reduce.c, src/reader.c:
17695 entered into RCS
17696
176971994-05-05 David J. MacKenzie <djm@gnu.org>
17698
17699 * Makefile.in: entered into RCS
17700
177011994-03-26 Richard Stallman <rms@gnu.org>
17702
17703 * src/bison.s1: entered into RCS
17704
177051994-03-26 Richard Stallman <rms@gnu.org>
17706
17707 * bison.simple: entered into RCS
17708
177091994-03-25 Richard Stallman <rms@gnu.org>
17710
17711 * src/main.c: entered into RCS
17712
177131994-03-24 Richard Stallman <rms@gnu.org>
17714
17715 * src/conflicts.c: entered into RCS
17716
177171994-01-02 Richard Stallman <rms@gnu.org>
17718
17719 * Makefile.in: *** empty log message ***
17720
177211993-11-21 Richard Stallman <rms@gnu.org>
17722
17723 * src/bison.s1: *** empty log message ***
17724
177251993-11-21 Richard Stallman <rms@gnu.org>
17726
17727 * doc/bison.texinfo: entered into RCS
17728
17729 * doc/bison.texinfo: *** empty log message ***
17730
177311993-11-21 Richard Stallman <rms@gnu.org>
17732
17733 * bison.simple: *** empty log message ***
17734
177351993-10-25 David J. MacKenzie <djm@gnu.org>
17736
17737 * doc/bison.texinfo: *** empty log message ***
17738
177391993-10-19 Richard Stallman <rms@gnu.org>
17740
17741 * src/bison.s1: *** empty log message ***
17742
177431993-10-19 Richard Stallman <rms@gnu.org>
17744
17745 * bison.simple: *** empty log message ***
17746
177471993-10-14 Richard Stallman <rms@gnu.org>
17748
17749 * src/bison.s1: *** empty log message ***
17750
177511993-10-14 Richard Stallman <rms@gnu.org>
17752
17753 * bison.simple: *** empty log message ***
17754
177551993-09-14 David J. MacKenzie <djm@gnu.org>
17756
17757 * doc/bison.texinfo: *** empty log message ***
17758
177591993-09-13 Noah Friedman <friedman@gnu.org>
17760
17761 * Makefile.in: *** empty log message ***
17762
177631993-09-10 Richard Stallman <rms@gnu.org>
17764
17765 * src/conflicts.c: *** empty log message ***
17766
17767 * src/system.h: entered into RCS
17768
177691993-09-10 Richard Stallman <rms@gnu.org>
17770
17771 * doc/bison.1: entered into RCS
17772
177731993-09-06 Noah Friedman <friedman@gnu.org>
17774
17775 * src/version.c: entered into RCS
17776
177771993-09-06 Noah Friedman <friedman@gnu.org>
17778
17779 * Makefile.in: *** empty log message ***
17780
177811993-07-30 David J. MacKenzie <djm@gnu.org>
17782
17783 * Makefile.in: *** empty log message ***
17784
177851993-07-24 Richard Stallman <rms@gnu.org>
17786
17787 * src/bison.s1: *** empty log message ***
17788
177891993-07-24 Richard Stallman <rms@gnu.org>
17790
17791 * bison.simple: *** empty log message ***
17792
177931993-07-08 David J. MacKenzie <djm@gnu.org>
17794
17795 * Makefile.in: *** empty log message ***
17796
177971993-07-04 Richard Stallman <rms@gnu.org>
17798
17799 * src/bison.s1: *** empty log message ***
17800
178011993-07-04 Richard Stallman <rms@gnu.org>
17802
17803 * bison.simple: *** empty log message ***
17804
178051993-06-26 David J. MacKenzie <djm@gnu.org>
17806
17807 * src/getargs.c: entered into RCS
17808
178091993-06-26 David J. MacKenzie <djm@gnu.org>
17810
17811 * doc/bison.texinfo: *** empty log message ***
17812
17813 * doc/bison.1: New file.
17814
178151993-06-25 Richard Stallman <rms@gnu.org>
17816
17817 * src/getargs.c: New file.
17818
178191993-06-16 Richard Stallman <rms@gnu.org>
17820
17821 * src/bison.s1: *** empty log message ***
17822
178231993-06-16 Richard Stallman <rms@gnu.org>
17824
17825 * bison.simple: *** empty log message ***
17826
178271993-06-03 Richard Stallman <rms@gnu.org>
17828
17829 * src/bison.s1: New file.
17830
178311993-06-03 Richard Stallman <rms@gnu.org>
17832
17833 * doc/bison.texinfo: *** empty log message ***
17834
178351993-06-03 Richard Stallman <rms@gnu.org>
17836
17837 * bison.simple: New file.
17838
178391993-05-19 Richard Stallman <rms@gnu.org>
17840
17841 * doc/bison.texinfo: New file.
17842
178431993-05-07 Noah Friedman <friedman@gnu.org>
17844
17845 * Makefile.in: *** empty log message ***
17846
178471993-04-28 Noah Friedman <friedman@gnu.org>
17848
17849 * src/reader.c: *** empty log message ***
17850
178511993-04-23 Noah Friedman <friedman@gnu.org>
17852
17853 * src/alloc.h: entered into RCS
17854
178551993-04-20 David J. MacKenzie <djm@gnu.org>
17856
17857 * src/version.c: *** empty log message ***
17858
17859 * src/files.c, src/allocate.c:
17860 entered into RCS
17861
17862 * src/reader.c: *** empty log message ***
17863
17864 * src/lex.c: entered into RCS
17865
17866 * src/conflicts.c: New file.
17867
17868 * src/symtab.c: entered into RCS
17869
17870 * src/alloc.h: New file.
17871
17872 * src/LR0.c: entered into RCS
17873
178741993-04-18 Noah Friedman <friedman@gnu.org>
17875
17876 * src/reader.c: New file.
17877
17878 * src/version.c: *** empty log message ***
17879
178801993-04-18 Noah Friedman <friedman@gnu.org>
17881
17882 * Makefile.in: *** empty log message ***
17883
178841993-04-17 Noah Friedman <friedman@gnu.org>
17885
17886 * Makefile.in: *** empty log message ***
17887
178881993-04-15 Richard Stallman <rms@gnu.org>
17889
17890 * src/main.c, src/files.c:
17891 New file.
17892
178931993-04-15 Noah Friedman <friedman@gnu.org>
17894
17895 * configure.in: entered into RCS
17896
17897 * configure.in: *** empty log message ***
17898
17899 * configure.in: New file.
17900
179011993-04-14 Richard Stallman <rms@gnu.org>
17902
17903 * Makefile.in: New file.
17904
179051993-04-13 Richard Stallman <rms@gnu.org>
17906
17907 * src/version.c: New file.
17908
179091993-03-25 Richard Stallman <rms@gnu.org>
17910
17911 * src/output.c: entered into RCS
17912
179131992-09-25 Richard Stallman <rms@gnu.org>
17914
17915 * configure.bat: entered into RCS
17916
179171992-06-22 Richard Stallman <rms@gnu.org>
17918
17919 * src/vmsgetargs.c: entered into RCS
17920
179211992-06-22 Richard Stallman <rms@gnu.org>
17922
17923 * doc/bison.rnh: entered into RCS
17924
179251992-04-20 David J. MacKenzie <djm@gnu.org>
17926
17927 * README: entered into RCS
17928
179291992-01-22 Richard Stallman <rms@gnu.org>
17930
17931 * src/machine.h: entered into RCS
17932
179331991-12-21 Richard Stallman <rms@gnu.org>
17934
17935 * src/lalr.c, src/closure.c:
17936 entered into RCS
17937
179381991-12-20 Richard Stallman <rms@gnu.org>
17939
17940 * src/state.h: entered into RCS
17941
179421991-12-18 Richard Stallman <rms@gnu.org>
17943
17944 * src/print.c, src/nullable.c, src/derives.c:
17945 entered into RCS
17946
179471991-11-03 David J. MacKenzie <djm@gnu.org>
17948
17949 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
17950 entered into RCS
17951
179521988-09-09 Richard Stallman <rms@gnu.org>
17953
17954 * src/bison.hairy: entered into RCS
17955
179561987-12-16 Richard Stallman <rms@gnu.org>
17957
17958 * REFERENCES: entered into RCS
dc546b0f 17959
f294a2c2 17960
04098407 17961 -----
f294a2c2 17962
04098407 17963 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
e2a21b6f
PE
17964 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
17965 Software Foundation, Inc.
f294a2c2 17966
04098407
PE
17967 Copying and distribution of this file, with or without
17968 modification, are permitted provided the copyright notice and this
17969 notice are preserved.
e9071366
AD
17970
17971$Id$