]> git.saurik.com Git - bison.git/blame - ChangeLog
* data/push.c (yypstate): Add typedef, and update all uses of
[bison.git] / ChangeLog
CommitLineData
ee5abb37
JD
12006-12-15 Bob Rossi <bob@brasko.net>
2 and Joel Denny <jdenny@ces.clemson.edu>
3
4 * data/push.c (yypstate): Add typedef, and update all uses of
5 struct yypstate to just yypstate.
6 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
7
16ca01f9
JD
82006-12-14 Bob Rossi <bob@brasko.net>
9
10 * data/push.c (yypush_parse): Declare prototype regardless of
11 %locations option.
12
ab8e7e1a
JD
132006-12-14 Bob Rossi <bob@brasko.net>
14
15 * data/push.c (yyparse): Remove the prototype and the #define when in
16 push-parser mode.
17
9bf32be3
JD
182006-12-13 Bob Rossi <bob@brasko.net>
19
20 * data/push.c (yypstate_init): Rename to...
21 (yypstate_new): ... this and use b4_c_function_def.
22 (yypstate_delete): New.
23 (yypush_parse): Change parameters yynval and yynlloc to be const.
24 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
25 yypstate_delete functions.
26
f02e2948
JD
272006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
28
29 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
30 strange test case titles. Reported by Bob Rossi.
31
38eb7751
PE
322006-12-13 Paul Eggert <eggert@cs.ucla.edu>
33
34 * TODO: Add pointer to Sylvain Schmitz's work on static detection
35 of potential ambiguities in GLR grammers.
36
bd9d212b
JD
372006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
38
39 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
40 `bison ', use m4_index instead of m4_substr since chopping up a string
41 containing M4-special characters causes problems here.
42
43 Fix a couple of bugs related to special characters in user-specified
44 file names, and make it easier for skeletons to compute output file
45 names with the same file name prefix as Bison-computed output file
46 names.
47 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
48 b4_parser_file_name and b4_spec_defines_file instead of
49 @output_parser_name@ and @output_header_name@, which are now redundant.
50 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
51 b4_parser_file_name, b4_spec_defines_file, and the new
52 @basename(FILENAME@) instead of @output_parser_name@ and
53 @output_header_name@, which inappropriately escaped the file names as
54 C string literals.
55 * src/files.c (all_but_ext): Remove static qualifier.
56 (compute_output_file_names): Move `free (all_but_ext)' to...
57 (output_file_names_free): ... here since all_but_ext is needed later.
58 * src/files.h (all_but_ext): Extern.
59 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
60 exactly what MUSCLE_INSERT_STRING used to do.
61 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
62 characters are escaped properly.
63 * src/output.c (prepare): Define muscle file_name_all_but_ext as
64 all_but_ext.
65 For pkgdatadir muscle, maintain previous functionality by using
66 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
67 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
68 digraphs would never be expanded. Hopefully no one has M4-special
69 characters in his Bison installation path.
70 * src/scan-skel.l: Don't parse @output_header_name@ and
71 @output_parser_name@ anymore since they're now redundant.
72 In @output, use decode_at_digraphs.
73 Parse a new @basename command that invokes last_component.
74 (decode_at_digraphs): New.
75 (BASE_QPUTS): Remove unused.
76 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
77 (Output file name): New tests.
78
3f7ca628
JD
792006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
80
81 Warn about output files that are generated by the skeletons and that
82 conflict with other output files.
83 * data/glr.c: Don't generate the header file here when glr.cc does.
84 * src/files.c (file_names, file_names_count): New static globals.
85 (compute_output_file_names): Invoke output_file_name_check for files
86 not generated by the skeletons and remove existing checks.
87 (output_file_name_check): New function that warns about conflicting
88 output file names.
89 (output_file_names_free): Free file_names.
90 * src/files.h (output_file_name_check): Declare.
91 * src/scan-skel.l: Invoke output_file_name_check for files generated by
92 the skeletons.
93 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
94 (Conflicting output files): New tests.
95
178e123e
PE
962006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
97
98 * doc/bison.texinfo: Fix a couple of typos.
99
1002006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
101
102 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
103 Rename to...
104 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
105 update all uses.
106 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
107 (yypush_parse): Rename yypvars argument to yyps and remove redundant
108 local pv.
109 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
110 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
111
ea17f233
JD
1122006-12-07 Bob Rossi <bob@brasko.net>
113 and Joel Denny <jdenny@ces.clemson.edu>
114
115 * data/push.c (yypvarsinit): Change return type from void* to struct
116 yypvars*. No longer cast to void* on return.
117 (struct yypvars): Remove yylen since it need not be remembered between
118 yypushparse invocations.
119 (yypushparse): Don't copy between yylen and pv->yylen.
120
55a30bda
JD
1212006-12-05 Bob Rossi <bob@brasko.net>
122
123 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
124 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
125 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
126 (struct yypvars): Remove b4_declare_parser_variables.
127 (yypvarsinit): Remove init code for removed variables.
128 (global scope): Do not declare b4_declare_parser_variables if
129 push or pure mode.
130 (yypushparse): Add b4_declare_parser_variables.
131 Init new local variables, and remove init code for removed
132 yypvars variables.
133 (yyparse): Delete.
134 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
135 and yyparse for other modes.
136 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
137 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
138 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
139 (AT_PURE_LEX_IF): True if pure or push parser.
140
85894313
JD
1412006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
142
143 Document Yacc prologue alternatives and default %destructor's and
144 %printer's as experimental. Don't mention Java yet. Discussed at
145 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
146 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
147 (2.3a): Annotate this entry to say the old forms of these features were
148 also experimental.
149 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
150 Bison Symbols): Say they're experimental. Comment out any mention
151 of Java (we'll want this back eventually).
152
02975b9a
JD
1532006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
154
155 Support a file name argument to %defines. Deprecate `=' in
156 %file-prefix, %name-prefix, and %output. Discussed at
157 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
158 * NEWS (2.3a+): Mention.
159 * doc/bison.texinfo (Decl Summary, Bison Symbols): Add entry for new
160 form of %defines, and remove `=' from entries for %file-prefix,
161 %name-prefix, and %output.
162 * src/parse-gram.y (prologue_declaration): Implement.
163 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
164 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
165 all but one occurrence of %name-prefix.
166 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
167 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
168 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
169 occurrence of each of %file-prefix and %output. Add check for %defines
170 with argument.
171 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
172 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
173 Remove the `=' from %output.
174
287b314e
JD
1752006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
176
177 Don't escape $ in test case titles since Autoconf 2.61 now does that
178 correctly.
179 * tests/actions.at (Default %printer and %destructor are not for error
180 or $undefined): Here.
181 (Default %printer and %destructor are not for $accept): Here.
182 * tests/input.at (Invalid $n and @n): Here.
183
3ebecc24
JD
1842006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
185
186 Rename <!> to <>. Discussed starting at
187 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
188 * NEWS (2.3a+): Update.
189 * doc/bison.texinfo (Freeing Discarded Symbols, Bison Symbols):
190 Update.
191 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
192 * src/scan-gram.l (INITIAL): Implement.
193 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
194 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
195 comment.
196 * tests/actions.at (Default tagless %printer and %destructor,
197 Default tagged and per-type %printer and %destructor,
198 Default %printer and %destructor are not for error or $undefined,
199 Default %printer and %destructor are not for $accept,
200 Default %printer and %destructor for mid-rule values): Update.
201 * tests/input.at (Default %printer and %destructor redeclared,
202 Unused values with default %destructor): Update.
203
26b8a438
JD
2042006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
205
206 Don't let %prec take a nonterminal.
207 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
208 token.
209 * tests/input.at (%prec takes a token): New test checking that %prec
210 won't take a nonterminal.
211
07c39ae9
JD
2122006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
213
405d53b7
JD
214 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
215 it was double-quoted.
07c39ae9
JD
216 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
217 grammar is maintained with Bison's highest standards.
218 * src/getargs.c: Fix some typos in Doxygen comments.
219
580b8926
JD
2202006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
221
222 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
223 later. Reported by Paul Eggert in
224 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
225 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
226 * src/scan-code.l (translate_action): Don't bother invoking
227 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
228 (code_scanner_free): Instead of invoking
229 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
230 which frees more.
231 * src/scan-gram.l (gram_scanner_free): Likewise.
232 * src/scan-skel.l (scan_skel): Likewise.
233
4502eadc
JD
2342006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
235
236 * src/files.c (tr): Change return type to void.
237 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
238 has been called previously for the same key.
239 (muscle_find): Return storage instead of value so that
240 --enable-gcc-warnings doesn't produce warnings that the return discards
241 const. aver that the value and storage are the same since storage
242 could potentially be NULL when value is not.
243 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
244 same as 0.
245
7746c8f6
PE
2462006-11-08 Paul Eggert <eggert@cs.ucla.edu>
247
248 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
249 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
250 us a slightly cleaner distribution, and also works.
251 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
252 gnulib changes.
253
eb095650
PE
2542006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
255 and Paul Eggert <eggert@cs.ucla.edu>
256
257 Don't let Bison leak memory except when it complains.
258 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
259 (spec_defines_file, dir_prefix): Now char *, not const char *,
260 since they are freed.
261 * src/files.c: Likewise.
262 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
263 Likewise.
264 (tr): Now operates in-place. All uses changed.
265 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
266 values.
267 (compute_file_name_parts, compute_output_file_names): Don't store
268 read-only data in variables that will be freed.
269 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
270 src_extension, and header_extension.
271 (output_file_names_free): New public function to free
272 spec_verbose_file, spec_graph_file, spec_defines_file,
273 parser_file_name, and dir_prefix.
274 * src/getargs.c (getargs): Don't store read-only data in variables that
275 will be freed.
276 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
277 (which previously existed but was unused), and quotearg_free.
278 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
279 * src/muscle_tab.c: Likewise.
280 (muscle_entry): Make the value char const *,
281 and add a new storage member that is char * and can be freed.
282 (muscle_entry_free): New private function.
283 (muscle_init): Use it instead of free.
284 (muscle_insert, muscle_grow): Update and use new storage member.
285 (muscle_code_grow): Free the string passed to muscle_grow
286 since it's not needed anymore.
287 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
288 add a new `char *code' member.
289 ("{...}"): Declare semantic type as code.
290 * src/scan-code.h (translate_rule_action):
291 (translate_symbol_action, translate_code, translate_action): Return
292 `char const *' rather than `char *' since external code should not free
293 these strings.
294 * src/scan-code.l: Likewise.
295 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
296 which is "{...}" in the parser.
297 * tests/Makefile.am (maintainer-check-valgrind): Set
298 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
299 Valgrind.
300 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
301 complain.
302 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
303 expecting a non-zero exit status sets --leak-check=summary and
304 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
305 this case, and we don't want to hear about it.
306
ac564be4
PE
3072006-11-08 Paul Eggert <eggert@cs.ucla.edu>
308
309 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
310 instead of from the template, to simplify configuration a bit.
311 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
312 and m4/wint_t.m4, as they are needed with the latest gnulib.
313
17bd8a73
JD
3142006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
315
316 Disable unset/unused mid-rule value warnings by default, and recognize
317 --warnings=midrule-values to enable them. Discussed starting at
318 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
319 * NEWS (2.3a+): Mention.
320 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
321 warnings): Add entry for midrule-values subargument.
322 * src/reader.c (symbol_should_be_used): Don't return true just because
323 the value is a set/used mid-rule value unless
324 --warnings=midrule-values was specified.
325 * tests/input.at (Unused values, Unused values before symbol
326 declarations): Run tests with and without --warnings=midrule-values.
327
328 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
329 than LIST_FREE directly.
330
89eb3c76
JD
3312006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
332
333 Finish implementing --warnings=error, which should not be implied by
334 --warnings=all (or by its synonyms -W and --warnings without
335 subarguments).
336 * src/complain.c (set_warning_issued): New function to report that
337 warnings are being treated as errors and to record an error if so.
338 Invoke...
339 (warn_at, warn): ... here.
340 * src/getargs.c (warnings_args, warnings_types): Reorder so that
341 "error - warnings are errors" does not appear above "all - all of the
342 above".
343 (getargs): For -W and --warnings without subarguments, don't let
344 FLAGS_ARGMATCH set warnings_error in warnings_flag.
345 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
346
ba7560e2
JD
3472006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
348
349 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
350 empty subargument list. For example: `bison --warnings= parser.y'.
351
31283fc3
JD
3522006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
353
354 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
355 the parser header file so that gcc doesn't warn.
356
12e35840
JD
3572006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
358
359 Split the default %destructor/%printer into two kinds: <*> and <!>.
360 Discussed starting at
361 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
362 * NEWS (2.3a+): Mention.
363 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
364 previous change today related to mid-rules.
365 (Bison Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 366 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
367 (TYPE_TAG_ANY): Add as <*>.
368 (TYPE_TAG_NONE): Add as <!>.
369 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
370 for <*> and <!>.
371 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
372 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
373 * src/symlist.c (symbol_list_default_new): Split into tagged and
374 tagless versions.
375 (symbol_list_destructor_set, symbol_list_printer_set): Split
376 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
377 SYMLIST_DEFAULT_TAGLESS.
378 * src/symlist.h: Update symbol_list_default*_new prototypes.
379 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
380 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
381 * src/symtab.c (default_destructor, default_destructor_location,
382 default_printer, default_printer_location): Split each into tagged and
383 tagless versions.
384 (symbol_destructor_get, symbol_destructor_location_get,
385 symbol_printer_get, symbol_printer_location_get): Implement tagged
386 default and tagless default cases.
387 (default_destructor_set, default_printer_set): Split each into tagged
388 and tagless versions.
389 * src/symtab.h: Update prototypes.
390 * tests/actions.at (Default %printer and %destructor): Rename to...
391 (Default tagless %printer and %destructor): ... this, and extend.
392 (Per-type %printer and %destructor): Rename to...
393 (Default tagged and per-type %printer and %destructor): ... this, and
394 extend.
395 (Default %printer and %destructor for user-defined end token): Extend.
396 (Default %printer and %destructor are not for error or $undefined):
397 Update.
398 (Default %printer and %destructor are not for $accept): Update.
399 (Default %printer and %destructor for mid-rule values): Extend.
400 * tests/input.at (Default %printer and %destructor redeclared): Extend.
401 (Unused values with default %destructor): Extend.
402
f91b1629
JD
4032006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
404
405 Don't apply the default %destructor/%printer to an unreferenced midrule
406 value. Mentioned at
407 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
408 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
409 like $@n instead of just @n so that the default %destructor/%printer
410 logic doesn't see them as user-defined symbols.
411 (symbol_is_dummy): Check for both forms of the name.
412 * src/reader.c (packgram): Remove the `$' from each midrule symbol
413 name for which the midrule value is referenced in any action.
414 * tests/actions.at (Default %printer and %destructor for mid-rule
415 values): New test.
416 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
417 for change to dummy symbol names.
418
519d0004
JD
4192006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
420
421 Warn about unset midrule $$ if the corresponding $n is used.
422 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
423 $n usage.
424 (packgram): Before invoking grammar_rule_check on any rule, make sure
425 all actions have already been scanned in order to set `used' flags.
426 Otherwise, checking that a midrule's $$ is set will not always work
427 properly because the midrule check must forward-reference the midrule's
428 parent rule.
429 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
430 warning.
431
a501eca9
JD
4322006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
433
434 More improvements to the documentation of the prologue alternatives:
435 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
436 Bison manual.
437 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
438 some text to clarify the relative importance of the new directives and
439 to show how these directives may be viewed as code labels.
440
2cbe6b7f
JD
4412006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
442
443 Similar to the recently removed %before-header, add %code-top as the
444 alternative to the pre-prologue. Mentioned at
445 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
446 Also, let the prologue alternatives appear in the grammar section.
447 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
448 (prologue_declaration): Move the existing prologue alternatives to...
449 (grammar_declaration): ... here and add %code-top.
450 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
451
452 Clean up and extend documentation for the prologue alternatives.
453 * NEWS (2.3a+): Describe prologue alternatives.
454 * doc/bison.texinfo (Prologue): Move discussion of prologue
455 alternatives to...
456 (Prologue Alternatives): ... this new section, and extend it to discuss
457 all 4 directives in detail.
458 (Bison Symbols): Clean up discussion of prologue alternatives and add
459 %code-top.
460
e557d3ea
JMG
4612006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
462
463 DJGPP specific issues.
464
465 * djgpp/config.bat: config.hin has been moved to lib. Adjust
466 config.bat accordingly.
467 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
468 * djgpp/config.site: Likewise.
469
136a0f76
PB
4702006-10-16 Paolo Bonzini <bonzini@gnu.org>
471
27bd5d67
PB
472 Replace %*-header with %provides, %requires, %code. See discussion at
473 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
474
136a0f76
PB
475 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
476 (b4_user_start_header): Remove.
477 * data/glr.c: Use new macros instead of b4_*start_header
478 and b4_*end_header.
479 * data/glr.cc: Likewise.
480 * data/lalr1.cc: Likewise.
481 * data/push.c: Likewise.
482 * data/yacc.c: Likewise.
483
484 * doc/bison.texinfo: Remove %before-header, rename
485 %{start,end,after}-header to %requires, %provides, %code.
486
487 * src/parse-gram.y: Likewise (also rename token names accordingly).
488 * src/scan-gram.l: Likewise.
489 * tests/actions.at: Likewise.
490
10f429ef
PE
4912006-10-14 Paul Eggert <eggert@cs.ucla.edu>
492
493 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
494 Problem reported by Joel E. Denny.
495
4962006-10-14 Jim Meyering <jim@meyering.net>
497
498 (Sync from coreutils.)
499 Work also when the working directory (with e.g. coreutils sources)
500 is version controlled with git, rather than CVS.
501 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
502 rather than CVS.
503 In messages and comments, say e.g., "checked-out sources",
504 rather than "CVS sources".
505 (version_controlled_file): New function. Work for git as well as
506 for CVS. Don't use grep's -q option.
507 (slurp): Call it here, in place of CVS-specific code.
508
c4bd5bf7
JD
5092006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
510
511 Fix testsuite for ./configure --enable-gcc-warnings:
512 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
513 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
514 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
515 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
516 * test/regression.at (Diagnostic that expects two alternatives):
517 Likewise.
518
46356ea4
PE
5192006-10-12 Paul Eggert <eggert@cs.ucla.edu>
520
231ed89a
PE
521 * bootstrap.conf (gnulib_modules): Add config-h.
522 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
523 worry about HAVE_CONFIG_H.
524 * lib/abitset.c: Likewise.
525 * lib/bitset.c: Likewise.
526 * lib/bitset_stats.c: Likewise.
527 * lib/bitsetv-print.c: Likewise.
528 * lib/bitsetv.c: Likewise.
529 * lib/ebitset.c: Likewise.
530 * lib/get-errno.c: Likewise.
531 * lib/lbitset.c: Likewise.
532 * lib/subpipe.c: Likewise.
533 * lib/timevar.c: Likewise.
534 * lib/vbitset.c: Likewise.
535 * lib/bitset.c: Include "bitset.h" first, to test interface.
536 * lib/bitset_stats.c: Include "bitset_stats.h" first.
537 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
538 * lib/bitsetv.c: Include "bitsetv.h" first.
539 * lib/get-errno.c: Include "get-errno.h" first.
540 * m4/.cvsignore: Add config-h.m4.
541 * tests/actions.at (Default %printer and %destructor for ...):
542 Adjust expected line numbers in output to reflect removal of #if
543 HAVE_CONFIG_H lines.
544 * tests/glr-regression.at (Missed %merge type warnings when ...):
545 Likewise.
546 * tests/regression.at (Braced code in declaration in rules section):
547 Likewise.
548 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
549 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
550 Include <config.h> unconditionally.
551
46356ea4
PE
552 * bootstrap: Sync from coreutils, as follows:
553
554 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
555
556 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
557 variable was sometimes used without being initialized. This
558 messed up the installation of the INSTALL file in some cases.
559
560 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
561
562 * bootstrap (usage, main program, symlink_to_gnulib): Add option
563 --copy. Inspired by a suggestion from Bruno Haible.
564
565 2006-10-03 Jim Meyering <jim@meyering.net>
566
567 * bootstrap: Undo last change to this file, since now gnulib-tool
568 sticks with the automake default in generating dependencies.
569
dd4bf078
PE
5702006-10-12 Paul Eggert <eggert@cs.ucla.edu>
571
cf2a5f7c
PE
572 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
573 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
574
575 * doc/bison.1: Add copyright notice.
576
577 * data/glr.c: Don't include <stdarg.h>; not used.
578
35fe0834
PE
579 * NEWS: The -g and --graph options now output graphs in Graphviz
580 DOT format, not VCG format.
581 * doc/bison.1: Likewise.
582 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
583 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
584 of this change in
585 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
586 * TODO: Remove Graphviz entry.
587 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
588 remove vcg.c, vcg.h, vcg_defaults.h.
589 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
590 * src/graphviz.c, src/graphviz.h: New files.
591 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
592 * src/files.h: Make comment more generic.
593 * src/main.c (main): Likewise.
594 * src/print_graph.h: Likewise.
595 * src/getargs.c (usage): Make usage description more generic.
596 * src/print_graph.c: Include graphviz.h rather than vcg.h.
597 (static_graph, fgraph): Remove. All uses changed to pass
598 arguments instead of sharing a static var.
599 (print_core, print_actions, print_state, print_graph):
600 Output graphviz format rather than VCG format.
601 * tests/.cvsignore: Remove *.vcg; add *.dot.
602 * tests/output.at: Expect *.dot files, not *.vcg files.
603
dd4bf078
PE
604 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
605 accommodates the 2006-10-08 change.
606
efdd7421
PE
6072006-10-11 Bob Rossi <bob@brasko.net>
608
609 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
610 (b4_yyssa, b4_yyerror_range): New macros.
611 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
612 (yypvarsinit): Remove init of removed fields.
613 (yypushparse): Remove use of removed fields; use new macros instead.
614
96a1981a
PE
6152006-10-11 Paul Eggert <eggert@cs.ucla.edu>
616
617 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
618 in a push parser. Reindent slightly to match yacc.c better.
619
6202006-10-11 Bob Rossi <bob@brasko.net>
621
46356ea4
PE
622 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
623 yymsg_alloc fields.
624 (yypvarsinit, yypushparse): Remove init of removed fields.
625 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 626
c1630a8b
PE
6272006-10-09 Paul Eggert <eggert@cs.ucla.edu>
628
629 * THANKS: Add Paolo Bonzini and Bob Rossi.
630
90b9908d
PB
6312006-10-08 Paolo Bonzini <bonzini@gnu.org>
632
633 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
634 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
635 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
636 b4_define_user_cde and uses): Remove.
637 (b4_comment, b4_prefix, b4_sync_start): New.
638 * data/bison.m4: New file, with most of the content removed from c.m4.
639 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
640 * src/output.c (output_skeleton): Pass bison.m4.
641 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
642 only if specified.
643
cf806753
PE
6442006-10-05 Paul Eggert <eggert@cs.ucla.edu>
645
646 Fix test failure reported by Tom Lane in
647 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
648 and try to make such failures easier to catch in the future.
649 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
650 that's now the caller's responsibility.
651 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
652 Set yychar = YYEOF if it's negative.
653 * tests/actions.at (yylex): Abort if asked to read past EOF.
654 * tests/conflicts.at (yylex): Likewise.
655 * tests/cxx-type.at (yylex): Likewise.
656 * tests/glr-regression.at (yylex): Likewise.
657 * tests/input.at (yylex): Likewise.
658 * tests/regression.at (yylex): Likewise.
659 * tests/torture.at (yylex): Likewise.
660
0e2f006a
PE
6612006-10-01 Paul Eggert <eggert@cs.ucla.edu>
662
663 Fix problems with translating English-language diagnostics.
664 * bootstrap: Fix bug introduced in recent bootstrap changes, with
665 respect to bison-runtime pot generation. The YY_ stuff
666 wasn't being captured.
667 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
668 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
669 * runtime-po/POTFILES.in: Add data/push.c.
670
e3ddc1e3
PE
6712006-09-29 Paul Eggert <eggert@cs.ucla.edu>
672
673 Merge bootstrap changes from coreutils.
674
675 2006-09-28 Jim Meyering <jim@meyering.net>
676
677 Automatically generated dependencies are important even
678 when all of the sources in a directory come from gnulib.
679 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
680 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
681
682 2006-09-23 Jim Meyering <jim@meyering.net>
683
684 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
685
686 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
687
688 * bootstrap: Add support for --force.
689 (usage): New function. Describe usage less tersely.
690 (CVS_only_file): New var.
691
01e972b3
PE
6922006-09-21 Paul Eggert <eggert@cs.ucla.edu>
693
694 * data/push.c (YYPUSH_MORE): Make it an enum instead.
695 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
696 Adjust white space and comments to match GNU style better.
697
c63d3e90
PE
6982006-09-20 Bob Rossi <bob@brasko.net>
699
700 * data/push.c (yyresult_get): Remove function.
701 (YYPUSH_MORE): Add #define.
702 (yypushparse): Modify return value.
703
e70f46d1
PE
7042006-09-20 Paul Eggert <eggert@cs.ucla.edu>
705
706 * stamp-h.in: Remove; no longer needed.
707 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
708 Remove config.h, config.hin, intl (no longer created).
709 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
710 stamp-h1.
711
712 Sync bootstrap from coreutils, as follows:
713
714 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
715
716 * bootstrap (symlink_to_gnulib): New function.
717 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
718 to copies-of-gnulib.
719 (cp_mark_as_generated, slurp, gnulib_files):
720 Avoid making a copy if it's the same as the old version.
721 (gnulib_files): Add support for this variable (used by Bison).
722
a92be413
PE
7232006-09-20 Paul Eggert <eggert@cs.ucla.edu>
724
725 * src/getargs.c (usage): Rework to use conventions similar to
726 coreutils, to make translation a bit easier and the code a bit
727 smaller. Problem reported by Tim Van Holder.
728
4f82b42a
PE
7292006-09-15 Paul Eggert <eggert@cs.ucla.edu>
730
3b2942e6
PE
731 Use some of gnulib's new modules, taken from coreutils.
732
733 * bootstrap: Sync from coreutils, except add support for gnulib_files.
734 * bootstrap.conf: New file.
735 (gnulib_modules): Add configmake, inttypes, unistd.
736 (XGETTEXT_OPTIONS): Add complain, complain_at,
737 fatal, fatal_at, warn, warn_at, unexpected_end.
738 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
739 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
740 (gl_EARLY): Add.
741 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
742 (gl_INIT): Add
743 (GNULIB_AUTOCONF_SNIPPET): Remove.
744 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
745 the pickiest.
746 * lib/.cvsignore: Add inttypes_.h.
747 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
748 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
749 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
750 no-longer-necessary initializations.
751 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
752 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
753 use the unistd module.
754 * src/system.h: Likewise.
755 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
756 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
757 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
758 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
759 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
760 * src/system.h: Include inttypes.h unconditionally, now that we
761 use the inttypes module. Don't bother to include stdint.h, since
762 inttypes.h now does that for us.
763 (LOCALEDIR): Remove, now that we use the configmake module.
764 * src/getargs.c: Include configmake.h.
765 * src/main.c: Likewise.
766 * src/output.c: Likewise.
767 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
768 not from $abs_top_builddir, since config.h moved.
769
770
4f82b42a
PE
771 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
772 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
773
774 * src/parse-gram.y (symbol_declaration): Don't put statements
775 before declarations; it's not portable to C89.
776 * src/scan-code.l (handle_action_at): Likewise.
777
778 * src/scan-code.l: Always initialize braces_level; the old code
779 left it uninitialized and therefore had undefined behavior.
780
781 Don't attempt to redefine 'assert', since it runs afoul of
782 systems where standard headers (mistakenly) include <assert.h>.
783 Instead, define and use our own alternative, called 'aver'.
784 * src/reader.c: Don't include assert.h, since we no longer
785 use assert.
786 * src/scan-code.l: Likewise.
787 * src/system.h (assert): Remove, replacing with....
788 (aver): New function, taking a bool arg. All uses changed.
789 * src/tables.c (pack_vector): Ensure that aver arg is bool,
790 not merely an integer.
791
31c10e38
PE
7922006-09-15 Bob Rossi <bob@brasko.net>
793
794 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
795 * data/c.m4 (YYPUSH): New.
796 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
797 * src/getargs.c (push_parser): New var.
798 * src/getargs.h (push_parser): New declaration.
799 * src/output.c (prepare): Add macro insertion of `push_flag'.
800 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
801 (prologue_declaration): Parse %push-parser.
802 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
803 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
804 list of removed lines from the traces observed.
805 (AT_CHECK_CALC_LALR): Added push parser tests.
806
fa7b79c0
PE
8072006-09-13 Paul Eggert <eggert@cs.ucla.edu>
808
21fe08ca
PE
809 * NEWS: Version 2.3a.
810 * configure.ac (AC_INIT): Likewise.
811
e8ec4d9b
PE
812 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
813 "#define YYSTYPE int" that caused "make maintainer-check" to fail
814 due to header ordering dependencies. I don't know why the #define
815 was there.
816
fa7b79c0
PE
817 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
818 runtime cost when YYDEBUG is not defined, and so that some tests
819 that used to fail now work. Problem and initial suggestion by
820 Paolo Bonzini.
821 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
822 * data/glr.cc (b4_parser_class_name):
823 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
824 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
825 (yydebug_) [YYDEBUG]: New member.
826 (yycdebug_): Now defined only if YYDEBUG.
827 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
828 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
829 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
830 if YYYDEBUG.
831 (debug_stream, set_debug_stream, debug_level, set_debug_level):
832 Define only if YYDEBUG.
833 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
834 set_debug_level.
835 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
836 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
837 AT_CHECK_CALC_GLR_CC that are working now.
838
4ec13d60
PE
8392006-09-12 Paul Eggert <eggert@cs.ucla.edu>
840
841 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
842 We don't need them in glr.cc, and glr.c defines them.
843 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
844 assumes that defining it to anything is the same as defining
845 it to 1. Problem reported by Paolo Bonzini.
846
8e1687ae
PE
8472006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
848
849 * data/c.m4 (b4_null, b4_case): Define.
850 * src/output.c (prepare_symbols): Use b4_null.
851 (user_actions_output): Use b4_case.
852
3dc5e96b
PE
8532006-09-11 Paul Eggert <eggert@cs.ucla.edu>
854
aef3da86
PE
855 * data/glr.c (b4_shared_declarations): Put start-header first,
856 before any #includes that we generate, so that feature-test
857 macros work. Problem reported by Michael Deutschmann in
858 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
859 * data/lalr1.cc: Likewise.
860 * doc/bison.texinfo (Prologue): Document that feature-test macros
861 should be defined before any Bison declarations.
862 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
863 that depend on location.hh after, not before, Bison decls, since
864 we now include location.hh after the first user prologue.
865
3dc5e96b
PE
866 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
867 Sander Brandenburg in
868 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
869 Also, fix minor white space and comment issues.
aef3da86
PE
870 (Prologue): Mention that it's better to define feature-test macros
871 before Bison declarations. Problem reported by Michael Deutschmann.
872
873 * README-cvs: Fix typo: "&" should be "&&". Problem reported
874 by Jim Meyering.
875 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
876 This adjusts to recent gnulib changes.
3dc5e96b 877
b2a0b7ca
JD
8782006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
879
880 Finish implementation of per-type %destructor/%printer. Discussed
881 starting at
882 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
883 and
884 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
885 * NEWS (2.3+): Add a description of this feature to the default
886 %destructor/%printer description.
887 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
888 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
889 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
890 list node contains a semantic type.
891 * src/symtab.c, src/symtab.h: Extend with a table that associates
892 semantic types with their %destructor's and %printer's.
893 (semantic_type_from_uniqstr, semantic_type_get,
894 semantic_type_destructor_set, semantic_type_printer_set): New functions
895 composing the public interface of that table.
896 (symbol_destructor_get, symbol_destructor_location_get,
897 symbol_printer_get, symbol_printer_location_get): If there's no
898 per-symbol %destructor/%printer, look up the per-type before trying
899 the default.
900 * tests/actions.at (Per-type %printer and %destructor): New test case.
901 * tests/input.at (Default %printer and %destructor redeclared):
902 Extend to check that multiple occurrences of %symbol-default in a
903 single %destructor/%printer declaration is an error.
904 (Per-type %printer and %destructor redeclared, Unused values with
905 per-type %destructor): New test cases.
906
3be03b13
JD
9072006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
908
909 Require default %destructor/%printer to be declared using
910 %symbol-default instead of an empty symbol list, and start working on
911 new per-type %destructor/%printer. Discussed at
912 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
913 * NEWS (2.3+): Add %symbol-default to example.
914 * bison.texinfo (Freeing Discarded Symbols): Likewise.
915 (Bison Symbols): Add entry for %symbol-default.
916 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
917 (generic_symlist, generic_symlist_item): New nonterminals for creating
918 a list in which each item is a symbol, semantic type, or
919 %symbol-default.
920 (grammar_declaration): Use generic_symlist in %destructor and %printer
921 declarations instead of symbols.1 or an empty list.
922 (symbol_declaration, precedence_declaration, symbols.1): Update actions
923 for changes to symbol_list.
924 * src/reader.c: Update for changes to symbol_list.
925 * src/scan-code.l: Likewise.
926 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
927 * src/symlist.c, src/symlist.h: Extend such that a list node may
928 represent a semantic type or a %symbol-default in addition to just an
929 ordinary symbol. Add switched functions for setting %destructor's and
930 %printer's.
931 * tests/actions.at, tests/input.at: Add %symbol-default to all default
932 %destructor/%printer declarations.
933
3508ce36
JD
9342006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
935
936 Whether the default %destructor/%printer applies to a particular symbol
937 isn't a question of whether the user *declares* that symbol (in %token,
938 for example). It's a question of whether the user by any means
939 *defines* the symbol at all (by simply using a char token, for
940 example). $end is defined by Bison whereas any other token with token
941 number 0 is defined by the user. The error token is always defined by
942 Bison regardless of whether the user declares it with %token, but we
943 may one day let the user define error as a nonterminal instead.
944 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
945 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
946 the meaning of "user-defined".
947 * tests/actions.at (Default %printer and %destructor for user-declared
948 end token): Rename to...
949 (Default %printer and %destructor for user-defined end token): ...
950 this.
951
952 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
953 computation of whether to apply the default, don't maintain a list of
954 every Bison-defined symbol. Instead, just check for a first character
955 of '$', which a user symbol cannot have, and check for the error token.
956
9350499c
JD
9572006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
958
959 Don't apply the default %destructor or %printer to the error token,
960 $undefined, or $accept. This change fits the general rule that the
961 default %destructor and %printer are only for user-declared symbols,
962 and it solves several difficulties that are described in the new test
963 cases listed below.
964 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
965 * tests/actions.at (Default %printer and %destructor are not for error
966 or $undefined, Default %printer and %destructor are not for $accept):
967 New test cases.
968
4d7370cb
JD
9692006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
970
971 Allow %start after the first rule.
972 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
973 when parsing the first rule.
974 (check_and_convert_grammar): Search for it here after all grammar
975 declarations have been parsed. Skip midrules, which have dummy LHS
976 nonterminals.
977 * src/symtab.c (symbol_is_dummy): New function.
978 * src/symtab.h (symbol_is_dummy): Declare it.
979 * tests/input.at (%start after first rule): New test.
980
6d0ef4ec
JD
9812006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
982
983 Redo some of the previous commit: add back the ability to use
984 non-aliased/undeclared string literals since it might be useful to
985 those declaring %token-table.
986 * src/reader.c (check_and_convert_grammar): Undo changes in previous
987 commit: don't worry about complaints from symbols_pack.
988 * src/symtab.c (symbol_new, symbol_class_set,
989 symbol_check_alias_consistency): Undo changes in previous commit: count
990 each string literal as a new symbol and token, assign it a symbol
991 number, and don't complain about non-aliased string literals.
992 (symbols_pack): Since symbol_make_alias still does not decrement symbol
993 and token counts but does still set aliased tokens to the same number,
994 symbol_pack_processor now leaves empty slots in the symbols array.
995 Remove those slots.
996 * tests/regression.at (Undeclared string literal): Remove test case
997 added in previous commit since non-aliased string literals are allowed
998 again.
999 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
1000 remove unnecessary string literal declarations.
1001 * tests/sets.at (Firsts): Likewise.
1002
965537bc
JD
10032006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
1004
1005 Don't allow an undeclared string literal, but allow a string literal to
1006 be used before its declaration.
1007 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
1008 symbols_pack complained.
1009 * src/symtab.c (symbol_new): Don't count a string literal as a new
1010 symbol.
1011 (symbol_class_set): Don't count a string literal as a new token, and
1012 don't assign it a symbol number since symbol_make_alias does that.
1013 (symbol_make_alias): It's not necessary to decrement the symbol and
1014 token counts anymore. Don't assume that an alias declaration occurs
1015 before any uses of the identifier or string, and thus don't assert that
1016 one of them has the highest symbol number so far.
1017 (symbol_check_alias_consistency): Complain if there's a string literal
1018 that wasn't declared as an alias.
1019 (symbols_pack): Bail if symbol_check_alias_consistency failed since
1020 symbol_pack asserts that every token has been assigned a symbol number
1021 although undeclared string literals have not.
1022 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 1023 string literal): New test cases.
965537bc
JD
1024 (Characters Escapes, Web2c Actions): Declare string literals as
1025 aliases.
1026 * tests/sets.at (Firsts): Likewise.
1027
47aee066
JD
10282006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
1029
1030 In the grammar scanner, STRING_FINISH unclosed constructs and return
1031 them to the parser in order to improve error messages.
1032 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
1033 SC_BRACED_CODE, SC_PROLOGUE): Implement.
1034 * tests/input.at (Unclosed constructs): New test case.
1035 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
1036 seen.
1037
1038 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
1039 unused global.
1040
1f6b3679
JD
10412006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
1042
1043 Handle string aliases for character tokens correctly.
1044 * src/symtab.c (symbol_user_token_number_set): If the token has an
1045 alias, check and set its alias's user token number instead of its own,
1046 which is set to indicate the alias. Previously, every occurrence of
1047 the character token in the grammar overwrote that alias indicator with
1048 the character code.
1049 * tests/input.at (String aliases for character tokens): New test.
1050
219741d8
JD
10512006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
1052
1053 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
1054
11daa4e7
PE
10552006-08-11 Paul Eggert <eggert@cs.ucla.edu>
1056
1057 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
1058 to prevent failures when building on older platforms.
1059 Check for autopoint failure.
1060 Set XGETTEXT_OPTIONS to values that check for C format strings,
1061 so that translators are warned about them (this also helps
1062 prevent core dumps).
1063
1064 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
1065 function, since it simplifies our code a bit.
1066
1067 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
1068 rather than -W, so we don't get bogus warnings about sign comparisons.
1069 Add -Wpointer-arith, since that warning is useful (it reports code
1070 that does not conform to C89 and that some compilers reject).
1071 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
1072 since it's no longer needed.
1073
f9bfc42a
JD
10742006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
1075
1076 Clean up scanners a bit.
1077 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
1078 definitions so gcc won't warn when obstack_for_string is unused.
1079 * src/scan-code.l: config.h and system.h are already #include'd by
1080 scan-code-c.c, so get rid of them here.
1081 * src/scan-gram.l: Likewise.
1082 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
1083 definitions rather than duplicating the rest of it.
1084 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
1085
06e8700a
JD
10862006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
1087
1088 Suppress signed/unsigned comparison warnings for yycheck.
1089 * data/c.m4 (b4_safest_int_type): New macro.
1090 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
1091 a signed int type, cast it to b4_safest_int_type first.
1092 * data/yacc.c: Likewise.
1093 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
1094 also overwritten.
1095
9c437126
PE
10962006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
1097
1098 * doc/bison.texinfo: Fix some typos.
1099
284d8a13
PE
11002006-08-02 Paul Eggert <eggert@cs.ucla.edu>
1101
1102 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
1103 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
1104
1105 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
1106 the latest gnulib does this a different way.
1107 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
1108 translation was patched, so stop omitting it.
1109
ec5479ce
JD
11102006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1111
1112 Enable declaration of default %printer/%destructor. Make the parser
1113 use these for all user-declared grammar symbols for which the user does
1114 not declare a specific %printer/%destructor. Thus, the parser uses it
1115 for token 0 if the user declares it but not if Bison generates it as
1116 $end. Discussed starting at
1117 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
1118 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
1119 and
1120 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
1121 * NEWS (2.3+): Mention.
1122 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
1123 declare a %destructor for a mid-rule's semantic value. It's just
1124 impossible to declare one specific to it.
1125 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
1126 code. Describe default %destructor form.
1127 * src/parse-gram.y (grammar_declaration): Parse default
1128 %printer/%destructor declarations.
1129 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
1130 and symbol_destructor_location_get rather than accessing the destructor
1131 and destructor_location members of struct symbol.
1132 (symbol_printers_output): Likewise but for %printer's.
1133 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
1134 again.
1135 * src/symtab.c (default_destructor, default_destructor_location,
1136 default_printer, default_printer_location): New static global
1137 variables to record the default %destructor and %printer.
1138 (symbol_destructor_get, symbol_destructor_location_get,
1139 symbol_printer_get, symbol_printer_location_get): New functions to
1140 compute the appropriate %destructor and %printer for a symbol.
1141 (default_destructor_set, default_printer_set): New functions to set the
1142 default %destructor and %printer.
1143 * src/symtab.h: Prototype all those new functions.
1144 * tests/actions.at (Default %printer and %destructor): New test to
1145 check that the right %printer and %destructor are called, that they're
1146 not called for $end, and that $$ and @$ work correctly.
1147 (Default %printer and %destructor for user-declared end token): New
1148 test to check that the default %printer and %destructor are called for
1149 a user-declared end token.
1150 * tests/input.at (Default %printer and %destructor redeclared, Unused
1151 values with default %destructor): New tests to check related grammar
1152 warnings and errors.
1153
868d2d96
JD
11542006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1155
1156 Clean up handling of %destructor for the end token (token 0).
1157 Discussed starting at
1158 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
1159 and
1160 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
1161
1162 Make the skeletons consistent in how they pop the end token and invoke
1163 its %destructor.
1164 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
1165 state, which has token number 0, since this would invoke the
1166 %destructor for the end token.
1167 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
1168 until after shifting the end token, or else it won't be popped.
1169 * data/yacc.c (yyparse): Likewise.
1170
1171 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
1172 it's the end token. Upon termination, destroy an unshifted lookahead
1173 even when it's the end token.
1174 * data/lalr1.cc (yy::parser::parse): Likewise.
1175 * data/yacc.c (yyparse): Likewise.
1176
1177 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
1178 value warnings for the end token when the user gives the end token a
1179 %destructor.
1180
1181 * tests/actions.at (Printers and Destructors): Test all the above.
1182
62a9592d
PE
11832006-07-24 Paul Eggert <eggert@cs.ucla.edu>
1184
1185 Update to latest gnulib and gettext versions.
1186 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
1187 Add fopen-safer.
1188 (gnulib_files): Add m4/warning.m4. Don't worry about files
1189 overwritten by autopoint.
1190 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
1191 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
1192 rejects them.
1193 Don't use autoreconf; instead, invoke autopoint etc. by hand,
1194 so that we can remove the intl files at a better time.
1195 (intl_files_to_remove): Remove aclocal.m4, since it gets
1196 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
1197 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
1198 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
1199 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
1200 Remove datarootdir hack; no longer needed.
1201 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
1202 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
1203 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
1204 strdup.h.
1205 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
1206 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
1207
10d6970f
PE
12082006-07-20 Paul Eggert <eggert@cs.ucla.edu>
1209
1210 * bootstrap: Adjust to today's change to gnulib-tool by invoking
1211 it with --assume-autoconf='latest-stable'.
1212
50a33993
JD
12132006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
1214
1215 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
1216 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
1217 YYSTYPE' and `{'.
1218 * src/muscle_tab.h (muscle_grow): Replace the header comments with
1219 those from muscle_tab.c since the old ones are misleading.
1220
2ce4ed68
AD
12212006-07-13 Akim Demaille <akim@epita.fr>
1222
1223 Support %define "KEY" {VALUE}.
1224 * src/scan-code.h, src/scan-code.l (translate_action)
1225 (translate_rule_action, translate_symbol_action, translate_code):
1226 Return char *, not const char *.
1227 * src/parse-gram.y (declaration): Rename as...
1228 (prologue_declaration): this.
1229 (string_content): Remove this nonterminal, use STRING.
1230 (braceless, content, content.opt): New nonterminal.
1231 Use them.
1232 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
1233 as value.
1234 * src/scan-gram.l (getargs.h): Don't include it.
1235
db7e5eb5
PE
12362006-07-12 Paul Eggert <eggert@cs.ucla.edu>
1237
1238 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
1239 rather than a for-loop that declares a local bool variable. This
1240 should work around a compatibility problem with a Cray x1e C++
1241 compiler reported by Hung Nguyen in
1242 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
1243 The for-loop was introduced in the 2004-11-17 change but I don't
1244 know why it was needed.
1245
a5d80ba5
AD
12462006-07-12 Akim Demaille <akim@epita.fr>
1247
1248 * data/c.m4: Comment changes.
1249
23eb2a69
AD
12502006-07-10 Akim Demaille <akim@lrde.epita.fr>
1251
1252 * src/complain.c (error_message, ERROR_MESSAGE): New.
1253 To factor...
1254 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
1255 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
1256
ddc8ede1
PE
12572006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1258
1259 * NEWS: Instead of %union, you can define and use your own union type
1260 YYSTYPE if your grammar contains at least one <type> tag.
1261 Your YYSTYPE need not be a macro; it can be a typedef.
1262 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
1263 (Union Decl, Decl Summary): Document this.
1264 * data/glr.c (YYSTYPE): Implement this.
1265 * data/glr.cc (YYSTYPE): Likewise.
1266 * data/lalr1.cc (YYSTYPE): Likewise.
1267 * data/yacc.c (YYSTYPE): Likewise.
1268 * src/output.c (prepare): Output tag_seen_flag.
1269 * src/parse-gram.y (declaration, grammar_declaration):
1270 Use 'union_seen' rather than 'typed' to determine whether
1271 %union has been seen, since grammars can now be typed without
1272 %union.
1273 (symbol_declaration, type.opt, symbol_def):
1274 Keep track of whether a tag has been seen.
1275 * src/reader.c (union_seen, tag_seen): New vars.
1276 (typed): remove.
1277 * src/reader.h (union_seen, tag_seen, typed): Likewise.
1278 * src/scan-code.l (untyped_var_seen): New variable.
1279 (handle_action_dollar): Adjust to above changes.
1280 (handle_action_dollar, handle_action_at):
1281 Improve overflow checking for outlandish numbers.
1282 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
1283 avoid new diagnostics generated by above changes.
1284 * tests/regression.at (YYSTYPE typedef): Add test to check
1285 for type tags without %union.
1286
1287 * src/symlist.c (symbol_list_length): Return int, not unsigned
1288 int, since callers expect int. This may need to get revisited
1289 once we have proper integer overflow checking.
1290
1291 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
1292 object is now static.
1293
1294 * src/getargs.c (flags_argmatch): Return void, not int,
1295 to pacify ./configure --enable-gcc-warnings.
1296
1297 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
1298 since last_string is already defined to FLEX_PREFIX (last_string).
1299
7b42569e
AD
13002006-07-09 Akim Demaille <akim@lrde.epita.fr>
1301
1302 Implement --warnings/-W.
1303 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
1304 replaced by...
1305 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
1306 Adjust callers.
1307 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
1308 (warnings_args, warnings_types): New.
1309 (getargs, short_options, long_options): Accept -W/--warnings.
1310 Sort the options by alphabetical order, upper case letter right
1311 before its lower case.
1312
3b452f4e
JD
13132006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1314
1315 Change %merge result type clash warnings to errors. Discussed at
1316 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
1317 * src/reader.c (record_merge_function_type): Use complain_at.
1318 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1319 declared later): Update test case results.
1320
b8a41559
AD
13212006-07-09 Akim Demaille <akim@lrde.epita.fr>
1322
1323 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
1324 to be in alphabetical order.
1325 (trace_args): Spelling fixes.
1326
cd9e1ba2
PE
13272006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1328
1329 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
1330 so they don't collide with user-defined macros.
1331 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
1332 this was never guaranteed, and now that we're using gnulib stdint,
1333 which defines int_fast16_t to long int, the problem is exposed.
1334
cb48f191
PE
13352006-07-08 Paul Eggert <eggert@cs.ucla.edu>
1336
b8445a15
PE
1337 * data/c.m4 (b4_basename): Simplify a bit, since we don't
1338 need the full POSIX semantics (and weren't implementing them
1339 anyway).
1340
cb48f191
PE
1341 Adjust to Autoconf 2.60 and today's gnulib.
1342 * bootstrap (gnulib_modules): Add stdint.
1343 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
1344 no longer copies it.
1345 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
1346 since stdint needs the former and wcwidth (which is now required
1347 by mbswidth) needs the latter.
1348 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
1349 work around a compatibility glitch between gettext 0.14.6 and
1350 Autoconf 2.60.
1351 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
1352 Do not check for uintptr_t, since new stdint module does the right
1353 thing.
1354 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
1355 Add stdint.h, stdint_.h, wcwidth.h.
1356 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
1357 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
1358 stdint.m4, wchar_t.m4, wcwidth.m4.
1359 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
1360 usual order for ../lib/*.h files.
1361 (file_name_split): Use last_component, not base_name, to adjust
1362 to gnulib changes.
1363 * src/parse-gram.h: Include <strverscmp.h> in the usual order
1364 for ../lib/*.h files.
1365 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
1366 Define unconditionally, since we now assume the stdint module.
1367 * src/scan-skel.l: Include <dirname.h>.
1368 (BASE_QPUTS): Use last_component, not base_name.
1369 * src/system.h: Include <unlocked-io.h> in the usual order
1370 for ../lib/*.h files. Include <stdint.h> unconditionally,
1371 since we now use the stdint module.
1372 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
1373 HAVE_UINTPTR_T, since we now use the stdint module.
1374 (base_name): Remove decl, since files now include <dirname.h>
1375 to get the decl.
1376
cd48d21d
AD
13772006-07-08 Akim Demaille <akim@lrde.epita.fr>
1378
1379 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
1380 New, default to 1.
1381 * data/yacc.c, data/glr.c, data/location.cc: Use them.
1382 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
1383 default.
1384 * tests/calc.at: Adjust.
1385
8ec0a172
AD
13862006-07-08 Akim Demaille <akim@lrde.epita.fr>
1387
b8445a15 1388 * data/c.m4 (b4_basename): New.
8ec0a172
AD
1389 (b4_syncline): Also output the location of its invocation (from
1390 the skeleton).
1391 (b4_user_action, b4_define_user_action, b4_user_actions)
1392 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
1393 (b4_user_stype): New.
1394 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
1395
4a678af8
JD
13962006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1397
1398 In the grammar file, the first column is 1 not 0 on the first line as
1399 on every other line.
1400 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
1401 * tests/input.at (Torturing the Scanner): Update output.
1402
1403 * src/scan-gram.l (scanner_cursor): Declare it static.
1404
dd60572a
JD
14052006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1406
1407 In warnings, say "previous declaration" rather than "first
1408 declaration".
1409 * src/symtab.c (redeclaration): Do that here.
1410 * src/reader.c (record_merge_function_type): In the case of a result
1411 type clash, report the previous declaration rather than the very first
1412 one in the grammar file.
1413 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1414 declared later): Add a third declaration to check this behavior.
1415 * tests/input.at (Incompatible Aliases): Update output.
1416
2073e1b6
AD
14172006-06-27 Akim Demaille <akim@epita.fr>
1418
1419 * doc/Doxyfile.in: New.
1420 * doc/Makefile.am: Use it.
1421 * src/lalr.h, src/symtab.h: Initial doxygenation.
1422
8ee5b538
JD
14232006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1424
1425 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
1426 declared after the %merge. This continues the effort of the previous
1427 patch.
8ee5b538
JD
1428 * src/reader.c (get_merge_function): Don't set the merger type yet.
1429 (record_merge_function_type): New function for setting the merger type
1430 and checking for clashes.
1431 (grammar_current_rule_merge_set): Set the location of the %merge for
1432 the current rule.
1433 (packgram): Invoke record_merge_function_type for each rule now that
1434 all symbol type declarations have been parsed.
1435 * src/reader.h (merger_list.type_declaration_location): New member
1436 storing the location of the first %merge from which the type for this
1437 merging function was derived.
1438 * src/symlist.h (symbol_list.merger_declaration_location): New member
1439 storing the location of a rule's %merge, if any.
1440 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1441 declared later): New test to catch the error fixed by the above patch.
1442
ffa4ba3a
JD
14432006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1444
1445 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
1446 declarations appear after the rules. Discussed at
1447 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
1448 and
1449 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
1450 Don't mistake the type of $$ in a midrule to be that of its parent
1451 rule's $$.
ffa4ba3a
JD
1452 * src/reader.c (grammar_current_rule_end): Don't invoke
1453 grammar_rule_check yet since not all symbol declarations may have been
1454 parsed yet.
1455 (grammar_midrule_action): Likewise.
1456 Don't record whether the midrule's $$ has been used yet since actions
1457 haven't been translated yet.
1458 Record the midrule's parent rule and its RHS index within the parent
1459 rule.
1460 (grammar_current_rule_action_append): Don't translate the action yet
1461 since not all symbol declarations may have been parsed yet and, thus,
1462 warnings about types for $$, $n, @$, and @n can't be reported yet.
1463 (packgram): Translate the action and invoke grammar_rule_check now that
1464 all symbol declarations have been parsed.
1465 * src/scan-code.l (handle_action_dollar): Now that this is invoked
1466 after parsing the entire grammar file, the symbol list here in the case
1467 of a midrule is actually the midrule's empty RHS, so reference its
1468 parent rule's RHS where necessary.
1469 On the other hand, now that you can already know it's a midrule, you
1470 aren't forced to think $$ has the same type as its parent rule's $$.
1471 (handle_action_at): In the case of a midrule, reference the parent rule
1472 where necessary.
1473 * src/symlist.c (symbol_list_new): Initialize new midrule-related
1474 members.
1475 (symbol_list_length): Now that this is invoked after all rules have
1476 been parsed, a NULL symbol (rather than a NULL symbol list node)
1477 terminates a rule. symbol_list_print already does this correctly.
1478 * src/symlist.h (symbol_list.midrule_parent_rule,
1479 symbol_list.midrule_parent_rhs_index): New members so that midrules can
1480 remember their relationships with their parents.
1481 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
1482 fixed by the above patch.
1483 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
1484 implementing...
1485 (Unused values): ... this old test case and...
1486 (Unused values before symbol declarations): ... this new test case.
1487 This one is the same as `Unused values' except that all symbol
1488 declarations appear after the rules in order to catch the rest of the
1489 errors fixed by the above patch.
1490
e256e17f
JD
14912006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1492
300a1930
JD
1493 More cleanup.
1494 * src/reader.c (current_rule): Declare it static since it's no longer
1495 used outside this file.
1496 (grammar_current_rule_action_append): Remove redundant arguments from
1497 translate_rule_action invocation.
1498 * src/reader.h (current_rule): Remove this unused extern.
1499 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
1500 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 1501
381ecb06
JD
15022006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
1503
1504 Clean up yesterday's patch.
1505 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
1506 to...
1507 * src/reader.c (grammar_current_rule_action_append): ... here for
1508 consistency with grammar_current_rule_symbol_append.
1509 * tests/regression.at (Braced code in declaration in rules section):
1510 Make yyerror and yylex static as usual.
1511
4210cd0b
JD
15122006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
1513
1514 Fix bug that mistakes braced code in a declaration in the rules section
1515 to be a rule action. Mentioned at
1516 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
1517 * src/scan-gram.l: Move midrule action detection from the start of the
1518 scanning of any braced code to...
1519 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
1520 action. For readability, use $2 and @2 rather than the equivalent
1521 global variables.
1522 * tests/regression.at (Braced code in declaration in rules section):
1523 New test to catch the error fixed by the above patch.
1524
1525 Work on code readability some.
1526 * src/scan-code.l (current_rule): Get rid of this misleading and
1527 redundant declaration: it's actually extern'ed in reader.h.
1528 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
1529 translate_action): Add a rule argument and use it instead of the global
1530 current_rule.
1531 (translate_rule_action): This already receives current_rule through an
1532 argument, so pass it on to translate_action instead of assigning
1533 current_rule to current_rule.
1534 (translate_symbol_action, translate_code): Pass rule = NULL to
1535 translate_action.
1536
34f98f46
JD
15372006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
1538
1539 Rename %before-definitions to %start-header and %after-definitions to
1540 %end-header. Don't use these declarations to separate pre-prologue
1541 blocks from post-prologue blocks. Add new order-independent
1542 declarations %before-header and %after-header as alternatives to the
1543 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
1544 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
1545 * NEWS (2.3+): Update for these changes.
1546 * data/glr.c (b4_before_definitions): Update to...
1547 (b4_start_header): ... this.
1548 (b4_after_definitions): Update to...
1549 (b4_end_header): ... this.
1550 * data/glr.cc: Likewise.
1551 * data/lalr1.cc: Likewise.
1552 * data/yacc.c: Likewise.
1553 * doc/bison.texinfo (The prologue): Update names, and replace remaining
1554 prologue blocks with %*-header declarations.
1555 (Calc++ Parser): Likewise.
1556 (Bison Declaration Summary): Update names.
1557 (Bison Symbols): Update description.
1558 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
1559 (PERCENT_END_HEADER): ... this.
1560 (PERCENT_BEFORE_DEFINITIONS): Update to...
1561 (PERCENT_START_HEADER): ... this.
1562 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
1563 (declaration): Update token names and m4 macro names.
1564 When parsing %end-header and %start-header, invoke translate_code
1565 before muscle_code_grow, and no longer set global booleans to remember
1566 whether these declarations have been seen.
1567 Parse new %after-header and %before-header.
1568 * src/reader.c (before_definitions, after_definitions): Remove.
1569 (prologue_augment): Accept a new bool argument to specify whether to
1570 augment the pre-prologue or post-prologue.
1571 * src/reader.h (before_definitions, after_definitions): Remove these
1572 extern's.
1573 (prologue_augment): Add new bool argument.
1574 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
1575 (PERCENT_END_HEADER): ... this.
1576 (PERCENT_BEFORE_DEFINITIONS): Update to...
1577 (PERCENT_START_HEADER): ... this.
1578 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
1579 * tests/actions.at (Printers and Destructors): Update names.
1580
31b2b07e
JD
15812006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
1582
1583 Add comparison operators for C++ location classes. Discussed at
1584 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
1585 * data/c++.m4 (b4_define_location_comparison): New boolean %define
1586 declaration indicating whether filename_type has an operator==. If
1587 filename_type is `std::string', it defaults to `1', `0' otherwise.
1588 * data/location.cc: Iff b4_define_location_comparison is `1', add
1589 operator== and operator!= for class position and for class location.
1590
1591 Some minor fixes.
1592 * src/scan-action.l: Remove unused file.
1593 * src/symtab.c (symbol_printer_set): Use printer_location not
1594 destructor_location.
1595 * src/symtab.h (struct symbol): Replace incorrect source comment for
1596 printer members.
1597 * tests/input.at (Incompatible Aliases): Update output with correct
1598 printer location.
1599
9bc0dd67
JD
16002006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
1601
1602 Don't put the pre-prologue in the header file. For the yacc.c code
1603 file and the glr.c header and code files, move the pre-prologue before
1604 the token definitions. Add new %before-definitions and
1605 %after-definitions to declare code that will go in both the header file
1606 and code file. Discussed at
1607 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
1608 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
1609 and
1610 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
1611 * NEWS (2.3+): Describe these changes.
1612 * data/glr.c (b4_pre_prologue): Move from within to before...
1613 (b4_shared_declarations): ... this.
1614 Add new b4_before_definitions before b4_token_enums.
1615 Add new b4_after_definitions at the end.
1616 * data/glr.cc (b4_pre_prologue): Replace with...
1617 (b4_before_definitions): ... this in the header file.
1618 (b4_after_definitions): New near the end of the header file.
1619 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
1620 code file right before including the header file.
1621 (b4_before_definitions): New in the previous position of
1622 b4_pre_prologue in the header file.
1623 (b4_after_definitions): New near the end of the header file.
1624 * data/yacc.c: Clean up some m4 quoting especially in the header file.
1625 (b4_token_enums_defines): In the code file, move to right before
1626 YYSTYPE for consistency with the header file.
1627 (b4_before_definitions): New right before b4_token_enums_defines in
1628 both the header and code file.
1629 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
1630 header and code file.
1631 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
1632 of prologues for %union dependencies.
1633 (Bison Declaration Summary): In %defines description, mention the
1634 effect of %before-definitions and %after-definitions on the header
1635 file.
1636 (Calc++ Parser): Forward declare driver in a %before-definitions rather
1637 than in the pre-prologue so that make check succeeds.
1638 (Bison Symbols): Add entries for %before-definitions and
1639 %after-definitions.
1640 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
1641 %before-definitions.
1642 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
1643 (declaration): Parse those declarations and append to
1644 b4_before_definitions and b4_after_definitions, respectively.
1645 * src/reader.c (before_definitions, after_definitions): New bools to
1646 track whether those declarations have been seen.
1647 (prologue_augment): Add to the post-prologue if %union,
1648 %before-definitions, or %after-definitions has been seen.
1649 * src/reader.h (before_definitions, after_definitions): New extern's.
1650 * src/scan-gram.l: Scan the new declarations.
1651 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
1652 prologue block in a %before-definitions or a %after-definitions based
1653 on whether the %union is declared.
1654 * tests/regression.at (Early token definitions with --yacc, Early token
1655 definitions without --yacc): Move tests for token definitions into the
1656 post-prologue since token names are no longer defined in the
1657 pre-prologue.
1658
203b9274
AD
16592006-06-20 Akim Demaille <akim@epita.fr>
1660
1661 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
1662 (symbol_get): Use it.
1663 * src/parse-gram.y: Use it.
1664
a7ee59cf
JD
16652006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
1666
1667 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
1668 build succeeds when configured with --enable-gcc-warnings.
1669
5a2baae7
PE
16702006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1671
33ad1a9c
PE
1672 * src/parse-gram.y (char_name): New function.
1673 (CHAR, STRING, string_content): For %printer, properly escape.
1674 (ID): Prefer fputs to fprintf.
1675 (id): Reindent to be consistent with other rules.
1676 Properly quote char.
1677
5a2baae7
PE
1678 The Translation Project changed its way of publishing translations
1679 to maintainers. I haven't received any responses to my request
1680 for supporting the old way, or for documenting the new way. I
1681 have modified 'bootstrap' to use screen scraping
1682 (in this case, HTML scraping). This is unreliable and inelegant,
1683 but I don't see any better way. Yuck.
1684 * bootstrap (TP_URL, WGET_COMMAND): New vars.
1685 (get_translations): New function, which uses HTML scraping to
1686 deduce locations of latest translations.
1687 Use this function to grab both bison and bison-runtime .po files.
1688 Don't bother priming the pump for the runtime-po domain any more,
1689 as it's now translated better than bison is.
1690
58d7a1a1
AD
16912006-06-19 Akim Demaille <akim@epita.fr>
1692
1693 * src/scan-gram.l: No longer "parse" things after `%union' until
1694 `{'. Rather, return a single "%union" token.
1695 No longer make symbols: return strings, and leave the conversion
1696 to symbols to the parser.
1697 (SC_PRE_CODE, token_type): Remove.
1698 * src/parse-gram.y (%union): New field `character'.
1699 Sort tokens.
1700 (CHAR): New token.
1701 (ID, ID_COLON): Now that the scanner no longer makes them
1702 identifiers, adjust all uses to invoke symbol_get.
1703 (id_colon): New, wraps the conversion from string to symbol.
1704 (%union): Accept a possible union_name.
1705 (symbol): Now can be a char.
1706 * data/c.m4 (b4_union_name): Leave a default value.
1707 * data/glr.c, data/yacc.c: Use it.
1708
b931235e
JD
17092006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
1710
1711 For associating token numbers with token names for "yacc.c", don't use
1712 #define statements unless `--yacc' is specified; always use enum
1713 yytokentype. Most important discussions start at:
1714 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
1715 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
1716 and
1717 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
1718 * NEWS (2.3+): Mention.
1719 * data/c.m4 (b4_yacc_if): New.
1720 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
1721 token #define's.
1722 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
1723 on token name definitions.
1724 * src/getargs.c (usage): Capitalize `Yacc' in English.
1725 * src/output.c (prepare): Define b4_yacc_flag.
1726 * tests/regression.at (Early token definitions): Test that tokens names
1727 are defined before the pre-prologue not just before the post-prologue.
1728 Remove this test case and copy to...
1729 (Early token definitions with --yacc): ... this to test #define's.
1730 (Early token definitions without --yacc): ... and this to test enums.
1731
9e6e7ed2
PE
17322006-06-11 Paul Eggert <eggert@cs.ucla.edu>
1733
1734 * NEWS: Reword the post-2.3 change to not be so optimistic about
1735 removing the old "look-ahead" spelling.
1736 Update previous look-ahead/lookahead change reports.
1737 * REFERENCES: look-ahead -> lookahead (since that's
1738 what he actually wrote).
1739 * doc/refcard.tex: look ahead -> lookahead,
1740 look-ahead -> lookahead
1741
742e4900
JD
17422006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
1743
1744 For consistency, use `lookahead' instead of `look-ahead' or
1745 `look_ahead'. Discussed starting at
1746 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
1747 and then at
1748 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
1749 * NEWS: For the next release, note the change to `--report'.
1750 * TODO, doc/bison.1: Update English.
1751 * doc/bison.texinfo: Update English.
1752 (Understanding Your Parser, Bison Options): Document as
1753 `--report=lookahead' rather than `--report=look-ahead'.
1754 * src/conflicts.c: Update English in comments.
1755 (lookahead_set): Rename from look_ahead_set.
1756 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
1757 (resolve_sr_conflict): Rename local look_ahead_tokens to
1758 lookahead_tokens, and update other uses.
1759 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
1760 count_rr_conflicts, conflicts_free): Update uses.
1761 * src/getargs.c (report_args): Move "lookahead" before alternate
1762 spellings.
1763 (report_types): Update uses.
1764 (usage): For `--report' usage description, state `lookahead' spelling
1765 rather than `look-ahead'.
1766 * src/getargs.h (report.report_lookahead_tokens): Rename from
1767 report_look_ahead_tokens.
1768 * src/lalr.c: Update English in comments.
1769 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
1770 (state_lookahead_tokens_count): Rename from
1771 state_look_ahead_tokens_count.
1772 Rename local n_look_ahead_tokens to n_lookahead_tokens.
1773 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
1774 Rename local n_look_ahead_tokens to n_lookahead_tokens.
1775 Update other uses.
1776 Update English in output.
1777 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
1778 * src/print.c: Update English in comments.
1779 (lookahead_set): Rename from look_ahead_set.
1780 (print_reduction): Rename argument lookahead_token from
1781 look_ahead_token.
1782 (print_core, state_default_rule, print_reductions, print_results):
1783 Update uses.
1784 * src/print_graph.c: Update English in comments.
1785 (print_core): Update uses.
1786 * src/state.c: Update English in comments.
1787 (reductions_new): Update uses.
1788 (state_rule_lookahead_tokens_print): Rename from
1789 state_rule_look_ahead_tokens_print, and update other uses.
1790 * src/state.h: Update English in comments.
1791 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
1792 (state_rule_lookahead_tokens_print): Rename from
1793 state_rule_look_ahead_tokens_print.
1794 * src/tables.c: Update English in comments.
1795 (conflict_row, action_row): Update uses.
1796 * tests/glr-regression.at
1797 (Incorrect lookahead during deterministic GLR,
1798 Incorrect lookahead during nondeterministic GLR): Rename
1799 print_look_ahead to print_lookahead.
1800 * tests/torture.at: Update English in comments.
1801 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
1802 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
1803 (Many lookahead tokens): Update uses.
1804 * data/glr.c: Update English in comments.
1805 * lalr1.cc: Likewise.
1806 * yacc.c: Likewise.
1807 * src/conflicts.h: Likewise.
1808 * src/lalr.h: Likewise.
1809 * src/main.c: Likewise.
1810 * src/output.c: Likewise.
1811 * src/parse-gram.c: Likewise.
1812 * src/tables.h: Likewise.
1813 * tests/calc.at: Likewise.
1814
3c40d0b5
JD
18152006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
1816
1817 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
1818
5d278082
PE
18192006-06-07 Paul Eggert <eggert@cs.ucla.edu>
1820
1821 * TODO: Add request from Nelson H. F. Beebe to be able to install
1822 Bison without installing the yacc script.
1823
9e668899
JD
18242006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
1825
1826 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
1827 and yytext if they're already #define'd.
1828 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
1829 * src/scan-code-c.c: ... here.
1830 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
1831 <config.h>.
1832
0c8e079f
JD
18332006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
1834
1835 Get Bison to build again when configured with --enable-gcc-warnings.
1836 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
1837 missing #include's.
1838 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
1839 loc argument as it shadows a global.
1840 * src/scan-gram.l: Remove stray comma that prevents boundary_set
1841 invocation.
1842
1843 * src/.cvsignore: Add scan-code.c.
1844
2346344a
AD
18452006-06-07 Akim Demaille <akim@epita.fr>
1846
1847 * src/scan-gram.l: Move the "add a trailing ; to actions" code
1848 to...
1849 * src/scan-code.l: here.
1850 * tests/input.at (Torturing the Scanner): Fix another location
1851 error.
1852
4862bdfd
AD
18532006-06-07 Akim Demaille <akim@epita.fr>
1854
1855 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
1856
e9071366
AD
18572006-06-06 Akim Demaille <akim@epita.fr>
1858
1859 Extract the parsing of user actions from the grammar scanner.
1860 As a consequence, the relation between the grammar scanner and
1861 parser is much simpler. We can also split "composite tokens" back
1862 into simple tokens.
1863 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
1864 * src/scan-gram.l (add_column_width, adjust_location): Move to and
1865 rename as...
1866 * src/location.h, src/location.c (add_column_width)
1867 (location_compute): these.
1868 Fix the column count: the initial column is 0.
1869 (location_print): Be robust to ending column being 0.
1870 * src/location.h (boundary_set): New.
1871 * src/main.c: Adjust to scanner_free being renamed as
1872 gram_scanner_free.
1873 * src/output.c: Include scan-code.h.
1874 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
1875 Use boundary_set.
1876 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
1877 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
1878 which is now, again, a separate token.
1879 Adjust all dependencies.
1880 Whereever actions with $ and @ are used, use translate_code.
1881 (action): Remove this nonterminal which is now useless.
1882 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
1883 (grammar_current_rule_action_append): Use translate_code.
1884 (packgram): Bound check ruleno, itemno, and rule_length.
1885 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
1886 (last_string, last_braced_code_loc, max_left_semantic_context)
1887 (scanner_initialize, scanner_free, scanner_last_string_free)
1888 (gram_out, gram_lineno, YY_DECL_): Move to...
1889 * src/scan-gram.h: this new file.
1890 (YY_DECL): Rename as...
1891 (GRAM_DECL): this.
1892 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
1893 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
1894 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
1895 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
1896 Move these declarations, and...
1897 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
1898 these to...
1899 * src/flex-scanner.h: this new file.
1900 * src/scan-gram.l (rule_length, rule_length_overflow)
1901 (increment_rule_length): Remove.
1902 (last_braced_code_loc): Rename as...
1903 (gram_last_braced_code_loc): this.
1904 Adjust to the changes of the parser.
1905 Move all the handling of $ and @ into...
1906 * src/scan-code.l: here.
1907 * src/scan-gram.l (handle_dollar, handle_at): Remove.
1908 (handle_action_dollar, handle_action_at): Move to...
1909 * src/scan-code.l: here.
1910 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
1911 scan-code.h, scan-code-c.c, scan-gram.h.
1912 (EXTRA_bison_SOURCES): Add scan-code.l.
1913 (BUILT_SOURCES): Add scan-code.c.
1914 (yacc): Be robust to white spaces.
1915
1916 * tests/conflicts.at, tests/input.at, tests/reduce.at,
1917 * tests/regression.at: Adjust the column numbers.
1918 * tests/regression.at: Adjust the error message.
7891a7c4 1919
184e42f0
JD
19202006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
1921
1922 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
1923 Use Akim's wording from
1924 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
1925
7891a7c4
JD
19262006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
1927
1928 Between Bison releases, manually append `+' to the previous Bison
1929 release number, and use that as a signal to automatically print the
1930 ChangeLog's CVS Id keyword from --version. Discussed starting at
1931 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
1932 * ChangeLog: Add Id header.
1933 * configure.ac (AC_INIT): Append `+' to `2.3'.
1934 * src/.cvsignore: Add revision.c.
1935 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
1936 (BUILT_SOURCES): Add revision.c.
1937 (revision.c): New target rule. This file defines a new global variable
1938 named revision. It initializes it with either the Id from ChangeLog
1939 or, if VERSION doesn't contain `+', with the empty string.
1940 * src/getargs.c (version): Print the value of revision.
1941 * src/revision.h: Extern revision.
1942
4ad3ed84
PE
19432006-06-05 Paul Eggert <eggert@cs.ucla.edu>
1944
1945 * NEWS: Version 2.3.
1946 * configure.ac (AC_INIT): Likewise.
1947
02103984
PE
19482006-05-30 Paul Eggert <eggert@cs.ucla.edu>
1949
1950 * data/glr.c (YYRECOVERING): Define to be a function-like macro
1951 with no arguments, not as an object-like macro. This is for
1952 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
1953 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
1954 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
1955 Document this.
1956
2c08afa5
JD
19572006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
1958
1959 * src/getargs.c (usage): Back out yesterday's modification of the
1960 --help output so that we don't have to wait for translation before
1961 releasing 2.3.
1962
6077da58
PE
19632006-05-29 Paul Eggert <eggert@cs.ucla.edu>
1964
1965 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
1966 Problem reported by Akim Demaille.
1967
2a26b6c2
JD
19682006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
1969
1970 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
1971
aefef0d6
PE
19722006-05-26 Paul Eggert <eggert@cs.ucla.edu>
1973
1974 * data/yacc.c (yy_reduce_print): Omit trailing white space in
1975 generated source code. Problem reported by Frans Englich in
1976 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
1977
fcd8e201
PE
19782006-05-22 Paul Eggert <eggert@cs.ucla.edu>
1979
1980 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
1981 shell, not within 'make', so that 'make' by an ordinary builder
1982 (using GNU make) does not worry about configuring gzip. This also
1983 works around a bug reported independently by Keith Thompson and by
1984 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
1985 stderr rather than stdout, messing up the build logs.
1986
7b5cdcbd
JD
19872006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
1988
1989 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
1990 to make sure that YYID will never be unused. This fixes a 'make
1991 maintainer-check' failure caused by the recent changes to the 'Trivial
1992 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
1993 not used.
1994 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
1995
5ad0a449
JD
19962006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
1997
1998 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
1999 state before an empty RHS is always resolved here. Only the location
2000 of that state is guaranteed to be resolved, and that's enough. This
2001 fixes the remaining bug reported by Derek M. Jones in
2002 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
2003 * tests/glr-regression.at (Uninitialized location when reporting
2004 ambiguity): Test the above case.
2005 Also, the embedded comments in this test case claim it checks the case
2006 of an empty RHS that has inherited the initial location. However, the
2007 corresponding LHS was already resolved, so yyresolveLocations didn't
2008 actually have reason to modify it. Fix this by forcing
2009 nondeterministic operation at the beginning of the parse.
2010
50cce58e
PE
20112006-05-20 Paul Eggert <eggert@cs.ucla.edu>
2012
2013 * data/c.m4 (b4_yy_symbol_print_generate):
2014 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
2015 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
2016 of the bugs reported today by Derek M Jones in
2017 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
2018 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
2019 defined to be a type name without parens or brackets.
2020 (Location Type): Similarly for YYLTYPE.
2021 * tests/regression.at (Trivial grammars): Put in a test for this
2022 bug that will be caught by 'make maintainer-check' (though not,
2023 alas, by 'make check' unless your compiler is picky).
2024
ab8d9dc5
PE
20252006-05-19 Paul Eggert <eggert@cs.ucla.edu>
2026
0d2c8934 2027 * NEWS: Version 2.2.
ab8d9dc5
PE
2028 * configure.ac (AC_INIT): Likewise.
2029
9138c575
JD
20302006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
2031
2032 * data/glr.c (yyreportTree): Make room in yystates for the state
2033 preceding the RHS. This fixes the segmentation fault reported by Derek
2034 M. Jones in
2035 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
2036 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
2037 to the user. Reported for yyreportTree by Derek M. Jones later in the
2038 same thread.
2039 * THANKS: Add Derek M. Jones.
2040 Update my email address.
2041 Fix typo in Steve Murphy's name.
2042
276f48df
PE
20432006-05-14 Paul Eggert <eggert@cs.ucla.edu>
2044
d6645148
PE
2045 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
2046 checking against YYLAST that caused the parser to miss a potential
2047 alternative in its diagnostic.
2048 Problem reported by Maria Jose Moron Fernandez in
2049 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
2050 * data/lalr1.cc (yysyntax_error_): Likewise.
2051 * data/yacc.c (yysyntax_error): Likewise.
2052 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
2053 tokens, in case we run into an older C compiler.
2054 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
2055 Use them to check for the off-by-one error fixed above.
2056
276f48df
PE
2057 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
2058 YYSIZE_T, not size_t.
2059 * tests/regression.at (Trivial grammars): New test, to catch
2060 the error fixed by the above patch.
2061
cd8b5791
AD
20622006-05-14 Akim Demaille <akim@lrde.epita.fr>
2063
2064 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
2065 scheme.
2066 Reported by Steve Murphy.
2067
34376418
AD
20682006-05-14 Akim Demaille <akim@lrde.epita.fr>
2069
2070 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
2071 * data/glr.cc: b4_location_flag is now b4_locations_flag.
2072
327afc7c
AD
20732006-05-14 Akim Demaille <akim@lrde.epita.fr>
2074
2075 Implement --trace=m4.
2076 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
2077 * src/output.c (output_skeleton): When set, pass -dV to m4.
2078
2079 Factor the handling of flags in m4.
2080 * src/output.c (prepare): Rename the muscle names debug, defines,
2081 error_verbose to debug_flag, defines_flag, error_verbose_flag.
2082 * data/c.m4: Adjust.
2083 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
2084 Use b4_define_flag_if to define other b4_FLAG_if macros.
2085 (b4_location_if): As a consequence, rename as...
2086 (b4_locations_if): this, for consistency.
2087 Adjust all the skeletons.
2088
ba9ecd19
AD
20892006-05-14 Akim Demaille <akim@lrde.epita.fr>
2090
2091 * etc/bench.pm: Shorten bench names.
2092
4e83ea15
AD
20932006-05-14 Akim Demaille <akim@lrde.epita.fr>
2094
2095 * src/output.h, src/output.c (error_verbose): Move to...
2096 * src/getargs.h, src/getargs.c: here.
2097 Sort the flags.
2098 Adjust dependencies.
2099
6e93d810
PE
21002006-05-13 Paul Eggert <eggert@cs.ucla.edu>
2101
2102 * data/c.m4 (b4_copyright): Put the special exception for Bison
2103 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
2104 uses changed. Suggested by Akim Demaille. Also, wrap the
2105 copyright notice, in case it is longer than 80 columns. Replace
2106 comma by newline after title.
6e93d810 2107
eaea13f5
PE
21082006-05-11 Paul Eggert <eggert@cs.ucla.edu>
2109
2110 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
2111 incompatibility, not a bug. Mention that it wasn't fixed as of
2112 flex 2.5.33.
2113
3cf084ec
AD
21142006-05-11 Akim Demaille <akim@lrde.epita.fr>
2115
2116 * examples/extexi: Enforce the precedence of concatenation over
2117 >>.
0a9f1c7d 2118 Reported by Tommy Nordgren.
3cf084ec 2119
32c96bd7
AD
21202006-05-11 Akim Demaille <akim@lrde.epita.fr>
2121
2122 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
2123 with the member "token".
f94705b2 2124 Reported by Martin Nylin.
32c96bd7 2125
eaea13f5
PE
21262006-05-08 Paul Eggert <eggert@cs.ucla.edu>
2127
2128 * data/glr.c: Switch to Bison 2.2 special-exception language in
2129 the copyright notice. Use more-regular format for titles and
2130 copyright notices.
2131 * data/glr.cc: Likewise.
2132 * data/location.cc: Likewise.
2133 * data/yacc.cc: Likewise.
2134 * doc/bison.texinfo (Conditions): Document this.
2135 * NEWS: likewise. Upgrade version to 2.2.
2136
6e2d1146
AD
21372006-04-27 Akim Demaille <akim@lrde.epita.fr>
2138
2139 * data/glr.cc: Remove dead code.
2140
47671055
PE
21412006-04-25 Paul Eggert <eggert@cs.ucla.edu>
2142
2143 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
2144 that variable and the line breaks the bootstrap. Problem reported
2145 by Juan M. Guerrero.
2146
ed2e6384
AD
21472006-04-24 Akim Demaille <akim@lrde.epita.fr>
2148
2149 * doc/bison.texinfo (Multiple start-symbols): New.
2150
3cedc2dc
AD
21512006-04-24 Akim Demaille <akim@lrde.epita.fr>
2152
2153 * etc/README, etc/bench.pl: New.
2154
b2ddc3f3
AD
21552006-04-03 Akim Demaille <akim@lrde.epita.fr>
2156
2157 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
2158 rule.
2159 Reported by Mickael Labau.
2160 * tests/input.at (Torturing the Scanner): Test it.
2161
91e3ac9a
PE
21622006-03-16 Paul Eggert <eggert@cs.ucla.edu>
2163
2164 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
2165 Problem reported by Bob Rossi.
2166
21672006-03-13 Paul Eggert <eggert@cs.ucla.edu>
2168
2169 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
2170 and didn't really work.
2171 For the index, use @ifnotinfo, not @iftex.
2172 Minor cleanups of spacing and terminology.
2173
5cf61e93
AD
21742006-03-12 Akim Demaille <akim@lrde.epita.fr>
2175
2176 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
2177 of AT_NAME_PREFIX when %name-prefix is not used.
2178
aa08666d
AD
21792006-03-12 Akim Demaille <akim@lrde.epita.fr>
2180
2181 Apply --prefix to C++ skeletons too: they change the namespace.
2182 The test suite already exercize these cases.
2183 * data/c++.m4 (b4_namespace): New.
2184 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
2185 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
2186 * data/yacc.c, data/glr.c: Remove a useless `[]'.
2187 * doc/bison.texinfo: Document it.
2188 (Option Cross Key): Use @multitable in all formats. It looks
2189 nicer, even in TeX outputs.
2190 (Rules): Use the same code whatever the output type is.
2191 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
2192 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
2193 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 2194
45567173
AD
21952006-03-10 Akim Demaille <akim@lrde.epita.fr>
2196
2197 * TODO: Remove dead items.
2198
e9d8f881 21992006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
2200
2201 * doc/FAQ: Remove, merged into...
2202 * doc/bison.texinfo (FAQ): this.
2203 * doc/Makefile.am (EXTRA_DIST): Adjust.
2204
c095d689
AD
22052006-03-10 Akim Demaille <akim@lrde.epita.fr>
2206
2207 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
2208 even if empty.
2209 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
2210 * doc/bison.texinfo (Calc++ Scanner): Use it.
2211
6e0f8287
PE
22122006-03-09 Paul Eggert <eggert@cs.ucla.edu>
2213
2214 Fix two nits reported by twlevo, plus one more that I discovered.
2215
2216 * src/assoc.h (assoc_to_string): Give a name to the arg, as
2217 this is the usual Bison style.
2218 * src/location.h (location_print): Likewise.
2219
2220 * src/reader.h (token_name): Likewise.
2221
d6b771c3
PE
22222006-03-08 Paul Eggert <eggert@cs.ucla.edu>
2223
2224 Fix some nits reported by twlevo.
2225 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
2226 and "POSIX". Use more-modern syntax for URLs. Mention C++
2227 and ask for Java. Don't hardwire OS version numbers. Add
2228 copyright notice.
2229 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
2230 * src/conflicts.c (solved_conflicts_obstack): Now static.
2231
1e137b71
JD
22322006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2233
2234 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
2235 page. Say "you can use it" not "you may use it" as on the web page;
2236 we're describing capabilities not granting permission.
2237
73f2e47e
PE
22382006-03-06 Paul Eggert <eggert@cs.ucla.edu>
2239
6d05403d
PE
2240 * data/glr.c (yyresolveLocations): Rename local variables to avoid
2241 shadowing warnings. Use usual patter for iterating through RHS.
2242 * tests/glr-regression.at
2243 (Uninitialized location when reporting ambiguity):
2244 Modify yylex so that it uses its argument, rather than trying
2245 to rely on ARGSUSED (which doesn't work for gcc with warnings).
2246 const char -> char const.
2247
73f2e47e
PE
2248 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
2249 Don't use tabs inside commands; it messes up 'ps'.
2250 Problem reported by twlevo.
2251
8710fc41
JD
22522006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
2253
2254 * tests/glr-regression.at (Uninitialized location when reporting
2255 ambiguity): New test case.
2256 * data/glr.c (yyresolveLocations): New function, which uses
2257 YYLLOC_DEFAULT.
2258 (yyresolveValue): Invoke yyresolveLocations before reporting an
2259 ambiguity.
2260 * doc/bison.texinfo (Default Action for Locations): Note
2261 YYLLOC_DEFAULT's usage for ambiguity locations.
2262 (GLR Semantic Actions): Cross-reference those notes.
2263
ae952af2
JD
22642006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
2265
2266 * tests/glr-regression.at (Leaked semantic values when reporting
2267 ambiguity): Remove unnecessary union and type declarations.
2268 (Leaked lookahead after nondeterministic parse syntax error): New test
2269 case.
2270 * data/glr.c (yyparse): Check for zero stacks remaining before
2271 attempting to shift the lookahead so that you don't lose it.
2272
35ee866a
JD
22732006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2274
2275 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
2276 * tests/glr-regression.at (Leaked semantic values when reporting
2277 ambiguity): New test case.
2278 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
2279 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
2280 now unnecessary yystackp parameter.
2281 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
2282 destructors can be called.
2283
2284 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
2285 in existing testcases.
2286
520181ab
JD
22872006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2288
2289 Don't leak semantic values for parent RHS when a user action cuts the
2290 parser, and clean up related code a bit.
2291 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
2292 cuts parse): Rename to...
2293 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
2294 for leaked parent RHS values.
2295 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
2296 between an unresolved state (non-empty chain of semantic options) and
2297 an incomplete one (signaled by an empty chain).
ae952af2 2298 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
2299 successfully or unsuccessfully resolved yyGLRState to...
2300 (yyresolveValue): ... here so that yyresolveValue always leaves a
2301 yyGLRState with consistent data and thus is easier to understand.
2302 Remove the yyvalp and yylocp parameters since they are always just
2303 taken from the yys parameter. When reporting a discarded merged value
2304 in debugging output, note that it is incompletely merged. Document the
2305 interface.
2306 (yyresolveAction): If resolving any of the RHS states fails, destroy
2307 them all rather than leaking them. Thus, as long as user actions are
2308 written to clean up the RHS correctly, yyresolveAction always cleans up
2309 the RHS of a semantic option. Document the interface.
2310
18d9185c
PE
23112006-02-27 Paul Eggert <eggert@cs.ucla.edu>
2312
2313 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
2314 led to a segmentation fault in GNU Pascal. Problem reported
2315 by Waldek Hebisch.
2316
841a7737
JD
23172006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
2318
2319 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
2320 mid-rule action inside a nonterminal symbol in order to declare a
2321 destructor for its semantic value.
2322
fc3f467f
PE
23232006-02-16 Paul Eggert <eggert@cs.ucla.edu>
2324
2325 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
2326 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
2327 __cplusplus && ! defined _STDLIB_H && !
2328 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
2329 defined free))]: Include <stdlib.h> rather than rolling our own
2330 declarations of malloc and free, to avoid problems with
2331 incompatible declarations (using 'throw') C++'s stdlib.h. This
2332 should fix Debian bug 340012
2333 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
2334 reported by Guillaume Melquiond.
2335
a3af26dd
PE
23362006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2337
4d7bc38c
PE
2338 * NEWS: Clarify symbols versus types in unused-value warnings.
2339
a3af26dd
PE
2340 * configure.ac (AC_INIT): Bump version number.
2341
4e26c69e
PE
23422006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2343
2344 * NEWS: Version 2.1a.
2345 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
2346 since C99 requires this.
2347
498e897c
PE
23482006-02-11 Paul Eggert <eggert@cs.ucla.edu>
2349
2350 * m4/c-working.m4: New file.
2351 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
2352
57bb17ca
PE
23532006-02-10 Paul Eggert <eggert@cs.ucla.edu>
2354
2355 * Makefile.maint: Merge from coreutils.
2356
0be105dc
PE
23572006-02-09 Paul Eggert <eggert@cs.ucla.edu>
2358
2359 More portability fixes for problems summarized by Nelson H. F. Beebe.
2360
2361 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
2362 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
2363 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
2364 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
2365 messes up because C++ code is compiled in 32-bit mode but linked
2366 in 64-bit mode.
2367
6fc0c024
PE
23682006-02-08 Paul Eggert <eggert@cs.ucla.edu>
2369
2370 More portability fixes for problems summarized by Nelson H. F. Beebe.
2371
7870f699
PE
2372 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
2373 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
2374
6fc0c024
PE
2375 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
2376 nodist_PROGRAMS, since we don't need to actually compile the
2377 example if we're just doing a plain 'make'. This avoids bothering
2378 the installer unnecessarily about problems due to weird C++
2379 compilers.
2380
fe6c2fde
PE
23812006-02-06 Paul Eggert <eggert@cs.ucla.edu>
2382
2383 More portability fixes for problems summarized by Nelson H. F. Beebe.
2384
2385 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
2386 than #include "...", and compile with -I'.'. The old method was
2387 not portable, according to Posix and the C standard, and it does
2388 not work with Sun C 5.7, where previous #line directives affect
2389 the working directory used in later #include "..." directives.
2390
927b425b
JMG
23912006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2392
2393 Various DJGGP specific issues in /djgpp
2394
d9735e9e
PE
23952006-02-02 Paul Eggert <eggert@cs.ucla.edu>
2396
2397 More portability fixes for problems summarized by Nelson H. F. Beebe.
2398
2399 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
2400 '#include <map>' works and that you can apply ++ to iterators.
2401
5a6755af
PE
24022006-02-01 Paul Eggert <eggert@cs.ucla.edu>
2403
67a0dc4f
PE
2404 Work around portability problems summarized by Nelson H. F. Beebe in
2405 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
2406
8c86f0ef
PE
2407 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
2408 that '#include <string>' works.
2409
de35dd59
PE
2410 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
2411 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
2412 "warning: sorry: semantics of inline function static data `const
2413 unsigned char translate_table[262]' are wrong (you'll wind up with
2414 multiple copies)".
2415
67a0dc4f
PE
2416 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
2417 or, xor to not_, and_, or_, and xor_, respectively. This works
2418 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
2419 random system header somewhere that includes the equivalent of
2420 <iso646.h>.
2421
5a6755af
PE
2422 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
2423 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 2424 Suite Version 2.0.
5a6755af 2425
3f001415
JD
24262006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
2427
2428 During deterministic GLR operation, user actions should be able to
2429 influence the parse by changing yychar. To make this easier to fix and
2430 to make glr.c easier to evolve in general, don't maintain yytoken in
2431 parallel with yychar; just compute yytoken when needed.
2432 * tests/glr-regression.at (Incorrect lookahead during deterministic
2433 GLR): Check that setting yychar in a user action has the intended
2434 effect.
2435 * data/glr.c (yyGLRStack): Remove yytokenp member.
2436 (yyclearin): Don't set *yytokenp.
2437 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
2438 yychar rather than *yytokenp to determine the current lookahead.
2439 Compute yytoken locally when needed.
2440 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
2441 point to.
2442
2443 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
2444 after `--report' documentation.
2445
e2a8c0f5
PE
24462006-01-30 Paul Eggert <eggert@cs.ucla.edu>
2447
2448 * src/parse-gram.y (grammar_declaration): Location of printer
2449 symbol is @1, not list->location. Bug reported by twlevo.
2450 * tests/input.at (Incompatible Aliases): Adjust to above change.
2451
6b702268
PE
24522006-01-29 Paul Eggert <eggert@cs.ucla.edu>
2453
27622431
PE
2454 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
2455 all the test at once. This makes the output easier to read in the
2456 normal case.
2457
6b702268
PE
2458 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
2459 got from <http://bro-ids.org/download.html>. The bug is that
2460 when two actions appeared in succession, the second one was
2461 scanned before the first one was added to the grammar rule
2462 as a midrule action. Bison then output the incorrect warning
2463 "parse.y:905.17-906.36: warning: unused value: $3".
2464 * src/parse-gram.y (BRACED_CODE, action): These are no longer
2465 associated with a value.
2466 (rhs): Don't invoke grammar_current_rule_action_append.
2467 (action): Invoke it here instead.
2468 * src/reader.c (grammar_midrule_action): Now extern.
2469 (grammar_current_rule_action_append): Don't invoke
2470 grammar_midrule_action; that is now the scanner's job.
2471 * src/reader.h (last_string, last_braced_code_loc):
2472 (grammar_midrule_action): New decls.
2473 * src/scan-gram.l (last_string): Now extern, sigh.
2474 (last_braced_code_loc): New extern variable.
2475 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
2476 rule already has an action.
2477 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
2478 * tests/input.at (AT_CHECK_UNUSED_VALUES):
2479 Add some tests to check that the above changes fixed the bug.
2480
d40ba6c2
PE
24812006-01-27 Paul Eggert <eggert@cs.ucla.edu>
2482
2483 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
2484 All used changed. Check whether the symbol has a destructor,
2485 not whether it is typed.
2486 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
2487 that the values are still reported as unused. All line numbers
2488 adjusted.
2489
401aace6
PE
24902006-01-23 Paul Eggert <eggert@cs.ucla.edu>
2491
2492 Work around a bug in bro 0.8, which underparenthesizes its
2493 definition of YYLLOC_DEFAULT.
2494 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
2495 their arguments.
2496 * data/lalr1.cc: Likewise.
2497 * data/yacc.cc: Likewise.
2498
06f01bc4
PE
24992006-01-22 Paul Eggert <eggert@cs.ucla.edu>
2500
401aace6
PE
2501 Work around a bug in Pike 7.0, and give the Pike folks a
2502 better way to override the usual int widths.
2503 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
2504 user can override the types.
2505 (short): #undef, to work around a bug in Pike 7.0.
2506 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
2507 (union yyalloc.yyss): Use yytype_int16 rather than short.
2508 All uses changed.
2509 (yysigned_char): Remove.
2510 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
2511 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
2512 * tests/regression.at (Web2c Actions): Adjust to above changes.
2513
2514 * src/reader.c (check_and_convert_grammar): New function.
2515 (reader): Close the input file even if something went wrong during
2516 parsing. Minor file descriptor leak reported by twlevo.
2517
06f01bc4
PE
2518 * src/assoc.c (assoc_to_string): Use a default: abort (); case
2519 to pacify gcc -Wswitch-default.
2520 * src/scan-gram.l (adjust_location): Use a default: break; case
2521 to pacify gcc -Wswitch-default.
2522 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
2523 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
2524 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
2525 Move these decls to scan-skel.l, since they don't need to be
2526 visible elsewhere.
2527 * src/scan-skel.l: Accept the above decls.
2528 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
2529 is used.
2530
02650b7f
PE
25312006-01-21 Paul Eggert <eggert@cs.ucla.edu>
2532
2533 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
2534 since we don't want to insist on a version number at the start
2535 of the changelog every time.
2536 * Makefile.maint: Sync from coreutils a bit better.
2537 (sc_trailing_blank): Renamed from sc_trailing_space.
2538 All uses changed.
2539 (sc_no_if_have_config_h, sc_require_config_h):
2540 (sc_prohibit_assert_without_use): New rules.
2541 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
2542 (sc_dd_max_sym_length): Fix leading spaces in rule.
2543 (sc_system_h_headers): Prefix with @.
2544 (sc_useless_cpp_parens, m4-check): Output line numbers.
2545 (changelog-check): Allow version only in head.
2546 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
2547 satisfy new Makefile.maint rule.
2548 * data/glr.c: Likewise.
2549 * data/glr.cc: Likewise.
2550 * data/lalr1.cc: Likewise.
2551 * data/yacc.c: Likewise.
2552 * lib/ebitsetv.c: Likewise.
2553 * lib/lbitset.c: Likewise.
2554 * lib/subpipe.c: Likewise.
2555 * lib/timevar.c: Likewise.
2556 * src/system.h: Likewise.
2557 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
2558 * djgpp/Makefile.maint: Add copyright notice.
2559 * djgpp/README.in: Likewise.
2560 * djgpp/config.bat: Likewise.
2561 * djgpp/config.site: Likewise.
2562 * djgpp/config_h.sed: Likewise.
2563 * djgpp/djunpack.bat: Likewise.
2564 * djgpp/config.sed: Fix copyright notice to match standard format.
2565 * djgpp/subpipe.h: Likewise.
2566 * lib/bitsetv-print.c: Likewise.
2567 * lib/bitsetv.c: Likewise.
2568 * lib/subpipe.h: Likewise.
2569 * lib/timevar.c: Likewise.
2570 * lib/timevar.h: Likewise.
2571 * djgpp/subpipe.c: Use standard recipe for config.h.
2572 * lib/abitset.c: Likewise.
2573 * lib/bitset.c: Likewise.
2574 * lib/bitset_stats.c: Likewise.
2575 * lib/bitsetv-print.c: Likewise.
2576 * lib/bitsetv.c: Likewise.
2577 * lib/ebitsetv.c: Likewise.
2578 * lib/get-errno.c: Likewise.
2579 * lib/lbitset.c: Likewise.
2580 * lib/subpipe.c: Likewise.
2581 * lib/timevar.c: Likewise.
2582 * lib/vbitset.c: Likewise.
2583 * tests/local.at: Likewise.
2584 * src/scan-gram.l: Don't include verify.h, since system.h does
2585 that for us.
2586 * .x-sc_require_config_h: New file.
2587 * .x-sc_unmarked_diagnostics: New file.
2588
287c78f6
PE
25892006-01-20 Paul Eggert <eggert@cs.ucla.edu>
2590
287c78f6
PE
2591 Be a bit more systematic about using 'abort'.
2592 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
2593 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
2594 Put 'default: abort ();' before some other case, to satisfy older
2595 pedantic compilers.
2596 * lib/bitset_stats.c (bitset_stats_init): Likewise.
2597 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
2598 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
2599 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
2600 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
2601 (get_decision_str, get_orientation_str, get_node_alignment_str):
2602 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
2603 (get_linestyle_str, get_arrowstyle_str): Likewise.
2604 * src/conflicts.c (resolve_sr_conflict):
2605 Use a default case rather than one for the one remaining enum
2606 value, to catch invalid enum values as well.
2607 * src/lalr.c (set_goto_map, map_goto):
2608 Prefer "assert (FOO);" to "if (!FOO) abort ();".
2609 * src/nullable.c (nullable_compute, token_definitions_output):
2610 Likewise.
2611 * src/reader.c (packgram, reader): Likewise.
2612 * src/state.c (transitions_to, state_new, state_reduction_find):
2613 Likewise.
2614 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
2615 (symbol_pack): Likewise.
2616 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
2617 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
2618 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
2619 * src/system.h: Don't include <assert.h>.
2620 (assert): New macro.
2621
2622 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
2623 (Destructor Decl, Parser Function, Pure Calling):
2624 Describe rules for braces inside C code more carefully.
287c78f6 2625
c66dfadd
PE
26262006-01-19 Paul Eggert <eggert@cs.ucla.edu>
2627
c21493b8
PE
2628 Fix some porting glitches found by Nelson H. F. Beebe.
2629 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
2630 compilers that don't understand that abort () does not return.
2631 * src/state.c (transitions_to): Likewise.
2632 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
2633 that '#include <cstdlib>' works.
2634 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
2635 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
2636 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
2637 for the benefit of some pre-C99 compilers.
2638
b6e3facf
PE
2639 * bootstrap: Undo changes to gnulib files that autoreconf made.
2640
c66dfadd
PE
2641 Minor fixups to get 'make maintainer-check' to work.
2642 * configure.ac: Don't use -Wnested-externs, as it's incompatible
2643 with the new verify.h implementation.
2644 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
2645 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
2646 * data/yacc.c (YYUSE): Likewise.
2647 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
2648 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
2649 * src/parse-gram.y (declaration): Don't pass a string constant
2650 to a function that expects char *, since GCC might complain
2651 about the constant value.
2652 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
2653 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
2654 before #defining them.
2655 * tests/glr-regression.at
2656 (Incorrectly initialized location for empty right-hand side in GLR):
2657 In yyerror, use the msg arg.
2658 (Corrupted semantic options if user action cuts parse):
2659 (Incorrect lookahead during deterministic GLR):
2660 (Incorrect lookahead during nondeterministic GLR):
2661 Don't name a local var 'index'; it shadows string.h's 'index'.
2662
ed94ef2a
AD
26632006-01-19 Akim Demaille <akim@epita.fr>
2664
2665 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
2666 location, not just parts of it.
2667
e9ad4aec
PE
26682006-01-18 Paul Eggert <eggert@cs.ucla.edu>
2669
d6ca7905
PE
2670 * NEWS: Document the fact that multiple %unions are now allowed.
2671 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
2672 * TODO: This feature is now implemented, so remove it from
2673 the wishlist.
d6ca7905 2674
ef1b70e0
PE
2675 * Makefile.maint: Merge with coreutils Makefile.maint.
2676 (CVS_LIST): Use build-aux version if available.
2677 (VERSION_REGEXP): New macro.
2678 (syntax-check-rules): Add sc_no_if_have_config_h,
2679 sc_prohibit_assert_without_use, sc_require_config_h,
2680 sc_useless_cpp_parens.
2681 (sc_obsolete_symbols): Check for O_NDELAY.
2682 (sc_dd_max_sym_length): Track coreutils.
2683 (sc_unmarked_diagnostics): Look in all files, not just *.c.
2684 (sc_useless_cpp_parens): New rule.
2685 (news-date-check): Look for version or today's date.
2686 (changelog-check): Don't require version number near head.
2687 (copyright-check): Use current year instead of hardwiring 2005.
2688 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
2689 (announcement): Add --gpg-key-ID.
2690
2691 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
2692 with "file system".
2693
2073ce56 2694 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
2695 array. Problem reported by twlevo.
2696 * src/reader.c (packgram): Prepend a new sentinel before ritem.
2697 * src/lalr.c (build_relations): Rely on new sentinel.
2698 * src/gram.c (gram_free): Adjust to new sentinel.
2699
b7691f15
JD
27002006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
2701
2702 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
2703 yylookaheadNeeds. All uses updated.
2704 (yysplitStack): Rename local yynewLookaheadStatuses to
2705 yynewLookaheadNeeds.
2706 * data/glr-regression.at (Incorrect lookahead during nondeterministic
2707 GLR): In comments, change `lookahead status' to `lookahead need'.
2708
ddee1b06
PH
27092006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2710
2711 * data/glr.c (yysplitStack): A little stylistic rewrite.
2712
12f4614d
PH
27132006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2714
2715 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
2716
32c29292
JD
27172006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
2718
2719 * doc/bison.texinfo: Fix some typos.
2720 (GLR Semantic Actions): New subsection discussing special
2721 considerations because GLR semantic actions might be deferred.
2722 (Actions): Mention look-ahead usage of yylval.
2723 (Actions and Locations): Mention look-ahead usage of yylloc.
2724 (Special Features for Use in Actions): Add YYEOF entry and mention it
2725 in the yychar entry.
2726 In the yychar entry, remove mention of the local yychar case (pure
2727 parser) since this is irrelevant information when writing semantic
2728 actions and since it's already discussed in `Bison Symbols' where
2729 yychar is otherwise described as an external variable.
2730 In the yychar entry, don't call it the `current' look-ahead since it
2731 isn't when semantic actions are deferred.
2732 In the yychar and yyclearin entries, add note about deferred semantic
2733 actions.
2734 Add yylloc and yylval entries discussing look-ahead usage.
2735 (Look-Ahead Tokens): When discussing yychar, don't call it the
2736 `current' look-ahead, and do mention yylval and yylloc.
2737 (Error Recovery): Cross-reference `Action Features' when mentioning
2738 yyclearin.
2739 (Bison Symbols): In the yychar entry, don't call it the `current'
2740 look-ahead.
2741 In the yylloc and yylval entries, mention look-ahead usage.
2742
de366a2f 27432006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
2744
2745 * tests/glr-regression.at: Update copyright year to 2006.
2746
bf70fa87
JD
27472006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2748
2749 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
2750 use during nondeterministic operation to track which stacks have
2751 actually needed the current lookahead.
2752 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
2753 Allocate, deallocate, resize, and otherwise shuffle space for
2754 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
2755 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
2756 appropriately during nondeterministic operation.
2757 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
2758 members to store the current lookahead to be used by the deferred
2759 user action.
2760 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
2761 from which the RHS is taken. Set the lookahead members of the new
2762 yySemanticOption according to the lookahead status for stack yyk.
2763 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
2764 yyaddDeferredAction.
2765 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
2766 members of yySemanticOption before invoking yyuserAction, and then set
2767 them back to their current values afterward.
2768 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
2769 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
2770 * tests/glr-regression.at: Remove `.' from the ends of recent test case
2771 titles for consistency.
2772 (Leaked merged semantic value if user action cuts parse): In order to
2773 suppress lint warnings, use arguments in merge function, and assign
2774 char value < 128 in main.
2775 (Incorrect lookahead during deterministic GLR): New test case.
2776 (Incorrect lookahead during nondeterministic GLR): New test case.
2777
05449a2c
JD
27782006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2779
de366a2f 2780 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
2781 !yyvaluep as signal that no semantic value is available to print.
2782 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
2783 to print a semantic value.
2784
4158e0a1 27852006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 2786
4158e0a1
JD
2787 * tests/glr-regression.at: For consistency with my newer test cases,
2788 don't thank myself.
2789
d659304d
JD
27902006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
2791
2792 * data/glr.c (yyresolveValue): When merging semantic options, if at
2793 least one user action succeeds but a later one cuts the parse, then
2794 destroy the semantic value before returning rather than leaking it.
2795 (yyresolveStates): If a user action cuts the parse and thus
2796 yyresolveValue fails, ignore the (unset) semantic value rather than
2797 corrupting the yyGLRState, and empty the semantic options list since
2798 the user actions should have called all necessary destructors.
2799 Simplify code with YYCHK.
2800 * tests/glr-regression.at (Corrupted semantic options if user action
2801 cuts parse): New test case.
2802 (Undesirable destructors if user action cuts parse): New test case.
2803 Before applying any of this patch, this test case never actually failed
2804 for me... but only because the corrupted semantic options usually
2805 masked this bug.
2806 (Leaked merged semantic value if user action cuts parse): New test
2807 case.
2808
6ec2c0f2
AD
28092006-01-05 Akim Demaille <akim@epita.fr>
2810
2811 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
2812
1b9c21fb
PE
28132006-01-04 Paul Eggert <eggert@cs.ucla.edu>
2814
2815 * data/c.m4 (b4_c_modern): New macro, with a new provision for
2816 _MSC_VER. Problem reported by Cenzato Marco.
2817 (b4_c_function_def): Use it.
2818 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
2819 b4_c_modern.
2820 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
2821 than rolling our own.
2822
84866159
AD
28232006-01-04 Akim Demaille <akim@epita.fr>
2824
2825 Also warn about non-used mid-rule values.
2826 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
2827 member.
2828 (symbol_list_new): Adjust.
2829 * src/reader.c (symbol_typed_p): New.
2830 (grammar_rule_check): Use it.
2831 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
2832 Check its rule.
2833 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
2834 Use it.
2835 * tests/actions.at (Exotic Dollars): Adjust.
2836
378f4bd8
AD
28372006-01-04 Akim Demaille <akim@epita.fr>
2838
2839 * src/reader.c (grammar_midrule_action): If $$ is set in a
2840 mid-rule, move the `used' bit to its lhs.
2841 * tests/input.at (Unused values): New.
2842 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
2843
e2a21b6f
PE
28442006-01-03 Paul Eggert <eggert@cs.ucla.edu>
2845
54662697
PE
2846 * doc/bison.texinfo (Bison Options): Say more accurately what
2847 --yacc does.
2848 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
2849 about declarations in the grammar when in Yacc mode, as POSIX does
2850 not require a diagnostic when the grammar uses extensions.
2851
2852 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
2853
073f9288
PE
2854 Warn about dubious constructions like "%token T T".
2855 Reported by twlevo.
2856 * src/symtab.h (struct symbol.declared): New member.
2857 * src/symtab.c (symbol_new): Initialize it to false.
2858 (symbol_class_set): New arg DECLARING, specifying whether
2859 this is a declaration that we want to warn about, if there
2860 is more than one of them. All uses changed.
2861
1221b78a
PE
2862 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
2863 Allow multiple %union directives, whose contents concatenate.
2864 * src/parse-gram.y (grammar_declaration): Likewise.
2865 Use muscle_code_grow, so that we don't need stype_line any more.
2866 All uses changed.
2867
2868 * src/muscle_tab.c (muscle_grow): Fix comment.
2869
e2a21b6f
PE
2870 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
2871 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
2872 Update copyright year to 2006.
2873
8f7e3cf9
AD
28742006-01-03 Akim Demaille <akim@epita.fr>
2875
2876 Have glr.cc pass (some of) the calc.at tests.
2877 * data/glr.cc (b4_parse_param_orig): New.
2878 (b4_parse_param): Improve its definition, and bound it more
2879 clearly in the skeleton.
2880 (b4_epilogue): Append, instead of prepending, in order to keep
2881 #line consistency.
2882 Simplify the generation of auxiliary functions: locations and
2883 purity are mandated.
2884 (b4_global_tokens_and_yystype): Honor it.
2885 * data/location.cc (c++.m4): Don't include it.
2886 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
2887 and AT_SKEL_CC_IF.
2888 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
2889 AT_LALR1_CC_IF.
2890 Be sure to initialize the first position's filename.
2891 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
2892 mandated anyway.
2893 (AT_CHECK_CALC_GLR_CC): New.
2894 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
2895
3953ed88
AD
28962006-01-02 Akim Demaille <akim@epita.fr>
2897
2898 * src/output.c (output_skeleton): Don't hard wire the inclusion of
2899 c.m4.
0a96ba81 2900 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
2901 * data/glr.cc: Do not include stack.hh.
2902
9ecafbbf
AD
29032006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2904
2905 * data/glr.c: Reformat whitespace with tabs.
2906 (b4_lpure_formals): Remove this unused m4 macro.
2907 * tests/cxx-type.at: Reformat whitespace with tabs.
2908 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
2909 since it's a member. Rename type to isNterm for clarity.
2910
c4d497a0
AD
29112005-12-29 Akim <akim@sulaco.local>
2912
2913 Let glr.cc catch up with symbol_value_print.
2914 * data/glr.cc (b4_yysymprint_generate): Replace by...
2915 (b4_yy_symbol_print_generate): this.
2916 (yy_symbol_print, yy_symbol_value_print): Declare them.
2917
4517da37
PE
29182005-12-28 Paul Eggert <eggert@cs.ucla.edu>
2919
2920 * src/location.h (boundary): Note that a line or column equal
2921 to INT_MAX indicates an overflow.
2922 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
2923 (rule_length_overflow, increment_rule_length, add_column_width):
2924 New functions.
2925 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
2926 (<SC_BRACED_CODE>"}"):
2927 Use increment_rule_length rather than incrementing it by hand.
2928 (adjust_location, handle_syncline): Diagnose overflow.
2929 (handle_action_dollar, handle_action_at):
2930 Fix bug with monstrosities like $-2147483648.
2931 Remove now-unnecessary checks.
2932 (scan_integer): Verify assumptions and remove now-unnecessary checks.
2933 (convert_ucn_to_byte): Verify assumptions.
2934 (handle_syncline): New arg LOC. All callers changed.
2935 Don't store through a value derived from char const * pointer.
2936
2937 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
2938 GCC warnings.
2939
e3233bf6
PE
29402005-12-27 Paul Eggert <eggert@cs.ucla.edu>
2941
2942 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
2943 Remove unnecessary forward static decls.
2944
8f3596a6
AD
29452005-12-27 Akim Demaille <akim@epita.fr>
2946
2947 * src/reader.c (grammar_current_rule_check): Also check that $$
2948 is used.
2949 Take the rule to check as argument, hence rename as...
2950 (grammar_rule_check): this.
2951 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
2952 Rename as...
2953 (grammar_rule_begin, grammar_rule_end): these, for consistency.
2954 (grammar_midrule_action, grammar_symbol_append): Now static.
2955 * tests/torture.at (input): Don't rely on the default action
2956 being always performed.
2957 * tests/calc.at: "Set" $$ even when the action is "cut" with
2958 YYERROR or other.
2959 * tests/actions.at (Exotic Dollars): Instead of using unused
2960 values, check that the warning is issued.
2961
721be13c
PE
29622005-12-22 Paul Eggert <eggert@cs.ucla.edu>
2963
2964 * NEWS: Improve wording for unused-value warnings.
2965
a0af42fc
AD
29662005-12-22 Akim Demaille <akim@epita.fr>
2967
2968 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
2969 (b4_yysymprint_generate): Rename as...
2970 (b4_yy_symbol_print_generate): this.
2971 Generate yy_symbol_print instead of yysymprint.
2972 Generate also yy_symbol_value_print, and use it.
2973
affac613
AD
29742005-12-22 Akim Demaille <akim@epita.fr>
2975
721be13c 2976 * NEWS: Warn about unused values.
affac613
AD
2977 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
2978 a `used' member.
2979 (symbol_list_n_get, symbol_list_n_used_set): New.
2980 (symbol_list_n_type_name_get): Use symbol_list_n_get.
2981 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
2982 * src/reader.c (grammar_current_rule_check): Check that values are
2983 used.
2984 * src/symtab.c (symbol_print): Accept 0.
2985 * tests/existing.at: Remove the type information.
2986 Empty the actions.
2987 Remove useless actions (beware of mid-rule actions: perl -000
2988 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
2989 * tests/actions.at (Exotic Dollars): Use unused values.
2990 * tests/calc.at: Likewise.
2991 * tests/glr-regression.at (No users destructors if stack 0 deleted):
2992 Likewise.
2993
2994 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
2995 rule_useful_p.
2996
9d9b8b70
PE
29972005-12-21 Paul Eggert <eggert@cs.ucla.edu>
2998
8bb4c753
PE
2999 Undo 2005-12-01 tentative license wording change. The wording is
3000 still being reviewed by the lawyers, and we don't want to wait for
3001 them before publishing a test release. For now, revert to the
3002 previous wording.
3003 * NEWS: Undo 2005-12-01 change.
3004 * data/glr.c: Revert to previous license wording.
3005 * data/glr.cc: Likewise.
3006 * data/lalr1.cc: Likewise.
3007 * data/location.cc: Likewise.
3008 * data/yacc.c: Likewise.
3009
9d9b8b70
PE
3010 * NEWS: Reword %destructor vs YYABORT etc.
3011 * data/glr.c: Use American spacing, for consistency.
3012 * data/glr.cc: Likewise.
3013 * data/lalr1.cc: Likewise.
3014 * data/yacc.c: Likewise.
3015 * data/yacc.c: Reformat comments slightly.
3016 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
3017 for consistency. Fix some spelling errors and reword recently-included
3018 text slightly.
3019 * tests/cxx-type.at: Cast results of malloc, for C++.
3020
2c3b392a
AD
30212005-12-21 Joel E. Denny <address@hidden>
3022
3023 * tests/cxx-type.at: Construct a tree, count the parents of shared
3024 nodes, and free each node once and only once. Previously, the memory
3025 for semantic values was leaked instead.
3026
d6cff4dc
AD
30272005-12-21 Joel E. Denny <address@hidden>
3028
3029 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
3030 (yylval, yylloc): If pure, #define to yystackp->yyval and
3031 yystackp->yyloc similar to yychar and yynerrs.
3032 (yyparse): If pure, remove local yylval and yylloc. Add local
3033 yystackp to accommodate pure definitions of yylval and yylloc.
3034 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
3035 yylvalp and yyllocp to &yylval and &yylloc.
3036 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
3037 namespace. Previously, nerrs and char were missing, but lval and lloc
3038 weren't necessary.
3039 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
3040 yylvalp and yyllocp parameters since, if pure, these are now always
3041 accessible through yystackp. If not pure, they are still accessible
3042 globally.
3043 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
3044 `if (YYID (N))' to pacify lint.
3045
a85284cf
AD
30462005-12-21 Akim Demaille <akim@epita.fr>
3047
3048 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
3049 destroy the RHS symbols of a rule.
3050 * data/yacc.c (yylen): Initialize to 0.
3051 Keep its value to the number of items to possibly shift.
3052 In particular, a regular successful parse that ends on YYFINAL by
3053 a (internal) YYACCEPT must not have yylen != 0.
3054 (yyerrorlab, yyreturn): Pop the RHS.
3055 Reorder a bit to emphasize the `shifting' bits of code.
3056 (YYPOPSTACK): Now accept a number of items to pop.
3057 * data/lalr1.cc: Likewise.
3058 * data/glr.c: Formatting changes.
3059 Use goto instead of fall through.
3060 * doc/bison.texinfo (Destructor Decl): Complete.
3061
d508c281
JMG
30622005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3063
3064 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3065 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
3066 * djgpp/config.bat: Replace every occurence of the file name
3067 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3068 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3069 * djgpp/config.sed: Replace every occurence of the file name
3070 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3071 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3072 * djgpp/djunpack.bat: DJGPP specific file.
3073 * djgpp/fnchange.lst: DJGPP specific file.
3074 * djgpp/README.in: Add new information about how to unpack the bison
3075 source on MSDOS and other systems which have 8.3 file name restrictions
3076 using djunpack.bat and fnchange.lst.
3077
3e7a2cd9
PE
30782005-12-12 Paul Eggert <eggert@cs.ucla.edu>
3079
3080 * bootstrap (build_cvs_prefix): Remove; unused.
3081 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
3082 when getting gnulib.
3083
30842005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
3085
3086 * data/glr.c: Reorder typedef declarations for structs to match order
3087 of struct declarations.
3088 Rename yystack everywhere to yystackp except in yyparse where it's not
3089 a pointer.
3090 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
3091 consistency.
3092 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
3093 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
3094 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
3095 lint.
3096
877519f8
PE
30972005-12-09 Paul Eggert <eggert@cs.ucla.edu>
3098
0eca5a39
PE
3099 * tests/sets.at (Accept): Fix typos in regular expression used to
3100 sed out the final state number.
3101
2cec9080
PE
3102 Work around portability problem on Solaris 10: flex-generated
3103 files include <stdio.h> before <config.h>, which messes up
3104 because the latter defines __EXTENSIONS__. Address the problem
3105 by creating two new little files that include <config.h> first,
3106 then include the flex-generated files. Rewrite everyone else
3107 to include <config.h> first, as well.
3108 * lib/timevar.c: Always include "config.h".
3109 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
3110 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
3111 (EXTRA_bison_SOURCES): New macro.
3112 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
3113 * src/system.h: Don't include config.h.
3114 * src/LR0.c: Include <config.h> first.
3115 * src/assoc.c: Likewise.
3116 * src/closure.c: Likewise.
3117 * src/complain.c: Likewise.
3118 * src/conflicts.c: Likewise.
3119 * src/derives.c: Likewise.
3120 * src/files.c: Likewise.
3121 * src/getargs.c: Likewise.
3122 * src/gram.c: Likewise.
3123 * src/lalr.c: Likewise.
3124 * src/location.c: Likewise.
3125 * src/main.c: Likewise.
3126 * src/muscle_tab.c: Likewise.
3127 * src/nullable.c: Likewise.
3128 * src/output.c: Likewise.
3129 * src/parse-gram.y: Likewise.
3130 * src/print.c: Likewise.
3131 * src/print_graph.c: Likewise.
3132 * src/reader.c: Likewise.
3133 * src/reduce.c: Likewise.
3134 * src/relation.c: Likewise.
3135 * src/state.c: Likewise.
3136 * src/symlist.c: Likewise.
3137 * src/symtab.c: Likewise.
3138 * src/tables.c: Likewise.
3139 * src/uniqstr.c: Likewise.
3140 * src/vcg.c: Likewise.
3141
877519f8
PE
3142 * src/parse-gram.y: Fix minor problems uncovered by lint.
3143 (current_lhs, current_lhs_location): Now static.
3144 (current_assoc): Remove unused variable.
3145
3146 Cleanups so that Bison-generated parsers have less lint.
3147 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
3148 Prepend /*ARGSUSED*/, for lint's sake.
3149 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
3150 definition if 'lint' is defined.
3151 (YYID): New macro (or function, if lint).
3152 All uses of /*CONSTCOND*/0 replaced by YYID(0).
3153 * data/yacc.c: Likewise.
3154 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
3155 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
3156 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
3157 is C++ only.
3158 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
3159 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
3160 Use YYID(0) rather than 0, for lint.
3161 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
3162 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
3163
f5228370
PE
31642005-12-07 Paul Eggert <eggert@cs.ucla.edu>
3165
3166 * tests/glr-regression.at
3167 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
3168 Close memory leak reported by twlevo.
3169
69ce078b
PE
31702005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
3171
6ff99711
PE
3172 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
3173 all stacks.
3174 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
3175 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3176 New test case.
3177 (Duplicated user destructor for lookahead): This test now is expected
3178 to succeed.
3179
af3412cd
PE
31802005-12-01 Paul Eggert <eggert@cs.ucla.edu>
3181
32b5b719 3182 * NEWS: Document the following change.
af3412cd
PE
3183 * data/yacc.c: Say "parser skeleton" rather than "file", since
3184 it's no longer just a file.
3185 * data/glr.c: Grant a special exception for C GLR parsers, that
3186 reads like the already-existing exception for C LALR(1) parsers.
3187 * data/glr.cc: Likewise.
3188 * data/lalr1.cc: Likewise.
3189 * data/location.cc: Likewise.
3190 * data/yacc.c: Reword the "written by" statement to clarify that
3191 it was the parser skeleton, not the entire output file.
3192 * data/glr.c: Written by Paul Hilfinger.
3193 * data/glr.cc: Written by Akim Demaille.
3194 * data/lalr1.cc: Likewise.
3195
035aa4a0
PE
31962005-11-18 Paul Eggert <eggert@cs.ucla.edu>
3197
d9963c85
PE
3198 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
3199 Fix typos in previous change that broke 'make check'.
3200 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
3201 supported in C.
3202 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
3203 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
3204 We can revert this once things settle down.
3205
035aa4a0
PE
3206 * src/conflicts.c (conflicts_print): Don't print file name twice
3207 when %expect fails because there were no conflicts.
3208 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
3209 change.
3210 * tests/conflicts.at (%expect not enough, %expect too much):
3211 (%expect with reduce conflicts): Adjust to new behavior.
3212
32132005-11-18 Akim Demaille <akim@epita.fr>
3214
3215 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
3216 errors.
3217 * NEWS: Document this.
3218 * doc/bison.texinfo (Expect Decl): Likewise.
3219
d1ff7a7c
AD
32202005-11-16 Akim Demaille <akim@epita.fr>
3221
3222 Generalize the display of semantic values and locations in traces.
3223 * data/glr.c (yy_reduce_print): Fix indices (again).
3224 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
3225 literal integers.
3226 * data/lalr1.cc (yyreduce_print): Rename as...
3227 (yy_reduce_print): this.
3228 Display values and locations.
3229 * data/yacc.c (yy_reduce_print): Likewise.
3230 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
3231 (yysymprint): Move higher to be visible from yy_reduce_print).
3232 (yyparse): Adjust.
3233 * tests/calc.at: Adjust the expected length of the traces.
3234
6de5398d
AD
32352005-11-14 Akim Demaille <akim@epita.fr>
3236
3237 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
3238 from 1 to N, while values and location start at 0.
3239 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
3240
a1373f55
AD
32412005-11-14 Akim Demaille <akim@epita.fr>
3242
3243 * data/glr.c (yy_reduce_print): Fix the $ number.
3244
613d8952
AD
32452005-11-14 Akim Demaille <akim@epita.fr>
3246
3247 "Use" parse parameters.
3248 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
3249 * data/glr.c, data/glr.cc: Use them.
3250 * data/glr.c (YYUSE): Have a C++ definition that supports
3251 non-pointer types.
3252
b2741627
AD
32532005-11-14 Akim Demaille <akim@epita.fr>
3254
3255 * data/glr.c (yyexpandGLRStack): Declare only if defined.
3256
5059b5c8
AD
32572005-11-14 Akim Demaille <akim@epita.fr>
3258
42249483
AD
3259 * data/glr.cc: New.
3260 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 3261
4626a15d
AD
32622005-11-12 Akim Demaille <akim@epita.fr>
3263
3264 Let position and location be PODs.
3265 * data/location.cc (position::initialize, location::initialize): New.
3266 (position::position, location::location): Define only if
3267 b4_location_constructors is defined.
3268 * data/lalr1.cc (b4_location_constructors): Define it for backward
3269 compatibility.
3270 * doc/bison.texinfo (Initial Action Decl): Use initialize.
3271
32722005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
3273
3274 * data/lalr1.cc: Move the body of the ctor and dtor into the
3275 parser file (instead of the header).
3276 Wrap the implementations in a "namespace yy".
3277
32782005-11-12 Akim Demaille <akim@epita.fr>
3279
3280 Have glr.c include its header file when created.
3281 * data/glr.c (b4_shared_declarations): New.
3282 Output them verbatim in the parser if !%defines, otherwise
3283 output then in the header file, and include it instead.
3284
1989d947
AD
32852005-11-11 Akim Demaille <akim@epita.fr>
3286
3287 * data/glr.c: Comment changes.
3288
32892005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
3290
3291 When yydebug, report semantic and location values for reductions.
3292 * data/glr.c (yy_reduce_print): Report the semantic values and the
3293 locations.
3294 (YY_REDUCE_PRINT): Adjust.
3295 (yyglrReduce): Use them.
3296 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
3297 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
3298 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
3299 traces.
3300
02998094
AD
33012005-11-10 Akim Demaille <akim@epita.fr>
3302
3303 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
3304 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
3305 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
3306
5210672f
PE
33072005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
3308
3309 * m4/cxx.m4, examples/Makefile.am: Don't build
3310 examples/calc++ if no C++ compiler is available. (trivial change)
3311
a8991a1d
AD
33122005-11-09 Akim Demaille <akim@epita.fr>
3313
3314 * src/scan-skel.l: Use a couple of asserts.
3315
36b5e963
AD
33162005-11-03 Akim Demaille <akim@epita.fr>
3317
3318 In some (weird) cases, the final state number is incorrect.
3319 Reported by Alexandre Duret-Lutz.
3320 * src/LR0.c (state_list_append): Remove the computation of
3321 final_state.
3322 (save_reductions): Do it here.
3323 (get_state): Alpha conversion.
3324 (generate_states): Use a for loop.
3325 * src/gram.h (item_number_is_rule_number)
3326 (item_number_is_symbol_number): New.
3327 * src/state.c: Use assert.
3328 * src/system.h: Include assert.h.
3329 * tests/sets.at (Accept): New.
3330
44e7ead1
PH
33312005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3332
3333 * data/glr.c (yyfill): Adjust comment.
36b5e963 3334 (yyresolveAction): Initialize default location properly
44e7ead1
PH
3335 for empty right-hand sides.
3336 (yydoAction): Ditto.
3337 Add comment explaining apparently dead code.
36b5e963
AD
3338 * tests/glr-regression.at
3339 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 3340 New test.
36b5e963 3341
e10a80ee
PE
33422005-10-30 Paul Eggert <eggert@cs.ucla.edu>
3343
3344 * bootstrap (cleanup_gnulib): New function. Use it to clean up
3345 gnulib when interrupted. This fixes some race conditions and
3346 works around some portability problems (one noted by Paul
3347 Hilfinger).
3348
067b32ee
AD
33492005-10-22 Akim <akim@epita.fr>
3350
3351 * Makefile.cfg: Adjust to config -> build-aux.
3352 Reported by twledo.
3353
4b367315
AD
33542005-10-21 Akim Demaille <akim@epita.fr>
3355
3356 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
3357 the %parse-params.
3358 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
3359 * data/yacc.c (b4_Pure_if): Rename as...
3360 (b4_yacc_pure_if): this.
3361 (YY_SYMBOL_PRINT, yyparse): Adjust.
3362 * doc/bison.texinfo: Formatting changes.
3363
24cc23d9
AD
33642005-10-21 Akim Demaille <akim@epita.fr>
3365
3366 Finish the transition config -> build-aux.
3367 * configure.ac, Makefile.am: Use build-aux.
3368 * config/prev-version, config/announce-gen, config/Makefile.am:
3369 Move to...
3370 * build-aux/prev-version, build-aux/announce-gen,
3371 * build-aux/Makefile.am: here.
3372
d4476375
AD
33732005-10-14 Akim Demaille <akim@epita.fr>
3374
3375 * examples/calc++/test: Use set -x only when VERBOSE.
3376
302c0aee
PE
33772005-10-13 Paul Eggert <eggert@cs.ucla.edu>
3378
3379 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
3380 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
3381
7625ec2c
AD
33822005-10-13 Akim Demaille <akim@epita.fr>
3383
3384 * src/scan-skel.l: Output the base name parts of the parser and
3385 header file names.
302c0aee 3386 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
3387 additional checks.
3388 Use this to exercise C++ outputs in subdirs.
3389 Reported by Oleg Smolsky.
3390
ba0fe3c7
PE
33912005-10-12 Paul Eggert <eggert@cs.ucla.edu>
3392
3393 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
3394 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
3395 Problem reported by John P. Hartmann.
3396 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
3397 already defined it.
3398
9b8a5ce0
AD
33992005-10-12 Akim Demaille <akim@epita.fr>
3400
3401 * src/parse-gram.y (version_check): Exit 63 to please missing
3402 (stands for "version mismatch).
3403 * tests/input.at, doc/bison.texinfo: Adjust.
3404
4f6e011e
PE
34052005-10-10 Paul Eggert <eggert@cs.ucla.edu>
3406
3407 Work around portability problems with Visual Age C compiler
3408 (xlc and xlC_r) reported by John P. Hartmann.
3409 * data/location.cc (initial_column, initial_line): Remove.
3410 All uses replaced by 0 and 1.
3411 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
3412 that xlc complains about.
3413 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 3414 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 3415 as __STDC__.
4d7aa45e
PE
3416 * data/yacc.c (YYMODERN_C): New macro, which also looks at
3417 __STDC_VERSION__. Use it everywhere instead of looking at
3418 __STDC__ and __cplusplus.
4f6e011e 3419
a1b3bf8c
AD
34202005-10-10 Akim Demaille <akim@epita.fr>
3421
3422 * examples/calc++/test: Be quiet unless VERBOSE.
3423
412e44aa
PE
34242005-10-05 Paul Eggert <eggert@cs.ucla.edu>
3425
2a4647a3
PE
3426 * data/c.m4 (yydestruct, yysymprint):
3427 Use YYUSE instead of casting to void.
3428 * data/glr.c (YYUSE): New macro.
3429 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3430 Use it instead of rolling our own.
3431 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3432 (YYCHK1):
3433 Use /*CONSTCOND*/ to suppress lint warnings.
3434 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3435 (YY_STACK_PRINT): Use 'false' not '0'.
3436 (YYUSE): New macro.
3437 (yysymprint_, yydestruct_): Use it instead of rolling our own.
3438 * data/yacc.c (YYUSE): New macro.
3439 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
3440 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
3441 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
3442
3443
412e44aa
PE
3444 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
3445 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
3446
88c6637f
PE
34472005-10-04 Paul Eggert <eggert@cs.ucla.edu>
3448
2f4f028d
PE
3449 Undo the parts of the unlocked-I/O change that substituted
3450 putc or puts for printf. This might hurt performance a bit,
3451 but some people prefer the printf style.
3452 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
3453 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
3454 All uses replaced by YYFPRINTF and YYDPRINTF.
3455 * data/yacc.c: Likewise.
3456 * lib/bitset.c (bitset_print): Likewise.
3457 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
3458 putc and puts.
3459 * lib/lbitset.c (debug_lbitset): Likewise.
3460 * src/closure.c (print_firsts, print_fderives): Likewise.
3461 * src/gram.c (grammar_dump): Likewise.
3462 * src/lalr.c (look_ahead_tokens_print): Likewise.
3463 * src/output.c (escaped_output): Likewise.
3464 (user_actions_output): Break apart two printfs.
3465 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
3466 * src/reduce.c (reduce_print): Likewise.
3467 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
3468 * src/system.h: Include unlocked-io.h rathe than stdio.h.
3469
88c6637f
PE
3470 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3471 Use assignments rather than casts-to-void to suppress
3472 unused-variable warnings. This pacifies 'lint'.
3473 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
3474 unused-variable warnings.
3475
fb32e373
JMG
34762005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3477
3478 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3479
edb8f44f
PE
34802005-10-02 Paul Eggert <eggert@cs.ucla.edu>
3481
fb9c0b33
PE
3482 Use unlocked I/O for a minor performance improvement on hosts like
3483 GNU/Linux and Solaris that support unlocked I/O. The basic idea
3484 is to use the gnlib unlocked-io module, and to prefer putc and
3485 puts to printf when either will work (since the latter doesn't
3486 come in an unlocked flavor).
3487 * bootstrap (gnulib_modules): Add unlocked-io.
3488 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
3489 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
3490 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
3491 and similarly for puts and putc and printf.
3492 * data/yacc.c: Likewise.
3493 * lib/bitset.c (bitset_print): Likewise.
3494 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
3495 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
3496 to printf.
3497 * lib/lbitset.c (debug_lbitset): Likewise.
3498 * src/closure.c (print_firsts, print_fderives): Likewise.
3499 * src/gram.c (grammar_dump): Likewise.
3500 * src/lalr.c (look_ahead_tokens_print): Likewise.
3501 * src/output.c (escaped_output): Likewise.
3502 (user_actions_output): Coalesce two printfs.
2f4f028d 3503 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
3504 * src/reduce.c (reduce_print): Likewise.
3505 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 3506 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 3507
edb8f44f
PE
3508 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
3509 this confuses xgettext.
3510
b50d2359
AD
35112005-10-02 Akim Demaille <akim@epita.fr>
3512
3513 * bootstrap (gnulib_modules): Add strverscmp.
3514 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
3515 * m4/.cvsignore: Add strverscmp.m4.
3516 * src/parse-gram.y (%require): New token, new rule.
3517 (version_check): New.
3518 * src/scan-gram.l (%require): Adjust.
3519 * tests/input.at (AT_REQUIRE): New.
3520 Use it.
3521 * doc/bison.texinfo (Require Decl): New.
3522 (Calc++ Parser): Use %require.
3523
21667f64
AD
35242005-10-02 Akim Demaille <akim@epita.fr>
3525
3526 * data/location.cc: New.
3527
2b81e969
AD
35282005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
3529 Akim Demaille <akim@epita.fr>
3530
3531 Make sure -odir/foo.cc creates dir/location.hh etc.
3532 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
3533 (spec_file_prefix, spec_verbose_file, spec_graph_file)
3534 (spec_defines_file): Now const.
3535 (dir_prefix): New.
3536 (short_base_name): Remove.
3537 * src/files.c: Adjust.
3538 (dirname.h): Include.
3539 (base_name): Don't prototype it.
3540 (finput): Remove, duplicates gram_in.
3541 (full_base_name, short_base_name): Replace by...
3542 (all_but_ext, all_but_tab_ext): these.
3543 (compute_base_names): Rename as...
3544 (compute_file_name_parts): this.
3545 Update to compute the new variables, including dir_prefix.
3546 Adjust dependencies.
3547 * src/output.c (prepare): Output them.
3548 * src/reader.c: Adjust to use gram_in, not finput.
3549 * src/scan-skel.l (@dir_prefix@): New.
3550
ad6a9b97
JMG
35512005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3552
3553 * lib/subpipe.c: New function end_of_output_subpipe() added
3554 to allow support for non-posix systems. This is a no-op function
3555 for posix systems.
3556
3557 * lib/subpipe.h: New function end_of_output_subpipe() added
3558 to allow support for non-posix systems. This is a no-op function
3559 for posix systems.
3560
3561 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
3562 handle the lack of pipe/fork functionality on non-posix systems.
3563
3564 * djgpp/Makefile.maint: DJGPP specific file.
3565
3566 * djgpp/README.in: DJGPP specific file.
3567
3568 * djgpp/config.bat: DJGPP specific configuration file.
3569
3570 * djgpp/config.sed: DJGPP specific configuration file.
3571
3572 * djgpp/config.site: DJGPP specific configuration file.
3573
3574 * djgpp/config_h.sed: DJGPP specific configuration file.
3575
3576 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
3577
3578 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
3579
fc695704
AD
35802005-10-02 Akim Demaille <akim@epita.fr>
3581
3582 * data/location.cc: New, extract from...
3583 * data/lalr1.cc: here.
3584 (location.hh): Include it after the user prologue, in case the
3585 filename type is defined by the user.
3586 Forward declation location and position before the pre-prologue.
3587 (yyresult_): Rename as...
3588 (yyresult): this, it's a local variable, not an attribute.
3589 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
3590
35912005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
3592
3593 * examples/extexi: Restore the #line generation.
3594
fb9712a9
AD
35952005-09-30 Akim Demaille <akim@epita.fr>,
3596 Alexandre Duret-Lutz <adl@gnu.org>
3597
3598 Move the token type and YYSTYPE in the parser class.
3599 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
3600 (parser::token): New, from the moved free definition of tokens.
3601 (parser::semantic_value): Now a full definition instead of an
3602 indirection to YYSTYPE.
3603 (b4_post_prologue): No longer included in the header file, but
3604 in the implementation file.
3605 * doc/bison.texi (C+ Language Interface): Update.
3606 * src/parse-gram.y: Support unary %define.
3607 * tests/actions.at: Define global_tokens_and_yystype for backward
3608 compatibility until we update the tests.
3609 * tests/calc.at: Idem.
3610 (first_line, first_column, last_line, last_column): Define for lalr1.cc
3611 to simplify the code.
3612
55f0c7b1
PE
36132005-09-29 Paul Eggert <eggert@cs.ucla.edu>
3614
3615 Port to SunOS 4.1.4, which lacks strtoul and strerror.
3616 Ah, the good old days! Problem reported by Peter Klein.
3617 * bootstrap (gnulib_modules): Add strerror, strtoul.
3618 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
3619 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
3620
fb9712a9 36212005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
3622
3623 * data/c.m4 (b4_error_verbose_if): New.
3624 * data/lalr1.cc: Use it.
3625 (YYERROR_VERBOSE_IF): Remove.
3626 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
3627 parser members, replaced by...
3628 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
3629 local variables.
3630 (yysyntax_error_): Takes the state number as argument.
3631 (yyreduce_print_): Use the argument yyrule, not the former
3632 attribute yyn_.
3633
8a6f72f3
PE
36342005-09-26 Paul Eggert <eggert@cs.ucla.edu>
3635
3636 * bootstrap (gnulib_modules): Add verify.
3637 * lib/.cvsignore: Add verify.h.
3638 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
3639 * src/system.h (verify): Remove.
3640 Include verify.h instead.
3641 * src/tables.c (tables_generate): Use new API for 'verify'.
3642
0d50976f
PE
36432005-09-21 Paul Eggert <eggert@cs.ucla.edu>
3644
ebc3737e
PE
3645 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
3646 local variables whose names begin with 'yy'.
3647 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
3648 Trivial changes from Joel E. Denny.
3649
0d50976f
PE
3650 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
3651 it itself.
3652 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
3653 don't use alloca any more.
3654
3655 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
3656 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 3657 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
3658 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
3659 to match yacc.c, to test more hosts.
3660
a05b79df
PE
36612005-09-20 Paul Eggert <eggert@cs.ucla.edu>
3662
55289366
PE
3663 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
3664 doesn't affect behavior.
3665 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
3666 Solaris, AIX, MSC.
3667 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
3668 This works a bit better with glibc, if user code has already included
3669 stdlib.h.
3670 * doc/bison.texinfo (Bison Parser): Document that users can't
3671 arbitrarily use malloc and free for other purposes. Document
3672 that <alloca.h> and <malloc.h> might be included.
3673 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
3674 user must declare alloca.
3675
a05b79df
PE
3676 * HACKING (release): Forwarn the Translation Project about
3677 stable releses.
3678
3ab2ca22
AD
36792005-09-20 Akim Demaille <akim@epita.fr>
3680
3681 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
3682
a9739e7c
PE
36832005-09-19 Paul Eggert <eggert@cs.ucla.edu>
3684
a702593e
PE
3685 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
3686 (YYSTACK_ALLOC_MAXIMUM): Use it.
3687 (yysyntax_error): New function.
3688 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
3689 multiple syntax errors are reported, and alloca is being used.
3690 Instead, reallocate buffers twice as big each time, so that
3691 we waste at most half the allocated memory. Start with a small
3692 (128-byte) buffer that will suffice in most cases anyway.
3693 Use yysyntax_error to do most of the work.
3694
3695 * doc/bison.texinfo (Error Reporting, Table of Symbols):
3696 yynerrs is the number of errors reported, not the number of
3697 errors encountered.
3698
a9739e7c
PE
3699 * tests/glr-regression.at (Duplicated user destructor for lookahead):
3700 Mark it as expected to fail.
3701 Cast result of malloc; problem reported by twlevo@xs4all.nl.
3702 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
3703 Don't start user-code symbols with "yy", to avoid name space problems.
3704
f479c6c6
AD
37052005-09-19 Akim Demaille <akim@epita.fr>
3706
3707 Remove the traits, failed experiment.
3708 It never proved useful, and anyway because of the current
3709 definition, it was not possible to have several specialization of
3710 this traits, making it useless.
3711 * data/lalr1.cc (yy:traits): Remove.
3712 Inline its definitions in the parser class.
3713
e2586f82
AD
37142005-09-19 Akim Demaille <akim@epita.fr>
3715
3716 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
3717 least Mac OSX with a /usr/local install of gettext.
3718
2e8cf949
AD
37192005-09-19 Akim Demaille <akim@epita.fr>
3720
3721 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
3722 and yytoken for similarity with the other skeletons.
3723
c7fb0b90
AD
37242005-09-19 Akim Demaille <akim@epita.fr>
3725
4e26c69e 3726 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 3727
1bd0deda
PE
37282005-09-16 Paul Eggert <eggert@cs.ucla.edu>
3729
3730 * NEWS: Version 2.1.
3731
3732 * NEWS: Remove notice of yytname change, since it was never in an
3733 official release.
3734 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
3735 diagnostic.
3736 * src/output.c (prepare): Likewise.
3737 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
3738 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
3739 is not defined. This is an awful hack, but it's enough for now.
3740 All callers changed.
3741 * tests/glr-regression-at (make_value): Args are const pointers now,
3742 to avoid GCC warning.
3743 (Duplicated user destructor for lookahead): New test. Currently
3744 skipped. It fails on my host but I'm not sure it'll always fail.
3745
37462005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
3747
3748 * src/symtab.h (struct symbol): Declare the printer and destructor
3749 as const, to avoid accidental calls to free.
3750 (symbol_destructor_set, symbol_printer_set): Adjust.
3751 * src/symtab.c: Adjust.
3752
1bd0deda 37532005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
3754
3755 * data/c.m4 (b4_token_enums): New.
3756 (b4_token_defines): Rename as...
3757 (b4_token_enums_defines): this.
3758 (b4_token_defines): New, output only the #defines.
3759 * data/yacc.c, data/glr.c: Adjust.
3760 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
3761 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
3762 as default values.
3763
dbcdae2d
AD
37642005-09-16 Akim Demaille <akim@epita.fr>
3765
3766 * data/lalr1.cc (yylex_): Remove, inline its code.
3767 (yyreport_syntax_error_): Remove, replaced by...
3768 (yysyntax_error_): this which returns a string and leaves to the
3769 caller the call to the users' error function.
3770 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
3771 Move from members of the parser object...
3772 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
3773 to local variables of the parse function.
3774
70d8f291
AD
37752005-09-16 Akim Demaille <akim@epita.fr>
3776
3777 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
3778 since it's in Bison's name space.
3779
b47dbebe
PE
37802005-09-15 Paul Eggert <eggert@cs.ucla.edu>
3781
ae199bf1
PE
3782 * data/glr.c (yyresolveValue): Add default case to pacify
3783 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
3784
b47dbebe
PE
3785 * NEWS: Document when yyparse started to return 2.
3786 * doc/bison.texinfo (Parser Function): Document when yyparse
3787 returns 2.
3788
3789 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
3790 (b4_filename_type): Renamed back from b4_file_name_type. All uses
3791 changed.
3792 (class position): file_name -> filename (reverting). All uses changed.
3793
37942005-09-14 Paul Eggert <eggert@cs.ucla.edu>
3795
3796 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
3797 do anything if $@ exists. This reverts part of the 2005-07-07
3798 patch.
3799
00292f66
PE
38002005-09-11 Paul Eggert <eggert@cs.ucla.edu>
3801
3802 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
3803 contains obsolete information and isn't worth distributing as a
3804 separate file anyway.
3805 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
3806 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
3807 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
3808 (yyparse): Abort if user code uses longjmp to throw an unexpected
3809 value.
3810
a420f962
PE
38112005-09-09 Paul Eggert <eggert@cs.ucla.edu>
3812
00292f66
PE
3813 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
3814 Suggested by twlevo@xs4all.nl.
3815
127287e9
PE
3816 * data/glr.c (YYCHK1): Do not assume YYE is in range.
3817 This avoids a diagnostic from gcc -Wswitch-enum.
3818 Problem reported by twlevo@xs4all.nl.
3819
a420f962
PE
3820 * doc/bison.texinfo: Don't use "filename", as per GNU coding
3821 standards. Use "file name" or "file" or "name", depending on
3822 the context.
3823 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
3824 not to hack/foo.tab.c.
3825 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
3826 * data/glr.c: b4_filename -> b4_file_name.
3827 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
3828 All uses changed.
3829 (class position): filename -> file_name. All uses changed.
3830 * data/yacc.c: b4_filename -> b4_file_name.
3831 * lib/bitset.h: filename -> file_name in local vars.
3832 * lib/bitset_stats.c: Likewise.
3833 * src/files.c: Likewise.
3834 * src/scan-skel.l ("@output ".*\n): Likewise.
3835 * src/files.c (file_name_split): Renamed from filename_split.
3836 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
3837
38382005-09-08 Paul Eggert <eggert@cs.ucla.edu>
3839
3840 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
3841 to accommodate latest gnulib.
3842
3843 * tests/glr-regression.at (Duplicate representation of merged trees):
3844 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
3845
3846 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
3847 needed.
3848
42a6501d
PE
38492005-08-26 Paul Eggert <eggert@cs.ucla.edu>
3850
3851 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
3852 All uses changed. Invoke user destructor after an error during a
3853 split parse (trivial change from Joel E. Denny).
3854
3855 * tests/glr-regression.at
3856 (User destructor after an error during a split parse): New test case.
3857 Problem reported by Joel E. Denny in:
3858 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
3859
ef9a1faf
PE
38602005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3861
5b4aaf78
PE
3862 * README-cvs: Give URLs for recommended tools.
3863 Mention Gzip version problem, and bootstrapping issues.
3864 Remove troubleshooting section, as it's somewhat obsolete.
3865
b5240ba5
PE
3866 * bootstrap (no_cache): New var, to accommodate different wget
3867 variants. Use it instead of '-C off'. Problem reported by
3868 twlevo@xs4all.nl.
3869
ef9a1faf
PE
3870 * data/glr.c (yydestroyStackItem): New function.
3871 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
3872 debugging information. Problem reported by Joel E. Denny.
3873
e6efa9da
AD
38742005-08-25 Akim Demaille <akim@epita.fr>
3875
3876 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
3877
adc90f13
PE
38782005-08-24 Paul Eggert <eggert@cs.ucla.edu>
3879
3880 * data/glr.c (yyrecoverSyntaxError, yyreturn):
3881 Don't invoke destructor on unresolved entries.
3882 * tests/glr-regression.at
3883 (User destructor for unresolved GLR semantic value): New test case.
3884 Problem reported by Joel E. Denny in:
3885 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
3886
f9315de5
PE
38872005-08-21 Paul Eggert <eggert@cs.ucla.edu>
3888
15d29c1f
PE
3889 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
3890 Add strnlen.c.
3891 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
3892 lib-prefix.m4, po.m4.
3893
dd5f2af2
PE
3894 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
3895 in yydestruct diagnostic, since it might not be an error.
3896 Problem reported by Joel Denny near end of
3897 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 3898 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
3899 * data/yacc.c (yyreturn): Likewise.
3900 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
3901
3902 * src/files.c: Remove obsolete FIXME comment.
3903
3904 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
3905 with the other templates, and to fix bogus run-on messages such
3906 as the one reported at the end of
3907 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
3908 All callers changed to avoid the newline.
3909 (yyprocessOneStack): Output two lines rather than one, to accommodate
3910 the above change. This changes the debug output format slightly.
3911
f9315de5
PE
3912 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
3913 reported by Joel E. Denny in
3914 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
3915 (trivial change).
3916 * tests/glr-regression.at (Duplicate representation of merged trees):
3917 New test, from Joel E. Denny in:
3918 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
3919 * THANKS: Add Joel E. Denny.
3920
3921 * configure.ac (AC_INIT): Bump to 2.0c.
3922
04098407
PE
39232005-07-24 Paul Eggert <eggert@cs.ucla.edu>
3924
3925 * NEWS: Version 2.0b.
3926
ca5d2013
PE
3927 * Makefile.am (SUBDIRS): Put examples before tests, so that
3928 "make check" doesn't finish with "All 1 tests passed".
3929
3d54b576
PE
3930 * tests/regression.at (Token definitions): Don't rely on
3931 AT_PARSER_CHECK for data that contains backslashes. It currently
3932 uses 'echo', and 'echo' isn't portable if its argument contains
3933 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
3934 that the byte '\0xff' is not printable in the C locale; it is,
3935 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
3936 not printable, so use '\0x81' to test.
3937
d53ae497
PE
3938 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
3939 version of GCC, since the macro is used with non-GCC compilers.
3940
fc01665e
PE
3941 Fix core dump reported by Pablo De Napoli in
3942 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
3943 * tests/regression.at (Invalid inputs with {}): New test.
3944 * src/parse-gram.y (token_name): Translate type before using
3945 it as an index.
3946
04098407
PE
3947 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
3948 the user's name space. All uses changed to __attribute__
3949 ((__unused__)).
3950 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
3951 Add __attribute__ ((__noreturn__)).
3952
3953 * etc/clcommit: Remove. We weren't using it, and it failed
3954 "make maintainer-distcheck".
3955 * Makefile.maint: Merge from coreutils.
3956 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
3957 (syntax-check-rules): Change list of rules as described below.
3958 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
3959 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
3960 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
3961 (sc_trailing_space): New rules.
3962 (sc_xalloc_h_in_src): Remove.
3963 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
3964 (sc_space_tab, sc_error_exit_success, sc_changelog):
3965 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
3966 (makefile-check, po-check, author_mark_check):
3967 (makefile_path_separator_check, copyright-check):
3968 Use grep -n, to make it easier to find violations.
3969 Use CVS_LIST and CVS_LIST_EXCEPT.
3970 (header_regexp, h_re): Remove.
3971 (dd_c): New macro.
3972 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
3973 (my-distcheck): Use more-modern GCC flags.
3974 (signatures, %.asc): Remove.
3975 (rel-files, announcement): Remove signatures.
3976 Restore old updating code, even though we don't use it, so
3977 that we're the same as coreutils.
3978 (alpha, beta, major): Depend on news-date-check.
3979 Make the upload commands.
3980
3981 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
3982 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
3983 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
3984 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
3985 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
3986 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
3987 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
3988 * tests/sets.at: Likewise.
3989
3990 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
3991 we comment out the Autoconf version number.
3992 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
3993 it's error-prone and "make maintainer-distcheck" rejects it.
3994
3995 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
3996 Indent calls to "error" to pacify "make maintainer-distcheck",
3997 when the calls are not intended to be translated.
3998 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
3999
4000 * src/Makefile.am (DEFS): Use +=, to pacify
4001 "make maintainer-distcheck".
4002 (bison_SOURCES): Add scan-skel.h.
4003 (sc_tight_scope): New rule, from coreutils.
4004
4005 * src/files.c (src_extension, header_extension):
4006 Now static, not extern.
4007 * src/getargs.c (short_options): Likewise.
4008 * src/muscle_tab.c (muscle_table): Likewise.
4009 * src/parse-gram.y (current_class, current_type, current_prec):
4010 Likewise.
4011 * src/reader.c (grammar_end, previous_rule_end): Likewise.
4012 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
4013 * src/main.c (main): Cast bindtextdomain and textdomain calls to
4014 void, to avoid warning when NLS is disabled.
4015 * src/output.c: Include scan-skel.h.
4016 (scan_skel): Remove decl, since scan-skel.h does this.
4017 (output_skeleton):
4018 Indent calls to "error" to pacify "make maintainer-distcheck".
4019 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
4020 * src/reader.h (gram_end, gram_lineno): New decls to pacify
4021 "make maintainer-distcheck".
4022 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
4023 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
4024 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
4025 (skel_lex_destroy, scan_skel): Move these decls to...
4026 * src/scan-skel.h: New file.
4027 * src/uniqstr.c (uniqstr_assert):
4028 Indent calls to "error" to pacify "make maintainer-distcheck".
4029
4030 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
4031 not @VAR@.
4032
4033 * tests/torture.at: Revamp to avoid misuse of atoi that
4034 "make maintainer-distcheck" complained about.
4035
4036 * examples/extexi (message): Don't print a message more than once,
4037 and omit line-number decoration that makes Emacs compile think
4038 that informative messages are worth worrying about.
4039
40402005-07-22 Paul Eggert <eggert@cs.ucla.edu>
4041
4042 * configure.ac: Update version number.
4043
4044 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
4045 accidentally.
4046 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
4047 autogenerated by the maintainer.
4048 * examples/calc++/.cvsignore: Add *.yy.
4049
4050 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
4051 * lib/bitset_stats.c (bitset_stats_init): Likewise.
4052 * lib/bitsetv.c (bitsetv_alloc): Likewise.
4053
4054 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
4055
4056 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
4057 from maintainer-distcheck about casting the argument of 'free'.
4058
4059 * NEWS: Mention recent yytname changes.
4060 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
4061
4062 * bootstrap: For translations that have not yet been upgraded to
4063 the new runtime-po domain, prime the pump by extracting the
4064 relevant strings from the obsolete translations. This code can be
4065 removed once the bison-runtime domain has been translated by each
4066 team.
4067
4068 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
4069 now that token names are already quoted.
4070
4071 Fix problem reported by Anthony Heading.
4072 * data/glr.c (YYTOKEN_TABLE): New macro.
4073 (yytname): Define if YYTOKEN_TABLE.
4074 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
4075 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
4076 (YYERROR_VERBOSE): Define the same way the other skeletons do.
4077 * src/output.c (prepare_symbols): Output token_table_flag.
4078
0ffda363
PE
40792005-07-21 Paul Eggert <eggert@cs.ucla.edu>
4080
4081 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
4082 again if the first call fails.
4083
4084 * data/glr.c (yytnamerr): New function.
4085 (yyreportSyntaxError): Use it to dequote most string literals.
4086 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
4087 with other skeletons. All uses changed.
4088 (yytnameerr_): New function.
4089 (yyreport_syntax_error): Use it to dequote most string literals.
4090 * data/yacc.c (yytnamerr): New function.
4091 (yyerrlab): Use it to decode most string literals.
4092 * doc/bison.texinfo (Decl Summary, Calling Convention):
4093 Clarify quoting convention of yytname.
4094 * src/output.c (prepare_symbols): Quote all names. This undoes
4095 the 2005-04-17 change, which is now accomplished (mostly) via
4096 changes in the parsers as described above.
4097 * tests/regression.at (Token definitions, Web2c Actions):
4098 Undo most 2005-04-17 change here, too.
4099
41002005-07-20 Paul Eggert <eggert@cs.ucla.edu>
4101
4102 Fix more problems reported by twlevo@xs4all.nl.
4103 * tests/cxx-type.at: Don't pipe output of ./types through sed to
4104 remove trailing spaces. This loses the exit status of ./types,
4105 and isn't needed since ./types shouldn't be emitting trailing
4106 spaces.
4107 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
4108 as the stack isn't valid in that case.
4109
4110 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4111 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4112 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4113 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
4114 is used.
4115 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
4116 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
4117 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
4118 Likewise.
4119
4120 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
4121 overly-picky compilers that reject 'char *foo = "bar";'.
4122
4123 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
4124 to FILE * parameter, not to stderr. This fixes a typo introduced
4125 in the 2005-07-12 change.
4126
4127 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
4128 warnings from GCC 4.
4129
4130 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
4131 (yyglrShiftDefer, yysplitStack):
4132 Remove unused parameters b4_pure_formals. All uses changed.
4133 (yyglrShift): Remove unused parameters b4_user_formals.
4134 All uses changed.
4135 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
4136
6100a9aa
PE
41372005-07-18 Paul Eggert <eggert@cs.ucla.edu>
4138
258b75ca
PE
4139 Destructor cleanups and regularization among the three skeletons.
4140 * NEWS: Document the behavior changes.
4141 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
4142 stack before failing, as the cleanup code will do it for us now.
4143 * data/lalr1.cc (yyerrlab): Likewise.
4144 * data/glr.c (yyparse): Pop everything off the stack before
4145 freeing it, so that destructors get called properly.
4146 * data/lalr1.cc (yyreturn): Likewise.
4147 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
4148 This is more consistent.
4149 * doc/bison.texinfo (Destructor Decl): Mention more reasons
4150 why destructors might be called. 1.875 -> 2.1.
4151 (Destructor Decl, Decl Summary, Table of Symbols):
4152 Some English-language cleanups for %destructor.
4153 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
4154 Add output line for destructor of start symbol.
4155 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
4156 because of that same extra output line.
4157
1a059451
PE
4158 * NEWS: Document minor wording changes in diagnostics of
4159 Bison-generated parsers.
4160 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
4161 Remove unused formals. All uses changed.
4162 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
4163 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
4164 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
4165 Rename yyoverflowab to yyexhaustedlab.
4166 When memory exhaustion occurs during syntax-error reporting,
4167 report it separately rather than in a single diagnostic; this
4168 eases translation.
4169 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
4170 (Memory Exhausted): Renamed from Parser Stack Overflow.
4171 Revamp wording slightly to prefer "memory exhaustion".
4172 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
4173
97460c78
PE
4174 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
4175
30757c8c
PE
4176 Add i18n support to the GLR skeleton. Partially fix the C++
4177 skeleton; a C++ expert needs to finish this. Remove debugging
4178 msgids; there's little point to having them translated, since they
4179 can be understood only by someone who can read the
4180 (English-language) source code.
4181
4182 Generate runtime-po/bison-runtime.pot automatically, so that we
4183 don't have to worry about garbage getting in that file. We'll
4184 make sure after the next official release that old msgids don't
4185 get lost. See
4186 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
4187
4188 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
4189 Now auto-generated.
4190 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
4191 Fix typos in explanations of the runtime file.
4192 * bootstrap: Change gettext keyword from YYI18N to YY_.
4193 Use standard Makefile.in.in in runtime-po, since we'll arrange
4194 for backward-compatible bison-runtime.po files in a different way.
4195 * data/glr.c (YY_): New macro, from yacc.c.
4196 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
4197 Translate messages intended for users.
4198 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
4199 the wording in the other skeletons. We don't know that the memory
4200 is virtual.
4201 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
4202 Use same method that yacc.c uses.
4203 Don't translate debugging messages.
4204 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
4205 it doesn't work (yet), and requires C++ expertise to fix.
4206 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
4207 Move defn to a more logical place, to be consistent with other
4208 skeletons.
4209 Don't translate debugging messages.
4210 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
4211 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
4212 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
4213 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
4214
ac8c5689
PE
4215 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
4216 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
4217 void, not int.
4218 * tests/glr-regression.at (Badly Collapsed GLR States):
4219 Likewise.
4220 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4221 yylex should return 0 at EOF rather than aborting.
4222
6100a9aa
PE
4223 Improve tests for stack overflow in GLR parser.
4224 Problem reported by twlevo@xs4all.nl.
4225 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
4226 All uses removed.
4227 (yyStackOverflow): Just longjmp, but with value 2 so that caller
4228 can handle the problem.
4229 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
4230 (yyparse): New local variable yyresult to record the result.
4231 Use result of setjmp to set it, rather than storing itinto
4232 struct.
4233 (yyDone): Remove label.
4234 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
4235 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
4236 if YYABORT is used).
4237 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
4238 yyparse status; put status > 1 into diagnostic.
4239 Check that status==2 works.
4240 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
4241 Use exit status 3 for failure to open (which shouldn't happen).
4242
15f40952
PE
42432005-07-17 Paul Eggert <eggert@cs.ucla.edu>
4244
67fd79c4
PE
4245 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
4246 1 on syntax error; just let yyparse do its thing.
4247 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
4248 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
4249 (Exploding the Stack Size with Alloca):
4250 (Exploding the Stack Size with Malloc):
4251 Expect exit status 2, not 1, since the parser is supposed to blow
4252 its stack. Problem reported by twlevo@xs4all.nl.
4253
15f40952
PE
4254 * data/glr.c (yyparse): Don't assume that the initial calls
4255 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
4256 Print a stack-overflow message and fail instead.
4257 Initialize the line-number information before creating the stack,
4258 so that the stack-overflow message can report line zero safely.
4259
f32c66b5
PE
42602005-07-14 Paul Eggert <eggert@cs.ucla.edu>
4261
a22ff96f 4262 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
4263 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
4264 (yyuserMerge): Provide a default case if b4_mergers is empty.
4265 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
4266 * tests/glr-regression.at
4267 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 4268 Add casts to pacify C++ compilers.
1beb0b24
PE
4269 * tests/glr-regression.at (Improper merging of GLR delayed action
4270 sets): Declare yylex before using it.
f32c66b5 4271 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
4272 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
4273 test for valgrind; valgrind is independent of g++.
4274 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
4275 for compatibility with POSIX 1003.1-2001 (if running coreutils).
4276 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
4277 Use a destructor, so that we can expand the stack. Change
4278 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 4279
d741bd1b
PE
42802005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4281
4282 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
4283 a valgrind failure. Problem reported by twlevo@xs4all.nl.
4284
0410a6e0
PE
42852005-07-13 Paul Eggert <eggert@cs.ucla.edu>
4286
4287 * PACKAGING: New file, suggested by Bruno Haible and taken from
4288 similar wording in gettext's PACKAGING file.
4289 * NEWS: Mention PACKAGING.
4290 * Makefile.am (EXTRA_DIST): Add PACKAGING.
4291
f7ab6a50
PE
42922005-07-12 Paul Eggert <eggert@cs.ucla.edu>
4293
baf785db 4294 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
4295 * bootstrap: Get runtime translations into runtime-po.
4296 Create runtime-po files automatically, if possible.
4297 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
4298 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
4299 does not infringe on the user's name space.
4300 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
4301 * doc/bison.texinfo (Internationalization): Revamp the English
4302 and Texinfo syntax a bit, to try to make it clearer.
4303 (Bison Options, Option Cross Key): Mention --print-localedir.
4304 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
4305 YYENABLE_NLS. Quote a bit more.
4306 * runtime-po/.cvsignore: New file.
4307 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
4308 * runtime-po/Rules-quot: Remove; now created by bootstrap.
4309 * runtime-po/quot.sed: Likewise.
4310 * runtime-po/boldquot.sed: Likewise.
4311 * runtime-po/en@quot.header: Likewise.
4312 * runtime-po/en@boldquot.header: Likewise.
4313 * runtime-po/insert-header.sin: Likewise.
4314 * runtime-po/remove-potcdate.sin: Likewise.
4315 * runtime-po/Makevars: Likewise.
4316 * runtime-po/LINGUAS: Likewise.
4317 * runtime-po/de.po: Likewise; we will rely on the translation project
4318 to maintain this, so "bootstrap" should get it.
0410a6e0 4319 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
4320 its value.
4321 * src/main.c (main): Bind the bison-runtime domain, too.
4322
43232005-07-12 Bruno Haible <bruno@clisp.org>
4324
4325 * data/yacc.c: Include <libintl.h> when NLS is enabled.
4326 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
4327 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
4328 * runtime-po: New directory.
4329 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
4330 $(DOMAIN).pot-update rule, so that old messages are never dropped.
4331 * runtime-po/Rules-quot: New file, copied from po/.
4332 * runtime-po/quot.sed: Likewise.
4333 * runtime-po/boldquot.sed: Likewise.
4334 * runtime-po/en@quot.header: Likewise.
4335 * runtime-po/en@boldquot.header: Likewise.
4336 * runtime-po/insert-header.sin: Likewise.
4337 * runtime-po/remove-potcdate.sin: Likewise.
4338 * runtime-po/Makevars: New file.
4339 * runtime-po/POTFILES.in: New file.
4340 * runtime-po/LINGUAS: New file.
4341 * runtime-po/bison-runtime.pot: New file.
4342 * runtime-po/de.po: New file.
4343 * m4/bison.m4: New file.
4344 * Makefile.am (SUBDIRS): Add runtime-po.
4345 (aclocaldir, aclocal_DATA): New variables.
4346 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
4347 Define aclocaldir.
4348 * src/getargs.c (usage): Document --print-localedir option.
4349 (PRINT_LOCALEDIR_OPTION): New enum item.
4350 (long_options): Add --print-localedir option.
4351 (getargs): Handle --print-localedir option.
4352 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
4353 (Internationalization): New section.
4354
22dda0f0
AD
43552005-07-12 Akim Demaille <akim@epita.fr>
4356
4357 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
4358 for consistency with the rest of the code.
4359 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
4360 Add separators.
4361
82b248ad
AD
43622005-07-12 Akim Demaille <akim@epita.fr>
4363
4364 * src/parse-gram.y: Use %printer instead of YYPRINT.
4365
fa0e9314
AD
43662005-07-12 Akim Demaille <akim@epita.fr>
4367
867a3e00
AD
4368 * src/symtab.h, src/symtab.c (symbol_print): New.
4369 * src/symlist.h, src/symlist.c (symbol_list_print): New.
4370 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
4371
43722005-07-12 Akim Demaille <akim@epita.fr>
4373
4374 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
4375 b4_at_dollar and b4_dollar_dollar.
4376
e054b190
PE
43772005-07-11 Paul Eggert <eggert@cs.ucla.edu>
4378
4379 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
4380 and Pennello's paper.
4381
34160ec4
PE
43822005-07-09 Paul Eggert <eggert@cs.ucla.edu>
4383
407d4a75
PE
4384 * data/yacc.c (yyparse): Undo previous patch. Instead,
4385 set yylsp[0] and yyvsp[0] only if the initial action
4386 sets yylloc and yylval, respectively.
4387
34160ec4
PE
4388 * data/yacc.c (yyparse): In the initial action, set
4389 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
4390 This avoids the use of undefined variables if the initial
4391 action does not set yylloc and/or yylval.
4392
c3d5a4a7
PE
43932005-07-07 Paul Eggert <eggert@cs.ucla.edu>
4394
b34d96c1
PE
4395 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
4396 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
4397 Remove from CVS. These files are automatically generated.
4398 * examples/extexi: Clarify that this file is now part of Bison,
4399 not GNU M4, and that it works with any POSIX-compatible Awk.
4400 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
4401 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
4402 so that we also get calc++-parser.yy. Geneate it.
4403 Use $(AWK), not gawk, since any conforming Awk will do.
4404 Put comment before action, since older 'make' can't handle comment
4405 in action.
4406 $(BUILT_SOURCES): List all built sources, not just some of them.
4407 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
4408 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
4409 $($(calc_sources_generated)): Remove unnecessary test for existence
4410 of target. (This had a shell syntax error anyway; a stray "x".)
4411 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
4412 calc++-parser.yy.
4413 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
4414
c3d5a4a7
PE
4415 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
4416 implied by the other modules.
4417
828c373b
AD
44182005-07-06 Akim Demaille <akim@epita.fr>
4419
4420 Bind examples/calc++ to the package.
4421 * examples/calc++/Makefile: Remove, replaced by...
4422 * examples/calc++/Makefile.am: ... this new file.
4423 * examples/calc++/test: Remove input.
4424 * examples/calc++/compile: Remove.
4425 * examples/Makefile.am: New.
4426 * configure.ac, Makefile.am: Adjust.
4427 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
4428
63cb01d6
PE
44292005-07-05 Paul Eggert <eggert@cs.ucla.edu>
4430
fd2df2ed
PE
4431 * data/glr.c (yyFail): Drastically simplify; since the format argument
4432 never had any % directives, we can simply pass it to yyerror.
4433 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
4434 be modified later, as that is the usual style in glr.c.
4435 Problems reported by Paul Hilfinger.
4436
63cb01d6
PE
4437 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
4438 and size overflow errors.
4439 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
4440 in case the user prolog sets feature-test macros like _GNU_SOURCE.
4441 (YYSIZEMAX): New macro.
4442 (yystpcpy): New function, taken from yacc.c.
4443 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
4444 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
4445 so that we don't have to maintain their signatures.
4446 (yyFail): Check for buffer overflow, by using vsnprintf rather
4447 than vsprintf. Allocate a bigger buffer if possible.
4448 Report an error if buffer allocation fails.
4449 (yyStackOverflow): New function.
4450 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
4451 the initialization was successful. It might fail if storage was
4452 exhausted.
4453 (yyexpandGLRStack): Add more checks for storage allocation failure.
4454 Use yyStackOverflow to report failures.
4455 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
4456 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
4457 Don't assume stack number fits in int.
4458 (yysplitStack): Check for storage allocation failure.
4459 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
4460 can print diagnostics on storage allocation failure. All callers
4461 changed.
4462 (yyresolveValue): Use yybool for boolean.
4463 (yyreportSyntaxError): Check for size-calculation overflow.
4464 This code is taken from yacc.c.
4465 (yyparse): Check for storage allocation errors when allocating
4466 the initial stack.
4467
1c59e0a1
AD
44682005-07-05 Akim Demaille <akim@epita.fr>
4469
4470 Extract calc++ from the documentation.
4471 * doc/bison.texinfo (Calc++): Add the extraction marks.
4472 * examples/extexi: New, from the aborted GNU Programming 2E.
4473 Separate the different paragraph of a file with empty lines.
4474 * examples/Makefile: Use it to extract the whole calc++ example.
4475
8a0adb01
AD
44762005-06-24 Akim Demaille <akim@epita.fr>
4477
4478 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
4479 class typedefs.
4480
12545799
AD
44812005-06-22 Akim Demaille <akim@epita.fr>
4482
4483 * doc/bison.texinfo (C++ Language Interface): First stab.
4484 (C++ Parsers): Remove.
4485
99be0235
AD
44862005-06-22 Akim Demaille <akim@epita.fr>
4487
4488 * data/lalr1.cc (yylex_): Honor %lex-param.
4489
0ffd4fd1
AD
44902005-06-22 Akim Demaille <akim@epita.fr>
4491
4492 Start a set of simple examples.
4493 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
4494 * examples/calc++/calc++-driver.hh,
4495 * examples/calc++/calc++-parser.yy,
4496 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
4497 * examples/calc++/compile, examples/calc++/test: New.
4498
0925ebb4
PE
44992005-06-09 Paul Eggert <eggert@cs.ucla.edu>
4500
4501 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
4502 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
4503 which stems from the 2005-05-27 patch.
4504
43d3b664
PH
45052005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4506
4507 * data/glr.c: Modify treatment of unused parameters to permit use
4508 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
4509
3062864d
PE
45102005-05-30 Paul Eggert <eggert@cs.ucla.edu>
4511
4512 Fix infringement on user name space reported by Janos Zoltan Szabo.
4513 * data/yacc.c (yyparse): strlen -> yystrlen.
4514
989b5b8e
AD
45152005-05-30 Akim Demaille <akim@epita.fr>
4516
4517 * data/lalr1.cc (_): New.
4518 Translate the various messages.
4519
bedf57f5
PE
45202005-05-27 Paul Eggert <eggert@cs.ucla.edu>
4521
4522 Fix infringement on user name space reported by Bruno Haible.
4523 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
4524 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
4525 the user's name space.
4526 (alloca): Include <stdlib.h> to get it, if it's not built in.
4527 (YYMALLOC, YYFREE): Define only if needed.
4528 (malloc, free): Declare, but only if needed, as this infringes on
4529 the user name space.
4530
4d1801f1
PE
45312005-05-25 Paul Eggert <eggert@cs.ucla.edu>
4532
4533 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
4534 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
4535 with %d format.
4536 * lib/ebitset.c (min, max): Undef before defining.
4537 * lib/vbitset.c (min, max): Likewise.
4538 * lib/subpipe.c (create_subpipe): Save local variables in case
4539 vfork clobbers them.
4540
45412005-05-24 Bruno Haible <bruno@clisp.org>
4542
4543 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
4544 error message syntax used by gcc-4.0.
4545
b94a9e1e
PE
45462005-05-23 Paul Eggert <eggert@cs.ucla.edu>
4547
85ac3861
PE
4548 * README: Mention m4 1.4.3. Remove obsolete advice about
4549 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
4550
b94a9e1e
PE
4551 * bootstrap: Remove workaround for problem I encountered with
4552 gettext 0.14.1; it seems to be fixed now.
4553
51c30d21
PE
45542005-05-22 Paul Eggert <eggert@cs.ucla.edu>
4555
009ce67d
PE
4556 * NEWS: Version 2.0a.
4557
f2a97c62
PE
4558 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
4559 the previous change.
4560
c8775f93
PE
4561 Various maintainer cleanups.
4562 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
4563 conftest*, for benefit of CVS commands run at the same time as
4564 "configure". Add build-aux, since "bootstrap" now creates it and
4565 its subfiles.
4566 * Makefile.cfg (move_if_change): Remove.
4567 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
4568 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
4569 (po_repo, do-po-update, po-update, wget_files, get-targets):
4570 (config.guess-url_prefix, config.sub-url_prefix):
4571 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
4572 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
4573 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
4574 Remove.
4575 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
4576 this is now the recommended name.
4577 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
4578 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
4579 ylwrap. These files now go into build-aux.
4580 * config/move-if-change: Remove.
4581 * config/prev-version.txt: Bump from 1.75 to 2.0.
4582
3ea5f0ec
PE
4583 * bootstrap: Add stdio-safer, unistd-safer modules.
4584 Remove m4/glibc2.m4 (introduced by latest gnulib, but
4585 we don't need it).
4586 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
4587 fopen-safer.c, stdio-safer.h, unistd-safer.h.
4588 * lib/subpipe.c: Include "unistd-safer.h".
4589 (create_subpipe): Make sure all the newly-created
4590 file descriptors are > 2, so that diagnostics don't
4591 get sent down them (which might cause Bison to hang, in theory).
4592 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
4593 * src/files.c (xfopen): Use fopen_safer, not fopen.
4594
51c30d21
PE
4595 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
4596 yesterday's yacc.c fix.
4597
cea1469d
PE
45982005-05-21 Paul Eggert <eggert@cs.ucla.edu>
4599
3ea5f0ec
PE
4600 * data/glr.c, data/lalr1.cc: Update copyright date.
4601
cea1469d
PE
4602 Fix a destructor bug reported by Wolfgang Spraul in
4603 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
4604 * data/yacc.c (yyabortlab): Don't call destructor, and
4605 don't set yychar to EMPTY.
4606 (yyoverflowlab): Don't call destructor.
4607 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
4608 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
4609 since we no longer output the message "discarding lookahead token
4610 end of input ()".
4611
5e6f62f2
PH
46122005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4613
4614 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
4615 fix a small glitch in debugging output.
4616 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
4617 after YY_SYMBOL_PRINT where needed.
4618
4619 (struct yyGLRState): Add some comments.
4620 (struct yySemanticOption): Add some comments.
4621 (union yyGLRStackItem): Add comment.
4622
4623 (yymergeOptionSets): Correct this to properly perform the union,
4624 avoiding infinite reported by Michael Rosien.
4625 Update comment.
4626
4627 * tests/glr-regression.at: Add test for GLR merging error reported
4628 by M. Rosien.
cea1469d 4629
0fb669f9
PE
46302005-05-13 Paul Eggert <eggert@cs.ucla.edu>
4631
4632 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
4633 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
4634 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
4635 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
4636 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
4637 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
4638 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
4639 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
4640 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
4641 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
4642 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
4643 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
4644 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
4645 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
4646 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
4647 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
4648 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
4649 src/derives.h, src/files.c, src/files.h, src/getargs.c,
4650 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
4651 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
4652 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
4653 src/output.h, src/parse-gram.c, src/parse-gram.h,
4654 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
4655 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
4656 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
4657 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
4658 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
4659 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
4660 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
4661 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
4662 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
4663 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
4664 tests/reduce.at, tests/regression.at, tests/sets.at,
4665 tests/synclines.at, tests/testsuite.at, tests/torture.at:
4666 Update FSF postal mail address.
4667
51f4735e
PE
46682005-05-11 Paul Eggert <eggert@cs.ucla.edu>
4669
4670 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
4671 Problem reported by Ralf Menzel.
4672
80ce3401
PE
46732005-05-01 Paul Eggert <eggert@cs.ucla.edu>
4674
4675 * tests/actions.at: Test that stack overflow invokes destructors.
4676 From Marcus Holland-Moritz.
4677 * data/yacc.c (yyerrlab): Move the code that destroys the stack
4678 from here....
4679 (yyreturn): to here. That way, destructors are called properly
4680 even if the stack overflows, or the user calls YYACCEPT or
4681 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
4682 (yyoverflowlab): Destroy the lookahead.
4683
46842005-04-24 Paul Eggert <eggert@cs.ucla.edu>
4685
4686 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
4687
72f000b0
PE
46882005-04-17 Paul Eggert <eggert@cs.ucla.edu>
4689
4690 * NEWS: Bison-generated C parsers no longer quote literal strings
4691 associated with tokens.
4692 * src/output.c (prepare_symbols): Don't escape strings,
4693 since users don't want to see C escapes.
4694 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
4695 in diagnostics.
c19683bb 4696 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
4697 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
4698
1094323f
PE
46992005-04-16 Paul Eggert <eggert@cs.ucla.edu>
4700
4701 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
4702 the data size is known to be too small and we can't increase it.
4703 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
4704
ca407bdf
PE
47052005-04-15 Paul Eggert <eggert@cs.ucla.edu>
4706
4707 * src/parse-gram.y: Include quotearg.h.
4708 (string_as_id): Quote $1 before using it as a key, since the
4709 lexer no longer quotes it for us.
4710 (string_content): Don't strip quotes, since lexer no longer
4711 quotes it for us.
4712 * src/scan-gram.l: Include quotearg.h.
4713 ("\""): Omit quote.
4714 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
4715 a key, since the rest of the lexer doesn't quote it.
4716 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
4717 * tests/regression.at (Token definitions): Check for backslashes
4718 in token strings.
4719
4720 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
4721 (YYSIZE_T): Define to unsigned long int when using an older compiler.
4722 (yyparse): Revamp code to generate long syntax error message, to
4723 make it easier to translate, and to avoid problems with arithmetic
4724 overflow. Change "virtual memory" to "memory" in diagnostic, since
4725 we don't know whether the memory is virtual.
4726
1ce59070
PE
47272005-04-13 Paul Eggert <eggert@cs.ucla.edu>
4728
4729 * NEWS: Bison-generated C parsers now use the _ macro to
4730 translate strings.
4731 * data/yacc.c (_) [!defined _]: New macro.
4732 All English strings wrapped inside this macro.
4733 * doc/bison.texinfo (Bison Parser): Document _.
4734 * po/POTFILES.in: Include src/parse-gram.c, since it now
4735 includes translateable strings that parse-gram.y doesn't.
4736
a749a695
PE
47372005-04-12 Paul Eggert <eggert@cs.ucla.edu>
4738
4739 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
4740 reverting the 2004-10-11 change to this function.
4741 (symbol_check_alias_consistency): Don't call symbol_type_set
4742 if the type name is already correct.
4743 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
4744
8fb1053b
PE
47452005-03-25 Paul Eggert <eggert@cs.ucla.edu>
4746
4747 * tests/regression.at (Token definitions): Don't use a token named
4748 c, as that generates a "#define c ..." that runs afoul of buggy
4749 stdlib.h that uses the identifier c as a member of struct
4750 drand48_data. Problem reported by Horst Wente.
4751
ff498c4a
PE
47522005-03-21 Paul Eggert <eggert@cs.ucla.edu>
4753
4754 * bootstrap: Change translation URL from
4755 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
4756 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
4757 redirection glitches. Problem reported by twlevo@xs4all.nl.
4758
65211d70
PE
47592005-03-20 Paul Eggert <eggert@cs.ucla.edu>
4760
4761 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
4762 after operands; POSIX says this isn't portable for the c99 command.
4763
9577fb1f
PE
47642005-03-18 Paul Eggert <eggert@cs.ucla.edu>
4765
4766 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
4767 immediately if a data overrun has occurred; this may help us track
4768 down what may be a spurious failure on MacOS.
4769
78b178f7
PE
47702005-03-17 Paul Eggert <eggert@cs.ucla.edu>
4771
a2599d0f
PE
4772 Respond to problems reported by twlevo@xs4all.nl.
4773
4774 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
4775
78b178f7
PE
4776 * src/vcg.h: Comment fix.
4777 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
4778 (G_CMAX): Change to -1 instead of INT_MAX.
4779
4780 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 4781
7296e729
PE
47822005-03-15 Paul Eggert <eggert@cs.ucla.edu>
4783
4784 * src/tables.c (state_number_to_vector_number): Put it inside an
4785 "#if 0", since it's not currently used. Problem reported by
4786 Roland McGrath.
4787
05ac60f3
PE
47882005-03-06 Paul Eggert <eggert@cs.ucla.edu>
4789
4790 * src/output.c (escaped_output): Renamed from
4791 escaped_file_name_output, since we now use it for symbol tags as
4792 well. All uses changed.
4793 (symbol_destructors_output, symbol_printers_output):
4794 Escape symbol tags too.
4795 Problem reported by Matyas Forstner in
4796 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
4797
4798 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
4799 not needed.
4800 * src/output.c (user_actions_output, token_definitions_output,
4801 symbol_destructors_output, symbol_printers_output): Likewise.
4802 * src/reader.c (prologue_augment): Likewise.
4803 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
4804
4805 * src/vcg.c (output_edge): Don't quote linestyle arg.
4806 Problem reported by twlevo@xs4all.nl.
4807
7eb453ac
PE
48082005-02-28 Paul Eggert <eggert@cs.ucla.edu>
4809
4810 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
4811 example, reported by Derek M Jones. Also, make the example even
4812 more outrageous, to better illustrate how bad the problem is.
4813
4c04c52a
PE
48142005-02-24 Paul Eggert <eggert@cs.ucla.edu>
4815
4816 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
4817 putsym. Typo reported by Sebastian Piping.
4818
a61e1620
PE
48192005-02-23 Paul Eggert <eggert@cs.ucla.edu>
4820
4821 * doc/bison.texinfo (Language and Grammar): some -> same
4822 (Epilogue): int he -> in the
4823 Typos reported by Sebastian Piping via Justin Pence.
4824
9ec93868
PE
48252005-02-07 Paul Eggert <eggert@cs.ucla.edu>
4826
4827 * tests/glr-regression.at (Improper handling of embedded actions
4828 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
4829 embedded actions and $-N in GLR parsers", work around an Autoconf bug
4830 with dollar signs in test names.
4831 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
4832 for a similar reason.
4833
73ce7e7e
PE
48342005-01-28 Paul Eggert <eggert@cs.ucla.edu>
4835
4836 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
4837 wants to redefine G_VIEW.
4838
2e72b98e
PE
48392005-01-27 Paul Eggert <eggert@cs.ucla.edu>
4840
4841 * src/vcg.c (get_view_str): Remove case for normal_view.
4842 Problem reported by twlevo@xs4all.nl.
4843
e0d634e5
PE
48442005-01-24 Paul Eggert <eggert@cs.ucla.edu>
4845
ccf830a4
PE
4846 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
4847 Problem reported by twlevo@xs4all.nl.
4848
e0d634e5
PE
4849 * doc/bison.texinfo: Change @dircategory from "GNU programming
4850 tools" to "Software development". Requested by Richard Stallman
4851 via Karl Berry.
4852
7bbc8cb0
PE
48532005-01-23 Paul Eggert <eggert@cs.ucla.edu>
4854
4855 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
4856 Problem reported by twlevo@xs4all.nl.
4857
08b770bc
PE
48582005-01-21 Paul Eggert <eggert@cs.ucla.edu>
4859
4860 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
4861 keyword; it's not needed with modern compilers, and it doesn't
4862 affect correctness with older compilers. Suggested by
4863 twlevo@xs4all.nl.
4864
95f22ad2
PE
48652005-01-17 Paul Eggert <eggert@cs.ucla.edu>
4866
4867 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
4868 gcc -Wswitch-default.
4869 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
4870 * data/yacc.c (yyparse): Likewise.
4871
d229d15c
PE
48722005-01-12 Paul Eggert <eggert@cs.ucla.edu>
4873
4874 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
4875 already. Let config.h define any nonstandard values.
4876
ecadd90f
PE
48772005-01-10 Paul Eggert <eggert@cs.ucla.edu>
4878
4879 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
4880 for the benefit of slower hosts. Problem reported by
4881 Nelson H. F. Beebe.
4882
213744b5
PE
48832005-01-07 Paul Eggert <eggert@cs.ucla.edu>
4884
4885 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
4886 being defined and not used.
4887 * data/lalr1.cc (yyparse): Likewise.
4888 Use "if (false)" rather than "if (0)".
4889
249d3236
PE
48902005-01-05 Paul Eggert <eggert@cs.ucla.edu>
4891
4892 * TODO: Mention that we should allow NUL bytes in tokens.
4893
987cc1fb
PE
48942005-01-02 Paul Eggert <eggert@cs.ucla.edu>
4895
4896 * src/scan-skel.l (<<EOF>>): Don't close standard output.
4897 Problem reported by Hans Aberg.
4898
08fe02d9
PE
48992005-01-01 Paul Eggert <eggert@cs.ucla.edu>
4900
4901 * src/getargs.c (version): Happy new year; update overall
4902 program copyright date from 2004 to 2005.
4903
4904 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
4905 Problem reported by Hans Aberg.
4906 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
4907 (Output file names.): Add a test for the case when standard output
4908 is closed.
4909
010c0266
PE
49102004-12-26 Paul Eggert <eggert@cs.ucla.edu>
4911
4912 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
4913 to fix an oversight in the Bison 2.0 manual.
4914
da12206a
PE
49152004-12-25 Paul Eggert <eggert@cs.ucla.edu>
4916
4917 * NEWS: Version 2.0. Reformat the existing news items since
4918 1.875, so that related items are grouped together.
3a4734aa 4919 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
4920 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
4921
c935d934
PE
4922 * tests/torture.at (Exploding the Stack Size with Alloca): Set
4923 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
4924 otherwise, we're not testing alloca. Unfortunately there's no
4925 simple way to consult HAVE_ALLOCA here.
4926
da12206a
PE
4927 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
4928 for yymsg, too.
4929
4930 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
4931 hand. This avoids a warning about comparing int to size_t when
4932 GCC warnings are enabled.
4933
0a2c5137
PE
49342004-12-22 Paul Eggert <eggert@cs.ucla.edu>
4935
d7e14fc0
PE
4936 * NEWS: Bison-generated parsers no longer default to using the
4937 alloca function (when available) to extend the parser stack, due
4938 to widespread problems in unchecked stack-overflow detection.
4939 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
4940 responsibility to set it to a positive value. This lets the user
4941 specify a value that is not a preprocessor constant.
4942 * data/yacc.c (YYMAXDEPTH): Likewise.
4943 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
4944 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
4945 to be a compile-time constant. However, explain the constraints on it.
4946 Also, explain the constraints on YYINITDEPTH.
4947 (Table of Symbols): Explain that alloca is no longer the default.
4948 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
4949 to 1.
4950
0a2c5137
PE
4951 * doc/bison.texinfo (Location Default Action): Mention that n must
4952 be zero when k is zero. Suggested by Frank Heckenbach.
4953
e019c247
AD
49542004-12-22 Akim Demaille <akim@epita.fr>
4955
4956 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
4957 (parser::state_type, parser::semantic_type, parser::location_type):
4958 Private, not public.
4959 (parser::parse): Return ints, not bool.
4960 Returning a bool introduces a problem: 0 corresponds to false, and
4961 it seems weird to return false on success. Returning true changes
4962 the conventions for yyparse.
4963 Alternatively we could return void and send an exception.
4964 There is no clear consensus (yet?).
4965 (state_stack, semantic_stack, location_stack): Rename as...
4966 (state_stack_type, semantic_stack_type, location_stack_type): these.
4967 Private, not public.
4968 * tests/c++.at: New.
4969 * tests/testsuite.at, tests/Makefile.am: Adjust.
4970
72731bb7
AD
49712004-12-21 Akim Demaille <akim@epita.fr>
4972
4973 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
4974
9a0d8bec
AD
49752004-12-21 Akim Demaille <akim@epita.fr>
4976
4977 Don't impose std::string for filenames.
4978
4979 * data/lalr1.cc (b4_filename_type): New.
4980 (position::filename): Use it.
4981 (parser.hh): Move the inclusion of stack.hh and location.hh below
4982 the user code, so that needed headers for the filename type can be
4983 included first.
72731bb7
AD
4984 Forward declare them before the user code.
4985 * tests/Makefile.am (check-local, installcheck-local): Pass
4986 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 4987
99880de5
AD
49882004-12-20 Akim Demaille <akim@epita.fr>
4989
4990 Use more STL like names: my_class instead of MyClass.
4991
4992 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
4993 (SemanticStack, SemanticType, StateStack, StateType)
4994 (TokenNumberType, Stack, Slice, Traits, Parser::location)
4995 (Parser::value): Rename as...
4996 (location_stack, location_type, rhs_number_type, semantic_stack)
4997 (semantic_type, state_stack, state_type, token_number_type, stack)
4998 (slice, traits, parser::yylloc, parser::yylval): these.
4999
5000 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
5001
9bec482e
PE
50022004-12-19 Paul Eggert <eggert@cs.ucla.edu>
5003
5004 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
5005 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
5006
f6fbd3da
PE
50072004-12-17 Paul Eggert <eggert@cs.ucla.edu>
5008
5009 Remove uses of 'short int' and 'unsigned short int'. This raises
5010 some arbitrary limits. It uses more memory but nowadays that's
5011 not much of an issue.
5012
5013 This change does not affect the generated parsers; that's a different
5014 task, as some users will want to conserve memory there.
5015
5016 Ideally we should use size_t to represent all object counts, and
5017 something like ptrdiff_t to represent signed differences of object
5018 counts; but that will require more code-cleanup than I have the
5019 time to do right now.
5020
5021 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
5022 Use size_t, not int or short int, to count objects.
5023 * src/closure.c (nritemset, closure): Likewise.
5024 * src/closure.h (nritemset, closure): Likewise.
5025 * src/nullable.c (nullable_compute): Likewise.
5026 * src/print.c (print_core): Likewise.
5027 * src/print_graph.c (print_core): Likewise.
5028 * src/state.c (state_compare, state_hash): Likewise.
5029 * src/state.h (struct state): Likewise.
5030 * src/tables.c (default_goto, goto_actions): Likewise.
5031
5032 * src/gram.h (rule_number, rule): Use int, not short int.
5033 * src/output.c (prepare_rules): Likewise.
5034 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
5035 errs, reductions): Likewise.
5036 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
5037 Likewise.
5038 * src/tables.c (vector_number, tally, action_number,
5039 ACTION_NUMBER_MINIMUM): Likewise.
5040 * src/output.c (muscle_insert_short_int_table): Remove.
5041
efeed023
AD
50422004-12-17 Akim Demaille <akim@epita.fr>
5043
5044 * data/lalr1.cc: Extensive Doxygenation.
5045 (error_): Rename as...
5046 (error): this, since it is visible to the user.
5047 Adjust callers.
5048 (Parser::message): Now an automatic variable from...
5049 (Parser::yyreport_syntax_error_): here.
5050 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
5051 Parser::error.
5052 * tests/input.at: Escape $.
5053
bc82c5a5
PE
50542004-12-16 Paul Eggert <eggert@cs.ucla.edu>
5055
5056 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
5057 Parenthesize rhs to avoid obscure problems with mistakes like
5058 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
5059 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5060 b4_rhs_location): Likewise.
5061 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5062 b4_rhs_location): Likewise.
5063
fd19f271
AD
50642004-12-16 Akim Demaille <akim@epita.fr>
5065
5066 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
5067 yacc.c: be sure to stay within yycheck_.
5068 * tests/actions.at: Re-enable C++ tests.
5069
10454ea4
AD
50702004-12-16 Akim Demaille <akim@epita.fr>
5071
5072 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
5073 real.
5074
c5b95ccf
AD
50752004-12-16 Akim Demaille <akim@epita.fr>
5076
5077 Use #define to handle the %name-prefix.
5078
5079 * data/glr.c, data/yacc.c: Comment changes.
5080 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
5081 so that one can refer to yylex in the parser file, and have it
5082 renamed, as is the case with other skeletons.
5083
617a8f12
AD
50842004-12-16 Akim Demaille <akim@epita.fr>
5085
5086 Move lalr1.cc internals into yy*.
5087
5088 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
5089 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
5090 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
5091 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
5092 (empty_, final_, terror_, errcode_, ntokens_)
5093 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
5094 (looka_, ilooka_, error_range_, nerrs_):
5095 Rename as...
5096 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
5097 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
5098 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
5099 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
5100 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
5101 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
5102 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
5103 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
5104 these.
5105
1e547e6e
PE
51062004-12-15 Paul Eggert <eggert@cs.ucla.edu>
5107
5108 Fix some problems reported by twlevo at xs4all.
5109 * src/symtab.c (symbol_new): Report an error if the input grammar
5110 contains too many symbols. This is better than calling abort() later.
5111 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
5112 (struct node, struct graph):
5113 Rename member expand to stretch. All uses changed.
5114 (struct graph): Remove member layoutalgorithm. All uses removed.
5115 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
5116 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
5117 All uses changed.
5118 (N_STRETCH): Rename from N_EXPAND. All uses changed.
5119
735d6bd4
AD
51202004-12-15 Akim Demaille <akim@epita.fr>
5121
5122 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
5123 Add more Doxygen comments.
5124 (symprint_, stack_print_, reduce_print_, destruct_, pop)
5125 (report_syntax_error_, translate_): Rename as...
5126 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
5127 (yypop_, yyreport_syntax_error_, yytranslate_): this.
5128
2e1f5829
AD
51292004-12-15 Akim Demaille <akim@epita.fr>
5130
5131 * data/lalr1.cc (lex_): Rename as...
5132 (yylex_): this.
5133 Move the trace here.
5134 Take the %name-prefix into account.
5135 Reported by Alexandre Duret-Lutz.
5136
a3cb6248
AD
51372004-12-15 Akim Demaille <akim@epita.fr>
5138
5139 Simplify the C++ parser constructor.
5140
5141 * data/lalr1.cc (debug_): Rename as...
5142 (yydebug_): so that the parser's internals are always in the yy*
5143 pseudo namespace.
5144 Adjust uses.
5145 (b4_parse_param_decl): Remove the leading comma as it is now only
5146 called as unique argument list.
5147 (Parser::Parser): Remove the constructor accepting a location and
5148 an initial debugging level.
5149 Remove from the other ctor the argument for the debugging level.
5150 (debug_level_type, debug_level, set_debug_level): New.
5151
5152 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
5153 constructor calls.
5154
07fed891
AD
51552004-12-15 Akim Demaille <akim@epita.fr>
5156
5157 Remove b4_root related material: failure experiment
a3cb6248 5158 (which goal was to allow to derive from a class).
07fed891
AD
5159
5160 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
5161 definitions and uses.
5162
e603eaa5
PE
51632004-12-14 Paul Eggert <eggert@cs.ucla.edu>
5164
5165 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
5166 not 2, since it's not portable to subtract 1 from the start of an
5167 array. The new item 0 is never set or used. All uses changed.
5168
5169 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
5170 the default definition of YYLLOC_DEFAULT. Problem reported
5171 by Frank Heckenbach.
5172
fafb007d
PE
51732004-12-12 Paul Eggert <eggert@cs.ucla.edu>
5174
5175 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
5176 the normal case and one for the error case. Just use the
5177 first one uniformly. Problem reported by Frank Heckenbach.
5178 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
5179 use exactly the same macro in both places.
5180 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
5181 so that the normal-case YYRHSLOC works for the error case too.
5182 All uses changed.
5183 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
5184 (YYLLOC_DEFAULT): Use the same macro as glr.c.
5185 * doc/bison.texinfo (Location Default Action): Don't claim that
5186 we have an array of locations. Use the same macro for both glr
5187 and lalr parsers. Mention YYRHSLOC. Mention what happens when
5188 the index is 0.
5189
48814dcd
PE
51902004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5191
a4e1a53b
PE
5192 * HACKING: Update email addresses to send announcements to.
5193
48814dcd
PE
5194 * configure.ac (AC_INIT): Bump version to 1.875f.
5195
337116ba
PE
51962004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5197
5198 * NEWS: Version 1.875e.
5199 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
5200
5201 * src/scan-skel.l: Include "complain.h", for "fatal".
5202
5203 * src/relation.h (relation_print, relation_digraph):
5204 Relation sizes are of type relation_node, not size_t (this is
5205 merely a doc fix, since the two types are equivalent).
5206 (relation_transpose): Relation sizes are of type relation_node,
5207 not int.
5208 * src/relation.c: Likewise.
5209 (top, infinity): Now of type relation_node, not int.
5210 (traverse, relation_transpose): Use relation_node, not int.
5211
5212 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
5213 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
5214 (yyparse): Remove unused local introduced in 2004-10-25 patch.
5215
5216 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 5217 specifying whether the test should be skipped. Use it tp
337116ba 5218 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 5219 fail on some hosts, and should be skipped.
337116ba 5220
da2a7671
PE
52212004-12-08 Paul Eggert <eggert@cs.ucla.edu>
5222
5223 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
5224 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
5225 unless otherwise specified below.
5226
5227 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
5228 to allocate kernel_base, kernel_items, kernel_size, since
5229 they needn't be initialized to 0.
5230 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
5231 * src/closure.c (new_closure): Likewise, for itemset.
5232 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
5233 * src/lalr.c (set_goto_map): Likewise, for temp_map.
5234 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
5235 (build_relations): Likewise for edge, states1, includes.
5236 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
5237 * src/reader.c (packgram): Likewise, for ritem, rules.
5238 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
5239 * src/relation.c (relation_digraph): Likewise for VERTICES.
5240 (relation_transpose): Likewise for new_R, end_R.
5241 * src/symtab.c (symbols_token_translations_init): Likewise for
5242 token_translations.
5243 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
5244 (token_actions): Likewise for yydefact, actrow, conflrow,
5245 conflict_list.
5246 (save_column): Likewise for froms[symno], tos[symno].
5247 (goto_actions): Likewise for state_count.
5248 (pack_table): Likewise for base, pos, check.
5249 (tables_generate): Likewise for width.
5250
5251 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
5252 for initial core. Just have a separate core, so we needn't worry
5253 about whether kernel_size and kernel_base are initialized.
5254
5255 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
5256 kernel_size, kernel_items): Remove unnecessary initialization.
5257 * src/conflicts.c (conflicts): Likewise.
5258 * src/derives.c (derives): Likewise.
5259 * src/muscle_tablc (muscle_insert): Likewise.
5260 * src/relation.c (relation_digraph): Likewise.
5261 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
5262 conflrow, conflict_table, conflict_list, table, check):
5263 Likewise.
5264
5265 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
5266 This is because all callers pass unsigned int.
5267 * src/closure.h (new_closure): Likewise.
5268
5269 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
5270 (build_relations): Initialize includes[i] in all cases.
5271 * src/reader.c (packgram): Always initialize rules[ruleno].prec
5272 and rules[ruleno].precsym. Initialize members in order.
5273 * src/relation.c (relation_transpose): Always initialize new_R[i]
5274 and end_R[i].
5275 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
5276
5277 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
5278 conflict_list[0] was always 0, but now it isn't initialized.
5279
5280 * src/table.c (table_grow): When conflict_table grew, the grown
5281 area wasn't cleared. Fix this.
5282
5283 * lib/.cvsignore: Add strdup.c, strdup.h.
5284 * m4/.cvsignore: Add strdup.m4.
5285
00baeeac
PE
52862004-12-07 Paul Eggert <eggert@cs.ucla.edu>
5287
5288 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
5289 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
5290 GOTO_NUMBER_MAXIMUM, since we occasionally compute
5291 ngotos + 1 without checking for overflow.
5292 (build_relations): Use END_NODE, not -1, to denote end of edges.
5293 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
5294 build_relations): Use goto_number, not int, for goto numbers.
5295 * src/tables.c (save_column, default_goto): Likewise.
5296
be3d9d42
AD
52972004-11-23 Akim Demaille <akim@epita.fr>
5298
5299 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
5300 of #defining from yystype.
5301 Don't typedef yystype, C++ does not need it.
5302 This lets it possible to forward declare it as union.
5303
78e526d5
PE
53042004-11-23 Paul Eggert <eggert@cs.ucla.edu>
5305
5306 * bootstrap (gnulib_modules): Add extensions.
5307 Problem reported by Jim Meyering.
5308
afbb696d
PE
53092004-11-22 Paul Eggert <eggert@cs.ucla.edu>
5310
5311 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
5312 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
5313 src/system.h, src/tables.c: XFREE -> free, to accommodate
5314 recent change to gnulib xalloc.h.
78e526d5 5315 Problem reported by Jim Meyering.
afbb696d 5316
c1f8f16a
AD
53172004-11-17 Akim Demaille <akim@epita.fr>
5318
5319 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
5320
db7e5eb5 53212004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
5322 Alexandre Duret-Lutz <adl@gnu.org>
5323
5324 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
5325 changes.
5326 (YYCDEBUG): Adjust.
5327 Use it instead of cdebug_.
5328 (Parser::debug_stream, Parser::set_debug_stream): New.
5329 (Parser::symprint_): Define cdebug_ for temporary backward
5330 compatibility.
5331 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
5332 debug_stream ().
5333
68e11668
AD
53342004-11-17 Akim Demaille <akim@epita.fr>
5335
5336 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
5337 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
5338 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
5339 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
5340
97cbc73e
PE
53412004-10-27 Paul Eggert <eggert@cs.ucla.edu>
5342
5343 * data/glr.c (yyloc_default): Remove; not used.
5344 Problem reported by Frank Heckenbach.
5345
e342c3be
AD
53462004-10-25 Akim Demaille <akim@epita.fr>
5347
5348 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
5349 Introduce another definition to address simple location arrays.
5350 (yyGLRStack): New member: yyerror_range.
5351 (yyrecoverSyntaxError, yyparse): Update it.
5352 (yyrecoverSyntaxError): Use it when shifting the error token to
5353 have an accurate range, equivalent to the one computed by both
5354 yacc.c and lalr1.cc.
5355 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
5356 that column numbers start at column 0, as per GNU Coding
5357 Standards, the others tests, and the doc.
5358 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
5359 Adjust to the above change (first column is 0).
5360 And adjust the location of the "<error>", now covering the whole
5361 line.
5362
93602feb 53632004-10-22 Akim Demaille <akim@epita.fr>
04098407 5364 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
5365
5366 Remove some arbitrary limits on goto numbers and relations.
5367 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
5368 initial values, since they're never used.
5369 (set_goto_map): ngotos is now unsigned, so test for overflow
5370 by seeing whether it wraps around to zero.
5371 * src/lalr.h (goto_number): Now size_t, not short int.
5372 (GOTO_NUMBER_MAXIMUM): Remove.
5373 * src/relation.c (relation_print, traverse, relation_transpose):
5374 Check for END_NODE rather than looking at sign.
5375 * src/relation.h (END_NODE): New macro.
5376 (relation_node): Now size_t, not short int.
5377
dba08b04
PE
53782004-10-22 Paul Eggert <eggert@cs.ucla.edu>
5379
5380 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
5381 keyword, not an identifier. Problem reported by Baron Schwartz in
5382 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
5383
df09ef2e
AD
53842004-10-11 Akim Demaille <akim@epita.fr>
5385
5386 * src/symtab.c (symbol_check_alias_consistency): Also check
5387 type names, destructors, and printers.
5388 Reported by Alexandre Duret-Lutz.
5389 Recode the handling of associativity and precedence in terms
5390 of symbol_precedence_set.
5391 Accept no redeclaration at all, not even equal to the previous
5392 value.
5393 (redeclaration): New.
5394 Use it to factor redeclaration complaints.
5395 (symbol_make_alias): Don't set the type of the alias, let
5396 symbol_check_alias_consistency do it as for other features.
5397 * src/symtab.h (symbol): Add new member prec_location, and
5398 type_location.
5399 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
5400 * tests/input.at (Incompatible Aliases): New.
5401
146bc99d
PE
54022004-10-09 Paul Eggert <eggert@cs.ucla.edu>
5403
5404 .cvsignore fixes to accommodate gnulib changes,
5405 and the practice of naming build directories "_build".
5406 * .cvsignore: Add "_*". Sort.
5407 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
5408 * m4/.cvsignore: Add "*_gl.m4".
5409
e503aa60
AD
54102004-10-06 Akim Demaille <akim@epita.fr>
5411
5412 * src/parse-gram.y (add_param): Fix the truncation of trailing
5413 spaces.
5414
b4a20338
AD
54152004-10-05 Akim Demaille <akim@epita.fr>
5416
5417 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
5418 whether the reducion was empty or not. This leaves room to
5419 improve the use of YYLLOC_DEFAULT in such a case.
5420 lalr1.cc is still experimental, so changing this is acceptable.
5421 And finally, there are probably not many users who changed the
5422 handling of locations in GLR, so changing is admissible too.
5423
5424 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
5425 empty reduction, set @$ to an empty location ending the previously
5426 stacked symbol.
5427 Adjust uses to make sure the code is triggered on empty
5428 reductions.
5429 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
5430 expected output: empty reductions have empty locations.
5431
f85a5e6f
AD
54322004-09-29 Akim Demaille <akim@epita.fr>
5433
5434 * data/lalr1.cc: Move towards a more standard C++ coding style
5435 for templates: Class < T > -> Class<T>.
5436
b203fc2c
AD
54372004-09-29 Akim Demaille <akim@epita.fr>
5438
5439 * data/lalr1.cc: Reinstall the former ctor, for sake of
5440 compatibility, but warn it will be removed.
5441 Move towards a more standard C++ coding style (i.e., type *var ->
5442 type* var).
5443
5b7e1e73
PE
54442004-09-27 Paul Eggert <eggert@cs.ucla.edu>
5445
3fee967f
PE
5446 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
5447 since it's less likely to work if NULs are involved in the future.
5b7e1e73 5448
0dcca5c2
AD
54492004-09-27 Akim Demaille <akim@epita.fr>
5450
5451 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
5452
6dde1c82
AD
54532004-09-27 Akim Demaille <akim@epita.fr>
5454
5455 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 5456 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
5457 and argument names.
5458 (b4_cc_constructor_call): Likewise.
5459
b233d555
AD
54602004-09-24 Akim Demaille <akim@epita.fr>
5461
5462 * src/parse-gram.y (add_param): Strip the leading and trailing
5463 blanks from a formal argument declaration.
5464 (YY_LOCATION_PRINT): New.
5465
619404e3
AD
54662004-09-24 Akim Demaille <akim@epita.fr>
5467
5468 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
5469 after the location.
5470
dd8d9022
AD
54712004-09-24 Akim Demaille <akim@epita.fr>
5472
5473 * doc/bison.texinfo (Table of Symbols): Sort.
5474
0092f063
AD
54752004-09-21 Akim Demaille <akim@epita.fr>
5476
5477 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
5478 the useless parentheses.
5479 Suggested by Paul Eggert.
5480
451364ed
AD
54812004-09-20 Akim Demaille <akim@epita.fr>
5482
5483 Let the initial-action act on the look-ahead, and use it for the
5484 "initial push" (corresponding to an hypothetical beginning-of-file).
5485 And let lalr1.cc honor %initial-action.
5486
5487 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
5488 example.
5489 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
5490 (Parser::Parser): Remove the ctor that used to initialize it.
5491 (Parser::parse): Like in the other skeletons, issue the "starting
5492 parse" message before any action.
5493 Honor %initial-action.
5494 Initialize the stacks with the lookahead.
5495 * data/yacc.c: Let $$ and @$ in %initial-action designate the
5496 look-ahead.
5497 Push them in the stacks.
5498 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
5499
18d192f0
AD
55002004-09-20 Akim Demaille <akim@epita.fr>
5501
5502 * doc/bison.texinfo (Initial Action Decl): New.
5503
b8458aa5
AD
55042004-09-20 Akim Demaille <akim@epita.fr>
5505
5506 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
5507 clearer criterion to define it.
5508 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
5509 When reducing on an empty RHS, use the latest stacked location as
5510 location.
5511 yylloc is not always available.
5512 * data/glr.c: Likewise.
5513 Also, honor initial-actions.
5514
3fc16193
AD
55152004-09-20 Akim Demaille <akim@epita.fr>
5516
5517 * data/yacc.c (YY_LOCATION_PRINT): New.
5518 Define when we know YYLTYPE's structure, i.e., when the default
5519 YYLLOC_DEFAULT is used.
5520 * data/c.m4 (b4_yysymprint_generate): Use it.
5521 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
5522 value of the result.
5523 (error_start_): Replace with...
5524 (error_range_): this location array.
5525 This allows to replace code relying on the implementation of
5526 locations by portable code.
5527 * data/yacc.c (yylerrsp): Replace with...
5528 (yyerror_range): this.
5529 Every time a token is popped, update yyerror_range[0], to have an
5530 accurate location for the error token.
5531 * data/glr.c (YY_LOCATION_PRINT): New.
5532 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
5533 deference a pointer.
5534 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
5535 report the location in %printers.
5536
5537 * src/scan-skel.l: Instead of abort, report error messages to ease
5538 understanding skeleton scanning failures.
5539
ecfe33e7
AD
55402004-09-16 Akim Demaille <akim@epita.fr>
5541
5542 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
5543 (iterator, const_iterator): these, to be more in the C++ spirit.
5544 Also, return reverse iterators so that when displaying the stack
5545 we display its bottom first.
5546 (Parser::stack_print_, Parser::reduce_print_): Match the messages
5547 from yacc.c.
5548 We should probably use vector here though.
5549
1576d44d
AD
55502004-09-16 Akim Demaille <akim@epita.fr>
5551
5552 Have more complete shift traces.
5553
5554 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
5555 to report Shifts instead of ad hoc YYDPRINTF invocations,
5556 including for the error token.
5557 * data/lalr1.cc (symprint_): Output the location.
5558 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
5559 output the location within the %printer.
5560 Activate GLR tests, at least to make sure they compile properly.
5561 They still don't pass though.
5562 * tests/calc.at: Adjust expect verbose output, since now "Entering
5563 state..." is on a different line than the "Shifting" message.
5564
9c66f418
AD
55652004-09-08 Akim Demaille <akim@epita.fr>
5566
5567 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
5568 Bison directive from the Bison file to the invocation of this
5569 macro, so that these directives are passed to
5570 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
5571 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
5572 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
5573 the extra Bison directives instead of the whole series.
5574 Change the grammar so that there are recoverable errors, and
5575 unrecoverable errors. Now we can have the parser give up before
5576 consuming the whole input. As a result we now can observe that
5577 the lookahead is freed when needed.
5578 Change the parser source to parse argv[1] instead of a hard coded
5579 string.
5580 Simplify yylex, and give a value and location to EOF.
5581 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
5582 passed directives already coded in the file.
5583 Add some tests to check the location of "error".
5584 For some tests, the C++ parser is correct, and not yacc.c.
5585 For other tests, they provide different, but unsatisfying, values,
5586 so keep the C++ value so that at least one parser is "correct"
5587 according to the test suite.
5588 (Actions after errors): Remove, this is subsumed by the
5589 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
5590
52d5733f
AD
55912004-09-06 Akim Demaille <akim@epita.fr>
5592
5593 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 5594 (Parser::pop): New.
52d5733f
AD
5595 Use it.
5596
a0e68930
AD
55972004-09-06 Akim Demaille <akim@epita.fr>
5598
5599 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
5600 argument, an informative message.
5601 Call YY_SYMBOL_PRINT.
5602 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
5603 * data/lalr1.cc (destruct_): Likewise.
5604 In addition, no longer depend on b4_yysymprint_generate and
5605 b4_yydestruct_generate to generate these functions, do it "by
5606 hand".
5607
e757bb10
AD
56082004-09-03 Akim Demaille <akim@epita.fr>
5609
5610 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
5611 invoked, yydestruct the lookahead.
5612 * tests/calc.at (Calculator $1): Update the expected lengths of
5613 traces: there is an added line for the discarded lookahead.
5614 * doc/bison.texinfo (Destructor Decl): Some rewording.
5615 Define "discarded" symbols.
5616
0fe1f06d
AD
56172004-09-02 Akim Demaille <akim@epita.fr>
5618
5619 * data/lalr1.cc (translate_, destruct_): No reason to be static.
5620
284acc8b
AD
56212004-09-02 Akim Demaille <akim@epita.fr>
5622
5623 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
5624 (YYDSYMPRINTF): Rename as...
5625 (YY_SYMBOL_PRINT): this.
5626 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
5627 two.
5628 Use it instead of direct symprint_ calls.
5629 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
5630 one.
5631
a5eb1ed2
AD
56322004-09-02 Akim Demaille <akim@epita.fr>
5633
b7c72fe1
AD
5634 * data/lalr1.cc (b4_yysymprint_generate): New.
5635 (symprint_): New member function, defined when YYDEBUG.
5636 Use it consistently instead of token/nterm debugging output by
5637 hand.
a5eb1ed2
AD
5638 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
5639 %printer calls to use cdebug_ when using lalr1.cc.
5640
417141dd
AD
56412004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
5642
5643 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
5644 with #ifdef YYDEBUG.
5645
2fa09258
AD
56462004-08-26 Akim Demaille <akim@epita.fr>
5647
5648 * doc/bison.texinfo (Implementing Loops): Rename as...
5649 (Implementing Gotos/Loops): this.
5650
9378b508
PE
56512004-08-13 Paul Eggert <eggert@cs.ucla.edu>
5652
5653 Adjust to latest gnulib.
5654 * bootstrap (gnulib_modules): Add xalloc-die.
5655 Set LC_ALL=C so that file names sort consistently.
5656 Prefer the gnulib copies of gettext.m4, glibc21.m4,
5657 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
5658 uintmax_t.m4, ulonglong.m4.
5659 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
5660 po.m4 since we are now using _gl.m4 instead.
5661
87a8ad5c
PE
56622004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
5663
5664 * src/scan-action.l: Remove. Scanning of semantic actions is
5665 handled in scan-gram.l.
5666
dca81a78
PE
56672004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
5668
5669 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
5670
5671 * src/location.h (struct): The file member is a uniqstr.
5672 (equal_boundaries): Use UNIQSTR_EQ for comparison.
5673
c9cbf7c5
PE
56742004-07-22 Paul Eggert <eggert@cs.ucla.edu>
5675
5676 Fix bug with non-%union parsers that have printers or destructors,
5677 which led to a Bison core dump. Reported by Peter Fales in
5678 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 5679
c9cbf7c5
PE
5680 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
5681 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
5682 not to our own type.
5683 * src/output.c (symbol_destructors_output, symbol_printers_output):
5684 Don't assume %union.
5685 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
5686 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
5687 UNION-FLAG. All callers changed.
5688 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
5689 Use type char, not unsigned int, when declaring an array of char;
5690 this lets us remove a cast.
5691 (Printers and Destructors): Add non-%union test cases.
5692
fa7e68c3
PE
56932004-06-21 Paul Eggert <eggert@cs.ucla.edu>
5694
5695 * doc/bison.texinfo: Minor editorial changes, mostly to the new
5696 GLR writeups. E.g., avoid frenchspacing and the future tense,
5697 change "lookahead" to "look-ahead", and change "wrt" to "with
5698 respect to".
2fa09258 5699
fa7e68c3
PE
57002004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5701
5702 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
5703 New sections, split off from the GLR Parsers section. Put the new
5704 Simple GLR Parser near the start of the GLR section, for clarity.
5705 Rewrite connective text.
5706
99a9344e
PE
57072004-06-21 Frank Heckenbach <frank@g-n-u.de>
5708
5709 * doc/bison.texinfo (Simple GLR Parsers): New section.
5710
8dd162d3
PE
57112004-06-21 Paul Eggert <eggert@cs.ucla.edu>
5712
5713 * NEWS, TODO, doc/bison.texinfo:
5714 Use "look-ahead" instead of "lookahead", to be consistent.
5715 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
5716 while we're fixing "look-ahead".
5717 * src/conflicts.c (shift_set): Renamed from shiftset.
5718 (look_ahead_set): Renamed from lookaheadset.
5719 * src/print.c: Likewise.
5720 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
5721 name for "lookahead".
5722 (report_types, usage): Likewise.
5723 * src/getargs.h (report_look_ahead_tokens): Renamed from
5724 report_lookaheads.
5725 * src/lalr.c (compute_look_ahead_tokens): Renamed from
5726 compute_lookaheads.
5727 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
5728 (look_ahead_tokens_print): Renamed from lookaheads_print.
5729 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
5730 state_rule_lookaheads_print.
5731 * src/state.h: Likewise.
5732 (reductions.look_ahead_tokens): Renamed from lookaheads.
5733 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
5734 AT_DATA_LOOKAHEADS_GRAMMAR.
5735
57a90331
PE
57362004-06-03 Paul Eggert <eggert@cs.ucla.edu>
5737
5738 * README: Update location of patched M4 distribution.
5739
8ed3234a
PE
57402004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
5741
5742 Don't assume the C++ compiler takes the same arguments as the C compiler
5743 (trivial change).
5744 * configure.ac (O0CXXFLAGS): New var.
5745 * tests/atlocal.in (CXXFLAGS): Use it.
5746
07971983
PE
57472004-05-29 Paul Eggert <eggert@cs.ucla.edu>
5748
5749 Fix some "make check" problems with C++ reported by
5750 Albert Chin-A-Young for Tru64 C++ in this thread:
5751 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
5752
5753 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
5754 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
5755 Output to a .cc file for C++, not to a .c file.
5756 * tests/calc.at (AT_CHECK_CALC): Likewise.
5757 * tests/regression.at (AT_CHECK_DANCER): Likewise.
5758 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
5759
29058652
PE
57602004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
5761
5762 * tests/calc.at, tests/actions.at: Workaround for SGI
5763 C++ compiler. (trivial change)
5764
62cb8a99
PE
57652004-05-27 Paul Eggert <eggert@cs.ucla.edu>
5766
fd418816
PE
5767 Spent a few hours checking out which prerequisite versions the
5768 current sources actually require. I went all the way back to
5769 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
5770 a seemingly endless set of combinations of versions more recent
5771 than that. The bottom line is that the current sources require
5772 fairly recent versions of the build tools, and it'll be some work
5773 to change this.
5774 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
5775 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
5776 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
5777 Add comments explaining why those particular versions are
5778 currently needed.
2fa09258 5779
62cb8a99
PE
5780 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
5781 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 5782 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
5783
5784 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
5785 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
5786
caa52c10
PE
57872004-05-26 Paul Eggert <eggert@cs.ucla.edu>
5788
5789 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
5790 0.11.5. Suggested by Bruno Haible.
5791 * bootstrap: Remove gettext version checking.
5792
5793 * doc/bison.texinfo (Decl Summary): Also mention that %union
5794 can depend on prerequisite types. Problem reported by Tim
5795 Van Holder.
5796
4bfd5e4e
PE
57972004-05-25 Paul Eggert <eggert@cs.ucla.edu>
5798
2cef3017
PE
5799 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
5800 * README-alpha: Don't tell people not to package this.
5801
b9c85d5c
PE
5802 * bootstrap: Don't assume $(...) works; use `...` instead.
5803 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
5804 gettext better.
5805
4bfd5e4e
PE
5806 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
5807 put into the -d output file, and mention what to do if YYSTYPE is
5808 defined as a macro.
5809
6a36ff94
PE
58102004-05-24 Paul Eggert <eggert@cs.ucla.edu>
5811
6712933e
PE
5812 Undo change made earlier today: it caused autopoint to not bring
5813 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
5814 autopoint's.
5815
5816 * bootstrap: Check that gettext version matches what's in
5817 configure.ac. Warn users to ignore robots.txt ERROR 404.
5818 * bootstrap: Undo today's earlier change (logged below).
5819 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 5820
6a36ff94
PE
5821 The gettext version checking is causing more trouble than it's
5822 curing; remove it. Problem reported by Paul Hilfinger.
5823
5824 * bootstrap: Issue a warning that one can expect a message
5825 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
5826 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
5827
209ea708
PE
58282004-05-23 Paul Eggert <eggert@cs.ucla.edu>
5829
5830 Ensure that the C++ compiler used for testing actually works on a
5831 simple test program; if not, skip the C++-related tests. Problem
5832 reported by Vin Shelton in:
161a71f3 5833 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
5834
5835 * m4/cxx.m4: New file.
5836 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
5837 * tests/atlocal.in (BISON_CXX_WORKS): Add.
5838 * tests/local.at (AT_COMPILE_CXX): Use it.
5839
41ca2549
PE
58402004-05-21 Paul Eggert <eggert@cs.ucla.edu>
5841
383e69dc
PE
5842 * data/glr.c (yylloc): Output this macro even if locations are not
5843 being generated, as the GLR parser needs it even in that case.
5844 Problem reported by Troy A. Johnson
5845 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
5846
41ca2549
PE
5847 * configure.ac (AC_INIT): Update to 1.875e.
5848
e476c87d
PE
58492004-05-21 Paul Eggert <eggert@cs.ucla.edu>
5850
5851 * NEWS: Version 1.875d.
5852 * configure.ac (AC_INIT): Likewise.
5853 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
5854
5855 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
5856 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
5857 lalr1.cc runs afoul of the first, and the last two are no longer
5858 supported by GCC 3.4.0.
5859 * README: Mention GNU m4 1.4 or later; mention m4 patches.
5860 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
5861
233a88ad
PE
58622004-05-06 Paul Eggert <eggert@cs.ucla.edu>
5863
5864 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
5865 unsigned int, for compatibility with latest gnulib hash module.
5866 * src/state.c (state_hash, state_hasher): Likewise.
5867 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
5868 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 5869
12ffdd28
PE
58702004-05-03 Paul Eggert <eggert@cs.ucla.edu>
5871
5872 * NEWS: Unescaped newlines are no longer allowed in char & strings.
5873
5874 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
5875 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
5876 character and string literals.
5877 (unexpected_end): New function.
5878 (unexpected_eof): Use it.
5879 (unexpected_newline): New function.
5880 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
5881 actions.
e476c87d 5882
12ffdd28
PE
5883 * NEWS: Document %expect-rr.
5884
5885 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
5886 Fix typo by replacing $1 with $option.
5887 Remove more 'intl'-related files.
9668e2be 5888 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
5889
5890 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
5891 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
5892 strtoul.c.
5893 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
5894 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
5895 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
5896 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
5897 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
5898 * src/.cvsignore: Add *.output.
5899
5900 * src/parse-gram.y: Put copyright notice inside %{ %} so it
5901 gets copied to the output file.
e476c87d 5902
1f65350a
PE
59032004-04-28 Paul Eggert <eggert@twinsun.com>
5904
5905 Get files from the gnulib and po repositories, instead of relying
5906 on them being in our CVS. Upgrade to latest versions of gnulib
5907 and Automake.
5908
5909 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
5910 * bootstrap: Bootstrap from gnulib and po repositories.
5911 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
5912 * README-cvs: Document these changes. Remove version numbers from
5913 mentions of build tools, since they change so often. Mention Flex.
5914
5915 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
5916 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
5917 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
5918 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 5919 does this for us.
12ffdd28
PE
5920 (AC_ISC_POSIX): Remove; we no longer support this
5921 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
5922 (AC_HEADER_STDC): Remove: we now assume C89 or better.
5923 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
5924 Do not check for C89 headers, except for locale.h which is used
5925 by the Yacc library and must port to K&R hosts.
5926 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
5927 Do not check for C89 functions, except for setlocale which is
5928 used by the Yacc library.
5929 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
5930 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
5931 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
5932 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
5933 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
5934 AM_GNU_GETTEXT): Remove; now done by:
5935 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
5936 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
5937 for us.
5938
5939 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
5940 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
5941 Define to empty, as gnulib.mk will do the rest for us.
5942 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
5943 for us.
5944 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
5945 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
5946
5947 * src/files.c: Include gnulib's xstrndup.h.
5948
5949 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
5950 (REALLOC): Use xnrealloc, for likewise.
5951 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
5952 (strnlen, memrchr): Remove decls; functions no longer used.
5953 Include <stpcpy.h>.
5954
5955 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
5956 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
5957 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
5958 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
5959 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
5960 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
5961 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
5962 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
5963 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
5964 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
5965 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
5966 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
5967 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
5968 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
5969 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
5970 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
5971 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
5972 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
5973 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
5974 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
5975 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
5976 Remove, as these files are now generated automatically
5977 by bootstrap or automake.
5978
5979 * po/ChangeLog: Remove: all but one entry was a duplicate
5980 of this file, and I moved that 2000-11-02 entry here.
5981
5982 * config/.cvsignore: Add Makefile, depcomp, install-sh.
5983 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
5984 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
5985 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
5986 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
5987 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
5988 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
5989 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
5990 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
5991 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
5992 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
5993 xstrndup.h.
5994 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
5995 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
5996 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
5997 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
5998 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
5999 * src/.cvsignore: Remove *_.c.
6000
6001
6002 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
6003 support it. (The latest stable gzip doesn't.)
6004
60052004-04-27 Paul Eggert <eggert@twinsun.com>
6006
6007 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
6008 case, as stos_ is now used by destructors due to the 2004-02-09
6009 change.
6010
6011 Remove more K&R C support.
6012 * lib/libiberty.y (PARAMS): Remove. All uses removed.
6013 * lib/subpipe.c (errno): Remove decl.
6014 Include <stdlib.h> unconditionally.
6015 (EXIT_FAILURE): Remove macro.
6016 * src/complain.c (vfprintf, strerror): Remove.
6017 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
6018 unconditionally.
6019 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
6020 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
6021 (strchr, strspn, memchr): Remove decls.
6022 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
6023 unconditionally. Do not declare perror.
6024 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
6025 unconditionally.
6026
6027 * src/complain.c (_): Remove useless defn, as system.h defines this.
6028
6029 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
6030 with latest obstack.h.
6031 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
6032 to procedure types, as obstack.h now does that for us.
6033 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
6034
6035 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
6036 so that this include file can stand alone.
6037 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
6038 does this now. Include subpipe.h first after config.h, to
6039 test whether it can stand alone.
6040
6041 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
6042 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
6043 unused declaration.
6044
6045 * tests/synclines.at (%union synch line): Put a dummy member in
6046 the union, because empty unions aren't allowed in C. Caught
6047 by GCC 3.4.0.
6048
4f16766c
PE
60492004-04-13 Jim Meyering <jim@meyering.net>
6050
6051 * src/conflicts.c (conflicts_print): Correct format string typo:
6052 use `%%' to produce literal `%'. (trivial change)
6053
779e7ceb
PE
60542004-03-30 Paul Eggert <eggert@twinsun.com>
6055
6056 * src/getargs.c (version): Update copyright year to 2004.
6057
6058 * data/c.m4 (b4_int_type): Use 'short int' rather than
6059 'short', and similarly for 'long', 'unsigned', etc.
6060 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
6061 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
6062 yy_yypstack, yydumpstack): Likewise.
6063 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
6064 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
6065 Likewise.
6066 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
6067 yy_stack_print, yyparse): Likewise.
6068 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
6069 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
6070 * lib/bitset.c (bitset_print): Likewise.
6071 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
6072 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
6073 * lib/bitsetv.c (bitsetv_dump): Likewise.
6074 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
6075 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
6076 Likewise.
6077 * src/LR0.c (allocate_itemsets): Likewise.
6078 * src/gram.h (rule_number, rule): Likewise.
6079 * src/lalr.h (goto_number): Likewise.
6080 * src/nullable.c (nullable_compute): Likewise.
6081 * src/output.c (prepare_rules): Likewise.
6082 * src/relation.c (relation_print, relation_digraph): Likewise.
6083 * src/relation.h (relation_node): Likewise.
6084 * src/state.h (state_number, transitions, errs, reductions,
6085 struct state): Likewise.
6086 * src/symtab.h (symbol_number, struct symbol): Likewise.
6087 * src/tables.c (vector_number, tally, action_number,
6088 default_goto, goto_actions): Likewise.
6089 * tests/existing.at (GNU Cim Grammar): Likewise.
6090 * tests/regression.at (Web2c Actions): Likewise.
6091
6092 * src/output.c (muscle_insert_short_int_table): Renamed from
6093 muscle_insert_short_table. All uses changed.
6094
d6328241
PH
60952004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6096
6097 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
6098 (declaration): Replace expected_conflicts with expected_sr_conflicts.
6099 Add %expect-rr rule.
4f16766c 6100
d6328241
PH
6101 * src/scan-gram.l: Recognize %expect-rr.
6102
4f16766c 6103 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 6104 expected_conflicts.
4f16766c 6105 (expected_rr_conflicts): Declare.
d6328241
PH
6106
6107 * src/conflicts.c (expected_sr_conflicts): Rename from
6108 expected_conflicts.
6109 (expected_rr_conflicts): Define.
6110 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
6111 for GLR parsers.
6112 Use expected_sr_conflicts in place of expected_conflicts.
6113 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 6114
d6328241 6115 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 6116
1452af69
PE
61172004-03-08 Paul Eggert <eggert@gnu.org>
6118
6119 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 6120 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
6121
6122 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
6123 in lalr1.cc.
6124 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
6125 * src/scan-gram.l (scan_integer): New function.
6126 ({int}): Use it.
6127 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
6128 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
6129 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
6130 Say "long int", not "long", for uniformity with GNU style.
6131
006d217d
PE
61322004-02-25 Paul Eggert <eggert@twinsun.com>
6133
6134 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
6135 compilers. This fixes a problem with Intel's C++ compiler being
6136 chatty, reported by Guido Trentalancia in
161a71f3 6137 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 6138
c2729758
ADL
61392004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
6140
6141 Support %destructor and merge error locations in lalr1.cc.
6142
6143 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
6144 (Parser::stos_): Define unconditionally.
6145 (Parser::destruct_): New method. Generate its body with
6146 b4_yydestruct_generate.
6147 (Parser::error_start_): New attribute.
6148 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
6149 token which are discarded.
6150 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
6151 error_start_ when erroneous token are discarded.
6152 (Parser::parse) <yyerrlab1>: Compute the location of the error
6153 token so that it covers all the discarded tokens.
6154 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
6155 it can be called with `%skeleton "lalr1.cc"', and do that.
6156
dd0e0635
PE
61572004-02-02 Paul Eggert <eggert@twinsun.com>
6158
6159 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
6160 $(top_srcdir)/lib and ../lib. This fixes a bug reported
6161 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
6162 There's no need to mention top_builddir since Automake does that
6163 for us.
6164 (INCLUDES): Remove, as Automake says it's obsolescent.
6165 Contents migrated into AM_CPPFLAGS as described above.
6166 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
6167
61682004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6169
6170 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
6171 (yyreportSyntaxError): Handle case where lookahead token is
6172 YYEMPTY.
6173
be16239b
PH
61742004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6175
6176 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
6177 resulting parsers are compilable with C++.
6178
5fa90832
PE
61792003-12-23 Paul Eggert <eggert@twinsun.com>
6180
6181 * config/depcomp, config/install-sh: Sync with Automake 1.8.
6182 * src/output.c (output_skeleton): Rename local var.
6183 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
6184 Bison tokens, as this runs afoul of the 2003-10-07 change that
6185 disallowed NUL bytes in character constants or string literals.
6186
6187 * tests/local.at: Require Autoconf 2.59's Autotest.
6188 * tests/testsuite.at: Don't include local.at, since we now assume
6189 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
6190 including it.
6191 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
6192 multiple inclusion warnings.
dd0e0635 6193
b165c324
AD
61942003-12-02 Akim Demaille <akim@epita.fr>
6195
6196 * doc/bison.texinfo (How Can I Reset the Parser): More about start
6197 conditions.
6198 From Bruno Haible.
6199
26e06a21
ADL
62002003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
6201
6202 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
6203
92ac3705
PE
62042003-10-07 Paul Eggert <eggert@twinsun.com>
6205
6a5ecb38
PE
6206 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
6207 if testsuite doesn't exist.
6208
92ac3705
PE
6209 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
6210 literals, unfortunately.
6211 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
6212 Complain about NUL bytes in character constants or string literals.
6213
91d2c560
PE
62142003-10-05 Paul Eggert <eggert@twinsun.com>
6215
6216 * NEWS: Don't document %no-default-prec, as it's still
6217 too experimental.
6218 * doc/bison.texinfo: Document %no-default-prec only if
6219 the defaultprec flag is set. Normally it's not.
6220
0cc3da3a
PE
62212003-10-04 Paul Eggert <eggert@twinsun.com>
6222
6223 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
6224 non-modifiable lvalue, instead of a modifiable one.
6225 * doc/bison.texinfo (Actions): Document that $$ can
6226 be assigned to. Do not claim that $$ and $N are
6227 array element references: user code should not rely on this.
6228
22fccf95
PE
62292003-10-01 Paul Eggert <eggert@twinsun.com>
6230
6231 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
6232 (grammar_declaration): Use it.
6233 * src/scan-gram.l: New token %no-default-prec.
6234 * tests/conflicts.at: Revamp tests to use %no-default-prec.
6235 * NEWS, doc/bison.texinfo: Document the above.
6236
fc8f2965
AD
62372003-10-01 Akim Demaille <akim@epita.fr>
6238
6239 VCG no longer supports long_straight_phase.
6240
6241 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
6242 * src/print_graph.c (print_graph): Adjust.
6243
39a06c25
PE
62442003-09-30 Frank Heckenbach <frank@g-n-u.de>
6245 and Paul Eggert <eggert@twinsun.com>
6246
6247 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
6248 Table of Symbols): Document %default-prec.
6249 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
6250 (grammar_declaration): Set default_prec on %default-prec.
6251 * src/scan-gram.l (%default-prec): New token.
6252 * src/reader.h (default_prec): New flag.
6253 * src/reader.c: Likewise.
6254 (packgram): Handle it.
6255 * tests/conflicts.at (%default-prec without %prec,
6256 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 6257
39a06c25
PE
62582003-09-30 Paul Eggert <eggert@twinsun.com>
6259
6260 * tests/testsuite.at: Include local.at, not input.at, fixing
6261 a typo in the 2003-08-25 patch.
6262
62b6aef9
AD
62632003-08-27 Akim Demaille <akim@epita.fr>
6264
6265 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
6266 GCC warnings.
6267
89e1cc61
AD
62682003-08-26 Akim Demaille <akim@epita.fr>
6269
6270 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
6271 "<\#" to avoid magic from Gnus when posting parts of this script.
6272
a08460b0
AD
62732003-08-26 Akim Demaille <akim@epita.fr>
6274
6275 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
6276 (Parser::parse): here.
6277 Adjust: nerrs and errstatus is now replaced by...
6278 (Parser::nerrs_, Parser::errstatus_): New.
6279
603f1cfd
AD
62802003-08-25 Akim Demaille <akim@epita.fr>
6281
6282 * config/announce-gen, Makefile.cfg: New.
6283 * Makefile.am: Adjust.
6284 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
6285 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
6286
cd3684cf
AD
62872003-08-25 Akim Demaille <akim@epita.fr>
6288
6289 When reducing initial empty rules, Bison parser read an initial
6290 location that is not defined. This results in garbage, and that
6291 affects Bison's own parser. Therefore we need (i) to extend Bison
6292 to support a means to initialize this location, and (ii) to use
6293 this CVS Bison to fix CVS Bison's parser.
6294
6295 * src/reader.h, reader.c (epilogue_augment): Remove, replace
6296 with...
6297 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
6298 * src/parse-gram.y: Adjust.
6299 (%initial-action): New.
6300 (%error-verbose): Since we require CVS Bison, there is no reason
6301 not to use it.
6302 * src/scan-gram.l: Adjust.
6303 * src/Makefile.am (YACC): New, to make sure we use our own parser.
6304 * data/yacc.c (yyparse): Use b4_initial_action.
6305
4e03e201
AD
63062003-08-25 Akim Demaille <akim@epita.fr>
6307
6308 * doc/bison.texinfo: Don't promote stdout for error messages.
6309
8c182d05
AD
63102003-08-25 Akim Demaille <akim@epita.fr>
6311
6312 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
6313 From Alexandre Duret-Lutz.
6314
6a60c4cf
PE
63152003-08-25 Akim Demaille <akim@epita.fr>
6316
6317 Version 1.875c.
6318
25f66e1a
AD
63192003-08-25 Akim Demaille <akim@epita.fr>
6320
6321 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
6322 Use them.
6323
5348bfbe
AD
63242003-08-25 Akim Demaille <akim@epita.fr>
6325
6326 * data/lalr1.cc (Parser::reduce_print_): New.
6327 Use it.
6328
47301314
AD
63292003-08-25 Akim Demaille <akim@epita.fr>
6330
6331 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
6332 error recovery loops. This patch is based on
161a71f3 6333 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
6334 Also, augment the similarity between lalr1.cc and yacc.c.
6335 Note: the locations of error recovery rules are not correct yet.
6336
6337 * data/lalr1.cc: Comment changes to augment the similarity between
6338 lalr1.cc and yacc.c.
6339 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
6340 (yyerrlab1): Remove, but where it used to be (now the bottom part of
6341 yyerrlab), when hitting EOF, pop the whole stack here instead of
6342 merely falling thru the default error handling mechanism.
6343 (yyerrorlab): New label, with the old contents of YYERROR,
6344 plus the following change: pop the stack of rhs corresponding
6345 to the production that invoked YYERROR. That is how Yacc
6346 behaves (required by POSIX).
6347 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
6348 fail.
6349
1f7a61ff
AD
63502003-08-25 Akim Demaille <akim@epita.fr>
6351
6352 Tune local.at so that people can "autom4te -l autotest calc.at -o
6353 calc" for instance, to extract a sub test suite.
6354
6355 * tests/testsuite.at: Move the initialization, Autotest version
6356 requirement, and AT_TESTED invocation into...
6357 * tests/local.at: here.
6358 * tests/testsuite.at: Include it for compatibility with Autoconf
6359 2.57.
6360 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
6361 be ignore.
6362
327b5b56
PE
63632003-08-04 Paul Eggert <eggert@twinsun.com>
6364
6365 Rework code slightly to avoid gcc -Wtraditional warnings.
6366 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
6367 The returned value is now stored in *YY0. All callers changed.
6368 * src/output.c (merge_output): Adjust to the above change.
6369
0051e3ed
PE
63702003-07-26 Paul Eggert <eggert@twinsun.com>
6371
6372 * data/glr.c (YYASSERT): New macro.
6373 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
6374 yyresolveStates, yyprocessOneStack):
6375 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
6376 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 6377
137437c6
PE
63782003-07-25 Paul Eggert <eggert@twinsun.com>
6379
5b620e06
PE
6380 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
6381 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 6382 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
6383 by Frank Heckenbach, though I have omitted the structure-initialization
6384 part of his glr-knr.diff patch since I recall that the Portable
6385 C Compiler didn't require that change.
6386
137437c6
PE
6387 Let the user specify how to allocate and free memory.
6388 Derived from a suggestion by Frank Heckenbach in
161a71f3 6389 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
6390 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
6391 All uses of free, malloc, realloc changed to use these macros,
6392 and unnecessary casts removed.
6393 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
6394
ddb85ca5
PE
63952003-07-06 Matthias Mann <MatthiasMann@gmx.de>
6396
6397 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
6398 use s.empty() rather than s == "" to test for empty string; see
161a71f3 6399 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
6400 (trivial change)
6401
39910e09
AD
64022003-06-25 Akim Demaille <akim@epita.fr>
6403
6404 * config/depcomp, config/install-sh: Update from masters.
6405
0ae99356
PE
64062003-06-20 Paul Eggert <eggert@twinsun.com>
6407
6408 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
6409 and return properly parenthesized result.
6410 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
6411 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
6412 Remove unnecessary parentheses from uses.
6413 * doc/bison.texinfo (Location Default Action): Describe the
6414 conventions for parentheses.
6415
cd05d13c
PE
64162003-06-19 Paul Eggert <eggert@twinsun.com>
6417
81fd08ca
PE
6418 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
6419 yyreportTree): Do not assume that size_t is the same width as int,
6420 when printing sizes. Print sizes using an unsigned format.
6421 Problem reported by Frank Heckenbach in
161a71f3 6422 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 6423
cd05d13c
PE
6424 Port to Forte Developer 7 C compiler.
6425 * data/glr.c (struct YYLTYPE): If locations are not being used,
6426 declare a single dummy member, as empty structs do not conform
6427 to the C standard.
6428 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
6429 the Forte Developer 7 C compiler complains that end-of-loop
6430 code is not reached.
6431
4dcf140b
PE
64322003-06-17 Paul Eggert <eggert@twinsun.com>
6433
6434 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
6435 avoid warnings from picky compilers about redefinition of PARAMS.
6436
8dd76bee
PE
64372003-06-17 Paul Eggert <eggert@twinsun.com>
6438
6439 Version 1.875b.
6440
6441 * NEWS: Document 1.875b.
6442
6443 * lib/bbitset.h: Do not include config.h; that's the includer's job.
6444 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
6445 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
6446 Don't use 'index' in comments, as it's a builtin fn on some hosts.
6447 * lib/bitset_stats.c: Include gettext.h unconditionally, as
6448 per recent gettext manual's suggestion.
6449 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
6450 Use prototypes, not old-style definitions.
6451 * lib/lbitset.c (lbitset_unused_clear): Likewise.
6452 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
6453 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
6454 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
6455 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
6456 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
6457 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
6458 vbitset_or_and_cmp, vbitset_copy): Likewise.
6459
6460 * lib/libiberty.h: Do not include config.h; that's the includer's job.
6461 Do not include <stdlib.h>.
6462 (PARAMS): Define unconditionally for C89.
6463 (ATTRIBUTE_NORETURN): Remove.
6464 (ATTRIBUTE_UNUSED): Define unconditionally.
6465
6466 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 6467 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
6468 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
6469 * lib/vbitset.c, lib/vbitset.h: New files.
6470 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
6471 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
6472 from libbitset.
6473
6474 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
6475 `How Can I Reset @code{yyparse}', since texinfo does not allow
6476 arbitrary @ in node names.
6477
6478 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
6479 shouldn't be needed according to the gettext 0.12.1 documentation
6480 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 6481 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 6482 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 6483 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 6484
8dd76bee
PE
6485 * lib/.cvsignore: Add stdbool.h.
6486 * m4/.cvsignore: Add nls.m4, po.m4.
6487
6488 Upgrade to CVS gnulib.
6489 * stdbool_.h: File renamed from stdbool.h.in.
6490 * configure.ac (AM_STDBOOL_H): Invoke this instead of
6491 AC_HEADER_STDBOOL.
6492 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
6493 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
6494 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
6495 (MOSTLYCLEANFILES): New var.
6496 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
6497 (stdbool.h): New rule.
6498 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
6499 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
6500 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
6501 m4/quote.m4: Upgrade to today's gnulib.
6502
6503 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
6504 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
6505 the tests right now.
6506 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
6507 yyerror are declared before use; C99 requires this.
6508
25005f6a
PH
65092003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6510
6511 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
6512 first.
6513 (yyrecoverSyntaxError): Correct the logic for setting and testing
6514 yyerrState.
6515 Correct comment on handling EOF.
6516 Allow states with only a default reduction, rather than failing
8dd76bee 6517 (I can't quite reconstruct why these were not allowed before).
25005f6a 6518
137437c6 6519 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 6520 buffer overruns, corrupting state.
8dd76bee
PE
6521
6522 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
6523 definition.
6524 * src/reader.h (max_left_semantic_context): New variable declaration.
6525 * src/scan-gram.l (max_left_semantic_context): Define.
6526 (handle_action_dollar): Update max_left_semantic_context.
6527 * data/glr.c (YYMAXLEFT): New definition.
6528 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
6529 (yyresolveAction): Ditto.
6530
6531 Fixes to problems with location handling in GLR parsers reported by
6532 Frank Heckenbach (2003/06/05).
6533
6534 * data/glr.c (YYLTYPE): Make trivial if locations not used.
6535 (YYRHSLOC): Add parentheses, and define only if locations used.
6536 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
6537 locations not used.
6538 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
6539 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 6540
25005f6a
PH
6541 * tests/cxx-type.at: Exercise location information; update tests
6542 to differentiate output with and without locations.
8dd76bee 6543 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
6544 because default YYLTYPE not yet defined.
6545 Change semantic actions to compute strings, rather than printing
6546 them directly (to test proper passing of semantics values). Change
6547 output to prefix notation and update test data and expected results.
6548 (yylex): Track locations.
6549 (stmtMerge): Return value rather than printing, and include arguments
6550 in value.
8dd76bee 6551
711f40b7
PE
65522003-06-03 Paul Eggert <eggert@twinsun.com>
6553
6554 Avoid warnings generated by GCC 2.95.4 when Bison is
6555 configured with --enable-gcc-warnings.
6556 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
6557 yy::]b4_parser_class_name[::translate_,
6558 yy::Stack::operator[] (unsigned),
6559 yy::Stack::operator[] (unsigned) const,
6560 yy::Slice::operator[] (unsigned),
6561 yy::Slice::operator[] (unsigned) const):
6562 Rename local vars to avoid warnings.
6563 * tests/glr-regression.at (Improper handling of embedded actions
6564 and $-N in GLR parsers): Remove unused local variable from yylex.
6565 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
6566 (void) as arg when not pure, since we now assume C89 when building
6567 Bison. Pacify GCC by using parameter.
6568
ac695f7d
PE
65692003-06-02 Paul Eggert <eggert@twinsun.com>
6570
6571 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
6572 yy::Location::lines, yy::Location::columns): Rename arguments
6573 to avoid shadowing; this removes a warning generated by GCC 3.3.
6574
26ec81e0
PE
65752003-06-01 Paul Eggert <eggert@twinsun.com>
6576
6577 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
6578 to g++, as GCC 3.3 complains if you do it.
6579 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
6580 everything that WARNING_CFLAGS has, except omit warnings
6581 not suitable for C++.
6582 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
6583 * tests/atlocal.in (CXXFLAGS): New var.
6584 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
6585
6586 Fix a GLR parser bug I reported in February; see
161a71f3 6587 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
6588 The problem was that GLR parsers did not conform to the C standard,
6589 because actions like { $1 = $2 + $3; } expanded to expressions
6590 that invoked YYFILL in separate subexpressions, and YYFILL assigned
6591 to a local variable. The C standard says that expressions
6592 like (var = f ()) + (var = f ()) have undefined behavior.
6593 Another problem was that GCC sometimes issues warnings that
6594 yyfill and its parameters are unused.
6595
6596 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
6597 as possibly unused.
6598 (yyfill): New function.
6599 (YYFILL): Use it.
6600 (yyuserAction): Change type of yynormal to bool, so that it matches
6601 the new yyfill signature. Mark it as possibly unused.
6602
6603
6604 Follow up on a bug I reported in February, where a Bison-generated
6605 parser can loop. Provide a test case and a fix for yacc.c. I
6606 don't have a fix for lalr1.cc or for glr.c, unfortunately.
6607 The original bug report is in:
161a71f3 6608 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
6609
6610 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
6611 macro's size was becoming unwieldy.
6612 (yyerrlab): Do not discard an empty lookahead symbol, as this
6613 might destroy garbage.
6614 (yyerrorlab): New label, with the old contents of YYERROR,
6615 plus the following change: pop the stack of rhs corresponding
6616 to the production that invoked YYERROR. That is how Yacc
6617 behaves, and POSIX requires this behavior.
6618 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
6619 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
6620 Define 'alarm' to do nothing if unistd.h is not available.
6621 Add a new rule "exp: '-' error;" to test the above change to
6622 data/yacc.c. Use 'alarm' to abort any test taking longer than
6623 10 seconds, as it's probably looping.
6624 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
6625 Also, the new yacc.c generates two fewer diagnostics for an
6626 existing test.
6627
d0829076
PE
66282003-05-24 Paul Eggert <eggert@twinsun.com>
6629
c6ae27df
PE
6630 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
6631 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
6632 This fixes a problem reported by John Bowman when the Compaq/HP
6633 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
6634 -ansi -Wall -gall).
6635 * data/yacc.c (union yyalloc): Likewise.
6636 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 6637
d0829076
PE
6638 Switch from 'int' to 'bool' where that makes sense.
6639
6640 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
6641 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
6642 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
6643 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
6644 Return or accept bool, not int. All callers changed.
6645 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
6646 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
6647 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
6648 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
6649 bitset_or_and_cmp_): Likewise.
6650 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
6651 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
6652 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
6653 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
6654 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
6655 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
6656 bitset_stats_or_and_cmp): Likewise.
6657 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
6658 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
6659 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
6660 ebitset_xor_cmp): Likewise.
6661 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
6662 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
6663 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
6664 lbitset_xor_cmp): Likewise.
6665 * lib/bbitset.h: Include <stdbool.h>.
6666 (struct bitset_vtable): The following members now return bool, not
6667 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
6668 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
6669 or_and_cmp).
6670 * src/conflicts.c (count_rr_conflicts): Likewise.
6671 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
6672 All uses changed.
6673 * lib/ebitset.c (ebitset_obstack_init): Likewise.
6674 * lib/lbitset.c (lbitset_obstack_init): Likewise.
6675 * src/getargs.c (debug_flag, defines_flag, locations_flag,
6676 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
6677 graph_flag): Likewise.
6678 * src/getargs.h (debug_flag, defines_flag, locations_flag,
6679 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
6680 graph_flag): Likewise.
6681 * src/output.c (error_verbose): Likewise.
6682 * src/output.h (error_verbose): Likewise.
6683 * src/reader.c (start_flag, typed): Likewise.
6684 * src/reader.h (typed): Likewise.
6685 * src/getargs.c (LOCATIONS_OPTION): New constant.
6686 (long_options, getargs): Use it.
6687 * src/lalr.c (build_relations): Use bool, not int.
6688 * src/nullable.c (nullable_compute): Likewise.
6689 * src/print.c (print_reductions): Likewise.
6690 * src/tables.c (action_row, pack_vector): Likewise.
6691 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
6692 * src/output.c (prepare): Use it.
6693 * src/output.c (token_definitions_output,
6694 symbol_destructors_output, symbol_destructors_output): Use string,
6695 not boolean integer, to keep track of whether to output separator.
6696 * src/print_graph.c (print_core): Likewise.
6697 * src/state.c (state_rule_lookaheads_print): Likewise.
6698
6699 * config/install-sh: Sync from automake 1.7.5.
6700
6b2584b7
PE
67012003-05-14 Paul Eggert <eggert@twinsun.com>
6702
6703 * src/parse-gram.y (rules_or_grammar_declaration): Require a
6704 semicolon after a grammar declaration, in the interest of possible
6705 future changes to the Bison input language.
6706 Do not allow a stray semicolon at the start of the grammar.
6707 (rhses.1): Allow one or more semicolons after any rule, including
6708 just before "|" as required by POSIX.
6709 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
6710 grammar.
6711
caf37a36
ADL
67122003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
6713
6714 %parse-param support for lalr1.cc.
6715
6716 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
6717 b4_cc_constructor_calls, b4_cc_constructor_call,
6718 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
6719 definitions.
6720 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
6721 parse-param arguments.
6722 (yy::b4_parser_class_name): Declare instance variables to
6723 hold parse-param arguments.
6724 * tests/calc.at: s/value/semantic_value/ because value clashes
6725 with a member of yy::b4_parser_class_name. Adjust C++ code
6726 to handle %parse-param. Enable %parse-param test in C++.
6727
3ab37077
PE
67282003-05-12 Paul Eggert <eggert@twinsun.com>
6729
6730 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
6731 English a bit. Fix fclose typo. Change "const char" to "char
6732 const", and use ANSI C rather than K&R for "main". Suggest
6733 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
6734 and suggest yy_switch_to_buffer.
6735
67362003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
6737
6738 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
6739 C89. This avoids a diagnostic on compilers that define __STDC__
6740 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 6741 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 6742
e743727f
PE
67432003-05-03 Paul Eggert <eggert@twinsun.com>
6744
6745 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
6746 Do not overrun array bounds.
6747 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 6748 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 6749
916708d5
AD
67502003-04-29 Akim Demaille <akim@epita.fr>
6751
6752 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
6753 * src/getargs.c, src/getargs.h: here, as bool, not int.
6754 (nondeterministic_parser): New.
6755 * src/parse-gram.y, src/scan-gram.l: Support
6756 %nondeterministic-parser.
6757 * src/output.c (prepare): Use nondeterministic_parser instead
6758 of glr_parser where appropriate.
6759 * src/tables.c (conflict_row, action_row, save_row)
6760 (token_actions, token_actions, pack_vector): Ditto.
6761
a06ea4aa
AD
67622003-04-29 Akim Demaille <akim@epita.fr>
6763
6764 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
6765
211074ca
AD
67662003-04-29 Akim Demaille <akim@epita.fr>
6767
6768 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
6769 with %pure-parser and %locations to exercise the patch from Yakov
6770 Markovitch below.
6771
6175ffe3
PE
67722003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
6773
6774 * data/yacc.c: (b4_lex_param): Corrected for the case where
6775 %lex-param is provided and %pure-parser isn't.
6776
b1e95857
PE
67772003-04-27 Paul Eggert <eggert@twinsun.com>
6778
6779 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 6780 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
6781 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
6782 if it is not defined.
6783 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
6784
acda9df6
PE
67852003-04-26 Paul Eggert <eggert@twinsun.com>
6786
3470c57b
PE
6787 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
6788 Declare to be of type suitable for the ninf value itself, not of
6789 type suitable for the corresponding table, since the latter might
6790 be unsigned but the ninf value might be negative. This fixes a
6791 bug reported by Alexandre Duret-Lutz in
161a71f3 6792 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 6793
acda9df6
PE
6794 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
6795 invokes it. We shouldn't invoke it twice because it will attempt
6796 to put error.o in the archive twice. This fixes a glitch reported
6797 by Martin Mokrejs in
161a71f3 6798 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 6799
b5250f26
PE
68002003-04-21 Paul Eggert <eggert@twinsun.com>
6801
6802 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
6803 to gnulib.
6804
089ac0f1
PE
68052003-04-21 Yakov Markovitch <Markovitch@iso.ru>
6806
6807 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
6808 Fix obvious typo that results in uncompilable GLR parsers
6809 when both %pure-parser and %locations are used. (trivial change)
6810
5ededac6
PE
68112003-04-17 Paul Eggert <eggert@twinsun.com>
6812
1b8f2fff
PE
6813 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
6814 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
6815 Do not insert the expected token via unput, as this runs afoul
6816 of a POSIX-compatibility bug in flex 2.5.31.
6817 All uses changed to BEGIN the parent state,
6818 since we no longer insert the expected token via unput.
6819 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
6820 that is no longer emitted after the above change.
6821
5ededac6
PE
6822 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
6823 the first one. This change is from Paul Hilfinger, and it fixes
6824 regression reported by Werner Lemberg in
161a71f3 6825 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
6826
6827 (resolve_sr_conflict): Don't invoke state_errs_set
6828 unless one or more tokens have been explicitly made errors.
6829 Otherwise, the above change causes Bison to abort.
6830
6831 * tests/existing.at (GNU pic Grammar): New test case, taken from
6832 Lemberg's email.
6833
b8be9132
AD
68342003-03-31 Akim Demaille <akim@epita.fr>
6835
6836 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
6837
d423d460
AD
68382003-03-31 Akim Demaille <akim@epita.fr>
6839
6840 * src/output.c (prepare_symbols): Avoid trailing spaces in the
6841 output.
6842
c7e441b4
AD
68432003-03-31 Akim Demaille <akim@epita.fr>
6844
6845 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
6846 From Paul Hilfinger.
6847
231897ad
AD
68482003-03-29 Akim Demaille <akim@epita.fr>
6849
6850 * m4/error.m4: Do not put under dynamic conditions some code which
6851 expansion is under static control.
6852
5b066063
AD
68532003-03-29 Akim Demaille <akim@epita.fr>
6854
6855 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
6856
22a74fec
AD
68572003-03-29 Akim Demaille <akim@epita.fr>
6858
6859 * doc/bison.texinfo (Strings are Destroyed): New.
6860
0eee27e7
PE
68612003-03-13 Paul Eggert <eggert@twinsun.com>
6862
6863 * .cvsignore: Add configure.lineno.
6864 * src/.cvsignore: Add yacc.
6865 * tests/.cvsignore: Add testsuite.log.
6866 * doc/fdl.texi: Sync with latest FSF version.
6867
f61aad93
PE
68682003-03-12 Paul Eggert <eggert@twinsun.com>
6869
537636c7
PE
6870 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
6871 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
6872 cursor, instead of leaving it undefined. This fixes a bug
6873 reported by Tim Van Holder in
161a71f3 6874 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
6875 * tests/input.at (Torturing the Scanner): Test the scanner on
6876 an empty input file, which was Tim Van Holder's test case.
6877
6878 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
6879 <sys/resource.h> can be included, include sys/time.h and
6880 sys/times.h first, if available. This works around the SunOS
6881 4.1.4 porting bug reported by Bruce Becker in
161a71f3 6882 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
6883
6884 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
6885 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
6886 AC_HEADER_SYS_WAIT.
6887
f61aad93
PE
6888 Merge changes from gnulib. This was prompted because the CVS
6889 snapshot didn't build on Solaris 7 due to strnlen problems.
6890
6891 These changes need to be merged back into gnulib:
6892 * lib/hash.c: Include <stdbool.h> unconditionally.
6893 * m4/onceonly.m4 (m4_quote): New macro.
6894 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
6895 Quote AC_FOREACH variable-expansions properly.
6896 The 2003-01-03 obstack.h change also needs merging.
6897 {end of changes requiring merging}
5b066063 6898
f61aad93
PE
6899 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
6900 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
6901 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
6902 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
6903 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
6904 New files, imported from gnulib.
6905 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
6906 above.
6907
6908 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
6909 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
6910 gnulib sources.
6911
6912 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
6913 Add.
6914 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
6915 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
6916 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
6917 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
6918 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
6919 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
6920 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
6921 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
6922 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
6923 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
6924 (jm_PREREQ_ARGMATCH): Remove.
6925 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
6926 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
6927
6928 * src/system.h: Include <stdbool.h> unconditionally.
6929
6930 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
6931 assuming at least C89 in the bitset code for some time now.
6932
d2ffe116
AD
69332003-03-03 Akim Demaille <akim@epita.fr>
6934
6935 * ro.po: New.
6936
052826fd
AD
69372003-03-02 Akim Demaille <akim@epita.fr>
6938
6939 * doc/bison.texinfo (Table of Symbols): Reactivate the
6940 documentation for %lex-param, and %parse-param.
6941
c4749565
AD
69422003-03-02 Akim Demaille <akim@epita.fr>
6943
6944 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
6945 generate verbose error messages.
6946 Use the number of tokens as an upper bound in yytname, as it
6947 cannot be a non terminal.
6948
d5286af1
AD
69492003-03-02 Akim Demaille <akim@epita.fr>
6950
6951 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
6952 message.
6953
22e304a6
AD
69542003-03-02 Akim Demaille <akim@epita.fr>
6955
22e304a6
AD
6956 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
6957 Use them to exercise yycheck overrun.
6958 Based on Andrew Suffield's grammar.
6959
67a25fed
AD
69602003-03-02 Akim Demaille <akim@epita.fr>
6961
6962 Create tests/local.at for Bison generic testing macros.
6963
6964 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
6965 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
6966 This new file.
6967 * tests/calc.at (AT_CHECK_CALC): Adjust.
6968 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
6969 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
6970 * tests/local.at: here.
6971 (AT_COMPILE_CXX): Tags the tests using it as c++.
6972 Ignore the test if CXX is not functional.
6973
9c2b381f
PE
69742003-03-01 Paul Eggert <eggert@twinsun.com>
6975
6976 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
6977 not loc->end, since loc->end might contain garbage and this leads
6978 to undefined behavior on some platforms.
6979 (id_loc, token_start): Use (IF_LINTed) initial values that do not
6980 depend on *loc, so that the reader doesn't give the the false
6981 impression that *loc is initialized.
6982 (<INITIAL>"%%"): Do not bother setting code_start, since its value
6983 does not survive the return.
6984
0433ba88
AD
69852003-03-01 Akim Demaille <akim@epita.fr>
6986
6987 * src/scan-gram.l (code_start): Always initialize it when entering
6988 into yylex, as SC_EPILOGUE is activated *before* the corresponding
6989 yylex invocation. An alternative would be making it static, but
6990 then it starts with the second %%'s beginning, instead of its end.
6991
b305ea69
PE
69922003-02-28 Paul Eggert <eggert@twinsun.com>
6993
6994 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
6995 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 6996 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 6997
c3d25e01
PE
69982003-02-26 Paul Eggert <eggert@twinsun.com>
6999
7000 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
7001 Remove Sequent/Pyramid discussion (nobody uses them any more).
7002 Merge VMS and MS-DOS discussion; these ports may well be dead
7003 but let's keep mentioning them for now. Put <> around email
7004 addresses. Add copyright notice.
7005
c267ffbc
PE
70062003-02-24 Paul Eggert <eggert@twinsun.com>
7007
7008 * data/glr.c (yy_reduce_print): yylineno -> yylno,
7009 to avoid collision with flex use of yylineno.
7010 Problem reported by Bruce Lilly in
161a71f3 7011 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
7012 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
7013 * data/yacc.c (yy_reduce_print): Likewise.
7014
7015 * config/depcomp: Sync with Automake 1.7.3.
7016
f939fc12
AD
70172003-02-21 Akim Demaille <akim@epita.fr>
7018
7019 * data/lalr1.cc: Use temporary variables instead of casts to
7020 change integer types.
7021 Suggested by Paul Eggert.
7022
95923bd6
AD
70232003-02-21 Akim Demaille <akim@epita.fr>
7024
7025 * doc/bison.texinfo: Use "location" consistently to refer to @n,
7026 to avoid confusions with lalr1.cc's notion of Position.
7027 Suggested by Paul Eggert.
7028
2cdc240e
AD
70292003-02-20 Akim Demaille <akim@epita.fr>
7030
7031 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
7032 before initial_columns.
7033 (location.hh): Use consistent variable names when defining the
7034 operator<<.
7035 Use "last" so that we subtract from Positions, not from unsigned.
7036
5d003116
AD
70372003-02-20 Akim Demaille <akim@epita.fr>
7038
7039 * data/lalr1.cc (position.hh): New subfile, including the extended
7040 and Doxygen'ed documentation of class Position.
7041 (location.hh): Use it.
7042 Document a` la Doxygen.
ba1ecc07 7043 With the help of Benoit Perrot.
5d003116 7044
d02b25f9
AD
70452003-02-20 Akim Demaille <akim@epita.fr>
7046
7047 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
7048 AT_YACC_IF.
7049 Redefine AT_YYERROR_SEES_LOC_IF using it.
7050 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
7051 not defined.
7052 Don't use the location in yy::Parser::error_ and
7053 yy::Parser::print_ when not %locations.
7054 Activate more lalr1.cc tests.
7055
0d1c3a04
AD
70562003-02-19 Akim Demaille <akim@epita.fr>
7057
7058 * data/lalr1.cc: When displaying a line number, be sure to make it
7059 an int.
7060
60a777aa
AD
70612003-02-19 Akim Demaille <akim@epita.fr>
7062
7063 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
7064 Remove, useless.
7065 (YYABORT, YYACCEPT, YYERROR): New.
7066 * tests/calc.at: Renable the lalr1.cc test.
7067
0b86fc41
AD
70682003-02-19 Akim Demaille <akim@epita.fr>
7069
7070 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
7071 error recovery, mixing with/without pops and discarding of the
7072 lookahead.
7073 Exercise YYERROR.
7074 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
7075
da99a5dc
PE
70762003-02-17 Paul Eggert <eggert@twinsun.com>
7077
7078 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
7079 * tests/testsuite.at (AT_COMPILE): Use them.
7080 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 7081 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 7082
93b8c255
PE
70832003-02-12 Paul Eggert <eggert@twinsun.com>
7084
7085 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
7086 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 7087 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
7088 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
7089 Check for malloc failure, for consistency with yacc.c.
7090 (yytname_size): Remove, for consistency with yacc.c.
7091
7092 The bug still remains in data/lalr1.cc, as I didn't have time
7093 to fix it there.
7094
7548fed2
AD
70952003-02-06 Akim Demaille <akim@epita.fr>
7096
7097 * configure.ac (GXX): Rename as...
7098 (CXX): this, to keep the original Autoconf semantics.
7099 Require 2.57.
7100 * data/lalr1.cc: Fix b4_copyright invocations.
7101 If YYDEBUG is not defined, don't depend upon name_ being defined.
7102 (location.hh): Include string and iostream.
7103 (Position::filename): New member.
7104 (Position::Position ()): New.
7105 (operator<< (Position)): New.
7106 (operator- (Position, int)): New.
7107 (Location::first, Location::last): Rename as...
7108 (Location::begin, Location::end): these, to mock the conventional
7109 iterator names.
7110 (operator<< (Location)): New.
7111 * tests/atlocal.in (CXX): New.
7112 * tests/testsuite.at (AT_COMPILE_CXX): New.
7113 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
7114 locations in a more synthetic way.
7115 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
7116 lalr1.cc is used.
7117 Adjust the C locations to match those from Emacs: first column is
7118 column 0.
7119 Change all the expected results.
7120 Conform to the GCS: simplify the locations when applicable.
7121 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
7122 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
7123 these CPP macros with the m4 macros new defined by...
7124 (AT_CHECK_PUSHDEFS): this, i.e.:
7125 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 7126 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
7127 New macros.
7128 (AT_CHECK_POPDEFS): Undefine them.
7129 (AT_CHECK_CALC_LALR1_CC): New.
7130 Use it for the first lalr1.cc test.
7131
43a176ef
AD
71322003-02-04 Akim Demaille <akim@epita.fr>
7133
7134 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
7135 Location as is defined.
7136
fc049e9c
AD
71372003-02-04 Akim Demaille <akim@epita.fr>
7138
7139 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
7140 name_ being defined.
7141
a737b216
PE
71422003-02-03 Paul Eggert <eggert@twinsun.com>
7143
7144 * src/gram.h (start_symbol): Remove unused decl.
7145
7146 Use more-consistent naming conventions for local vars.
7147
7148 * src/derives.c (derives_compute): Change type of local var from
7149 int to rule_number.
7150 * src/gram.c (grammar_rules_partial_print): Likewise.
7151 * src/print.c (print_core): Likewise.
7152 * src/reduce.c (reduce_grammar_tables): Likewise.
7153
7154 * src/gram.c (grammar_dump): Change name of item_number *
7155 local var from r to rp.
7156 * src/nullable.c (nullable_compute): Likewise.
7157
7158 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
7159
7160 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
7161 for symbol or symbol_number var.
7162 * src/reader.c (grammar_start_symbol_set): Likewise.
7163 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
7164 Likewise.
7165 * src/state.c (transitions_to): Likewise.
7166 * src/state.h: Likewise.
7167 * src/tables.c (symbol_number_to_vector_number): Likewise.
7168
7169 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
7170 char * var.
7171
7172 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
7173 var.
7174
7175 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
7176 var.
7177
7178 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
7179 Use str, not s, for char * var. Use ch, not c, for character var.
7180 Use size for size var.
7181
7182 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
7183 char * var.
7184 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
7185 uniqstr var.
7186 * src/uniqstr.h: Likewise.
7187
7188 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
7189 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
7190 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
7191 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
7192 param to have same name as that of enum, so that we don't use
7193 "s" to stand for a non-state.
7194
68e93ad5
AD
71952003-02-02 Akim Demaille <akim@epita.fr>
7196
7197 * src/scan-skel.l: Scan more than one inert character per yylex
7198 invocation.
7199
92898986
PE
72002003-02-01 Paul Eggert <eggert@twinsun.com>
7201
7202 Version 1.875a.
7203
1d9d5d71
PE
7204 * po/LINGUAS: Add ms.
7205
0435d061
AD
72062003-01-30 Akim Demaille <akim@epita.fr>
7207
7208 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
7209
6029a57f
PH
72102003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7211
7212 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
7213 of $1.
0435d061
AD
7214
7215 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 7216 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 7217 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 7218
6029a57f
PH
7219 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
7220 (b4_rhs_location): Ditto.
0435d061 7221 (yyfill): New function to copy from stack tree into array
6029a57f 7222 incrementally.
0435d061
AD
7223 (yyuserAction): Modify to allow incremental move of semantic values
7224 to rhs array when in GLR mode.
7225 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
7226 as needed.
7227 Remove dummy use of yystack, as there is now a guaranteed use.
7228 (yydoAction): Modify to allow incremental move of semantic values
7229 to rhs array when in GLR mode.
7230 (yyresolveAction): Ditto.
7231 (yyglrShiftDefer): Update comment.
0435d061 7232 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
7233 (yyglrReduce): Ditto.
7234 (yydoAction): Ditto
0435d061 7235
6029a57f
PH
7236 * tests/glr-regr1.at: Rename to ...
7237 * tests/glr-regression.at: Add new regression test for the problems
7238 described above (adapted from S. Eken).
7239 Update copyright notice.
7240 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
7241 * tests/Makefile.am: Ditto.
7242
6cee6297
PE
72432003-01-28 Paul Eggert <eggert@twinsun.com>
7244
7245 * data/lalr1.cc: Do not use @output_header_name@ unless
7246 b4_defines_flag is set. This fixes two bugs reported by
7247 Tim Van Holder in
161a71f3
PE
7248 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
7249 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 7250
b2a836b5
PE
72512003-01-21 Paul Eggert <eggert@twinsun.com>
7252
7253 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
7254 we don't need to worry about yyerrlab1 being reported as an
7255 "unused label" by non-GCC C compilers. The downside is that if
7256 locations are used then a couple of statements are duplicated each
7257 time YYERROR is invoked, but the upside is that the warnings
7258 should vanish.
7259 (yyerrlab1): Move code to YERROR.
7260 (yyerrlab2): Remove. Change uses back to yyerrlab1.
7261 This reverts some of the 2002-12-27 change.
7262
4196b931
PE
72632003-01-17 Paul Eggert <eggert@twinsun.com>
7264
7265 * src/output.c (symbol_printers_output): Fix typo that led
7266 to core dump. Problem reported by Antonio Rus in
161a71f3 7267 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 7268
3ae831b4
AD
72692003-01-13 Akim Demaille <akim@epita.fr>,
7270 Quoc Peyrot <chojin@lrde.epita.fr>,
7271 Robert Anisko <anisko_r@lrde.epita.fr>
7272
7273 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
7274 when the stacks contain one element, as the loop would otherwise
7275 free the last state, and then use the top state (the one we just
7276 popped). This means that the initial elements will not be freed
7277 explicitly, as is the case in yacc.c; it is not a problem, as
7278 these elements have fake values.
7279
e3aa65c5
PE
72802003-01-11 Paul Eggert <eggert@twinsun.com>
7281
7282 * NEWS: %expect-violations are now just warnings, reverting
7283 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
7284 bootstrapping problem reported by Matthias Klose; see
161a71f3 7285 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
7286 * src/conflicts.c (conflicts_print): Likewise.
7287 * tests/conflicts.at (%expect not enough, %expect too much,
7288 %expect with reduce conflicts): Likewise.
7289 * doc/bison.texinfo (Expect Decl): Document this. Also mention
7290 that the warning is enabled if the number of conflicts changes
7291 (not necessarily increases).
7292
7293 * src/getargs.c (version): Update copyright year.
7294
f0057011
AD
72952003-01-09 Akim Demaille <akim@epita.fr>
7296
7297 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
7298
1ee6d2a0
PE
72992003-01-08 Paul Eggert <eggert@twinsun.com>
7300
7301 * Makefile.maint (WGETFLAGS):
7302 New macro, containing "-C off" to disable proxy caches.
7303 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
7304 (rel-check): Use $(WGET) instead of wget.
7305
d4fd77c4
PE
73062003-01-06 Paul Eggert <eggert@twinsun.com>
7307
7308 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
7309 the GLR paper of Scott, Johnstone and Hussain.
7310
464c6927
PE
73112003-01-04 Paul Eggert <eggert@twinsun.com>
7312
d600ee67
PE
7313 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
7314 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
7315 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
7316 (EXTRA_LIBRARIES): New var, for liby.a.
7317 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
7318 (EXTRA_SCRIPTS): New var, for yacc.
7319
464c6927
PE
7320 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
7321 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
7322 Problem reported by Nelson H. F. Beebe.
7323
73242003-01-03 Paul Eggert <eggert@twinsun.com>
7325
7326 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
7327 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7328 when compiling Bison 1.875's `bitset bset = obstack_alloc
7329 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
7330
7331 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
7332 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
7333 grow to a huge size with typical invocation.
d600ee67 7334
464c6927
PE
7335 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
7336 Use the pattern recommended by Autoconf 2.57, except also protect
7337 against double-definition.
7338 * src/system.h: Likewise.
7339 Portability issues reported by Nelson H. F. Beebe.
d600ee67 7340
464c6927
PE
7341 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
7342 All uses changed. Provide a definition in both C and C++.
7343 (yytrue, yyfalse): Define even if defined (__cplusplus).
7344
7345 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
7346 Reported by Nelson H. F. Beebe.
d600ee67 7347
464c6927
PE
7348 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
7349
0f42c7d5
PE
73502003-01-02 Paul Eggert <eggert@twinsun.com>
7351
7352 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
7353 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
7354 Bug reported by Nelson H. F. Beebe.
7355
dc546b0f
PE
73562003-01-01 Paul Eggert <eggert@twinsun.com>
7357
7358 * Version 1.875.
7359
2c09b6a7
PE
73602002-12-30 Paul Eggert <eggert@twinsun.com>
7361
7362 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
7363 Moved here from...
7364 (<INITIAL>","): Here. This causes stray "," to be treated
7365 more uniformly.
7366
dc546b0f 7367 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
7368 last brace in braced code when not in Yacc mode, for compatibility
7369 with Bison 1.35. This resurrects the 2001-12-15 patch to
7370 src/reader.c.
7371
7372 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
7373 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
7374
535c0f63
PE
73752002-12-28 Paul Eggert <eggert@twinsun.com>
7376
7377 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
7378 that of SYM's type. This fixes Debian bug 168069, reported by
7379 Thomas Olsson.
d600ee67 7380
963fcc17
PE
73812002-12-28 Paul Eggert <eggert@twinsun.com>
7382
7383 Version 1.75f.
7384
7385 Switch back to the Yacc style of conflict reports, undoing some
7386 of the 2002-07-30 change.
7387 * doc/bison.texinfo (Understanding): Use Yacc style for
7388 conflict reports. Also, use new way of locating rules.
7389 * src/conflicts.c (conflict_report):
7390 Renamed from conflict_report_yacc, removing the old
7391 'conflict_report'. Translate the entire conflict report at once,
7392 so that we don't assume that "," has the same interpretation in
7393 all languages.
7394 (conflicts_output): Use Yacc-style conflict report for each state,
7395 instead of our more-complicated style.
7396 (conflicts_print): Use Yacc-style conflict report, except print
7397 the input file name when not emulating Yacc.
7398 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
7399 Conflicted Reduction, %expect not enough, %expect too much,
7400 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
7401 * tests/existing.at (GNU Cim Grammar): Likewise.
7402 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
7403
7404 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
7405 fatal): Don't invoke fflush; it's not needed and it might even be
7406 harmful for stdout, as stdout might not be open.
7407 * src/reduce.c (reduce_print): Likewise.
7408
b1efe548
PE
74092002-12-27 Paul Eggert <eggert@twinsun.com>
7410
7411 Fix a bug where error locations were not being recorded correctly.
7412 This problem was originally reported by Paul Hilfinger in
161a71f3 7413 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
7414
7415 * data/yacc.c (yyparse): New local var yylerrsp, to record the
7416 top of the location stack's error locations.
7417 (yyerrlab): Set it. When discarding a token, push its location
7418 onto yylerrsp so that we don't lose track of the error's end.
7419 (yyerrlab1): Now is only the target of YYERROR, so that we can
7420 properly record the location of the action that failed. For GCC
7421 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
7422 GCC warning about yyerrlab1 being unused if YYERROR is unused.
7423 (yyerrlab2): New label, which yyerrlab now falls through to.
7424 Compute the error's location by applying YYLLOC_DEFAULT to
7425 the locations of all the symbols that went into the error.
7426 * doc/bison.texinfo (Location Default Action): Mention that
7427 YYLLOC_DEFAULT is also invoked for syntax errors.
7428 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7429 Error locations include the locations of all the tokens that were
7430 discarded, not just the last token.
d600ee67 7431
983c5c2c
PE
74322002-12-26 Paul Eggert <eggert@twinsun.com>
7433
b1efe548
PE
7434 * src/files.c: Include quote.h.
7435 (compute_output_file_names): Warn if we detect conflicting
7436 outputs to the same file. This should catch the misunderstanding
7437 exemplified by Debian Bug 165349, reported by Bruce Stephens..
7438
7439 * src/conflicts.c (conflicts_print): If the user specifies
7440 "%expect N", report an error if there are any reduce/reduce
7441 conflicts. This is what the manual says should happen.
7442 This fixes Debian bug 130890, reported by Anthony DeRobertis.
7443 * tests/conflicts.at (%expect with reduce conflicts): New test.
7444
983c5c2c
PE
7445 Don't use m4_include on relative file names, as it doesn't work as
7446 desired if there happens to be a file with that name under ".".
d600ee67 7447
983c5c2c
PE
7448 * m4sugar/version.m4: Remove; it was included but it wasn't used.
7449 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
7450 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
7451 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
7452 * src/output.c (output_skeleton): Use full path names when
7453 specifying a file to include; don't rely on include path, as
7454 it's unreliable when the working file contains a file with
7455 that name.
d600ee67 7456
983c5c2c
PE
74572002-12-25 Paul Eggert <eggert@twinsun.com>
7458
7459 Remove obsolete references to bison.simple and bison.hairy.
7460 Problem mentioned by Aubin Mahe in
161a71f3 7461 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
7462 * data/glr.c: Comment fix.
7463 * doc/bison.1: Remove references. Also, mention "yacc".
7464
7465 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
7466 with -g option.
7467
7468 * src/parse-gram.y (declaration): Use enum "report_states" rather
7469 than its numeric value 1.
7470
7471 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
7472 opening a new one. This fixes Debian bug 165349, reported by
7473 Bruce Stephens.
7474
23f2d9dc
PE
74752002-12-24 Paul Eggert <eggert@twinsun.com>
7476
7477 Version 1.75e.
7478
7479 * Makefile.maint (cvs-update): Don't assume that the shell
7480 supports $(...), as Solaris sh doesn't.
7481
7482 * src/parse-gram.y (lloc_default): Remove test for empty
7483 nonterminals at the end, since it didn't change the result.
7484
74852002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
7486
7487 If the user does not define YYSTYPE as a macro, Bison now declares it
7488 using typedef instead of defining it as a macro. POSIX requires this.
7489 For consistency, YYLTYPE is also declared instead of defined.
7490
7491 %union directives can now have a tag before the `{', e.g., the
7492 directive `%union foo {...}' now generates the C code
7493 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
7494 The default union tag is `YYSTYPE', for compatibility with Solaris 9
7495 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
7496 instead of `yyltype'.
7497
7498 `yystype' and `yyltype' are now obsolescent macros instead of being
7499 typedefs or tags; they are no longer documented and will be
7500 withdrawn in a future release.
7501
7502 * data/glr.c (b4_location_type): Remove.
7503 (YYSTYPE): Renamed from yystype.
7504 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
7505 (struct YYLTYPE): Renamed from struct yyltype.
7506 (YYLTYPE): Renamed from yyltype.
7507 (yyltype, yystype): New (and obsolescent) macros,
7508 for backward compatibility.
7509 * data/yacc.c: Likewise.
7510
7511 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
7512 does not specify a union tag. This is for compatibility with
7513 Solaris 9 yacc.
7514
7515 * src/parse-gram.y (add_param): 2nd arg is now char * not char
7516 const *, since it is now modified by stripping surrounding { }.
7517 (current_braced_code): Remove.
7518 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
7519 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
7520 trailing " {...}". Now of type <chars>.
7521 (grammar_declaration): Adjust to bundled tokens.
7522 (code_content): Remove; stripping is now done by add_param.
7523 (print_token_value): Print contents of bundled tokens.
7524 (token_name): New function.
7525
7526 * src/reader.h (braced_code, current_braced_code): Remove.
7527 (token_name): New decl.
7528
7529 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
7530 token_type, not braced_code code_kind. All uses changed.
7531 (SC_PRE_CODE): New state, for scanning after a keyword that
7532 has (or usually has) an immediately-following braced code.
7533 (token_type): New local var, to keep track of which token type
7534 to return when scanning braced code.
7535 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 7536 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
7537 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
7538 instead of returning a token type immediately.
7539 (<INITIAL>"{"): Set token type.
7540 (<SC_BRACED_CODE>"}"): Use it.
7541 (handle_action_dollar, handle_action_at): Now returns bool
7542 indicating success. Fail if ! current_rule; this prevents a core dump.
7543 (handle_symbol_code_dollar, handle_symbol_code_at):
7544 Remove; merge body into caller.
7545 (handle_dollar, handle_at): Complain in invalid contexts.
7546
7547 * NEWS, doc/bison.texinfo: Document the above.
7548 * NEWS: Fix years and program names in copyright notice.
7549
879ca4f8
PE
75502002-12-17 Paul Eggert <eggert@twinsun.com>
7551
7552 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
7553 Reporting, Table of Symbols): Omit mentions of %lex-param and
7554 %parse-param from the documentation for now.
7555
1c5fe69d
PE
75562002-12-15 Paul Eggert <eggert@twinsun.com>
7557
7558 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
7559 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
7560 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
7561 disagreed with the Bison documentation. Bug
7562 reported by Andrew Walrond.
d600ee67 7563
1c5fe69d
PE
7564 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
7565 as the caller now does that.
7566 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
7567 (YYEMPTY): Parenthesize right hand side, since others use it.
7568 (yyparse): Don't assume that our generated code is the only code
7569 that sets yychar.
7570
d1de5372
PE
75712002-12-13 Paul Eggert <eggert@twinsun.com>
7572
7573 Version 1.75d.
7574
7575 POSIX requires a "yacc" command.
7576 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
7577 (MOSTLYCLEANFILES): Add yacc.
7578 (yacc): New rule.
1c5fe69d 7579 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
7580 as an alias for bison y.
7581
7582 * po/LINGUAS: Add da.
d600ee67 7583
d1de5372
PE
7584 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
7585 problem with latest <getopt.h>.
7586 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
7587
7588 * doc/fdl.texi: Upgrade to 1.2.
7589 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
7590 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
7591 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
7592 gnulib.
7593 * config/install-sh: Sync with autotools.
7594
7595 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 7596 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
7597 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
7598 locations are requested.
7599 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
7600 locations are requested.
7601
d0f3fe23
PE
76022002-12-12 Paul Eggert <eggert@twinsun.com>
7603
7604 Remove unportable casts and storage allocation tricks.
7605 While we're at it, remove almost all casts, since they
7606 usually aren't needed and are a sign of trouble.
7607
7608 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
7609
7610 * src/derives.c (derives_compute): Do not subtract NTOKENS from
7611 the pointer DSET returned by malloc; this isn't portable.
7612 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
7613 Similarly for DERIVES.
7614 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
7615 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
7616 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
7617
7618 * src/derives.c (derives_compute): Do not bother invoking
7619 int_of_rule_number, since rule numbers are integers.
7620
7621 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
7622 rather than XMALLOC (char, N).
7623
7624 * src/files.c (filename_split): Rewrite to avoid cast.
7625
7626 * src/gram.h (symbol_number_as_item_number,
7627 item_number_as_symbol_number, rule_number_as_item_number,
7628 item_number_as_rule_number):
7629 Now inline functions rather than macros, to avoid casts.
7630 * src/state.h (state_number_as_int): Likewise.
7631 * src/tables.c (state_number_to_vector_number,
7632 symbol_number_to_vector_number): Likewise.
7633
7634 * src/gram.h (int_of_rule_number): Remove; no longer used.
7635
7636 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
7637 since the resulting storage is always stored into.
7638
7639 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
7640 where it's needed.
7641
7642 * src/muscle_tab.c (muscle_m4_output):
7643 Now inline. Return bool, not int.
7644 * src/state.c (state_compare): Likewise.
7645 * src/symtab.c (symbol_check_defined,
7646 symbol_check_alias_consistency, symbol_pack, symbol_translation,
7647 hash_compare_symbol, hash_symbol):
7648 Likewise.
7649 * src/uniqstr.c (uniqstr_print): Likewise.
7650 * src/muscle_tab.c (muscle_m4_output_processor):
7651 New function, to avoid casts.
7652 * src/state.c (state_comparator, stage_hasher): Likewise.
7653 * src/symtab.c (symbol_check_defined_processor,
7654 symbol_check_alias_consistency_processor, symbol_pack_processor,
7655 symbol_translation_processor, hash_symbol_comparator,
7656 hash_symbol_hasher): Likewise.
7657 * src/uniqstr.c (uniqstr_print_processor): Likewise.
7658 * src/muscle_tab.c (muscles_m4_output):
7659 Use new functions instead of casting old functions unportably.
7660 * src/state.c (state_hash_new): Likewise.
7661 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
7662 symbols_token_translations_init):
7663 Likewise.
7664 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
7665
7666 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
7667 var instead of casting to long, to avoid casts.
7668 (prepare_states): Use MALLOC rather than alloca, so that we don't
7669 have to worry about alloca.
7670 * src/state.c (state_hash_lookup): Likewise.
7671
7672 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
7673 local var instead of casting to unsigned char, to avoid casts.
7674
7675 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
7676 STATE_ALLOC): Remove.
7677 (transitions_new, errs_new, reductions_new, state_new): Use malloc
7678 rather than calloc, and use offsetof to avoid allocating slightly
7679 too much storage.
7680 (state_new): Initialize all members.
7681
7682 * src/state.c (state_hash): Use unsigned accumulator, not signed.
7683
7684 * src/symtab.c (symbol_free): Remove; unused.
7685 (symbol_get): Remove cast in lhs of assignment.
7686 (symbols_do): Now static. Accept generic arguments, not
7687 hashing-related ones.
7688
7689 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
7690 (symbol_processor): Remove.
7691 (symbols_do): Remove decl; now static.
7692
7693 * src/system.h (alloca): Remove; decl no longer needed.
7694 (<stddef.h>): Include, for offsetof.
7695 (<inttypes.>, <stdint.h>): Include if available.
7696 (uintptr_t): New type, if system lacks it.
7697 (CALLOC, MALLOC, REALLOC): New macros.
7698 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
7699 new macros.
7700
7701 * src/tables.c (table_size): Now int, to pacify GCC.
7702 (table_grow, table_ninf_remap): Use signed table size.
7703 (save_row): Don't bother initializing locals when not needed.
7704 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
7705 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
7706
7707 * src/vcg.h: Correct misspellings.
7708
7709 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
7710
7711
7712 * src/getargs.c (getargs): Don't assume EOF == -1.
7713
26b4a969
PE
77142002-12-09 Paul Eggert <eggert@twinsun.com>
7715
7716 Change identifier spellings to avoid collisions with names
7717 that are reserved by POSIX.
7718
7719 Don't use names ending in _t, since POSIX reserves them.
7720 For consistency, remove _e and _s endings -- they're weren't
7721 needed to remove ambiguity. All uses changed.
7722 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
7723 turn was just renamed from struniq_t.
7724 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
7725 which in turn was just renamed from struniq_processor_t.
7726 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
7727 in turn was renamed from hash_compare_struniq_t.
7728 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
7729 (state_list): Renamed from state_list_t.
7730 * src/assoc.h (assoc): Renamed from assoc_t.
7731 * src/conflicts.c (enum conflict_resolution): Renamed from
7732 enum conflict_resolution_e.
7733 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
7734 (rule_list): Renamed from rule_list_t.
7735 * src/getargs.h (enum trace): Renamed from enum trace_e.
7736 (enum report): Renamed from enum report_e.
7737 * src/gram.h (item_number): Renamed from item_number_t.
7738 (rule_number): Renamed from rule_number_t.
7739 (struct rule_s): Remove the "rule_s" part; not used.
7740 (rule): Renamed from rule_t.
7741 (rule_filter): Renamed from rule_filter_t.
7742 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
7743 (goto_list): Renamed from goto_list_t.
7744 * src/lalr.h (goto_number): Renamed from goto_number_t.
7745 * src/location.h (location): Renamed from location_t.
7746 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
7747 and moved here from:
7748 * src/muscle_tab.h (muscle_entry_t): here.
7749 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
7750 (rule_list): Renamed from rule_list_t.
7751 * src/print_graph.c (static_graph): Renamed from graph.
7752 * src/reader.h (braced_code): Renamed from braced_code_t.
7753 Remove brace_code_e tag.
7754 * src/relation.h (relation_node): Renamed from relation_node_t.
7755 (relation_nodes): Renamed from relation_nodes_t.
7756 (relation): Renamed from relation_t.
7757 * src/state.h (state_number): Renamed from state_number_t.
7758 (struct state): Renamed from struct state_s.
7759 (state): Renamed from state_t.
7760 (transitions): Renamed from transitions_t. Unused (and
7761 misspelled) transtion_s tag removed.
7762 (errs): Renamed from errs_t. Unused errs_s tag removed.
7763 (reductions): Renamed from reductions_t. Unused tag
7764 reductions_s removed.
7765 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
7766 (struct symbol_list): Renamed from struct symbol_list_s.
7767 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
7768 (struct symbol): Renamed from struct symbol_s.
7769 (symbol): Renamed from symbol_t.
7770 * src/tables.c (vector_number): Renamed from vector_number_t.
7771 (action_number): Renamed from action_t.
7772 * src/tables.h (base_number): Renamed from base_t.
7773 * src/vcg.h (enum color): Renamed from enum color_e.
7774 (enum textmode): Renamed from enum textmode_e.
7775 (enum shape): Renamed from enum shape_e.
7776 (struct colorentry): Renamed from struct colorentry_s.
7777 (struct classname): Renamed from struct classname_s.
7778 (struct infoname): Renamed from struct infoname_s.
7779 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
7780 (enum decision): Renamed from enum decision_e.
7781 (enum orientation): Renamed from enum orientation_e.
7782 (enum alignment): Renamed from enum alignment_e.
7783 (enum arrow_mode): Renamed from enum arrow_mode_e.
7784 (enum crossing_type): Renamed from enum crossing_type_e.
7785 (enum view): Renamed from enum view_e.
7786 (struct node): Renamed from struct node_s.
7787 (node): Renamed from node_t.
7788 (enum linestyle): Renamed from enum linestyle_e.
7789 (enum arrowstyle): Renamed from enum arrowstyle_e.
7790 (struct edge): Renamed from struct edge.
7791 (edge): Renamed from edge_t.
7792 (struct graph): Renamed from struct graph_s.
7793 (graph): Renamed from graph_t.
7794 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
7795 Rename value_t -> value.
7796 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
7797 value_t_as_yystype -> value_as_yystype.
7798
7799 Don't include <errno.h> in the mainstream code, since it
7800 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
7801 * lib/get-errno.c, lib/get-errno.h: New files.
7802 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
7803 get-errno.c.
7804 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
7805 * src/output.c (output_skeleton): Likewise.
7806 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
7807 instead of errno.
7808 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
7809 Likewise.
7810 (handle_action_dollar, handle_action_at): Likewise.
7811 * src/system.h: Do not include <errno.h>.
7812 (TAB_EXT): Renamed from EXT_TAB.
7813 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
7814
7815 Avoid str[a-z]*, since <string.h> reserves that name space.
7816 Change all instances of "struniq" in names to "uniqstr", and
7817 likewise for "STRUNIQ" and "UNIQSTR".
7818 * src/uniqstr.c: Renamed from src/struniq.c.
7819 * src/uniqstr.h: Renamed from src/struniq.h.
7820 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
7821 * src/files.c (strsuffix): Remove; unused.
7822 (concat2): Renamed from stringappend. Now static.
7823 * src/files.h (strsuffix, stringappend): Remove; unused.
7824 * src/parse-gram.y (<chars>): Renamed from <string>.
7825 (<uniqstr>): Renamed from <struniq>.
7826 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
7827 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
7828 (struct graph_s.expand): Renamed from struct graph_s.stretch.
7829 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
7830 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
7831 (N_EXPAND): Renamed from N_STRETCH.
7832
7833 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
7834 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
7835 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
7836 Remove; unused.
7837 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
7838 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
7839 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
7840 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
7841 (BASE_MAXIMUM): Renamed from BASE_MAX.
7842 (BASE_MINIMUM): Renamed from BASE_MIN.
7843 (ACTION_MAX): Remove; unused.
7844 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
7845 Unnecessary casts removed from above defines.
7846
7847
7848 Fix misspelling in names.
7849 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
7850 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
7851 G_NODE_ALIGNEMENT.
7852
7853
7854 * lib/timevar.c (timevar_report): Renamed from time_report,
7855 for consistency with other names.
7856 * lib/timevar.h (timevar_report): New decl.
7857 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
7858
7859
7860 Sort include-file uses.
7861
7862 Reorder all include files under src to be in the order "system.h".
7863 then the ../lib include files in angle brackets (alphabetized),
7864 then the . include files in double-quotes (alphabetized). Fix
7865 dependency breakages encountered in this process, as follows:
7866 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
7867 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
7868 * src/state.h: Include "symtab.h".
7869
996b1c7e
PE
78702002-12-08 Paul Eggert <eggert@twinsun.com>
7871
7872 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
7873 since this causes problems when __file__ contains character
7874 sequences like "@" that are treated specially by src/scan-skel.l.
7875 Instead, just use the file's basename. This fixes the bug
7876 reported by Martin Mokrejs in
161a71f3 7877 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 7878
e19c4e5d
PE
78792002-12-06 Paul Eggert <eggert@twinsun.com>
7880
7881 Add support for rules that do not have trailing semicolons, as
7882 POSIX requires. Improve the quality of locations in Bison
7883 diagnostics.
26b4a969 7884
e19c4e5d
PE
7885 * src/location.c: Include <quotearg.h>.
7886 (empty_location): Now const.
7887 (location_print): New function. Follow the recommendation of the
7888 GNU Coding Standards for locations that span file boundaries.
7889 * src/location.h: Do not include <quotearg.h>; no longer needed.
7890 (boundary): New type.
7891 (location_t): Use it. This allows locations to span file boundaries.
7892 All member uses changed: file -> start.file or end.file (as needed),
7893 first_line -> start.line, first_column -> start.column,
7894 last_line -> end.line, last_column -> end.column.
7895 (equal_boundaries): New function.
7896 (LOCATION_RESET, LOCATION_STEP): Remove.
7897 (LOCATION_PRINT): Remove. All callers changed to use location_print.
7898 (empty_location): Now const.
7899 (location_print): New decl.
7900 * src/parse-gram.y (lloc_default): New function, which handles
7901 empty locations more accurately.
7902 (YYLLOC_DEFAULT): Use it.
7903 (%token COLON): Remove.
7904 (%token ID_COLON): New token.
26b4a969 7905 (rules): Use it.
e19c4e5d
PE
7906 (declarations, rules): Remove trailing semicolon.
7907 (declaration, rules_or_grammar_declaration):
7908 Allow empty (";") declaration.
7909 (symbol_def): Remove empty actions; no longer needed.
7910 (rules_or_grammar_declaration): Remove trailing semicolon.
7911 (semi_colon.opt): Remove.
7912 * src/reader.h: Include location.h.
7913 (scanner_cursor): New decl.
7914 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
7915 rolling our own.
7916 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
7917 of *loc.
7918 (STEP): Remove. No longer needed, now that adjust_location does
7919 the work. All uses removed.
7920 (scanner_cursor): New var.
7921 (adjust_location): Renamed from extend_location. It now sets
7922 *loc and adjusts the scanner cursor. All uses changed.
7923 Don't bother testing for CR.
7924 (handle_syncline): Remove location arg; now updates scanner cursor.
7925 All callers changed.
7926 (unexpected_end_of_file): Now accepts start boundary of token or
7927 comment, not location. All callers changed. Update scanner cursor,
7928 not the location.
7929 (SC_AFTER_IDENTIFIER): New state.
7930 (context_state): Renamed from c_context. All uses changed.
7931 (id_loc, code_start, token_start): New local vars.
7932 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
7933 processing of Yacc white space and equivalents here.
7934 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
7935 instead of returning ID immediately, since we need to search for
7936 a subsequent colon.
7937 (<INITIAL>"'", "\""): Save token_start.
7938 (<INITIAL>"%{", "{", "%%"): Save code_start.
7939 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
7940 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
7941 BEGIN context_state at end, not INITIAL.
7942 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
7943 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
7944 Return correct token start.
7945 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
7946 the start of a character, string or multiline comment is found.
7947 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
7948 Reduction): Adjust reported locations to match the more-precise
7949 results now expected.
7950 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
7951 * tests/reduce.at (Useless Rules, Reduced Automaton,
7952 Underivable Rules): Likewise.
7953 * tests/regression.at (Invalid inputs): No longer `expecting ";"
7954 or "|"' now that so many other tokens are allowed by the new grammar.
7955
7956 * src/complain.h (current_file): Remove duplicate decl;
7957 current_file is now owned by files.h.
7958 * src/complain.c, src/scan-gram.l: Include files.h.
7959
79602002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 7961
e19c4e5d
PE
7962 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
7963 promotes to int; it might be unsigned int.
7964 * data/yacc.c (yy_reduce_print): Likewise.
7965
7966 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
7967 be #defined in the prologue, not in the Bison declarations.
7968 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 7969
b64755e3
PE
79702002-12-02 Paul Eggert <eggert@twinsun.com>
7971
7972 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
7973 * lib/strtoul.c: New file, from gnulib.
7974 This fixes a porting bug reported by Peter Klein in
161a71f3 7975 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 7976
6e746484
PE
79772002-11-30 Paul Eggert <eggert@twinsun.com>
7978
b64755e3
PE
7979 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
7980 and put only a forward declaration in the prologue. This is for
7981 consistency with the other scanner helper functions.
7982
6ba55592
PE
7983 Type clashes now generate warnings, not errors, since it
7984 appears that POSIX may allow some grammars with type clashes.
7985 * src/reader.c (grammar_current_rule_check): Warn about
7986 type clashes instead of complaining.
7987 * tests/input.at (Type Clashes): Expect warnings, not complaints.
7988
6e746484
PE
7989 Add Yacc library, since POSIX requires it.
7990 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
7991 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
7992 * lib/main.c, lib/yyerror.c: New files.
7993
7994 gram_error can be static; it need not be extern.
7995 * src/reader.h (gram_error): Remove decl.
7996 * src/parse-gram.y (gram_error): Now static. Add static decl.
7997 (print_token_value): Omit parameter names from forward decl,
7998 for consistency.
7999
88510f9c
PE
80002002-11-29 Paul Eggert <eggert@twinsun.com>
8001
6e746484
PE
8002 * doc/bison.texinfo: Emphasize that yylex and yyerror must
8003 be declared before being used. E.g., one should typically
8004 declare them in the prologue. Use GNU coding style in examples.
8005 Put "const" consistently after the type it modifies. Mention
8006 that C99 supports "inline". Mention that yyerror traditionally
8007 returns "int".
8008
88510f9c
PE
8009 %parse-param and %lex-param now take just one argument, the
8010 declaration; the argument name is deduced from the declaration.
8011
8012 * doc/bison.texinfo (Parser Function, Pure Calling, Error
8013 Reporting, Table of Symbols): Document this.
8014 * src/parse-gram.y (add_param): New function.
8015 (COMMA): Remove.
8016 (declaration): Implement new rule for %parse-param and %lex-param.
8017 * src/scan-gram.l: "," now elicits a warning, rather than being
8018 a token; this is more compatible with byacc.
8019 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
8020
bb92250c
PE
80212002-11-27 Paul Eggert <eggert@twinsun.com>
8022
8023 Rename identifiers to avoid real and potential collisions.
8024
8025 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
8026 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 8027 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
8028 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
8029 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
8030 * src/parse-gram.y (print_token_value): Renamed from yyprint.
8031 All uses changed.
8032 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
8033 The name "yycontrol" violates the name space rules, and this stuff
8034 wasn't being used anyway.
8035 (input): Remove action; this stuff wasn't being used.
8036 (gram_error): Rename local variable yylloc -> loc.
8037 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
8038 (YY_DECL): Don't use "yy" at start of local variables.
8039 All uses changed, e.g., yylloc -> loc.
8040 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
8041 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
8042 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
8043 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
8044
8045 * src/parse-gram.y (gram_error): loc is now const *.
8046 * src/reader.h (gram_error): Likewise.
8047
3af4feb2
PE
80482002-11-24 Paul Eggert <eggert@twinsun.com>
8049
8050 Version 1.75c.
8051
8052 * tests/actions.at (Actions after errors): Use an output format
8053 more similar to that of the Printers and Destructors test.
8054 Test the position of the ';' token too.
8055 (Printers and Destructors): Likewise.
8056 (Printers and Destructors: %glr-parser): Remove for now, to avoid
8057 unnecessarily alarming people when the test fails.
8058
8059 * data/yacc.c (yyerrlab1): Move this label down, so that the
8060 parser does not discard the lookahead token if the user code
8061 invokes YYERROR. This change is required for POSIX conformance.
8062
8063 * lib/error.c: Sync with gnulib.
8064
80652002-11-22 Paul Eggert <eggert@twinsun.com>
8066
8067 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
8068 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
8069 * lib/xmalloc.c: Likewise.
26b4a969 8070
58004308
PE
80712002-11-20 Paul Eggert <eggert@twinsun.com>
8072
8073 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
8074
80752002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 8076
58004308
PE
8077 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
8078 should use `if (! x) abort ();' rather than `assert (x);', and
8079 anyway it's one less thing to worry about configuring.
8080
8081 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
8082 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
8083 and replace all instances of assert with abort.
8084 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8085 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
8086
8087 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
8088 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
8089 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
8090 hash_find_entry, hash_rehash, hash_insert): Likewise.
8091 * src/conflicts.c (resolve_sr_conflict): Likewise.
8092 * src/lalr.c (set_goto_map, map_goto): Likewise.
8093 * src/nullable.c (nullable_compute): Likewise.
8094 * src/output.c (prepare_rules, token_definitions_output): Likewise.
8095 * src/reader.c (packgram, reader): Likewise.
8096 * src/state.c (state_new, state_free, state_transitions_set,
8097 state_reduction_find): Likewise.
8098 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
8099 symbol_pack): Likewise.
8100 * src/tables.c (conflict_row, pack_vector): Likewise.
8101 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
8102 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
8103 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
8104 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
8105
8106 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
8107 (ARGMATCH_CONSTRAINT): New macro.
8108 (ARGMATCH_ASSERT): Use it.
8109
8110 * src/system.h (verify): New macro.
8111 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
8112 rather than assert.
8113 * src/tables.c (tables_generate): Likewise.
8114
8115 * src/struniq.c (struniq_assert): Now returns void, and aborts
8116 if the assertion is false.
8117 (struniq_assert_p): Remove.
8118 * src/struniq.h: Likewise.
8119
76ae8198
PE
81202002-11-18 Paul Eggert <eggert@twinsun.com>
8121
8122 * data/glr.c (yygetLRActions): Replace `yyindex' with
8123 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
8124 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 8125 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 8126
d3c4e709
AD
81272002-11-18 Akim Demaille <akim@epita.fr>
8128
8129 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
8130 space.
8131 From Tim Van Holder.
8132
8d8a7238
PE
81332002-11-17 Paul Eggert <eggert@twinsun.com>
8134
8135 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
8136 to "SyntaxError" for consistency with my 2002-11-15 change.
8137
8138 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
8139 not define to {}, since this breaks the common use of `YYDPRINTF
8140 ((...));' if a single statement is desired (e.g. before `else').
8141 Work around GCC warnings by surrounding corresponding calls with
8142 {} if needed.
8143 (yyhasResolvedValue): Remove unused function.
8144 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
8145 loop body.
8146 (yyreportSyntaxError): Renamed from yyreportParseError.
8147 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
8148 All uses changed.
8149 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
8150 extern when possible. Remove unused initializations.
8151
b0937b22
AD
81522002-11-16 Akim Demaille <akim@epita.fr>
8153
8154 Augment the similarity between GLR and LALR traces.
8155
8156 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
8157 (YY_REDUCE_PRINT): New.
8158 (yyparse): Use them.
8159 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
8160 YYDPRINT here.
8161 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
8162 state reached after the reduction/recovery, since...
8163 (yyparse, yyprocessOneStack): Report the state we are entering in.
8164
c5e3e510
AD
81652002-11-16 Akim Demaille <akim@epita.fr>
8166
8167 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
8168 Add support for --trace=skeleton.
8169 * src/scan-skel.l: %option debug.
8170 Scan strings of non-@ or \n instead of character by character.
8171 (scan_skel): Handle trace_skeleton.
8172 (QPUTS): New.
8173 (@output_parser_name@, @output_header_name@): ``Restore'' their
8174 support (used to be M4 macros).
8175 * data/yacc.c: Quote larger chunks, a la glr.c.
8176 * data/lalr1.cc: Likewise.
8177 The header guards are no longer available, so use some other
8178 string than `YYLSP_NEEDED'.
8179
4c6cc1db
AD
81802002-11-16 Akim Demaille <akim@epita.fr>
8181
8182 Make the ``Printers and Destructors'' test more verbose, taking
8183 `yacc.c''s behavior as (possibly wrong) reference.
8184
8185 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
8186 instead of fprint on stdout.
8187 Set and report the last_line of the symbols.
8188 Consistently display values and locations.
8189
6d9e8019
PE
81902002-11-16 Paul Eggert <eggert@twinsun.com>
8191
8192 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
8193
6e649e65
PE
81942002-11-15 Paul Eggert <eggert@twinsun.com>
8195
b25d88f6
PE
8196 * tests/actions.at (Actions after errors): New test case.
8197
6e649e65
PE
8198 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
8199 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
8200 tests/action.at, tests/calc.at, tests/conflicts.at,
8201 tests/cxx-type.at, tests/regression.at:
8202 "parse error" -> "syntax error" for POSIX compatibility.
8203 "parsing stack overflow..." -> "parser stack overflow" so
8204 that code matches Bison documentation.
8205
0f39aab9
AD
82062002-11-15 Akim Demaille <akim@epita.fr>
8207
8208 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
8209 take two BRACED_CODE, not two string_content.
8210 Free the scanner's obstack when we are done.
8211 (code_content): New.
8212 * tests/calc.at: Adjust.
8213 * doc/bison.texinfo: Adjust.
8214 Also, make sure to include the `,' for these declarations.
8215
761c1926
AD
82162002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
8217
8218 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
8219 definition; avoids potential autoreconf problems.
8220
b0f98b10
AD
82212002-11-15 Akim Demaille <akim@epita.fr>
8222
8223 Always check the value returned by yyparse.
8224
8225 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
8226 returned by yyparse.
8227 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
8228 Adjust calls.
8229 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
8230 returned by yyparse.
8231
970785f1
PH
82322002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8233
8234 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
8235 on input.at test.
8236
8fcc7db1
PE
82372002-11-14 Paul Eggert <eggert@twinsun.com>
8238
7ec1b48e
PE
8239 * src/output.c (output_skeleton): Call xfopen instead of
8240 duplicating xfopen's body.
8241
cfff7583 8242 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 8243 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 8244
8fcc7db1
PE
8245 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
8246 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
8247 Group compiler. Instead, use "$CC -E bar.c". Include the .h
8248 file twice in the grammar, as an extra check.
8249
8250 * tests/input.at (Torturing the Scanner): Surround the
8251 backslash-newline tests with "#if 0", to make it less likely that
8252 we'll run into compiler bugs. Bring back solitary \ inside
8253 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 8254 test backslash-newline in C character constant.
8fcc7db1 8255
4e8d992c
AD
82562002-11-14 Akim Demaille <akim@epita.fr>
8257
8258 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
8259 status of the compiler.
f32b346d 8260 Calling `exit 1' is no longer needed.
4e8d992c
AD
8261 Reported by Nelson H. F. Beebe.
8262
9501dc6e
AD
82632002-11-14 Akim Demaille <akim@epita.fr>
8264
8265 * tests/atlocal.in (CPPFLAGS): We have config.h.
8266 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
8267 New.
8268 * tests/actions.at, tests/calc.at, tests/conflicts.at,
8269 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
8270 * tests/regression.at, tests/torture.at: Use them for all the
8271 grammars that are to be compiled.
8272 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
8273 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
8274 * doc/bison.texinfo (GLR Parsers): Document `inline'.
8275
18b519c0
AD
82762002-11-14 Akim Demaille <akim@epita.fr>
8277
8278 * doc/bison.texinfo: Various formatting changes (alignments in
8279 samples, additional @group/@end group, GCS in samples.
8280 Use @deffn instead of simple @table to define the directives,
8281 macros, variables etc.
8282
9a86cdb9
PE
82832002-11-13 Paul Eggert <eggert@twinsun.com>
8284
daa33def 8285 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 8286 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 8287
daa33def 8288 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 8289 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
8290 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
8291 * tests/headers.at (export YYLTYPE): Likewise.
8292
8293 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 8294 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 8295
9a86cdb9
PE
8296 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
8297 comments, since they're not portable. Use GNU coding style.
8298
9c1e26bd
AD
82992002-11-13 Akim Demaille <akim@epita.fr>
8300
8301 * data/yacc.c: Leave bigger chunks of quoted text.
8302 (YYDSYMPRINTF): New.
8303 Use it to report symbol activities.
8304 * data/glr.c (YYDSYMPRINTF): New.
8305 Use it.
8306
87f721cc
PE
83072002-11-12 Paul Eggert <eggert@twinsun.com>
8308
8309 Version 1.75b.
8310
8311 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
8312 (yyglrReduce): Return yyok, not 0.
8313 This should avoid the enumerated-type warnings reported
464c6927 8314 by Nelson H. F. Beebe in
161a71f3 8315 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
8316
8317 * lib/bbitset.h (BITSET_INLINE): Remove.
8318 * lib/bitset.h [! BITSET_INLINE]: Remove.
8319 (bitset_set, bitset_reset, bitset_test): Rename local vars
8320 to avoid shadowing warnings by GCC.
8321
8322 * data/glr.c (inline): Remove #define. It's the user's
8323 responsibility to #define it away, just like 'const'.
464c6927 8324 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 8325 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 8326
87f721cc
PE
8327 * Makefile.maint (po-check): Scan .l and .y files instead of the
8328 .c and the .h files that they generate. This fixes the bug
8329 reported by Tim Van Holder in:
161a71f3 8330 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
8331 Look for N_ as well as for _. Try to avoid matching #define for
8332 N_ and _.
8333 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
8334 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
8335 * src/scan-gram.l: Revamp regular expressions so that " and '
8336 do not confuse xgettext.
8337
8338 * src/struniq.h (struniq_new): Do not declare the return type
8339 to be 'const'; this violates the C standard.
8340 * src/struniq.c (struniq_new): Likewise.
8341
be14ade5
AD
83422002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
8343
8344 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
8345 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
8346 linker.
8347
05291fbc
AD
83482002-11-12 Akim Demaille <akim@epita.fr>
8349
8350 * Makefile.maint: Sync with Autoconf:
8351 (local_updates): New.
8352
1f5fd52e
AD
83532002-11-12 Akim Demaille <akim@epita.fr>
8354
8355 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
8356
283f1e64
AD
83572002-11-12 Akim Demaille <akim@epita.fr>
8358
8359 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
8360 locations.
8361
886b69d1
AD
83622002-11-12 Akim Demaille <akim@epita.fr>
8363
8364 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
8365 not yyvalue.
8366
3df37415
AD
83672002-11-12 Akim Demaille <akim@epita.fr>
8368
8369 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
8370 Use it to test the GLR parser.
8371
7bd6c77e
AD
83722002-11-12 Akim Demaille <akim@epita.fr>
8373
8374 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
8375 defines it.
8376 * data/glr.c (yystos): New.
8377 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
8378 (YYDSYMPRINT): New.
8379 (yyval): Don't define it, it is handled via M4.
8380 (yyrecoverParseError): Free verbosely the discarded symbols.
8381 * data/yacc.c (yysymprint): Remove, rather...
8382 (b4_yysymprint_generate): invoke.
8383 * data/c.m4 (b4_yysymprint_generate): New.
8384 Accept pointers as arguments, as opposed to the version from
8385 yacc.c.
8386 (b4_yydestruct_generate): Likewise.
8387 * tests/cations.at (Printers and Destructors): Use Bison directives
8388 instead of CPP macros.
8389 Don't rely on internal details.
8390
b0400cc6
AD
83912002-11-12 Akim Demaille <akim@epita.fr>
8392
8393 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
8394 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
8395 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
8396 it against YYEMPTY and so forth), work on yytoken (i.e., set
8397 it to YYEMPTY etc.).
8398 (yydestruct): Replace with a b4_yydestruct_generate invocation.
8399 (b4_symbol_actions): Remove.
8400 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
8401 for 0, end-of-input.
8402
72f889cc
AD
84032002-11-12 Akim Demaille <akim@epita.fr>
8404
8405 * doc/bison.texinfo (Destructor Decl): New.
8406
b1ae9233
AD
84072002-11-12 Akim Demaille <akim@epita.fr>
8408
8409 * src/tables.c (tables_generate): Use free for pointers that
8410 cannot be NULL, not XFREE.
8411 (pack_vector): Use assert, not fatal, for bound violations.
8412 * src/state.c (state_new): Likewise.
8413 * src/reader.c (reader): Likewise.
8414 * src/lalr.c (set_goto_map): Likewise.
72f889cc 8415 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
8416 the file name.
8417
7ec2d4cd
AD
84182002-11-12 Akim Demaille <akim@epita.fr>
8419
8420 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
8421 Restore.
8422 * src/scan-gram.l (last_string): Is global to the file, not to
8423 yylex.
8424 * src/parse-gram.y (input): Don't append the epilogue here,
8425 (epilogue.opt): do it here, and free the scanner's obstack.
8426 * src/reader.c (epilogue_set): Rename as...
8427 (epilogue_augment): this.
8428 * data/c.m4 (b4_epilogue): Defaults to empty.
8429
573a6cd3
AD
84302002-11-12 Akim Demaille <akim@epita.fr>
8431
8432 * src/getargs.c (long_options): Remove duplicates.
8433 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
8434 Remove.
8435 * doc/bison.rnh: Remove.
8436 * doc/bison.texinfo (VMS Invocation): Remove.
8437
95612cfa
AD
84382002-11-12 Akim Demaille <akim@epita.fr>
8439
8440 * src/struniq.h, src/struniq.c (struniq_t): Is const.
8441 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
8442
8443 Use struniq for symbols.
8444
8445 * src/symtab.h (symbol_t): The tag member is a struniq.
8446 (symbol_type_set): Adjust.
8447 * src/symtab.c (symbol_new): Takes a struniq.
8448 (symbol_free): Don't free the tag member.
8449 (hash_compare_symbol_t, hash_symbol_t): Rename as...
8450 (hash_compare_symbol, hash_symbol): these.
8451 Use the fact that tags as struniqs.
8452 (symbol_get): Use struniq_new.
8453 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
8454 Returns a strniq.
8455 * src/reader.h (merger_list, grammar_currentmerge_set): The name
8456 and type members are struniqs.
8457 * src/reader.c (get_merge_function)
8458 (grammar_current_rule_merge_set): Adjust.
8459 (TYPE, current_type): Are struniq.
8460
8461 Use struniq for file names.
8462
8463 * src/files.h, src/files.c (infile): Split into...
8464 (grammar_file, current_file): these.
8465 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
8466 * src/reduce.c (reduce_print): Likewise.
8467 * src/getargs.c (getargs): Likewise.
8468 * src/complain.h, src/complain.c: Likewise.
8469 * src/main.c (main): Call struniqs_new early enough to use it for
8470 file names.
8471 Don't free the input file name.
8472
3e6656f9
AD
84732002-11-12 Akim Demaille <akim@epita.fr>
8474
8475 * src/symtab.c (symbol_free): Remove dead deactivated code:
8476 type_name are properly removed.
8477 Don't use XFREE to free items that cannot be NULL.
8478 * src/struniq.h, src/struniq.c: New.
8479 * src/main.c (main): Initialize/free struniqs.
8480 * src/parse-gram.y (%union): Add astruniq member.
8481 (yyprint): Adjust.
8482 * src/scan-gram.l (<{tag}>): Return a struniq.
8483 Free the obstack bit that used to store it.
8484 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
8485
7672019c
PE
84862002-11-11 Paul Eggert <eggert@twinsun.com>
8487
8488 Revamp to fix many (but not all) of the C- and M4-related quoting
8489 problems. Among other things, this fixes the Bison bug reported
8490 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 8491 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
8492
8493 Use new @ escapes consistently. Represent brackets with @{ and @}
8494 rather than @<:@ and @:>@, since this works a bit better with dumb
8495 editors like vi. Represent @ with @@, since @ is now consistently
8496 an escape. Use @oline@ and @ofile@ rather than __oline__ and
8497 __ofile__, to avoid unexpected expansions. Similarly, use @output
8498 rather than #output.
8499
8500 * data/c.m4 (b4_copyright): Omit file name from comment, since
8501 the file name could contain "*/".
8502 (b4_synclines_flag): Don't quote the 2nd argument; it should already
8503 be quoted. All uses changed.
8504
8505 * data/glr.c: Use new @ escapes consistently.
8506 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
8507 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
8508 Remove, since they couldn't handle arbitrary characters in file
8509 names.
8510 * data/lalr1.cc: Likewise.
8511 * data/yacc.c: Likewise.
8512
8513 * src/files.c (output_infix): Remove; all uses removed.
8514 * src/files.h: Likewise.
8515
8516 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
8517 mishandled funny characters in file names, and anyway it isn't
8518 needed any more.
8519 * data/yacc.c: Likewise.
8520 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
8521
8522 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
8523 * data/yacc.c: Likewise.
8524
8525 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
8526 strings now.
8527 (muscle_init): Quote filename as a C string.
8528 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
8529 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
8530 * src/output.c (escaped_file_name_output): New function.
8531 (prepare_symbols): Quote tokens for M4.
8532 (prepare): Don't insert output_infix, output_prefix,
8533 output_parser_name, output_header_name; this is now down by scan-skel.
8534 Insert skeleton as a C string.
8535
8536 * src/output.c (user_actions_output, symbol_destructors_output,
8537 symbol_printers_output): Quote filenames for C and M4.
8538 * src/reader.c (prologue_augment, epilogue_set): Likewise.
8539
8540 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
8541 escapes other than \\ and \'; this simplifies the code.
8542 (<SC_STRING>): Likewise, for \\ and \".
8543 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
8544 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
8545 Use new escapes @{ and @} for [ and ].
8546
8547 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
8548 them with auto vars.
8549 Switch to new escape scheme, where @ is the escape character uniformly.
8550 Abort if a stray escape character is found. Avoid unbounded input
8551 buffer when parsing non-escaped text.
8552
8553 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
8554 __oline__, #output, $@, and @{ do not have unintended meanings.
8555
acea4f3b
PE
85562002-11-09 Paul Eggert <eggert@twinsun.com>
8557
8558 Fix the test failure due to GCC warnings described in
161a71f3 8559 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
8560 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
8561 evaluate to 0 if it's impossible for NINF to be in the respective
8562 table.
8563 (yygetLRActions, yyrecoverParseError): Use them.
8564
8565 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
8566 counted in the token inserted at end of file. Now takes
8567 location_t *, not location_t, so that the location can be
8568 adjusted. All uses changed.
8569
8570 * tests/regression.at (Invalid inputs): Adjust wording in
8571 diagnostic to match the new behavior.
8572
8573 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
8574 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
8575 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
8576 abort ();'. This reduces the runtime of the "Many lookaheads"
8577 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
8578 GCC 3.2.
8579
20ef1ad5
PE
85802002-11-07 Paul Eggert <eggert@twinsun.com>
8581
8582 * src/parse-gram.y (CHARACTER): Remove unused token.
8583 All uses removed.
8584
8585 * src/scan-gram.l: Remove stack option. We no longer use the
8586 stack, since the stack was never deeper than 1; instead, use the
8587 new auto var c_context to record the stacked value.
8588
8589 Remove nounput option. At an unexpected end of file, we now unput
8590 the minimal input necessary to end cleanly; this simplifies the
8591 code.
8592
8593 Avoid unbounded token sizes where this is easy.
8594
8595 (unexpected_end_of_file): New function.
8596 Use it to systematize the error message on unexpected EOF.
8597 (last-string): Now auto, not static.
8598 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
8599 (scanner_last_string_free): Remove; not used.
8600 (percent_percent_count): Move decl to just before use.
8601 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
8602 not the (never otherwised-used) CHARACTER.
8603
93724f13
AD
86042002-11-07 Akim Demaille <akim@epita.fr>
8605
8606 Let yyerror always receive the msg as last argument, so that
8607 yyerror can be variadic.
8608
8609 * data/yacc.c (b4_yyerror_args): New.
8610 Use it when calling yyerror.
8611 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
8612 Use it when calling yyerror.
8613 * doc/bison.texinfo (Error Reporting): Adjust.
8614 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
8615 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
8616
6e40b4eb
AD
86172002-11-06 Akim Demaille <akim@epita.fr>
8618
8619 #line should have quoted strings.
8620 Ideally, this should be done by m4_quotearg.
8621
8622 * src/scan-skel.l: Include quotearg.h.
8623 Quote __ofile__.
8624 * src/output.c (symbol_printers_output)
8625 (symbol_destructors_output): Quote the file name.
8626
2dfbfc12
AD
86272002-11-06 Akim Demaille <akim@epita.fr>
8628
8629 * tests/regression.at (Invalid inputs): Adjust to the recent
8630 messages.
8631
437c2d80
AD
86322002-11-06 Akim Demaille <akim@epita.fr>
8633
8634 Restore --no-lines.
8635 Reported by Jim Kent.
8636
8637 * data/c.m4 (b4_syncline): New.
8638 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
8639 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
8640 * src/output.c (user_actions_output): Likewise.
8641 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 8642 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 8643
900c5db5
AD
86442002-11-06 Akim Demaille <akim@epita.fr>
8645
8646 * src/main.c (main): Free `infile'.
8647 * src/scan-gram.l (handle_syncline): New.
8648 Recognize `#line'.
8649 * src/output.c (user_actions_output, symbol_destructors_output)
8650 (symbol_printers_output): Use the location's file name, not
8651 infile.
8652 * src/reader.c (prologue_augment, epilogue_set): Likewise.
8653
e183b123 86542002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 8655
e183b123 8656 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 8657 either has GLR conflict entries.
e183b123 8658
193eb6b7
PE
86592002-11-05 Paul Eggert <eggert@twinsun.com>
8660
e183b123
PE
8661 * src/scan-gram.l: Use more accurate diagnostics, e.g.
8662 "integer out of range" rather than "invalid value".
8663 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
8664 accordingly.
8665
193eb6b7
PE
8666 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
8667 Also, remove one static variable in the scanner.
8668
8669 * src/scan-gram.l (braces_level): Now auto, not static.
8670 Initialize to zero if the compiler is being picky.
8671 (INITIAL): Clear braces_level instead of incrementing it.
8672 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
8673 as POSIX 1003.1-2001 requires.
8674 * src/system.h (IF_LINT): New macro, taken from coreutils.
8675 * configure.ac: Define "lint" if --enable-gcc-warnings.
8676
29c01725
AD
86772002-11-05 Akim Demaille <akim@epita.fr>
8678
8679 * src/scan-gram.l: When it starts with `%', complain about the
8680 whole directive, not just that `invalid character: %'.
8681
8aeac3ca
AD
86822002-11-04 Akim Demaille <akim@epita.fr>
8683
8684 * Makefile.maint: Update from Autoconf.
8685 (update, cvs-update, po-update, do-po-update): New.
8686
793a58bb
AD
86872002-11-04 Akim Demaille <akim@epita.fr>
8688
8689 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
8690 and yyerror.
8691 Have yyerror `use' its arguments.
8692 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
8693 returns true when location & yacc & pure & parse-param.
8694 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
8695
c4d720cd
AD
86962002-11-04 Akim Demaille <akim@epita.fr>
8697
8698 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
8699 clashes.
8700 * src/scan-gram.l: Use [\'] instead of ['] to pacify
8701 font-lock-mode.
8702 Use complain_at.
8703 Use quote, not quote_n since LOCATION_PRINT no longer uses the
8704 slot 0.
8705
613a0dc5
PE
87062002-11-03 Paul Eggert <eggert@twinsun.com>
8707
8708 * src/reader.c (get_merge_function, grammar_current_rule_check):
8709 Use consistent diagnostics for reporting type name clashes.
8710 Quote the types with <>, for consistency with Yacc.
8711 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
8712
2a8d363a
AD
87132002-11-03 Akim Demaille <akim@epita.fr>
8714
8715 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
8716 New.
8717 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
8718 (b4_parse_param): Remove.
8719 Use b4_identification.
8720 Propagate b4_pure_args where needed to pass them to yyerror.
8721 * data/glr.m4 (b4_parse_param): Remove.
8722 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
8723 (b4_lpure_formals): New.
8724 Use b4_identification.
8725 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
8726 b4_user_formals and b4_user_args.
8727 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
8728 (yyreportAmbiguity): When using a pure parser, also need
8729 the location, and the parse-params.
8730 Adjust callers.
8731 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
8732 When using a pure parser, also need the parse-params.
8733 Adjust callers.
8734 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
8735 (%pure-parser + %parse-param) LALR and GLR parsers.
8736 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
8737 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
8738 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
8739 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
8740 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
8741 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
8742 * doc/bison.texinfo: Untabify the whole file.
8743 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
8744 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
8745 (Error Reporting): Adjust to these new directives.
8746 Document %error-verbose, deprecate YYERROR_VERBOSE.
8747
9e32add8
AD
87482002-11-03 Akim Demaille <akim@epita.fr>
8749
8750 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
8751 AT_CHECK_CALC_GLR invocations to use % directives, instead of
8752 command line options.
8753 * tests/cxx-type.at: Formatting changes.
8754
b02d90a5
PE
87552002-11-03 Paul Eggert <eggert@twinsun.com>
8756
8757 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
8758 to count columns correctly, and to check for invalid inputs.
9e32add8 8759
b02d90a5
PE
8760 Use mbsnwidth to count columns correctly. Account for tabs, too.
8761 Include mbswidth.h.
8762 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
8763 (extend_location): New function.
8764 (YY_LINES): Remove.
8765
8766 Handle CRLF in C code rather than in Lex code.
8767 (YY_INPUT): New macro.
8768 (no_cr_read): New function.
8769
8770 Scan UCNs, even though we don't fully handle them yet.
8771 (convert_ucn_to_byte): New function.
8772
8773 Handle backslash-newline correctly in C code.
8774 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
8775 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
8776 all uses changed.
8777 (tag, splice): New EREs. Do not allow NUL or newline in tags.
8778 Use {splice} wherever C allows backslash-newline.
8779 YY_STEP after space, newline, vertical-tab.
8780 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 8781
b02d90a5
PE
8782 (letter, id): Don't assume ASCII; e.g., spell out a-z.
8783
8784 ({int}, handle_action_dollar, handle_action_at): Check for integer
8785 overflow.
9e32add8 8786
b02d90a5
PE
8787 (YY_STEP): Omit trailing semicolon, so that it's more like C.
8788
8789 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
8790 as well as \000. Check for UCHAR_MAX, not 255.
8791 Allow \x with an arbitrary positive number of digits, as in C.
8792 Check for overflow here.
8793 Allow \? and UCNs, for compatibility with C.
8794
8795 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
8796 with quote slot used by complain_at.
8797
8798 * tests/input.at: Add tests for backslash-newline, m4 quotes
8799 in symbols, long literals, and funny escapes in strings.
8800
8801 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
8802 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
8803 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
8804 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
8805 * m4/mbswidth.m4: New file, from GNU coreutils.
8806
8807 * doc/bison.texinfo (Grammar Outline): Document // comments.
8808 (Symbols): Document that trigraphs have no special meaning in Bison,
8809 nor is backslash-newline allowed.
8810 (Actions): Document that trigraphs have no special meaning.
8811
8812 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
8813 no longer used.
8814
88152002-11-02 Paul Eggert <eggert@twinsun.com>
8816
8817 * src/reader.c: Don't include quote.h; not needed.
8818 (get_merge_function): Reword warning to be consistent with
8819 type clash diagnostic in grammar_current_rule_check.
8820
8821 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
8822 bug in trigraph handling.
8823
8824 * src/output.c (prepare_symbols): When printing token names,
8825 escape "[" as "@<:@" and likewise for "]".
8826
8827 * src/system.h (errno): Remove declaration, as we are now
8828 assuming C89 or better, and C89 guarantees errno.
8829
762b212b
PE
88302002-10-30 Paul Eggert <eggert@twinsun.com>
8831
8832 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
8833 Check for close failures.
8834 * src/files.h (xfclose): Return void, not int, since it always
8835 returned zero.
8836 * src/files.c (xfclose): Likewise. Report I/O error if ferror
8837 indicates one.
8838 * src/output.c (output_skeleton): Use xfclose rather than fclose
8839 and ferror. xfclose now checks ferror.
8840
8841 * data/glr.c (YYLEFTMOST_STATE): Remove.
8842 (yyreportTree): Use a stack-based leftmost state. This avoids
8843 our continuing battles with bogus warnings about initializers.
8844
56100c60
AD
88452002-10-30 Akim Demaille <akim@epita.fr>
8846
8847 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
8848 #if.
8849
51b4a04c
PH
88502002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8851
8852 * tests/glr-regr1.at: New test for reported regressions.
8853 * tests/testsuite.at: Add glr-regr1.at test.
8854 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 8855
bf1ebda2
PE
88562002-10-24 Paul Eggert <eggert@twinsun.com>
8857
5c16c6b1
PE
8858 Version 1.75a.
8859
bf1ebda2
PE
8860 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
8861 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
8862 we use malloc. Don't assume 'A' through 'Z' are contiguous.
8863 Don't assume strdup exists; POSIX says its an XSI extension.
8864 Check for buffer overflow on input.
8865
b526ee61
AD
88662002-10-24 Akim Demaille <akim@epita.fr>
8867
8868 * src/output.c (output_skeleton): Don't disable M4sugar comments
8869 too soon: it results in comments being expanded.
8870 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
8871 first output.
8872
f1886bb2
AD
88732002-10-24 Akim Demaille <akim@epita.fr>
8874
8875 * data/yacc.c (m4_int_type): New.
8876 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
8877 char' as only yacc.c wants K&R portability.
8878 * data/glr.c (yysigned_char): Remove.
8879 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
8880 Reported by Quoc Peyrot.
8881
c5576256
PE
88822002-10-23 Paul Eggert <eggert@twinsun.com>
8883
8884 * src/main.c (main): With --trace=time, report times even if a
8885 non-fatal error occurs. Formerly, the times were reported in some
8886 such cases but not in others.
8887 * src/reader.c (reader): Just return if a complaint has been issued,
8888 instead of exiting, so that 'main' can report times.
8889
27b0ffea
AD
88902002-10-22 Akim Demaille <akim@epita.fr>
8891
8892 * src/system.h: Include sys/types.
8893 Reported by Bert Deknuydt.
8894
223a7883
PE
88952002-10-23 Paul Eggert <eggert@twinsun.com>
8896
8897 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
8898 Suggested by Art Haas.
8899
89002002-10-22 Paul Eggert <eggert@twinsun.com>
8901
8902 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
8903 decl; not needed any more.
8904 * src/main.c (main): Use return to exit, undoing yesterday's change.
8905 The last OS that we could find where this wouldn't work is
8906 SunOS 3.5, and that's too old to worry about now.
8907
8908 * data/glr.c (struct yyltype): Define members even when not
8909 doing locations. This is more consistent with yacc.c, and it
8910 works around the following bug reports:
161a71f3
PE
8911 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
8912 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 8913
223a7883
PE
8914 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
8915 @acronym consistently. Standardize on "Yacc" instead of "YACC",
8916 "Algol" instead of "ALGOL". Give a bit more history about BNF.
8917
8b76775a
AD
89182002-10-22 Akim Demaille <akim@epita.fr>
8919
8920 * data/README: New.
8921
6db10d14
PE
89222002-10-21 Paul Eggert <eggert@twinsun.com>
8923
8924 Be consistent about 'bool'; the old code used an enum in one
8925 module and an int in another, and this violates the C standard.
8926 * m4/stdbool.m4: New file, from coreutils 4.5.3.
8927 * configure.ac (AC_HEADER_STDBOOL): Add.
8928 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
8929 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
8930 * src/symtab.c (hash_compare_symbol_t): Likewise.
8931 * src/system.h (bool, false, true): Use a definition consistent
8932 with ../lib/hash.c. All uses changed.
8933
8934 * src/complain.c (warning_issued): Renamed from warn_message_count,
8935 so that we needn't worry about integer overflow (!).
8936 Now of type bool. All uses changed.
8937 (complaint_issued): Renamed from complain_message_count; likewise.
8938
8939 * src/main.c (main): Use exit to exit with failure.
27b0ffea 8940
6db10d14
PE
8941 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
8942 rather than 1 and 0.
8943 * src/main.c (main): Likewise.
8944 * src/getargs.c (getargs): Likewise.
8945 * src/reader.c (reader): Likewise.
8946
8947 * src/getarg.c (getargs): Remove duplicate code for
8948 "Try `bison --help'".
8949
8950 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
8951 What was that "2" for?
8952
8953 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
8954 * src/getargs.c (usage): Likewise.
8955
8956 * src/getargs.c (getargs): When there are too few operands, report
8957 the last one. When there are too many, report the first extra
8958 one. This is how diffutils does it.
8959
92a060fd
PE
89602002-10-20 Paul Eggert <eggert@twinsun.com>
8961
8962 Remove K&R vestiges.
8963 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
8964 * src/complain.c (VA_START): Remove. Assume prototypes.
8965 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
8966 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
8967 fatal): Assume prototypes.
8968 * src/complain.h: Assume prototypes.
8969 * src/system.h (PARAMS): Remove.
8970 Include <limits.h> unconditionally, since it's guaranteeed even
8971 for a freestanding C89 compiler.
8972 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
8973 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 8974
e7cb57c0
AD
89752002-10-20 Akim Demaille <akim@epita.fr>
8976
8977 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
8978 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
8979 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
8980 (yyresolveStates, yyresolveAction, yyresolveStack)
8981 (yyprocessOneStack): Use them.
8982 (yy_reduce_print): New.
8983 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
8984
0245f82d
AD
89852002-10-20 Akim Demaille <akim@epita.fr>
8986
8987 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
8988 arguments and output `void'.
8989 (b4_c_function): Rename as...
8990 (b4_c_function_def): this.
8991 (b4_c_function_decl, b4_c_ansi_function_def)
8992 (b4_c_ansi_function_decl): New.
8993 Change the interpretation of the arguments: before `int, foo', now
8994 `int foo, foo'.
8995 * data/yacc.c (yyparse): Prototype and define thanks to these.
8996 Adjust b4_c_function_def uses.
8997 * data/glr.c (yyparse): Likewise, but ANSI only.
8998
39912f52
AD
89992002-10-20 Akim Demaille <akim@epita.fr>
9000
9001 * src/output.c (prepare): Move the definition of `tokens_number',
9002 `nterms_number', `undef_token_number', `user_token_number_max'
9003 to...
9004 (prepare_tokens): Here.
9005 (prepare_tokens): Rename as...
9006 (prepare_symbols): this.
9007 (prepare): Move the definition of `rules_number' to...
9008 (prepare_rules): here.
9009 (prepare): Move the definition of `last', `final_state_number',
9010 `states_number' to...
9011 (prepare_states): here.
9012 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
9013
20c1e2ad
AD
90142002-10-20 Akim Demaille <akim@epita.fr>
9015
9016 * src/tables.h, src/tables.c, src/output.c: Comment changes.
9017
21964f43
AD
90182002-10-20 Akim Demaille <akim@epita.fr>
9019
9020 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
9021 * data/c.m4: here.
9022
66d30cd4
AD
90232002-10-20 Akim Demaille <akim@epita.fr>
9024
9025 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
9026 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
9027 `pair'.
9028 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
9029 `name' to...
9030 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
9031 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
9032 These.
9033
95f2c9fe
PE
90342002-10-19 Paul Eggert <eggert@twinsun.com>
9035
9036 Do not create a temporary file, as that involves security and
9037 cleanup headaches. Instead, use a pair of pipes.
9038 Derived from a suggestion by Florian Krohm.
9039 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
9040 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
9041 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
9042 (BISON_PREREQ_SUBPIPE): Add.
9043 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
9044 Add subpipe.h, subpipe.c.
9045 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
9046 * po/POTFILES.in: Add lib/subpipe.c.
9047 * src/output.c: Include "subpipe.h".
9048 (m4_invoke): Remove decl.
9049 (scan_skel): New decl.
9050 (output_skeleton): Use pipe rather than temporary file for m4 input.
9051 Check that m4sugar.m4 is readable, to avoid deadlock.
9052 Check for pipe I/O error.
9053 * src/scan-skel.l (readpipe): Remove decl.
9054 (scan_skel): New function, to be used in place of m4_invoke.
9055 Read from stream rather than file.
66d30cd4 9056
95f2c9fe
PE
9057 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
9058 float, as this generates a warning on Solaris 8 + GCC 3.2 with
9059 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
9060 this generates a more-accurate value anyway.
9061
9062 * lib/timevar.c (timervar_accumulate): Rename locals to
9063 avoid confusion with similarly-named more-global.
9064 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
9065
9066 * src/output.c (prepare): Use xstrdup to convert char const *
9067 to char *, to avoid GCC warning.
9068
c19988b7
AD
90692002-10-19 Akim Demaille <akim@epita.fr>
9070
9071 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
9072 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
9073 Use them to have `calc.y' ready for %pure-parser.
9074 * data/yacc.c (YYLEX): Pass a yylex return type to
9075 b4_c_function_call.
9076
ae7453f2
AD
90772002-10-19 Akim Demaille <akim@epita.fr>
9078
9079 Prototype support of %lex-param and %parse-param.
9080
9081 * src/parse-gram.y: Add the definition of the %lex-param and
9082 %parse-param tokens, plus their rules.
9083 Drop the `_' version of %glr-parser.
9084 Add the "," token.
9085 * src/scan-gram.l (INITIAL): Scan them.
9086 * src/muscle_tab.c: Comment changes.
9087 (muscle_insert, muscle_find): Rename `pair' as `probe'.
9088 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
9089 (muscle_entry_s): The `value' member is no longer const.
9090 Adjust all dependencies.
9091 * src/muscle_tab.c (muscle_init): Adjust: use
9092 MUSCLE_INSERT_STRING.
9093 Initialize the obstack earlier.
9094 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
9095 (muscle_pair_list_grow): New.
9096 * data/c.m4 (b4_c_function_call, b4_c_args): New.
9097 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
9098 * tests/calc.at: Use %locations, not --locations.
9099 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
9100
0e575721
AD
91012002-10-19 Akim Demaille <akim@epita.fr>
9102
9103 * src/getargs.c (usage): Take status as argument and exit
9104 accordingly.
9105 Report the traditional `Try ... --help' message when status != 0.
9106 (usage, version): Don't take a FILE * as arg, it is pointless.
9107 (getargs): When there is an incorrect number of arguments, make it
9108 an error, and report it GNUlically thanks to `usage ()'.
9109
724ce7f5
PE
91102002-10-18 Paul Eggert <eggert@twinsun.com>
9111
3a781eb2
PE
9112 * data/glr.c (yyreportParseError): Don't assume that sprintf
9113 yields the length of the printed string, as this is not true
9114 on SunOS 4.1.4. Reported by Peter Klein.
9115
724ce7f5
PE
9116 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
9117 * tests/conflicts.at (%nonassoc and eof): Likewise.
9118 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
9119
473d0a75
AD
91202002-10-17 Akim Demaille <akim@epita.fr>
9121
9122 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
9123 * src/getargs.c (trace_types, trace_args): Adjust.
9124 * src/reader.c (grammar_current_rule_prec_set)
9125 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
9126 Standardize error messages.
9127 And s/@prec/%prec/!
9128 (reader): Use trace_flag to enable scanner/parser debugging,
9129 instead of an adhoc scheme.
9130 * src/scan-gram.l: Remove trailing debugging code.
9131
e76d2469
PE
91322002-10-16 Paul Eggert <eggert@twinsun.com>
9133
93e2236a
PE
9134 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
9135 MUSCLE_TAB_H.
9136
e76d2469
PE
9137 * NEWS: Officially drop support for building Bison with K&R C,
9138 since it didn't work anyway and it's not worth worrying about.
9139 * Makefile.maint (wget_files): Remove ansi2knr.c.
9140 (ansi2knr.c-url_prefix): Remove.
9141 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
9142 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9143 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9144
5bd1c419
PE
91452002-10-15 Paul Eggert <eggert@twinsun.com>
9146
9147 Stop using the "enum_" trick for K&R-style function definitions;
9148 it confused me, and I was the author! Instead, assume that people
9149 who want to use K&R C compilers (when using these modules in GCC,
9150 perhaps?) will run ansi2knr.
9151
9152 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
9153 All uses of "enum_" changed to "enum ".
9154 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9155 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 9156
5bd1c419
PE
9157 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
9158 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
9159 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
9160 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
9161 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
9162 abitset_not, abitset_ones, abitset_or, abitset_or_and,
9163 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
9164 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
9165 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
9166 Use function prototypes; this removes the need for declaring
9167 static functions simply to provide their prototypes.
9168 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
9169 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
9170 bitset_count_, bitset_create, bitset_dump, bitset_first,
9171 bitset_free, bitset_init, bitset_last, bitset_next,
9172 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
9173 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
9174 bitset_print, bitset_release_memory, bitset_toggle_,
9175 bitset_type_choose, bitset_type_get, bitset_type_name_get,
9176 debug_bitset): Likewise.
9177 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
9178 * lib/bitset_stats.c (bitset_log_histogram_print,
9179 bitset_percent_histogram_print, bitset_stats_and,
9180 bitset_stats_and_cmp, bitset_stats_and_or,
9181 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
9182 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
9183 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
9184 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
9185 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
9186 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
9187 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
9188 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
9189 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
9190 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
9191 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
9192 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
9193 bitset_stats_zero): Likewise.
9194 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9195 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9196 bitsetv_dump, debug_bitsetv): Likewise.
9197 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
9198 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
9199 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
9200 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
9201 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
9202 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
9203 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
9204 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
9205 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
9206 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
9207 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
9208 Likewise.
9209 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
9210 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
9211 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
9212 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
9213 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
9214 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
9215 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
9216 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
9217 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
9218 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
9219 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 9220
ae26e1f0
AD
92212002-10-14 Akim Demaille <akim@epita.fr>
9222
9223 Version 1.75.
9224
d43baf71
AD
92252002-10-14 Akim Demaille <akim@epita.fr>
9226
9227 * tests/Makefile.am (maintainer-check-posix): New.
9228
7ebc83e3
AD
92292002-10-14 Akim Demaille <akim@epita.fr>
9230
9231 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
9232 member.
9233
05846dae
AD
92342002-10-14 Akim Demaille <akim@epita.fr>
9235
9236 * src/tables.c (table_ninf_remap): base -> tab.
9237 Reported by Matt Rosing.
9238
1318e37d
PE
92392002-10-14 Paul Eggert <eggert@twinsun.com>
9240
447fbb17
PE
9241 * tests/action.at, tests/calc.at, tests/conflicts.at,
9242 tests/cxx-type.at, tests/headers.at, tests/input.at,
9243 tests/regression.at, tests/synclines.at, tests/torture.at:
9244 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
9245 so that the tests still work even if POSIXLY_CORRECT is set.
9246 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 9247
1318e37d
PE
9248 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
9249 for portability to K&R hosts. Fix typo: signed char is guaranteed
9250 only to 127, not to 128.
9251 * data/glr.c (yysigned_char): New type.
9252 * data/yacc.c (yysigned_char): Likewise.
9253 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
9254
cc0f0794
PE
92552002-10-13 Paul Eggert <eggert@twinsun.com>
9256
5038f418
PE
9257 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
9258 true due to limited range of data type" warning from GCC.
9259
cc0f0794
PE
9260 * data/c.m4 (b4_token_defines): Protect against double-inclusion
9261 by wrapping enum yytokentype's definition inside #ifndef
9262 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
9263
6fed0802
AD
92642002-10-13 Akim Demaille <akim@epita.fr>
9265
9266 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
9267 Un yy- yyrhs to avoid the name clash with the global YYRHS.
9268
32f0598d
AD
92692002-10-13 Akim Demaille <akim@epita.fr>
9270
9271 * Makefile.maint: Update from Autoconf 2.54.
9272 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
9273
7ea9a33f
AD
92742002-10-13 Akim Demaille <akim@epita.fr>
9275
9276 * src/print.c (print_state): Separate the list of solved conflicts
9277 from the other items.
9278 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
9279
ea99527d
AD
92802002-10-13 Akim Demaille <akim@epita.fr>
9281
9282 Let nondeterministic skeletons be usable with deterministic
9283 tables.
9284
9285 With the patch, GAWK compiled by GCC without -O2 passes its test
9286 suite using a GLR parser driven by LALR tables. It fails with -O2
9287 because `struct stat' gives two different answers on my machine:
9288 88 (definition of an auto var) and later 96 (memset on this var).
9289 Hence the stack is badly corrumpted. The headers inclusion is to
9290 blame: if I move the awk.h inclusion before GLR's system header
9291 inclusion, the two struct stat have the same size.
9292
9293 * src/tables.c (pack_table): Always create conflict_table.
9294 (token_actions): Always create conflict_list.
9295 * data/glr.c (YYFLAG): Remove, unused.
9296
f377f69f
AD
92972002-10-13 Akim Demaille <akim@epita.fr>
9298
9299 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
9300 (O0FLAGS): New.
9301 (VALGRIND, GXX): New.
9302 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
9303 * tests/bison.in: Run $PREBISON a pre-command.
9304 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
9305 (maintainer-check-g++): New.
9306 * Makefile.am (maintainer-check): New.
9307
2a1fe6ed
AD
93082002-10-13 Akim Demaille <akim@epita.fr>
9309
9310 * data/glr.c: Formatting changes.
9311 Tweak some trace messages to match yacc.c's.
9312
f50adbbd
AD
93132002-10-13 Akim Demaille <akim@epita.fr>
9314
9315 GLR parsers sometimes raise parse errors instead of performing the
9316 default reduction.
9317 Reported by Charles-Henry de Boysson.
9318
9319 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 9320 check the length of the traces when %glr.
f50adbbd
AD
9321 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
9322 GLR's traces.
9323 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
9324 Test GLR parsers.
9325 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
9326 (yyltype): Remove the yy prefix from the member names.
9327 (yytable): Complete its comment.
9328 (yygetLRActions): Map error action number from YYTABLE from
9329 YYTABLE_NINF to 0.
9330 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
9331 (which was a bug: it should have been YYTABEL_NINF, and yet it was
9332 not satisfying as we could compare an YYACTION computed from
9333 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
9334 only value for error actions.
9335 (yyreportParseError): In verbose parse error messages, don't issue
9336 `error' in the list of expected tokens.
9337 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
9338 next action to perform to match glr.c's decoding.
9339 (yytable): Complete its comment.
9340
bcbad5b9
PE
93412002-10-13 Paul Eggert <eggert@twinsun.com>
9342
9343 Fix problem reported by Henrik Grubbstroem in
161a71f3 9344 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
9345 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
9346 because the Bison parser reads the second action before reducing
9347 the first one.
9348 * src/scan-gram.l (rule_length): New static var.
9349 Use it to keep track of the rule length in the scanner, since
9350 we can't expect the parser to be in lock-step sync with the scanner.
9351 (handle_action_dollar, handle_action_at): Use this var.
9352 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 9353
14904b89
PE
93542002-10-12 Paul Eggert <eggert@twinsun.com>
9355
1fe611e5
PE
9356 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
9357 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
9358 Include <sys/time.h> when checking for clock_t and struct tms.
9359 Use same include order as source.
9360 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 9361 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 9362
1fe611e5
PE
9363 * lib/timevar.c: Update copyright date and clarify comments.
9364 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 9365
1fe611e5
PE
9366 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
9367 GCC version as of today, then merge Bison's changes.
9368 Change "GCC" to "Bison" in copyright notice. timevar.def's
9369 author is Akim, so change that too.
9370
98194095
PE
9371 * src/reader.c (grammar_current_rule_check):
9372 Don't worry about the default action if $$ is untyped.
9373 Prevents bogus warnings reported by Jim Gifford in
161a71f3 9374 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 9375
14904b89
PE
9376 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
9377 * data/glr.c, data/lalr1.cc, data/yacc.c:
9378 Output token definitions before the first part of user declarations.
9379 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 9380 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 9381
ff6dca18
PE
93822002-10-11 Paul Eggert <eggert@twinsun.com>
9383
9384 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
9385 (yyparse): here. This undoes some of the 2002-07-25 change.
9386 Compatibility problem reported by Ralf S. Engelschall with
9387 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
9388
eb714592
AD
93892002-10-11 Akim Demaille <akim@epita.fr>
9390
9391 * tests/regression.at Characters Escapes): New.
9392 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
9393 characters.
9394 Reported by Jan Nieuwenhuizen.
9395
b7195100
AD
93962002-10-11 Akim Demaille <akim@epita.fr>
9397
9398 * po/id.po: New.
9399
f28a0f2d
PE
94002002-10-10 Paul Eggert <eggert@twinsun.com>
9401
9402 Portability fixes for bitsets; this also avoids several GCC
9403 warnings.
9404
9405 * lib/abitset.c: Include <stddef.h>, for offsetof.
9406 * lib/lbitset.c: Likewise.
9407
9408 * lib/abitset.c (abitset_bytes): Return a size that is aligned
9409 properly for vectors of objects. Do not assume that adding a
9410 header size to a multiple of a word size yields a value that is
9411 properly aligned for the whole union.
9412 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9413
9414 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
9415 unique names for structures.
9416 * lib/ebitset.c (ebitset_bytes): Likewise.
9417 * lib/lbitset.c (lbitset_bytes): Likewise.
9418
9419 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
9420 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
9421 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
9422 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
9423 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
9424 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
9425 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
9426 to improve the type-checking that GCC can do.
9427 * lib/bitset.c (bitset_op4_cmp): Likewise.
9428 * lib/bitset_stats.c (bitset_stats_count,
9429 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
9430 bitset_stats_copy, bitset_stats_disjoint_p,
9431 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
9432 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
9433 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
9434 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
9435 bitset_stats_and_or_cmp, bitset_stats_andn_or,
9436 bitset_stats_andn_or_cmp, bitset_stats_or_and,
9437 bitset_stats_or_and_cmp): Likewise.
9438 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
9439 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
9440 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
9441 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
9442
9443 * lib/abitset.h: Include bitset.h, not bbitset.h.
9444 * lib/ebitset.h: Likewise.
9445 * lib/lbitset.h: Likewise.
9446
9447 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
9448 All instances of parameters of type enum bitset_opts are now of
9449 type enum_bitset_opts, to conform to the C Standard, and similarly
9450 for enum_bitset_type.
9451 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9452 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
9453
9454 Do not use "struct bitset_struct" to mean different things in
9455 different modules. Not only is this confusing, it violates
9456 the C Standard, which requires that structure types in different
9457 modules must be compatible if one is to be passed to the other.
9458 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
9459 All instances of "struct bitset_struct *" replaced with "bitset".
9460 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
9461 (union bitset_union, struct abitset_struct, struct ebitset_struct,
9462 struct lbitset_struct, struct bitset_stats_struct): New types.
9463 All uses of struct bitset_struct changed to union bitset_union,
9464 etc.
ba0fe3c7 9465 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
9466 struct bitset_struct): Remove.
9467 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
9468 struct bitset_struct): Remove.
9469 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
9470 bitset_struct): Remove.
9471 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
9472 Likewise.
9473
9474 Do not call a function of type T using a call that assumes the
9475 function is of a different type U. Standard C requires that a
9476 function must be called with a type that is compatible with its
9477 definition.
9478 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9479 New decls.
9480 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9481 New functions.
9482 * lib/ebitset.c (PFV): Remove.
9483 * lib/lbitset.c (PFV): Likewise.
9484 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
9485 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
9486 decls.
9487 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
9488 (ebitset_vtable): Use them.
9489 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
9490 lbitset_xor): New functions.
9491 (lbitset_vtable): Use them.
9492
9493 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
9494 Declare.
9495
9496 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
9497 GCC warning.
9498 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
9499 Use offsetof, for simplicity.
9500
6fbe4984
PE
95012002-10-06 Paul Eggert <eggert@twinsun.com>
9502
9503 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
9504 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 9505 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
9506 which was inadvertently undone by the 2002-09-30 patch.
9507 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
9508 the same width as int.
9509
420f93c8
PE
95102002-10-04 Paul Eggert <eggert@twinsun.com>
9511
9512 Version 1.50.
9513
9514 * configure.ac (AC_INIT), NEWS: Increment version number.
9515
9516 * doc/bison.texinfo: Minor spelling, grammar, and white space
9517 fixes.
9518 (Symbols): Mention that any negative value returned from yylex
9519 signifies end-of-input. Warn about negative chars. Mention
9520 the portable Standard C character set.
9521
9522 The GNU coding standard says CFLAGS and YFLAGS are reserved
9523 for the installer to set.
9524 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
9525 * src/Makefile.am (AM_CFLAGS): Likewise.
9526 (AM_YFLAGS): Renamed from YFLAGS.
9527
9528 Fix some MAX and MIN problems.
9529 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
9530 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
9531 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
9532 * src/reader.c (reader): Use it.
9533
9534 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
9535 POSIX 1003.1-2001 has removed fgrep.
9536
95372002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
9538
9539 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
9540 interpreted as signed.
9541 * lib/ebitset.c (ebitset_list): Fix bug.
9542
ff68026d
PE
95432002-10-01 Paul Eggert <eggert@twinsun.com>
9544
9545 More fixes for 64-bit hosts and large bitsets.
9546
9547 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
9548 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
9549 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
9550 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
9551 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
9552 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
9553 bitset_count_): Likewise.
9554 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
9555 bitset_first, bitset_last): Likewise.
9556 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
9557 bitset_stats_list_reverse, bitset_stats_size,
9558 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
9559 Likewise.
9560 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9561 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9562 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9563 bitsetv_reflexive_transitive_closure): Likewise.
9564 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
9565 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
9566 Likewise.
9567 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
9568 Likewise.
420f93c8 9569
ff68026d
PE
9570 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
9571 Use size_t, not unsigned int, to count bytes.
9572 * lib/abitset.h (abitset_bytes): Likewise.
9573 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
9574 Likewise.
9575 * lib/bitset.h (bitset_bytes): Likewise.
9576 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
9577 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
9578 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9579 * lib/ebitset.c (ebitset_bytes): Likewise.
9580 * lib/ebitset.h (ebitset_bytes): Likewise.
9581 * lib/lbitset.c (lbitset_bytes): Likewise.
9582 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 9583
ff68026d
PE
9584 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
9585 abitset_subset_p, abitset_disjoint_p, abitset_and,
9586 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
9587 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
9588 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
9589 abitset_or_and, abitset_or_and_cmp):
9590 Use bitset_windex instead of unsigned int.
9591 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
9592 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
9593 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
9594 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
9595 Likewise.
9596 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 9597
ff68026d
PE
9598 * lib/bitset.c (bitset_print):
9599 Use proper printf formats for widths of integer types.
9600 * lib/bitset_stats.c (bitset_percent_histogram_print,
9601 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
9602 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9603 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
9604 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 9605
ff68026d
PE
9606 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
9607 BITSET_SIZE_MAX): New macros.
9608 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
9609 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
9610 to BITSET_WINDEX_MAX.
9611
9612 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
9613 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
9614 since we now return the bitset_bindex type (not int).
9615
9616 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
9617 when computing sizes.
9618 * lib/ebitset.c (ebitset_elts_grow): Likewise.
9619
9620 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
9621 and avoid cast to unsigned.
9622
6aa452a6
AD
96232002-09-30 Akim Demaille <akim@epita.fr>
9624
9625 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
9626 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
9627 Updates from Michael Hayes.
9628
927f7817
AD
96292002-09-30 Art Haas <ahaas@neosoft.com>
9630
9631 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
9632 invocations.
9633 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
9634 defined.
9635
9738f41e
AD
96362002-09-27 Akim Demaille <akim@epita.fr>
9637
9638 Version 1.49c.
9639
a5c75d7f
AD
96402002-09-27 Akim Demaille <akim@epita.fr>
9641
9642 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
9643 (Because of AC_LIBSOURCE).
9644
8280e179
AD
96452002-09-27 Akim Demaille <akim@epita.fr>
9646
9647 Playing with Autoscan.
9648
9649 * configure.ac: Remove the old LIBOBJ tweaks.
9650 (AC_REPLACE_FUNCS): Add strrchr and strtol.
9651 * lib/strrchr.c: New.
9652 * lib/strtol.c: New, from the Coreutils 4.5.1.
9653
ae64af35
AD
96542002-09-27 Akim Demaille <akim@epita.fr>
9655
9656 Playing with Autoscan.
9657
9658 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
9659 * lib/Makefile.am (libbison_a_SOURCES): No longer include
9660 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
9661 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
9662 Coreutils 4.5.1.
9663
d1a1114f
AD
96642002-09-24 Akim Demaille <akim@epita.fr>
9665
9666 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
9667 (Frequently Asked Questions, Parser Stack Overflow): New.
9668
b906441c
AD
96692002-09-13 Akim Demaille <akim@epita.fr>
9670
9671 Playing with autoscan.
9672
9673 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
9674 * src/files.c (skeleton_find): Remove, unused.
9675 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
9676 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
9677
bd701811
AD
96782002-09-13 Akim Demaille <akim@epita.fr>
9679
9680 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
9681 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
9682
e0a13e7b
AD
96832002-09-13 Akim Demaille <akim@epita.fr>
9684
9685 * configure.ac: Require 2.54.
9686 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
9687 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
9688 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
9689 Remove, provided by Autoconf macros.
9690
c97011bf
AD
96912002-09-12 Akim Demaille <akim@epita.fr>
9692
9693 * m4/prereq.m4: Update, from Coreutils 4.5.1.
9694
d862b1be
AD
96952002-09-12 Akim Demaille <akim@epita.fr>
9696
9697 * m4/prereq.m4: Update, from Fileutils 4.1.5.
9698 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
9699 Reported by Martin Mokrejs.
9700
3d38c03a
AD
97012002-09-10 Akim Demaille <akim@epita.fr>
9702
9703 * src/parse-gram.y: Associate a human readable string to each
9704 token type.
9705 * tests/regression.at (Invalid inputs): Adjust.
9706
b6347355
AD
97072002-09-10 Gary V. Vaughan <gary@gnu.org>
9708
9709 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
9710 with an Autoconf-2.5x style configure.ac.
9711
09ba4ab2
PE
97122002-09-06 Paul Eggert <eggert@twinsun.com>
9713
9714 * doc/bison.texinfo (Conditions): Make explicit that the GPL
9715 exception applies only to yacc.c. This is a modification of a
9716 patch originally suggested by Akim Demaille.
9717
21846f69
AD
97182002-09-06 Akim Demaille <akim@epita.fr>
9719
09ba4ab2
PE
9720 * data/c.m4 (b4_copyright): Move the GPL exception comment from
9721 here to...
9722 * data/yacc.c: here.
9723
21846f69
AD
9724 * data/lalr1.cc (struct yyltype): Don't define it, since we use
9725 LocationType.
9726 (b4_ltype): Default to yy::Location from location.hh.
9727
c0ad8bf3
AD
97282002-09-04 Jim Meyering <jim@meyering.net>
9729
9730 * data/yacc.c: Guard the declaration of yytoknum also with
9731 `#ifdef YYPRINT', so it is declared only when used.
9732
3a93251e
AD
97332002-09-04 Akim Demaille <akim@epita.fr>
9734
9735 * configure.in: Rename as...
9736 * configure.ac: this.
9737 Bump to 1.49c.
9738
427c0dda
AD
97392002-09-04 Akim Demaille <akim@epita.fr>
9740
9741 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
9742 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
9743 translate maintainer only messages.
9744
6a254321
PE
97452002-08-12 Paul Eggert <eggert@twinsun.com>
9746
645e30d1
PE
9747 Version 1.49b.
9748
6a254321
PE
9749 * Makefile.am (SUBDIRS): Remove intl.
9750 (DISTCLEANFILES): Remove.
9751 * NEWS: Mention that GNU M4 is now required. Clarify what is
9752 meant by "larger grammars". Mention the pt_BR translation.
9753 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
9754 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
9755 Bump version from 0.11.2 to 0.11.5.
9756 (BISON_PREREQ_STAGE): Remove.
9757 (AM_GNU_GETTEXT): Use external gettext.
9758 (AC_OUTPUT): Remove intl/Makefile.
9759
9760 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
9761
9762 * data/glr.c: Include string.h, for strlen.
9763 (yyreportParseError): Use size_t for yysize.
9764 (yy_yypstack): No longer nested inside yypstates, as nested
9765 functions are not portable. Do not assume size_t is the
9766 same width as int.
9767 (yypstates): Do not assume that ptrdiff_t is the same width
9768 as int, and similarly for yyposn and YYINDEX.
9769
9770 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
9771
9772 * lib/Makefile.am (INCLUDES): Do not include from the intl
9773 directory, which has been removed.
9774 * src/Makefile.am (INCLUDES): Likewise.
9775
9776 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
9777 (bitsets_sources, additional_bitsets_sources, timevars_sources):
9778 New vars.
9779
9780 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
9781 * tests/Makefile.am (EXTRA_DIST): Likewise.
9782
9783 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
9784 Do not assume that bitset_windex is the same width as unsigned.
9785
9786 * lib/abitset.c (abitset_unused_clear): Do not assume that
9787 bitset_word is the same width as int.
9788 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
9789 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
9790 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
9791 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
9792 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
9793
9794 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
9795 portability to one's complement hosts!).
9796 * lib/ebitset.c (ebitset_op1): Likewise.
9797 * lib/lbitset.c (lbitset_op1): Likewise.
9798
9799 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
9800 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
9801 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
9802 Sync with fileutils.
9803 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
9804 lib/gettext.h: Sync with diffutils.
9805
9806 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
9807 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
9808
9809 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
9810 PROTOTYPES to check for prototypes, and "defined __STDC__" to
9811 check for void *.
9812
9813 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
9814 size_t; the old version tried to do this but casted improperly.
9815 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
9816 (bitset_test): Now returns int, not unsigned long.
9817
9818 * lib/bitset_stats.c: Include "gettext.h".
9819 (_): New macro.
9820 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
9821 name locals "index", as it generates unnecessary warnings on some
9822 hosts that have an "index" function.
9823
9824 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
9825 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
9826 they need translation.
9827 * src/LR0.c (state_list_append, new_itemsets, get_state,
9828 append_states, generate_states): Likewise.
9829 * src/assoc.c (assoc_to_string): Likewise.
9830 * src/closure.c (print_closure, set_firsts, closure): Likewise.
9831 * src/gram.c (grammar_dump): Likewise.
9832 * src/injections.c (injections_compute): Likewise.
9833 * src/lalr.c (lookaheads_print): Likewise.
9834 * src/relation.c (relation_transpose): Likewise.
9835 * src/scan-gram.l: Likewise.
9836 * src/tables.c (table_grow, pack_vector): Likewise.
9837
9838 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
9839 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
9840 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
9841 * m4/mbstate_t.m4: Sync with fileutils.
9842 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
9843
9844 * po/LINGUAS: Add pt_BR.
9845 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
9846 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
9847 lib/timevar.c.
9848 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
9849 manual recommends.
9850 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
9851
9852 * src/complain.c (strerror_r): Remove decl; not needed.
9853 (strerror): Use same pattern as ../lib/error.c.
9854
9855 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
9856
9857 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
9858
9859 * src/main.c (main): Cast result of bindtextdomain and textdomain
9860 to void, to avoid a GCC warning when --disable-nls is in effect.
9861
9862 * src/scan-gram.l: Use strings rather than escapes when possible,
9863 to minimize the number of warnings from xgettext.
9864 (handle_action_dollar, handle_action_at): Don't use isdigit,
9865 as it mishandles negative chars and it may not work as expected
9866 outside the C locale.
9867
9868 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
9869 this is a GCC extension and is not portable to other compilers.
9870
9871 * src/system.h (alloca): Use same pattern as ../lib/error.c.
9872 Do not include <ctype.h>; no longer needed.
9873 Do not include <malloc.h>; no longer needed (and generates
9874 warnings on OpenBSD 3.0).
9875
9876 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
9877 it's not portable.
9878
9879 * tests/regression.at: Do not use 'cc -c input.c -o input';
9880 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
9881
9882 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
9883 exit status as failure, not just exit status 1. Sun C exits
9884 with status 2 sometimes.
9885
9886 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
9887 Use it for the two large tests.
9888
c8f002c7
AD
98892002-08-02 Akim Demaille <akim@epita.fr>
9890
9891 * src/conflicts.c (conflicts_output): Don't output rules never
9892 reduced here, since anyway that computation doesn't work.
9893 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
9894 (rule_useless_p, rule_never_reduced_p): New.
9895 (grammar_rules_partial_print): Use a filter instead of a range.
9896 Display the title only if needed.
9897 (grammar_rules_print): Adjust.
9898 (grammar_rules_never_reduced_report): New.
9899 * src/tables.c (action_row): Move the computation of rules never
9900 reduced to...
9901 (token_actions): here.
9902 * src/main.c (main): Make the parser before making the report, so
9903 that rules never reduced are computed.
9904 Call grammar_rules_never_reduced_report.
9905 * src/print.c (print_results): Report rules never reduced.
9906 * tests/conflicts.at, tests/reduce.at: Adjust.
9907
cd08e51e
AD
99082002-08-01 Akim Demaille <akim@epita.fr>
9909
9910 Instead of attaching lookaheads and duplicating the rules being
9911 reduced by a state, attach the lookaheads to the reductions.
9912
9913 * src/state.h (state_t): Remove the `lookaheads',
9914 `lookaheads_rule' member.
9915 (reductions_t): Add a `lookaheads' member.
9916 Use a regular array for the `rules'.
9917 * src/state.c (reductions_new): Initialize the lookaheads member
9918 to 0.
9919 (state_rule_lookaheads_print): Adjust.
9920 * src/state.h, src/state.c (state_reductions_find): New.
9921 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
9922 (count_rr_conflicts): Adjust.
9923 * src/lalr.c (LArule): Remove.
9924 (add_lookback_edge): Adjust.
9925 (state_lookaheads_count): New.
9926 (states_lookaheads_initialize): Merge into...
9927 (initialize_LA): this.
9928 (lalr_free): Adjust.
9929 * src/main.c (main): Don't free nullable and derives too early: it
9930 is used by --verbose.
9931 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
9932
bb0027a9
AD
99332002-08-01 Akim Demaille <akim@epita.fr>
9934
9935 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
9936 `rule_number_t**'.
9937 (set_derives, free_derives): Rename as...
9938 (derives_compute, derives_free): this.
9939 Adjust all dependencies.
9940 * src/nullable.c (set_nullable, free_nullable): Rename as...
9941 (nullable_compute, nullable_free): these.
9942 (rule_list_t): Store rule_t *, not rule_number_t.
9943 * src/state.c (state_rule_lookaheads_print): Directly compare rule
9944 pointers, instead of their numbers.
9945 * src/main.c (main): Call nullable_free, and derives_free earlier,
9946 as they were lo longer used.
9947
3325ddc4
AD
99482002-08-01 Akim Demaille <akim@epita.fr>
9949
9950 * lib/timevar.c (get_time): Include children time.
9951 * src/lalr.h (LA, LArule): Don't export them: used with the
9952 state_t.
9953 * src/lalr.c (LA, LArule): Static.
9954 * src/lalr.h, src/lalr.c (lalr_free): New.
9955 * src/main.c (main): Call it.
9956 * src/tables.c (pack_vector): Check whether loc is >= to the
9957 table_size, not >.
9958 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
9959 (tables_generate): do it, since that's also it which allocates
9960 them.
9961 Don't free LA and LArule, main does.
9962
c6f1a33c
AD
99632002-07-31 Akim Demaille <akim@epita.fr>
9964
9965 Separate parser tables computation and output.
9966
9967 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
9968 (conflict_list, conflict_list_cnt, table, check, table_ninf)
9969 (yydefgoto, yydefact, high): Move to...
9970 * src/tables.h, src/tables.c: here.
9971 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
9972 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
9973 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
9974 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
9975 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
9976 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
9977 (action_row, save_row, token_actions, save_column, default_goto)
9978 (goto_actions, sort_actions, matching_state, pack_vector)
9979 (table_ninf_remap, pack_table, prepare_actions): Move to...
9980 * src/tables.c: here.
9981 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
9982 * src/output.c (token_actions, output_base, output_conflicts)
9983 (output_check): Merge into...
9984 (prepare_actions): this.
9985 (actions_output): Rename as...
9986 (user_actions_output): this.
9987 * src/main.c (main): Call tables_generate and tables_free.
9988
1509d42f
AD
99892002-07-31 Akim Demaille <akim@epita.fr>
9990
9991 Steal GCC's --time-report support.
9992
9993 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
9994 stolen/adjusted from GCC.
9995 * m4/stage.m4: Remove time related checks.
9996 * m4/timevar.m4: New.
9997 * configure.in: Adjust.
9998 * src/system.h: Adjust to using timevar.h.
9999 * src/getargs.h, src/getargs.c: Support trace_time for
10000 --trace=time.
10001 * src/main.c (stage): Remove.
10002 (main): Replace `stage' invocations with timevar calls.
10003 * src/output.c: Insert pertinent timevar calls.
10004
273a74fa
AD
100052002-07-31 Akim Demaille <akim@epita.fr>
10006
10007 Let --trace have arguments.
10008
10009 * src/getargs.h (enum trace_e): New.
10010 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
10011 (long_options, short_options): --trace/-T takes an optional
10012 argument.
10013 Change all the uses of trace_flag to reflect the new flags.
10014 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
10015
10016 Strengthen `stage' portability.
10017
10018 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
10019 * configure.in: Use it.
10020 Don't check for malloc.h and sys/times.h.
10021 * src/system.h: Include them when appropriate.
10022 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
10023 times and struct tms are available.
10024
217598da
AD
100252002-07-30 Akim Demaille <akim@epita.fr>
10026
10027 In verbose parse error message, don't report `error' as an
10028 expected token.
10029 * tests/actions.at (Printers and Destructors): Adjust.
10030 * tests/calc.at (Calculator $1): Adjust.
10031 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
10032 error message, do not report the parser accepts the error token in
10033 that state.
10034
52489d44
AD
100352002-07-30 Akim Demaille <akim@epita.fr>
10036
10037 Normalize conflict related messages.
10038
10039 * src/complain.h, src/complain.c (warn, complain): New.
10040 * src/conflicts.c (conflicts_print): Use them.
10041 (conflict_report_yacc): New, extracted from...
10042 (conflicts_print): here.
10043 * tests/conflicts.at, tests/existing.at: Adjust.
10044
e8832397
AD
100452002-07-30 Akim Demaille <akim@epita.fr>
10046
10047 Report rules which are never reduced by the parser: those hidden
10048 by conflicts.
10049
10050 * src/LR0.c (save_reductions): Don't make the final state too
10051 different: save its reduction (accept) instead of having a state
10052 without any action (no shift or goto, no reduce).
10053 Note: the final state is now a ``regular'' state, i.e., the
10054 parsers now contain `reduce 0' as default reduction.
10055 Nevertheless, since they decide to `accept' when yystate =
10056 final_state, they still will not reduce rule 0.
10057 * src/print.c (print_actions, print_reduction): Adjust.
10058 * src/output.c (action_row): Track reduced rules.
10059 (token_actions): Report rules never reduced.
10060 * tests/conflicts.at, tests/regression.at: Adjust.
10061
caf23d24
AD
100622002-07-30 Akim Demaille <akim@epita.fr>
10063
10064 `stage' was accidently included in a previous patch.
10065 Initiate its autoconfiscation.
10066
10067 * configure.in: Look for malloc.h and sys/times.h.
10068 * src/main.c (stage): Adjust.
10069 Report only when trace_flag.
10070
640748ee
AD
100712002-07-29 Akim Demaille <akim@epita.fr>
10072
10073 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
10074 state_number_t.
10075 (errs_t): symbol_t*, not symbol_number_t.
10076 (reductions_t): rule_t*, not rule_number_t.
10077 (FOR_EACH_SHIFT): New.
10078 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
10079 * src/print.c, src/print_graph.c: Adjust.
10080
88bce5a2
AD
100812002-07-29 Akim Demaille <akim@epita.fr>
10082
10083 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
10084
10085 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
10086 (endtoken, accept): these.
10087 * src/reader.c (reader): Set endtoken's default tag to "$end".
10088 Set undeftoken's tag to "$undefined" instead of "$undefined.".
10089 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
10090 Adjust.
10091
1bfb97db
AD
100922002-07-29 Akim Demaille <akim@epita.fr>
10093
10094 * src/reduce.c (reduce_grammar): When the language is empty,
10095 complain about the start symbol, not the axiom.
10096 Use its location.
10097 * tests/reduce.at (Empty Language): New.
10098
fc5734fe
AD
100992002-07-26 Akim Demaille <akim@epita.fr>
10100
10101 * src/reader.h, src/reader.c (gram_error): ... can't get
10102 yycontrol without making too strong assumptions on the parser
10103 itself.
10104 * src/output.c (prepare_tokens): Use the real 0th value of
10105 token_translations instead of `0'.
10106 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
10107 visible here.
10108 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
10109 for the time being: %locations ought to provide it to yyerror.
10110
3650b4b8
AD
101112002-07-25 Akim Demaille <akim@epita.fr>
10112
10113 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
10114 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
10115 * tests/regression.at (Web2c Actions): Adjust.
10116
4b3d3a8e
AD
101172002-07-25 Akim Demaille <akim@epita.fr>
10118
10119 Stop storing rules from 1 to nrules + 1.
10120
10121 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
10122 * src/nullable.c, src/output.c, src/print.c, src/reader.c
10123 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
10124 Iterate from 0 to nrules.
10125 Use rule_number_as_item_number and item_number_as_rule_number.
10126 Adjust to `derive' now containing possibly 0.
10127 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
10128 Handle the `- 1' part in rule numbers from/to item numbers.
10129 * src/conflicts.c (log_resolution): Fix the message which reversed
10130 shift and reduce.
10131 * src/output.c (action_row): Initialize default_rule to -1.
10132 (token_actions): Adjust.
10133 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
10134 expected output.
10135 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
10136
4a2a22f4
AD
101372002-07-25 Akim Demaille <akim@epita.fr>
10138
10139 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
10140 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
10141 (b4_c_knr_arg_decl): New.
10142 * data/yacc.c: Use it to define yysymprint, yydestruct, and
10143 yyreport_parse_error.
10144
b8df3223
AD
101452002-07-25 Akim Demaille <akim@epita.fr>
10146
10147 * data/yacc.c (yyreport_parse_error): New, extracted from...
10148 (yyparse): here.
10149 (yydestruct, yysymprint): Move above yyparse.
10150 Be K&R compliant.
10151
a762e609
AD
101522002-07-25 Akim Demaille <akim@epita.fr>
10153
10154 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
10155 replace...
10156 (b4_sint_type, b4_uint_type): these.
10157 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
10158 * tests/regression.at (Web2c Actions): Adjust.
10159
12b0043a
AD
101602002-07-25 Akim Demaille <akim@epita.fr>
10161
10162 * src/gram.h (TIEM_NUMBER_MAX): New.
10163 (item_number_of_rule_number, rule_number_of_item_number): Rename
10164 as...
10165 (rule_number_as_item_number, item_number_as_rule_number): these.
10166 Adjust dependencies.
10167 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
10168 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
10169 (symbol_number_to_vector_number): New.
10170 (order): Of vector_number_t* type.
10171 (base_t, BASE_MAX, BASE_MIN): New.
10172 (froms, tos, width, pos, check): Of base_t type.
10173 (action_number_t, ACTION_MIN, ACTION_MAX): New.
10174 (actrow): Of action_number_t type.
10175 (conflrow): Of unsigned int type.
10176 (table_ninf, base_ninf): New.
10177 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
10178 (muscle_insert_int_table, muscle_insert_base_table)
10179 (muscle_insert_rule_number_table): New.
10180 (prepare_tokens): Output `toknum' as int_table.
10181 (action_row): Returns a rule_number_t.
10182 Use ACTION_MIN, not SHRT_MIN.
10183 (token_actions): yydefact is rule_number_t*.
10184 (table_ninf_remap): New.
10185 (pack_table): Use it for `base' and `table'.
10186 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
10187 replaced with...
10188 (YYPACT_NINF, YYTABLE_NINF): these.
10189 (yypact, yytable): Compute their types instead of hard-coded
10190 `short'.
10191 * tests/regression.at (Web2c Actions): Adjust.
10192
5dde258a
AD
101932002-07-19 Akim Demaille <akim@epita.fr>
10194
10195 * src/scan-gram.l (id): Can start with an underscore.
10196
a945ec39
AD
101972002-07-16 Akim Demaille <akim@epita.fr>
10198
10199 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
10200 Adjust all former `associativity' dependencies.
10201 * src/symtab.c (symbol_new): Default associativity is `undef', not
10202 `right'.
10203 (symbol_check_alias_consistence): Adjust.
10204
fae437e8
AD
102052002-07-09 Akim Demaille <akim@epita.fr>
10206
10207 * doc/bison.texinfo: Properly set the ``header'' part.
10208 Use @dircategory ``GNU programming tools'' as per Texinfo's
10209 documentation.
10210 Use @copying.
10211
1a715ef2
AD
102122002-07-09 Akim Demaille <akim@epita.fr>
10213
10214 * lib/quotearg.h: Protect against multiple inclusions.
10215 * src/location.h (location_t): Add a `file' member.
10216 (LOCATION_RESET, LOCATION_PRINT): Adjust.
10217 * src/complain.c (warn_at, complain_at, fatal_at): Drop
10218 `error_one_per_line' support.
10219
a5d50994
AD
102202002-07-09 Akim Demaille <akim@epita.fr>
10221
10222 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
10223 * src/reader.c (lineno): Remove.
10224 Adjust all dependencies.
10225 (get_merge_function): Take a location and use complain_at.
10226 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
10227 * tests/regression.at (Invalid inputs, Mixing %token styles):
10228 Adjust.
10229
b275314e
AD
102302002-07-09 Akim Demaille <akim@epita.fr>
10231
10232 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
10233 recovery rule, and forbid extensions when --yacc.
10234 (gram_error): Use complain_at.
10235 * src/reader.c (reader): Exit if there were parse errors.
10236
865b9df1
AD
102372002-07-09 Akim Demaille <akim@epita.fr>
10238
10239 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
10240 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
10241 Reported by R Blake <blakers@mac.com>.
10242
c76e14da
AD
102432002-07-09 Akim Demaille <akim@epita.fr>
10244
10245 * data/yacc.c: Output the copyright notive in the header.
10246
7db2ed2d
AD
102472002-07-03 Akim Demaille <akim@epita.fr>
10248
10249 * src/output.c (froms, tos): Are state_number_t.
10250 (save_column): sp, sp1, and sp2 are state_number_t.
10251 (prepare): Rename `final' as `final_state_number', `nnts' as
10252 `nterms_number', `nrules' as `rules_number', `nstates' as
10253 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
10254 unused.
10255 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
10256 * data/lalr1.cc (nsym_): Remove, unused.
10257
e68e0410
AD
102582002-07-03 Akim Demaille <akim@epita.fr>
10259
10260 * src/lalr.h, src/lalr.c (goto_number_t): New.
10261 * src/lalr.c (goto_list_t): New.
10262 Propagate them.
10263 * src/nullable.c (rule_list_t): New.
10264 Propagate.
10265 * src/types.h: Remove.
10266
e1a4f3a4
AD
102672002-07-03 Akim Demaille <akim@epita.fr>
10268
10269 * src/closure.c (print_fderives): Use rule_rhs_print.
10270 * src/derives.c (print_derives): Use rule_rhs_print.
10271 (rule_list_t): New, replaces `shorts'.
10272 (set_derives): Add comments.
10273 * tests/sets.at (Nullable, Firsts): Adjust.
10274
536545f3
AD
102752002-07-03 Akim Demaille <akim@epita.fr>
10276
10277 * src/output.c (prepare_actions): Free `tally' and `width'.
10278 (prepare_actions): Allocate and free `order'.
10279 * src/symtab.c (symbols_free): Free `symbols'.
10280 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
10281 * src/output.c (m4_invoke): Move to...
10282 * src/scan-skel.l: here.
10283 (<<EOF>>): Close yyout, and free its name.
10284
8b752b00
AD
102852002-07-03 Akim Demaille <akim@epita.fr>
10286
10287 Fix some memory leaks, and fix a bug: state 0 was examined twice.
10288
10289 * src/LR0.c (new_state): Merge into...
10290 (state_list_append): this.
10291 (new_states): Merge into...
10292 (generate_states): here.
10293 (set_states): Don't ensure a proper `errs' state member here, do it...
10294 * src/conflicts.c (conflicts_solve): here.
10295 * src/state.h, src/state.c: Comment changes.
10296 (state_t): Rename member `shifts' as `transitions'.
10297 Adjust all dependencies.
10298 (errs_new): For consistency, also take the values as argument.
10299 (errs_dup): Remove.
10300 (state_errs_set): New.
10301 (state_reductions_set, state_transitions_set): Assert that no
10302 previous value was assigned.
10303 (state_free): New.
10304 (states_free): Use it.
10305 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
10306 temporary storage: use `errs' and `nerrs' as elsewhere.
10307 (set_conflicts): Allocate and free this `errs'.
10308
613f5e1a
AD
103092002-07-02 Akim Demaille <akim@epita.fr>
10310
10311 * lib/libiberty.h: New.
10312 * lib: Update the bitset implementation from upstream.
10313 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
10314 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
10315 * src/main.c: Adjust bitset stats calls.
10316
26e0cadc
PE
103172002-07-01 Paul Eggert <eggert@twinsun.com>
10318
10319 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
10320 char, so that negative chars don't collide with $.
10321
1154cced
AD
103222002-06-30 Akim Demaille <akim@epita.fr>
10323
10324 Have the GLR tests be `warning' checked, and fix the warnings.
10325
10326 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
10327 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
10328 (yyremoveDeletes): `yyi' and `yyj' are size_t.
10329 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
10330 (yyaddDeferredAction): static.
10331 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
10332 (yyreportParseError): yyprefix is const.
10333 yytokenp is used only when verbose.
10334 (yy__GNUC__): Replace with __GNUC__.
10335 (yypdumpstack): yyi is size_t.
10336 (yypreference): Un-yy local variables and arguments, to avoid
10337 clashes with `yyr1'. Anyway, we are not in the user name space.
10338 (yytname_size): be an int, as is compared with ints.
10339 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
10340 Use them.
10341 * tests/cxx-gram.at: Use quotation to protect $1.
10342 Use AT_COMPILE to enable warnings hunts.
10343 Prototype yylex and yyerror.
10344 `Use' argc.
10345 Include `string.h', not `strings.h'.
10346 Produce and prototype stmtMerge only when used.
10347 yylex takes a location.
10348
97650f4e
AD
103492002-06-30 Akim Demaille <akim@epita.fr>
10350
10351 We spend a lot of time in quotearg, in particular when --verbose.
10352
10353 * src/symtab.c (symbol_get): Store a quoted version of the key.
10354 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
10355 Adjust all callers.
10356
d2576365
AD
103572002-06-30 Akim Demaille <akim@epita.fr>
10358
10359 * src/state.h (reductions_t): Rename member `nreds' as num.
10360 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
10361 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
10362
ccaf65bc
AD
103632002-06-30 Akim Demaille <akim@epita.fr>
10364
10365 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
10366 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
10367 (shifts_to): Rename as...
10368 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
10369 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
10370 (TRANSITION_IS_DISABLED, transitions_to): these.
10371
87675353
AD
103722002-06-30 Akim Demaille <akim@epita.fr>
10373
10374 * src/print.c (print_shifts, print_gotos): Merge into...
10375 (print_transitions): this.
10376 (print_transitions, print_errs, print_reductions): Align the
10377 lookaheads columns.
10378 (print_core, print_transitions, print_errs, print_state,
10379 print_grammar): Output empty lines separator before, not after.
10380 (state_default_rule_compute): Rename as...
10381 (state_default_rule): this.
10382 * tests/conflicts.at (Defaulted Conflicted Reduction),
10383 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
10384 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
10385
ce4ccb4b
AD
103862002-06-30 Akim Demaille <akim@epita.fr>
10387
10388 Display items as we display rules.
10389
10390 * src/gram.h, src/gram.c (rule_lhs_print): New.
10391 * src/gram.c (grammar_rules_partial_print): Use it.
10392 * src/print.c (print_core): Likewise.
10393 * tests/conflicts.at (Defaulted Conflicted Reduction),
10394 (Unresolved SR Conflicts): Adjust.
10395 (Unresolved SR Conflicts): Adjust and rename as...
10396 (Resolved SR Conflicts): this, as was meant.
10397 * tests/regression.at (Web2c Report): Adjust.
10398
bc933ef1
AD
103992002-06-30 Akim Demaille <akim@epita.fr>
10400
10401 * src/print.c (state_default_rule_compute): New, extracted from...
10402 (print_reductions): here.
10403 Pessimize, but clarify the code.
10404 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
10405
53d4308d
AD
104062002-06-30 Akim Demaille <akim@epita.fr>
10407
10408 * src/output.c (action_row): Let default_rule be always a rule
10409 number.
10410
574fb2d5
AD
104112002-06-30 Akim Demaille <akim@epita.fr>
10412
10413 * src/closure.c (print_firsts, print_fderives, closure):
10414 Use BITSET_EXECUTE.
10415 * src/lalr.c (lookaheads_print): Likewise.
10416 * src/state.c (state_rule_lookaheads_print): Likewise.
10417 * src/print_graph.c (print_core): Likewise.
10418 * src/print.c (print_reductions): Likewise.
10419 * src/output.c (action_row): Likewise.
10420 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
10421
05811fd7
AD
104222002-06-30 Akim Demaille <akim@epita.fr>
10423
10424 * src/print_graph.c: Use report_flag.
10425
0e4d5753
AD
104262002-06-30 Akim Demaille <akim@epita.fr>
10427
10428 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
10429 to...
10430 * src/relation.h, src/relation.c (traverse, relation_digraph)
10431 (relation_print, relation_transpose): New.
10432
24c7d800
AD
104332002-06-30 Akim Demaille <akim@epita.fr>
10434
10435 * src/state.h, src/state.c (shifts_to): New.
10436 * src/lalr.c (build_relations): Use it.
10437
9222837b
AD
104382002-06-30 Akim Demaille <akim@epita.fr>
10439
10440 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
10441 (item_number_of_rule_number, rule_number_of_item_number): New.
10442 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
10443 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
10444 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
10445 Propagate their use.
10446 Much remains to be done, in particular wrt `shorts' from types.h.
10447
260008e5
AD
104482002-06-30 Akim Demaille <akim@epita.fr>
10449
10450 * src/symtab.c (symbol_new): Initialize the `printer' member.
10451
8a731ca8
AD
104522002-06-30 Akim Demaille <akim@epita.fr>
10453
10454 * src/LR0.c (save_reductions): Remove, replaced by...
10455 * src/state.h, src/state.c (state_reductions_set): New.
10456 (reductions, errs): Rename as...
10457 (reductions_t, errs_t): these.
10458 Adjust all dependencies.
10459
32e1e0a4
AD
104602002-06-30 Akim Demaille <akim@epita.fr>
10461
10462 * src/LR0.c (state_list_t, state_list_append): New.
10463 (first_state, last_state): Now symbol_list_t.
10464 (this_state): Remove.
10465 (new_itemsets, append_states, save_reductions): Take a state_t as
10466 argument.
10467 (set_states, generate_states): Adjust.
10468 (save_shifts): Remove, replaced by...
10469 * src/state.h, src/state.c (state_shifts_set): New.
10470 (shifts): Rename as...
10471 (shifts_t): this.
10472 Adjust all dependencies.
10473 * src/state.h (state_t): Remove the `next' member.
10474
e5fb6710
AD
104752002-06-30 Akim Demaille <akim@epita.fr>
10476
10477 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
10478 escaped in slot 0.
10479
c7ca99d4
AD
104802002-06-30 Akim Demaille <akim@epita.fr>
10481
10482 Use hash.h for the state hash table.
10483
10484 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
10485 (allocate_storage): Use state_hash_new.
10486 (free_storage): Use state_hash_free.
10487 (new_state, get_state): Adjust.
10488 * src/lalr.h, src/lalr.c (states): Move to...
10489 * src/states.h (state_t): Remove the `link' member, no longer
10490 used.
10491 * src/states.h, src/states.c: here.
10492 (state_hash_new, state_hash_free, state_hash_lookup)
10493 (state_hash_insert, states_free): New.
10494 * src/states.c (state_table, state_compare, state_hash): New.
10495 * src/output.c (output_actions): Do not free states now, since we
10496 still need to know the final_state number in `prepare', called
10497 afterwards. Do it...
10498 * src/main.c (main): here: call states_free after `output'.
10499
df0e7316
AD
105002002-06-30 Akim Demaille <akim@epita.fr>
10501
10502 * src/state.h, src/state.c (state_new): New, extracted from...
10503 * src/LR0.c (new_state): here.
10504 * src/state.h (STATE_ALLOC): Move to...
10505 * src/state.c: here.
10506 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
10507 * src/state.h, src/state.c: here.
10508
39f41916
AD
105092002-06-30 Akim Demaille <akim@epita.fr>
10510
10511 * src/reader.c (gensym): Rename as...
10512 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
10513 (getsym): Rename as...
10514 (symbol_get): this.
10515
d57650a5
AD
105162002-06-30 Akim Demaille <akim@epita.fr>
10517
10518 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
10519 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
10520 * src/output.c, src/print.c, src/print_graph.c: Propagate.
10521 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
10522
5a08f1ce
AD
105232002-06-30 Akim Demaille <akim@epita.fr>
10524
10525 Make the test suite pass with warnings checked.
10526
10527 * tests/actions.at (Printers and Destructors): Improve.
10528 Avoid unsigned vs. signed issues.
10529 * tests/calc.at: Don't exercise the scanner here, do it...
10530 * tests/input.at (Torturing the Scanner): here.
10531
720623af
PH
105322002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10533
88e7e941 10534 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
10535 reorganize first lines parallel to yacc.c.
10536
fb8135fa
AD
105372002-06-28 Akim Demaille <akim@epita.fr>
10538
10539 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
10540 (b4_token_enum, b4_token_defines): New, factored from...
10541 * data/lalr1.cc, data/yacc.c, glr.c: here.
10542
41442480
AD
105432002-06-28 Akim Demaille <akim@epita.fr>
10544
10545 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
10546 unused variables.
10547 * src/output.c (merger_output): static.
10548
e0e5bf84
AD
105492002-06-28 Akim Demaille <akim@epita.fr>
10550
ba0fe3c7 10551 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
10552 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
10553 pacify GCC.
10554 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 10555
676385e2
PH
105562002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10557
10558 Accumulated changelog for new GLR parsing features.
10559
6a254321 10560 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
10561 conflicts_total_count.
10562 * src/conflicts.h: Ditto.
10563 * src/output.c (token_actions): Use the new name.
10564 (output_conflicts): Change conflp => conflict_list_heads, and
10565 confl => conflict_list for better readability.
10566 * data/glr.c: Use the new names.
10567 * NEWS: Add self to GLR announcement.
e0e5bf84 10568
676385e2
PH
10569 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
10570
10571 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
10572 Akim Demaille.
10573
10574 * data/bison.glr: Change name to glr.c
10575 * data/glr.c: Renamed from bison.glr.
10576 * data/Makefile.am: Add glr.c
e0e5bf84
AD
10577
10578 * src/getargs.c:
10579
676385e2 10580 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 10581 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 10582
676385e2
PH
10583 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10584
10585 * data/bison.glr: Be sure to restore the
10586 current #line when returning to the skeleton contents after having
10587 exposed the input file's #line.
10588
10589 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10590
10591 * data/bison.glr: Bring up to date with changes to bison.simple.
10592
10593 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10594
10595 * data/bison.glr: Correct definitions that use b4_prefix.
10596 Various reformatting.
10597 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
10598 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
10599 yytokenp argument; now part of stack.
10600 (yychar): Define to behave as documented.
10601 (yyclearin): Ditto.
e0e5bf84 10602
676385e2
PH
10603 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10604
10605 * src/reader.h: Add declaration for free_merger_functions.
10606
10607 * src/reader.c (merge_functions): New variable.
10608 (get_merge_function): New function.
10609 (free_merger_functions): New function.
10610 (readgram): Check for %prec that is not followed by a symbol.
10611 Handle %dprec and %merge declarations.
10612 (packgram): Initialize dprec and merger fields in rules array.
10613
10614 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
10615 conflict_list_cnt, conflict_list_free): New variables.
10616 (table_grow): Also grow conflict_table.
e0e5bf84 10617 (prepare_rules): Output dprec and merger tables.
676385e2 10618 (conflict_row): New function.
e0e5bf84 10619 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
10620 default reduction in conflicted states for GLR parser so that there
10621 are spaces for the conflict lists.
10622 (save_row): Also save conflict information.
10623 (token_actions): Allocate conflict list.
10624 (merger_output): New function.
10625 (pack_vector): Pack conflict table, too.
10626 (output_conflicts): New function to output yyconflp and yyconfl.
10627 (output_check): Allocate conflict_tos.
10628 (output_actions): Output conflict tables, also.
10629 (output_skeleton): Output b4_mergers definition.
10630 (prepare): Output b4_max_rhs_length definition.
10631 Use 'bison.glr' as default skeleton for GLR parsers.
10632
10633 * src/gram.c (glr_parser): New flag.
10634 (grammar_free): Call free_merger_functions.
10635
10636 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
10637 all pairs of conflicting reductions, rather than just all tokens
10638 causing conflicts. Needed to size conflict tables.
e0e5bf84 10639 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
10640 interface.
10641 (conflicts_print): Ditto.
10642 (count_total_conflicts): New function.
10643
10644 * src/reader.h (merger_list): New type.
10645 (merge_functions): New variable.
10646
10647 * src/lex.h (tok_dprec, tok_merge): New token types.
10648
10649 * src/gram.h (rule_s): Add dprec and merger fields.
10650 (glr_parser): New flag.
10651
10652 * src/conflicts.h (count_total_conflicts): New function.
10653
10654 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
10655
10656 * doc/bison.texinfo (Generalized LR Parsing): New section.
10657 (GLR Parsers): New section.
10658 (Language and Grammar): Mention GLR parsing.
10659 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
10660 Correct typo ("tge" -> "the").
10661
10662 * data/bison.glr: New skeleton for GLR parsing.
10663
10664 * tests/cxx-gram.at: New tests for GLR parsing.
10665
10666 * tests/testsuite.at: Include cxx-gram.at.
10667
10668 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 10669
676385e2
PH
10670 * src/parse-gram.y:
10671
10672 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
10673
10674 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 10675
b5480d74 106762002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
10677
10678 * src/options.h, src/options.c: Remove.
10679 * src/getargs.c (short_options, long_options): New.
10680
60491a94
AD
106812002-06-27 Akim Demaille <akim@epita.fr>
10682
10683 * data/bison.simple, data/bison.c++: Rename as...
10684 * data/yacc.c, data/lalr1.cc: these.
10685 * doc/bison.texinfo (Environment Variables): Remove.
10686
9be0c25b
AD
106872002-06-25 Raja R Harinath <harinath@cs.umn.edu>
10688
10689 * src/getargs.c (report_argmatch): Initialize strtok().
10690
1ae72863
AD
106912002-06-20 Akim Demaille <akim@epita.fr>
10692
10693 * data/bison.simple (b4_symbol_actions): New, replaces...
10694 (b4_symbol_destructor, b4_symbol_printer): these.
10695 (yysymprint): Be sure to call YYPRINT only for tokens, and using
10696 user token numbers.
10697
87542d29
AD
106982002-06-20 Akim Demaille <akim@epita.fr>
10699
10700 * data/bison.simple (yydestructor): Rename as...
10701 (yydestruct): this.
10702
1a31ed21
AD
107032002-06-20 Akim Demaille <akim@epita.fr>
10704
10705 * src/symtab.h, src/symtab.c (symbol_type_set)
10706 (symbol_destructor_set, symbol_precedence_set): The location is
10707 the last argument.
10708 Adjust all callers.
10709
e776192e
AD
107102002-06-20 Akim Demaille <akim@epita.fr>
10711
10712 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
10713 internals.
10714 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
10715 Takes a location.
10716 * src/symtab.h, src/symtab.c (symbol_class_set)
10717 (symbol_user_token_number_set): Likewise.
10718 Adjust all callers.
10719 Promote complain_at.
10720 * tests/input.at (Type Clashes): Adjust.
10721
5c1180b3
AD
107222002-06-20 Akim Demaille <akim@epita.fr>
10723
10724 * data/bison.simple (YYLEX): Fix the declaration when
10725 %pure-parser.
10726
e3170060
AD
107272002-06-20 Akim Demaille <akim@epita.fr>
10728
10729 * data/bison.simple (yysymprint): Don't print the token number,
10730 just its name.
10731 * tests/actions.at (Destructors): Rename as...
10732 (Printers and Destructors): this.
10733 Also exercise %printer.
10734
253862fd
AD
107352002-06-20 Akim Demaille <akim@epita.fr>
10736
10737 * data/bison.simple (YYDSYMPRINT): New.
10738 Use it to remove many of the #if YYDEBUG/if (yydebug).
10739
366eea36
AD
107402002-06-20 Akim Demaille <akim@epita.fr>
10741
10742 * src/symtab.h, src/symtab.c (symbol_t): printer and
10743 printer_location are new members.
10744 (symbol_printer_set): New.
10745 * src/parse-gram.y (PERCENT_PRINTER): New token.
10746 Handle its associated rule.
10747 * src/scan-gram.l: Adjust.
10748 (handle_destructor_at, handle_destructor_dollar): Rename as...
10749 (handle_symbol_code_at, handle_symbol_code_dollar): these.
10750 * src/output.c (symbol_printers_output): New.
10751 (output_skeleton): Call it.
10752 * data/bison.simple (yysymprint): New. Cannot be named yyprint
10753 since there are already many grammar files with a user `yyprint'.
10754 Replace the calls to YYPRINT to calls to yysymprint.
10755 * tests/calc.at: Adjust.
10756 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
10757 taking advantage of parser very internal details (stack size!).
10758
4f25ebb0
AD
107592002-06-20 Akim Demaille <akim@epita.fr>
10760
10761 * src/scan-gram.l: Complete the scanner with the missing patterns
10762 to pacify Flex.
10763 Use `quote' and `symbol_tag_get' where appropriate.
10764
93b68a0e
AD
107652002-06-19 Akim Demaille <akim@epita.fr>
10766
10767 * tests/actions.at (Destructors): Augment to test locations.
10768 * data/bison.simple (yydestructor): Pass it the current location
10769 if locations are enabled.
10770 Prototype only when __STDC__ or C++.
10771 Change the argument names to move into the yy name space: there is
10772 user code here.
10773
58612f1d
AD
107742002-06-19 Akim Demaille <akim@epita.fr>
10775
74310291
AD
10776 * data/bison.simple (b4_pure_if): New.
10777 Use it instead of #ifdef YYPURE.
10778
107792002-06-19 Akim Demaille <akim@epita.fr>
10780
10781 * data/bison.simple (b4_location_if): New.
58612f1d
AD
10782 Use it instead of #ifdef YYLSP_NEEDED.
10783
f25bfb75
AD
107842002-06-19 Akim Demaille <akim@epita.fr>
10785
10786 Prepare @$ in %destructor, but currently don't bind it in the
10787 skeleton, as %location use is not cleaned up yet.
10788
10789 * src/scan-gram.l (handle_dollar, handle_destructor_at)
10790 (handle_action_at): New.
10791 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
10792 a braced_code_t and a location as additional arguments.
10793 (handle_destructor_dollar): Instead of requiring `b4_eval', just
10794 unquote one when outputting `b4_dollar_dollar'.
10795 Adjust callers.
10796 * data/bison.simple (b4_eval): Remove.
10797 (b4_symbol_destructor): Adjust.
10798 * tests/input.at (Invalid @n): Adjust.
10799
c732d2c6
AD
108002002-06-19 Zack Weinberg <zack@codesourcery.com>
10801
10802 * doc/bison.texinfo: Document ability to have multiple
10803 prologue sections.
10804
8c165d89
AD
108052002-06-18 Akim Demaille <akim@epita.fr>
10806
10807 * src/files.c (compute_base_names): When computing the output file
10808 names from the input file name, strip the directory part.
10809
ca98bf57
AD
108102002-06-18 Akim Demaille <akim@epita.fr>
10811
10812 * data/bison.simple.new: Comment changes.
10813 Reported by Andreas Schwab.
10814
0bfb02ff
AD
108152002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
10816
10817 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
10818 there are no `label `yyoverflowlab' defined but not used' warnings
10819 when yyoverflow is defined.
10820
24c0aad7
AD
108212002-06-18 Akim Demaille <akim@epita.fr>
10822
10823 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
10824 new member.
10825 (symbol_destructor_set): Adjust.
10826 * src/output.c (symbol_destructors_output): Output the destructor
10827 locations.
10828 Output the symbol name.
10829 * data/bison.simple (b4_symbol_destructor): Adjust.
10830
5719c109
AD
108312002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
10832 and Akim Demaille <akim@epita.fr>
10833
10834 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
10835 what's left on the stack when the error recovery hits EOF.
10836 * tests/actions.at (Destructors): Complete to exercise this case.
10837
9280d3ef
AD
108382002-06-17 Akim Demaille <akim@epita.fr>
10839
10840 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
10841 arguments is really empty, not only equal to `[]'.
10842 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
10843 member.
10844 (symbol_destructor_set): New.
10845 * src/output.c (symbol_destructors_output): New.
10846 * src/reader.h (brace_code_t, current_braced_code): New.
10847 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
10848 (handle_dollar): Rename as...
10849 (handle_action_dollar): this.
10850 (handle_destructor_dollar): New.
10851 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
10852 (grammar_declaration): Use it.
10853 * data/bison.simple (yystos): Is always defined.
10854 (yydestructor): New.
10855 * tests/actions.at (Destructors): New.
10856 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
10857
dafdc66f
AD
108582002-06-17 Akim Demaille <akim@epita.fr>
10859
10860 * src/symlist.h, src/symlist.c (symbol_list_length): New.
10861 * src/scan-gram.l (handle_dollar, handle_at): Compute the
10862 rule_length only when needed.
10863 * src/output.c (actions_output, token_definitions_output): Output
10864 the full M4 block.
10865 * src/symtab.c: Don't access directly to the symbol tag, use
10866 symbol_tag_get.
10867 * src/parse-gram.y: Use symbol_list_free.
10868
56c47203
AD
108692002-06-17 Akim Demaille <akim@epita.fr>
10870
10871 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
10872 (symbol_list_prepend, get_type_name): Move to...
10873 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
10874 (symbol_list_prepend, symbol_list_n_type_name_get): here.
10875 Adjust all callers.
10876 (symbol_list_free): New.
10877 * src/scan-gram.l (handle_dollar): Takes a location.
10878 * tests/input.at (Invalid $n): Adjust.
10879
1e0bab92
AD
108802002-06-17 Akim Demaille <akim@epita.fr>
10881
10882 * src/reader.h, src/reader.c (symbol_list_new): Export it.
10883 (symbol_list_prepend): New.
10884 * src/parse-gram.y (%union): `list' is a new member.
10885 (symbols.1): New, replaces...
10886 (terms_to_prec.1, nterms_to_type.1): these.
10887 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
10888 Take a location as additional argument.
10889 Adjust all callers.
10890
04e60654
AD
108912002-06-15 Akim Demaille <akim@epita.fr>
10892
10893 * src/parse-gram.y: Move %token in the declaration section so that
10894 we don't depend upon CVS Bison.
10895
10e5b8bd
AD
108962002-06-15 Akim Demaille <akim@epita.fr>
10897
10898 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
10899 * src/print.c (print_core): Use it.
10900
9801d40c
AD
109012002-06-15 Akim Demaille <akim@epita.fr>
10902
10903 * src/conflicts.c (log_resolution): Accept the rule involved in
10904 the sr conflicts instead of the lookahead number that points to
10905 that rule.
10906 (flush_reduce): Accept the current lookahead vector as argument,
10907 instead of the index in LA.
10908 (resolve_sr_conflict): Accept the current number of lookahead
10909 bitset to consider for the STATE, instead of the index in LA.
10910 (set_conflicts): Adjust.
10911 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
10912
c0263492
AD
109132002-06-15 Akim Demaille <akim@epita.fr>
10914
10915 * src/state.h (state_t): Replace the `lookaheadsp' member, a
10916 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
10917 Adjust all dependencies.
10918 * src/lalr.c (initialize_lookaheads): Split into...
10919 (states_lookaheads_count, states_lookaheads_initialize): these.
10920 (lalr): Adjust.
10921
9757c359
AD
109222002-06-15 Akim Demaille <akim@epita.fr>
10923
10924 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
10925 out of...
10926 (grammar_rules_print): here.
10927 * src/reduce.c (reduce_output): Use it.
10928 * tests/reduce.at (Useless Rules, Reduced Automaton)
10929 (Underivable Rules): Adjust.
10930
6b98e4b5
AD
109312002-06-15 Akim Demaille <akim@epita.fr>
10932
10933 Copy BYacc's nice way to report the grammar.
10934
10935 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
10936 New.
10937 Don't print the rules' location, it is confusing and useless.
10938 (rule_print): Use grammar_rhs_print.
10939 * src/print.c (print_grammar): Use grammar_rules_print.
10940
6b98e4b5
AD
109412002-06-15 Akim Demaille <akim@epita.fr>
10942
10943 Complete and rationalize `useless thing' warnings.
10944
10945 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
10946 (symbol_tag_print): New.
10947 Use them everywhere in place of accessing directly the tag member.
10948 * src/gram.h, src/gram.c (rule_print): New.
10949 Use it where a rule used to be printed `by hand'.
10950 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
10951 (reduce_grammar_tables): Report the useless rules.
10952 (reduce_print): Useless things are a warning, not an error.
10953 Report it as such.
10954 * tests/reduce.at (Useless Nonterminals, Useless Rules):
10955 (Reduced Automaton, Underivable Rules): Adjust.
10956 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
10957 * tests/conflicts.at (Unresolved SR Conflicts)
10958 (Solved SR Conflicts): Adjust.
10959
ee000ba4
AD
109602002-06-15 Akim Demaille <akim@epita.fr>
10961
10962 Let symbols have a location.
10963
10964 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
10965 (getsym): Adjust.
10966 Adjust all callers.
10967 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
10968 Use location_t, not int.
10969 * src/symtab.c (symbol_check_defined): Take advantage of the
10970 location.
10971 * tests/regression.at (Invalid inputs): Adjust.
10972
8efe435c
AD
109732002-06-15 Akim Demaille <akim@epita.fr>
10974
10975 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
10976 (input): Don't try to initialize yylloc here, do it in the
10977 scanner.
10978 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
10979 * src/gram.h (rule_t): Change line and action_line into location
10980 and action_location, of location_t type.
10981 Adjust all dependencies.
10982 * src/location.h, src/location.c (empty_location): New.
10983 * src/reader.h, src/reader.c (grammar_start_symbol_set)
10984 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
10985 (grammar_current_rule_symbol_append)
10986 (grammar_current_rule_action_append): Expect a location as argument.
10987 * src/reader.c (grammar_midrule_action): Adjust to attach an
10988 action's location as dummy symbol location.
10989 * src/symtab.h, src/symtab.c (startsymbol_location): New.
10990 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
10991 the line numbers.
10992
1921f1d7
AD
109932002-06-14 Akim Demaille <akim@epita.fr>
10994
10995 Grammar declarations may be found in the grammar section.
10996
10997 * src/parse-gram.y (rules_or_grammar_declaration): New.
10998 (declarations): Each declaration may end with a semicolon, not
10999 just...
11000 (grammar_declaration): `"%union"'.
11001 (grammar): Branch to rules_or_grammar_declaration.
11002
4515534c
AD
110032002-06-14 Akim Demaille <akim@epita.fr>
11004
11005 * src/main.c (main): Invoke scanner_free.
11006
f958596b
AD
110072002-06-14 Akim Demaille <akim@epita.fr>
11008
11009 * src/output.c (m4_invoke): Extracted from...
11010 (output_skeleton): here.
11011 Free tempfile.
11012
2c569025
AD
110132002-06-14 Akim Demaille <akim@epita.fr>
11014
11015 * src/parse-gram.y (directives, directive, gram)
11016 (grammar_directives, precedence_directives, precedence_directive):
11017 Rename as...
11018 (declarations, declaration, grammar, grammar_declaration)
11019 (precedence_declaration, precedence_declarator): these.
11020 (symbol_declaration): New.
11021
592e8d4d
AD
110222002-06-14 Akim Demaille <akim@epita.fr>
11023
11024 * src/files.c (action_obstack): Remove, unused.
11025 (output_obstack): Remove it, and all its dependencies, as it is no
11026 longer needed.
11027 * src/reader.c (epilogue_set): Build the epilogue in the
11028 muscle_obstack.
11029 * src/output.h, src/output.c (muscle_obstack): Move to...
11030 * src/muscle_tab.h, src/muscle_tab.h: here.
11031 (muscle_init): Initialize muscle_obstack.
11032 (muscle_free): New.
11033 * src/main.c (main): Call it.
11034
0c15323d
AD
110352002-06-14 Akim Demaille <akim@epita.fr>
11036
11037 * src/location.h: New, extracted from...
11038 * src/reader.h: here.
11039 * src/Makefile.am (noinst_HEADERS): Merge into
11040 (bison_SOURCES): this.
11041 Add location.h.
11042 * src/parse-gram.y: Use location_t instead of Bison's.
11043 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
11044 Use location_t instead of ints.
11045
e96c9728
AD
110462002-06-14 Akim Demaille <akim@epita.fr>
11047
11048 * data/bison.simple, data/bison.c++: Be sure to restore the
11049 current #line when returning to the skeleton contents after having
11050 exposed the input file's #line.
11051
75d1fe16
AD
110522002-06-12 Akim Demaille <akim@epita.fr>
11053
11054 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
11055 eager.
11056 * tests/actions.at (Exotic Dollars): New.
11057
6c35d22c
AD
110582002-06-12 Akim Demaille <akim@epita.fr>
11059
11060 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
11061 ['"/] too eagerly.
11062 * tests/input.at (Torturing the Scanner): New.
11063
1d6412ad
AD
110642002-06-11 Akim Demaille <akim@epita.fr>
11065
11066 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
11067 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
11068 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
11069 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
11070 * src/reader.c (reader): Use it.
11071
4cdb01db
AD
110722002-06-11 Akim Demaille <akim@epita.fr>
11073
11074 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
11075 Adjust all callers.
11076 (scanner_last_string_free): New.
11077
44995b2e
AD
110782002-06-11 Akim Demaille <akim@epita.fr>
11079
11080 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
11081 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
11082 (last_string, YY_OBS_FREE): New.
11083 Use them when returning an ID.
11084
e9955c83
AD
110852002-06-11 Akim Demaille <akim@epita.fr>
11086
11087 Have Bison grammars parsed by a Bison grammar.
11088
11089 * src/reader.c, src/reader.h (prologue_augment): New.
11090 * src/reader.c (copy_definition): Remove.
11091
11092 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
11093 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
11094 (grammar_current_rule_prec_set, grammar_current_rule_check)
11095 (grammar_current_rule_symbol_append)
11096 (grammar_current_rule_action_append): Export.
11097 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
11098 (symbol_list_action_append): Remove.
11099 Hook the routines from reader.
11100 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
11101 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
11102
11103 * src/reader.c (read_declarations): Remove, unused.
11104
11105 * src/parse-gram.y: Handle the epilogue.
11106 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
11107 (grammar_start_symbol_set): this.
11108 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
11109 * src/reader.c (readgram): Remove, unused.
11110 (reader): Adjust to insert eoftoken and axiom where appropriate.
11111
11112 * src/reader.c (copy_dollar): Replace with...
11113 * src/scan-gram.h (handle_dollar): this.
11114 * src/parse-gram.y: Remove `%thong'.
11115
11116 * src/reader.c (copy_at): Replace with...
11117 * src/scan-gram.h (handle_at): this.
11118
11119 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
11120 New.
11121
11122 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
11123 time being.
11124
11125 * src/reader.h, src/reader.c (grammar_rule_end): New.
11126
11127 * src/parse.y (current_type, current_class): New.
11128 Implement `%nterm', `%token' support.
11129 Merge `%term' into `%token'.
11130 (string_as_id): New.
11131 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
11132 type name.
11133
11134 * src/parse-gram.y: Be sure to handle properly the beginning of
11135 rules.
11136
11137 * src/parse-gram.y: Handle %type.
11138 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
11139
11140 * src/parse-gram.y: More directives support.
11141 * src/options.c: No longer handle source directives.
11142
11143 * src/parse-gram.y: Fix %output.
11144
11145 * src/parse-gram.y: Handle %union.
11146 Use the prologue locations.
11147 * src/reader.c (parse_union_decl): Remove.
11148
11149 * src/reader.h, src/reader.c (epilogue_set): New.
11150 * src/parse-gram.y: Use it.
11151
11152 * data/bison.simple, data/bison.c++: b4_stype is now either not
11153 defined, then default to int, or to the contents of %union,
11154 without `union' itself.
11155 Adjust.
11156 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
11157
11158 * src/output.c (actions_output): Don't output braces, as they are
11159 already handled by the scanner.
11160
11161 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
11162 characters to themselves.
11163
11164 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
11165 that the epilogue has a proper #line.
11166
11167 * src/parse-gram.y: Handle precedence/associativity.
11168
11169 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
11170 a terminal.
11171 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
11172 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
11173 at all to define terminals that cannot be emitted.
11174
11175 * src/scan-gram.l: Escape M4 characters.
11176
11177 * src/scan-gram.l: Working properly with escapes in user
11178 strings/characters.
11179
11180 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
11181 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
11182 grammar.
11183 Use more modest sizes, as for the time being the parser does not
11184 release memory, and therefore the process swallows a huge amount
11185 of memory.
11186
11187 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
11188 stricter %token grammar.
11189
11190 * src/symtab.h (associativity): Add `undef_assoc'.
11191 (symbol_precedence_set): Do nothing when passed an undef_assoc.
11192 * src/symtab.c (symbol_check_alias_consistence): Adjust.
11193
11194 * tests/regression.at (Invalid %directive): Remove, as it is now
11195 meaningless.
11196 (Invalid inputs): Adjust to the new error messages.
11197 (Token definitions): The new grammar doesn't allow too many
11198 eccentricities.
11199
11200 * src/lex.h, src/lex.c: Remove.
11201 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
11202 (copy_character, copy_string2, copy_string, copy_identifier)
11203 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
11204 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
11205 (parse_action): Remove.
11206 * po/POTFILES.in: Adjust.
11207
2e047461
AD
112082002-06-11 Akim Demaille <akim@epita.fr>
11209
cd05d13c 11210 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
11211 rule's action member: return the action as a string.
11212 Don't require `rule_length' as an argument: compute it.
11213 (grammar_current_rule_symbol_append)
11214 (grammar_current_rule_action_append): New, eved out from
11215 (readgram): here.
11216 Remove `action_flag', `rulelength', unused now.
11217
9af3fbce
AD
112182002-06-11 Akim Demaille <akim@epita.fr>
11219
11220 * src/reader.c (grammar_current_rule_prec_set).
11221 (grammar_current_rule_check): New, eved out from...
11222 (readgram): here.
11223 Remove `xaction', `first_rhs': useless.
11224 * tests/input.at (Type clashes): New.
11225 * tests/existing.at (GNU Cim Grammar): Adjust.
11226
1485e106
AD
112272002-06-11 Akim Demaille <akim@epita.fr>
11228
11229 * src/reader.c (grammar_midrule_action): New, Eved out from
11230 (readgram): here.
11231
da4160c3
AD
112322002-06-11 Akim Demaille <akim@epita.fr>
11233
11234 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
11235 New.
11236 (readgram): Use them as replacement of inlined code, crule and
11237 crule1.
11238
f6d0f937
AD
112392002-06-11 Akim Demaille <akim@epita.fr>
11240
11241 * src/reader.c (grammar_end, grammar_symbol_append): New.
11242 (readgram): Use them.
11243 Make the use of `p' as local as possible.
11244
69078d4b
AD
112452002-06-10 Akim Demaille <akim@epita.fr>
11246
11247 GCJ's parser requires the tokens to be defined before the prologue.
11248
11249 * data/bison.simple: Output the token definition before the user's
11250 prologue.
11251 * tests/regression.at (Braces parsing, Duplicate string)
11252 (Mixing %token styles): Check the output from bison.
11253 (Early token definitions): New.
11254
5e424082
AD
112552002-06-10 Akim Demaille <akim@epita.fr>
11256
11257 * src/symtab.c (symbol_user_token_number_set): Don't complain when
11258 assigning twice the same user number to a token, so that we can
11259 use it in...
11260 * src/lex.c (lex): here.
11261 Also use `symbol_class_set' instead of hand written code.
11262 * src/reader.c (parse_assoc_decl): Likewise.
11263
44536b35
AD
112642002-06-10 Akim Demaille <akim@epita.fr>
11265
11266 * src/symtab.c, src/symtab.c (symbol_class_set)
11267 (symbol_user_token_number_set): New.
11268 * src/reader.c (parse_token_decl): Use them.
11269 Use a switch instead of ifs.
11270 Use a single argument.
11271
8b9f2372
AD
112722002-06-10 Akim Demaille <akim@epita.fr>
11273
11274 Remove `%thong' support as it is undocumented, unused, duplicates
11275 `%token's job, and creates useless e-mail traffic with people who
11276 want to know what it is, why it is undocumented, unused, and
11277 duplicates `%token's job.
11278
11279 * src/reader.c (parse_thong_decl): Remove.
11280 * src/options.c (option_table): Remove "thong".
11281 * src/lex.h (tok_thong): Remove.
11282
3ae2b51f
AD
112832002-06-10 Akim Demaille <akim@epita.fr>
11284
11285 * src/symtab.c, src/symtab.c (symbol_type_set)
11286 (symbol_precedence_set): New.
11287 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
11288 (value_components_used): Remove, unused.
11289
2f1afb73
AD
112902002-06-09 Akim Demaille <akim@epita.fr>
11291
11292 Move symbols handling code out of the reader.
11293
11294 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
11295 (axiom): Move to...
11296 * src/symtab.h, src/symtab.c: here.
11297
11298 * src/gram.c (start_symbol): Remove: use startsymbol->number.
11299 * src/reader.c (startval): Rename as...
11300 * src/symtab.h, src/symtab.c (startsymbol): this.
11301 * src/reader.c: Adjust.
11302
11303 * src/reader.c (symbol_check_defined, symbol_make_alias)
11304 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11305 (token_translations_init)
11306 Move to...
11307 * src/symtab.c: here.
11308 * src/reader.c (packsymbols): Move to...
11309 * src/symtab.h, src/symtab.c (symbols_pack): here.
11310 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
11311 argument.
11312
e9bca3ad
AD
113132002-06-03 Akim Demaille <akim@epita.fr>
11314
11315 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
11316 then statements.
11317
86eff183
AD
113182002-06-03 Akim Demaille <akim@epita.fr>
11319
11320 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
11321 structs with non literals.
11322 * src/scan-skel.l: never-interactive.
11323 * src/conflicts.c (enum conflict_resolution_e): No trailing
11324 comma.
11325 * src/getargs.c (usage): Split long literal strings.
11326 Reported by Hans Aberg.
11327
717be197
AD
113282002-05-28 Akim Demaille <akim@epita.fr>
11329
11330 * data/bison.c++: Use C++ ostreams.
11331 (cdebug_): New member.
11332
670ddffd
AD
113332002-05-28 Akim Demaille <akim@epita.fr>
11334
11335 * src/output.c (output_skeleton): Be sure to allocate enough room
11336 for `/' _and_ for `\0' in full_skeleton.
11337
769b430f
AD
113382002-05-28 Akim Demaille <akim@epita.fr>
11339
11340 * data/bison.c++: Catch up with bison.simple:
11341 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11342 and Paul Eggert <eggert@twinsun.com>: `error' handing.
11343 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
11344 and popping traces.
11345
7067cb36
PH
113462002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11347
11348 * src/output.c (output_skeleton): Put an explicit path in front of
11349 the skeleton file name, rather than relying on the -I directory,
11350 to partially alleviate effects of having a skeleton file lying around
11351 in the current directory.
769b430f 11352
4a713ec2
PH
113532002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11354
769b430f 11355 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
11356 obstack_printf should be obstack_fgrow1.
11357
b408954b
AD
113582002-05-26 Akim Demaille <akim@epita.fr>
11359
11360 * src/state.h (state_t): `solved_conflicts' is a new member.
11361 * src/LR0.c (new_state): Set it to 0.
11362 * src/conflicts.h, src/conflicts.c (print_conflicts)
11363 (free_conflicts, solve_conflicts): Rename as...
11364 (conflicts_print, conflicts_free, conflicts_solve): these.
11365 Adjust callers.
11366 * src/conflicts.c (enum conflict_resolution_e)
11367 (solved_conflicts_obstack): New, used by...
11368 (log_resolution): this.
11369 Adjust to attach the conflict resolution to each state.
11370 Complete the description with the precedence/associativity
11371 information.
11372 (resolve_sr_conflict): Adjust.
11373 * src/print.c (print_state): Output its solved_conflicts.
11374 * tests/conflicts.at (Unresolved SR Conflicts)
11375 (Solved SR Conflicts): Exercise --report=all.
11376
a49aecd5
AD
113772002-05-26 Akim Demaille <akim@epita.fr>
11378
11379 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
11380 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
11381 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
11382 (token_number_t, item_number_as_token_number)
11383 (token_number_as_item_number, muscle_insert_token_number_table):
11384 Rename as...
11385 (symbol_number_t, item_number_as_symbol_number)
11386 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
11387 these, since it is more appropriate.
11388
5504898e
AD
113892002-05-26 Akim Demaille <akim@epita.fr>
11390
11391 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
11392 `Error:' lines.
11393 * data/bison.simple (yystos) [YYDEBUG]: New.
11394 (yyparse) [YYDEBUG]: Display the symbols which are popped during
11395 error recovery.
11396 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
11397
ec3bc396
AD
113982002-05-25 Akim Demaille <akim@epita.fr>
11399
11400 * doc/bison.texinfo (Debugging): Split into...
11401 (Tracing): this new section, its former contents, and...
11402 (Understanding): this new section.
11403 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
11404 by...
11405 (report_flag): this.
11406 Adjust all dependencies.
11407 (report_args, report_types, report_argmatch): New.
11408 (usage, getargs): Report/support -r, --report.
11409 * src/options.h
11410 (struct option_table_struct): Rename as..,
11411 (struct option_table_s): this.
11412 Rename the `set_flag' member to `flag' to match with getopt_long's
11413 struct.
11414 * src/options.c (option_table): Split verbose into an entry for
11415 %verbose, and another for --verbose.
11416 Support --report/-r, so remove -r from the obsolete --raw.
11417 * src/print.c: Attach full item sets and lookaheads reports to
11418 report_flag instead of trace_flag.
11419 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
11420
78df8250
PE
114212002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11422 and Paul Eggert <eggert@twinsun.com>
769b430f 11423
78df8250
PE
11424 * data/bison.simple (yyparse): Correct error handling to conform to
11425 POSIX and yacc. Specifically, after syntax error is discovered,
11426 do not reduce further before shifting the error token.
11427 Clean up the code a bit by removing the labels yyerrdefault,
11428 yyerrhandle, yyerrpop.
11429 * NEWS: Document the above.
11430
c0c9ea05
PH
114312002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11432
11433 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
11434 type; it isn't always big enough, since it doesn't necessarily
11435 include non-terminals.
769b430f 11436 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
11437 the latter can be removed.
11438 (yy_token_number_type): Remove, only one use.
11439 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
11440 don't use TokenNumberType as element type.
769b430f 11441
c0c9ea05
PH
11442 * tests/regression.at: Modify expected output to agree with change
11443 to yyr1 and yytranslate.
769b430f 11444
6390a83f
FK
114452002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
11446
11447 * src/reader.c (parse_action): Use copy_character instead of
11448 obstack_1grow.
11449
db7c8e9a
AD
114502002-05-13 Akim Demaille <akim@epita.fr>
11451
11452 * tests/regression.at (Token definitions): Prototype yylex and
11453 yyerror.
11454
fcc61800
PH
114552002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11456
158c687b 11457 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
11458 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
11459 32-bit arithmetic.
11460 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
11461
5683e9b2
AD
114622002-05-07 Akim Demaille <akim@epita.fr>
11463
11464 * tests/synclines.at: Be sure to prototype yylex and yyerror to
11465 avoid GCC warnings.
11466
0c2d3f4c
AD
114672002-05-07 Akim Demaille <akim@epita.fr>
11468
11469 Kill GCC warnings.
11470
11471 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
11472 over the RHS of each rule.
11473 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
11474 * src/state.h (state_t): Member `nitems' is unsigned short.
11475 * src/LR0.c (get_state): Adjust.
11476 * src/reader.c (packgram): Likewise.
11477 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
11478 `Type'.
11479 (muscle_insert_int_table): Remove, unused.
11480 (prepare_rules): Remove `max'.
11481
1565b720
AD
114822002-05-06 Akim Demaille <akim@epita.fr>
11483
11484 * src/closure.c (print_firsts): Display of the symbol tags.
11485 (bitmatrix_print): Move to...
11486 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
11487 here.
11488 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
11489
cfaee611
AD
114902002-05-06 Akim Demaille <akim@epita.fr>
11491
11492 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
11493 hash_do_for_each.
11494
458be8e0
AD
114952002-05-06 Akim Demaille <akim@epita.fr>
11496
11497 * src/LR0.c (new_state, get_state): Instead of using the global
11498 `kernel_size' and `kernel_base', have two new arguments:
11499 `core_size' and `core'.
11500 Adjust callers.
11501
a900a624
AD
115022002-05-06 Akim Demaille <akim@epita.fr>
11503
11504 * src/reader.c (packgram): No longer end `ritem' with a 0
11505 sentinel: it is not used.
11506
d4e7d3a1
AD
115072002-05-05 Akim Demaille <akim@epita.fr>
11508
11509 New experimental feature: display the lookaheads in the report and
11510 graph.
11511
11512 * src/print (print_core): When --trace-flag, display the rules
11513 lookaheads.
11514 * src/print_graph.c (print_core): Likewise.
11515 Swap the arguments.
11516 Adjust caller.
11517
39ceb25b
AD
115182002-05-05 Akim Demaille <akim@epita.fr>
11519
11520 * tests/torture.at (Many lookaheads): New test.
11521
5372019f
AD
115222002-05-05 Akim Demaille <akim@epita.fr>
11523
11524 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
11525 (GENERATE_MUSCLE_INSERT_TABLE): this.
11526 (output_int_table, output_unsigned_int_table, output_short_table)
11527 (output_token_number_table, output_item_number_table): Replace with...
11528 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
11529 (muscle_insert_short_table, muscle_insert_token_number_table)
11530 (muscle_insert_item_number_table): these.
11531 Adjust all callers.
11532 (prepare_tokens): Don't free `translations', since...
11533 * src/reader.h, src/reader.c (grammar_free): do it.
11534 Move to...
11535 * src/gram.h, src/gram.c (grammar_free): here.
11536 * data/bison.simple, data/bison.c++: b4_token_number_max is now
11537 b4_translate_max.
11538
5df5f6d5
AD
115392002-05-05 Akim Demaille <akim@epita.fr>
11540
11541 * src/output.c (output_unsigned_int_table): New.
11542 (prepare_rules): `i' is unsigned.
11543 `prhs', `rline', `r2' are unsigned int.
11544 Rename muscle `rhs_number_max' as `rhs_max'.
11545 Output muscles `prhs_max', `rline_max', and `r2_max'.
11546 Free rline and r1.
11547 * data/bison.simple, data/bison.c++: Adjust to use these muscles
11548 to compute types instead of constant types.
11549 * tests/regression.at (Web2c Actions): Adjust.
11550
b87f8b21
AD
115512002-05-04 Akim Demaille <akim@epita.fr>
11552
11553 * src/symtab.h (SALIAS, SUNDEF): Rename as...
11554 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
11555 Adjust dependencies.
11556 * src/output.c (token_definitions_output): Be sure not to output a
11557 `#define 'a'' when fed with `%token 'a' "a"'.
11558 * tests/regression.at (Token definitions): New.
11559
8bb936e4
PE
115602002-05-03 Paul Eggert <eggert@twinsun.com>
11561
11562 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
11563 for K&R C.
11564
115652002-05-03 gettextize <bug-gnu-gettext@gnu.org>
11566
11567 * Makefile.am (SUBDIRS): Remove intl.
11568 (EXTRA_DIST): Add config/config.rpath.
11569
53c71a12
AD
115702002-05-03 Akim Demaille <akim@epita.fr>
11571
11572 * data/bison.simple (m4_if): Don't output empty enums.
11573 And actually, output valid enum definitions :(.
11574
289dd0cf
AD
115752002-05-03 Akim Demaille <akim@epita.fr>
11576
11577 * configure.bat: Remove, completely obsolete.
11578 * Makefile.am (EXTRA_DIST): Adjust.
11579 Don't distribute config.rpath...
11580 * config/Makefile.am (EXTRA_DIST): Do it.
11581
db85e524
AD
115822002-05-03 Akim Demaille <akim@epita.fr>
11583
11584 * configure.in (GETTEXT_VERSION): New.
11585 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
11586
83ccf991
AD
115872002-05-03 Akim Demaille <akim@epita.fr>
11588
11589 * data/bison.simple (b4_token_enum): New.
11590 (b4_token_defines): Use it to output tokens both as #define and
11591 enums.
11592 Suggested by Paul Eggert.
11593 * src/output.c (token_definitions_output): Don't output spurious
11594 white spaces.
11595
1f418995
AD
115962002-05-03 Akim Demaille <akim@epita.fr>
11597
11598 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
11599
45119f04
RA
116002002-05-02 Robert Anisko <robert@lrde.epita.fr>
11601
11602 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
11603 Update the stack class, give a try to deque as the default container.
11604
b2d52318
AD
116052002-05-02 Akim Demaille <akim@epita.fr>
11606
11607 * data/bison.simple (yyparse): Do not implement @$ = @1.
11608 (YYLLOC_DEFAULT): Adjust to do it.
11609 * doc/bison.texinfo (Location Default Action): Fix.
11610
3a8b4109
AD
116112002-05-02 Akim Demaille <akim@epita.fr>
11612
11613 * src/reader.c (parse_braces): Merge into...
11614 (parse_action): this.
11615
84614e13
AD
116162002-05-02 Akim Demaille <akim@epita.fr>
11617
11618 * configure.in (ALL_LINGUAS): Remove.
11619 * po/LINGUAS, hr.po: New.
11620
fdbcd8e2
AD
116212002-05-02 Akim Demaille <akim@epita.fr>
11622
11623 Remove the so called hairy (semantic) parsers.
11624
11625 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
11626 * src/gram.h, src/gram.c (semantic_parser): Remove.
11627 (rule_t): Remove the guard and guard_line members.
11628 * src/lex.h (token_t): remove tok_guard.
11629 * src/options.c (option_table): Remove %guard and %semantic_parser
11630 support.
11631 * src/output.c, src/output.h (guards_output): Remove.
11632 (prepare): Adjust.
11633 (token_definitions_output): Don't output the `T'
11634 tokens (???).
11635 (output_skeleton): Don't output the guards.
11636 * src/files.c, src/files.c (attrsfile): Remove.
11637 * src/reader.c (symbol_list): Remove the guard and guard_line
11638 members.
11639 Adjust dependencies.
11640 (parse_guard): Remove.
11641 * data/bison.hairy: Remove.
11642 * doc/bison.texinfo (Environment Variables): Remove occurrences of
11643 BISON_HAIRY.
11644
82b6cb3f
AD
116452002-05-02 Akim Demaille <akim@epita.fr>
11646
11647 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
11648 (parse_guard): Rename the formal argument `stack_offset' as
11649 `rule_length', which is more readable.
11650 Adjust callers.
11651 (copy_at, copy_dollar): Instead of outputting the hard coded
11652 values of $$, $n and so forth, output invocation to b4_lhs_value,
11653 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
11654 Note: this patch partially drops `semantic-parser' support: it
11655 always does `rule_length - n', where semantic parsers ought to
11656 always use `-n'.
82b6cb3f
AD
11657 * data/bison.simple, data/bison.c++ (b4_lhs_value)
11658 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
11659
6cbfbcc5
AD
116602002-05-02 Akim Demaille <akim@epita.fr>
11661
11662 * configure.in (AC_INIT): Bump to 1.49b.
11663 (AM_INIT_AUTOMAKE): Short invocation.
11664
b8548114
AD
116652002-05-02 Akim Demaille <akim@epita.fr>
11666
11667 Version 1.49a.
11668
c20cd1fa
AD
116692002-05-01 Akim Demaille <akim@epita.fr>
11670
11671 * src/skeleton.h: Remove.
11672
8a9566d4
AD
116732002-05-01 Akim Demaille <akim@epita.fr>
11674
11675 * src/skeleton.h: Fix the #endif.
11676 Reported by Magnus Fromreide.
11677
8c6d399a
PE
116782002-04-26 Paul Eggert <eggert@twinsun.com>
11679
11680 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
11681 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 11682 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 11683
2b7ed18a
RA
116842002-04-25 Robert Anisko <robert@lrde.epita.fr>
11685
11686 * src/scan-skel.l: Postprocess quadrigraphs.
11687
11688 * src/reader.c (copy_character): New function, used to output
11689 single characters while replacing `[' and `]' with quadrigraphs, to
11690 avoid troubles with M4 quotes.
11691 (copy_comment): Output characters with copy_character.
11692 (read_additionnal_code): Likewise.
11693 (copy_string2): Likewise.
11694 (copy_definition): Likewise.
11695
11696 * tests/calc.at: Exercise M4 quoting.
11697
34a89c50
AD
116982002-04-25 Akim Demaille <akim@epita.fr>
11699
11700 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
11701 between `!' and the command.
11702 Reported by Paul Eggert.
11703
0dd1580a
RA
117042002-04-24 Robert Anisko <robert@lrde.epita.fr>
11705
11706 * tests/calc.at: Exercise prologue splitting.
11707
11708 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
11709 `b4_post_prologue' instead of `b4_prologue'.
11710
11711 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
11712 muscles.
11713 (output): Free pre_prologue_obstack and post_prologue_obstack.
11714 * src/files.h, src/files.c (attrs_obstack): Remove.
11715 (pre_prologue_obstack, post_prologue_obstack): New.
11716 * src/reader.c (copy_definition): Add a parameter to specify the
11717 obstack to fill, instead of using attrs_obstack unconditionally.
11718 (read_declarations): Pass pre_prologue_obstack to copy_definition if
11719 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
11720
83c1796f
PE
117212002-04-23 Paul Eggert <eggert@twinsun.com>
11722
11723 * data/bison.simple: Remove unnecessary commentary and white
11724 space differences from 1_29-branch.
11725 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
11726
11727 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
11728 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
11729 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
11730 constructors or destructors.
11731
11732 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
11733
1207eeac
AD
117342002-04-23 Akim Demaille <akim@epita.fr>
11735
11736 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
11737 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
11738 location with columns.
11739 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
11740 All reported by Paul Eggert.
11741
78ab8f67
AD
117422002-04-22 Akim Demaille <akim@epita.fr>
11743
11744 * src/reduce.c (dump_grammar): Move to...
11745 * src/gram.h, src/gram.c (grammar_dump): here.
11746 Be sure to separate long item numbers.
11747 Don't read the members of a rule's prec if its nil.
11748
133c20e2
AD
117492002-04-22 Akim Demaille <akim@epita.fr>
11750
11751 * src/output.c (table_size, table_grow): New.
11752 (MAXTABLE): Remove, replace uses with table_size.
11753 (pack_vector): Instead of dying when the table is too big, grow it.
11754
9515e8a7
AD
117552002-04-22 Akim Demaille <akim@epita.fr>
11756
11757 * data/bison.simple (yyr1): Its type is that of a token number.
11758 * data/bison.c++ (r1_): Likewise.
11759 * tests/regression.at (Web2c Actions): Adjust.
11760
23c5a174
AD
117612002-04-22 Akim Demaille <akim@epita.fr>
11762
11763 * src/reader.c (token_translations_init): 256 is now the default
11764 value for the error token, i.e., it will be assigned another
11765 number if the user assigned 256 to one of her tokens.
11766 (reader): Don't force 256 to error.
11767 * doc/bison.texinfo (Symbols): Adjust.
11768 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
11769 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
11770 etc. instead of 10, 20, 30 (which was used to `jump' over error
11771 (256) and undefined (2)).
11772
5fbb0954
AD
117732002-04-22 Akim Demaille <akim@epita.fr>
11774
11775 Propagate more token_number_t.
11776
11777 * src/gram.h (token_number_as_item_number)
11778 (item_number_as_token_number): New.
11779 * src/output.c (GENERATE_OUTPUT_TABLE): New.
11780 Use it to create output_item_number_table and
11781 output_token_number_table.
11782 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
11783 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
11784 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
11785 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
11786
4f940944
AD
117872002-04-22 Akim Demaille <akim@epita.fr>
11788
11789 * src/output.h, src/output.c (get_lines_number): Remove.
11790
3ded9a63
AD
117912002-04-19 Akim Demaille <akim@epita.fr>
11792
11793 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
11794 as Lex/Flex'.
11795 (Debugging): More details about enabling the debugging features.
11796 (Table of Symbols): Describe $$, $n, @$, and @n.
11797 Suggested by Tim Josling.
11798
e0c471a9
AD
117992002-04-19 Akim Demaille <akim@epita.fr>
11800
11801 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
11802
fecc10cd
AD
118032002-04-10 Akim Demaille <akim@epita.fr>
11804
11805 * src/system.h: Rely on HAVE_LIMITS_H.
11806 Suggested by Paul Eggert.
11807
51dec47b
AD
118082002-04-09 Akim Demaille <akim@epita.fr>
11809
11810 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
11811 full stderr, and strip it according to the bison options, instead
11812 of composing the error message from different bits.
11813 This makes it easier to check for several error messages.
11814 Adjust all the invocations.
11815 Add an invocation exercising the error token.
11816 Add an invocation demonstrating a stupid error message.
11817 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
11818 Adjust the tests.
11819 Error message are for stderr, not stdout.
11820
007a50a4
AD
118212002-04-09 Akim Demaille <akim@epita.fr>
11822
11823 * src/gram.h, src/gram.c (error_token_number): Remove, use
11824 errtoken->number.
11825 * src/reader.c (reader): Don't specify the user token number (2)
11826 for $undefined, as it uselessly prevents using it.
11827 * src/gram.h (token_number_t): Move to...
11828 * src/symtab.h: here.
11829 (state_t.number): Is a token_number_t.
11830 * src/print.c, src/reader.c: Use undeftoken->number instead of
11831 hard coded 2.
11832 (Even though this 2 is not the same as above: the number of the
11833 undeftoken remains being 2, it is its user token number which
11834 might not be 2).
11835 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
11836 `user_token_number_max'.
11837 Output `undef_token_number'.
11838 * data/bison.simple, data/bison.c++: Use them.
11839 Be sure to map invalid yylex return values to
11840 `undef_token_number'. This saves us from gratuitous SEGV.
11841
11842 * tests/conflicts.at (Solved SR Conflicts)
11843 (Unresolved SR Conflicts): Adjust.
11844 * tests/regression.at (Web2c Actions): Adjust.
11845
06446ccf
AD
118462002-04-08 Akim Demaille <akim@epita.fr>
11847
11848 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
11849 Adding #line.
11850 Remove the duplicate `typedefs'.
11851 (RhsNumberType): Fix the declaration and various other typos.
11852 Use __ofile__.
11853 * data/bison.simple: Use __ofile__.
11854 * src/scan-skel.l: Handle __ofile__.
11855
62a3e4f0
AD
118562002-04-08 Akim Demaille <akim@epita.fr>
11857
11858 * src/gram.h (item_number_t): New, the type of item numbers in
11859 RITEM. Note that it must be able to code symbol numbers as
11860 positive number, and the negation of rule numbers as negative
11861 numbers.
11862 Adjust all dependencies (pretty many).
11863 * src/reduce.c (rule): Remove this `short *' pointer: use
11864 item_number_t.
11865 * src/system.h (MINSHORT, MAXSHORT): Remove.
11866 Include `limits.h'.
11867 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
11868 (shortcpy): Remove.
11869 (MAXTABLE): Move to...
11870 * src/output.c (MAXTABLE): here.
11871 (prepare_rules): Use output_int_table to output rhs.
11872 * data/bison.simple, data/bison.c++: Adjust.
11873 * tests/torture.at (Big triangle): Move the limit from 254 to
11874 500.
11875 * tests/regression.at (Web2c Actions): Ajust.
11876
11877 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
11878 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
11879 passes, but produces negative #line number, once fixed, GCC is
11880 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
11881 C), it passes.
11882 * src/state.h (state_h): Code input lines on ints, not shorts.
11883
bb88b0fc
AD
118842002-04-08 Akim Demaille <akim@epita.fr>
11885
11886 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
11887 and then the grammar.
11888
9a636f47
AD
118892002-04-08 Akim Demaille <akim@epita.fr>
11890
11891 * src/system.h: No longer using strndup.
11892
680e8701
AD
118932002-04-07 Akim Demaille <akim@epita.fr>
11894
11895 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
11896 * src/output.c (output_table_data): Return the longest number.
11897 (prepare_tokens): Output `token_number_max').
11898 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
11899 New.
11900 Use them to define yy_token_number_type/TokenNumberType.
11901 Use this type for yytranslate.
11902 * tests/torture.at (Big triangle): Push the limit from 124 to
11903 253.
11904 * tests/regression.at (Web2c Actions): Adjust.
11905
817e9f41
AD
119062002-04-07 Akim Demaille <akim@epita.fr>
11907
11908 * tests/torture.at (Big triangle): New.
11909 (GNU AWK Grammar, GNU Cim Grammar): Move to...
11910 * tests/existing.at: here.
11911
5123689b
AD
119122002-04-07 Akim Demaille <akim@epita.fr>
11913
11914 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
11915 nritems.
11916 Adjust dependencies.
11917
f3849179
AD
119182002-04-07 Akim Demaille <akim@epita.fr>
11919
11920 * src/reader.c: Normalize increments to prefix form.
11921
bd02036a
AD
119222002-04-07 Akim Demaille <akim@epita.fr>
11923
11924 * src/reader.c, symtab.c: Remove debugging code.
11925
db8837cb
AD
119262002-04-07 Akim Demaille <akim@epita.fr>
11927
11928 Rename all the `bucket's as `symbol_t'.
11929
11930 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
11931 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
11932 * src/symtab.c, src/symtab.h (bucket): Rename as...
11933 (symbol_t): this.
11934 (symbol_list_new, bucket_check_defined, bucket_make_alias)
11935 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
11936 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
11937 (buckets_new, buckets_free, buckets_do): Rename as...
11938 (symbol_list_new, symbol_check_defined, symbol_make_alias)
11939 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11940 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
11941 (symbols_new, symbols_free, symbols_do): these.
11942
72a23c97
AD
119432002-04-07 Akim Demaille <akim@epita.fr>
11944
11945 Use lib/hash for the symbol table.
11946
11947 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
11948 EOF.
11949 * src/lex.c (lex): Set the `number' member of new terminals.
11950 * src/reader.c (bucket_check_defined, bucket_make_alias)
11951 (bucket_check_alias_consistence, bucket_translation): New.
11952 (reader, grammar_free, readgram, token_translations_init)
11953 (packsymbols): Adjust.
11954 (reader): Number the predefined tokens.
11955 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
11956 for predefined tokens.
11957 * src/symtab.h (bucket): Remove all the hash table related
11958 members.
11959 * src/symtab.c (symtab): Replace by...
11960 (bucket_table): this.
11961 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
11962 (buckets_new, buckets_do): New.
11963
280a38c3
AD
119642002-04-07 Akim Demaille <akim@epita.fr>
11965
11966 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
11967 (start_symbol, max_user_token_number, semantic_parser)
11968 (error_token_number): Initialize.
11969 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
11970 Initialize.
11971 (reader): Don't.
11972 (errtoken, eoftoken, undeftoken, axiom): Extern.
11973
03b31c0c
AD
119742002-04-07 Akim Demaille <akim@epita.fr>
11975
11976 * src/gram.h (rule_s): prec and precsym are now pointers
11977 to the bucket giving the priority/associativity.
11978 Member `associativity' removed: useless.
11979 * src/reduce.c, src/conflicts.c: Adjust.
11980
8b3df748
AD
119812002-04-07 Akim Demaille <akim@epita.fr>
11982
11983 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
11984 Properly escape the symbols' TAG when outputting them.
11985
e601aa1d
AD
119862002-04-07 Akim Demaille <akim@epita.fr>
11987
11988 * src/lalr.h (LA): Is a bitsetv, not bitset*.
11989
b0299a2e
AD
119902002-04-07 Akim Demaille <akim@epita.fr>
11991
11992 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
11993 (LArule): this, which is an array to rule_t*.
11994 * src/print.c, src/conflicts.c: Adjust.
11995
d7e1f00c
AD
119962002-04-07 Akim Demaille <akim@epita.fr>
11997
11998 * src/gram.h (rule_t): Rename `number' as `user_number'.
11999 `number' is a new member.
12000 Adjust dependencies.
12001 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
12002
cc9305dd
AD
120032002-04-07 Akim Demaille <akim@epita.fr>
12004
12005 As a result of the previous patch, it is no longer needed
12006 to reorder ritem itself.
12007
12008 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
12009
b0940840
AD
120102002-04-07 Akim Demaille <akim@epita.fr>
12011
12012 Be sure never to walk through RITEMS, but use only data related to
12013 the rules themselves. RITEMS should be banished.
12014
12015 * src/output.c (output_token_translations): Rename as...
12016 (prepare_tokens): this.
12017 In addition to `translate', prepare the muscles `tname' and
12018 `toknum', which were handled by...
12019 (output_rule_data): this.
12020 Remove, and move the remainder of its outputs into...
12021 (prepare_rules): this new routines, which also merges content from
12022 (output_gram): this.
12023 (prepare_rules): Be sure never to walk through RITEMS.
12024 (output_stos): Rename as...
12025 (prepare_stos): this.
12026 (output): Always invoke prepare_states, after all, just don't use it
12027 in the output if you don't need it.
12028
643a5994
AD
120292002-04-07 Akim Demaille <akim@epita.fr>
12030
12031 * src/LR0.c (new_state): Display `nstates' as the name of the
12032 newly created state.
12033 Adjust to initialize first_state and last_state if needed.
12034 Be sure to distinguish the initial from the final state.
12035 (new_states): Create the itemset of the initial state, and use
12036 new_state.
12037 * src/closure.c (closure): Now that the initial state has its
12038 items properly set, there is no need for a special case when
12039 creating `ruleset'.
12040
12041 As a result, now the rule 0, reducing to $axiom, is visible in the
12042 outputs. Adjust the test suite.
12043
12044 * tests/conflicts.at (Solved SR Conflicts)
12045 (Unresolved SR Conflicts): Adjust.
12046 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
12047 * tests/conflicts.at (S/R in initial): New.
12048
b4c4ccc2
AD
120492002-04-07 Akim Demaille <akim@epita.fr>
12050
12051 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
12052 the RHS of the rules.
12053 * src/output.c (output_gram): Likewise.
12054
bba97eb2
AD
120552002-04-07 Akim Demaille <akim@epita.fr>
12056
12057 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
12058 bucket.
12059 Adjust all dependencies.
12060 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
12061 `number' of the buckets too.
12062 * src/gram.h: Include `symtab.h'.
12063 (associativity): Move to...
12064 * src/symtab.h: here.
12065 No longer include `gram.h'.
12066
c3b407f4
AD
120672002-04-07 Akim Demaille <akim@epita.fr>
12068
12069 * src/gram.h, src/gram.c (rules_rhs_length): New.
12070 (ritem_longest_rhs): Use it.
12071 * src/gram.h (rule_t): `number' is a new member.
12072 * src/reader.c (packgram): Set it.
12073 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
12074 the end of `rules', and count them out of `nrules'.
12075 (reduce_output, dump_grammar): Adjust.
12076 * src/print.c (print_grammar): It is no longer needed to check for
12077 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
12078 * tests/reduce.at (Reduced Automaton): New test.
12079
11652ab3
AD
120802002-04-07 Akim Demaille <akim@epita.fr>
12081
12082 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
12083 lacking `+ 1' to nrules, Bison reported as useless a token if it
12084 was used solely to set the precedence of the last rule...
12085
26b23c1a
AD
120862002-04-07 Akim Demaille <akim@epita.fr>
12087
12088 * data/bison.c++, data/bison.simple: Don't output the current file
12089 name in #line, to avoid useless diffs between two identical
12090 outputs under different names.
12091
18bcecb0
AD
120922002-04-07 Akim Demaille <akim@epita.fr>
12093
12094 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
12095 Normalize loops to using `< nrules + 1', not `<= nrules'.
12096
fa770c86
AD
120972002-04-07 Akim Demaille <akim@epita.fr>
12098
12099 * TODO: Update.
12100
d9b739c3
AD
121012002-04-07 Akim Demaille <akim@epita.fr>
12102
12103 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
12104 bucket.value as bucket.number.
12105
99013900
AD
121062002-04-07 Akim Demaille <akim@epita.fr>
12107
12108 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
12109 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
12110 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
12111 RHS, instead of being an index in RITEMS.
12112
e966383b
PE
121132002-04-04 Paul Eggert <eggert@twinsun.com>
12114
12115 * doc/bison.texinfo: Update copyright date.
12116 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
12117 (Symbols): Warn about running Bison in one character set,
12118 but compiling and/or running in an incompatible one.
12119 Warn about character code 256, too.
12120
121212002-04-03 Paul Eggert <eggert@twinsun.com>
12122
12123 * src/bison.data (YYSTACK_ALLOC): Depend on whether
12124 YYERROR_VERBOSE is nonzero, not whether it is defined.
12125
12126 Merge changes from bison-1_29-branch.
c307773e 12127
8d6c48b9
PE
121282002-03-20 Paul Eggert <eggert@twinsun.com>
12129
12130 Merge fixes from Debian bison_1.34-1.diff.
12131
12132 * configure.in (AC_PREREQ): 2.53.
12133
e53c6322
AD
121342002-03-20 Akim Demaille <akim@epita.fr>
12135
12136 * src/conflicts.c (log_resolution): Argument `resolution' is const.
12137
9ffbeca7
PE
121382002-03-19 Paul Eggert <eggert@twinsun.com>
12139
21db0b2a
PE
12140 * src/bison.simple (YYCOPY): New macro.
12141 (YYSTACK_RELOCATE): Use it.
12142 Remove Type arg; no longer needed. All callers changed.
12143 (yymemcpy): Remove; no longer needed.
12144
9ffbeca7
PE
12145 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
12146 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
12147
642cb8f8
AD
121482002-03-19 Akim Demaille <akim@epita.fr>
12149
12150 Test and fix the #line outputs.
12151
12152 * tests/atlocal.at (GCC): New.
12153 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 12154 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
12155 (Action synch line, Epilogue synch line): New tests.
12156 * src/reader.c (parse_union_decl): Define the muscle stype_line.
12157 * data/bison.simple, data/bison.c++: Use it.
12158
3c31a486
AD
121592002-03-19 Akim Demaille <akim@epita.fr>
12160
12161 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
12162 (Solved SR Conflicts, %expect not enough, %expect right)
12163 (%expect too much): Move to...
12164 * tests/conflicts.at: this new file.
12165
0d8bed56
AD
121662002-03-19 Akim Demaille <akim@epita.fr>
12167
12168 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12169 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
12170 that we can move to enums for instance.
12171 * src/output.c (token_definitions_output): Output a list of
12172 `token-name, token-number' instead of the #define.
12173 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
12174
9208d17f
AD
121752002-03-14 Akim Demaille <akim@epita.fr>
12176
12177 Use Gettext 0.11.1.
12178
af27eacb
RA
121792002-03-09 Robert Anisko <robert@lrde.epita.fr>
12180
12181 * data/bison.c++: Make the user able to add members to the generated
12182 parser by subclassing.
12183
9101a310
RA
121842002-03-05 Robert Anisko <robert@lrde.epita.fr>
12185
12186 * src/reader.c (read_additionnal_code): `c' should be an integer, not
12187 a character.
12188 Reported by Nicolas Tisserand and Nicolas Burrus.
12189
fff9bf0b
RA
121902002-03-04 Robert Anisko <robert@lrde.epita.fr>
12191
12192 * src/reader.c: Warn about lacking semi-colons, do not complain.
12193
64dba31e
RA
121942002-03-04 Robert Anisko <robert@lrde.epita.fr>
12195
12196 * data/bison.c++: Remove a debug line.
12197
374f5a14
RA
121982002-03-04 Robert Anisko <robert@lrde.epita.fr>
12199
12200 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
12201 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
12202 provide a default implementation.
12203
bfcf1f3a
AD
122042002-03-04 Akim Demaille <akim@epita.fr>
12205
12206 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
12207 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
12208 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
12209 * tests/semantic.at (Parsing Guards): Similarly.
12210 * src/reader.at (readgram): Complain if the last rule is not ended
12211 with a semi-colon.
12212
65ccf9fc
AD
122132002-03-04 Akim Demaille <akim@epita.fr>
12214
12215 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
12216 * src/closure.c: here.
12217 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
12218 RTC.
12219 * src/warshall.h, src/warshall.c: Remove.
12220 * tests/sets.at (Broken Closure): Adjust.
12221
d0039cbc
AD
122222002-03-04 Akim Demaille <akim@epita.fr>
12223
12224 * src/output.c (output_skeleton): tempdir is const.
12225 bytes_read is unused.
12226
345cea78
AD
122272002-03-04 Akim Demaille <akim@epita.fr>
12228
12229 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12230 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
12231 Update.
12232 From Michael Hayes.
12233
564801f7
AD
122342002-03-04 Akim Demaille <akim@epita.fr>
12235
12236 * src/closure.c (closure): `r' is unused.
12237
e5352bc7
AD
122382002-03-04 Akim Demaille <akim@epita.fr>
12239
12240 * tests/sets.at (Broken Closure): Add the ending `;'.
12241 * src/reader.at (readgram): Complain if a rule is not ended with a
12242 semi-colon.
12243
914feea9
AD
122442002-03-04 Akim Demaille <akim@epita.fr>
12245
12246 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
12247 (count_sr_conflicts): Use bitset_count.
12248 * src/reduce.c (inaccessable_symbols): Ditto.
12249 (bits_size): Remove.
12250 * src/warshall.h, src/warshall.c: Convert to bitsetv.
12251
f0250de6
AD
122522002-03-04 Akim Demaille <akim@epita.fr>
12253
12254 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
12255 * src/reduce.c: Remove the `bitset_zero's following the
12256 `bitset_create's, as now it is performed by the latter.
12257
ef017502
AD
122582002-03-04 Akim Demaille <akim@epita.fr>
12259
12260 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
12261 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
12262 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
12263 latest sources from Michael.
12264
76514394
AD
122652002-03-04 Akim Demaille <akim@epita.fr>
12266
12267 * src/output.c (output): Don't free the grammar.
12268 * src/reader.c (grammar_free): New.
12269 * src/main.c (main): Call it and don't free symtab here.
12270
55024580
AD
122712002-03-04 Akim Demaille <akim@epita.fr>
12272
12273 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
12274 before returning.
12275 Reported by Benoit Perrot.
12276
f9abaa2c
AD
122772002-03-04 Akim Demaille <akim@epita.fr>
12278
12279 Use bitset operations when possible, not loops over bits.
12280
12281 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
12282 bitset_or.
12283 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
12284 * src/reduce.c (useless_nonterminals): Formatting changes.
12285 * src/warshall.c (TC): Use bitset_or.
12286
0e721e75
AD
122872002-03-04 Akim Demaille <akim@epita.fr>
12288
12289 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
12290 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
12291 Ditto.
12292
0fb1ffb1
AD
122932002-03-04 Akim Demaille <akim@epita.fr>
12294
12295 * src/lalr.c (F): Now a bitset*.
12296 Adjust all dependencies.
12297
b86796bf
AD
122982002-03-04 Akim Demaille <akim@epita.fr>
12299
12300 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
12301 Adjust all dependencies.
12302
602bbf31
AD
123032002-03-04 Akim Demaille <akim@epita.fr>
12304
12305 * src/L0.c, src/LR0.h (nstates): Be size_t.
12306 Adjust comparisons (signed vs unsigned).
12307 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
12308 bitset*.
12309 Adjust all dependencies.
12310
d8a0245c
AD
123112002-03-04 Akim Demaille <akim@epita.fr>
12312
12313 * src/closure.c (firsts): Now, also a bitset.
12314 Adjust all dependencies.
12315 (varsetsize): Remove, now unused.
12316 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
12317
34ba9743
AD
123182002-03-04 Akim Demaille <akim@epita.fr>
12319
12320 * src/print.c: Convert to use bitset.h, not hand coded iterations
12321 over ints.
12322
ed86e78c
AD
123232002-03-04 Akim Demaille <akim@epita.fr>
12324
12325 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
12326
dfdb1797
AD
123272002-03-04 Akim Demaille <akim@epita.fr>
12328
12329 * src/closure.c (ruleset): Be a bitset.
12330 (rulesetsize): Remove.
12331
7086e707
AD
123322002-03-04 Akim Demaille <akim@epita.fr>
12333
12334 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12335 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
12336 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
12337 * src/closure.c (fderives): Be an array of bitsets.
12338
98254360
RA
123392002-02-28 Robert Anisko <robert@lrde.epita.fr>
12340
12341 * data/bison.c++: Merge the two generated headers. Insert a copyright
12342 notice in each output file.
12343
a75c057f
AD
123442002-02-28 Akim Demaille <akim@epita.fr>
12345
12346 * data/bison.c++: Copy the prologue of bison.simple to fetch
12347 useful M4 definitions, such as b4_header_guard.
12348
06b00abc
AD
123492002-02-25 Akim Demaille <akim@epita.fr>
12350
12351 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
12352 translator friendly scheme for the bgr
12353 copyright notice.
06b00abc 12354
70e7d534
AD
123552002-02-25 Akim Demaille <akim@epita.fr>
12356
12357 * src/output.c (header_output): Remove, now handled completely via
12358 M4.
12359
abe017f6
AD
123602002-02-25 Akim Demaille <akim@epita.fr>
12361
12362 * m4/m4.m4: New, from CVS Autoconf.
12363 * configure.in: Invoke it.
12364 * src/output.c (output_skeleton): Use its result instead of the
12365 hard coded name.
12366
381fb12e
AD
123672002-02-25 Akim Demaille <akim@epita.fr>
12368
12369 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
12370 Fileutils 4.1.5.
12371 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
12372 * src/output.c (output_skeleton): Use mkstemp to create a real
12373 temporary file.
12374 Move the filling of `skeleton' and its muscle to...
12375 (prepare): here.
12376 (output): Move the definition of the prologue muscle to...
12377 (prepare): here.
12378 * src/system.h (DEFAULT_TMPDIR): New.
12379
6f38107f
PE
123802002-02-14 Paul Eggert <eggert@twinsun.com>
12381
12382 Remove the support for C++ namespace cleanliness; it was
12383 causing more problems than it was curing, since it didn't work
12384 properly on some nonstandard C++ compilers. This can wait
12385 for a proper C++ parser.
12386
12387 * NEWS: Document this.
12388 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
12389 of C++, as it's treated like C now.
12390 * src/bison.simple (YYSTD): Remove.
12391 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
12392 Treat C++ just like Standard C instead of trying to support
12393 namespace cleanliness.
12394
80cce3da
AD
123952002-02-14 Akim Demaille <akim@epita.fr>
12396
12397 * tests/regression.at (else): Adjust to Andreas' change.
12398
842e8679
AD
123992002-02-14 Akim Demaille <akim@epita.fr>
12400
12401 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
12402
4bda3f10
AD
124032002-02-13 Andreas Schwab <schwab@suse.de>
12404
12405 * src/output.c (output_rule_data): Don't output NULL, it might
12406 not be defined yet.
12407
4162fa07 124082002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 12409
4162fa07
RA
12410 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
12411 (Copyright notice): Update.
b418ecd8 12412
bd16a5dc
AD
124132002-02-11 Akim Demaille <akim@epita.fr>
12414
12415 * tests/regression.at (%nonassoc and eof): Don't include
12416 nonportable headers.
12417
8d69a1a3
RA
124182002-02-08 Robert Anisko <robert@lrde.epita.fr>
12419
12420 * data/bison.c++: Correct error recovery. Make the user able to
12421 initialize the starting location.
12422
9b2d0677
AD
124232002-02-07 Akim Demaille <akim@epita.fr>
12424
12425 * tests/input.at: New.
12426
69e2658b
RA
124272002-02-07 Robert Anisko <robert@lrde.epita.fr>
12428
12429 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 12430 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
12431 directives around tables only needed for debugging.
12432
4aacc3a7
RA
124332002-02-07 Robert Anisko <robert@lrde.epita.fr>
12434
12435 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
12436 C++ parsers.
12437 (yy::b4_name::parse): Use print_.
12438
762a801e
RA
124392002-02-07 Robert Anisko <robert@lrde.epita.fr>
12440
12441 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
12442
4bb2bc3f
RA
124432002-02-07 Robert Anisko <robert@lrde.epita.fr>
12444
12445 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
12446 C++ parsers.
12447 (yy::b4_name::parse): Build verbose error messages, and use error_.
12448
6b45a3ca
RA
124492002-02-06 Robert Anisko <robert@lrde.epita.fr>
12450
12451 * data/bison.c++: Fix m4 quoting in comments.
12452
50997c6e
RA
124532002-02-06 Robert Anisko <robert@lrde.epita.fr>
12454
12455 * data/bison.c++: Adjust the parser code. Fix some muscles that were
12456 not expanded by m4.
12457
3f3eed27
AD
124582002-02-05 Akim Demaille <akim@epita.fr>
12459
12460 * data/bison.c++: Adjust to the M4 back end.
12461 More is certainly needed.
12462
be2a1a68
AD
124632002-02-05 Akim Demaille <akim@epita.fr>
12464
12465 Give a try to M4 as a back end.
12466
12467 * lib/readpipe.c: New, from wdiff.
12468 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
12469 BISON_HAIRY.
12470 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
12471 specific values. Now it is m4 that performs the lookup.
12472 * src/parse-skel.y: Remove.
12473 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
12474 * src/output.c (actions_output, guards_output)
12475 (token_definitions_output): No longer keeps track of the output
12476 line number, hence remove the second argument.
12477 (guards_output): Check against the guard member of a rule, not the
12478 action member.
12479 Adjust callers.
12480 (output_skeleton): Don't look for the skeleton location, let m4 do
12481 that.
12482 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
12483 file will be used.
12484 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
12485 (prepare): Given that for the time being changesyntax is not
12486 usable in M4, rename the muscles using `-' to `_'.
12487 Define `defines_flag', `output_parser_name' and `output_header_name'.
12488 * src/output.h (actions_output, guards_output)
12489 (token_definitions_output): Adjust prototypes.
12490 * src/scan-skel.l: Instead of scanning the skeletons, it now
12491 processes the output of m4: `__oline__' and `#output'.
12492 * data/bison.simple: Adjust to be used by M4(sugar).
12493 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
12494 to date.
12495 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
12496 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
12497 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
12498 shamelessly stolen from CVS Autoconf.
12499
beda758b
AD
125002002-02-05 Akim Demaille <akim@epita.fr>
12501
12502 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
12503 * configure.in: Check for the declarations of free and malloc.
12504 * src/muscle_tab.c: Adjust.
12505
5ece6d43
AD
125062002-02-05 Akim Demaille <akim@epita.fr>
12507
12508 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
12509 which have no values.
12510
5bb18f9a
AD
125112002-02-05 Akim Demaille <akim@epita.fr>
12512
12513 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
12514 * data/: here.
12515
894dd62e
PE
125162002-01-29 Paul Eggert <eggert@twinsun.com>
12517
12518 * src/bison.simple (YYSIZE_T): Do not define merely because
12519 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
12520 On some platforms, <alloca.h> does not declare YYSTD (size_t).
12521
82841af7
AD
125222002-01-27 Akim Demaille <akim@epita.fr>
12523
12524 Fix `%nonassoc and eof'.
12525
12526 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
12527 which were not properly copied! Replace
12528 memcpy (res->errs, src->errs, src->nerrs);
12529 with
12530 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
12531 !!!
12532 * tests/regression.at (%nonassoc and eof): Adjust to newest
12533 Autotest: `.' is not in the PATH.
12534
318b76e9
AD
125352002-01-27 Akim Demaille <akim@epita.fr>
12536
12537 * tests/sets.at (AT_EXTRACT_SETS): New.
12538 (Nullable): Use it.
12539 (Firsts): New.
12540
30d2f3d5
AD
125412002-01-26 Akim Demaille <akim@epita.fr>
12542
12543 * tests/actions.at, tests/calc.at, tests/headers.at,
12544 * tests/torture.at: Adjust to the newest Autotest which no longer
12545 forces `.' in the PATH.
12546
30f8c395
AD
125472002-01-25 Akim Demaille <akim@epita.fr>
12548
12549 * tests/regression.at (%nonassoc and eof): New.
12550 Suggested by Robert Anisko.
12551
29ae55f1
AD
125522002-01-24 Akim Demaille <akim@epita.fr>
12553
12554 Bison dumps core when trying to complain about broken input files.
12555 Reported by Cris van Pelt.
12556
12557 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
12558 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
12559 into...
12560 (Invalid inputs): Strengthen: exercise parse_percent_token.
12561
2b548aa6
RA
125622002-01-24 Robert Anisko <robert.anisko@epita.fr>
12563
12564 * src/Makefile.am: Add bison.c++.
12565 * src/bison.c++: New skeleton.
12566
bb0146c2
AD
125672002-01-21 Paolo Bonzini <bonzini@gnu.org>
12568
12569 * po/it.po: New.
12570
bec30531
AD
125712002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
12572
12573 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
12574
fc6edc45
MA
125752002-01-20 Marc Autret <marc@gnu.org>
12576
12577 * src/files.c (compute_output_file_names): Fix
12578
5e5d5415
MA
125792002-01-20 Marc Autret <marc@gnu.org>
12580
12581 * tests/output.at: New test.
12582 * src/files.c (compute_base_names): Don't map extensions when
12583 the YACC flag is set, use defaults.
12584 Reported by Evgeny Stambulchik.
12585
44ea3fbd
MA
125862002-01-20 Marc Autret <marc@gnu.org>
12587
ba0fe3c7
PE
12588 * src/system.h: Need to define __attribute__ away for non-GCC
12589 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
12590 Suggested by Albert Chin-A-Young.
12591
338963d1
TVH
125922002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
12593
12594 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
12595 canonical definition.
12596 * src/system.h: Use the canonical definition for PARAMS (avoids
12597 a conflict with the macro from lib/hash.h).
12598
c57b2479
AD
125992002-01-11 Akim Demaille <akim@epita.fr>
12600
12601 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 12602 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 12603
b85810ae
AD
126042002-01-09 Akim Demaille <akim@epita.fr>
12605
12606 * src/files.c, src/files.h (output_infix): New.
12607 (tab_extension): Remove.
12608 (compute_base_names): Compute the former, drop the latter.
12609 * src/output.c (prepare): Insert the muscles `output-infix', and
12610 `output-suffix'.
12611 * src/parse-skel.y (string, string.1): New.
12612 (section.header): Use it.
12613 (section.yacc): Remove.
12614 (prefix): Remove too.
12615 * src/scan-skel.l: Adjust.
12616 * src/bison.simple, src/bison.hairy: Adjust.
12617
cae60122
AD
126182002-01-09 Akim Demaille <akim@epita.fr>
12619
12620 * configure.in (WERROR_CFLAGS): Compute it.
12621 * src/Makefile.am (CFLAGS): Pass it.
12622 * tests/atlocal.in (CFLAGS): Idem.
12623 * src/files.c: Fix a few warnings.
12624 (get_extension_index): Remove, unused.
12625
ae404801
AD
126262002-01-08 Akim Demaille <akim@epita.fr>
12627
12628 * src/getargs.c (AS_FILE_NAME): New.
12629 (getargs): Use it to convert DOSish file names.
12630 * src/files.c (base_name): Rename as full_base_name to avoid
12631 clashes with `base_name ()'.
12632 (filename_split): New.
12633 (compute_base_names): N-th rewrite, using filename_split.
12634
22312b71
AD
126352002-01-08 Akim Demaille <akim@epita.fr>
12636
12637 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
12638 New, stolen from the Fileutils 4.1.
12639 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
12640 * configure.in: Check for the presence of memrchr, and of its
12641 prototype.
12642
a67cef01
TVH
126432002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
12644
12645 * lib/hash.h (__P): Added definition for this macro.
12646 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
12647 BUILT_SOURCES, to ensure they are generated first.
12648 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
12649 %error-verbose to allow bootstrapping with bison 1.30x.
12650
2b25d624
AD
126512002-01-06 Akim Demaille <akim@epita.fr>
12652
12653 * src/reader.c (parse_braces): Don't fetch the next char, the
12654 convention is to fetch on entry.
12655 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
12656 'switch' without a following semicolon.
12657 * tests/regression.at (braces parsing): New.
12658
3460813b
AD
126592002-01-06 Akim Demaille <akim@epita.fr>
12660
12661 Bison is dead wrong in its RR conflict reports.
12662
12663 * tests/torture.at (GNU Cim Grammar): New.
12664 * src/conflicts.c (count_rr_conflicts): Fix.
12665
73784c64
AD
126662002-01-06 Akim Demaille <akim@epita.fr>
12667
12668 Creating package.m4 from configure.ac causes too many problems.
12669
12670 * tests/Makefile.am (package.m4): Create it by hand,
12671 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
12672
25d81090
AD
126732002-01-06 Akim Demaille <akim@epita.fr>
12674
12675 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
12676 skeleton.h.
12677
a9b8959e
PE
126782002-01-04 Paul Eggert <eggert@twinsun.com>
12679
12680 * doc/bison.texinfo (Debugging):
12681 Remove YYSTDERR; it's no longer defined or used.
12682 Also, s/cstdio.h/cstdio/.
12683
25d81090
AD
126842002-01-03 Akim Demaille <akim@epita.fr>
12685
12686 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
12687
1109455c
AD
126882002-01-03 Akim Demaille <akim@epita.fr>
12689
12690 * src/parse-skel.y (process_skeleton): Don't bind the parser's
12691 tracing code to --trace, wait for a better --trace option, with
12692 args.
12693
7ea5e977
AD
126942002-01-03 Akim Demaille <akim@epita.fr>
12695
12696 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
12697 The ISO C++ standard is extremely clear about it: stderr is
12698 considered a macro, not a regular symbol (see table 94 `Header
12699 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
12700 Therefore std:: does not apply to it. It still does with fprintf.
12701 Also, s/cstdio.h/cstdio/.
12702
fab5b110
AD
127032002-01-03 Akim Demaille <akim@epita.fr>
12704
12705 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
12706 for non system headers.
12707
aed7fd9b
AD
127082002-01-02 Akim Demaille <akim@epita.fr>
12709
12710 Equip the skeleton chain with location tracking, runtime trace,
12711 pure parser and scanner.
12712
12713 * src/parse-skel.y: Request a pure parser, locations, and prefix
12714 renaming.
12715 (%union): Having several members with the same type does not help
12716 type mismatches, simplify.
12717 (YYPRINT, yyprint): New.
12718 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
12719 (skel_error): this.
12720 Handle locations.
12721 * src/scan-skel.l: Adjust to these changes.
12722 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
12723 (LOCATION_PRINT, skel_control_t): New.
12724
24fad99e
AD
127252001-12-30 Akim Demaille <akim@epita.fr>
12726
12727 * src/parse-skel.y: Get rid of the shift/reduce conflict:
12728 replace `gb' with BLANKS.
12729 * src/scan-skel.l: Adjust.
12730
a4b36db4
AD
127312001-12-30 Akim Demaille <akim@epita.fr>
12732
12733 * src/system.h: We don't need nor want bcopy.
12734 Throw away MS-DOS crap: we don't need getpid.
12735 * configure.in: We don't need strndup. It was even causing
12736 problems: because Flex includes the headers *before* us,
12737 _GNU_SOURCE is not defined by config.h, and therefore strndup was
12738 not visible.
12739 * lib/xstrndup.c: New.
12740 * src/scan-skel.l: Use it.
12741 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
12742 * src/parse-skel.y: Use %directives instead of #defines.
12743
1239777d
AD
127442001-12-30 Akim Demaille <akim@epita.fr>
12745
12746 * src/skeleton.h: New.
12747 * src/output.c (output_parser, output_master_parser): Remove, dead
12748 code.
12749 * src/output.h (get_lines_number, actions_output, guards_output)
12750 (token_definitions_output): Prototype them.
12751 * src/parse-skel.y: Add the license notice.
12752 Include output.h and skeleton.h.
12753 (process_skeleton): Returns void, and takes a single parameter.
12754 * src/scan-skel.l: Add the license notice.
12755 Include skeleton.h.
12756 Don't use %option yylineno: it seems that then Flex imagines
12757 REJECT has been used, and therefore it won't reallocate its
12758 buffers (which makes no other sense to me than a bug). It results
12759 in warnings for `unused: yy_flex_realloc'.
12760
9b3add5b
RA
127612001-12-30 Robert Anisko <robert.anisko@epita.fr>
12762
12763 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
12764 (MUSCLE_INSERT_PREFIX): ...to there.
12765 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
12766 (MUSCLE_INSERT_PREFIX): Move from here...
12767
12768 * src/bison.hairy: Add a section directive. Put braces around muscle
12769 names. This parser skeleton is still broken, but Bison should not
12770 choke on a bad muscle 'syntax'.
12771 * src/bison.simple: Add a section directive. Put braces around muscle
12772 names.
12773
12774 * src/files.h (strsuffix, stringappend): Add declarations.
12775 (tab_extension): Add declaration.
12776 (short_base_name): Add declaration.
12777
12778 * src/files.c (strsuffix, stringappend): No longer static. These
12779 functions are used in the skeleton parser.
12780 (tab_extension): New.
12781 (compute_base_names): Use the computations done in this function
fab5b110 12782 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
12783 names.
12784 (short_base_name): No longer static.
12785
12786 * src/output.c (output_skeleton): New.
12787 (output): Disable call to output_master_parser, and give a try to
12788 a new skeleton handling system.
12789 (guards_output, actions_output): No longer static.
12790 (token_definitions_output, get_lines_number): No longer static.
12791
12792 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
12793
fab5b110 12794 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
12795 parse-skel.y.
12796
12797 * src/parse-skel.y: New file.
12798 * src/scan-skel.l: New file.
12799
b5b61c61
AD
128002001-12-29 Akim Demaille <akim@epita.fr>
12801
12802 %name-prefix is broken.
12803
12804 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
12805 Adjust all dependencies.
12806 * tests/headers.at (export YYLTYPE): Strengthen this test: use
12807 %name-prefix.
12808
12809 Renaming yylval but not yylloc is not consistent. Now we do.
12810
12811 * src/bison.simple: Prefix yylloc if used.
12812 * doc/bison.texinfo (Decl Summary): Document that.
12813
8c9a50be
AD
128142001-12-29 Akim Demaille <akim@epita.fr>
12815
12816 * doc/bison.texinfo: Promote `%long-directive' over
12817 `%long_directive'.
12818 Remove all references to fixed-output-files, yacc is enough.
12819
d99361e6
AD
128202001-12-29 Akim Demaille <akim@epita.fr>
12821
12822 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
12823 user prologue. These are defaults.
12824 * tests/actions.at (Mid-rule actions): Make sure the user can
12825 define YYDEBUG and YYERROR_VERBOSE.
12826
b9cecb91
AD
128272001-12-29 Akim Demaille <akim@epita.fr>
12828
12829 * src/output.c (header_output): Don't forget to export YYLTYPE and
12830 yylloc.
12831 * tests/headers.at (export YYLTYPE): New, make sure it does.
12832 * tests/regression.at (%union and --defines, Invalid CPP headers):
12833 Move to...
12834 * tests/headers.at: here.
12835
aea13e97
AD
128362001-12-29 Akim Demaille <akim@epita.fr>
12837
12838 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
12839
931394cb
AD
128402001-12-29 Akim Demaille <akim@epita.fr>
12841
12842 * tests/actions.at (Mid-rule actions): Output on a single line
12843 instead of several.
12844
704a47c4
AD
128452001-12-29 Akim Demaille <akim@epita.fr>
12846
12847 * doc/bison.texinfo: Formatting changes.
12848
091e20bb
AD
128492001-12-29 Akim Demaille <akim@epita.fr>
12850
12851 Don't store the token defs in a muscle, just be ready to output it
12852 on command. Now possible via `symbols'. Fixes a memory leak.
12853
12854 * src/output.c (token_definitions_output): New.
12855 (output_parser, header_output): Use it.
12856 * src/reader.c (symbols_save): Remove.
12857
cce71710
AD
128582001-12-29 Akim Demaille <akim@epita.fr>
12859
12860 * src/bison.simple: Do not provide a default for YYSTYPE and
12861 YYLTYPE before the user's prologue. Otherwise it's hardly... a
12862 default.
12863
82c035a8
AD
128642001-12-29 Akim Demaille <akim@epita.fr>
12865
12866 Mid-rule actions are simply... ignored!
12867
12868 * src/reader.c (readgram): Be sure to attach mid-rule actions to
12869 the empty-rule associated to the dummy symbol, not to the host
12870 rule.
12871 * tests/actions.at (Mid-rule actions): New.
12872
8419d367
AD
128732001-12-29 Akim Demaille <akim@epita.fr>
12874
12875 Memory leak.
12876
12877 * src/reader.c (reader): Free grammar.
12878
375d5806
AD
128792001-12-29 Akim Demaille <akim@epita.fr>
12880
12881 Memory leak.
12882
12883 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
12884 since it allocates it for each state, although only one is needed.
12885 (allocate_storage): Do it here.
12886
f51cb8ff
AD
128872001-12-29 Akim Demaille <akim@epita.fr>
12888
12889 * src/options.h, src/options.c (create_long_option_table): Rename
12890 as...
12891 (long_option_table_new): this, with a clearer prototype.
12892 (percent_table): Remove, unused,
12893 * src/getargs.c (getargs): Adjust.
12894
29e88316
AD
128952001-12-29 Akim Demaille <akim@epita.fr>
12896
12897 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
12898 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
12899 as states.
12900
b9f71f19
AD
129012001-12-29 Akim Demaille <akim@epita.fr>
12902
12903 * src/lalr.c (build_relations): Rename `states' as `states1'.
12904 Sorry, I don't understand exactly what it is, no better name...
12905
1a2b5d37
AD
129062001-12-29 Akim Demaille <akim@epita.fr>
12907
12908 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
12909 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
12910 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
12911 as rules.
12912
1cca533e
AD
129132001-12-29 Akim Demaille <akim@epita.fr>
12914
12915 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
12916 ago.
12917
c03ae966
AD
129182001-12-29 Akim Demaille <akim@epita.fr>
12919
12920 * src/reader.c, src/reader.h (user_toknums): Remove.
12921 Adjust all users to use symbols[i]->user_token_number.
12922
5a670b1e
AD
129232001-12-29 Akim Demaille <akim@epita.fr>
12924
12925 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
12926 Adjust all users to use symbols[i]->prec or ->assoc.
12927
ad949da9
AD
129282001-12-29 Akim Demaille <akim@epita.fr>
12929
12930 * src/reader.c, src/reader.h (tags): Remove.
12931 Adjust all users to use symbols[i]->tag.
12932
0e78e603
AD
129332001-12-29 Akim Demaille <akim@epita.fr>
12934
12935 * src/gram.h, src/gram.c (symbols): New, similar to state_table
12936 and rule_table.
12937 * src/reader.c (packsymbols): Fill this table.
12938 Drop sprec.
12939 * src/conflicts.c (resolve_sr_conflict): Adjust.
12940 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
12941 single table.
12942 Use symbols[i]->tag instead of tags[i].
12943
213e640e
AD
129442001-12-29 Akim Demaille <akim@epita.fr>
12945
12946 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
12947 In addition, put a comment in there, to replace...
12948 * tests/regression.at (%union and C comments): Remove.
12949
e7b8bef1
AD
129502001-12-29 Akim Demaille <akim@epita.fr>
12951
12952 * tests/regression.at (Web2c Actions): Blindly move the actual
12953 output as expected output. The contents *seem* right to me, but I
12954 can't pretend reading perfectly parser tables... Nonetheless, all
12955 the other tests pass correctly, the table look OK, even though the
12956 presence of `$axiom' is to be noted: AFAICS it is useless (but
12957 harmless).
12958
b68e7744
AD
129592001-12-29 Akim Demaille <akim@epita.fr>
12960
12961 * src/reader.c (readgram): Don't add the rule 0 if there were no
12962 rules read. In other words, add it _after_ having performed
12963 grammar sanity checks.
12964 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
12965
78d5bae9
AD
129662001-12-29 Akim Demaille <akim@epita.fr>
12967
12968 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
12969 visible, and some states have now a different number.
12970
ff442794
AD
129712001-12-29 Akim Demaille <akim@epita.fr>
12972
12973 * src/reader.c (readgram): Bind the initial rule's lineno to that
12974 of the first rule.
12975 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
12976 (Solved SR Conflicts): Adjust rule 0's line number.
12977
610ab194
AD
129782001-12-29 Akim Demaille <akim@epita.fr>
12979
12980 Fix the `GAWK Grammar' failure.
12981
12982 * src/LR0.c (final_state): Initialize to -1 so that we do compute
12983 the reductions of the first state which was mistakenly confused
12984 with the final state because precisely final_state was initialized
12985 to 0.
12986 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
12987 now noticed by Bison.
12988 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
12989 have a reduction on $default.
12990
29d29c8f
AD
129912001-12-29 Akim Demaille <akim@epita.fr>
12992
12993 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
12994 rule line numbers.
12995 * src/closure.c (print_closure): Likewise.
12996 * src/derives.c (print_derives): Likewise.
12997 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
12998 now.
12999
7c6b64d0
AD
130002001-12-29 Akim Demaille <akim@epita.fr>
13001
13002 * src/lalr.c (lookaheads_print): New.
13003 (lalr): Call it when --trace-flag.
13004 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
13005 are dumped.
13006
3d4daee3
AD
130072001-12-29 Akim Demaille <akim@epita.fr>
13008
13009 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
13010 when walking through ritem, even via rule->rhs.
13011 * src/reduce.c (dump_grammar, useful_production, reduce_output)
13012 (useful_production, useless_nonterminals): Likewise.
13013 (reduce_grammar_tables): Likewise, plus update nritems.
13014 * src/nullable.c (set_nullable): Likewise.
13015 * src/lalr.c (build_relations): Likewise.
13016 * tests/sets.at (Nullable): Adjust.
13017 Fortunately, now, the $axiom is no longer nullable.
13018
9e7f6bbd
AD
130192001-12-29 Akim Demaille <akim@epita.fr>
13020
13021 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
13022 the 0-sentinel.
13023 * src/gram.c (ritem_longest_rhs): Likewise.
13024 * src/reduce.c (nonterminals_reduce): Likewise.
13025 * src/print_graph.c (print_graph): Likewise.
13026 * src/output.c (output_rule_data): Likewise.
13027 * src/nullable.c (set_nullable): Likewise.
13028
255ef638
AD
130292001-12-29 Akim Demaille <akim@epita.fr>
13030
13031 * src/output.c: Comment changes.
13032
0d8a7363
AD
130332001-12-27 Paul Eggert <eggert@twinsun.com>
13034
13035 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
13036 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
13037 Sparc, as they were causing more porting problems than the
13038 (minor) performance improvement was worth.
13039
13040 Also, catch up with 1.31's YYSTD.
13041
3db472b9
AD
130422001-12-27 Akim Demaille <akim@epita.fr>
13043
13044 * src/output.c (output_gram): Rely on nritems, not the
13045 0-sentinel. See below.
13046 Use -1 as separator, not 0.
13047 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
13048 Rely on -1 as separator in yyrhs, instead of 0.
13049 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
13050 twice `Now at end of input', therefore there are two lines less to
13051 expect.
13052
b365aa05
AD
130532001-12-27 Akim Demaille <akim@epita.fr>
13054
13055 * tests/regression.at (Unresolved SR Conflicts):
13056 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
13057 below.
13058
30171f79
AD
130592001-12-27 Akim Demaille <akim@epita.fr>
13060
13061 * src/LR0.c (new_state): Recognize the final state by the fact it
13062 is reached by eoftoken.
13063 (insert_start_shifting_state, insert_eof_shifting_state)
13064 (insert_accepting_state, augment_automaton): Remove, since now
13065 these states are automatically computed from the initial state.
13066 (generate_states): Adjust.
13067 * src/print.c: When reporting a rule number to the user, substract
13068 1, so that the axiom rule is rule 0, and the first user rule is 1.
13069 * src/reduce.c: Likewise.
13070 * src/print_graph.c (print_core): For the time being, just as for
13071 the report, depend upon --trace-flags to dump the full set of
13072 items.
13073 * src/reader.c (readgram): Once the grammar read, insert the rule
13074 0: `$axiom: START-SYMBOL $'.
13075 * tests/set.at: Adjust: rule 0 is now displayed, and since the
13076 number of the states has changed (the final state is no longer
13077 necessarily the last), catch up.
13078
75142d45
AD
130792001-12-27 Akim Demaille <akim@epita.fr>
13080
13081 Try to make the use of the eoftoken valid. Given that its value
13082 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
13083 is used instead of > 0 where appropriate, (ii), depend upon nritems
13084 instead of the 0-sentinel.
13085
13086 * src/gram.h, src/gram.c (nritems): New.
13087 Expected to be duplication of nitems, but for the time being...
13088 * src/reader.c (packgram): Assert nritems and nitems are equal.
13089 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
13090 * src/closure.c (print_closure, print_fderives): Likewise.
13091 * src/gram.c (ritem_print): Likewise.
13092 * src/print.c (print_core, print_grammar): Likewise.
13093 * src/print_graph.c: Likewise.
13094
b7c49edf
AD
130952001-12-27 Akim Demaille <akim@epita.fr>
13096
13097 * src/main.c (main): If there are complains after grammar
13098 reductions, then output the report anyway if requested, then die.
13099 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
13100 * src/reader.c (eoftoken): New.
13101 (parse_token_decl): If the token being defined has value `0', it
13102 is the eoftoken.
13103 (packsymbols): No longer hack `tags' to insert `$' by hand.
13104 Be sure to preserve the value of the eoftoken.
13105 (reader): Make sure eoftoken is defined.
13106 Initialize nsyms to 0: now eoftoken is created just like the others.
13107 * src/print.c (print_grammar): Don't special case the eof token.
13108 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
13109 lie anyway, albeit pleasant.
13110 * tests/calc.at: Exercise error messages with eoftoken.
13111 Change the grammar so that empty input is invalid.
13112 Adjust expectations.
13113 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
13114
ec2da99f
AD
131152001-12-27 Akim Demaille <akim@epita.fr>
13116
13117 * configure.in: Check the protos of strchr ans strspn.
13118 Replace strchr if needed.
13119 * src/system.h: Provide the protos of strchr, strspn and memchr if
13120 missing.
13121 * lib/strchr.c: New.
13122 * src/reader.c (symbols_save): Use strchr.
13123
8adfa272
AD
131242001-12-27 Akim Demaille <akim@epita.fr>
13125
13126 * src/print.c, src/print_graph.c (escape): New.
13127 Use it to quote the TAGS outputs.
13128 * src/print_graph.c (print_state): Now errors are in red, and
13129 reductions in green.
13130 Prefer high to wide: output the state number on a line of its own.
13131
80dac38c
AD
131322001-12-27 Akim Demaille <akim@epita.fr>
13133
13134 * src/state.h, src/state.c (reductions_new): New.
13135 * src/LR0.c (set_state_table): Let all the states have a
13136 `reductions', even if reduced to 0.
13137 (save_reductions): Adjust.
13138 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
13139 * src/print.c (print_reductions, print_actions): Adjust.
13140 * src/output.c (action_row): Adjust.
13141
2cec70b9
AD
131422001-12-27 Akim Demaille <akim@epita.fr>
13143
13144 * src/state.h, src/state.c (errs_new, errs_dup): New.
13145 * src/LR0.c (set_state_table): Let all the states have an errs,
13146 even if reduced to 0.
13147 * src/print.c (print_errs, print_reductions): Adjust.
13148 * src/output.c (output_actions, action_row): Adjust.
13149 * src/conflicts.c (resolve_sr_conflict): Adjust.
13150
13ca549a
AD
131512001-12-27 Akim Demaille <akim@epita.fr>
13152
13153 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
13154
5092aba5
AD
131552001-12-27 Akim Demaille <akim@epita.fr>
13156
13157 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
13158 * src/print.c: here.
13159 (lookaheadset, shiftset): New, used as additional storage by
13160 print_reductions.
13161 (print_results): Adjust.
13162 (print_shifts, print_gotos, print_errs): New, extracted from...
13163 (print_actions): here.
13164 * src/print_graph.c (print_actions): Remove dead code.
13165
11e2beca
AD
131662001-12-27 Akim Demaille <akim@epita.fr>
13167
13168 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
13169 `$n' and `@n'.
13170
dac3c910
AD
131712001-12-27 Akim Demaille <akim@epita.fr>
13172
13173 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
13174 (build_relations): Adjust.
13175
d0b0fefa
AD
131762001-12-27 Akim Demaille <akim@epita.fr>
13177
13178 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
13179 duplication.
13180
adc8c848
AD
131812001-12-27 Akim Demaille <akim@epita.fr>
13182
13183 * src/reader.c (packgram): Catch nitems overflows.
13184
14d293ac
AD
131852001-12-27 Akim Demaille <akim@epita.fr>
13186
13187 * src/files.c, src/files.h (guard_obstack): Remove.
13188 * src/output.c (output): Adjust.
13189 * src/reader.c (parse_braces): New, factoring...
13190 (copy_action, copy_guard): these two which are renamed as...
13191 (parse_action, parse_guard): these.
13192 As a voluntary consequence, using braces around guards is now
13193 mandatory.
13194
f499b062
AD
131952001-12-27 Akim Demaille <akim@epita.fr>
13196
13197 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
13198 * src/reader.c (symbol_list): `guard' and `guard_line' are new
13199 members.
13200 (symbol_list_new): Adjust.
13201 (copy_action): action_line is the first line, not the last.
13202 (copy_guard): Just as for actions, store the `action' only, not
13203 the switch/case/break flesh.
13204 Don't parse the user action that might follow the guard, let...
13205 (readgram): do it, i.e., now, there can be an action after a
13206 guard.
13207 In other words the guard is just explicitly optional.
13208 (packgram): Adjust.
13209 * src/output.c (guards_output): New.
13210 (output_parser): Call it when needed.
13211 (output): Also free the guard and attrs obstacks.
13212 * src/files.c, src/files.h (obstack_save): Remove.
13213 (output_files): Remove.
13214 As a result, if one needs the former `.act' file, using an
13215 appropriate skeleton which requires actions and guards is now
13216 required.
13217 * src/main.c (main): Adjust.
13218 * tests/semantic.at: New.
13219 * tests/regression.at: Use `input.y' as input file name.
13220 Avoid 8+3 problems by requiring input.c when the test needs the
13221 parser.
13222
d945f5cd
AD
132232001-12-27 Akim Demaille <akim@epita.fr>
13224
13225 * src/reader.c (symbol_list_new): Be sure to initialize all the
13226 fields.
13227
d200e455
AD
132282001-12-27 Akim Demaille <akim@epita.fr>
13229
13230 All the hacks using a final pseudo state are now useless.
13231
13232 * src/LR0.c (set_state_table): state_table holds exactly nstates.
13233 * src/lalr.c (nLA): New.
13234 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
13235 instead of lookaheadsp from the pseudo state (nstate + 1).
13236
f9507c28
AD
132372001-12-27 Akim Demaille <akim@epita.fr>
13238
13239 * src/output.c (action_row, token_actions): Use a state_t instead
13240 of a integer, and nlookaheads instead of the following state's
13241 lookaheadsp.
13242
065fbd27
AD
132432001-12-27 Akim Demaille <akim@epita.fr>
13244
13245 * src/conflicts.c (log_resolution, flush_shift)
13246 (resolve_sr_conflict, set_conflicts, solve_conflicts)
13247 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
13248 (conflicts_print, print_reductions): Use a state_t instead of an
13249 integer when referring to a state.
13250 As much as possible, depend upon nlookaheads, instead of the
13251 `lookaheadsp' member of the following state (since lookaheads of
13252 successive states are successive, the difference between state n + 1
13253 and n served as the number of lookaheads for state n).
13254 * src/lalr.c (add_lookback_edge): Likewise.
13255 * src/print.c (print_core, print_actions, print_state)
13256 (print_results): Likewise.
13257 * src/print_graph.c (print_core, print_actions, print_state)
13258 (print_graph): Likewise.
13259 * src/conflicts.h: Adjust.
13260
1b177bd7
AD
132612001-12-27 Akim Demaille <akim@epita.fr>
13262
13263 * src/bison.hairy: Formatting/comment changes.
13264 ANSIfy.
13265 Remove `register' indications.
13266 Add plenty of `static'.
13267
7742ddeb
AD
132682001-12-27 Akim Demaille <akim@epita.fr>
13269
13270 * src/output.c (prepare): Drop the muscle `ntbase' which
13271 duplicates ntokens.
13272 * src/bison.simple: Formatting/comment changes.
13273 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
13274 is an undocumented synonym.
13275
1fa14068
AD
132762001-12-22 Akim Demaille <akim@epita.fr>
13277
13278 * src/output.c (output_table_data): Change the prototype to use
13279 `int' for array ranges: some invocations do pass an int, not a
13280 short.
13281 Reported by Wayne Green.
13282
b9752825
AD
132832001-12-22 Akim Demaille <akim@epita.fr>
13284
13285 Some actions of web2c.y are improperly triggered.
13286 Reported by Mike Castle.
13287
13288 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
13289 * tests/regression.at (Web2c): Rename as...
13290 (Web2c Report): this.
13291 (Web2c Actions): New.
13292
776209d6
AD
132932001-12-22 Akim Demaille <akim@epita.fr>
13294
13295 Reductions in web2c.y are improperly reported.
13296 Reported by Mike Castle.
13297
13298 * src/conflicts.c (print_reductions): Fix.
13299 * tests/regression.at (Web2c): New.
13300
275fc3ad
AD
133012001-12-18 Akim Demaille <akim@epita.fr>
13302
13303 Some host fail on `assert (!"foo")', which expands to
13304 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
13305 Reported by Nelson Beebee.
13306
13307 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
13308 `#define it_succeeded 0' and `assert (it_succeeded)'.
13309
897668ee
MA
133102001-12-17 Marc Autret <autret_m@epita.fr>
13311
13312 * src/bison.simple: Don't hard code the skeleton line and filename.
13313 * src/output.c (output_parser): Rename 'line' as 'output_line'.
13314 New line counter 'skeleton_line' (skeleton-line muscle).
13315
ab3399e0
PE
133162001-12-17 Paul Eggert <eggert@twinsun.com>
13317
13318 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
13319 YYDEBUG must be defined to a nonzero value.
13320
13321 * src/bison.simple (yytname): Do not assume that the user defines
13322 YYDEBUG to a properly parenthesized expression.
13323
3877f72b
AD
133242001-12-17 Akim Demaille <akim@epita.fr>
13325
13326 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
13327 nlookaheads is a new member.
13328 Adjust all users.
13329 * src/lalr.h (nlookaheads): Remove this orphan declaration.
13330 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
13331 state.
776209d6 13332
331dbc1b
AD
133332001-12-17 Akim Demaille <akim@epita.fr>
13334
13335 * src/files.h, src/files.c (open_files, close_files): Remove.
13336 * src/main.c (main): Don't open/close files, nor invoke lex_free,
13337 let...
13338 * src/reader.c (reader): Do it.
776209d6 13339
be750e4c
AD
133402001-12-17 Akim Demaille <akim@epita.fr>
13341
13342 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 13343
709ae8c6
AD
133442001-12-17 Akim Demaille <akim@epita.fr>
13345
13346 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
13347 (flush_reduce): New.
13348 (resolve_sr_conflict): Adjust.
776209d6 13349
f87685c3
AD
133502001-12-17 Akim Demaille <akim@epita.fr>
13351
13352 * src/output.c (output_obstack): Be static and rename as...
13353 (format_obstack): this, to avoid any confusion with files.c's
13354 output_obstack.
13355 * src/reader.h (muscle_obstack): Move to...
13356 * src/output.h: here, since it's defined in output.c.
13357
837491d8
AD
133582001-12-17 Akim Demaille <akim@epita.fr>
13359
13360 * src/output.c (action_row, save_column, default_goto)
13361 (sort_actions, matching_state, pack_vector): Better variable
13362 locality.
13363
796d61fb
AD
133642001-12-17 Akim Demaille <akim@epita.fr>
13365
13366 * src/output.c: Various formatting changes.
776209d6 13367
64d15509
AD
133682001-12-17 Akim Demaille <akim@epita.fr>
13369
13370 * src/files.c (output_files): Free the output_obstack.
13371 * src/main.c (main): Call print and print_graph conditionally.
13372 * src/print.c (print): Work unconditionally.
13373 * src/print_graph.c (print_graph): Work unconditionally.
13374 * src/conflicts.c (log_resolution): Output only if verbose_flag.
13375
fbc8ecb7
MA
133762001-12-16 Marc Autret <autret_m@epita.fr>
13377
13378 * src/output.c (actions_output): Fix. When we use %no-lines,
13379 there is one less line per action.
13380
f0440388
MA
133812001-12-16 Marc Autret <autret_m@epita.fr>
13382
13383 * src/bison.simple: Remove a useless #line directive.
13384 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
13385 * src/output.c (get_lines_number): New.
776209d6 13386 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
13387 output muscles.
13388 Fix line numbering.
13389 (actions_output): Computes the number of lines taken by actions.
13390 (output_master_parser): Insert new skeleton which is the name of
13391 the output parser file name.
13392
a79986b8
MA
133932001-12-15 Marc Autret <autret_m@epita.fr>
13394
13395 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
13396
4ec8e00f
MA
133972001-12-15 Marc Autret <autret_m@epita.fr>
13398
13399 * src/output.c (output_gram): Keep track of the hairy one.
13400
1a4648ff
AD
134012001-12-15 Akim Demaille <akim@epita.fr>
13402
13403 Make `make distcheck' work.
13404
13405 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
13406 system.h which uses libgettext.h.
13407
9c2c67e6
AD
134082001-12-15 Akim Demaille <akim@epita.fr>
13409
13410 * src/nullable.c (set_nullable): Useless rules must be skipped,
13411 otherwise, since we range over their symbols, we might look at a
13412 nonterminal which no longer ``exists'', i.e., it is not counted in
13413 `nvars', hence we overflow our arrays.
13414
93ede233
AD
134152001-12-15 Akim Demaille <akim@epita.fr>
13416
13417 The header can also be produced directly, without any obstack!
13418 Yahoo!
13419
13420 * src/files.c, src/files.h (defines_obstack): Remove.
13421 (compute_header_macro): Global.
13422 (defines_obstack_save): Remove.
13423 * src/reader.c (parse_union_decl): No longer output to
13424 defines_obstack: its content can be found in the `stype' muscle
13425 anyway.
13426 (output_token_translations): Merge into...
13427 (symbols_output): this.
13428 Rename as...
13429 (symbols_save): this.
13430 (reader): Adjust.
13431 * src/output.c (header_output): New.
13432 (output): Call it.
13433
2666f928
AD
134342001-12-15 Akim Demaille <akim@epita.fr>
13435
13436 * src/reader.c (parse_union_decl): Instead of handling two obstack
13437 simultaneously, use one to define the `stype' muscle, and use the
13438 value of the latter to fill defines_obstack.
13439 (copy_comment): Remove.
13440 (copy_comment2): Work for a single obstack.
13441 Rename as...
13442 (copy_comment): this.
13443
428046f8
AD
134442001-12-15 Akim Demaille <akim@epita.fr>
13445
13446 * src/lex.c, src/lex.h (xgetc): No longer static.
13447 * src/reader.c (parse_union_decl): Revamp.
13448
ea52d706
AD
134492001-12-15 Akim Demaille <akim@epita.fr>
13450
13451 Still making progress in separating Bison into (i) input, (ii)
13452 process, (iii) output: now we can directly output the parser file
13453 without using table_obstack at all.
13454
13455 * src/files.c, src/files.h (table_obstack): Bye bye.
13456 (parser_file_name): New.
13457 * src/files.c (compute_output_file_names): Compute it.
13458 * src/output.c (actions_output, output_parser)
13459 (output_master_parser): To a file instead of an obstack.
13460
3f96f4dc
AD
134612001-12-15 Akim Demaille <akim@epita.fr>
13462
13463 Attach actions to rules, instead of pre-outputting them to
13464 actions_obstack.
13465
13466 * src/gram.h (rule_t): action and action_line are new members.
13467 * src/reader.c (symbol_list): Likewise.
13468 (copy_action): Save the actions within the rule.
13469 (packgram): Save them in rule_table.
13470 * src/output.c (actions_output): New.
13471 (output_parser): Use it on `%%actions'.
13472 (output_rule_data): Don't free rule_table.
13473 (output): Do it.
13474 (prepare): Don't save the `action' muscle.
13475 * src/bison.simple: s/%%action/%%actions/.
13476
51576fb3
AD
134772001-12-15 Akim Demaille <akim@epita.fr>
13478
13479 * src/reader.c (copy_action): When --yacc, don't append a `;'
13480 to the user action: let it fail if lacking.
dee049eb 13481 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 13482
2648a72d
AD
134832001-12-14 Akim Demaille <akim@epita.fr>
13484
13485 * src/lex.c (literalchar): Simply return the char you decoded, non
13486 longer mess around with obstacks and int pointers.
13487 Adjust all callers.
13488
92790e5b
AD
134892001-12-14 Akim Demaille <akim@epita.fr>
13490
13491 * src/lex.c (literalchar): Don't escape the special characters,
13492 just decode them, and keep them as char (before, eol was output as
13493 the 2 char string `\n' etc.).
13494 * src/output.c (output_rule_data): Use quotearg to output the
13495 token strings.
13496
927c1557
PE
134972001-12-13 Paul Eggert <eggert@twinsun.com>
13498
13499 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
13500 Do not infringe on the global user namespace when using C++.
13501 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
13502 All uses of `fprintf' and `stderr' changed.
13503
13504 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
13505
ed8e1f68
AD
135062001-12-13 Akim Demaille <akim@epita.fr>
13507
13508 The computation of nullable is broken: it doesn't handle empty
13509 RHS's properly.
13510
13511 * tests/torture.at (GNU AWK Grammar): New.
13512 * tests/sets.at (Nullable): New.
13513 * src/nullable.c (set_nullable): Instead of blindly looping over
13514 `ritems', loop over the rules, and then over their rhs's.
13515
13516 Work around Autotest bugs.
13517
13518 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
13519 frame, because Autotest understand lines starting with a `+' as
13520 traces from the shell. Then, they are not processed properly.
13521 Admittedly an Autotest bug, but we don't have time to wait for
13522 Autotest to catch up.
13523 * tests/regression.at (Broken Closure): Adjust to the new table
13524 frames.
13525 Move to...
13526 * tests/sets.at: here.
13527
cb581495
AD
135282001-12-13 Akim Demaille <akim@epita.fr>
13529
13530 * src/closure.c (closure): Use nrules instead of playing tricks
13531 with BITS_PER_WORD.
13532
2e729273
AD
135332001-12-13 Akim Demaille <akim@epita.fr>
13534
13535 * src/print.c (print_actions): Output the handling of `$' as the
13536 traces do: shifting the token EOF. Before EOF was treated as a
13537 nonterminal.
13538 * tests/regression.at: Adjust some tests.
13539 * src/print_graph.c (print_core): Complete the set of items via
13540 closure. The next-to-final and final states are still unsatisfying,
13541 but that's to be addressed elsewhere.
13542 No longer output the rule numbers, but do output the state number.
13543 A single loop for the shifts + gotos is enough, but picked a
13544 distinct color for each.
13545 (print_graph): Initialize and finalize closure.
13546
107f7dfb
AD
135472001-12-13 Akim Demaille <akim@epita.fr>
13548
13549 * src/reader.c (readgram): Remove dead code, an strip useless
13550 braces.
13551 (get_type): Remove, unused.
13552
9b53a24f
AD
135532001-12-12 Akim Demaille <akim@epita.fr>
13554
13555 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
13556 on that of lib/error.c.
13557
dbfb6dcd
AD
135582001-12-12 Akim Demaille <akim@epita.fr>
13559
13560 Some hosts don't like `/' in includes.
13561
13562 * src/system.h: Include libgettext.h without qualifying the path.
13563 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
13564 $(top_srcdir).
13565
c25fb648
MA
135662001-12-11 Marc Autret <autret_m@epita.fr>
13567
13568 * src/output.c (output_parser): Remove useless muscle.
13569
710ddc4f
MA
135702001-12-11 Marc Autret <autret_m@epita.fr>
13571
13572 * src/bison.simple: Remove #line just before %%epilogue. It
13573 is now handled in ...
13574 * src/reader.c (read_additionnal_code): Add the output of a
13575 #line for the epilogue.
13576
e83d80b8
MA
135772001-12-10 Marc Autret <autret_m@epita.fr>
13578
927c1557 13579 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
13580 replace precedent remove.
13581 * src/bison.simple: Remove #line before %%prologue because
13582 %%input-line is wrong at this time.
13583
971d5158
MA
135842001-12-10 Marc Autret <autret_m@epita.fr>
13585
13586 * src/reader.c (symbols_output): Clean up.
927c1557 13587 * src/output.c (output_gram, output): Clean up.
971d5158 13588
5edafffd
AD
135892001-12-10 Akim Demaille <akim@epita.fr>
13590
13591 * src/lalr.c (initialize_lookaheads): New. Extracted from...
13592 * src/LR0.c (set_state_table): here.
13593 * src/lalr.c (lalr): Call it.
13594
0279f8e9
AD
135952001-12-10 Akim Demaille <akim@epita.fr>
13596
13597 * src/state.h (shifts): Remove the `number' member: shifts are
13598 attached to state, hence no longer need to be labelled with a
13599 state number.
13600
190c4f5f
AD
136012001-12-10 Akim Demaille <akim@epita.fr>
13602
13603 Now that states have a complete set of members, the linked list of
13604 shifts is useless: just fill directly the state's shifts member.
13605
13606 * src/state.h (shifts): Remove the `next' member.
13607 * src/LR0.c (first_state, last_state): Remove.
13608 Adjust the callers.
13609 (augment_automaton): Don't look for the shifts that must be added
13610 a shift on EOF: it is those of the state we looked for! But now,
13611 since shifts are attached, it is no longer needed to looking
13612 merely by its id: its number.
13613
2a73b93d
AD
136142001-12-10 Akim Demaille <akim@epita.fr>
13615
13616 * src/LR0.c (augment_automaton): Better variable locality.
13617 Remove an impossible branch: if there is a state corresponding to
13618 the start symbol being shifted, then there is shift for the start
13619 symbol from the initial state.
13620
74392f6a
AD
136212001-12-10 Akim Demaille <akim@epita.fr>
13622
13623 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
13624 only when appropriate: when insert_start_shifting_state' is not
13625 invoked.
13626 * tests/regression.at (Rule Line Numbers): Adjust.
13627
37c82725
AD
136282001-12-10 Akim Demaille <akim@epita.fr>
13629
13630 * src/LR0.c (augment_automaton): Now that all states have shifts,
13631 merge the two cases addition shifts to the initial state.
13632
6a164e0c
AD
136332001-12-10 Akim Demaille <akim@epita.fr>
13634
13635 * src/lalr.c (set_state_table): Move to...
13636 * src/LR0.c: here.
13637 * src/lalr.c (lalr): Don't call it...
13638 * src/LR0.c (generate_states): do it.
13639 * src/LR0.h (first_state): Remove, only the table is used.
13640
7215de24
AD
136412001-12-10 Akim Demaille <akim@epita.fr>
13642
13643 * src/LR0.h (first_shift, first_reduction): Remove.
13644 * src/lalr.c: Don't use first_shift: find shifts through the
13645 states.
13646
80e25d4d
AD
136472001-12-10 Akim Demaille <akim@epita.fr>
13648
13649 * src/LR0.c: Attach shifts to states as soon as they are
13650 computed.
13651 * src/lalr.c (set_state_table): Instead of assigning shifts to
13652 state, just assert that the mapping was properly done.
13653
0ab3728b
AD
136542001-12-10 Akim Demaille <akim@epita.fr>
13655
13656 * src/LR0.c (insert_start_shift): Rename as...
13657 (insert_start_shifting_state): this.
13658 (insert_eof_shifting_state, insert_accepting_state): New.
13659 (augment_automaton): Adjust.
13660 Better locality of the variables.
13661 When looking if the start_symbol is shifted from the initial
13662 state, using `while (... symbol != start_symbol ...)' sounds
13663 better than `while (... symbol < start_symbol ...)': If fail
13664 to see how the order between symbols could be relevant!
13665
78af9bbc
AD
136662001-12-10 Akim Demaille <akim@epita.fr>
13667
13668 * src/getargs.h: Don't declare `spec_name_prefix' and
13669 `spec_file_prefix', declared by src/files.h.
13670 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
13671 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
13672 * src/output.c (prepare): Adjust.
13673 * src/reader.c (symbols_output): Likewise.
13674 * src/vmsgetargs.c: Vaguely adjust, but who cares?
13675
bdef2a41
AD
136762001-12-10 Akim Demaille <akim@epita.fr>
13677
13678 * src/muscle_tab.c (muscle_init): NULL is a better default than
13679 `"0"'.
13680
3735969c
AD
136812001-12-10 Akim Demaille <akim@epita.fr>
13682
13683 * src/reader.c (reader): Calling symbols_output once is enough.
13684
49701457
AD
136852001-12-10 Akim Demaille <akim@epita.fr>
13686
13687 Now that states have a complete set of members, the linked list of
13688 reductions is useless: just fill directly the state's reductions
13689 member.
13690
13691 * src/state.h (struct reductions): Remove member `number' and
13692 `next'.
13693 * src/LR0.c (first_reduction, last_reduction): Remove.
13694 (save_reductions): Don't link the new reductions, store them in
13695 this_state.
13696 * src/lalr.c (set_state_table): No need to attach reductions to
13697 states, it's already done.
13698 * src/output.c (output_actions): No longer free the shifts, then
13699 the reductions, then the states: free all the states and their
13700 members.
13701
0edad749
AD
137022001-12-10 Akim Demaille <akim@epita.fr>
13703
13704 * src/options.c (OPTN, DRTV, BOTH): New.
13705 (option_table): Use them.
13706
0edad749
AD
13707 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
13708 the job of system.h.
13709 * src/options.c: Don't include stdio.h and xalloc.h for the same
13710 reasons.
13711
5449dd0f
AD
137122001-12-10 Akim Demaille <akim@epita.fr>
13713
13714 * src/output.c (output, prepare): Make sure the values of the
13715 muscles `action' and `prologue' are 0-terminated.
13716
a870c567
AD
137172001-12-10 Akim Demaille <akim@epita.fr>
13718
13719 Clean up GCC warnings.
13720
13721 * src/reader.c (copy_action): `buf' is not used.
13722 (parse_skel_decl): Be static.
13723 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
13724 * src/options.h (create_long_option_table): Have a real prototype.
13725 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
13726 (hash_delete_at): Return const void *.
13727 Adjust casts to preserve the const.
13728
80df8768
AD
137292001-12-10 Akim Demaille <akim@epita.fr>
13730
13731 * configure.in: Require 2.52g.
13732 M4 is not needed, but AUTOM4TE is.
13733 * m4/m4.m4: Remove.
13734 * tests/Makefile.am: Adjust.
13735
f693ad14
AD
137362001-12-10 Akim Demaille <akim@epita.fr>
13737
13738 One structure for states is enough, even though theoretically
13739 there are LR(0) states and LALR(1) states.
13740
13741 * src/lalr.h (state_t): Remove.
13742 (state_table): Be state_t **, not state_t *.
13743 * src/state.h (core, CORE_ALLOC): Rename as...
13744 (state_t, STATE_ALLOC): this.
13745 Add the LALR(1) members: shifts, reductions, errs.
13746 * src/LR0.c (state_table): Rename as...
13747 (state_hash): this, to avoid name clashes with the global
13748 `state_table'.
13749 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
13750 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
13751
74ffbcb6
AD
137522001-12-10 Akim Demaille <akim@epita.fr>
13753
13754 Bison dumps core on bash.y.
13755 Reported by Pascal Bart.
13756
13757 * src/warshall.c (bitmatrix_print): New.
13758 (TC): Use it.
ba0fe3c7 13759 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
13760 j must be the outer loop.
13761 * tests/regression.at (Broken Closure): New.
13762
07708e19
AD
137632001-12-05 Akim Demaille <akim@epita.fr>
13764
13765 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
13766 its argument.
ba1ecc07 13767 Reported by Peter Hamorsky.
07708e19 13768
92b16366
AD
137692001-12-05 Akim Demaille <akim@epita.fr>
13770
13771 * src/conflicts.c (err_table): Remove.
13772 (resolve_sr_conflict): Adjust.
13773 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
13774 Rename as...
13775 (state_t.reductions, state_t.shifts): this.
13776
076ab033
AD
137772001-12-05 Akim Demaille <akim@epita.fr>
13778
13779 * src/reduce.c (reduce_grammar_tables): No longer disable the
13780 removal of useless rules via CPP but via `if (0)', so that the
13781 compiler still check the code is valid.
13782 For instance, it should have noticed `rline' no longer exists: use
13783 the `line' member of rule_t.
13784 * src/gram.c (dummy, rline): Remove, unused.
13785
3843c413
AD
137862001-12-05 Akim Demaille <akim@epita.fr>
13787
13788 * src/output.c (pack_vector): Use assert, not berror.
13789 * src/main.c (berror): Remove, unused.
13790
43168960
AD
137912001-12-05 Akim Demaille <akim@epita.fr>
13792
13793 New experimental feature: if --verbose --trace output all the
13794 items of a state, not only its kernel.
13795
13796 * src/print.c (print_core): If `trace_flag', then invoke closure
13797 before outputting the items of the state (print_core is no longer
13798 a correct name them).
13799 (print_results): Invoke new_closure/free_closure if needed.
13800
b2872512
AD
138012001-12-05 Akim Demaille <akim@epita.fr>
13802
13803 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
13804 * src/closure.c, src/closure.h (itemsetsize): Rename as...
13805 (nitemset): for consistency with the rest of the project.
13806
23cbcc6c
AD
138072001-12-05 Akim Demaille <akim@epita.fr>
13808
13809 * src/closure.c (print_closure): Improve.
13810 (closure): Use it for printing input and output.
13811
03ec521c
AD
138122001-12-05 Akim Demaille <akim@epita.fr>
13813
13814 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
13815 indexed by nonterminals.
13816
3a7456dd
AD
138172001-12-05 Akim Demaille <akim@epita.fr>
13818
13819 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
13820 what it was!).
13821 * src/warshall.h: Remove accidental duplication of the content.
13822
1cbcf2e7
AD
138232001-12-05 Akim Demaille <akim@epita.fr>
13824
13825 * src/closure.c (set_fderives): De-obfuscate.
13826
84182270
AD
138272001-12-05 Akim Demaille <akim@epita.fr>
13828
13829 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
13830
3f6f053c
AD
138312001-12-05 Akim Demaille <akim@epita.fr>
13832
13833 * src/closure.c (set_firsts): De-obfuscate.
13834
7a5350ba
AD
138352001-12-05 Akim Demaille <akim@epita.fr>
13836
13837 * src/output.c (action_row): De-obfuscate
13838 using the good o' techniques: arrays not pointers, variable
13839 locality, BITISSET, RESETBIT etc.
13840
d954473d
AD
138412001-12-05 Akim Demaille <akim@epita.fr>
13842
13843 Pessimize the code to simplify it: from now on, all the states
13844 have a valid SHIFTS, which NSHIFTS is possibly 0.
13845
13846 * src/LR0.c (shifts_new): Be global and move to..
13847 * src/state.c, src/state.h: here.
13848 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
13849 * src/print_graph: Adjust.
13850
9839bbe5
AD
138512001-12-05 Akim Demaille <akim@epita.fr>
13852
13853 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
13854 * src/conflicts.c: Use it.
13855 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
13856 incorrectly ``simplified''.
13857
9f136c07
AD
138582001-12-05 Akim Demaille <akim@epita.fr>
13859
13860 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
13861 using the good o' techniques: arrays not pointers, variable
13862 locality, BITISSET, RESETBIT etc.
13863
b608206e
AD
138642001-12-05 Akim Demaille <akim@epita.fr>
13865
13866 * src/state.h (SHIFT_SYMBOL): New.
13867 * src/conflicts.c: Use it to deobfuscate.
13868
52afa962
AD
138692001-12-05 Akim Demaille <akim@epita.fr>
13870
13871 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
13872 (print_reductions): De-obfuscate using the good o' techniques:
13873 arrays not pointers, variable locality, BITISSET.
13874
e74dc321
AD
138752001-12-05 Akim Demaille <akim@epita.fr>
13876
13877 * src/conflicts.c (print_reductions): Arrays, not pointers.
13878 Use BITISSET.
13879
768fca83
AD
138802001-12-05 Akim Demaille <akim@epita.fr>
13881
13882 * src/conflicts.c (print_reductions): Pessimize, but clarify.
13883
a17e599f
AD
138842001-12-05 Akim Demaille <akim@epita.fr>
13885
13886 * src/conflicts.c (print_reductions): Improve variable locality.
13887
a04bc341
AD
138882001-12-05 Akim Demaille <akim@epita.fr>
13889
13890 * src/conflicts.c (print_reductions): Pessimize, but clarify.
13891
c8ea038e
AD
138922001-12-05 Akim Demaille <akim@epita.fr>
13893
13894 * src/conflicts.c (print_reductions): Improve variable locality.
13895
aa2aab3c
AD
138962001-12-05 Akim Demaille <akim@epita.fr>
13897
13898 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
13899 * src/lalr.c: Use them.
13900
b178c8cc
AD
139012001-12-05 Akim Demaille <akim@epita.fr>
13902
13903 * src/LR0.c (augment_automaton): Formatting changes.
13904 Better variable locality.
13905
f67d13aa
AD
139062001-12-05 Akim Demaille <akim@epita.fr>
13907
13908 * src/lalr.c (matrix_print): New.
13909 (transpose): Use it.
13910 Use arrays instead of pointers.
13911
c2713865
AD
139122001-12-05 Akim Demaille <akim@epita.fr>
13913
13914 * src/lalr.c (maxrhs): Move to...
13915 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
13916 * src/lalr.c (build_relations): Adjust.
13917
9887c18a
AD
139182001-12-05 Akim Demaille <akim@epita.fr>
13919
13920 * src/lalr.c (transpose): Free the memory allocated to the
13921 argument, as it is replaced by the results by the unique caller.
13922 (build_relations): Merely invoke transpose: it handles the memory
13923 deallocation.
13924 Improve variable locality.
13925 Avoid variables used as mere abbreviations.
13926 (compute_lookaheads): Use arrays instead of pointers.
13927
4d4f699c
AD
139282001-12-05 Akim Demaille <akim@epita.fr>
13929
13930 * src/lalr.c (initialize_F): Improve variable locality.
13931 Avoid variables used as mere abbreviations.
13932
80a69750
AD
139332001-12-05 Akim Demaille <akim@epita.fr>
13934
13935 * src/derives.c (print_derives): Display the ruleno.
13936 * src/lalr.c (initialize_F, transpose): Better variable locality
13937 to improve readability.
13938 Avoid variables used as mere abbreviations.
13939
fe961097
AD
139402001-12-05 Akim Demaille <akim@epita.fr>
13941
13942 * src/lalr.c (traverse): Use arrays instead of pointers.
13943
e3e4e814
AD
139442001-12-05 Akim Demaille <akim@epita.fr>
13945
13946 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
13947 the handling of squeue.
13948 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
13949
630e182b
AD
139502001-12-05 Akim Demaille <akim@epita.fr>
13951
13952 Because useless nonterminals are now kept alive (instead of being
13953 `destroyed'), we now sometimes examine them, and store information
13954 related to them. Hence we need to know their number, and adjust
13955 memory allocations.
13956
13957 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
13958 static.
13959 * src/LR0.c (allocate_itemsets): The memory allocated to
13960 `symbol_count' was used for two different purpose: once to count
13961 the number of occurrences of each symbol, and later reassigned to
13962 `shift_symbol', containing the symbol that can be shifted from a
13963 given state.
13964 Deobfuscate, i.e., allocate, use and free `symbol_count' here
13965 only, and...
13966 (new_itemsets): Allocate `shift_symbol' here.
13967 (allocate_itemsets): symbol_count includes useless nonterminals.
13968 Make room for them.
13969 (free_storage): Use `free', not `XFREE', for pointers that cannot
13970 be null.
13971
81b51460
AD
139722001-12-05 Akim Demaille <akim@epita.fr>
13973
13974 * src/nullable.c (set_nullable): Deobfuscate the handling of
13975 ritem.
13976 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
13977
3067fbef
AD
139782001-12-05 Akim Demaille <akim@epita.fr>
13979
13980 * src/gram.c, src/gram.h (ritem_print): New.
13981 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
13982 (This useless function was defined only to work around VMS linkers
13983 that can't handle compilation units with variables only).
13984 * src/reduce.c (dump_grammar): Use it to trace the construction of
13985 ritem.
13986
c2bea5f9
PE
139872001-12-04 Paul Eggert <eggert@twinsun.com>
13988
7d27c823
PE
13989 * src/bison.simple (union yyalloc): Change member names
13990 to be the same as the stack names.
13991 (yyparse): yyptr is now union yyalloc *, not char *.
13992 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
13993 and may generate better code on some machines.
c2bea5f9
PE
13994 (yystpcpy): Use prototype if __STDC__ is defined, not just
13995 if __cplusplus is defined.
35687a9d 13996
2c8a9dfa
AD
139972001-11-30 Akim Demaille <akim@epita.fr>
13998
13999 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
14000 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
14001 Gettext doesn't compile cleanly, and dies with -Werror.
14002 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
14003 Include WARNING_CFLAGS here.
14004 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
14005 before being defined.
14006
f4e421e6
AD
140072001-11-27 Paul Eggert <eggert@twinsun.com>
14008
14009 * lib/quotearg.h (quotearg_n, quotearg_n_style):
14010 First arg is int, not unsigned.
14011 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
14012 (SIZE_MAX, UINT_MAX): New macros.
14013 (quotearg_n_options): Abort if N is negative.
14014 Avoid overflow check on hosts where size_t is 64 bits and int
14015 is 32 bits, as overflow is impossible there.
14016 Fix off-by-one typo that caused unnecessary reallocation.
14017
7093d0f5
AD
140182001-11-29 Paul Eggert <eggert@twinsun.com>
14019
14020 Name space cleanup in generated parser.
14021
14022 * doc/bison.texinfo (Bison Parser): Discuss system headers
14023 and their effect on the user name space.
14024
14025 * src/bison.simple:
14026 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
14027 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
14028 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
14029
14030 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
14031 on user names when possible.
14032
14033 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
14034 Simplify test for whather <alloca.h> exists.
14035
14036 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
14037
14038 (<stdio.h>): Include if YYDEBUG.
14039
14040 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
14041 ! defined (yyoverflow) && ! defined (yymemcpy).
14042
14043 (yymemcpy, yyparse): Rename local variables as needed so that
14044 they all begin with 'yy'.
14045
14046 (yystrlen, yystpcpy): New functions.
14047
14048 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
14049 All uses changed.
14050
14051 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
14052 instead of relying on string.h functions. Use YYSTACK_ALLOC
14053 and YYSTACK_FREE instead of malloc and free.
14054
fd51e5ff
AD
140552001-11-30 Akim Demaille <akim@epita.fr>
14056
14057 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
14058 before their first uses.
14059 (YYBISON, YYPURE): Move to the top of the output.
14060
7d13ff5f
AD
140612001-11-30 Akim Demaille <akim@epita.fr>
14062
14063 * tests/reduce.at (Useless Nonterminals): Fix.
14064
892a3995
AD
140652001-11-30 Akim Demaille <akim@epita.fr>
14066
14067 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
14068 if body instead of `;' to pacify GCC's warnings.
14069
68f1e3ed
AD
140702001-11-30 Akim Demaille <akim@epita.fr>
14071
14072 Instead of mapping the LHS of unused rules to -1, keep the LHS
14073 valid, but flag the rules as invalid.
14074
14075 * src/gram.h (rule_t): `useful' is a new member.
14076 * src/print.c (print_grammar): Adjust.
14077 * src/derives.c (set_derives): Likewise.
14078 * src/reader.c (packgram, reduce_output): Likewise.
14079 * src/reduce.c (reduce_grammar_tables): Likewise.
14080 * tests/reduce.at (Underivable Rules, Useless Rules): New.
14081
d2d1b42b
AD
140822001-11-30 Akim Demaille <akim@epita.fr>
14083
14084 * src/reduce.c (reduce_output): Formatting changes.
14085 * src/print.c (print_results, print_grammar): Likewise.
14086 * tests/regression.at (Rule Line Numbers)
14087 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
14088
760b53a8
AD
140892001-11-30 Akim Demaille <akim@epita.fr>
14090
14091 * src/reduce.c (nonterminals_reduce): Instead of throwing away
14092 useless nonterminals, move them at the end of the symbol arrays.
14093 (reduce_output): Adjust.
14094 * tests/reduce.at (Useless Nonterminals): Adjust.
14095
00238958
AD
140962001-11-30 Akim Demaille <akim@epita.fr>
14097
14098 * src/reduce.c: Various comment/formatting changes.
14099 (nonterminals_reduce): New, extracted from...
14100 (reduce_grammar_tables): here.
14101 (reduce_grammar): Call nonterminals_reduce.
14102
396452de
PE
141032001-11-29 Paul Eggert <eggert@twinsun.com>
14104
14105 * src/bison.simple (YYSTACK_REALLOC): Remove.
14106 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
14107 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
14108 New macros.
14109 (union yyalloc): New type.
14110 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
14111 an arbitrary restriction on hosts where size_t is wider than int.
14112
14113 (yyparse): Don't dump core if alloca or malloc fails; instead, report
14114 a parser stack overflow. Allocate just one block of memory for all
14115 three stacks, instead of allocating three blocks; this typically is
14116 faster and reduces fragmentation.
14117
14118 Do not limit the number of items in the stack to a value that fits
14119 in 'int', as this is an arbitrary limit on hosts with 64-bit
14120 size_t and 32-bit int.
14121
147e184c
MA
141222001-11-29 Marc Autret <autret_m@epita.fr>
14123
14124 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
14125 of defining YYERROR_VERBOSE.
14126 [AT_DATA]: $4 is now out of C declarations in the prologue.
14127
426cf563
MA
141282001-11-28 Marc Autret <autret_m@epita.fr>
14129
14130 * src/reader.c (parse_dquoted_param): New.
14131 (parse_skel_decl): Use it.
14132 * src/lex.h: Add its prototype.
14133 * src/lex.c (literalchar): Become not static.
14134
c7925b99
MA
141352001-11-28 Marc Autret <autret_m@epita.fr>
14136
14137 * src/output.h: And put its extern declaration here.
14138 * src/output.c (error_verbose): Define here.
14139 (prepare): Echo name modification.
14140 * src/getargs.h: Clean its extern declaration.
14141 * src/getargs.c (error_verbose_flag): Remove.
14142 (getargs): Remove case 'e'.
14143 * src/options.c (option_table): 'error-verbose' is now seen as simple
14144 percent option.
14145 Include output.h.
14146
14147 * src/reader.c (read_declarations): Remove case tok_include.
14148 (parse_include_decl): Remove.
14149 * src/lex.h (token_t): Remove tok_include.
14150 * src/options.c (option_table): 'include' is now a simple command line
14151 option.
14152
5b5d1929
MA
141532001-11-28 Marc Autret <autret_m@epita.fr>
14154
14155 * src/bison.simple: Adjust muscle names.
14156 * src/muscle_tab.c (muscle_init): Also rename the muscles.
14157 * src/output.c (prepare): s/_/-/ for the muscles names.
14158 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
14159
8850be4b
MA
141602001-11-28 Marc Autret <autret_m@epita.fr>
14161
14162 * src/bison.simple: Fix debug.
14163 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
14164
4a38e613
AD
141652001-11-28 Akim Demaille <akim@epita.fr>
14166
14167 * src/LR0.c (shifts_new): New.
14168 (save_shifts, insert_start_shift, augment_automaton): Use it.
14169
4b35e1c1
AD
141702001-11-28 Akim Demaille <akim@epita.fr>
14171
14172 * src/closure.c (closure): `b' and `ruleno' denote the same value:
14173 keep ruleno only.
14174
d2b04478
AD
141752001-11-28 Akim Demaille <akim@epita.fr>
14176
14177 * src/closure.c (closure): Instead of looping over word in array
14178 then bits in words, loop over bits in array.
14179
2c4c30aa
AD
141802001-11-28 Akim Demaille <akim@epita.fr>
14181
14182 * src/closure.c (closure): No longer optimize the special case
14183 where all the bits of `ruleset[r]' are set to 0, to make the code
14184 clearer.
14185
576890b7
AD
141862001-11-28 Akim Demaille <akim@epita.fr>
14187
14188 * src/closure.c (closure): `r' and `c' are new variables, used to
14189 de-obfuscate accesses to RULESET and CORE.
14190
cb487d7d
AD
141912001-11-28 Akim Demaille <akim@epita.fr>
14192
14193 * src/reduce.c (reduce_print): Use ngettext.
14194 (dump_grammar): Improve the trace accuracy.
14195
6013d43f
AD
141962001-11-28 Akim Demaille <akim@epita.fr>
14197
14198 * src/reduce.c (dump_grammar): Don't translate trace messages.
14199
cb4956ee
AD
142002001-11-28 Akim Demaille <akim@epita.fr>
14201
14202 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
14203 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
14204 as all tags are free'ed afterwards.
14205 From Enrico Scholz.
14206
648185ab
PE
142072001-11-27 Paul Eggert <eggert@twinsun.com>
14208
14209 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
14210 use alloca when we didn't want to, and vice versa.
14211
68254a03
MA
142122001-11-27 Marc Autret <autret_m@epita.fr>
14213
9113b58f
AD
14214 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
14215 initialization.
68254a03
MA
14216 * src/output.c (prepare): Remove its update.
14217
04d843a2
MA
142182001-11-27 Marc Autret <autret_m@epita.fr>
14219
14220 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
14221 Use %error-verbose.
14222
d2079671 142232001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
14224
14225 * src/bison.simple: Remove YYERROR_VERBOSE using.
14226 Use %%error_verbose.
14227 (yyparse): Likewise.
14228 * src/output.c (prepare): Give its final value.
14229 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
14230 * src/getargs.h: Add its extern declaration.
14231 * src/getargs.c (error_verbose_flag): New int.
14232 (getargs): Update to catch new case.
14233 * src/options.c (option_table): 'error-verbose' is a new option.
14234 (shortopts): Update.
14235
e0327bc8
AD
142362001-11-27 Akim Demaille <akim@epita.fr>
14237
14238 * src/system.h: Use intl/libgettext.h.
14239 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
14240
000f1a3c
AD
142412001-11-27 Akim Demaille <akim@epita.fr>
14242
14243 * tests/torture.at (Exploding the Stack Size with Malloc):
14244 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
14245
26cfe0be
AD
142462001-11-27 Akim Demaille <akim@epita.fr>
14247
14248 * src/files.c: Include error.h.
14249 Reported by Hans Aberg.
14250
f6bd5427
MA
142512001-11-26 Marc Autret <autret_m@epita.fr>
14252
d2079671 14253 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
14254 (read_declarations): Add case tok_include.
14255 * src/getargs.h (include): Add its extern definition.
14256 * src/getargs.c (include): New const char *.
14257 (getargs): Add case '-I'.
14258 * src/options.c (option_table): Add include as command line and
14259 percent option.
14260 * src/lex.h (token_t): Add tok_include.
14261
2ca209c1
AD
142622001-11-26 Akim Demaille <akim@epita.fr>
14263
14264 * src/reader.c (readgram): Make sure rules for mid-rule actions
14265 have a lineno equal to that of their host rule.
14266 Reported by Hans Aberg.
14267 * tests/regression.at (Rule Line Numbers): New.
14268
0e41b407
AD
142692001-11-26 Akim Demaille <akim@epita.fr>
14270
14271 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
14272 size_ts.
14273
142742001-11-26 Akim Demaille <akim@epita.fr>
14275
14276 * src/complain.c, src/complain.h (error): Remove, provided by
14277 lib/error.[ch].
14278
e0c40012
AD
142792001-11-26 Akim Demaille <akim@epita.fr>
14280
14281 * src/reader.c (read_declarations): Don't abort on tok_illegal,
14282 issue an error message.
14283 * tests/regression.at (Invalid %directive): New.
14284 Reported by Hans Aberg.
14285
5e147124
AD
142862001-11-26 Akim Demaille <akim@epita.fr>
14287
14288 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
14289 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
14290
a034c8b8
AD
142912001-11-26 Akim Demaille <akim@epita.fr>
14292
14293 * src/conflicts.c (conflicts_print): Don't complain at all when
14294 there are no reduce/reduce conflicts, and as many shift/reduce
14295 conflicts as expected.
14296 * tests/regression.at (%expect right): Adjust.
14297
c64a20f3
AD
142982001-11-23 Akim Demaille <akim@epita.fr>
14299
14300 * lib/alloca.c: Update, from fileutils.
14301
5b0d29bb
AD
143022001-11-23 Akim Demaille <akim@epita.fr>
14303
14304 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
14305
722c4bfe
AD
143062001-11-23 Akim Demaille <akim@epita.fr>
14307
14308 * src/system.h: Include alloca.h.
14309 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
14310
6255b435
AD
143112001-11-23 Akim Demaille <akim@epita.fr>
14312
14313 * src/print_graph.c (print_actions): Remove `rule', unused.
14314 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
14315 pacify GCC's signed < unsigned warnings.
14316 * src/closure.c (itemsetsize): Likewise.
14317 * src/reader.c (symbol_list_new): Static.
14318
b29b2ed5
AD
143192001-11-23 Akim Demaille <akim@epita.fr>
14320
14321 Attaching lineno to buckets is stupid, since only one copy of each
14322 symbol is kept, only the line of the first occurrence is kept too.
14323
14324 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
14325 * src/reader.c (rline_allocated): Remove, unused.
14326 (symbol_list): Have a `line' member.
14327 (symbol_list_new): New.
14328 (readgram): Use it.
14329 * src/print.c (print_grammar): Output the rule line numbers.
14330 * tests/regression.at (Solved SR Conflicts)
14331 (Unresolved SR Conflicts): Adjust.
14332 Reported by Hans Aberg.
14333
a81b1d4a
MA
143342001-11-22 Marc Autret <autret_m@epita.fr>
14335
14336 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
14337
c1ecb3c1
MA
143382001-11-22 Marc Autret <autret_m@epita.fr>
14339
14340 * src/muscle_tab.c (muscle_init): Remove initialization of
14341 skeleton muscle.
14342 * src/output.c (output_master_parser): Do it here.
14343
fbe01355
AD
143442001-11-20 Akim Demaille <akim@epita.fr>
14345
14346 * po/sv.po: New.
14347 * configure.in (ALL_LINGUAS): Adjust.
14348 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
14349 longer contains strings to translate.
14350
81e895c0
AD
143512001-11-19 Akim Demaille <akim@epita.fr>
14352
14353 * src/conflicts.c (conflicts_print): Add a missing \n.
14354
6bb1878b
AD
143552001-11-19 Akim Demaille <akim@epita.fr>
14356
14357 * src/nullable.c (nullable_print): New.
14358 (set_nullable): Call it when tracing.
14359 Better locality of variables.
14360
d9ec2d07
AD
143612001-11-19 Akim Demaille <akim@epita.fr>
14362
14363 * src/print.c (print_actions): Better locality of variables.
14364
720e5c1b
AD
143652001-11-19 Akim Demaille <akim@epita.fr>
14366
14367 * src/derives.c (print_derives): Fix and enrich.
14368 * src/closure.c (print_fderives): Likewise.
14369
fb908786
AD
143702001-11-19 Akim Demaille <akim@epita.fr>
14371
14372 * src/closure.c (itemsetend): Remove, replaced with...
14373 (itemsetsize): new.
14374
125ecb56
AD
143752001-11-19 Akim Demaille <akim@epita.fr>
14376
14377 * src/LR0.c (kernel_end): Remove, replaced with...
14378 (kernel_size): new.
14379
d8cf039f
AD
143802001-11-19 Akim Demaille <akim@epita.fr>
14381
14382 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
14383 to clarify.
14384
7bec0760
AD
143852001-11-19 Akim Demaille <akim@epita.fr>
14386
14387 * src/closure.c (closure): Use arrays instead of pointers to clarify.
14388
c87d4863
AD
143892001-11-19 Akim Demaille <akim@epita.fr>
14390
14391 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
14392 trace messages.
14393 * src/LR0.c: Likewise.
14394 (allocate_itemsets): Use arrays instead of pointers to clarify.
14395
9bfe901c
AD
143962001-11-19 Akim Demaille <akim@epita.fr>
14397
14398 * src/getargs.c (statistics_flag): Replace with...
14399 (trace_flag): New.
14400 (longopts): Accept --trace instead of --statistics.
14401 * src/getargs.h, src/options.c: Adjust.
14402 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
14403 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
14404
97db7bd4
AD
144052001-11-19 Akim Demaille <akim@epita.fr>
14406
cc72668c 14407 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
14408 pointers to clarify the code.
14409 (save_reductions, save_shifts): Factor common parts of alternatives.
14410
2c5f66ed
AD
144112001-11-19 Akim Demaille <akim@epita.fr>
14412
14413 * src/LR0.c (new_state, get_state): Complete TRACE code.
14414 * src/closure.c: Include `reader.h' to get `tags', needed by the
14415 trace code.
14416 Rename the conditional DEBUG as TRACE.
14417 Output consistently TRACEs to stderr, not stdout.
14418 * src/derives.c: Likewise.
14419 * src/reduce.c: (inaccessable_symbols): Using if is better style
14420 than goto.
14421 Use `#if TRACE' instead of `#if 0' for tracing code.
14422
300f275f
AD
144232001-11-19 Akim Demaille <akim@epita.fr>
14424
14425 * src/system.h (LIST_FREE, shortcpy): New.
14426 * src/LR0.c: Use them.
14427 * src/output.c (free_itemsets, free_reductions, free_shifts):
14428 Remove, replaced by LIST_FREE.
14429
f59c437a
AD
144302001-11-19 Akim Demaille <akim@epita.fr>
14431
14432 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
14433 (REDUCTIONS_ALLOC): New.
14434 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
14435 allocation.
14436
6986fd9e
AD
144372001-11-19 Akim Demaille <akim@epita.fr>
14438
14439 * src/LR0.c (new_state): Complete trace code.
14440 * src/nullable.c (set_nullable): Don't translate traces.
14441
4bc30f78
AD
144422001-11-19 Akim Demaille <akim@epita.fr>
14443
14444 * src/print_graph.c (print_core): Better locality of variables.
14445 * src/print.c (print_core): Likewise.
14446
08a946e0
AD
144472001-11-19 Akim Demaille <akim@epita.fr>
14448
14449 * src/vcg.c: You do the output, so you are responsible of the
14450 handling of VCG syntax, in particular: use quotearg.
14451 * src/print_graph.c: Don't.
14452 (print_actions): Don't output the actions as part of the nodes,
14453 since that's the job of the edges.
14454 (print_state): Don't output by hand: fill the node description,
9bfe901c 14455 and ask for its output.
08a946e0 14456
f0473484
AD
144572001-11-19 Akim Demaille <akim@epita.fr>
14458
cc72668c
AD
14459 * src/bison.simple (yyparse): When verbosely reporting an error,
14460 no longer put additional quotes around token names.
f0473484
AD
14461 * tests/calc.at: Adjust.
14462
e41dc700
AD
144632001-11-19 Akim Demaille <akim@epita.fr>
14464
14465 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
14466 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
14467 * src/output.c: Adjust.
14468
652a871c
AD
144692001-11-19 Akim Demaille <akim@epita.fr>
14470
14471 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
14472 (rule_t): this.
14473 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
14474
b2ed6e58
AD
144752001-11-19 Akim Demaille <akim@epita.fr>
14476
14477 * src/gram.h (rule_t): New.
14478 (rule_table): New.
14479 (rrhs, rlhs): Remove, part of state_t.
14480 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
14481 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14482 * src/reader.c, src/reduce.c: Adjust.
14483
edad7067
AD
144842001-11-19 Akim Demaille <akim@epita.fr>
14485
14486 * src/reader.c (symbols_output): New, extracted from...
14487 (packsymbols): Here.
14488 (reader): Call it.
14489
3feec034
AD
144902001-11-19 Akim Demaille <akim@epita.fr>
14491
14492 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
14493 (maxrhs): this new function.
14494
ddcd5fdf
AD
144952001-11-19 Akim Demaille <akim@epita.fr>
14496
cc72668c 14497 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
14498 Adjust.
14499
bb527fc2
AD
145002001-11-19 Akim Demaille <akim@epita.fr>
14501
cc72668c 14502 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
14503 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14504 * src/lalr.c: Adjust.
14505
a845a697
AD
145062001-11-19 Akim Demaille <akim@epita.fr>
14507
14508 * src/lalr.c (initialize_LA): Only initialize LA. Let...
14509 (set_state_table): handle the `lookaheads' members.
14510
f004bf6a
AD
145112001-11-19 Akim Demaille <akim@epita.fr>
14512
cc72668c
AD
14513 * src/lalr.h (lookaheads): Removed array, whose contents is now
14514 a member of...
f004bf6a
AD
14515 (state_t): this structure.
14516 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14517 Adjust.
14518
de326cc0
AD
145192001-11-19 Akim Demaille <akim@epita.fr>
14520
cc72668c
AD
14521 * src/lalr.h (consistent): Removed array, whose contents is now
14522 a member of...
de326cc0
AD
14523 (state_t): this structure.
14524 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14525 Adjust.
14526
90b4416b
AD
145272001-11-19 Akim Demaille <akim@epita.fr>
14528
cc72668c
AD
14529 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
14530 contents are now members of...
90b4416b
AD
14531 (state_t): this structure.
14532 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14533 Adjust.
14534
9703cc49
AD
145352001-11-19 Akim Demaille <akim@epita.fr>
14536
14537 * src/lalr.h (state_t): New.
14538 (state_table): Be a state_t * instead of a core **.
14539 (accessing_symbol): Remove, part of state_t.
14540 * src/lalr.c: Adjust.
14541 (set_accessing_symbol): Merge into...
14542 (set_state_table): this.
14543 * src/print_graph.c, src/conflicts.c: Adjust.
14544
d803322e
AD
145452001-11-14 Akim Demaille <akim@epita.fr>
14546
14547 * tests/calc.at, tests/output.at, tests/regression.at,
14548 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
14549 now the tests are run in private dirs, therefore AC_CLEANUP and
14550 family can be simplified to 0-ary.
14551 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
14552 use abs. path to find config.h.
14553 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
14554 stderr, there can be way too much random noise.
14555 Instead pass -Werror to GCC and rely on the exit status.
14556 Reported by Wolfram Wagner.
14557
3d76b07d
AD
145582001-11-14 Akim Demaille <akim@epita.fr>
14559
14560 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
14561 defined only if yyoverflow is defined, to avoid `warning: unused
14562 variable `yyvs1''.
14563 Reported by The Test Suite.
14564
09b503c8
AD
145652001-11-14 Akim Demaille <akim@epita.fr>
14566
14567 * src/print.c: Include reduce.h.
14568 Reported by Hans Aberg.
14569
145702001-11-14 Akim Demaille <akim@epita.fr>
14571
14572 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
14573 Revert a previous patch: these are really const.
14574 * src/conflicts.c (conflict_report): Additional useless pair of
14575 braces to pacify GCC's warnings for `if () if () {} else {}'.
14576 * src/lex.c (parse_percent_token): Replace equal_offset with
14577 arg_offset.
14578 arg is const.
14579 Be sure to strdup `arg' when used, since there is no reason for
14580 token_buffer not to change.
14581
0f37a994
AD
145822001-11-14 Akim Demaille <akim@epita.fr>
14583
14584 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
14585 definition.
14586 * src/main.c (main): Use them.
14587 Suggested by Hans Aberg.
14588
d39d93b8
AD
145892001-11-12 Akim Demaille <akim@epita.fr>
14590
14591 * src/system.h (ngettext): Now that we use ngettext, be sure to
14592 provide a default definition when NLS are not used.
14593
9edcd895
AD
145942001-11-12 Akim Demaille <akim@epita.fr>
14595
14596 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
14597 Use @kbd to denote user input.
14598 (Language and Grammar): ANSIfy the example.
14599 Adjust its layout for info/notinfo.
14600 (Location Tracking Calc): Output error messages to stderr.
14601 Output locations in a more GNUtically correct way.
14602 Fix a couple of Englishos.
14603 Adjust @group/@end group pairs.
14604
7da99ede
AD
146052001-11-12 Akim Demaille <akim@epita.fr>
14606
e3aa65c5 14607 %expect was not functioning at all.
7da99ede
AD
14608
14609 * src/conflicts.c (expected_conflicts): Set to -1.
14610 (conflict_report): Use ngettext.
14611 (conflicts_print): Check %expect and make its violation an error.
14612 * doc/bison.texinfo (Expect Decl): Adjust.
14613 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
14614 * tests/regression.at (%expect not enough, %expect right)
14615 (%expect too much): New.
14616
ba9dda1a
AD
146172001-11-12 Akim Demaille <akim@epita.fr>
14618
14619 * tests/regression.at (Conflicts): Rename as...
14620 (Unresolved SR Conflicts): this.
14621 (Solved SR Conflicts): New.
14622
337c5bd1
AD
146232001-11-12 Akim Demaille <akim@epita.fr>
14624
14625 * src/reduce.c (print_results): Rename as...
14626 (reduce_output): This.
14627 Output to OUT, passed as argument, instead of output_obstack.
14628 (dump_grammar): Likewise.
14629 (reduce_free): New.
14630 Also free V1.
14631 (reduce_grammar): No longer call reduce_output, since...
14632 * src/print.c (print_results): do it.
14633 * src/main.c (main): Call reduce_free;
14634
c73a41af
AD
146352001-11-12 Akim Demaille <akim@epita.fr>
14636
14637 * src/conflicts.c (print_reductions): Accept OUT as argument.
14638 Output to it, not to output_obstack.
14639 * src/print.c (print_actions): Adjust.
14640
0df87bb6
AD
146412001-11-12 Akim Demaille <akim@epita.fr>
14642
14643 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
14644 the result instead of using...
14645 (src_total, rrc_total, src_count, rrc_count): Remove.
14646 (any_conflicts): Remove.
14647 (print_conflicts): Split into...
14648 (conflicts_print, conflicts_output): New.
14649 * src/conflicts.h: Adjust.
14650 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 14651 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
14652 * tests/regression.at (Conflicts): New.
14653 Reported by Tom Lane.
14654
e4d3d4de
AD
146552001-11-12 Akim Demaille <akim@epita.fr>
14656
14657 * tests/regression.at (Invalid input): Remove, duplicate with
14658 ``Invalid input: 1''.
14659
6d7d248e
AD
146602001-11-12 Akim Demaille <akim@epita.fr>
14661
14662 * tests/torture.at (AT_DATA_STACK_TORTURE)
14663 (Exploding the Stack Size with Alloca)
14664 (Exploding the Stack Size with Malloc): New.
14665
e9e4c321
AD
146662001-11-12 Akim Demaille <akim@epita.fr>
14667
14668 * src/bison.simple (YYSTACK_REALLOC): New.
14669 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 14670 Reported by Per Allansson.
e9e4c321 14671
5f7e0832
AD
146722001-11-12 Pascal Bart <pascal.bart@epita.fr>
14673
14674 * src/bison.simple: Define type yystype instead of YYSTYPE, and
14675 define CPP macro, which substitute YYSTYPE by yystype.
14676 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
14677 with yyltype/YYLTYPE. This allows inclusion of the generated
14678 header within the parser if the compiler, such as GGC, accepts
14679 multiple equivalent #defines.
14680 From Akim.
14681
e3f1699f
AD
146822001-11-05 Akim Demaille <akim@epita.fr>
14683
14684 * src/reader.c (symbols_output): New, extracted from...
14685 (packsymbols): here.
14686 (reader): Adjust.
14687
65be0866
AD
146882001-11-05 Akim Demaille <akim@epita.fr>
14689
14690 * src/lex.c (parse_percent_token): s/quotearg/quote/.
14691
e4d910bf
AD
146922001-11-05 Akim Demaille <akim@epita.fr>
14693
14694 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
14695 pattern.
14696
951366c1
AD
146972001-11-05 Akim Demaille <akim@epita.fr>
14698
14699 * src/options.h (struct option_table_struct): set_flags is void*.
14700 * src/options.c (longopts): Support `--output' and `%output'.
14701 (usage): Adjust.
14702 * src/lex.h (tok_setopt): Remove, replaced with...
14703 (tok_intopt, tok_stropt): these new guys.
14704 * src/lex.c (getopt.h): Not needed.
14705 (token_buffer, unlexed_token_buffer): Not const.
14706 (percent_table): Promote `-' over `_' in directive names.
14707 Active `%name-prefix', `file-prefix', and `output'.
14708 (parse_percent_token): Accept possible arguments to directives.
14709 Promote `-' over `_' in directive names.
14710
d8988b2f
AD
147112001-11-04 Akim Demaille <akim@epita.fr>
14712
14713 * doc/bison.texinfo (Decl Summary): Split the list into
14714 `directives for grammars' and `directives for bison'.
14715 Sort'em.
14716 Add description of `%name-prefix', `file-prefix', and `output'.
14717 Promote `-' over `_' in directive names.
14718 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
14719 Simplify the description of `--name-prefix'.
14720 Promote `-' over `_' in directive names.
14721 Promote `--output' over `--output-file'.
14722 Fix the description of `--defines'.
14723 * tests/output.at: Exercise %file-prefix and %output.
14724
6468d18e
AD
147252001-11-02 Akim Demaille <akim@epita.fr>
14726
14727 * doc/refcard.tex: Update.
14728
6b7e85b9
AD
147292001-11-02 Akim Demaille <akim@epita.fr>
14730
14731 * src/symtab.h (SUNDEF): New.
14732 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
14733 stand for `uninitialized', instead of 0.
14734 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
14735 * src/lex.c (lex): Adjust.
14736
14737 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
14738 Number it 0.
14739 Let yylex return it instead of a plain 0.
14740 Reported by Dick Streefland.
14741
cd5aafcf
AD
147422001-11-02 Akim Demaille <akim@epita.fr>
14743
14744 * tests/regression.at (Mixing %token styles): New test.
14745
037ca2f1
AD
147462001-11-02 Akim Demaille <akim@epita.fr>
14747
14748 * src/reader.c (parse_thong_decl): Formatting changes.
14749 (token_translations_init): New, extracted from...
14750 (packsymbols): Here.
14751 Adjust.
14752
270a173c
AD
147532001-11-01 Akim Demaille <akim@epita.fr>
14754
14755 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
14756 Check that `9foo.y' produces correct cpp guards.
14757 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
14758 guards.
14759 Reported by Wwp.
14760
561f9a30
AD
147612001-11-01 Akim Demaille <akim@epita.fr>
14762
14763 * tests/regression.at (Invalid input: 2): New.
14764 * src/lex.c (unlexed_token_buffer): New.
14765 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
14766 too.
14767 Reported by Wwp.
14768
f987e9d2
AD
147692001-11-01 Akim Demaille <akim@epita.fr>
14770
14771 * tests/calc.at: Catch up with 1.30.
14772 * configure.in: Bump to 1.49a.
14773 Adjust to newer Autotest.
14774
0846f581
PB
147752001-10-19 Pascal Bart <pascal.bart@epita.fr>
14776
14777 * src/conflicts.c: Move global variables rrc_total and src_total ...
14778 (print_conflicts): here.
14779 * src/output.c (output): Free global variable user_toknums.
14780 * src/lex.c (token_obstack): Become static.
14781
3c1a79b3
AD
147822001-10-18 Akim Demaille <akim@epita.fr>
14783
14784 * tests/atlocal.in (GCC): Add.
14785 * tests/calc.at: s/m4_match/m4_bmatch/.
14786 s/m4_patsubst/m4_bpatsubst/.
14787 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
14788 * configure.in: AC_SUBST(GCC).
14789
5d52e7d0
MA
147902001-10-14 Marc Autret <autret_m@epita.fr>
14791
14792 * src/options.c (create_long_option_table): Fix.
14793
631aa1d3
AD
147942001-10-10 Akim Demaille <akim@epita.fr>
14795
14796 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
14797
f6ec6d13
AD
147982001-10-04 Akim Demaille <akim@epita.fr>
14799
14800 * src/reader.c (parse_union_decl): Push the caracters in
14801 union_obstack, not attrs_obstack.
14802
342b8b6e
AD
148032001-10-04 Akim Demaille <akim@epita.fr>
14804
14805 Merge in the branch 1.29.
14806
14807 * src/reader.c (packsymbols): Use a temporary obstack for
14808 `%%tokendef', since output_stack is already used elsewhere.
14809
14810 2001-10-02 Akim Demaille <akim@epita.fr>
14811
14812 Bump 1.29d.
14813
14814 2001-10-02 Akim Demaille <akim@epita.fr>
14815
14816 Version 1.29c.
14817
14818 2001-10-02 Akim Demaille <akim@epita.fr>
14819
14820 * tests/regression.at (Invalid CPP headers): New.
14821 From Alexander Belopolsky.
14822 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
14823
14824 2001-10-02 Akim Demaille <akim@epita.fr>
14825
14826 * tests/regression.at (Invalid input): New.
14827 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
14828 Reported by Shura.
14829
14830 2001-10-02 Akim Demaille <akim@epita.fr>
14831
14832 * tests/calc.at: Now that --debug works, the tests must be adjusted.
14833
14834 2001-10-02 Akim Demaille <akim@epita.fr>
14835
14836 * src/output.c (output_parser): Assert `skeleton'.
14837 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
14838 systems.
14839 From Shura.
14840
14841 2001-10-01 Marc Autret <autret_m@epita.fr>
14842
14843 * src/lex.h: Echo modifications.
14844 * src/lex.c (unlex): Parameter is now token_t.
14845 From Hans Aberg.
14846
14847 2001-10-01 Marc Autret <autret_m@epita.fr>
14848
14849 * src/main.c: Include lex.h.
14850 From Hans Aberg.
14851
14852 2001-09-29 Akim Demaille <akim@epita.fr>
14853
14854 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
14855
14856 2001-09-28 Akim Demaille <akim@epita.fr>
14857
14858 * tests/testsuite.at: Update to newer Autotest.
14859 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
14860
14861 2001-09-27 Akim Demaille <akim@epita.fr>
14862
14863 Position independent wrapper.
14864
14865 * tests/bison: Remove.
14866 * tests/bison.in: New.
14867 * configure.in: Adjust.
14868
14869 2001-09-27 Paul Eggert <eggert@twinsun.com>
14870
14871 Port quotearg fixes from tar 1.13.24.
14872
14873 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
14874 tm to be declared.
14875 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
14876 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
14877
14878 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
14879 * m4/mbrtowc.m4: New file.
14880 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
14881 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
14882
14883 2001-09-27 Akim Demaille <akim@epita.fr>
14884
14885 Bump to 1.29c.
14886
14887 2001-09-27 Akim Demaille <akim@epita.fr>
14888
14889 Version 1.29b.
14890
14891 2001-09-25 Akim Demaille <akim@epita.fr>
14892
14893 * src/system.h: Include `xalloc.h'.
14894 Remove it from the C files.
14895 * src/files.c (output_files): Free the obstacks.
14896 * src/lex.c (init_lex): Rename as...
14897 (lex_init): this.
14898 (lex_free): New.
14899 * src/main.c (main): Use it.
14900
14901 2001-09-24 Marc Autret <autret_m@epita.fr>
14902
14903 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
14904 to output informations in fout (FILE*).
14905 (open_graph, close_graph): Likewise.
14906 (output_graph, output_edge, output_node): Likewise.
14907 * src/vcg.h: Update function prototypes.
14908 * src/print_graph.c (print_graph): Open output graph file.
14909 (print_actions): Adjust.
14910 * src/files.h: Remove extern declaration.
14911 * src/files.c: Remove graph_obstack declaration.
14912 (open_files): Remove graph_obstack initialization.
14913 (output_files): Remove graph_obstack saving.
14914
14915 2001-09-24 Marc Autret <autret_m@epita.fr>
14916
14917 * src/files.c (compute_output_file_names): Fix.
14918
14919 2001-09-24 Marc Autret <autret_m@epita.fr>,
14920 Akim Demaille <akim@epita.fr>
14921
14922 * src/reader.c (reader): Remove call to free_symtab ().
14923 * src/main.c (main): Call it here.
14924 Include symtab.h.
14925 * src/conflicts.c (initialize_conflicts): Rename as...
14926 (solve_conflicts): this.
14927 * src/print.c (print_core, print_actions, print_state)
14928 (print_grammar): Dump to a file instead a `output_obstack'.
14929 (print_results): Dump `output_obstack', and then proceed with the
14930 FILE *.
14931 * src/files.c (compute_output_file_names, close_files): New.
14932 (output_files): Adjust.
14933 * src/main.c (main): Adjust.
14934
14935 2001-09-23 Marc Autret <autret_m@epita.fr>
14936
14937 * src/files.c (compute_header_macro): Computes header macro name
14938 from spec_defines_file when given.
14939
14940 2001-09-23 Marc Autret <autret_m@epita.fr>
14941
14942 * src/files.c (output_files): Add default extensions.
14943
14944 2001-09-22 Akim Demaille <akim@epita.fr>
14945
14946 * src/conflicts.c (finalize_conflicts): Rename as...
14947 (free_conflicts): this.
14948
14949 2001-09-22 Akim Demaille <akim@epita.fr>
14950
14951 * src/gram.c (gram_free): Rename back as...
14952 (dummy): this.
14953 (output_token_translations): Free `token_translations'.
14954 * src/symtab.c (free_symtab): Free the tag field.
14955
14956 2001-09-22 Akim Demaille <akim@epita.fr>
14957
14958 Remove `translations' as it is always set to true.
14959
14960 * src/gram.h: Adjust.
14961 * src/reader.c (packsymbols, parse_token_decl): Adjust
14962 * src/print.c (print_grammar): Adjust.
14963 * src/output.c (output_token_translations): Adjust.
14964 * src/lex.c (lex): Adjust.
14965 * src/gram.c: Be sure the set pointers to NULL.
14966 (dummy): Rename as...
14967 (gram_free): this.
14968
14969 2001-09-22 Akim Demaille <akim@epita.fr>
14970
14971 * configure.in: Invoke AM_LIB_DMALLOC.
14972 * src/system.h: Use dmalloc.
14973 * src/LR0.c: Be sure to have pointers initialized to NULL.
14974 (allocate_itemsets): Allocate kernel_items only if needed.
14975
14976 2001-09-22 Akim Demaille <akim@epita.fr>
14977
14978 * configure.in: Bump to 1.29b.
14979 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
14980 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
14981 need xmalloc.c in calc.y.
14982 From Pascal Bart.
14983
14984 2001-09-21 Akim Demaille <akim@epita.fr>
14985
14986 Version 1.29a.
14987 * Makefile.maint, config/config.guess, config/config.sub,
14988 * config/missing: Update from masters.
14989 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
14990 upon package.m4.
14991 * configure.in (ALL_LINGUAS): Add `tr'.
14992
14993 2001-09-21 Akim Demaille <akim@epita.fr>
14994
14995 * tests/Makefile.am (package.m4): Move to...
14996 ($(srcdir)/$(TESTSUITE)): here.
14997
14998 2001-09-20 Akim Demaille <akim@epita.fr>
14999
15000 * src/complain.c: No longer try to be standalone: use system.h.
15001 Don't assume __STDC__ is defined to 1. Just test if it is defined.
15002 * src/complain.h: Likewise.
15003 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
15004 Remove the unused variable `n'.
15005 From Albert Chin-A-Young.
15006
15007 2001-09-18 Marc Autret <autret_m@epita.fr>
15008
15009 * doc/bison.1: Update.
15010 * doc/bison.texinfo (Bison Options): Update --defines and --graph
15011 descriptions.
15012 (Option Cross Key): Update.
15013 Add --graph.
15014
15015 2001-09-18 Marc Autret <autret_m@epita.fr>
15016
15017 * tests/regression.at: New test (comment in %union).
15018
15019 2001-09-18 Marc Autret <autret_m@epita.fr>
15020
15021 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
15022 do that.
15023 Reported by Keith Browne.
15024
15025 2001-09-18 Marc Autret <autret_m@epita.fr>
15026
15027 * tests/output.at: Add tests for --defines and --graph.
15028
15029 2001-09-18 Marc Autret <autret_m@epita.fr>
15030
15031 * tests/output.at: Removes tests of %{header,src}_extension features.
15032
15033 2001-09-18 Akim Demaille <akim@epita.fr>
15034
15035 * tests/Makefile.am (package.m4): New.
15036 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
15037 (_AT_CHECK_CALC_ERROR): Likewise.
15038 Factor the `, ' part of verbose error messages.
15039
15040 2001-09-18 Marc Autret <autret_m@epita.fr>
15041
15042 * src/getargs.c (longopts): Declare --defines and --graph as options
15043 with optional arguments.
15044 * src/files.h: Add extern declarations.
15045 * src/files.c (spec_graph_file, spec_defines_file): New.
15046 (output_files): Update.
15047 Remove CPP-outed code.
15048
15049 2001-09-18 Marc Autret <autret_m@epita.fr>
15050
15051 Turn off %{source,header}_extension feature.
15052
15053 * src/files.c (compute_exts_from_gf): Update.
15054 (compute_exts_from_src): Update.
15055 (output_files): CPP-out useless code.
15056 * src/files.h: Remove {header,source}_extension extern declarations.
15057 * src/reader.c (parse_dquoted_param): CPP-out.
15058 (parse_header_extension_decl): Remove.
15059 (parse_source_extension_decl): Remove.
15060 (read_declarations): Remove cases tok_{hdrext,srcext}.
15061 * src/lex.c (percent_table): Remove {header,source}_extension entries.
15062 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
15063
15064 2001-09-10 Akim Demaille <akim@epita.fr>
15065
15066 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
15067 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
15068 (AT_CHECK_OUTPUT): this.
15069 Merely check ls' exit status, its output is useless.
15070
15071 2001-09-10 Akim Demaille <akim@epita.fr>
15072
15073 * tests/calc.at: Use m4_match.
15074 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
15075
15076 2001-09-10 Marc Autret <autret_m@epita.fr>,
15077 Akim Demaille <akim@epita.fr>
15078
15079 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
15080 enum color_e.
15081 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
15082 to `normal'.
15083 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
15084 * src/lex.h: Adjust prototype.
15085 (token_t): Add `tok_undef'.
15086 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
15087 (parse_percent_token): Now returns token_t.
15088 Add default statement in switch.
15089 (lex): Separate `c' as an input variable, from the token_t result
15090 part.
15091 (unlexed): Is a token_t.
15092
15093 2001-09-10 Akim Demaille <akim@epita.fr>
15094
15095 * configure.in: Bump to 1.29a.
15096
15097 2001-09-07 Akim Demaille <akim@epita.fr>
15098
15099 Version 1.29.
15100
15101 2001-08-30 Akim Demaille <akim@epita.fr>
15102
15103 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
15104 * m4/atconfig.m4: Remove.
15105 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
15106 * tests/bison: New.
15107 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
15108 m4_if, m4_patsubst, and m4_regexp.
15109 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
15110 `input' file instead of echo.
15111
15112 2001-08-29 Akim Demaille <akim@epita.fr>
15113
15114 Bump to 1.28e.
15115
15116 2001-08-29 Akim Demaille <akim@epita.fr>
15117
15118 Version 1.28d.
15119
15120 2001-08-29 Paul Eggert <eggert@twinsun.com>
15121
15122 * src/bison.simple (yyparse): Don't take the address of an
15123 item before the start of an array, as that doesn't conform to
15124 the C Standard.
15125
15126 2001-08-29 Robert Anisko <anisko_r@epita.fr>
15127
15128 * doc/bison.texinfo (Location Tracking Calc): New node.
15129
15130 2001-08-29 Paul Eggert <eggert@twinsun.com>
15131
15132 * src/output.c (output): Do not define const, as this now
15133 causes more problems than it cures.
15134
15135 2001-08-29 Akim Demaille <akim@epita.fr>
15136
15137 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
15138 the nodes.
15139 Be sure to tag the `detailmenu'.
15140
15141 2001-08-29 Akim Demaille <akim@epita.fr>
15142
15143 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
15144 download in a tmp dir.
15145
15146 2001-08-28 Marc Autret <autret_m@epita.fr>
15147
15148 * config/depcomp: New file.
15149
15150 2001-08-28 Marc Autret <autret_m@epita.fr>
15151
15152 * doc/bison.1 (mandoc): Adjust.
15153 From Juan Manuel Guerrero.
15154
15155 2001-08-28 Marc Autret <autret_m@epita.fr>
15156
15157 * src/print_graph.c (print_state): Fix.
15158
15159 2001-08-27 Marc Autret <autret_m@epita.fr>
15160
15161 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
15162 char * members.
15163 Echo modifications to the functions prototypes.
15164 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
15165
15166 2001-08-27 Marc Autret <autret_m@epita.fr>
15167
15168 * src/vcg.c: Include `xalloc.h'.
15169 (add_colorentry): New.
15170 (add_classname): New.
15171 (add_infoname): New.
15172 * src/vcg.h: Add new prototypes.
15173
15174 2001-08-27 Akim Demaille <akim@epita.fr>
15175
15176 * Makefile.maint: Sync. again with CVS Autoconf.
15177
15178 2001-08-27 Akim Demaille <akim@epita.fr>
15179
15180 * Makefile.maint: Formatting changes.
15181 (po-update, cvs-update, update): New targets.
15182 (AMTAR): Remove.
15183
15184 2001-08-27 Akim Demaille <akim@epita.fr>
15185
15186 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15187 * Makefile.maint: Sync. with CVS Autoconf.
15188
15189 2001-08-27 Marc Autret <autret_m@epita.fr>
15190
15191 * src/vcg.h (struct infoname_s): New.
15192 (struct colorentry_s): New.
15193 (graph_s): New fields {vertical,horizontal}_order in structure.
15194 Add `infoname' field.
15195 Add `colorentry' field;
15196 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
15197 (G_HORIZONTAL_ORDER): New.
15198 (G_INFONAME): New.
15199 (G_COLORENTRY): New.
15200 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
15201 Add output of `infoname'.
15202 Add output of `colorentry'.
15203
15204 2001-08-27 Marc Autret <autret_m@epita.fr>
15205
15206 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
15207 This one shadowed a global parameter.
15208
15209 2001-08-24 Marc Autret <autret_m@epita.fr>
15210
15211 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
15212 instead of `unsigned'.
15213 (print_state): Do not call obstack_object_size () in obstack_grow ()
15214 to avoid macro variables shadowing.
15215
15216 2001-08-23 Marc Autret <autret_m@epita.fr>
15217
15218 * src/lex.c (percent_table): Typo: s/naem/name/.
15219 Add graph option.
15220 Normalize new options declarations.
15221
15222 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
15223
15224 * tests/suite.at: Exercise %header_extension and %source_extension.
15225
15226 2001-08-16 Marc Autret <autret_m@epita.fr>
15227
15228 * src/reader.c (parse_dquoted_param): New.
15229 (parse_header_extension_decl): Use it.
15230 (parse_source_extension_decl): Likewise.
15231
15232 2001-08-16 Marc Autret <autret_m@epita.fr>
15233
15234 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
15235 (get_xxxx_str): Use assert () instead of complain ().
15236 Remove return invokations in default cases.
15237 (get_decision_str): Modify default behaviour. Remove second argument.
15238 Echo modifications on calls.
15239 (output_graph): Fix.
15240
15241 2001-08-16 Marc Autret <autret_m@epita.fr>
15242
15243 * src/getargs.c (usage): Update with ``-g, --graph''.
15244
15245 2001-08-16 Marc Autret <autret_m@epita.fr>
15246
15247 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
15248 (Option Cross Key): Likewise.
15249 * doc/bison.1: Update.
15250
1c8c2190
PB
152512001-09-25 Pascal Bart <pascal.bart@epita.fr>
15252
15253 * src/output.c (output_master_parser): Don't finish action_obstack.
15254 (output_parser): Don't care about the muscle action, here.
15255 (prepare): Copy the action_obstack in the action muscle.
15256 (output): Free action_obstack.
15257
180d45ba
PB
152582001-09-23 Pascal Bart <pascal.bart@epita.fr>
15259
15260 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
15261 will contain `%union' declaration.
15262 (parse_union_decl): Delete #line directive output.
15263 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
15264 informations about %union.
15265 (parse_union_decl): Copy the union_obstack in the muscle stype.
15266 * src/bison.simple: Add new #line directive.
15267 Add typdef %%stype YYSTYPE.
15268
c51d1a19
PB
152692001-09-23 Pascal Bart <pascal.bart@epita.fr>
15270
15271 * src/bison.simple: Add new `#line' directive.
15272
6f9344da
PB
152732001-09-22 Pascal Bart <pascal.bart@epita.fr>
15274
15275 * src/bison.simple: New `#line' directive.
15276 * src/output.c (output_parser): Support new dynamic muscle input_line.
15277
652def80
MA
152782001-09-22 Marc Autret <autret_m@epita.fr>
15279
15280 * src/output.c (output_master_parser): New.
15281 (output_parser): Be more re-entrant.
15282
25b222fa
MA
152832001-09-21 Marc Autret <autret_m@epita.fr>
15284
15285 * src/reader.c (copy_definition, parse_union_decl): Update and use
15286 `linef' muscle.
15287 (copy_action): Likewise.
15288 Use obstack_1grow ().
15289 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
15290
6bc35ae5
MA
152912001-09-21 Marc Autret <autret_m@epita.fr>
15292
15293 * src/options.c (option_table): Adjust.
15294 * src/lex.c (parse_percent_token): Fix.
15295
c0629aa1
PB
152962001-09-20 Pascal Bart <pascal.bart@epita.fr>
15297
15298 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 15299
82b6d266
PB
153002001-09-20 Pascal Bart <pascal.bart@epita.fr>
15301
15302 * src/lex.c (parse_percent_token): Change type of variable `tx', which
15303 is now an option_table_struct*.
15304 (option_strcmp): New function option_strcmp.
15305 (parse_percent_token): Call option_strcmp.
15306 * src/getargs.c (xalloc.h, options.h): Include it.
15307 (getargs): Call create_long_option_table.
15308 (getargs): Free longopts at the end of the function.
15309 (shortopts): Move in options.c.
15310 * src/options.c (create_long_option_table): New function. Convert
15311 information from option_table to option structure.
15312 * src/reader.c (options.h): Include it.
15313
15314 * src/Makefile.am: Adjust.
15315 * src/options.c (option_table): Create from longopts and percent_table.
15316 * src/getargs.c (longopts): Delete.
15317 * src/lex.c (struct percent_table_struct): Delete.
15318 (percent_table): Delete.
15319 (options.h): Include it.
15320 * src/options.c: Create.
15321 * src/options.h: Create.
15322 Declare enum opt_access_e.
15323 Define struct option_table_struct.
15324
75f5aaea
MA
153252001-09-20 Marc Autret <autret_m@epita.fr>
15326
15327 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
15328 sections of Bison.
15329
f508cb0a
PB
153302001-09-19 Pascal Bart <pascal.bart@epita.fr>
15331
15332 * src/bison.simple: s/%%filename/%%skeleton.
15333 * src/muscle_tab.c (getargs.h): Include it.
15334 (muscle_init): Insert new muscle skeleton.
15335
13105fc1
PB
153362001-09-18 Pascal Bart <pascal.bart@epita.fr>
15337
15338 * src/output.c (output_parser): Delete unused variable actions_dumped.
15339
b0c4483e
PB
153402001-09-07 Pascal Bart <pascal.bart@epita.fr>
15341
15342 * src/output.c (output): Delete call to reader_output_yylsp.
15343 * src/reader.c (reader): Likewise.
ba0fe3c7 15344 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 15345
11d82f03
MA
153462001-09-02 Marc Autret <autret_m@epita.fr>
15347
15348 * src/reader.c: Include muscle_tab.h.
15349 (parse_union_decl): Update.
15350 (parse_macro_decl): Rename parse_muscle_decl.
15351 Update to use renamed functions and variable.
15352 (read_declarations, copy_action, read_additionnal_code, : Updated
15353 with correct variables and functions names.
15354 (packsymbols, reader): Likewise.
342b8b6e 15355
11d82f03 15356 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 15357
11d82f03
MA
15358 * src/output.c: Include muscle_tab.h
15359 In all functions using macro_insert, change by using muscle_insert ().
15360 (macro_obstack): Rename muscle_obstack.
15361 Echo modifications in the whole file.
15362 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
15363 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
15364 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
15365
15366 * src/muscle_tab.h: Update double inclusion macros.
15367 (macro_entry_s): Rename muscle_entry_s.
15368 Update prototypes.
342b8b6e 15369
11d82f03
MA
15370 * src/muscle_tab.c: Include muscle_tab.h.
15371 Rename macro_tabble to muscle_table.
15372 (mhash1, mhash2, mcmp): Use muscle_entry.
15373 (macro_init): Rename muscle_init. Update.
15374 (macro_insert): Rename muscle_insert. Update.
15375 (macro_find): Rename muscle_find. Update.
15376
15377 * src/main.c: Include muscle_tab.h.
15378 (main): Call muscle_init ().
15379 * src/Makefile.am (bison_SOURCES): Echo modifications.
15380
93a37297
MA
153812001-09-02 Marc Autret <autret_m@epita.fr>
15382
f753cd62 15383 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 15384
f753cd62
MA
15385 * src/muscle_tab.c, src/muscle_tab.h: Add files.
15386
153872001-09-02 Marc Autret <autret_m@epita.fr>
15388
15389 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 15390
682d48cd
PB
153912001-09-01 Pascal Bart <pascal.bart@epita.fr>
15392
342b8b6e 15393 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
15394 filename.
15395
087c8fda
MA
153962001-09-01 Marc Autret <autret_m@epita.fr>
15397
15398 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
15399 to an explicit value to activate the feature. We do it here.
15400
dda680cb
PB
154012001-08-31 Pascal Bart <pascal.bart@epita.fr>
15402
15403 * src/output.c (prepare): Delete the `filename' muscule insertion.
15404 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
15405 (parse_union_decl): Likewise.
15406 * src/macrotab.c (macro_init): Initialize filename by infile.
15407
9e644e64
MA
154082001-08-31 Marc Autret <autret_m@epita.fr>
15409
15410 * src/bison.simple (YYLSP_NEEDED): New definition.
15411 * src/output.c (prepare): Add macro insertion of `locations_flag'
15412
17da6427
PB
154132001-08-31 Pascal Bart <pascal.bart@epita.fr>
15414
15415 * src/output.c (prepare): Delete insertion of previous muscles,
15416 and insert the `prefix' muscles.
15417 * src/macrotab.c (macro_init): Likewise.
15418 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 15419 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
15420 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
15421 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 15422 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
15423 name_prefix.
15424
e8cb70b9
PB
154252001-08-31 Pascal Bart <pascal.bart@epita.fr>
15426
15427 * src/main.c (main): Standardize.
15428 * src/output.c (output_table_data, output_parser): Likewise.
15429 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
15430
63c2d5de
MA
154312001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
15432
342b8b6e 15433 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
15434 %%epilogue.
15435 * src/output.c (output): Rename %%declarations to %%prologue.
15436 * src/bison.simple: Echo modifications.
342b8b6e 15437
d8cb5183
MA
154382001-08-31 Marc Autret <autret_m@epita.fr>
15439
15440 * src/reader.c (readgram): CleanUp.
15441 (output_token_defines): Likewise.
15442 (packsymbols): Likewise.
15443 (reader): Likewise.
15444 * src/output.c (output): CPP-out useless code.
15445
6c686258
PB
154462001-08-31 Pascal Bart <pascal.bart@epita.fr>
15447
342b8b6e 15448 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
15449 output_trailers and output_headers.
15450 * src/output.h: Remove obsolete functions prototypes of output_headers
15451 and output_trailers.
15452
8f451ef7
PB
154532001-08-30 Pascal Bart <pascal.bart@epita.fr>
15454
15455 * src/main.c: Include macrotab.h.
342b8b6e 15456 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
15457 Adjust functions prototypes.
15458 * src/macrotab.c (macro_insert): Constify key and value.
15459 (macro_find): Constify key.
15460 (macro_insert): Include 'xalloc.h'
15461 (macro_insert): Use XMALLOC.
15462 (macro_find): Constify return value.
15463 * src/output.c (output_table_data): Rename table to table_data.
15464 (output_parser): Constify macro_key, macro_value.
15465
997b6fd0 154662001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
15467
15468 * src/reader.c (parse_skel_decl): New.
342b8b6e 15469 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
15470 * src/lex.h (token_t): New token `tok_skel'.
15471 * src/lex.c (percent_table): Add skeleton option entry.
15472 Standardize.
15473
ff48177d
MA
154742001-08-29 Marc Autret <autret_m@epita.fr>
15475
15476 * src/bison.simple: Add %%user_code directive at the end.
15477 * src/reader.c (read_additionnal_code): New.
15478 (reader): Use it.
15479 * src/output.c (output_program): Remove.
15480 (output): Update.
15481
b33160bf
MA
154822001-08-28 Marc Autret <autret_m@epita.fr>
15483
15484 * src/output.c (output_actions): Clean up.
4e5caae2 15485 (output_gram): CPP-out useless code.
b33160bf
MA
15486 * src/reader.c (reader): Clean up, CPP-out useless code.
15487
d1a2daf7
PB
154882001-08-28 Pascal Bart <pascal.bart@epita.fr>
15489
342b8b6e 15490 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 15491 directive.
d1a2daf7
PB
15492 * src/bison.simple: Add `%%definitions'.
15493
2b763dfe
MA
154942001-08-28 Marc Autret <autret_m@epita.fr>
15495
15496 * config/depcomp: New file.
15497
f1a87ef6
PE
154982001-08-27 Paul Eggert <eggert@twinsun.com>
15499
15500 * src/bison.simple (yyparse): Don't take the address of an
15501 item before the start of an array, as that doesn't conform to
15502 the C Standard.
15503
82e236e2
RA
155042001-08-27 Robert Anisko <robert.anisko@epita.fr>
15505
f1a87ef6 15506 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
15507 obstack. It was done too late here.
15508
15509 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
15510 completely wrong.
15511 (reader): Initialize the macro obstack here, since we need it to grow
15512 '%define' directives.
15513
15514 * src/reader.h: Declare the macro obstack as extern.
15515
b0cfa28a
RA
155162001-08-27 Robert Anisko <robert.anisko@epita.fr>
15517
15518 * src/output.c (output_parser): Fix. Store single '%' characters in
15519 the output obstack instead of throwing them away.
15520
6fc74234
AD
155212001-08-27 Akim Demaille <akim@epita.fr>
15522
15523 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15524
9c76d118
RA
155252001-08-25 Robert Anisko <robert.anisko@epita.fr>
15526
15527 * lib/Makefile.am: Adjust.
15528
a8289c62
RA
155292001-08-25 Robert Anisko <robert.anisko@epita.fr>
15530
15531 * src/bison.simple: Update and add '%%' directives.
15532
b6610515
RA
155332001-08-25 Robert Anisko <robert.anisko@epita.fr>
15534
15535 * src/reader.c (reader): Remove calls to 'output_headers' and
15536 'output_trailers'. Remove some C output.
15537 (readgram): Disable a piece of code that was writing a default
15538 definition for 'YYSTYPE'.
15539 (reader_output_yylsp): Remove.
15540 (packsymbols): Output token defintions to a macro.
15541 (copy_definition): Disable C output.
6fc74234 15542
b6610515
RA
15543 * src/reader.c (parse_macro_decl): New function used to parse macro
15544 declarations.
15545 (copy_string2): Put the body of copy_string into this new function.
15546 Add a parameter to let the caller choose whether he wants to copy the
15547 string delimiters or not.
15548 (copy_string): Be a simple call to copy_string2 with the last argument
15549 bound to true.
15550 (read_declarations): Add case for macro definition.
15551 (copy_identifier): New.
6fc74234 15552 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
15553 rather than lex.
15554
26f609ff
RA
155552001-08-25 Robert Anisko <robert.anisko@epita.fr>
15556
15557 * src/output.c (prepare): Add prefixed names.
15558 (output_parser): Output semantic actions.
15559 (output_parser): Fix bug on '%%line' directives.
6fc74234 15560
26f609ff
RA
15561 * src/output.c (output_headers): Remove. The C code printed by this
15562 function should now be in the skeletons.
15563 (output_trailers): Remove.
15564 (output): Disable call to 'reader_output_yylsp'.
15565 (output_rule_data): Do not output tables to the table obstack.
15566
15567 * src/output.c: Remove some C dedicated output.
15568 Improve the use of macro and output obstacks.
15569 (output_defines): Remove.
6fc74234 15570
26f609ff
RA
15571 * src/output.c (output_token_translations): Associate 'translate'
15572 table with a macro. No output to the table obstack.
15573 (output_gram): Same for 'rhs' and 'prhs'.
15574 (output_stos): Same for 'stos'.
15575 (output_rule_data): Same for 'r1' and 'r2'.
15576 (token_actions): Same for 'defact'.
15577 (goto_actions): Same for 'defgoto'.
15578 (output_base): Same for 'pact' and 'pgoto'.
15579 (output_table): Same for 'table'.
15580 (output_check): Same for 'check'.
6fc74234 15581
26f609ff
RA
15582 * src/output.c (output_table_data): New function.
15583 (output_short_table): Remove.
15584 (output_short_or_char_table): Remove.
6fc74234 15585
26f609ff
RA
15586 * src/output.c (output_parser): Replace most of the skeleton copy code
15587 with something new. Skeletons are now processed character by character
15588 rather than line by line, and Bison looks for '%%' macros. This is the
15589 first step in making Bison's output process (a lot) more flexible.
15590 (output_parser): Use the macro table.
15591
6f43b113
RA
155922001-08-25 Robert Anisko <robert.anisko@epita.fr>
15593
15594 * src/main.c (main): Initialize the macro table.
15595
dd3127cf
RA
155962001-08-25 Robert Anisko <robert.anisko@epita.fr>
15597
15598 * src/lex.c (percent_table): Add tok_define.
15599 * src/lex.h: Add tok_define.
15600
aa321494
RA
156012001-08-25 Robert Anisko <robert.anisko@epita.fr>
15602
15603 * src/macrotab.c: New file.
15604 * src/macrotab.h: New file.
15605 * src/Makefile.am: Update.
15606
68bd3b6b
RA
156072001-08-25 Robert Anisko <robert.anisko@epita.fr>
15608
15609 * lib/hash.c: New file.
15610 * lib/hash.h: New file.
15611 * lib/Makefile.am: Update.
15612
45f8dd1e
AD
156132001-08-15 Akim Demaille <akim@epita.fr>
15614
15615 Version 1.28c.
15616
40a64a7a 156172001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
15618
15619 * src/reader.c (readgram): Indent output macro YYSTYPE.
15620 (packsymbols): Likewise.
15621 (output_token_defines): Likewise.
15622 * src/files.c: Standardize.
15623 (compute_header_macro): New.
15624 (defines_obstack_save): New. Use compute_header_macro.
15625 (output_files): Update. Use defines_obstack_save.
15626
f9a8293a
AD
156272001-08-15 Akim Demaille <akim@epita.fr>
15628
15629 * doc/bison.texinfo (Table of Symbols): Document
15630 YYSTACK_USE_ALLOCA.
15631
150ca7a7
AD
156322001-08-15 Akim Demaille <akim@epita.fr>
15633
15634 * missing: Update from CVS Automake.
15635 * config/config.guess, config/config.sub, config/texinfo.tex:
15636 Update from gnu.org.
15637
69b5cec4
AD
156382001-08-15 Akim Demaille <akim@epita.fr>
15639
15640 * Makefile.maint: Sync with CVS Autoconf.
15641
f2b5126e
PB
156422001-08-14 Pascal Bart <pascal.bart@epita.fr>
15643
69b5cec4 15644 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
15645 `fdl.texi'.
15646 * doc/fdl.texi: Add to package.
15647
4ecbf796
MA
156482001-08-14 Marc Autret <autret_m@epita.fr>
15649
15650 Turn on %{source,header}_extension features.
15651
69b5cec4 15652 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
15653 source_extension.
15654 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 15655 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
15656 between options.
15657
95fb5662
MA
156582001-08-14 Marc Autret <autret_m@epita.fr>
15659
15660 * src/files.c (compute_base_names): Add extensions computing when
15661 `--file-prefix' used.
15662 Standardize function calls.
15663
78d09da9
MA
156642001-08-13 Marc Autret <autret_m@epita.fr>
15665
69b5cec4 15666 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
15667 defining it (defined but null disables alloca).
15668
5a009f2c
MA
156692001-08-13 Marc Autret <autret_m@epita.fr>
15670
15671 * src/bison.simple (_yy_memcpy): CPP reformat.
15672
1e41465a
PB
156732001-08-13 Pascal Bart <pascal.bart@epita.fr>
15674
15675 * tests/atconfig.in (CPPFLAGS): Fix.
15676
c67a198d
PB
156772001-08-10 Pascal Bart <pascal.bart@epita.fr>
15678
79282c6c 15679 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
15680 `gpl.texi'.
15681 * doc/gpl.texi: Add to package.
15682
09a6de7e
MA
156832001-08-10 Marc Autret <autret_m@epita.fr>
15684
15685 * src/print_graph.h: Fix.
15686 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
15687
b77b9ee0
AD
156882001-08-10 Akim Demaille <akim@epita.fr>
15689
15690 * src/system.h: Provide default declarations for stpcpy, strndup,
15691 and strnlen.
15692
3e259915
MA
156932001-08-10 Robert Anisko <anisko_r@epita.fr>
15694
15695 * doc/bison.texinfo (Locations): Update @$ stuff.
15696
ca96bc2d
MA
156972001-08-09 Robert Anisko <anisko_r@epita.fr>
15698
15699 * src/bison.simple (YYLLOC_DEFAULT): Update.
15700 (yyparse): Adjust.
15701
fdc6758b
MA
157022001-08-08 Marc Autret <autret_m@epita.fr>
15703
b77b9ee0 15704 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
15705 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
15706 Reported by Fabrice Bauzac.
957d4dbf 15707
600cad3b
MA
157082001-08-08 Marc Autret <autret_m@epita.fr>
15709
15710 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
15711 * src/vcg.c (output_node): Fix.
15712 * src/vcg.h: Cleanup.
15713 * src/print_graph.c: Add comments.
b77b9ee0 15714 (node_output_size): New global variable. Simplify the formatting of
600cad3b 15715 the VCG graph output.
b77b9ee0 15716 (print_actions): Unused code is now used. It notifies the final state
600cad3b 15717 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 15718 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
15719 blue.
15720 Get the current node name and node_obstack by argument.
15721 (node_obstack): New variable.
15722 (print_state): Manage node_obstack.
15723 (print_core): Use node_obstack given by argument.
15724 A node is not only computed here but in print_actions also.
15725 (print_graph): CPP out useless code instead of commenting it.
15726
976e528f
AD
157272001-08-07 Pascal Bart <pascal.bart@epita.fr>
15728
15729 * tests/atconfig.in (CPPFLAGS): Fix.
15730
20e8e5ca
AD
157312001-08-07 Akim Demaille <akim@epita.fr>
15732
15733 * src/print_graph.c (quote): New.
15734 (print_core): Use it.
15735
957d4dbf 157362001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 15737
3e3da797
AD
15738 * src/vcg.c (complain.h): Include it.
15739 Unepitaize `return' invocations.
c4b66126 15740 [NDEBUG] (main): Remove.
79282c6c 15741 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
15742 * src/files.c (open_files): Initialize graph_obstack.
15743 * src/print_graph.c (print_actions): CPP out useless code.
15744 (print_core): Don't output the last `\n' in labels.
15745 Use `quote'.
15746 * src/files.c (output_files): Output the VCG file.
15747 * src/main.c (main): Invoke print_graph ();
3e3da797 15748
957d4dbf 157492001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
15750
15751 Automaton VCG graph output.
15752 Using option ``-g'' or long option ``--graph'', you can generate
15753 a gram_filename.vcg file containing a VCG description of the LALR (1)
15754 automaton of your grammar.
15755
15756 * src/main.c: Call to print_graph() function.
15757 * src/getargs.h: Update.
15758 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
15759 (graph_flag): New flag.
15760 (longopts): Update.
15761 (getargs): Add case `g'.
15762 * src/files.c (graph_obstack): New obstack struct.
15763 (open_files): Initialize new obstack.
15764 (output_files): Saves graph_obstack if required.
15765 * src/files.h (graph_obstack): New extern declaration.
15766 * src/Makefile.am: Add new source files.
15767
927c1557 157682001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
15769
15770 * src/print_graph.c, src/print_graph.h (graph): New.
15771 * src/vcg.h: New file.
15772 * src/vcg.c: New file, VCG graph handling.
15773
7333d403
AD
157742001-08-06 Marc Autret <autret_m@epita.fr>
15775
15776 Add of %source_extension and %header_extension which specify
15777 the source or/and the header output file extension.
15778
15779 * src/files.c (compute_base_names): Remove initialisation of
15780 src_extension and header_extension.
15781 (compute_exts_from_gf): Update.
15782 (compute_exts_from_src): Update.
15783 (output_files): Update.
15784 * src/reader.c (parse_header_extension_decl): New.
15785 (parse_source_extension_decl): New.
15786 (read_declarations): New case statements for the new tokens.
15787 * src/lex.c (percent_table): Add entries for %source_extension
15788 and %header_extension.
15789 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
15790
84163231
AD
157912001-08-06 Marc Autret <autret_m@epita.fr>
15792
15793 * configure.in: Bump to 1.28c.
15794 * doc/bison.texinfo: Texinfo thingies.
15795
8303fc42
AD
157962001-08-04 Pascal Bart <pascal.bart@epita.fr>
15797
15798 * tests/atconfig.in (CPPFLAGS): Add.
15799 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
15800
70a84437
AD
158012001-08-03 Akim Demaille <akim@epita.fr>
15802
15803 Version 1.28b.
15804
2ce10144
AD
158052001-08-03 Akim Demaille <akim@epita.fr>
15806
15807 * tests/Makefile.am (check-local): Ship testsuite.
15808 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
15809 Include `string.h'.
15810
1e3e4bc1
AD
158112001-08-03 Akim Demaille <akim@epita.fr>
15812
15813 * configure.in: Try using -Wformat when compiling.
15814
42b45b7f
AD
158152001-08-03 Akim Demaille <akim@epita.fr>
15816
15817 * configure.in: Bump to 1.28b.
15818
8f13fe33
AD
158192001-08-03 Akim Demaille <akim@epita.fr>
15820
15821 * src/complain.c: Adjust strerror_r portability issues.
15822
b37ba92c
AD
158232001-08-03 Akim Demaille <akim@epita.fr>
15824
15825 Version 1.28a.
15826
b0ce6046
AD
158272001-08-03 Akim Demaille <akim@epita.fr>
15828
15829 * src/getargs.c, src/getarg.h (skeleton)): Constify.
15830 * src/lex.c (literalchar): Avoid name clashes on `buf'.
15831 * src/getargs.c: Include complain.h.
15832 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
15833 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
15834
d01c415b
AD
158352001-08-03 Akim Demaille <akim@epita.fr>
15836
15837 * src/reader.c (readgram): Display hidden chars in error messages.
15838
459dd1a6
AD
158392001-08-03 Akim Demaille <akim@epita.fr>
15840
15841 Update to gettext 0.10.39.
15842
53b74c0c
AD
158432001-08-03 Akim Demaille <akim@epita.fr>
15844
15845 * lib/strspn.c: New.
15846
234a3be3
AD
158472001-08-01 Marc Autret <autret_m@epita.fr>
15848
15849 * doc/bison.texinfo: Update.
15850 * doc/bison.1 (mandoc): Update.
15851 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
15852 * src/files.c: Support output files extensions computing.
15853 (src_extension): New static variable.
15854 (header_extension): New static variable.
15855 (tr): New function.
15856 (get_extension_index): New function, gets the index of an extension
15857 filename in a string.
15858 (compute_exts_from_gf): New function, computes extensions from the
15859 grammar file extension.
15860 (compute_exts_from_src): New functions, computes extensions from the
15861 C source file extension, file given by ``-o'' option.
15862 (compute_base_names): Update.
15863 (output_files): Update.
15864
847bf1f5
AD
158652001-08-01 Robert Anisko <anisko_r@epita.fr>
15866
d995fee7 15867 * doc/bison.texi: Document @$.
847bf1f5
AD
15868 (Locations): New section.
15869
d074a105
AD
158702001-07-18 Akim Demaille <akim@epita.fr>
15871
15872 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
15873 * config/prev-version.txt, config/move-if-change: New.
15874 * Makefile.am: Adjust.
15875
3419715d
AD
158762001-07-08 Pascal Bart <pascal.bart@epita.fr>
15877
15878 * src/bison.simple (yyparse): Suppress warning `comparaison
15879 between signed and unsigned'.
15880
62ab6972
AD
158812001-07-05 Pascal Bart <pascal.bart@epita.fr>
15882
15883 * src/getargs.h (raw_flag): Remove.
15884 * src/getargs.c: Die on `-r'/`--raw'.
15885 * src/lex.c (parse_percent_token): Die on `%raw'.
15886 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
15887 * tests/calc.at: Suppress test with option `--raw'.
15888
1e24cc5b
AD
158892001-07-14 Akim Demaille <akim@epita.fr>
15890
15891 * config/: New.
15892 * configure.in: Require Autoconf 2.50.
15893 Update to gettext 0.10.38.
15894
32dfccf8
AD
158952001-03-16 Akim Demaille <akim@epita.fr>
15896
15897 * doc/bison.texinfo: ANSIfy the examples.
15898
cd5bd6ac
AD
158992001-03-16 Akim Demaille <akim@epita.fr>
15900
15901 * getargs.c (skeleton): New variable.
15902 (longopts): --skeleton is a new option.
15903 (shortopts, getargs): -S is a new option.
15904 * getargs.h: Declare skeleton.
15905 * output.c (output_parser): Use it.
15906
5141b016
AD
159072001-03-16 Akim Demaille <akim@epita.fr>
15908
15909 * m4/strerror_r.m4: New.
15910 * m4/error.m4: Run AC_FUNC_STRERROR_R.
15911 * lib/error.h, lib/error.c: Update.
15912
447992b9
AD
159132001-03-16 Akim Demaille <akim@epita.fr>
15914
15915 * src/getargs.c (longopts): Clean up.
15916
274d42ce
AD
159172001-02-21 Akim Demaille <akim@epita.fr>
15918
15919 * src/reader.c (gensym): `gensym_count' is your own.
15920 Use a static buf to create the symbol name, as token_buffer is no
15921 longer a buffer.
15922
22c821f3
AD
159232001-02-08 Akim Demaille <akim@epita.fr>
15924
15925 * src/conflicts.c (conflict_report): Be sure not to append to res
15926 between two calls, which could happen if both first sprintf were
15927 skipped, but not the first cp += strlen.
15928
18569462
AD
159292001-02-08 Akim Demaille <akim@epita.fr>
15930
15931 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
15932 New, from fileutils 4.0.37.
15933 * configure.in: Require Autoconf 2.49c. I took some time before
15934 making this decision. This is the only way out for portability
15935 issues in Bison, it would mean way too much duplicate effort to
15936 import in Bison features implemented in 2.49c since 2.13.
15937 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
15938
0d8f3c8a
AD
159392001-02-02 Akim Demaille <akim@epita.fr>
15940
15941 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 15942 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 15943
f17bcd1f
AD
159442001-01-19 Akim Demaille <akim@epita.fr>
15945
15946 Get rid of the ad hoc handling of token_buffer in the scanner: use
15947 the obstacks.
15948
15949 * src/lex.c (token_obstack): New.
15950 (init_lex): Initialize it. No longer call...
15951 (grow_token_buffer): this. Remove it.
15952 Adjust all the places which used it to use the obstack.
15953
511e79b3
AD
159542001-01-19 Akim Demaille <akim@epita.fr>
15955
15956 * src/lex.h: Rename all the tokens:
15957 s/\bENDFILE\b/tok_eof/g;
15958 s/\bIDENTIFIER\b/tok_identifier/g;
15959 etc.
15960 Let them be enums, not #define, to ease debugging.
15961 Adjust all the code.
15962
0d6508ef
AD
159632001-01-18 Akim Demaille <akim@epita.fr>
15964
15965 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
15966 * src/lex.c (maxtoken, grow_token_buffer): Static.
15967
6deb4447
AD
159682001-01-18 Akim Demaille <akim@epita.fr>
15969
15970 Since we now use obstacks, more % directives can be enabled.
15971
15972 * src/lex.c (percent_table): Also accept `%yacc',
15973 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
15974 `%debug'.
15975 Handle the actions for `%semantic_parser' and `%pure_parser' here,
15976 instead of returning a token.
15977 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
15978 * src/reader.c (read_declarations): Adjust.
15979 * src/files.c (open_files): Don't call `compute_base_names', don't
15980 compute `attrsfile' since they depend upon data which might be
15981 *in* the input file now.
15982 (output_files): Do it here.
15983 * src/output.c (output_headers): Document the fact that this patch
15984 introduces a guaranteed SEGV for semantic parsers.
15985 * doc/bison.texinfo: Document them.
15986 * tests/suite.at: Exercise these %options.
15987
ff4423cc
AD
159882000-12-20 Akim Demaille <akim@epita.fr>
15989
15990 Also handle the output file (--verbose) with obstacks.
15991
15992 * files.c (foutput): Remove.
15993 (output_obstack): New.
15994 Adjust all dependencies.
15995 * src/conflicts.c: Return a string.
15996 * src/system.h (obstack_grow_string): Rename as...
15997 (obstack_sgrow): this. Be ready to work with non literals.
15998 (obstack_fgrow4): New.
15999
956dba3a
AD
160002000-12-20 Akim Demaille <akim@epita.fr>
16001
16002 * src/files.c (open_files): Fix the computation of short_base_name
16003 in the case of `-o foo.tab.c'.
16004
337bab46
AD
160052000-12-20 Akim Demaille <akim@epita.fr>
16006
16007 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
16008 (copy_dollar): Now that everything uses obstacks, get rid of the
16009 FILE * parameters.
16010
5d3214b8
AD
160112000-12-20 Akim Demaille <akim@epita.fr>
16012
16013 * src/files.c (open_files): Actually the `.output' file is based
16014 on the short_base_name, not base_name.
16015 * tests/suite.at (Checking output file names): Adjust.
16016
29092a57
AD
160172000-12-20 Akim Demaille <akim@epita.fr>
16018
16019 * src/bison.s1: Remove, we now use directly...
16020 * src/bison.simple: this.
16021 * src/Makefile.am: Use pkgdata instead of data.
16022
ea5607fd
AD
160232000-12-20 Akim Demaille <akim@epita.fr>
16024
16025 * src/files.c (guard_obstack): New.
16026 (open_files): Initialize it.
16027 (output_files): Dump it...
16028 * src/files.h: Export it.
16029 * src/reader.c (copy_guard): Use it.
16030
27110317
AD
160312000-12-19 Akim Demaille <akim@epita.fr>
16032
16033 * src/files.c (outfile, defsfile, actfile): Removed as global
16034 vars.
16035 (open_files): Don't compute them.
16036 (output_files): Adjust.
16037 (base_name, short_base_name): Be global.
16038 Adjust dependencies.
16039
19c50364
AD
160402000-12-19 Akim Demaille <akim@epita.fr>
16041
16042 * src/files.c (strsuffix): New.
16043 (stringappend): Be just like strcat but allocate.
16044 (base_names): Eve out from open_files.
16045 Try to simplify the rather hairy computation of base_name and
16046 short_base_name.
16047 (open_files): Use it.
16048 * tests/suite.at (Checking output file names): New test.
16049
573c1d9f
AD
160502000-12-19 Akim Demaille <akim@epita.fr>
16051
16052 * src/system.h (obstack_grow_literal_string): Rename as...
16053 (obstack_grow_string): this.
16054 * src/output.c (output_parser): Recognize `%% actions' instead of
16055 `$'.
16056 * src/bison.s1: s/$/%% actions/.
16057 * src/bison.hairy: Likewise.
16058
ef7ddedd
AD
160592000-12-19 Akim Demaille <akim@epita.fr>
16060
16061 * src/output.c (output_parser): Compute the `#line' lines when
16062 there are.
16063 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
16064 Suggested by Hans Aberg.
16065
ff61dabd
AD
160662000-12-19 Akim Demaille <akim@epita.fr>
16067
16068 Let the handling of the skeleton files be local to the procedures
16069 that use it.
16070
16071 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
16072 longer static.
16073 (fparser, open_extra_files): Remove.
16074 (open_files, output_files): Don't take care of fparser.
16075 * src/files.h: Adjust.
16076 * src/output.c (output_parser): Open and close the file to the
16077 skeleton.
16078 * src/reader.c (read_declarations): When %semantic_parser, open
16079 fguard.
16080
55b96341
AD
160812000-12-19 Akim Demaille <akim@epita.fr>
16082
16083 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
16084 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
16085
358c15b7
AD
160862000-12-19 Akim Demaille <akim@epita.fr>
16087
16088 * src/files.c (open_files): Yipee! We no longer need all the code
16089 looking for `/tmp' since we have no tmp file.
16090
7de3329e
AD
160912000-12-19 Akim Demaille <akim@epita.fr>
16092
16093 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
16094 New macros.
16095 * src/files.c (open_files): Less dependency on MSDOS etc.
16096
3abcd459
AD
160972000-12-14 Akim Demaille <akim@epita.fr>
16098
16099 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
16100 Provide a default definition.
16101 Use it when executing the default @ action.
16102 * src/reader.c (reader_output_yylsp): No longer include
16103 `timestamp' and `text' in the default YYLTYPE.
16104
2a91a95e
AD
161052000-12-12 Akim Demaille <akim@epita.fr>
16106
16107 * src/reader.c (copy_definition, parse_union_decl, copy_action)
16108 (copy_guard): Quote the file names.
16109 Reported by Laurent Mascherpa.
16110
14d3eb9b
AD
161112000-12-12 Akim Demaille <akim@epita.fr>
16112
16113 * src/output.c (output_headers, output_program, output): Be sure
16114 to escape special characters when outputting filenames.
16115 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
16116 (output_headers): Don't depend on them, Use ACTSTR.
16117
d7045ec6
AD
161182000-11-17 Akim Demaille <akim@epita.fr>
16119
16120 * lib/obstack.h: Formatting changes.
16121 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
16122 prevents type checking.
16123 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
16124 cast the value to (void *): assigning a `foo *' to a `void *'
16125 variable is valid.
16126 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
16127 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
16128 append characters.
16129
6fd54b73
AD
161302000-11-17 Akim Demaille <akim@epita.fr>
16131
16132 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
16133 as...
16134 (suite.m4, regression.m4, calc.m4): these.
16135 * tests/atgeneral.m4: Update from CVS Autoconf.
16136
4c50eae6
AD
161372000-11-17 Akim Demaille <akim@epita.fr>
16138
16139 * tests/regression.m4 (%union and --defines): New test,
16140 demonstrating a current bug in the obstack implementation.
16141
a35f64ea
AD
161422000-11-17 Akim Demaille <akim@epita.fr>
16143
16144 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
16145 macros.
16146 Use them to declare the variables which are global or local to
16147 `yyparse'.
16148
7de23534
AD
161492000-11-17 Akim Demaille <akim@epita.fr>
16150
16151 * acconfig.h: Remove, no longer used.
16152
aa7815f5
AD
161532000-11-07 Akim Demaille <akim@epita.fr>
16154
16155 * src: s/Copyright (C)/Copyright/g.
16156
5af1f549
AD
161572000-11-07 Akim Demaille <akim@epita.fr>
16158
16159 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
16160 defining.
16161 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
16162
553e2b22
AD
161632000-11-07 Akim Demaille <akim@epita.fr>
16164
16165 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
16166 Merge in a single CPP if/else.
16167
8a4f41d6
AD
161682000-11-07 Akim Demaille <akim@epita.fr>
16169
16170 * src/output.c (output): Remove useless variables.
16171 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
16172 argument `data' for consistency with the prototypes.
16173 Qualify it `const'.
16174 (obstack_copy, obstack_copy0): Rename the second argument as
16175 `address' for consistency. Qualify it `const'.
16176 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
16177 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
16178 `const' their input argument (`data' or `address').
16179 Adjust the corresponding macros to include `const' in casts.
16180
095a3fb5
AD
161812000-11-03 Akim Demaille <akim@epita.fr>
16182
16183 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
16184 s/PFILE1/BISON_HAIRY/.
16185 Adjust dependencies.
16186
d1cdce7c
AD
161872000-11-03 Akim Demaille <akim@epita.fr>
16188
090c5ebf 16189 For some reason, this was not applied.
d1cdce7c
AD
16190
16191 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16192 `unlink': it's no longer used.
16193
9311529b
AD
161942000-11-03 Akim Demaille <akim@epita.fr>
16195
16196 * src/files.c (skeleton_find): New function, eved out of...
16197 (open_files, open_extra_files): here.
16198
d8880f69
AD
161992000-11-03 Akim Demaille <akim@epita.fr>
16200
16201 Don't use `atexit'.
16202
16203 * src/files.c (obstack_save): New function.
16204 (done): Rename as...
16205 (output_files): this.
16206 Use `obstack_save'.
16207 * src/main.c (main): Don't use `atexit' to register `done', since
16208 it no longer has to remove tmp files, just call `output_files'
16209 when there are no errors.
16210
0dbb648e
AD
162112000-11-02 Akim Demaille <akim@epita.fr>
16212
16213 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16214 `unlink': it's no longer used.
16215 * src/files.h: Formatting changes.
16216
896fe5c1
AD
162172000-11-02 Akim Demaille <akim@epita.fr>
16218
16219 Remove the last uses of mktemp and unlink/delete.
16220
16221 * src/files.c (fdefines, ftable): Removed.
16222 (defines_ostack, table_obstack): New.
16223 Adjust dependencies of the former into uses of the latter.
16224 * src/output.c (output_short_or_char_table, output_short_table):
16225 Convert to using obstacks.
16226 * src/reader.c (copy_comment2): Accept one FILE * and two
16227 obstacks.
16228 (output_token_defines, reader_output_yylsp): Use obstacks.
16229 * src/system.h (obstack_fgrow3): New.
1f65350a 16230 * po/POTFILES.in: Adjust.
896fe5c1 16231
dd60faec
AD
162322000-11-01 Akim Demaille <akim@epita.fr>
16233
16234 Change each use of `fattrs' into a use of `attrs_obstack'.
16235
16236 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
16237 * src/files.c (fattrs): Remove.
16238 (attrs_obstack): New.
16239 Adjust all dependencies.
16240 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
16241
8c7ebe49
AD
162422000-11-01 Akim Demaille <akim@epita.fr>
16243
16244 Introduce obstacks.
16245 Change each use of `faction' into a use of `action_obstack'.
16246
16247 * lib/obstack.h, lib/obstack.c: New files.
16248 * src/files.c (faction): Remove.
16249 (action_obstack): New.
16250 Adjust all dependencies.
16251
77aee789
AD
162522000-10-20 Akim Demaille <akim@epita.fr>
16253
16254 * lib/quote.h (PARAMS): New macro. Use it.
16255
43591cec
AD
162562000-10-16 Akim Demaille <akim@epita.fr>
16257
16258 * src/output.c (output_short_or_char_table): New function.
16259 (output_short_table, output_token_translations): Use it.
16260 (goto_actions): Use output_short_table.
16261
1e9798d5
AD
162622000-10-16 Akim Demaille <akim@epita.fr>
16263
16264 * src/symtab.c (bucket_new): New function.
16265 (getsym): Use it.
16266
16267 * src/output.c (output_short_table): New argument to display the
16268 comment associated with the table.
16269 Adjust dependencies.
16270 (output_gram): Use it.
16271 (output_rule_data): Nicer output layout for YYTNAME.
16272
f282676b
AD
162732000-10-16 Akim Demaille <akim@epita.fr>
16274
16275 * src/lex.c (read_typename): New function.
16276 (lex): Use it.
16277 * src/reader.c (copy_dollar): Likewise.
16278
550a72a3
AD
162792000-10-16 Akim Demaille <akim@epita.fr>
16280
16281 * src/reader.c (copy_comment2): Expect the input stream to be on
16282 the `/' which is suspected to open a comment, instead of being
16283 called after `//' or `/*' was read.
16284 (copy_comment, copy_definition, parse_union_decl, copy_action)
16285 (copy_guard): Adjust.
16286
131e2fef
AD
162872000-10-16 Akim Demaille <akim@epita.fr>
16288
16289 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
16290 `read_signed_integer'.
16291
79282c5a
AD
162922000-10-16 Akim Demaille <akim@epita.fr>
16293
16294 * src/reader.c (copy_dollar): New function.
16295 (copy_guard, copy_action): Use it.
16296
ff4a34be
AD
162972000-10-16 Akim Demaille <akim@epita.fr>
16298
16299 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
16300 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
16301 New files, from Fileutils 4.0.27.
16302 * src/main.c (printable_version): Remove.
16303 * src/lex.c, src/reader.c: Use `quote'.
16304
163052000-10-04 Akim Demaille <akim@epita.fr>
16306
16307 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
16308
14ded682
AD
163092000-10-04 Akim Demaille <akim@epita.fr>
16310
16311 * doc/bison.texinfo: Various typos spotted by Neil Booth.
16312
8e03724b
AD
163132000-10-04 Akim Demaille <akim@epita.fr>
16314
16315 When a literal string is used to define two different tokens,
16316 `bison -v' segfaults.
16317 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
16318
16319 * tests/regression.m4: New file.
16320 Include the core of the sample provided by Piotr Gackiewicz.
16321 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
16322 properly.
16323
a9e64249
AD
163242000-10-04 Akim Demaille <akim@epita.fr>
16325
16326 * src/reader.c (parse_expect_decl): Keep `count' within the size
16327 of `buffer'.
16328 From Neil Booth.
16329
da9abf43
AD
163302000-10-02 Paul Eggert <eggert@twinsun.com>
16331
16332 * bison.s1 (yyparse): Assign the default value
16333 unconditionally, to avoid a GCC warning and make the parser a
16334 tad smaller.
16335
c33638bb
AD
163362000-10-02 Akim Demaille <akim@epita.fr>
16337
16338 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
16339 options.
16340
444c570a
AD
163412000-10-02 Akim Demaille <akim@epita.fr>
16342
16343 * src/derives.c, src/print.c, src/reduce.c: To ease the
16344 translation, move some `\n' out of the translated strings.
16345
89cab50d
AD
163462000-10-02 Akim Demaille <akim@epita.fr>
16347
16348 The location tracking mechanism is precious for parse error
16349 messages. Nevertheless, it is enabled only when `@n' is used in
16350 the grammar, which is a different issue (you can use it in error
16351 message, but not in the grammar per se). Therefore, there should
16352 be another means to enable it.
16353
16354 * src/getargs.c (getargs): Support `--locations'.
16355 (usage): Report it.
16356 * src/getargs.h (locationsflag): Export it.
16357 * src/lex.c (percent_table): Support `%locations'.
16358 * src/reader.c (yylsp_needed): Remove this variable, now replaced
16359 with `locationsflag'.
16360 * doc/bison.texinfo: Document `--locations' and `%locations'.
16361 Sort the options.
16362 * tests/calc.m4: Test it.
16363
16364 For regularity of the names, replace each
16365 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
16366 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
16367 In addition replace each `flag' with `_flag'.
16368
d6c2cba0
AD
163692000-10-02 Akim Demaille <akim@epita.fr>
16370
16371 Also test parse error messages, including with YYERROR_VERBOSE.
16372
16373 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
16374 associative).
16375 Use it to check the computations.
16376 Use it to check `nonassoc' is honored.
16377 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
16378 `--yyerror-verbose'.
16379 (_AT_CHECK_CALC): Adjust to this option.
16380 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
16381
5a35a6cb
AD
163822000-10-02 Akim Demaille <akim@epita.fr>
16383
16384 Test also `--verbose', `--defines' and `--name-prefix'. Testing
16385 the latter demonstrates a flaw in the handling of non debugging
16386 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
16387 was used in order to simplify:
16388
16389 #if YYDEBUG
16390 if (yydebug)
16391 {
16392 ...
16393 }
16394 #endif
16395
16396 into
16397
16398 if (yydebug)
16399 {
16400 ...
16401 }
16402
16403 unfortunately this leads to a CPP conflict when
16404 `--name-prefix=foo' is used since it produces `#define yydebug
16405 foodebug'.
16406
16407 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
16408 (YYDPRINTF): New macro.
16409 Spread its use.
16410 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
16411 the bison options.
16412 Also test `--verbose', `--defines' and `--name-prefix'.
16413
71da9eea
AD
164142000-10-02 Akim Demaille <akim@epita.fr>
16415
16416 Improve the readability of the produced parsers.
16417
16418 * src/bison.s1: Formatting changes.
16419 Improve the comment related to the `$' mark.
16420 (yydefault): Don't fall through to `yyresume': `goto' there.
16421 * src/output.c (output_parser): When the `$' is met, skip the end
16422 of its line.
16423 New variable, `number_of_dollar_signs', to check there's exactly
16424 one `$' in the parser skeleton.
16425
95e36146
AD
164262000-10-02 Akim Demaille <akim@epita.fr>
16427
16428 * lib/xstrdup.c: New file, from the fileutils.
16429 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
16430 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
16431 instead of strlen + xmalloc + strcpy.
16432 * src/symtab.c (copys): Remove, use xstrdup instead.
16433
d7020c20
AD
164342000-10-02 Akim Demaille <akim@epita.fr>
16435
16436 * src/gram.h (associativity): New enum type which replaces the
16437 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
16438 `right_assoc', `left_assoc' and `non_assoc'.
16439 Adjust all dependencies.
16440 * src/reader.c: Formatting changes.
16441 (LTYPESTR): Don't define it, use it as a literal in
16442 `reader_output_yylsp'.
16443 * src/symtab.h (symbol_class): New enum type which replaces the
16444 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
16445 `sunknown', `stoken and `snterm'.
16446
1916f98e
AD
164472000-10-02 Akim Demaille <akim@epita.fr>
16448
16449 * src/getargs.c (fixed_outfiles): Rename as...
16450 (yaccflag): for consistency and accuracy.
16451 Adjust dependencies.
16452
d7913476
AD
164532000-10-02 Akim Demaille <akim@epita.fr>
16454
16455 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
16456 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
16457 difficult and introduced a lot of core dump. It turns out that
16458 Bison used an implementation of `xmalloc' based on `calloc', and
16459 at various places it does depend upon the initialization to 0. I
16460 have not tried to isolate the pertinent places, and all the former
16461 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
16462 someone should address this issue.
16463
16464 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
16465 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
16466 files.
16467 Adjust dependencies.
16468 * src/warshall.h: New file.
16469 Propagate.
16470
340ef489
AD
164712000-10-02 Akim Demaille <akim@epita.fr>
16472
16473 Various anti-`extern in *.c' changes.
16474
16475 * src/system.h: Include `assert.h'.
16476
b2ca4022
AD
164772000-10-02 Akim Demaille <akim@epita.fr>
16478
16479 * src/state.h (nstates, final_state, first_state, first_shift)
16480 (first_reduction): Move their exportation from here...
16481 * src/LR0.h: to here.
16482 Adjust dependencies.
16483 * src/getargs.c (statisticsflag): New variable.
16484 Add support for `--statistics'.
16485 Adjust dependencies.
16486
16487 Remove a lot of now useless `extern' statements in most files.
16488
403b315b
AD
164892000-10-02 Akim Demaille <akim@epita.fr>
16490
16491 * src/LR0.h: New file.
16492 Propagate its use.
16493
07a58c13
AD
164942000-10-02 Akim Demaille <akim@epita.fr>
16495
16496 * src/print.h: New file.
16497 Propagate its use.
16498 * src/print.c: Formatting and ordering changes.
16499 (verbose, terse): Replace with...
16500 (print_results): this new function.
16501 Adjust dependencies.
16502
0619caf0
AD
165032000-10-02 Akim Demaille <akim@epita.fr>
16504
16505 * src/conflicts.c (conflict_report): New function.
16506 (conflict_log, verbose_conflict_log): Replace with...
16507 (print_conflicts): this function.
16508 Adjust dependencies.
16509 * src/conflicts.h: New file.
16510 Propagate its inclusion.
16511
3519ec76
AD
165122000-10-02 Akim Demaille <akim@epita.fr>
16513
16514 * src/nullable.h: New file.
16515 Propagate its inclusion.
16516 * src/nullable.c: Formatting changes.
16517
015acc48
AD
165182000-10-02 Akim Demaille <akim@epita.fr>
16519
16520 * src/reduce.h: New file.
16521 Propagate its inclusion.
16522 * src/reduce.c: Topological sort and other formatting changes.
16523 (bool, TRUE, FALSE): Move their definition to...
16524 * src/system.h: here.
16525
8963a27b
AD
165262000-10-02 Akim Demaille <akim@epita.fr>
16527
16528 * src/files.c: Formatting changes.
16529 (tryopen, tryclose, openfiles): Rename as...
16530 (xfopen, xfclose, open_files): this.
16531 (stringappend): static.
16532 * src/files.h: Complete the list of exported symbols.
16533 Propagate its use.
16534
a70083a3
AD
165352000-10-02 Akim Demaille <akim@epita.fr>
16536
16537 * src/reader.h: New file.
16538 Propagate its use instead of tedious list of `extern' and
16539 prototypes.
16540 * src/reader.c: Formatting changes, topological sort,
16541 s/register//.
16542
abadc117
AD
165432000-10-02 Akim Demaille <akim@epita.fr>
16544
16545 * src/lex.h: Prototype `lex.c' exported functions.
16546 * src/reader.c: Adjust.
16547 * src/lex.c: Formatting changes.
16548 (safegetc): Rename as...
16549 (xgetc): this.
16550
720d742f
AD
165512000-10-02 Akim Demaille <akim@epita.fr>
16552
16553 * src/lalr.h: New file.
16554 Propagate its inclusion instead of prototypes and `extern'.
16555 * src/lalr.c: Formatting changes, topological sorting etc.
16556
f2acea59
AD
165572000-10-02 Akim Demaille <akim@epita.fr>
16558
16559 * src/output.c (token_actions): Introduce a temporary array,
16560 YYDEFACT, that makes it possible for this function to use
16561 output_short_table.
16562
d019d655
AD
165632000-10-02 Akim Demaille <akim@epita.fr>
16564
16565 `user_toknums' is output as a `short[]' in `output.c', while it is
16566 defined as a `int[]' in `reader.c'. For consistency with the
16567 other output tables, `user_toknums' is now defined as a table of
16568 shorts.
16569
16570 * src/reader.c (user_toknums): Be a short table instead of an int
16571 table.
16572 Adjust dependencies.
16573
16574 Factor the short table outputs.
16575
16576 * src/output.c (output_short_table): New function.
16577 * src/output.c (output_gram, output_stos, output_rule_data)
16578 (output_base, output_table, output_check): Use it.
16579
6c89f1c1
AD
165802000-10-02 Akim Demaille <akim@epita.fr>
16581
16582 * src/output.c (output): Topological sort of the functions, in
16583 order to get rid of the `static' prototypes.
16584 No longer use `register'.
16585 * src/output.h: New file.
16586 Propagate its inclusion in files explicitly prototyping functions
16587 from output.c.
16588
d9efd181
AD
165892000-09-21 Akim Demaille <akim@epita.fr>
16590
16591 * src/atgeneral.m4: Update from Autoconf.
16592
c29240e7 165932000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
16594
16595 * src/closure.h: New file.
16596 * src/closure.c: Formatting changes, topological sort over the
16597 functions, use of closure.h.
16598 (initialize_closure, finalize_closure): Rename as...
16599 (new_closure, free_closure): these. Adjust dependencies.
16600 * src/LR0.c: Formatting changes, topological sort, use of
16601 cloture.h.
16602 (initialize_states): Rename as...
16603 (new_states): this.
16604 * src/Makefile.am (noinst_HEADERS): Adjust.
16605
499daa50
AD
166062000-09-20 Akim Demaille <akim@epita.fr>
16607
16608 * src/acconfig.h: Don't protect config.h against multiple
16609 inclusion.
16610 Don't define PARAMS.
16611 * src/system.h: Define PARAMS.
16612 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
16613 purpose of config.h. system.h must not try to fix wrong
16614 definitions in config.h.
16615
cc84fd5d
AD
166162000-09-20 Akim Demaille <akim@epita.fr>
16617
16618 * src/derives.h: New file.
16619 * src/main.c, src/derives.h: Use it.
16620 Formatting changes.
16621 * src/Makefile.am (noinst_HEADERS): Adjust.
16622
db5b3a89
AD
166232000-09-20 Akim Demaille <akim@epita.fr>
16624
16625 * tests/atgeneral.m4: Update from Autoconf.
16626 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
16627 (AT_CHECK_CALC): New macros.
16628 Use these macros to test bison with options `', `--raw',
16629 `--debug', `--yacc', `--yacc --debug'.
16630
ceed8467
AD
166312000-09-19 Akim Demaille <akim@epita.fr>
16632
16633 * src/output.c: Formatting changes.
16634 * src/machine.h: Remove, leaving its contents in...
16635 * src/system.h: here.
16636 Include stdio.h.
16637 Adjust all dependencies on stdio.h and machine.h.
16638 * src/getargs.h: New file.
16639 Let all `extern' declarations about getargs.c be replaced with
16640 inclusion of `getargs.h'.
16641 * src/Makefile.am (noinst_HEADERS): Adjust.
16642
16643 * tests/calc.m4 (yyin): Be initialized in main, not on the global
16644 scope.
16645 (yyerror): Returns void, not int.
16646 * doc/bison.texinfo: Formatting changes.
16647
05a1d24b
AD
166482000-09-19 Akim Demaille <akim@epita.fr>
16649
16650 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
16651 portable.
16652
cbd25751
AD
166532000-09-18 Akim Demaille <akim@epita.fr>
16654
16655 * configure.in: Append WARNING_CFLAGS to CFLAGS.
16656 * src/Makefile.am (INCLUDES): Don't.
16657 Be ready to fetch headers in lib/.
16658
13863333
AD
166592000-09-18 Akim Demaille <akim@epita.fr>
16660
16661 * doc/bison.texinfo: Update the copyright.
16662 ANSIfy and GNUify the examples.
16663 Remove the old menu.
16664
0d533154
AD
166652000-09-18 Akim Demaille <akim@epita.fr>
16666
16667 First set of tests: use the `calc' example from the documentation.
16668
16669 * src/bison.s1 (yyparse): Condition the code using `yytname' which
16670 is defined only when YYDEBUG is.
16671 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
16672 * src/files.c (tryopen, tryclose): Formatting changes.
16673 Move to the top and be static.
16674 * src/reader.c (read_signed_integer): Likewise.
16675 * tests/calc.m4: New file.
16676 * Makefile.am, suite.m4: Adjust.
16677 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
16678
e79137ac
AD
166792000-09-18 Akim Demaille <akim@epita.fr>
16680
16681 Add support for an Autotest test suite for Bison.
16682
16683 * m4/m4.m4, m4/atconfig.m4: New files.
16684 * m4/Makefile.am (EXTRA_DIST): Adjust.
16685 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
16686 files.
16687 * src/getargs.c: Display a more standard --version message.
16688 * src/reader.c (reader): Formatting changes.
16689 No longer depend upon VERSION_STRING.
16690 * configure.in: No longer use `dnl'.
16691 Set up the test suite and the new directory `tests/.
16692 (VERSION_STRING): Remove.
16693
27821bff
AD
166942000-04-14 Akim Demaille <akim@epita.fr>
16695
16696 * src/reader.c (copy_comment2): New function, same as former
16697 `copy_comment', but outputs into two FILE *.
16698 (copy_comment): Use it.
16699 (parse_union_decl): Use it.
16700 (get_type, parse_start_decl): Use the same `invalid' message.
16701 (parse_start_decl, parse_union_decl): Use the same `multiple'
16702 message.
16703 (parse_union_decl, copy_guard, copy_action): Use the same
16704 `unmatched' message.
16705 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
16706
cfe5fbc0
AD
167072000-03-31 Akim Demaille <akim@epita.fr>
16708
16709 * src/files.c (tryopen, tryclose): Move to the top.
16710 Be static.
16711
cb7db13e
AD
167122000-03-31 Akim Demaille <akim@epita.fr>
16713
16714 * src/main.c (main): Don't call `done', exit does it.
16715
a0f6b076
AD
167162000-03-31 Akim Demaille <akim@epita.fr>
16717
36281465
AD
16718 * allocate.c: s/return (foo)/return foo/.
16719 * lalr.c: Likewise.
16720 * LR0.c: Likewise.
16721 * output.c: Likewise.
16722 * reader.c: Likewise.
16723 * symtab.c: Likewise.
16724 * vmsgetargs.c: Likewise.
16725
167262000-03-31 Akim Demaille <akim@epita.fr>
16727
16728 Clean up the error reporting functions.
a0f6b076
AD
16729
16730 * src/report.c: New file.
16731 * src/report.h: Likewise.
16732 * src/Makefile.am: Adjust.
16733 * m4/error.m4: New file.
16734 * m4/Makefile.am: Adjust.
16735 * configure.in (jm_PREREQ_ERROR): Call it.
16736 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
16737 Remove.
16738 (fatal, fatals): Remove. All callers use complain.c::fatal.
16739 (warn, warni, warns, warnss, warnss): Remove. All callers use
16740 complain.c::complain.
16741 (toomany): Remove, use fatal instead.
16742 * src/files.c (done): No argument, use complain_message_count.
16743 * src/main.c (main): Register `done' to `atexit'.
16744
16745 * src/getargs.c (usage): More `fputs', less `fprintf'.
16746
18539825
AD
167472000-03-28 Akim Demaille <akim@epita.fr>
16748
16749 * lib/: New directory.
16750 * Makefile.am (SUBDIRS): Adjust.
16751 * configure.in: Adjust.
16752 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
16753 useless.
16754 * src/alloca.c: Moved to lib/.
16755 * src/getopt.c: Likewise.
16756 * src/getopt1.c: Likewise.
16757 * src/getopt.h: Likewise.
16758 * src/ansi2knr.c: Likewise.
16759 * src/ansi2knr.1: Likewise.
16760 * src/Makefile.am: Adjust.
16761 * lib/Makefile.am: New file.
16762
9f306f2a
AD
167632000-03-28 Akim Demaille <akim@epita.fr>
16764
16765 * src/getargs.c (usage): Refresh the help message.
16766
0ba347b6
AD
167672000-03-17 Akim Demaille <akim@epita.fr>
16768
16769 * src/getopt1.c: Updated from textutils 2.0e
16770 * src/getopt.c: Likewise.
16771 * src/getopt.h: Likewise.
16772
dbe7f271
AD
167732000-03-17 Akim Demaille <akim@epita.fr>
16774
16775 * src/Makefile.am (bison.simple): Fix the awk program: quote only
16776 the file name, not the whole `#line LINE FILE'.
16777
75bbe78d
AD
167782000-03-17 Akim Demaille <akim@epita.fr>
16779
16780 On syntax errors, report the token on which we choked.
16781
aa5fd0ee
AD
16782 * src/bison.s1 (yyparse): In the label yyerrlab, when
16783 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 16784
7b306f52
AD
167852000-03-17 Akim Demaille <akim@epita.fr>
16786
aa5fd0ee 16787 * src/reader.c (copy_at): New function.
7b306f52
AD
16788 (copy_guard): Use it.
16789 (copy_action): Use it.
16790
e87b5700
AD
167912000-03-17 Akim Demaille <akim@epita.fr>
16792
16793 Be kind to translators, save some useless translations.
16794
aa5fd0ee 16795 * src/main.c (banner): New function.
e87b5700
AD
16796 (fatal_banner): Use it.
16797 (warn_banner): Use it.
16798
ae3c3164
AD
167992000-03-17 Akim Demaille <akim@epita.fr>
16800
aa5fd0ee
AD
16801 * src/reader.c (copy_definition): Use copy_string and
16802 copy_comment. Removed now unused `match', `ended',
16803 `cplus_comment'.
ae3c3164
AD
16804 (copy_comment, copy_string): Moved, to be visible from
16805 copy_definition.
16806
4dc58e7c
AD
168072000-03-17 Akim Demaille <akim@epita.fr>
16808
aa5fd0ee
AD
16809 * src/reader.c (copy_string): Declare `static inline'. No
16810 problems with inline, since it is checked by configure.
4dc58e7c
AD
16811 (copy_comment): Likewise.
16812
0a6384c4
AD
168132000-03-17 Akim Demaille <akim@epita.fr>
16814
aa5fd0ee 16815 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 16816
3cef001a
AD
168172000-03-17 Akim Demaille <akim@epita.fr>
16818
aa5fd0ee 16819 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
16820 (copy_action): Use it. Removed now unused `match', `ended',
16821 `cplus_comment'.
16822 (copy_guard): Likewise.
16823
ca36d2ef
AD
168242000-03-17 Akim Demaille <akim@epita.fr>
16825
aa5fd0ee 16826 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
16827 (copy_action): Use it.
16828 (copy_guard): Likewise.
16829
6666f98f
AD
168302000-03-17 Akim Demaille <akim@epita.fr>
16831
16832 Change the handling of @s so that they behave exactly like $s.
16833 There is now a pseudo variable @$ (readble and writable), location
16834 of the lhs of the rule (by default ranging from the location of
16835 the first symbol of the rhs, to the location of the last symbol,
16836 or, if the rhs is empty, YYLLOC).
16837
16838 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
16839 yyval.
16840 (yyparse): When providing a default semantic action, provide a
16841 default location action.
16842 (after the $): No longer change `*YYLSP', just stack YYLOC the
16843 same way you stack YYVAL.
16844 * src/reader.c (read_declarations): Use warns.
16845 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
16846 (copy_action, case '@'): Likewise.
16847 Use a standard error message, to save useless work from
16848 translators.
16849
41aca2e0
AD
168502000-03-17 Akim Demaille <akim@epita.fr>
16851
aa5fd0ee
AD
16852 * src/bison.s1: Formatting and cosmetics changes.
16853 * src/reader.c: Likewise.
41aca2e0
AD
16854 Update the Copyright notice.
16855
dc08c1d5
AD
168562000-03-17 Akim Demaille <akim@epita.fr>
16857
aa5fd0ee
AD
16858 * src/bison.s1 (#line): All set to `#line' only, since the
16859 Makefile now handles them.
dc08c1d5 16860
9ee3c97b
AD
168612000-03-16 Akim Demaille <akim@epita.fr>
16862
16863 * src/output.c (output_rule_data): Output the documentation of
16864 some of the tables.
16865 (Copyright notice): Update.
16866 Formatting changes.
16867
0de741ca
AD
168682000-03-16 Akim Demaille <akim@epita.fr>
16869
16870 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
16871 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
16872 One `#if YYDEBUG' remains, since it uses variables which are
16873 defined only if `YYDEBUG != 0'.
16874
bb10be54
AD
168752000-03-16 Akim Demaille <akim@epita.fr>
16876
16877 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
16878 and related variables so that the similarities are highlighted.
16879
b07b484a
AD
168802000-03-16 Akim Demaille <akim@epita.fr>
16881
16882 * src/bison.s1: Properly indent CPP directives.
16883
361f60b3
AD
168842000-03-16 Akim Demaille <akim@epita.fr>
16885
16886 * src/bison.s1: Properly indent the `alloca' CPP section.
16887
8c44d3ec
AD
168882000-03-16 Akim Demaille <akim@epita.fr>
16889
16890 Do not hard code values of directories in `configure.in'.
16891 Update the `configure' tool chain.
16892
16893 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
16894 src/makefile.am.
16895 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
16896 (AC_OUTPUT): Add m4/Makefile.
16897 Bump to bison 1.28a, 1.29 has never been released.
16898 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
16899 handled via src/Makefile.am.
16900 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
16901 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
16902 autoheader.
16903 * Makefile.am (SUBDIRS): Add m4.
16904 (ACLOCAL_AM_FLAGS): New variable.
16905 (AUTOMAKE_OPTIONS): Add check-news.
16906 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
16907 the proper line number and file name.
16908 (DEFS): Propagate the location of bison library files and of the
16909 locale files.
16910 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
16911 builddir.
16912 * acinclude.m4: Remove, replaced by the directory m4.
16913 * m4/Makefile.am (EXTRA_DIST): New variable.
16914 * m4/gettext.m4: New file, from the fileutils.
16915 * m4/lcmessage.m4: Likewise
16916 * m4/progtest.m4: Likewise.
16917 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
16918
f95997e7
AD
169192000-03-10 Akim Demaille <akim@epita.fr>
16920
16921 * src/closure.c:
16922 Formatting changes of various comments.
16923 Respect the GNU coding standards at various places.
16924 Don't use `_()' when no translation is needed.
16925
169261999-12-13 Jesse Thilo <jthilo@gnu.org>
16927
16928 * src/files.c:
16929 OS/2 honors TMPDIR environment variable.
16930
169311999-12-13 Jesse Thilo <jthilo@gnu.org>
16932
16933 * doc/bison.texinfo: Tweaked spelling and grammar.
16934 Updated ISBN.
16935 Removed reference to price of printed copy.
16936 Mention BISON_SIMPLE and BISON_HAIRY.
16937
169381999-12-13 Jesse Thilo <jthilo@gnu.org>
16939
16940 * configure.in, NEWS:
16941 Bison 1.29 released.
16942
169431999-10-27 Jesse Thilo <jthilo@gnu.org>
16944
16945 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
16946 Added reference card.
16947
169481999-07-26 Jesse Thilo <jthilo@gnu.org>
16949
16950 * po/ru.po: Added Russian translation.
16951
169521999-07-26 Jesse Thilo <jthilo@gnu.org>
16953
16954 * configure.in: Added Russian translation.
16955
169561999-07-06 Jesse Thilo <jthilo@gnu.org>
16957
16958 * configure.in, NEWS, README:
16959 Released version 1.28.
16960
169611999-06-14 Jesse Thilo <jthilo@gnu.org>
16962
16963 * src/system.h:
16964 Squashed redefinition warning on some systems.
16965
16966 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
16967 Have configure build version string instead of relying on ANSI string
16968 concatentation.
16969
169701999-06-14 Jesse Thilo <jthilo@gnu.org>
16971
16972 * po/POTFILES.in: Got rid of version.c.
16973
169741999-06-14 Jesse Thilo <jthilo@gnu.org>
16975
16976 * acconfig.h, configure.in:
16977 Have configure build version string instead of relying on ANSI string
16978 concatentation.
16979
169801999-06-08 Jesse Thilo <jthilo@gnu.org>
16981
16982 * doc/bison.1:
16983 Dropped mention of `+' for long-named options.
16984
169851999-05-30 Jesse Thilo <jthilo@gnu.org>
16986
16987 * src/files.c: Added <unistd.h> for unlink().
16988
16989 * src/Makefile.am, src/system.h:
16990 I18n fixes.
16991
169921999-05-30 Jesse Thilo <jthilo@gnu.org>
16993
16994 * README: Added a FAQ list.
16995
16996 * configure.in, acconfig.h:
16997 I18n fixes.
16998
169991999-05-30 Jesse Thilo <jthilo@gnu.org>
17000
17001 * doc/FAQ, doc/Makefile.am:
17002 Added a FAQ list.
17003
170041999-05-19 Jesse Thilo <jthilo@gnu.org>
17005
17006 * src/alloc.h, src/symtab.h, src/version.c:
17007 Protected inclusion of "config.h" with HAVE_CONFIG_H.
17008
170091999-04-18 Jesse Thilo <jthilo@gnu.org>
17010
17011 * src/.cvsignore, src/Makefile.am:
17012 Reorganized: sources in `src', documentation in `doc'.
17013
17014 * src/lex.c (literalchar):
17015 fixed the code for escaping double quotes (thanks
17016 Jonathan Czisny.)
17017
170181999-04-18 Jesse Thilo <jthilo@gnu.org>
17019
17020 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
17021 Adjusted paths to reflect directory reorganization.
17022
170231999-04-18 Jesse Thilo <jthilo@gnu.org>
17024
17025 * doc/.cvsignore, doc/Makefile.am:
17026 Reorganized: sources in `src', documentation in `doc'.
17027
170281999-04-18 Jesse Thilo <jthilo@gnu.org>
17029
17030 * configure.in:
17031 Updated AC_INIT file to reflect directory reorganization.
17032
17033 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
17034 Reorganized: sources in `src', documentation in `doc'.
17035
170361999-04-13 Jesse Thilo <jthilo@gnu.org>
17037
17038 * src/allocate.c:
17039 Don't declare calloc() and realloc() if not necessary.
17040
170411999-04-13 Jesse Thilo <jthilo@gnu.org>
17042
17043 * configure.in, acconfig.h, acinclude.m4:
17044 Don't declare calloc() and realloc() if not necessary.
17045
170461999-03-23 Jesse Thilo <jthilo@gnu.org>
17047
17048 * po/.cvsignore: Added i18n support.
17049
170501999-03-23 Jesse Thilo <jthilo@gnu.org>
17051
17052 * acconfig.h, configure.in, Makefile.am:
17053 Added i18n support.
17054
170551999-03-22 Jesse Thilo <jthilo@gnu.org>
17056
17057 * src/bison.s1: Fixed #line numbers.
17058
170591999-03-15 Jesse Thilo <jthilo@gnu.org>
17060
17061 * po/es.po, po/fr.po, po/nl.po, po/de.po:
17062 Added PO files from Translation Project.
17063
170641999-03-03 Jesse Thilo <jthilo@gnu.org>
17065
17066 * Makefile.am:
17067 Added support for non-ANSI compilers (ansi2knr).
17068
170691999-02-16 Jesse Thilo <jthilo@gnu.org>
17070
17071 * configure.in: Bumped version number to 1.27.
17072
17073 * Makefile.am:
17074 Added `bison.simple' to list of files removed by `make distclean'.
17075
170761999-02-12 Jesse Thilo <jthilo@gnu.org>
17077
17078 * src/files.c, src/files.h:
17079 Defined locations of parser files in config.h instead of Makefile.
17080
170811999-02-12 Jesse Thilo <jthilo@gnu.org>
17082
17083 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
17084 Defined locations of parser files in config.h instead of Makefile.
17085
170861999-02-09 Jesse Thilo <jthilo@gnu.org>
17087
17088 * Makefile.am:
17089 Removed inappropriate use of $< macro.
17090
170911999-02-05 Jesse Thilo <jthilo@gnu.org>
17092
17093 * po/Makefile.in.in, po/POTFILES.in:
17094 Add `po' directory skeleton.
17095
170961999-01-27 Jesse Thilo <jthilo@gnu.org>
17097
17098 * README: Document help-bison list.
17099
17100 * configure.in: Add check for mkstemp().
17101
171021999-01-20 Jesse Thilo <jthilo@gnu.org>
17103
17104 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
17105 Hush a few compiler warnings.
17106
17107 * src/files.c:
17108 Add tryclose(), which verifies that fclose was successful.
17109 Hush a couple of compiler warnings.
17110
171111999-01-20 Jesse Thilo <jthilo@gnu.org>
17112
17113 * Makefile.am, OChangeLog:
17114 ChangeLog is now automatically generated. Include the old version as
17115 OChangeLog.
17116
171171999-01-14 Jesse Thilo <jthilo@gnu.org>
17118
17119 * 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:
17120 Update FSF address.
17121
171221999-01-14 Jesse Thilo <jthilo@gnu.org>
17123
17124 * doc/bison.texinfo: Fix formatting glitch.
17125
17126 * doc/bison.texinfo: Update FSF address.
17127
171281999-01-14 Jesse Thilo <jthilo@gnu.org>
17129
17130 * acconfig.h: Update FSF address.
17131
171321999-01-08 Jesse Thilo <jthilo@gnu.org>
17133
17134 * src/system.h:
17135 Don't define PACKAGE here, since config.h defines it.
17136
171371998-12-30 Jesse Thilo <jthilo@gnu.org>
17138
17139 * src/reader.c: Update copyright date.
17140
17141 * src/main.c:
17142 Ditch sprintf to statically-sized buffers in fatal/warn functions in
17143 favor of output directly to stderr (avoids buffer overruns).
17144
17145 * src/reader.c: Some checks for premature EOF.
17146
17147 * 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:
17148 Use prototypes if the compiler understands them.
17149
17150 * src/files.c: Honor TMPDIR on Unix hosts.
17151 Use prototypes if the compiler understands them.
17152
17153 * src/reader.c:
17154 Fix a couple of buffer overrun bugs.
17155 Use prototypes if the compiler understands them.
17156
17157 * src/system.h: Include unistd.h and ctype.h.
17158 Use #ifdef instead of #if for NLS symbols.
17159
171601998-12-30 Jesse Thilo <jthilo@gnu.org>
17161
17162 * doc/bison.texinfo:
17163 Delete comment "consider using @set for edition number, etc..." since
17164 we now are doing so.
17165
171661998-12-30 Jesse Thilo <jthilo@gnu.org>
17167
17168 * configure.in:
17169 Use prototypes if the compiler understands them.
17170
17171 * NEWS: Document 1.26 highlights.
17172
17173 * Makefile.am: Require Automake 1.3 or later.
17174
17175 * acconfig.h:
17176 Use prototypes if the compiler understands them.
17177
171781998-12-29 Jesse Thilo <jthilo@gnu.org>
17179
17180 * src/version.c:
17181 Use VERSION symbol from automake for version number.
17182
171831998-12-29 Jesse Thilo <jthilo@gnu.org>
17184
17185 * acconfig.h, configure.in, version.cin:
17186 Use VERSION symbol from automake for version number.
17187
171881998-11-28 Jesse Thilo <jthilo@gnu.org>
17189
17190 * Makefile.am:
17191 Distribute original version of simple parser (bison.s1), not built
17192 version (bison.simple).
17193
171941998-11-28 Jesse Thilo <jthilo@gnu.org>
17195
17196 * doc/bison.texinfo: Add info dir entry.
17197
17198 * doc/bison.texinfo:
17199 Let automake put version number into documentation.
17200
172011998-11-26 Jesse Thilo <jthilo@gnu.org>
17202
17203 * src/bison.cld, src/build.com, src/vmshlp.mar:
17204 Add non-RCS files from /gd/gnu/bison.
17205
172061998-11-26 Jesse Thilo <jthilo@gnu.org>
17207
17208 * doc/bison.1:
17209 Document the BISON_HAIRY and BISON_SIMPLE variables.
17210
172111998-11-25 Jesse Thilo <jthilo@gnu.org>
17212
17213 * src/version.c: Build version.c automatically.
17214
17215 * src/reader.c:
17216 Fix token numbering (used to start at 258, not 257).
17217
17218 * src/system.h: Include config.h.
17219
17220 * src/getargs.c: Update bug report address.
17221
17222 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
17223 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
17224
172251998-11-25 Jesse Thilo <jthilo@gnu.org>
17226
17227 * Makefile.am:
17228 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17229
17230 * configure.in, version.cin:
17231 Build version.c automatically.
17232
17233 * AUTHORS: Add AUTHORS file.
17234
17235 * README: Update bug report address.
17236
17237 * bison.simple:
17238 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17239
17240 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
17241 Add automake stuff.
17242
172431998-11-25 Jesse Thilo <jthilo@gnu.org>
17244
17245 * doc/bison.texinfo: Clean up some formatting.
17246
172471998-05-05 Richard Stallman <rms@gnu.org>
17248
17249 * doc/bison.texinfo:
17250 Explain better why to make a pure parser.
17251
172521998-01-05 Richard Stallman <rms@gnu.org>
17253
17254 * src/files.c (openfiles):
17255 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
17256 find a temporary directory, if possible. Do not unlink files while
17257 they are open.
17258
172591997-08-25 Richard Stallman <rms@gnu.org>
17260
17261 * src/reader.c (stack_offset;):
17262 Change some warni to warns.
17263
17264 * src/lex.c (literalchar): Use warns, not warni.
17265
172661997-06-28 Richard Stallman <rms@gnu.org>
17267
17268 * src/bison.s1: Add a Bison version comment.
17269
17270 * src/main.c (fatal, warn, berror):
17271 Use program_name.
17272
172731997-06-28 Richard Stallman <rms@gnu.org>
17274
17275 * Makefile.in (bison_version): New variable.
17276 (dist): Use that variable.
17277 (bison.s1): Substitute the Bison version into bison.simple.
17278
17279 * bison.simple: Add a Bison version comment.
17280
172811997-06-18 Richard Stallman <rms@gnu.org>
17282
17283 * src/main.c (fatal, warn, berror):
17284 Make error messages standard.
17285 (toomany): Improve error message text.
17286
17287 * 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:
17288 new.h renamed to alloc.h.
17289
172901997-06-18 Richard Stallman <rms@gnu.org>
17291
17292 * Makefile.in: new.h renamed to alloc.h.
17293
172941997-05-24 Richard Stallman <rms@gnu.org>
17295
17296 * src/lex.c (literalchar):
17297 Fix the code for escaping \, " and '.
17298
17299 (lex): Avoid trouble when there are many chars
17300 to discard in a char literal with just several chars in it.
17301
173021997-05-17 Richard Stallman <rms@gnu.org>
17303
17304 * src/bison.s1:
17305 Use malloc, if using alloca is troublesome.
17306 (YYSTACK_USE_ALLOCA): New flag macro.
17307 Define it for some systems and compilers.
17308 (YYSTACK_ALLOC): New macro.
17309 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17310 If it was malloc'd, free it.
17311
173121997-05-17 Richard Stallman <rms@gnu.org>
17313
17314 * bison.simple:
17315 Use malloc, if using alloca is troublesome.
17316 (YYSTACK_USE_ALLOCA): New flag macro.
17317 Define it for some systems and compilers.
17318 (YYSTACK_ALLOC): New macro.
17319 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17320 If it was malloc'd, free it.
17321
173221997-04-23 Richard Stallman <rms@gnu.org>
17323
17324 * src/bison.s1:
17325 (alloca) [__hpux]: Always define as __builtin_alloca.
17326
173271997-04-23 Richard Stallman <rms@gnu.org>
17328
17329 * bison.simple:
17330 (alloca) [__hpux]: Always define as __builtin_alloca.
17331
173321997-04-22 Richard Stallman <rms@gnu.org>
17333
17334 * src/bison.s1:
17335 [__hpux]: Include alloca.h (right for HPUX 10)
17336 instead of declaring alloca (right for HPUX 9).
17337
17338 * src/bison.s1 (__yy_memcpy):
17339 Declare arg `count' as unsigned int.
17340 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17341
173421997-04-22 Richard Stallman <rms@gnu.org>
17343
17344 * bison.simple:
17345 [__hpux]: Include alloca.h (right for HPUX 10)
17346 instead of declaring alloca (right for HPUX 9).
17347
17348 * bison.simple (__yy_memcpy):
17349 Declare arg `count' as unsigned int.
17350 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17351
173521997-01-03 Richard Stallman <rms@gnu.org>
17353
17354 * src/allocate.c: [__STDC__ or _MSC_VER]:
17355 Declare calloc and realloc to return void *.
17356
173571997-01-02 Richard Stallman <rms@gnu.org>
17358
17359 * src/system.h:
17360 [_MSC_VER]: Include stdlib.h and process.h.
17361 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
17362
17363 * src/main.c (main): Return FAILURE as a value.
17364 (printable_version): Declare arg as int, not char.
17365
173661997-01-02 Richard Stallman <rms@gnu.org>
17367
17368 * Makefile.in (dist):
17369 Explicitly check for symlinks, and copy them.
17370
173711996-12-19 Richard Stallman <rms@gnu.org>
17372
17373 * src/files.c:
17374 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
17375
173761996-12-18 Paul Eggert <eggert@gnu.org>
17377
17378 * src/bison.s1 (yyparse):
17379 If __GNUC__ and YYPARSE_PARAM are both defined,
17380 declare yyparse to have a void * argument.
17381
173821996-12-18 Paul Eggert <eggert@gnu.org>
17383
17384 * bison.simple (yyparse):
17385 If __GNUC__ and YYPARSE_PARAM are both defined,
17386 declare yyparse to have a void * argument.
17387
173881996-12-17 Richard Stallman <rms@gnu.org>
17389
17390 * src/reduce.c (nbits): Add some casts.
17391
173921996-08-12 Richard Stallman <rms@gnu.org>
17393
17394 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
17395
173961996-08-12 Richard Stallman <rms@gnu.org>
17397
17398 * bison.simple: Test _MSDOS as well as _MSDOS_.
17399
174001996-07-31 Richard Stallman <rms@gnu.org>
17401
17402 * src/bison.s1:
17403 [__sun && __i386]: Include alloca.h.
17404
174051996-07-31 Richard Stallman <rms@gnu.org>
17406
17407 * bison.simple:
17408 [__sun && __i386]: Include alloca.h.
17409
174101996-07-30 Richard Stallman <rms@gnu.org>
17411
17412 * src/bison.s1: Comment change.
17413
17414 * src/bison.s1: Test _MSDOS_, not MSDOS.
17415
174161996-07-30 Richard Stallman <rms@gnu.org>
17417
17418 * bison.simple: Comment change.
17419
17420 * bison.simple: Test _MSDOS_, not MSDOS.
17421
174221996-06-01 Richard Stallman <rms@gnu.org>
17423
17424 * 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:
17425 Insert `_' macro around many string constants.
17426
17427 * src/main.c:
17428 Insert `_' macro around many string constants.
17429
17430 (main): Call setlocale, bindtextdomain and textdomain.
17431
17432 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
17433 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
17434 [ENABLE_NLS]: Include libintl.h.
17435 [ENABLE_NLS] (gettext): Define.
17436 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
17437 (N_, PACKAGE, LOCALEDIR): New macros.
17438
174391996-06-01 Richard Stallman <rms@gnu.org>
17440
17441 * POTFILES.in: New file.
17442
17443 * Makefile.in (allocate.o):
17444 Define target explicitly.
17445
17446 * Makefile.in (CFLAGS): Set to @CFLAGS@.
17447 (LDFLAGS): Set to @LDFLAGS@.
17448 (configure): Run autoconf only if preceding `cd' succeeds.
17449 (bison.s1): Redirect output to temporary file then move the
17450 temporary to the target, rather than redirecting directly to bison.s1.
17451 (clean): Remove config.status and config.log.
17452 (distclean): Don't remove config.status here.
17453
174541996-05-12 Richard Stallman <rms@gnu.org>
17455
17456 * src/bison.s1:
17457 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17458
174591996-05-12 Richard Stallman <rms@gnu.org>
17460
17461 * bison.simple:
17462 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17463
174641996-05-11 Richard Stallman <rms@gnu.org>
17465
17466 * src/bison.s1 (__yy_memcpy):
17467 Really reorder the args, as was supposedly done on Feb 14 1995.
17468 (yyparse): Calls changed accordingly.
17469
174701996-05-11 Richard Stallman <rms@gnu.org>
17471
17472 * Makefile.in (dist): Don't use $(srcdir).
17473
17474 * bison.simple (__yy_memcpy):
17475 Really reorder the args, as was supposedly done on Feb 14 1995.
17476 (yyparse): Calls changed accordingly.
17477
174781996-01-27 Richard Stallman <rms@gnu.org>
17479
17480 * src/output.c (output_rule_data):
17481 Test YYERROR_VERBOSE in the conditional
17482 around the definition of ttyname.
17483
174841995-12-29 Richard Stallman <rms@gnu.org>
17485
17486 * src/bison.s1:
17487 Fix line numbers in #line commands.
17488
174891995-12-29 Richard Stallman <rms@gnu.org>
17490
17491 * bison.simple:
17492 Fix line numbers in #line commands.
17493
174941995-12-27 Richard Stallman <rms@gnu.org>
17495
17496 * src/bison.s1 (YYPARSE_PARAM_DECL):
17497 In C++, make it always null.
17498 (YYPARSE_PARAM_ARG): New macro.
17499 (yyparse): Use YYPARSE_PARAM_ARG.
17500
175011995-12-27 Richard Stallman <rms@gnu.org>
17502
17503 * bison.simple (YYPARSE_PARAM_DECL):
17504 In C++, make it always null.
17505 (YYPARSE_PARAM_ARG): New macro.
17506 (yyparse): Use YYPARSE_PARAM_ARG.
17507
175081995-11-29 Richard Stallman <rms@gnu.org>
17509
17510 * doc/bison.texinfo:
17511 Describe literal string tokens, %raw, %no_lines, %token_table.
17512
175131995-11-29 Daniel Hagerty <hag@gnu.org>
17514
17515 * doc/bison.texinfo: Fixed update date
17516
175171995-10-16 Richard Stallman <rms@gnu.org>
17518
17519 * src/version.c: Version 1.25.
17520
175211995-10-16 Richard Stallman <rms@gnu.org>
17522
17523 * NEWS: *** empty log message ***
17524
175251995-10-16 Richard Stallman <rms@gnu.org>
17526
17527 * doc/bison.1, doc/bison.rnh:
17528 Add new options.
17529
175301995-10-15 Richard Stallman <rms@gnu.org>
17531
17532 * src/vmsgetargs.c, src/getargs.c:
17533 Added -n, -k, and -raw switches.
17534 (noparserflag, toknumflag, rawtoknumflag): New variables.
17535
17536 * src/symtab.h (SALIAS):
17537 New #define for adding aliases to %token.
17538 (struct bucket): Added `alias' field.
17539
17540 * src/reduce.c (reduce_grammar):
17541 Revise error message.
17542 (print_notices): Remove final `.' from error message.
17543
17544 * src/reader.c (reader_output_yylsp):
17545 New function.
17546 (readgram): Use `#if 0' around code that accepted %command
17547 inside grammar rules: The documentation doesn't allow it,
17548 and it will fail since the %command processors scan for the next %.
17549 (parse_token_decl): Extended the %token
17550 declaration to allow a multi-character symbol as an alias.
17551 (parse_thong_decl): New function.
17552 (read_declarations): Added %thong declarations.
17553 (read_declarations): Handle NOOP to deal with allowing
17554 % declarations as another means to specify the flags.
17555 (readgram): Allow %prec prior to semantics embedded in a rule.
17556 (skip_to_char, read_declarations, copy_definition)
17557 (parse_token_decl, parse_start_decl, parse_type_decl)
17558 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
17559 (get_type_name, copy_guard, copy_action, readgram)
17560 (get_type, packsymbols): Revised most error messages.
17561 Changed `fatal' to `warnxxx' to avoid aborting for error.
17562 Revised and use multiple warnxxx functions to avoid using VARARGS1.
17563 (read_declarations): Improve the error message for
17564 an invalid character. Do not abort.
17565 (read_declarations, copy_guard, copy_action): Use
17566 printable_version to avoid unprintable characters in printed output.
17567 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
17568 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
17569 Allow the type of a non-terminal can be given
17570 more than once, as long as all specifications give the same type.
17571
17572 * src/output.c:
17573 (output_headers, output_trailers, output, output_gram)
17574 (output_rule_data): Implement noparserflag variable.
17575 Implement toknumflag variable.
17576 (output): Call reader_output_yylsp to output LTYPESTR.
17577
17578 * src/main.c (main):
17579 If reader sees an error, don't process the grammar.
17580 (fatals): Updated to not use VARARGS1.
17581 (printable_version, int_to_string, warn, warni, warns, warnss)
17582 (warnsss): New error reporting functions. Avoid abort for error.
17583
17584 * src/lex.h:
17585 Added THONG and NOOP for alias processing.
17586 Added SETOPT for the new code that allows setting options with %flags.
17587
17588 * src/lex.c:
17589 Include getopt.h. Add some extern decls.
17590 (safegetc): New function to deal with EOF gracefully.
17591 (literalchar); new function to deal with reading \ escapes.
17592 (lex): Use literalchar.
17593 (lex): Implemented "..." tokens.
17594 (literalchar, lex, parse_percent_token): Made tokenbuffer
17595 always contain the token. This includes growing the token
17596 buffer while reading an integer.
17597 (parse_percent_token): Replaced if-else statement with percent_table.
17598 (parse_percent_token): Added % declarations as another
17599 way to specify the flags -n, -l, and -r. Also added hooks for
17600 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
17601 major changes to files.c.
17602 (lex) Retain in the incoming stream a character following
17603 an incorrect '/'.
17604 (skip_white_space, lex): Revised most error messages
17605 and changed fatal to warn to avoid aborting.
17606 (percent_table): Added %thong declarations.
17607
17608 * src/gram.h: Comment changes.
17609
17610 * src/files.c (openfiles, open_extra_files, done):
17611 Add faction flag
17612 and actfile file. Handle noparserflag. Both for -n switch.
17613
17614 * src/conflicts.c (resolve_sr_conflict):
17615 Remove use of alloca.
17616
176171995-06-01 Jim Meyering <meyering@gnu.org>
17618
17619 * doc/bison.texinfo: *** empty log message ***
17620
176211995-05-06 Richard Stallman <rms@gnu.org>
17622
17623 * src/bison.s1: Comment change.
17624
176251995-05-06 Richard Stallman <rms@gnu.org>
17626
17627 * bison.simple: Comment change.
17628
176291995-05-03 Richard Stallman <rms@gnu.org>
17630
17631 * src/version.c: Version now 1.24.
17632
17633 * src/bison.s1: Change distribution terms.
17634
17635 * src/version.c: Version now 1.23.
17636
176371995-05-03 Richard Stallman <rms@gnu.org>
17638
17639 * doc/bison.texinfo:
17640 Rewrite "Conditions for Using Bison".
17641 Update version to 1.24.
17642
176431995-05-03 Richard Stallman <rms@gnu.org>
17644
17645 * bison.simple: Change distribution terms.
17646
176471995-02-23 Richard Stallman <rms@gnu.org>
17648
17649 * src/files.c: Test __VMS_POSIX as well as VMS.
17650
176511995-02-14 Jim Meyering <meyering@gnu.org>
17652
17653 * src/bison.s1 (__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
176581995-02-14 Jim Meyering <meyering@gnu.org>
17659
17660 * bison.simple (__yy_memcpy):
17661 Renamed from __yy_bcopy to avoid
17662 confusion. Reverse FROM and TO arguments to be consistent with
17663 those of memcpy.
17664
176651994-11-10 David J. MacKenzie <djm@gnu.org>
17666
17667 * NEWS: reformat
17668
17669 * NEWS: New file.
17670
17671 * Makefile.in (DISTFILES): Include NEWS.
17672
17673 * Makefile.in (DISTFILES):
17674 Include install-sh, not install.sh.
17675
17676 * configure.in: Update to Autoconf v2 macro names.
17677
176781994-10-05 David J. MacKenzie <djm@gnu.org>
17679
17680 * Makefile.in: fix typo
17681
17682 * Makefile.in (prefix, exec_prefix):
17683 Let configure set them.
17684
176851994-09-28 David J. MacKenzie <djm@gnu.org>
17686
17687 * Makefile.in: Set datadir to $(prefix)/share.
17688
176891994-09-15 Richard Stallman <rms@gnu.org>
17690
17691 * src/bison.s1:
17692 Update copyright notice and GPL version.
17693
176941994-09-15 Richard Stallman <rms@gnu.org>
17695
17696 * bison.simple:
17697 Update copyright notice and GPL version.
17698
176991994-07-12 Richard Stallman <rms@gnu.org>
17700
17701 * src/reduce.c, src/reader.c:
17702 entered into RCS
17703
177041994-05-05 David J. MacKenzie <djm@gnu.org>
17705
17706 * Makefile.in: entered into RCS
17707
177081994-03-26 Richard Stallman <rms@gnu.org>
17709
17710 * src/bison.s1: entered into RCS
17711
177121994-03-26 Richard Stallman <rms@gnu.org>
17713
17714 * bison.simple: entered into RCS
17715
177161994-03-25 Richard Stallman <rms@gnu.org>
17717
17718 * src/main.c: entered into RCS
17719
177201994-03-24 Richard Stallman <rms@gnu.org>
17721
17722 * src/conflicts.c: entered into RCS
17723
177241994-01-02 Richard Stallman <rms@gnu.org>
17725
17726 * Makefile.in: *** empty log message ***
17727
177281993-11-21 Richard Stallman <rms@gnu.org>
17729
17730 * src/bison.s1: *** empty log message ***
17731
177321993-11-21 Richard Stallman <rms@gnu.org>
17733
17734 * doc/bison.texinfo: entered into RCS
17735
17736 * doc/bison.texinfo: *** empty log message ***
17737
177381993-11-21 Richard Stallman <rms@gnu.org>
17739
17740 * bison.simple: *** empty log message ***
17741
177421993-10-25 David J. MacKenzie <djm@gnu.org>
17743
17744 * doc/bison.texinfo: *** empty log message ***
17745
177461993-10-19 Richard Stallman <rms@gnu.org>
17747
17748 * src/bison.s1: *** empty log message ***
17749
177501993-10-19 Richard Stallman <rms@gnu.org>
17751
17752 * bison.simple: *** empty log message ***
17753
177541993-10-14 Richard Stallman <rms@gnu.org>
17755
17756 * src/bison.s1: *** empty log message ***
17757
177581993-10-14 Richard Stallman <rms@gnu.org>
17759
17760 * bison.simple: *** empty log message ***
17761
177621993-09-14 David J. MacKenzie <djm@gnu.org>
17763
17764 * doc/bison.texinfo: *** empty log message ***
17765
177661993-09-13 Noah Friedman <friedman@gnu.org>
17767
17768 * Makefile.in: *** empty log message ***
17769
177701993-09-10 Richard Stallman <rms@gnu.org>
17771
17772 * src/conflicts.c: *** empty log message ***
17773
17774 * src/system.h: entered into RCS
17775
177761993-09-10 Richard Stallman <rms@gnu.org>
17777
17778 * doc/bison.1: entered into RCS
17779
177801993-09-06 Noah Friedman <friedman@gnu.org>
17781
17782 * src/version.c: entered into RCS
17783
177841993-09-06 Noah Friedman <friedman@gnu.org>
17785
17786 * Makefile.in: *** empty log message ***
17787
177881993-07-30 David J. MacKenzie <djm@gnu.org>
17789
17790 * Makefile.in: *** empty log message ***
17791
177921993-07-24 Richard Stallman <rms@gnu.org>
17793
17794 * src/bison.s1: *** empty log message ***
17795
177961993-07-24 Richard Stallman <rms@gnu.org>
17797
17798 * bison.simple: *** empty log message ***
17799
178001993-07-08 David J. MacKenzie <djm@gnu.org>
17801
17802 * Makefile.in: *** empty log message ***
17803
178041993-07-04 Richard Stallman <rms@gnu.org>
17805
17806 * src/bison.s1: *** empty log message ***
17807
178081993-07-04 Richard Stallman <rms@gnu.org>
17809
17810 * bison.simple: *** empty log message ***
17811
178121993-06-26 David J. MacKenzie <djm@gnu.org>
17813
17814 * src/getargs.c: entered into RCS
17815
178161993-06-26 David J. MacKenzie <djm@gnu.org>
17817
17818 * doc/bison.texinfo: *** empty log message ***
17819
17820 * doc/bison.1: New file.
17821
178221993-06-25 Richard Stallman <rms@gnu.org>
17823
17824 * src/getargs.c: New file.
17825
178261993-06-16 Richard Stallman <rms@gnu.org>
17827
17828 * src/bison.s1: *** empty log message ***
17829
178301993-06-16 Richard Stallman <rms@gnu.org>
17831
17832 * bison.simple: *** empty log message ***
17833
178341993-06-03 Richard Stallman <rms@gnu.org>
17835
17836 * src/bison.s1: New file.
17837
178381993-06-03 Richard Stallman <rms@gnu.org>
17839
17840 * doc/bison.texinfo: *** empty log message ***
17841
178421993-06-03 Richard Stallman <rms@gnu.org>
17843
17844 * bison.simple: New file.
17845
178461993-05-19 Richard Stallman <rms@gnu.org>
17847
17848 * doc/bison.texinfo: New file.
17849
178501993-05-07 Noah Friedman <friedman@gnu.org>
17851
17852 * Makefile.in: *** empty log message ***
17853
178541993-04-28 Noah Friedman <friedman@gnu.org>
17855
17856 * src/reader.c: *** empty log message ***
17857
178581993-04-23 Noah Friedman <friedman@gnu.org>
17859
17860 * src/alloc.h: entered into RCS
17861
178621993-04-20 David J. MacKenzie <djm@gnu.org>
17863
17864 * src/version.c: *** empty log message ***
17865
17866 * src/files.c, src/allocate.c:
17867 entered into RCS
17868
17869 * src/reader.c: *** empty log message ***
17870
17871 * src/lex.c: entered into RCS
17872
17873 * src/conflicts.c: New file.
17874
17875 * src/symtab.c: entered into RCS
17876
17877 * src/alloc.h: New file.
17878
17879 * src/LR0.c: entered into RCS
17880
178811993-04-18 Noah Friedman <friedman@gnu.org>
17882
17883 * src/reader.c: New file.
17884
17885 * src/version.c: *** empty log message ***
17886
178871993-04-18 Noah Friedman <friedman@gnu.org>
17888
17889 * Makefile.in: *** empty log message ***
17890
178911993-04-17 Noah Friedman <friedman@gnu.org>
17892
17893 * Makefile.in: *** empty log message ***
17894
178951993-04-15 Richard Stallman <rms@gnu.org>
17896
17897 * src/main.c, src/files.c:
17898 New file.
17899
179001993-04-15 Noah Friedman <friedman@gnu.org>
17901
17902 * configure.in: entered into RCS
17903
17904 * configure.in: *** empty log message ***
17905
17906 * configure.in: New file.
17907
179081993-04-14 Richard Stallman <rms@gnu.org>
17909
17910 * Makefile.in: New file.
17911
179121993-04-13 Richard Stallman <rms@gnu.org>
17913
17914 * src/version.c: New file.
17915
179161993-03-25 Richard Stallman <rms@gnu.org>
17917
17918 * src/output.c: entered into RCS
17919
179201992-09-25 Richard Stallman <rms@gnu.org>
17921
17922 * configure.bat: entered into RCS
17923
179241992-06-22 Richard Stallman <rms@gnu.org>
17925
17926 * src/vmsgetargs.c: entered into RCS
17927
179281992-06-22 Richard Stallman <rms@gnu.org>
17929
17930 * doc/bison.rnh: entered into RCS
17931
179321992-04-20 David J. MacKenzie <djm@gnu.org>
17933
17934 * README: entered into RCS
17935
179361992-01-22 Richard Stallman <rms@gnu.org>
17937
17938 * src/machine.h: entered into RCS
17939
179401991-12-21 Richard Stallman <rms@gnu.org>
17941
17942 * src/lalr.c, src/closure.c:
17943 entered into RCS
17944
179451991-12-20 Richard Stallman <rms@gnu.org>
17946
17947 * src/state.h: entered into RCS
17948
179491991-12-18 Richard Stallman <rms@gnu.org>
17950
17951 * src/print.c, src/nullable.c, src/derives.c:
17952 entered into RCS
17953
179541991-11-03 David J. MacKenzie <djm@gnu.org>
17955
17956 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
17957 entered into RCS
17958
179591988-09-09 Richard Stallman <rms@gnu.org>
17960
17961 * src/bison.hairy: entered into RCS
17962
179631987-12-16 Richard Stallman <rms@gnu.org>
17964
17965 * REFERENCES: entered into RCS
dc546b0f 17966
f294a2c2 17967
04098407 17968 -----
f294a2c2 17969
04098407 17970 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
e2a21b6f
PE
17971 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
17972 Software Foundation, Inc.
f294a2c2 17973
04098407
PE
17974 Copying and distribution of this file, with or without
17975 modification, are permitted provided the copyright notice and this
17976 notice are preserved.
e9071366
AD
17977
17978$Id$