]> git.saurik.com Git - bison.git/blame - ChangeLog
* configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
[bison.git] / ChangeLog
CommitLineData
f02e2948
JD
12006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
4 strange test case titles. Reported by Bob Rossi.
5
38eb7751
PE
62006-12-13 Paul Eggert <eggert@cs.ucla.edu>
7
8 * TODO: Add pointer to Sylvain Schmitz's work on static detection
9 of potential ambiguities in GLR grammers.
10
bd9d212b
JD
112006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
12
13 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
14 `bison ', use m4_index instead of m4_substr since chopping up a string
15 containing M4-special characters causes problems here.
16
17 Fix a couple of bugs related to special characters in user-specified
18 file names, and make it easier for skeletons to compute output file
19 names with the same file name prefix as Bison-computed output file
20 names.
21 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
22 b4_parser_file_name and b4_spec_defines_file instead of
23 @output_parser_name@ and @output_header_name@, which are now redundant.
24 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
25 b4_parser_file_name, b4_spec_defines_file, and the new
26 @basename(FILENAME@) instead of @output_parser_name@ and
27 @output_header_name@, which inappropriately escaped the file names as
28 C string literals.
29 * src/files.c (all_but_ext): Remove static qualifier.
30 (compute_output_file_names): Move `free (all_but_ext)' to...
31 (output_file_names_free): ... here since all_but_ext is needed later.
32 * src/files.h (all_but_ext): Extern.
33 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
34 exactly what MUSCLE_INSERT_STRING used to do.
35 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
36 characters are escaped properly.
37 * src/output.c (prepare): Define muscle file_name_all_but_ext as
38 all_but_ext.
39 For pkgdatadir muscle, maintain previous functionality by using
40 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
41 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
42 digraphs would never be expanded. Hopefully no one has M4-special
43 characters in his Bison installation path.
44 * src/scan-skel.l: Don't parse @output_header_name@ and
45 @output_parser_name@ anymore since they're now redundant.
46 In @output, use decode_at_digraphs.
47 Parse a new @basename command that invokes last_component.
48 (decode_at_digraphs): New.
49 (BASE_QPUTS): Remove unused.
50 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
51 (Output file name): New tests.
52
3f7ca628
JD
532006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
54
55 Warn about output files that are generated by the skeletons and that
56 conflict with other output files.
57 * data/glr.c: Don't generate the header file here when glr.cc does.
58 * src/files.c (file_names, file_names_count): New static globals.
59 (compute_output_file_names): Invoke output_file_name_check for files
60 not generated by the skeletons and remove existing checks.
61 (output_file_name_check): New function that warns about conflicting
62 output file names.
63 (output_file_names_free): Free file_names.
64 * src/files.h (output_file_name_check): Declare.
65 * src/scan-skel.l: Invoke output_file_name_check for files generated by
66 the skeletons.
67 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
68 (Conflicting output files): New tests.
69
178e123e
PE
702006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
71
72 * doc/bison.texinfo: Fix a couple of typos.
73
742006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
75
76 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
77 Rename to...
78 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
79 update all uses.
80 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
81 (yypush_parse): Rename yypvars argument to yyps and remove redundant
82 local pv.
83 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
84 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
85
ea17f233
JD
862006-12-07 Bob Rossi <bob@brasko.net>
87 and Joel Denny <jdenny@ces.clemson.edu>
88
89 * data/push.c (yypvarsinit): Change return type from void* to struct
90 yypvars*. No longer cast to void* on return.
91 (struct yypvars): Remove yylen since it need not be remembered between
92 yypushparse invocations.
93 (yypushparse): Don't copy between yylen and pv->yylen.
94
55a30bda
JD
952006-12-05 Bob Rossi <bob@brasko.net>
96
97 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
98 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
99 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
100 (struct yypvars): Remove b4_declare_parser_variables.
101 (yypvarsinit): Remove init code for removed variables.
102 (global scope): Do not declare b4_declare_parser_variables if
103 push or pure mode.
104 (yypushparse): Add b4_declare_parser_variables.
105 Init new local variables, and remove init code for removed
106 yypvars variables.
107 (yyparse): Delete.
108 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
109 and yyparse for other modes.
110 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
111 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
112 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
113 (AT_PURE_LEX_IF): True if pure or push parser.
114
85894313
JD
1152006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
116
117 Document Yacc prologue alternatives and default %destructor's and
118 %printer's as experimental. Don't mention Java yet. Discussed at
119 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
120 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
121 (2.3a): Annotate this entry to say the old forms of these features were
122 also experimental.
123 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
124 Bison Symbols): Say they're experimental. Comment out any mention
125 of Java (we'll want this back eventually).
126
02975b9a
JD
1272006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
128
129 Support a file name argument to %defines. Deprecate `=' in
130 %file-prefix, %name-prefix, and %output. Discussed at
131 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
132 * NEWS (2.3a+): Mention.
133 * doc/bison.texinfo (Decl Summary, Bison Symbols): Add entry for new
134 form of %defines, and remove `=' from entries for %file-prefix,
135 %name-prefix, and %output.
136 * src/parse-gram.y (prologue_declaration): Implement.
137 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
138 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
139 all but one occurrence of %name-prefix.
140 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
141 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
142 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
143 occurrence of each of %file-prefix and %output. Add check for %defines
144 with argument.
145 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
146 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
147 Remove the `=' from %output.
148
287b314e
JD
1492006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
150
151 Don't escape $ in test case titles since Autoconf 2.61 now does that
152 correctly.
153 * tests/actions.at (Default %printer and %destructor are not for error
154 or $undefined): Here.
155 (Default %printer and %destructor are not for $accept): Here.
156 * tests/input.at (Invalid $n and @n): Here.
157
3ebecc24
JD
1582006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
159
160 Rename <!> to <>. Discussed starting at
161 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
162 * NEWS (2.3a+): Update.
163 * doc/bison.texinfo (Freeing Discarded Symbols, Bison Symbols):
164 Update.
165 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
166 * src/scan-gram.l (INITIAL): Implement.
167 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
168 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
169 comment.
170 * tests/actions.at (Default tagless %printer and %destructor,
171 Default tagged and per-type %printer and %destructor,
172 Default %printer and %destructor are not for error or $undefined,
173 Default %printer and %destructor are not for $accept,
174 Default %printer and %destructor for mid-rule values): Update.
175 * tests/input.at (Default %printer and %destructor redeclared,
176 Unused values with default %destructor): Update.
177
26b8a438
JD
1782006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
179
180 Don't let %prec take a nonterminal.
181 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
182 token.
183 * tests/input.at (%prec takes a token): New test checking that %prec
184 won't take a nonterminal.
185
07c39ae9
JD
1862006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
187
405d53b7
JD
188 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
189 it was double-quoted.
07c39ae9
JD
190 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
191 grammar is maintained with Bison's highest standards.
192 * src/getargs.c: Fix some typos in Doxygen comments.
193
580b8926
JD
1942006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
195
196 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
197 later. Reported by Paul Eggert in
198 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
199 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
200 * src/scan-code.l (translate_action): Don't bother invoking
201 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
202 (code_scanner_free): Instead of invoking
203 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
204 which frees more.
205 * src/scan-gram.l (gram_scanner_free): Likewise.
206 * src/scan-skel.l (scan_skel): Likewise.
207
4502eadc
JD
2082006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
209
210 * src/files.c (tr): Change return type to void.
211 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
212 has been called previously for the same key.
213 (muscle_find): Return storage instead of value so that
214 --enable-gcc-warnings doesn't produce warnings that the return discards
215 const. aver that the value and storage are the same since storage
216 could potentially be NULL when value is not.
217 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
218 same as 0.
219
7746c8f6
PE
2202006-11-08 Paul Eggert <eggert@cs.ucla.edu>
221
222 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
223 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
224 us a slightly cleaner distribution, and also works.
225 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
226 gnulib changes.
227
eb095650
PE
2282006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
229 and Paul Eggert <eggert@cs.ucla.edu>
230
231 Don't let Bison leak memory except when it complains.
232 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
233 (spec_defines_file, dir_prefix): Now char *, not const char *,
234 since they are freed.
235 * src/files.c: Likewise.
236 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
237 Likewise.
238 (tr): Now operates in-place. All uses changed.
239 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
240 values.
241 (compute_file_name_parts, compute_output_file_names): Don't store
242 read-only data in variables that will be freed.
243 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
244 src_extension, and header_extension.
245 (output_file_names_free): New public function to free
246 spec_verbose_file, spec_graph_file, spec_defines_file,
247 parser_file_name, and dir_prefix.
248 * src/getargs.c (getargs): Don't store read-only data in variables that
249 will be freed.
250 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
251 (which previously existed but was unused), and quotearg_free.
252 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
253 * src/muscle_tab.c: Likewise.
254 (muscle_entry): Make the value char const *,
255 and add a new storage member that is char * and can be freed.
256 (muscle_entry_free): New private function.
257 (muscle_init): Use it instead of free.
258 (muscle_insert, muscle_grow): Update and use new storage member.
259 (muscle_code_grow): Free the string passed to muscle_grow
260 since it's not needed anymore.
261 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
262 add a new `char *code' member.
263 ("{...}"): Declare semantic type as code.
264 * src/scan-code.h (translate_rule_action):
265 (translate_symbol_action, translate_code, translate_action): Return
266 `char const *' rather than `char *' since external code should not free
267 these strings.
268 * src/scan-code.l: Likewise.
269 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
270 which is "{...}" in the parser.
271 * tests/Makefile.am (maintainer-check-valgrind): Set
272 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
273 Valgrind.
274 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
275 complain.
276 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
277 expecting a non-zero exit status sets --leak-check=summary and
278 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
279 this case, and we don't want to hear about it.
280
ac564be4
PE
2812006-11-08 Paul Eggert <eggert@cs.ucla.edu>
282
283 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
284 instead of from the template, to simplify configuration a bit.
285 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
286 and m4/wint_t.m4, as they are needed with the latest gnulib.
287
17bd8a73
JD
2882006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
289
290 Disable unset/unused mid-rule value warnings by default, and recognize
291 --warnings=midrule-values to enable them. Discussed starting at
292 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
293 * NEWS (2.3a+): Mention.
294 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
295 warnings): Add entry for midrule-values subargument.
296 * src/reader.c (symbol_should_be_used): Don't return true just because
297 the value is a set/used mid-rule value unless
298 --warnings=midrule-values was specified.
299 * tests/input.at (Unused values, Unused values before symbol
300 declarations): Run tests with and without --warnings=midrule-values.
301
302 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
303 than LIST_FREE directly.
304
89eb3c76
JD
3052006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
306
307 Finish implementing --warnings=error, which should not be implied by
308 --warnings=all (or by its synonyms -W and --warnings without
309 subarguments).
310 * src/complain.c (set_warning_issued): New function to report that
311 warnings are being treated as errors and to record an error if so.
312 Invoke...
313 (warn_at, warn): ... here.
314 * src/getargs.c (warnings_args, warnings_types): Reorder so that
315 "error - warnings are errors" does not appear above "all - all of the
316 above".
317 (getargs): For -W and --warnings without subarguments, don't let
318 FLAGS_ARGMATCH set warnings_error in warnings_flag.
319 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
320
ba7560e2
JD
3212006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
322
323 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
324 empty subargument list. For example: `bison --warnings= parser.y'.
325
31283fc3
JD
3262006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
327
328 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
329 the parser header file so that gcc doesn't warn.
330
12e35840
JD
3312006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
332
333 Split the default %destructor/%printer into two kinds: <*> and <!>.
334 Discussed starting at
335 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
336 * NEWS (2.3a+): Mention.
337 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
338 previous change today related to mid-rules.
339 (Bison Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 340 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
341 (TYPE_TAG_ANY): Add as <*>.
342 (TYPE_TAG_NONE): Add as <!>.
343 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
344 for <*> and <!>.
345 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
346 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
347 * src/symlist.c (symbol_list_default_new): Split into tagged and
348 tagless versions.
349 (symbol_list_destructor_set, symbol_list_printer_set): Split
350 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
351 SYMLIST_DEFAULT_TAGLESS.
352 * src/symlist.h: Update symbol_list_default*_new prototypes.
353 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
354 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
355 * src/symtab.c (default_destructor, default_destructor_location,
356 default_printer, default_printer_location): Split each into tagged and
357 tagless versions.
358 (symbol_destructor_get, symbol_destructor_location_get,
359 symbol_printer_get, symbol_printer_location_get): Implement tagged
360 default and tagless default cases.
361 (default_destructor_set, default_printer_set): Split each into tagged
362 and tagless versions.
363 * src/symtab.h: Update prototypes.
364 * tests/actions.at (Default %printer and %destructor): Rename to...
365 (Default tagless %printer and %destructor): ... this, and extend.
366 (Per-type %printer and %destructor): Rename to...
367 (Default tagged and per-type %printer and %destructor): ... this, and
368 extend.
369 (Default %printer and %destructor for user-defined end token): Extend.
370 (Default %printer and %destructor are not for error or $undefined):
371 Update.
372 (Default %printer and %destructor are not for $accept): Update.
373 (Default %printer and %destructor for mid-rule values): Extend.
374 * tests/input.at (Default %printer and %destructor redeclared): Extend.
375 (Unused values with default %destructor): Extend.
376
f91b1629
JD
3772006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
378
379 Don't apply the default %destructor/%printer to an unreferenced midrule
380 value. Mentioned at
381 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
382 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
383 like $@n instead of just @n so that the default %destructor/%printer
384 logic doesn't see them as user-defined symbols.
385 (symbol_is_dummy): Check for both forms of the name.
386 * src/reader.c (packgram): Remove the `$' from each midrule symbol
387 name for which the midrule value is referenced in any action.
388 * tests/actions.at (Default %printer and %destructor for mid-rule
389 values): New test.
390 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
391 for change to dummy symbol names.
392
519d0004
JD
3932006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
394
395 Warn about unset midrule $$ if the corresponding $n is used.
396 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
397 $n usage.
398 (packgram): Before invoking grammar_rule_check on any rule, make sure
399 all actions have already been scanned in order to set `used' flags.
400 Otherwise, checking that a midrule's $$ is set will not always work
401 properly because the midrule check must forward-reference the midrule's
402 parent rule.
403 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
404 warning.
405
a501eca9
JD
4062006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
407
408 More improvements to the documentation of the prologue alternatives:
409 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
410 Bison manual.
411 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
412 some text to clarify the relative importance of the new directives and
413 to show how these directives may be viewed as code labels.
414
2cbe6b7f
JD
4152006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
416
417 Similar to the recently removed %before-header, add %code-top as the
418 alternative to the pre-prologue. Mentioned at
419 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
420 Also, let the prologue alternatives appear in the grammar section.
421 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
422 (prologue_declaration): Move the existing prologue alternatives to...
423 (grammar_declaration): ... here and add %code-top.
424 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
425
426 Clean up and extend documentation for the prologue alternatives.
427 * NEWS (2.3a+): Describe prologue alternatives.
428 * doc/bison.texinfo (Prologue): Move discussion of prologue
429 alternatives to...
430 (Prologue Alternatives): ... this new section, and extend it to discuss
431 all 4 directives in detail.
432 (Bison Symbols): Clean up discussion of prologue alternatives and add
433 %code-top.
434
e557d3ea
JMG
4352006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
436
437 DJGPP specific issues.
438
439 * djgpp/config.bat: config.hin has been moved to lib. Adjust
440 config.bat accordingly.
441 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
442 * djgpp/config.site: Likewise.
443
136a0f76
PB
4442006-10-16 Paolo Bonzini <bonzini@gnu.org>
445
27bd5d67
PB
446 Replace %*-header with %provides, %requires, %code. See discussion at
447 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
448
136a0f76
PB
449 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
450 (b4_user_start_header): Remove.
451 * data/glr.c: Use new macros instead of b4_*start_header
452 and b4_*end_header.
453 * data/glr.cc: Likewise.
454 * data/lalr1.cc: Likewise.
455 * data/push.c: Likewise.
456 * data/yacc.c: Likewise.
457
458 * doc/bison.texinfo: Remove %before-header, rename
459 %{start,end,after}-header to %requires, %provides, %code.
460
461 * src/parse-gram.y: Likewise (also rename token names accordingly).
462 * src/scan-gram.l: Likewise.
463 * tests/actions.at: Likewise.
464
10f429ef
PE
4652006-10-14 Paul Eggert <eggert@cs.ucla.edu>
466
467 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
468 Problem reported by Joel E. Denny.
469
4702006-10-14 Jim Meyering <jim@meyering.net>
471
472 (Sync from coreutils.)
473 Work also when the working directory (with e.g. coreutils sources)
474 is version controlled with git, rather than CVS.
475 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
476 rather than CVS.
477 In messages and comments, say e.g., "checked-out sources",
478 rather than "CVS sources".
479 (version_controlled_file): New function. Work for git as well as
480 for CVS. Don't use grep's -q option.
481 (slurp): Call it here, in place of CVS-specific code.
482
c4bd5bf7
JD
4832006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
484
485 Fix testsuite for ./configure --enable-gcc-warnings:
486 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
487 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
488 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
489 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
490 * test/regression.at (Diagnostic that expects two alternatives):
491 Likewise.
492
46356ea4
PE
4932006-10-12 Paul Eggert <eggert@cs.ucla.edu>
494
231ed89a
PE
495 * bootstrap.conf (gnulib_modules): Add config-h.
496 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
497 worry about HAVE_CONFIG_H.
498 * lib/abitset.c: Likewise.
499 * lib/bitset.c: Likewise.
500 * lib/bitset_stats.c: Likewise.
501 * lib/bitsetv-print.c: Likewise.
502 * lib/bitsetv.c: Likewise.
503 * lib/ebitset.c: Likewise.
504 * lib/get-errno.c: Likewise.
505 * lib/lbitset.c: Likewise.
506 * lib/subpipe.c: Likewise.
507 * lib/timevar.c: Likewise.
508 * lib/vbitset.c: Likewise.
509 * lib/bitset.c: Include "bitset.h" first, to test interface.
510 * lib/bitset_stats.c: Include "bitset_stats.h" first.
511 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
512 * lib/bitsetv.c: Include "bitsetv.h" first.
513 * lib/get-errno.c: Include "get-errno.h" first.
514 * m4/.cvsignore: Add config-h.m4.
515 * tests/actions.at (Default %printer and %destructor for ...):
516 Adjust expected line numbers in output to reflect removal of #if
517 HAVE_CONFIG_H lines.
518 * tests/glr-regression.at (Missed %merge type warnings when ...):
519 Likewise.
520 * tests/regression.at (Braced code in declaration in rules section):
521 Likewise.
522 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
523 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
524 Include <config.h> unconditionally.
525
46356ea4
PE
526 * bootstrap: Sync from coreutils, as follows:
527
528 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
529
530 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
531 variable was sometimes used without being initialized. This
532 messed up the installation of the INSTALL file in some cases.
533
534 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
535
536 * bootstrap (usage, main program, symlink_to_gnulib): Add option
537 --copy. Inspired by a suggestion from Bruno Haible.
538
539 2006-10-03 Jim Meyering <jim@meyering.net>
540
541 * bootstrap: Undo last change to this file, since now gnulib-tool
542 sticks with the automake default in generating dependencies.
543
dd4bf078
PE
5442006-10-12 Paul Eggert <eggert@cs.ucla.edu>
545
cf2a5f7c
PE
546 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
547 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
548
549 * doc/bison.1: Add copyright notice.
550
551 * data/glr.c: Don't include <stdarg.h>; not used.
552
35fe0834
PE
553 * NEWS: The -g and --graph options now output graphs in Graphviz
554 DOT format, not VCG format.
555 * doc/bison.1: Likewise.
556 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
557 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
558 of this change in
559 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
560 * TODO: Remove Graphviz entry.
561 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
562 remove vcg.c, vcg.h, vcg_defaults.h.
563 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
564 * src/graphviz.c, src/graphviz.h: New files.
565 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
566 * src/files.h: Make comment more generic.
567 * src/main.c (main): Likewise.
568 * src/print_graph.h: Likewise.
569 * src/getargs.c (usage): Make usage description more generic.
570 * src/print_graph.c: Include graphviz.h rather than vcg.h.
571 (static_graph, fgraph): Remove. All uses changed to pass
572 arguments instead of sharing a static var.
573 (print_core, print_actions, print_state, print_graph):
574 Output graphviz format rather than VCG format.
575 * tests/.cvsignore: Remove *.vcg; add *.dot.
576 * tests/output.at: Expect *.dot files, not *.vcg files.
577
dd4bf078
PE
578 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
579 accommodates the 2006-10-08 change.
580
efdd7421
PE
5812006-10-11 Bob Rossi <bob@brasko.net>
582
583 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
584 (b4_yyssa, b4_yyerror_range): New macros.
585 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
586 (yypvarsinit): Remove init of removed fields.
587 (yypushparse): Remove use of removed fields; use new macros instead.
588
96a1981a
PE
5892006-10-11 Paul Eggert <eggert@cs.ucla.edu>
590
591 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
592 in a push parser. Reindent slightly to match yacc.c better.
593
5942006-10-11 Bob Rossi <bob@brasko.net>
595
46356ea4
PE
596 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
597 yymsg_alloc fields.
598 (yypvarsinit, yypushparse): Remove init of removed fields.
599 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 600
c1630a8b
PE
6012006-10-09 Paul Eggert <eggert@cs.ucla.edu>
602
603 * THANKS: Add Paolo Bonzini and Bob Rossi.
604
90b9908d
PB
6052006-10-08 Paolo Bonzini <bonzini@gnu.org>
606
607 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
608 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
609 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
610 b4_define_user_cde and uses): Remove.
611 (b4_comment, b4_prefix, b4_sync_start): New.
612 * data/bison.m4: New file, with most of the content removed from c.m4.
613 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
614 * src/output.c (output_skeleton): Pass bison.m4.
615 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
616 only if specified.
617
cf806753
PE
6182006-10-05 Paul Eggert <eggert@cs.ucla.edu>
619
620 Fix test failure reported by Tom Lane in
621 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
622 and try to make such failures easier to catch in the future.
623 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
624 that's now the caller's responsibility.
625 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
626 Set yychar = YYEOF if it's negative.
627 * tests/actions.at (yylex): Abort if asked to read past EOF.
628 * tests/conflicts.at (yylex): Likewise.
629 * tests/cxx-type.at (yylex): Likewise.
630 * tests/glr-regression.at (yylex): Likewise.
631 * tests/input.at (yylex): Likewise.
632 * tests/regression.at (yylex): Likewise.
633 * tests/torture.at (yylex): Likewise.
634
0e2f006a
PE
6352006-10-01 Paul Eggert <eggert@cs.ucla.edu>
636
637 Fix problems with translating English-language diagnostics.
638 * bootstrap: Fix bug introduced in recent bootstrap changes, with
639 respect to bison-runtime pot generation. The YY_ stuff
640 wasn't being captured.
641 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
642 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
643 * runtime-po/POTFILES.in: Add data/push.c.
644
e3ddc1e3
PE
6452006-09-29 Paul Eggert <eggert@cs.ucla.edu>
646
647 Merge bootstrap changes from coreutils.
648
649 2006-09-28 Jim Meyering <jim@meyering.net>
650
651 Automatically generated dependencies are important even
652 when all of the sources in a directory come from gnulib.
653 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
654 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
655
656 2006-09-23 Jim Meyering <jim@meyering.net>
657
658 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
659
660 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
661
662 * bootstrap: Add support for --force.
663 (usage): New function. Describe usage less tersely.
664 (CVS_only_file): New var.
665
01e972b3
PE
6662006-09-21 Paul Eggert <eggert@cs.ucla.edu>
667
668 * data/push.c (YYPUSH_MORE): Make it an enum instead.
669 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
670 Adjust white space and comments to match GNU style better.
671
c63d3e90
PE
6722006-09-20 Bob Rossi <bob@brasko.net>
673
674 * data/push.c (yyresult_get): Remove function.
675 (YYPUSH_MORE): Add #define.
676 (yypushparse): Modify return value.
677
e70f46d1
PE
6782006-09-20 Paul Eggert <eggert@cs.ucla.edu>
679
680 * stamp-h.in: Remove; no longer needed.
681 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
682 Remove config.h, config.hin, intl (no longer created).
683 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
684 stamp-h1.
685
686 Sync bootstrap from coreutils, as follows:
687
688 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
689
690 * bootstrap (symlink_to_gnulib): New function.
691 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
692 to copies-of-gnulib.
693 (cp_mark_as_generated, slurp, gnulib_files):
694 Avoid making a copy if it's the same as the old version.
695 (gnulib_files): Add support for this variable (used by Bison).
696
a92be413
PE
6972006-09-20 Paul Eggert <eggert@cs.ucla.edu>
698
699 * src/getargs.c (usage): Rework to use conventions similar to
700 coreutils, to make translation a bit easier and the code a bit
701 smaller. Problem reported by Tim Van Holder.
702
4f82b42a
PE
7032006-09-15 Paul Eggert <eggert@cs.ucla.edu>
704
3b2942e6
PE
705 Use some of gnulib's new modules, taken from coreutils.
706
707 * bootstrap: Sync from coreutils, except add support for gnulib_files.
708 * bootstrap.conf: New file.
709 (gnulib_modules): Add configmake, inttypes, unistd.
710 (XGETTEXT_OPTIONS): Add complain, complain_at,
711 fatal, fatal_at, warn, warn_at, unexpected_end.
712 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
713 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
714 (gl_EARLY): Add.
715 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
716 (gl_INIT): Add
717 (GNULIB_AUTOCONF_SNIPPET): Remove.
718 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
719 the pickiest.
720 * lib/.cvsignore: Add inttypes_.h.
721 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
722 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
723 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
724 no-longer-necessary initializations.
725 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
726 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
727 use the unistd module.
728 * src/system.h: Likewise.
729 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
730 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
731 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
732 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
733 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
734 * src/system.h: Include inttypes.h unconditionally, now that we
735 use the inttypes module. Don't bother to include stdint.h, since
736 inttypes.h now does that for us.
737 (LOCALEDIR): Remove, now that we use the configmake module.
738 * src/getargs.c: Include configmake.h.
739 * src/main.c: Likewise.
740 * src/output.c: Likewise.
741 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
742 not from $abs_top_builddir, since config.h moved.
743
744
4f82b42a
PE
745 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
746 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
747
748 * src/parse-gram.y (symbol_declaration): Don't put statements
749 before declarations; it's not portable to C89.
750 * src/scan-code.l (handle_action_at): Likewise.
751
752 * src/scan-code.l: Always initialize braces_level; the old code
753 left it uninitialized and therefore had undefined behavior.
754
755 Don't attempt to redefine 'assert', since it runs afoul of
756 systems where standard headers (mistakenly) include <assert.h>.
757 Instead, define and use our own alternative, called 'aver'.
758 * src/reader.c: Don't include assert.h, since we no longer
759 use assert.
760 * src/scan-code.l: Likewise.
761 * src/system.h (assert): Remove, replacing with....
762 (aver): New function, taking a bool arg. All uses changed.
763 * src/tables.c (pack_vector): Ensure that aver arg is bool,
764 not merely an integer.
765
31c10e38
PE
7662006-09-15 Bob Rossi <bob@brasko.net>
767
768 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
769 * data/c.m4 (YYPUSH): New.
770 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
771 * src/getargs.c (push_parser): New var.
772 * src/getargs.h (push_parser): New declaration.
773 * src/output.c (prepare): Add macro insertion of `push_flag'.
774 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
775 (prologue_declaration): Parse %push-parser.
776 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
777 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
778 list of removed lines from the traces observed.
779 (AT_CHECK_CALC_LALR): Added push parser tests.
780
fa7b79c0
PE
7812006-09-13 Paul Eggert <eggert@cs.ucla.edu>
782
21fe08ca
PE
783 * NEWS: Version 2.3a.
784 * configure.ac (AC_INIT): Likewise.
785
e8ec4d9b
PE
786 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
787 "#define YYSTYPE int" that caused "make maintainer-check" to fail
788 due to header ordering dependencies. I don't know why the #define
789 was there.
790
fa7b79c0
PE
791 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
792 runtime cost when YYDEBUG is not defined, and so that some tests
793 that used to fail now work. Problem and initial suggestion by
794 Paolo Bonzini.
795 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
796 * data/glr.cc (b4_parser_class_name):
797 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
798 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
799 (yydebug_) [YYDEBUG]: New member.
800 (yycdebug_): Now defined only if YYDEBUG.
801 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
802 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
803 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
804 if YYYDEBUG.
805 (debug_stream, set_debug_stream, debug_level, set_debug_level):
806 Define only if YYDEBUG.
807 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
808 set_debug_level.
809 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
810 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
811 AT_CHECK_CALC_GLR_CC that are working now.
812
4ec13d60
PE
8132006-09-12 Paul Eggert <eggert@cs.ucla.edu>
814
815 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
816 We don't need them in glr.cc, and glr.c defines them.
817 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
818 assumes that defining it to anything is the same as defining
819 it to 1. Problem reported by Paolo Bonzini.
820
8e1687ae
PE
8212006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
822
823 * data/c.m4 (b4_null, b4_case): Define.
824 * src/output.c (prepare_symbols): Use b4_null.
825 (user_actions_output): Use b4_case.
826
3dc5e96b
PE
8272006-09-11 Paul Eggert <eggert@cs.ucla.edu>
828
aef3da86
PE
829 * data/glr.c (b4_shared_declarations): Put start-header first,
830 before any #includes that we generate, so that feature-test
831 macros work. Problem reported by Michael Deutschmann in
832 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
833 * data/lalr1.cc: Likewise.
834 * doc/bison.texinfo (Prologue): Document that feature-test macros
835 should be defined before any Bison declarations.
836 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
837 that depend on location.hh after, not before, Bison decls, since
838 we now include location.hh after the first user prologue.
839
3dc5e96b
PE
840 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
841 Sander Brandenburg in
842 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
843 Also, fix minor white space and comment issues.
aef3da86
PE
844 (Prologue): Mention that it's better to define feature-test macros
845 before Bison declarations. Problem reported by Michael Deutschmann.
846
847 * README-cvs: Fix typo: "&" should be "&&". Problem reported
848 by Jim Meyering.
849 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
850 This adjusts to recent gnulib changes.
3dc5e96b 851
b2a0b7ca
JD
8522006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
853
854 Finish implementation of per-type %destructor/%printer. Discussed
855 starting at
856 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
857 and
858 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
859 * NEWS (2.3+): Add a description of this feature to the default
860 %destructor/%printer description.
861 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
862 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
863 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
864 list node contains a semantic type.
865 * src/symtab.c, src/symtab.h: Extend with a table that associates
866 semantic types with their %destructor's and %printer's.
867 (semantic_type_from_uniqstr, semantic_type_get,
868 semantic_type_destructor_set, semantic_type_printer_set): New functions
869 composing the public interface of that table.
870 (symbol_destructor_get, symbol_destructor_location_get,
871 symbol_printer_get, symbol_printer_location_get): If there's no
872 per-symbol %destructor/%printer, look up the per-type before trying
873 the default.
874 * tests/actions.at (Per-type %printer and %destructor): New test case.
875 * tests/input.at (Default %printer and %destructor redeclared):
876 Extend to check that multiple occurrences of %symbol-default in a
877 single %destructor/%printer declaration is an error.
878 (Per-type %printer and %destructor redeclared, Unused values with
879 per-type %destructor): New test cases.
880
3be03b13
JD
8812006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
882
883 Require default %destructor/%printer to be declared using
884 %symbol-default instead of an empty symbol list, and start working on
885 new per-type %destructor/%printer. Discussed at
886 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
887 * NEWS (2.3+): Add %symbol-default to example.
888 * bison.texinfo (Freeing Discarded Symbols): Likewise.
889 (Bison Symbols): Add entry for %symbol-default.
890 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
891 (generic_symlist, generic_symlist_item): New nonterminals for creating
892 a list in which each item is a symbol, semantic type, or
893 %symbol-default.
894 (grammar_declaration): Use generic_symlist in %destructor and %printer
895 declarations instead of symbols.1 or an empty list.
896 (symbol_declaration, precedence_declaration, symbols.1): Update actions
897 for changes to symbol_list.
898 * src/reader.c: Update for changes to symbol_list.
899 * src/scan-code.l: Likewise.
900 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
901 * src/symlist.c, src/symlist.h: Extend such that a list node may
902 represent a semantic type or a %symbol-default in addition to just an
903 ordinary symbol. Add switched functions for setting %destructor's and
904 %printer's.
905 * tests/actions.at, tests/input.at: Add %symbol-default to all default
906 %destructor/%printer declarations.
907
3508ce36
JD
9082006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
909
910 Whether the default %destructor/%printer applies to a particular symbol
911 isn't a question of whether the user *declares* that symbol (in %token,
912 for example). It's a question of whether the user by any means
913 *defines* the symbol at all (by simply using a char token, for
914 example). $end is defined by Bison whereas any other token with token
915 number 0 is defined by the user. The error token is always defined by
916 Bison regardless of whether the user declares it with %token, but we
917 may one day let the user define error as a nonterminal instead.
918 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
919 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
920 the meaning of "user-defined".
921 * tests/actions.at (Default %printer and %destructor for user-declared
922 end token): Rename to...
923 (Default %printer and %destructor for user-defined end token): ...
924 this.
925
926 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
927 computation of whether to apply the default, don't maintain a list of
928 every Bison-defined symbol. Instead, just check for a first character
929 of '$', which a user symbol cannot have, and check for the error token.
930
9350499c
JD
9312006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
932
933 Don't apply the default %destructor or %printer to the error token,
934 $undefined, or $accept. This change fits the general rule that the
935 default %destructor and %printer are only for user-declared symbols,
936 and it solves several difficulties that are described in the new test
937 cases listed below.
938 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
939 * tests/actions.at (Default %printer and %destructor are not for error
940 or $undefined, Default %printer and %destructor are not for $accept):
941 New test cases.
942
4d7370cb
JD
9432006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
944
945 Allow %start after the first rule.
946 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
947 when parsing the first rule.
948 (check_and_convert_grammar): Search for it here after all grammar
949 declarations have been parsed. Skip midrules, which have dummy LHS
950 nonterminals.
951 * src/symtab.c (symbol_is_dummy): New function.
952 * src/symtab.h (symbol_is_dummy): Declare it.
953 * tests/input.at (%start after first rule): New test.
954
6d0ef4ec
JD
9552006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
956
957 Redo some of the previous commit: add back the ability to use
958 non-aliased/undeclared string literals since it might be useful to
959 those declaring %token-table.
960 * src/reader.c (check_and_convert_grammar): Undo changes in previous
961 commit: don't worry about complaints from symbols_pack.
962 * src/symtab.c (symbol_new, symbol_class_set,
963 symbol_check_alias_consistency): Undo changes in previous commit: count
964 each string literal as a new symbol and token, assign it a symbol
965 number, and don't complain about non-aliased string literals.
966 (symbols_pack): Since symbol_make_alias still does not decrement symbol
967 and token counts but does still set aliased tokens to the same number,
968 symbol_pack_processor now leaves empty slots in the symbols array.
969 Remove those slots.
970 * tests/regression.at (Undeclared string literal): Remove test case
971 added in previous commit since non-aliased string literals are allowed
972 again.
973 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
974 remove unnecessary string literal declarations.
975 * tests/sets.at (Firsts): Likewise.
976
965537bc
JD
9772006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
978
979 Don't allow an undeclared string literal, but allow a string literal to
980 be used before its declaration.
981 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
982 symbols_pack complained.
983 * src/symtab.c (symbol_new): Don't count a string literal as a new
984 symbol.
985 (symbol_class_set): Don't count a string literal as a new token, and
986 don't assign it a symbol number since symbol_make_alias does that.
987 (symbol_make_alias): It's not necessary to decrement the symbol and
988 token counts anymore. Don't assume that an alias declaration occurs
989 before any uses of the identifier or string, and thus don't assert that
990 one of them has the highest symbol number so far.
991 (symbol_check_alias_consistency): Complain if there's a string literal
992 that wasn't declared as an alias.
993 (symbols_pack): Bail if symbol_check_alias_consistency failed since
994 symbol_pack asserts that every token has been assigned a symbol number
995 although undeclared string literals have not.
996 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 997 string literal): New test cases.
965537bc
JD
998 (Characters Escapes, Web2c Actions): Declare string literals as
999 aliases.
1000 * tests/sets.at (Firsts): Likewise.
1001
47aee066
JD
10022006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
1003
1004 In the grammar scanner, STRING_FINISH unclosed constructs and return
1005 them to the parser in order to improve error messages.
1006 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
1007 SC_BRACED_CODE, SC_PROLOGUE): Implement.
1008 * tests/input.at (Unclosed constructs): New test case.
1009 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
1010 seen.
1011
1012 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
1013 unused global.
1014
1f6b3679
JD
10152006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
1016
1017 Handle string aliases for character tokens correctly.
1018 * src/symtab.c (symbol_user_token_number_set): If the token has an
1019 alias, check and set its alias's user token number instead of its own,
1020 which is set to indicate the alias. Previously, every occurrence of
1021 the character token in the grammar overwrote that alias indicator with
1022 the character code.
1023 * tests/input.at (String aliases for character tokens): New test.
1024
219741d8
JD
10252006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
1026
1027 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
1028
11daa4e7
PE
10292006-08-11 Paul Eggert <eggert@cs.ucla.edu>
1030
1031 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
1032 to prevent failures when building on older platforms.
1033 Check for autopoint failure.
1034 Set XGETTEXT_OPTIONS to values that check for C format strings,
1035 so that translators are warned about them (this also helps
1036 prevent core dumps).
1037
1038 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
1039 function, since it simplifies our code a bit.
1040
1041 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
1042 rather than -W, so we don't get bogus warnings about sign comparisons.
1043 Add -Wpointer-arith, since that warning is useful (it reports code
1044 that does not conform to C89 and that some compilers reject).
1045 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
1046 since it's no longer needed.
1047
f9bfc42a
JD
10482006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
1049
1050 Clean up scanners a bit.
1051 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
1052 definitions so gcc won't warn when obstack_for_string is unused.
1053 * src/scan-code.l: config.h and system.h are already #include'd by
1054 scan-code-c.c, so get rid of them here.
1055 * src/scan-gram.l: Likewise.
1056 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
1057 definitions rather than duplicating the rest of it.
1058 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
1059
06e8700a
JD
10602006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
1061
1062 Suppress signed/unsigned comparison warnings for yycheck.
1063 * data/c.m4 (b4_safest_int_type): New macro.
1064 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
1065 a signed int type, cast it to b4_safest_int_type first.
1066 * data/yacc.c: Likewise.
1067 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
1068 also overwritten.
1069
9c437126
PE
10702006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
1071
1072 * doc/bison.texinfo: Fix some typos.
1073
284d8a13
PE
10742006-08-02 Paul Eggert <eggert@cs.ucla.edu>
1075
1076 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
1077 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
1078
1079 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
1080 the latest gnulib does this a different way.
1081 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
1082 translation was patched, so stop omitting it.
1083
ec5479ce
JD
10842006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1085
1086 Enable declaration of default %printer/%destructor. Make the parser
1087 use these for all user-declared grammar symbols for which the user does
1088 not declare a specific %printer/%destructor. Thus, the parser uses it
1089 for token 0 if the user declares it but not if Bison generates it as
1090 $end. Discussed starting at
1091 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
1092 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
1093 and
1094 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
1095 * NEWS (2.3+): Mention.
1096 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
1097 declare a %destructor for a mid-rule's semantic value. It's just
1098 impossible to declare one specific to it.
1099 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
1100 code. Describe default %destructor form.
1101 * src/parse-gram.y (grammar_declaration): Parse default
1102 %printer/%destructor declarations.
1103 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
1104 and symbol_destructor_location_get rather than accessing the destructor
1105 and destructor_location members of struct symbol.
1106 (symbol_printers_output): Likewise but for %printer's.
1107 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
1108 again.
1109 * src/symtab.c (default_destructor, default_destructor_location,
1110 default_printer, default_printer_location): New static global
1111 variables to record the default %destructor and %printer.
1112 (symbol_destructor_get, symbol_destructor_location_get,
1113 symbol_printer_get, symbol_printer_location_get): New functions to
1114 compute the appropriate %destructor and %printer for a symbol.
1115 (default_destructor_set, default_printer_set): New functions to set the
1116 default %destructor and %printer.
1117 * src/symtab.h: Prototype all those new functions.
1118 * tests/actions.at (Default %printer and %destructor): New test to
1119 check that the right %printer and %destructor are called, that they're
1120 not called for $end, and that $$ and @$ work correctly.
1121 (Default %printer and %destructor for user-declared end token): New
1122 test to check that the default %printer and %destructor are called for
1123 a user-declared end token.
1124 * tests/input.at (Default %printer and %destructor redeclared, Unused
1125 values with default %destructor): New tests to check related grammar
1126 warnings and errors.
1127
868d2d96
JD
11282006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
1129
1130 Clean up handling of %destructor for the end token (token 0).
1131 Discussed starting at
1132 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
1133 and
1134 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
1135
1136 Make the skeletons consistent in how they pop the end token and invoke
1137 its %destructor.
1138 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
1139 state, which has token number 0, since this would invoke the
1140 %destructor for the end token.
1141 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
1142 until after shifting the end token, or else it won't be popped.
1143 * data/yacc.c (yyparse): Likewise.
1144
1145 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
1146 it's the end token. Upon termination, destroy an unshifted lookahead
1147 even when it's the end token.
1148 * data/lalr1.cc (yy::parser::parse): Likewise.
1149 * data/yacc.c (yyparse): Likewise.
1150
1151 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
1152 value warnings for the end token when the user gives the end token a
1153 %destructor.
1154
1155 * tests/actions.at (Printers and Destructors): Test all the above.
1156
62a9592d
PE
11572006-07-24 Paul Eggert <eggert@cs.ucla.edu>
1158
1159 Update to latest gnulib and gettext versions.
1160 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
1161 Add fopen-safer.
1162 (gnulib_files): Add m4/warning.m4. Don't worry about files
1163 overwritten by autopoint.
1164 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
1165 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
1166 rejects them.
1167 Don't use autoreconf; instead, invoke autopoint etc. by hand,
1168 so that we can remove the intl files at a better time.
1169 (intl_files_to_remove): Remove aclocal.m4, since it gets
1170 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
1171 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
1172 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
1173 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
1174 Remove datarootdir hack; no longer needed.
1175 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
1176 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
1177 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
1178 strdup.h.
1179 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
1180 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
1181
10d6970f
PE
11822006-07-20 Paul Eggert <eggert@cs.ucla.edu>
1183
1184 * bootstrap: Adjust to today's change to gnulib-tool by invoking
1185 it with --assume-autoconf='latest-stable'.
1186
50a33993
JD
11872006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
1188
1189 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
1190 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
1191 YYSTYPE' and `{'.
1192 * src/muscle_tab.h (muscle_grow): Replace the header comments with
1193 those from muscle_tab.c since the old ones are misleading.
1194
2ce4ed68
AD
11952006-07-13 Akim Demaille <akim@epita.fr>
1196
1197 Support %define "KEY" {VALUE}.
1198 * src/scan-code.h, src/scan-code.l (translate_action)
1199 (translate_rule_action, translate_symbol_action, translate_code):
1200 Return char *, not const char *.
1201 * src/parse-gram.y (declaration): Rename as...
1202 (prologue_declaration): this.
1203 (string_content): Remove this nonterminal, use STRING.
1204 (braceless, content, content.opt): New nonterminal.
1205 Use them.
1206 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
1207 as value.
1208 * src/scan-gram.l (getargs.h): Don't include it.
1209
db7e5eb5
PE
12102006-07-12 Paul Eggert <eggert@cs.ucla.edu>
1211
1212 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
1213 rather than a for-loop that declares a local bool variable. This
1214 should work around a compatibility problem with a Cray x1e C++
1215 compiler reported by Hung Nguyen in
1216 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
1217 The for-loop was introduced in the 2004-11-17 change but I don't
1218 know why it was needed.
1219
a5d80ba5
AD
12202006-07-12 Akim Demaille <akim@epita.fr>
1221
1222 * data/c.m4: Comment changes.
1223
23eb2a69
AD
12242006-07-10 Akim Demaille <akim@lrde.epita.fr>
1225
1226 * src/complain.c (error_message, ERROR_MESSAGE): New.
1227 To factor...
1228 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
1229 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
1230
ddc8ede1
PE
12312006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1232
1233 * NEWS: Instead of %union, you can define and use your own union type
1234 YYSTYPE if your grammar contains at least one <type> tag.
1235 Your YYSTYPE need not be a macro; it can be a typedef.
1236 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
1237 (Union Decl, Decl Summary): Document this.
1238 * data/glr.c (YYSTYPE): Implement this.
1239 * data/glr.cc (YYSTYPE): Likewise.
1240 * data/lalr1.cc (YYSTYPE): Likewise.
1241 * data/yacc.c (YYSTYPE): Likewise.
1242 * src/output.c (prepare): Output tag_seen_flag.
1243 * src/parse-gram.y (declaration, grammar_declaration):
1244 Use 'union_seen' rather than 'typed' to determine whether
1245 %union has been seen, since grammars can now be typed without
1246 %union.
1247 (symbol_declaration, type.opt, symbol_def):
1248 Keep track of whether a tag has been seen.
1249 * src/reader.c (union_seen, tag_seen): New vars.
1250 (typed): remove.
1251 * src/reader.h (union_seen, tag_seen, typed): Likewise.
1252 * src/scan-code.l (untyped_var_seen): New variable.
1253 (handle_action_dollar): Adjust to above changes.
1254 (handle_action_dollar, handle_action_at):
1255 Improve overflow checking for outlandish numbers.
1256 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
1257 avoid new diagnostics generated by above changes.
1258 * tests/regression.at (YYSTYPE typedef): Add test to check
1259 for type tags without %union.
1260
1261 * src/symlist.c (symbol_list_length): Return int, not unsigned
1262 int, since callers expect int. This may need to get revisited
1263 once we have proper integer overflow checking.
1264
1265 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
1266 object is now static.
1267
1268 * src/getargs.c (flags_argmatch): Return void, not int,
1269 to pacify ./configure --enable-gcc-warnings.
1270
1271 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
1272 since last_string is already defined to FLEX_PREFIX (last_string).
1273
7b42569e
AD
12742006-07-09 Akim Demaille <akim@lrde.epita.fr>
1275
1276 Implement --warnings/-W.
1277 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
1278 replaced by...
1279 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
1280 Adjust callers.
1281 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
1282 (warnings_args, warnings_types): New.
1283 (getargs, short_options, long_options): Accept -W/--warnings.
1284 Sort the options by alphabetical order, upper case letter right
1285 before its lower case.
1286
3b452f4e
JD
12872006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1288
1289 Change %merge result type clash warnings to errors. Discussed at
1290 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
1291 * src/reader.c (record_merge_function_type): Use complain_at.
1292 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1293 declared later): Update test case results.
1294
b8a41559
AD
12952006-07-09 Akim Demaille <akim@lrde.epita.fr>
1296
1297 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
1298 to be in alphabetical order.
1299 (trace_args): Spelling fixes.
1300
cd9e1ba2
PE
13012006-07-09 Paul Eggert <eggert@cs.ucla.edu>
1302
1303 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
1304 so they don't collide with user-defined macros.
1305 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
1306 this was never guaranteed, and now that we're using gnulib stdint,
1307 which defines int_fast16_t to long int, the problem is exposed.
1308
cb48f191
PE
13092006-07-08 Paul Eggert <eggert@cs.ucla.edu>
1310
b8445a15
PE
1311 * data/c.m4 (b4_basename): Simplify a bit, since we don't
1312 need the full POSIX semantics (and weren't implementing them
1313 anyway).
1314
cb48f191
PE
1315 Adjust to Autoconf 2.60 and today's gnulib.
1316 * bootstrap (gnulib_modules): Add stdint.
1317 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
1318 no longer copies it.
1319 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
1320 since stdint needs the former and wcwidth (which is now required
1321 by mbswidth) needs the latter.
1322 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
1323 work around a compatibility glitch between gettext 0.14.6 and
1324 Autoconf 2.60.
1325 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
1326 Do not check for uintptr_t, since new stdint module does the right
1327 thing.
1328 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
1329 Add stdint.h, stdint_.h, wcwidth.h.
1330 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
1331 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
1332 stdint.m4, wchar_t.m4, wcwidth.m4.
1333 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
1334 usual order for ../lib/*.h files.
1335 (file_name_split): Use last_component, not base_name, to adjust
1336 to gnulib changes.
1337 * src/parse-gram.h: Include <strverscmp.h> in the usual order
1338 for ../lib/*.h files.
1339 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
1340 Define unconditionally, since we now assume the stdint module.
1341 * src/scan-skel.l: Include <dirname.h>.
1342 (BASE_QPUTS): Use last_component, not base_name.
1343 * src/system.h: Include <unlocked-io.h> in the usual order
1344 for ../lib/*.h files. Include <stdint.h> unconditionally,
1345 since we now use the stdint module.
1346 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
1347 HAVE_UINTPTR_T, since we now use the stdint module.
1348 (base_name): Remove decl, since files now include <dirname.h>
1349 to get the decl.
1350
cd48d21d
AD
13512006-07-08 Akim Demaille <akim@lrde.epita.fr>
1352
1353 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
1354 New, default to 1.
1355 * data/yacc.c, data/glr.c, data/location.cc: Use them.
1356 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
1357 default.
1358 * tests/calc.at: Adjust.
1359
8ec0a172
AD
13602006-07-08 Akim Demaille <akim@lrde.epita.fr>
1361
b8445a15 1362 * data/c.m4 (b4_basename): New.
8ec0a172
AD
1363 (b4_syncline): Also output the location of its invocation (from
1364 the skeleton).
1365 (b4_user_action, b4_define_user_action, b4_user_actions)
1366 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
1367 (b4_user_stype): New.
1368 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
1369
4a678af8
JD
13702006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1371
1372 In the grammar file, the first column is 1 not 0 on the first line as
1373 on every other line.
1374 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
1375 * tests/input.at (Torturing the Scanner): Update output.
1376
1377 * src/scan-gram.l (scanner_cursor): Declare it static.
1378
dd60572a
JD
13792006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
1380
1381 In warnings, say "previous declaration" rather than "first
1382 declaration".
1383 * src/symtab.c (redeclaration): Do that here.
1384 * src/reader.c (record_merge_function_type): In the case of a result
1385 type clash, report the previous declaration rather than the very first
1386 one in the grammar file.
1387 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1388 declared later): Add a third declaration to check this behavior.
1389 * tests/input.at (Incompatible Aliases): Update output.
1390
2073e1b6
AD
13912006-06-27 Akim Demaille <akim@epita.fr>
1392
1393 * doc/Doxyfile.in: New.
1394 * doc/Makefile.am: Use it.
1395 * src/lalr.h, src/symtab.h: Initial doxygenation.
1396
8ee5b538
JD
13972006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1398
1399 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
1400 declared after the %merge. This continues the effort of the previous
1401 patch.
8ee5b538
JD
1402 * src/reader.c (get_merge_function): Don't set the merger type yet.
1403 (record_merge_function_type): New function for setting the merger type
1404 and checking for clashes.
1405 (grammar_current_rule_merge_set): Set the location of the %merge for
1406 the current rule.
1407 (packgram): Invoke record_merge_function_type for each rule now that
1408 all symbol type declarations have been parsed.
1409 * src/reader.h (merger_list.type_declaration_location): New member
1410 storing the location of the first %merge from which the type for this
1411 merging function was derived.
1412 * src/symlist.h (symbol_list.merger_declaration_location): New member
1413 storing the location of a rule's %merge, if any.
1414 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
1415 declared later): New test to catch the error fixed by the above patch.
1416
ffa4ba3a
JD
14172006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1418
1419 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
1420 declarations appear after the rules. Discussed at
1421 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
1422 and
1423 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
1424 Don't mistake the type of $$ in a midrule to be that of its parent
1425 rule's $$.
ffa4ba3a
JD
1426 * src/reader.c (grammar_current_rule_end): Don't invoke
1427 grammar_rule_check yet since not all symbol declarations may have been
1428 parsed yet.
1429 (grammar_midrule_action): Likewise.
1430 Don't record whether the midrule's $$ has been used yet since actions
1431 haven't been translated yet.
1432 Record the midrule's parent rule and its RHS index within the parent
1433 rule.
1434 (grammar_current_rule_action_append): Don't translate the action yet
1435 since not all symbol declarations may have been parsed yet and, thus,
1436 warnings about types for $$, $n, @$, and @n can't be reported yet.
1437 (packgram): Translate the action and invoke grammar_rule_check now that
1438 all symbol declarations have been parsed.
1439 * src/scan-code.l (handle_action_dollar): Now that this is invoked
1440 after parsing the entire grammar file, the symbol list here in the case
1441 of a midrule is actually the midrule's empty RHS, so reference its
1442 parent rule's RHS where necessary.
1443 On the other hand, now that you can already know it's a midrule, you
1444 aren't forced to think $$ has the same type as its parent rule's $$.
1445 (handle_action_at): In the case of a midrule, reference the parent rule
1446 where necessary.
1447 * src/symlist.c (symbol_list_new): Initialize new midrule-related
1448 members.
1449 (symbol_list_length): Now that this is invoked after all rules have
1450 been parsed, a NULL symbol (rather than a NULL symbol list node)
1451 terminates a rule. symbol_list_print already does this correctly.
1452 * src/symlist.h (symbol_list.midrule_parent_rule,
1453 symbol_list.midrule_parent_rhs_index): New members so that midrules can
1454 remember their relationships with their parents.
1455 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
1456 fixed by the above patch.
1457 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
1458 implementing...
1459 (Unused values): ... this old test case and...
1460 (Unused values before symbol declarations): ... this new test case.
1461 This one is the same as `Unused values' except that all symbol
1462 declarations appear after the rules in order to catch the rest of the
1463 errors fixed by the above patch.
1464
e256e17f
JD
14652006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
1466
300a1930
JD
1467 More cleanup.
1468 * src/reader.c (current_rule): Declare it static since it's no longer
1469 used outside this file.
1470 (grammar_current_rule_action_append): Remove redundant arguments from
1471 translate_rule_action invocation.
1472 * src/reader.h (current_rule): Remove this unused extern.
1473 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
1474 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 1475
381ecb06
JD
14762006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
1477
1478 Clean up yesterday's patch.
1479 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
1480 to...
1481 * src/reader.c (grammar_current_rule_action_append): ... here for
1482 consistency with grammar_current_rule_symbol_append.
1483 * tests/regression.at (Braced code in declaration in rules section):
1484 Make yyerror and yylex static as usual.
1485
4210cd0b
JD
14862006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
1487
1488 Fix bug that mistakes braced code in a declaration in the rules section
1489 to be a rule action. Mentioned at
1490 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
1491 * src/scan-gram.l: Move midrule action detection from the start of the
1492 scanning of any braced code to...
1493 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
1494 action. For readability, use $2 and @2 rather than the equivalent
1495 global variables.
1496 * tests/regression.at (Braced code in declaration in rules section):
1497 New test to catch the error fixed by the above patch.
1498
1499 Work on code readability some.
1500 * src/scan-code.l (current_rule): Get rid of this misleading and
1501 redundant declaration: it's actually extern'ed in reader.h.
1502 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
1503 translate_action): Add a rule argument and use it instead of the global
1504 current_rule.
1505 (translate_rule_action): This already receives current_rule through an
1506 argument, so pass it on to translate_action instead of assigning
1507 current_rule to current_rule.
1508 (translate_symbol_action, translate_code): Pass rule = NULL to
1509 translate_action.
1510
34f98f46
JD
15112006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
1512
1513 Rename %before-definitions to %start-header and %after-definitions to
1514 %end-header. Don't use these declarations to separate pre-prologue
1515 blocks from post-prologue blocks. Add new order-independent
1516 declarations %before-header and %after-header as alternatives to the
1517 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
1518 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
1519 * NEWS (2.3+): Update for these changes.
1520 * data/glr.c (b4_before_definitions): Update to...
1521 (b4_start_header): ... this.
1522 (b4_after_definitions): Update to...
1523 (b4_end_header): ... this.
1524 * data/glr.cc: Likewise.
1525 * data/lalr1.cc: Likewise.
1526 * data/yacc.c: Likewise.
1527 * doc/bison.texinfo (The prologue): Update names, and replace remaining
1528 prologue blocks with %*-header declarations.
1529 (Calc++ Parser): Likewise.
1530 (Bison Declaration Summary): Update names.
1531 (Bison Symbols): Update description.
1532 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
1533 (PERCENT_END_HEADER): ... this.
1534 (PERCENT_BEFORE_DEFINITIONS): Update to...
1535 (PERCENT_START_HEADER): ... this.
1536 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
1537 (declaration): Update token names and m4 macro names.
1538 When parsing %end-header and %start-header, invoke translate_code
1539 before muscle_code_grow, and no longer set global booleans to remember
1540 whether these declarations have been seen.
1541 Parse new %after-header and %before-header.
1542 * src/reader.c (before_definitions, after_definitions): Remove.
1543 (prologue_augment): Accept a new bool argument to specify whether to
1544 augment the pre-prologue or post-prologue.
1545 * src/reader.h (before_definitions, after_definitions): Remove these
1546 extern's.
1547 (prologue_augment): Add new bool argument.
1548 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
1549 (PERCENT_END_HEADER): ... this.
1550 (PERCENT_BEFORE_DEFINITIONS): Update to...
1551 (PERCENT_START_HEADER): ... this.
1552 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
1553 * tests/actions.at (Printers and Destructors): Update names.
1554
31b2b07e
JD
15552006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
1556
1557 Add comparison operators for C++ location classes. Discussed at
1558 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
1559 * data/c++.m4 (b4_define_location_comparison): New boolean %define
1560 declaration indicating whether filename_type has an operator==. If
1561 filename_type is `std::string', it defaults to `1', `0' otherwise.
1562 * data/location.cc: Iff b4_define_location_comparison is `1', add
1563 operator== and operator!= for class position and for class location.
1564
1565 Some minor fixes.
1566 * src/scan-action.l: Remove unused file.
1567 * src/symtab.c (symbol_printer_set): Use printer_location not
1568 destructor_location.
1569 * src/symtab.h (struct symbol): Replace incorrect source comment for
1570 printer members.
1571 * tests/input.at (Incompatible Aliases): Update output with correct
1572 printer location.
1573
9bc0dd67
JD
15742006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
1575
1576 Don't put the pre-prologue in the header file. For the yacc.c code
1577 file and the glr.c header and code files, move the pre-prologue before
1578 the token definitions. Add new %before-definitions and
1579 %after-definitions to declare code that will go in both the header file
1580 and code file. Discussed at
1581 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
1582 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
1583 and
1584 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
1585 * NEWS (2.3+): Describe these changes.
1586 * data/glr.c (b4_pre_prologue): Move from within to before...
1587 (b4_shared_declarations): ... this.
1588 Add new b4_before_definitions before b4_token_enums.
1589 Add new b4_after_definitions at the end.
1590 * data/glr.cc (b4_pre_prologue): Replace with...
1591 (b4_before_definitions): ... this in the header file.
1592 (b4_after_definitions): New near the end of the header file.
1593 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
1594 code file right before including the header file.
1595 (b4_before_definitions): New in the previous position of
1596 b4_pre_prologue in the header file.
1597 (b4_after_definitions): New near the end of the header file.
1598 * data/yacc.c: Clean up some m4 quoting especially in the header file.
1599 (b4_token_enums_defines): In the code file, move to right before
1600 YYSTYPE for consistency with the header file.
1601 (b4_before_definitions): New right before b4_token_enums_defines in
1602 both the header and code file.
1603 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
1604 header and code file.
1605 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
1606 of prologues for %union dependencies.
1607 (Bison Declaration Summary): In %defines description, mention the
1608 effect of %before-definitions and %after-definitions on the header
1609 file.
1610 (Calc++ Parser): Forward declare driver in a %before-definitions rather
1611 than in the pre-prologue so that make check succeeds.
1612 (Bison Symbols): Add entries for %before-definitions and
1613 %after-definitions.
1614 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
1615 %before-definitions.
1616 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
1617 (declaration): Parse those declarations and append to
1618 b4_before_definitions and b4_after_definitions, respectively.
1619 * src/reader.c (before_definitions, after_definitions): New bools to
1620 track whether those declarations have been seen.
1621 (prologue_augment): Add to the post-prologue if %union,
1622 %before-definitions, or %after-definitions has been seen.
1623 * src/reader.h (before_definitions, after_definitions): New extern's.
1624 * src/scan-gram.l: Scan the new declarations.
1625 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
1626 prologue block in a %before-definitions or a %after-definitions based
1627 on whether the %union is declared.
1628 * tests/regression.at (Early token definitions with --yacc, Early token
1629 definitions without --yacc): Move tests for token definitions into the
1630 post-prologue since token names are no longer defined in the
1631 pre-prologue.
1632
203b9274
AD
16332006-06-20 Akim Demaille <akim@epita.fr>
1634
1635 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
1636 (symbol_get): Use it.
1637 * src/parse-gram.y: Use it.
1638
a7ee59cf
JD
16392006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
1640
1641 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
1642 build succeeds when configured with --enable-gcc-warnings.
1643
5a2baae7
PE
16442006-06-19 Paul Eggert <eggert@cs.ucla.edu>
1645
33ad1a9c
PE
1646 * src/parse-gram.y (char_name): New function.
1647 (CHAR, STRING, string_content): For %printer, properly escape.
1648 (ID): Prefer fputs to fprintf.
1649 (id): Reindent to be consistent with other rules.
1650 Properly quote char.
1651
5a2baae7
PE
1652 The Translation Project changed its way of publishing translations
1653 to maintainers. I haven't received any responses to my request
1654 for supporting the old way, or for documenting the new way. I
1655 have modified 'bootstrap' to use screen scraping
1656 (in this case, HTML scraping). This is unreliable and inelegant,
1657 but I don't see any better way. Yuck.
1658 * bootstrap (TP_URL, WGET_COMMAND): New vars.
1659 (get_translations): New function, which uses HTML scraping to
1660 deduce locations of latest translations.
1661 Use this function to grab both bison and bison-runtime .po files.
1662 Don't bother priming the pump for the runtime-po domain any more,
1663 as it's now translated better than bison is.
1664
58d7a1a1
AD
16652006-06-19 Akim Demaille <akim@epita.fr>
1666
1667 * src/scan-gram.l: No longer "parse" things after `%union' until
1668 `{'. Rather, return a single "%union" token.
1669 No longer make symbols: return strings, and leave the conversion
1670 to symbols to the parser.
1671 (SC_PRE_CODE, token_type): Remove.
1672 * src/parse-gram.y (%union): New field `character'.
1673 Sort tokens.
1674 (CHAR): New token.
1675 (ID, ID_COLON): Now that the scanner no longer makes them
1676 identifiers, adjust all uses to invoke symbol_get.
1677 (id_colon): New, wraps the conversion from string to symbol.
1678 (%union): Accept a possible union_name.
1679 (symbol): Now can be a char.
1680 * data/c.m4 (b4_union_name): Leave a default value.
1681 * data/glr.c, data/yacc.c: Use it.
1682
b931235e
JD
16832006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
1684
1685 For associating token numbers with token names for "yacc.c", don't use
1686 #define statements unless `--yacc' is specified; always use enum
1687 yytokentype. Most important discussions start at:
1688 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
1689 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
1690 and
1691 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
1692 * NEWS (2.3+): Mention.
1693 * data/c.m4 (b4_yacc_if): New.
1694 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
1695 token #define's.
1696 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
1697 on token name definitions.
1698 * src/getargs.c (usage): Capitalize `Yacc' in English.
1699 * src/output.c (prepare): Define b4_yacc_flag.
1700 * tests/regression.at (Early token definitions): Test that tokens names
1701 are defined before the pre-prologue not just before the post-prologue.
1702 Remove this test case and copy to...
1703 (Early token definitions with --yacc): ... this to test #define's.
1704 (Early token definitions without --yacc): ... and this to test enums.
1705
9e6e7ed2
PE
17062006-06-11 Paul Eggert <eggert@cs.ucla.edu>
1707
1708 * NEWS: Reword the post-2.3 change to not be so optimistic about
1709 removing the old "look-ahead" spelling.
1710 Update previous look-ahead/lookahead change reports.
1711 * REFERENCES: look-ahead -> lookahead (since that's
1712 what he actually wrote).
1713 * doc/refcard.tex: look ahead -> lookahead,
1714 look-ahead -> lookahead
1715
742e4900
JD
17162006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
1717
1718 For consistency, use `lookahead' instead of `look-ahead' or
1719 `look_ahead'. Discussed starting at
1720 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
1721 and then at
1722 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
1723 * NEWS: For the next release, note the change to `--report'.
1724 * TODO, doc/bison.1: Update English.
1725 * doc/bison.texinfo: Update English.
1726 (Understanding Your Parser, Bison Options): Document as
1727 `--report=lookahead' rather than `--report=look-ahead'.
1728 * src/conflicts.c: Update English in comments.
1729 (lookahead_set): Rename from look_ahead_set.
1730 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
1731 (resolve_sr_conflict): Rename local look_ahead_tokens to
1732 lookahead_tokens, and update other uses.
1733 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
1734 count_rr_conflicts, conflicts_free): Update uses.
1735 * src/getargs.c (report_args): Move "lookahead" before alternate
1736 spellings.
1737 (report_types): Update uses.
1738 (usage): For `--report' usage description, state `lookahead' spelling
1739 rather than `look-ahead'.
1740 * src/getargs.h (report.report_lookahead_tokens): Rename from
1741 report_look_ahead_tokens.
1742 * src/lalr.c: Update English in comments.
1743 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
1744 (state_lookahead_tokens_count): Rename from
1745 state_look_ahead_tokens_count.
1746 Rename local n_look_ahead_tokens to n_lookahead_tokens.
1747 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
1748 Rename local n_look_ahead_tokens to n_lookahead_tokens.
1749 Update other uses.
1750 Update English in output.
1751 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
1752 * src/print.c: Update English in comments.
1753 (lookahead_set): Rename from look_ahead_set.
1754 (print_reduction): Rename argument lookahead_token from
1755 look_ahead_token.
1756 (print_core, state_default_rule, print_reductions, print_results):
1757 Update uses.
1758 * src/print_graph.c: Update English in comments.
1759 (print_core): Update uses.
1760 * src/state.c: Update English in comments.
1761 (reductions_new): Update uses.
1762 (state_rule_lookahead_tokens_print): Rename from
1763 state_rule_look_ahead_tokens_print, and update other uses.
1764 * src/state.h: Update English in comments.
1765 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
1766 (state_rule_lookahead_tokens_print): Rename from
1767 state_rule_look_ahead_tokens_print.
1768 * src/tables.c: Update English in comments.
1769 (conflict_row, action_row): Update uses.
1770 * tests/glr-regression.at
1771 (Incorrect lookahead during deterministic GLR,
1772 Incorrect lookahead during nondeterministic GLR): Rename
1773 print_look_ahead to print_lookahead.
1774 * tests/torture.at: Update English in comments.
1775 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
1776 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
1777 (Many lookahead tokens): Update uses.
1778 * data/glr.c: Update English in comments.
1779 * lalr1.cc: Likewise.
1780 * yacc.c: Likewise.
1781 * src/conflicts.h: Likewise.
1782 * src/lalr.h: Likewise.
1783 * src/main.c: Likewise.
1784 * src/output.c: Likewise.
1785 * src/parse-gram.c: Likewise.
1786 * src/tables.h: Likewise.
1787 * tests/calc.at: Likewise.
1788
3c40d0b5
JD
17892006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
1790
1791 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
1792
5d278082
PE
17932006-06-07 Paul Eggert <eggert@cs.ucla.edu>
1794
1795 * TODO: Add request from Nelson H. F. Beebe to be able to install
1796 Bison without installing the yacc script.
1797
9e668899
JD
17982006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
1799
1800 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
1801 and yytext if they're already #define'd.
1802 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
1803 * src/scan-code-c.c: ... here.
1804 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
1805 <config.h>.
1806
0c8e079f
JD
18072006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
1808
1809 Get Bison to build again when configured with --enable-gcc-warnings.
1810 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
1811 missing #include's.
1812 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
1813 loc argument as it shadows a global.
1814 * src/scan-gram.l: Remove stray comma that prevents boundary_set
1815 invocation.
1816
1817 * src/.cvsignore: Add scan-code.c.
1818
2346344a
AD
18192006-06-07 Akim Demaille <akim@epita.fr>
1820
1821 * src/scan-gram.l: Move the "add a trailing ; to actions" code
1822 to...
1823 * src/scan-code.l: here.
1824 * tests/input.at (Torturing the Scanner): Fix another location
1825 error.
1826
4862bdfd
AD
18272006-06-07 Akim Demaille <akim@epita.fr>
1828
1829 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
1830
e9071366
AD
18312006-06-06 Akim Demaille <akim@epita.fr>
1832
1833 Extract the parsing of user actions from the grammar scanner.
1834 As a consequence, the relation between the grammar scanner and
1835 parser is much simpler. We can also split "composite tokens" back
1836 into simple tokens.
1837 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
1838 * src/scan-gram.l (add_column_width, adjust_location): Move to and
1839 rename as...
1840 * src/location.h, src/location.c (add_column_width)
1841 (location_compute): these.
1842 Fix the column count: the initial column is 0.
1843 (location_print): Be robust to ending column being 0.
1844 * src/location.h (boundary_set): New.
1845 * src/main.c: Adjust to scanner_free being renamed as
1846 gram_scanner_free.
1847 * src/output.c: Include scan-code.h.
1848 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
1849 Use boundary_set.
1850 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
1851 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
1852 which is now, again, a separate token.
1853 Adjust all dependencies.
1854 Whereever actions with $ and @ are used, use translate_code.
1855 (action): Remove this nonterminal which is now useless.
1856 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
1857 (grammar_current_rule_action_append): Use translate_code.
1858 (packgram): Bound check ruleno, itemno, and rule_length.
1859 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
1860 (last_string, last_braced_code_loc, max_left_semantic_context)
1861 (scanner_initialize, scanner_free, scanner_last_string_free)
1862 (gram_out, gram_lineno, YY_DECL_): Move to...
1863 * src/scan-gram.h: this new file.
1864 (YY_DECL): Rename as...
1865 (GRAM_DECL): this.
1866 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
1867 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
1868 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
1869 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
1870 Move these declarations, and...
1871 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
1872 these to...
1873 * src/flex-scanner.h: this new file.
1874 * src/scan-gram.l (rule_length, rule_length_overflow)
1875 (increment_rule_length): Remove.
1876 (last_braced_code_loc): Rename as...
1877 (gram_last_braced_code_loc): this.
1878 Adjust to the changes of the parser.
1879 Move all the handling of $ and @ into...
1880 * src/scan-code.l: here.
1881 * src/scan-gram.l (handle_dollar, handle_at): Remove.
1882 (handle_action_dollar, handle_action_at): Move to...
1883 * src/scan-code.l: here.
1884 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
1885 scan-code.h, scan-code-c.c, scan-gram.h.
1886 (EXTRA_bison_SOURCES): Add scan-code.l.
1887 (BUILT_SOURCES): Add scan-code.c.
1888 (yacc): Be robust to white spaces.
1889
1890 * tests/conflicts.at, tests/input.at, tests/reduce.at,
1891 * tests/regression.at: Adjust the column numbers.
1892 * tests/regression.at: Adjust the error message.
7891a7c4 1893
184e42f0
JD
18942006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
1895
1896 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
1897 Use Akim's wording from
1898 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
1899
7891a7c4
JD
19002006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
1901
1902 Between Bison releases, manually append `+' to the previous Bison
1903 release number, and use that as a signal to automatically print the
1904 ChangeLog's CVS Id keyword from --version. Discussed starting at
1905 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
1906 * ChangeLog: Add Id header.
1907 * configure.ac (AC_INIT): Append `+' to `2.3'.
1908 * src/.cvsignore: Add revision.c.
1909 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
1910 (BUILT_SOURCES): Add revision.c.
1911 (revision.c): New target rule. This file defines a new global variable
1912 named revision. It initializes it with either the Id from ChangeLog
1913 or, if VERSION doesn't contain `+', with the empty string.
1914 * src/getargs.c (version): Print the value of revision.
1915 * src/revision.h: Extern revision.
1916
4ad3ed84
PE
19172006-06-05 Paul Eggert <eggert@cs.ucla.edu>
1918
1919 * NEWS: Version 2.3.
1920 * configure.ac (AC_INIT): Likewise.
1921
02103984
PE
19222006-05-30 Paul Eggert <eggert@cs.ucla.edu>
1923
1924 * data/glr.c (YYRECOVERING): Define to be a function-like macro
1925 with no arguments, not as an object-like macro. This is for
1926 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
1927 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
1928 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
1929 Document this.
1930
2c08afa5
JD
19312006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
1932
1933 * src/getargs.c (usage): Back out yesterday's modification of the
1934 --help output so that we don't have to wait for translation before
1935 releasing 2.3.
1936
6077da58
PE
19372006-05-29 Paul Eggert <eggert@cs.ucla.edu>
1938
1939 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
1940 Problem reported by Akim Demaille.
1941
2a26b6c2
JD
19422006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
1943
1944 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
1945
aefef0d6
PE
19462006-05-26 Paul Eggert <eggert@cs.ucla.edu>
1947
1948 * data/yacc.c (yy_reduce_print): Omit trailing white space in
1949 generated source code. Problem reported by Frans Englich in
1950 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
1951
fcd8e201
PE
19522006-05-22 Paul Eggert <eggert@cs.ucla.edu>
1953
1954 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
1955 shell, not within 'make', so that 'make' by an ordinary builder
1956 (using GNU make) does not worry about configuring gzip. This also
1957 works around a bug reported independently by Keith Thompson and by
1958 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
1959 stderr rather than stdout, messing up the build logs.
1960
7b5cdcbd
JD
19612006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
1962
1963 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
1964 to make sure that YYID will never be unused. This fixes a 'make
1965 maintainer-check' failure caused by the recent changes to the 'Trivial
1966 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
1967 not used.
1968 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
1969
5ad0a449
JD
19702006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
1971
1972 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
1973 state before an empty RHS is always resolved here. Only the location
1974 of that state is guaranteed to be resolved, and that's enough. This
1975 fixes the remaining bug reported by Derek M. Jones in
1976 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
1977 * tests/glr-regression.at (Uninitialized location when reporting
1978 ambiguity): Test the above case.
1979 Also, the embedded comments in this test case claim it checks the case
1980 of an empty RHS that has inherited the initial location. However, the
1981 corresponding LHS was already resolved, so yyresolveLocations didn't
1982 actually have reason to modify it. Fix this by forcing
1983 nondeterministic operation at the beginning of the parse.
1984
50cce58e
PE
19852006-05-20 Paul Eggert <eggert@cs.ucla.edu>
1986
1987 * data/c.m4 (b4_yy_symbol_print_generate):
1988 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
1989 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
1990 of the bugs reported today by Derek M Jones in
1991 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
1992 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
1993 defined to be a type name without parens or brackets.
1994 (Location Type): Similarly for YYLTYPE.
1995 * tests/regression.at (Trivial grammars): Put in a test for this
1996 bug that will be caught by 'make maintainer-check' (though not,
1997 alas, by 'make check' unless your compiler is picky).
1998
ab8d9dc5
PE
19992006-05-19 Paul Eggert <eggert@cs.ucla.edu>
2000
0d2c8934 2001 * NEWS: Version 2.2.
ab8d9dc5
PE
2002 * configure.ac (AC_INIT): Likewise.
2003
9138c575
JD
20042006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
2005
2006 * data/glr.c (yyreportTree): Make room in yystates for the state
2007 preceding the RHS. This fixes the segmentation fault reported by Derek
2008 M. Jones in
2009 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
2010 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
2011 to the user. Reported for yyreportTree by Derek M. Jones later in the
2012 same thread.
2013 * THANKS: Add Derek M. Jones.
2014 Update my email address.
2015 Fix typo in Steve Murphy's name.
2016
276f48df
PE
20172006-05-14 Paul Eggert <eggert@cs.ucla.edu>
2018
d6645148
PE
2019 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
2020 checking against YYLAST that caused the parser to miss a potential
2021 alternative in its diagnostic.
2022 Problem reported by Maria Jose Moron Fernandez in
2023 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
2024 * data/lalr1.cc (yysyntax_error_): Likewise.
2025 * data/yacc.c (yysyntax_error): Likewise.
2026 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
2027 tokens, in case we run into an older C compiler.
2028 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
2029 Use them to check for the off-by-one error fixed above.
2030
276f48df
PE
2031 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
2032 YYSIZE_T, not size_t.
2033 * tests/regression.at (Trivial grammars): New test, to catch
2034 the error fixed by the above patch.
2035
cd8b5791
AD
20362006-05-14 Akim Demaille <akim@lrde.epita.fr>
2037
2038 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
2039 scheme.
2040 Reported by Steve Murphy.
2041
34376418
AD
20422006-05-14 Akim Demaille <akim@lrde.epita.fr>
2043
2044 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
2045 * data/glr.cc: b4_location_flag is now b4_locations_flag.
2046
327afc7c
AD
20472006-05-14 Akim Demaille <akim@lrde.epita.fr>
2048
2049 Implement --trace=m4.
2050 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
2051 * src/output.c (output_skeleton): When set, pass -dV to m4.
2052
2053 Factor the handling of flags in m4.
2054 * src/output.c (prepare): Rename the muscle names debug, defines,
2055 error_verbose to debug_flag, defines_flag, error_verbose_flag.
2056 * data/c.m4: Adjust.
2057 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
2058 Use b4_define_flag_if to define other b4_FLAG_if macros.
2059 (b4_location_if): As a consequence, rename as...
2060 (b4_locations_if): this, for consistency.
2061 Adjust all the skeletons.
2062
ba9ecd19
AD
20632006-05-14 Akim Demaille <akim@lrde.epita.fr>
2064
2065 * etc/bench.pm: Shorten bench names.
2066
4e83ea15
AD
20672006-05-14 Akim Demaille <akim@lrde.epita.fr>
2068
2069 * src/output.h, src/output.c (error_verbose): Move to...
2070 * src/getargs.h, src/getargs.c: here.
2071 Sort the flags.
2072 Adjust dependencies.
2073
6e93d810
PE
20742006-05-13 Paul Eggert <eggert@cs.ucla.edu>
2075
2076 * data/c.m4 (b4_copyright): Put the special exception for Bison
2077 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
2078 uses changed. Suggested by Akim Demaille. Also, wrap the
2079 copyright notice, in case it is longer than 80 columns. Replace
2080 comma by newline after title.
6e93d810 2081
eaea13f5
PE
20822006-05-11 Paul Eggert <eggert@cs.ucla.edu>
2083
2084 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
2085 incompatibility, not a bug. Mention that it wasn't fixed as of
2086 flex 2.5.33.
2087
3cf084ec
AD
20882006-05-11 Akim Demaille <akim@lrde.epita.fr>
2089
2090 * examples/extexi: Enforce the precedence of concatenation over
2091 >>.
0a9f1c7d 2092 Reported by Tommy Nordgren.
3cf084ec 2093
32c96bd7
AD
20942006-05-11 Akim Demaille <akim@lrde.epita.fr>
2095
2096 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
2097 with the member "token".
f94705b2 2098 Reported by Martin Nylin.
32c96bd7 2099
eaea13f5
PE
21002006-05-08 Paul Eggert <eggert@cs.ucla.edu>
2101
2102 * data/glr.c: Switch to Bison 2.2 special-exception language in
2103 the copyright notice. Use more-regular format for titles and
2104 copyright notices.
2105 * data/glr.cc: Likewise.
2106 * data/location.cc: Likewise.
2107 * data/yacc.cc: Likewise.
2108 * doc/bison.texinfo (Conditions): Document this.
2109 * NEWS: likewise. Upgrade version to 2.2.
2110
6e2d1146
AD
21112006-04-27 Akim Demaille <akim@lrde.epita.fr>
2112
2113 * data/glr.cc: Remove dead code.
2114
47671055
PE
21152006-04-25 Paul Eggert <eggert@cs.ucla.edu>
2116
2117 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
2118 that variable and the line breaks the bootstrap. Problem reported
2119 by Juan M. Guerrero.
2120
ed2e6384
AD
21212006-04-24 Akim Demaille <akim@lrde.epita.fr>
2122
2123 * doc/bison.texinfo (Multiple start-symbols): New.
2124
3cedc2dc
AD
21252006-04-24 Akim Demaille <akim@lrde.epita.fr>
2126
2127 * etc/README, etc/bench.pl: New.
2128
b2ddc3f3
AD
21292006-04-03 Akim Demaille <akim@lrde.epita.fr>
2130
2131 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
2132 rule.
2133 Reported by Mickael Labau.
2134 * tests/input.at (Torturing the Scanner): Test it.
2135
91e3ac9a
PE
21362006-03-16 Paul Eggert <eggert@cs.ucla.edu>
2137
2138 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
2139 Problem reported by Bob Rossi.
2140
21412006-03-13 Paul Eggert <eggert@cs.ucla.edu>
2142
2143 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
2144 and didn't really work.
2145 For the index, use @ifnotinfo, not @iftex.
2146 Minor cleanups of spacing and terminology.
2147
5cf61e93
AD
21482006-03-12 Akim Demaille <akim@lrde.epita.fr>
2149
2150 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
2151 of AT_NAME_PREFIX when %name-prefix is not used.
2152
aa08666d
AD
21532006-03-12 Akim Demaille <akim@lrde.epita.fr>
2154
2155 Apply --prefix to C++ skeletons too: they change the namespace.
2156 The test suite already exercize these cases.
2157 * data/c++.m4 (b4_namespace): New.
2158 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
2159 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
2160 * data/yacc.c, data/glr.c: Remove a useless `[]'.
2161 * doc/bison.texinfo: Document it.
2162 (Option Cross Key): Use @multitable in all formats. It looks
2163 nicer, even in TeX outputs.
2164 (Rules): Use the same code whatever the output type is.
2165 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
2166 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
2167 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 2168
45567173
AD
21692006-03-10 Akim Demaille <akim@lrde.epita.fr>
2170
2171 * TODO: Remove dead items.
2172
e9d8f881 21732006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
2174
2175 * doc/FAQ: Remove, merged into...
2176 * doc/bison.texinfo (FAQ): this.
2177 * doc/Makefile.am (EXTRA_DIST): Adjust.
2178
c095d689
AD
21792006-03-10 Akim Demaille <akim@lrde.epita.fr>
2180
2181 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
2182 even if empty.
2183 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
2184 * doc/bison.texinfo (Calc++ Scanner): Use it.
2185
6e0f8287
PE
21862006-03-09 Paul Eggert <eggert@cs.ucla.edu>
2187
2188 Fix two nits reported by twlevo, plus one more that I discovered.
2189
2190 * src/assoc.h (assoc_to_string): Give a name to the arg, as
2191 this is the usual Bison style.
2192 * src/location.h (location_print): Likewise.
2193
2194 * src/reader.h (token_name): Likewise.
2195
d6b771c3
PE
21962006-03-08 Paul Eggert <eggert@cs.ucla.edu>
2197
2198 Fix some nits reported by twlevo.
2199 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
2200 and "POSIX". Use more-modern syntax for URLs. Mention C++
2201 and ask for Java. Don't hardwire OS version numbers. Add
2202 copyright notice.
2203 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
2204 * src/conflicts.c (solved_conflicts_obstack): Now static.
2205
1e137b71
JD
22062006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
2207
2208 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
2209 page. Say "you can use it" not "you may use it" as on the web page;
2210 we're describing capabilities not granting permission.
2211
73f2e47e
PE
22122006-03-06 Paul Eggert <eggert@cs.ucla.edu>
2213
6d05403d
PE
2214 * data/glr.c (yyresolveLocations): Rename local variables to avoid
2215 shadowing warnings. Use usual patter for iterating through RHS.
2216 * tests/glr-regression.at
2217 (Uninitialized location when reporting ambiguity):
2218 Modify yylex so that it uses its argument, rather than trying
2219 to rely on ARGSUSED (which doesn't work for gcc with warnings).
2220 const char -> char const.
2221
73f2e47e
PE
2222 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
2223 Don't use tabs inside commands; it messes up 'ps'.
2224 Problem reported by twlevo.
2225
8710fc41
JD
22262006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
2227
2228 * tests/glr-regression.at (Uninitialized location when reporting
2229 ambiguity): New test case.
2230 * data/glr.c (yyresolveLocations): New function, which uses
2231 YYLLOC_DEFAULT.
2232 (yyresolveValue): Invoke yyresolveLocations before reporting an
2233 ambiguity.
2234 * doc/bison.texinfo (Default Action for Locations): Note
2235 YYLLOC_DEFAULT's usage for ambiguity locations.
2236 (GLR Semantic Actions): Cross-reference those notes.
2237
ae952af2
JD
22382006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
2239
2240 * tests/glr-regression.at (Leaked semantic values when reporting
2241 ambiguity): Remove unnecessary union and type declarations.
2242 (Leaked lookahead after nondeterministic parse syntax error): New test
2243 case.
2244 * data/glr.c (yyparse): Check for zero stacks remaining before
2245 attempting to shift the lookahead so that you don't lose it.
2246
35ee866a
JD
22472006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2248
2249 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
2250 * tests/glr-regression.at (Leaked semantic values when reporting
2251 ambiguity): New test case.
2252 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
2253 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
2254 now unnecessary yystackp parameter.
2255 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
2256 destructors can be called.
2257
2258 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
2259 in existing testcases.
2260
520181ab
JD
22612006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2262
2263 Don't leak semantic values for parent RHS when a user action cuts the
2264 parser, and clean up related code a bit.
2265 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
2266 cuts parse): Rename to...
2267 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
2268 for leaked parent RHS values.
2269 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
2270 between an unresolved state (non-empty chain of semantic options) and
2271 an incomplete one (signaled by an empty chain).
ae952af2 2272 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
2273 successfully or unsuccessfully resolved yyGLRState to...
2274 (yyresolveValue): ... here so that yyresolveValue always leaves a
2275 yyGLRState with consistent data and thus is easier to understand.
2276 Remove the yyvalp and yylocp parameters since they are always just
2277 taken from the yys parameter. When reporting a discarded merged value
2278 in debugging output, note that it is incompletely merged. Document the
2279 interface.
2280 (yyresolveAction): If resolving any of the RHS states fails, destroy
2281 them all rather than leaking them. Thus, as long as user actions are
2282 written to clean up the RHS correctly, yyresolveAction always cleans up
2283 the RHS of a semantic option. Document the interface.
2284
18d9185c
PE
22852006-02-27 Paul Eggert <eggert@cs.ucla.edu>
2286
2287 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
2288 led to a segmentation fault in GNU Pascal. Problem reported
2289 by Waldek Hebisch.
2290
841a7737
JD
22912006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
2292
2293 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
2294 mid-rule action inside a nonterminal symbol in order to declare a
2295 destructor for its semantic value.
2296
fc3f467f
PE
22972006-02-16 Paul Eggert <eggert@cs.ucla.edu>
2298
2299 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
2300 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
2301 __cplusplus && ! defined _STDLIB_H && !
2302 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
2303 defined free))]: Include <stdlib.h> rather than rolling our own
2304 declarations of malloc and free, to avoid problems with
2305 incompatible declarations (using 'throw') C++'s stdlib.h. This
2306 should fix Debian bug 340012
2307 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
2308 reported by Guillaume Melquiond.
2309
a3af26dd
PE
23102006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2311
4d7bc38c
PE
2312 * NEWS: Clarify symbols versus types in unused-value warnings.
2313
a3af26dd
PE
2314 * configure.ac (AC_INIT): Bump version number.
2315
4e26c69e
PE
23162006-02-13 Paul Eggert <eggert@cs.ucla.edu>
2317
2318 * NEWS: Version 2.1a.
2319 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
2320 since C99 requires this.
2321
498e897c
PE
23222006-02-11 Paul Eggert <eggert@cs.ucla.edu>
2323
2324 * m4/c-working.m4: New file.
2325 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
2326
57bb17ca
PE
23272006-02-10 Paul Eggert <eggert@cs.ucla.edu>
2328
2329 * Makefile.maint: Merge from coreutils.
2330
0be105dc
PE
23312006-02-09 Paul Eggert <eggert@cs.ucla.edu>
2332
2333 More portability fixes for problems summarized by Nelson H. F. Beebe.
2334
2335 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
2336 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
2337 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
2338 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
2339 messes up because C++ code is compiled in 32-bit mode but linked
2340 in 64-bit mode.
2341
6fc0c024
PE
23422006-02-08 Paul Eggert <eggert@cs.ucla.edu>
2343
2344 More portability fixes for problems summarized by Nelson H. F. Beebe.
2345
7870f699
PE
2346 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
2347 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
2348
6fc0c024
PE
2349 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
2350 nodist_PROGRAMS, since we don't need to actually compile the
2351 example if we're just doing a plain 'make'. This avoids bothering
2352 the installer unnecessarily about problems due to weird C++
2353 compilers.
2354
fe6c2fde
PE
23552006-02-06 Paul Eggert <eggert@cs.ucla.edu>
2356
2357 More portability fixes for problems summarized by Nelson H. F. Beebe.
2358
2359 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
2360 than #include "...", and compile with -I'.'. The old method was
2361 not portable, according to Posix and the C standard, and it does
2362 not work with Sun C 5.7, where previous #line directives affect
2363 the working directory used in later #include "..." directives.
2364
927b425b
JMG
23652006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2366
2367 Various DJGGP specific issues in /djgpp
2368
d9735e9e
PE
23692006-02-02 Paul Eggert <eggert@cs.ucla.edu>
2370
2371 More portability fixes for problems summarized by Nelson H. F. Beebe.
2372
2373 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
2374 '#include <map>' works and that you can apply ++ to iterators.
2375
5a6755af
PE
23762006-02-01 Paul Eggert <eggert@cs.ucla.edu>
2377
67a0dc4f
PE
2378 Work around portability problems summarized by Nelson H. F. Beebe in
2379 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
2380
8c86f0ef
PE
2381 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
2382 that '#include <string>' works.
2383
de35dd59
PE
2384 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
2385 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
2386 "warning: sorry: semantics of inline function static data `const
2387 unsigned char translate_table[262]' are wrong (you'll wind up with
2388 multiple copies)".
2389
67a0dc4f
PE
2390 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
2391 or, xor to not_, and_, or_, and xor_, respectively. This works
2392 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
2393 random system header somewhere that includes the equivalent of
2394 <iso646.h>.
2395
5a6755af
PE
2396 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
2397 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 2398 Suite Version 2.0.
5a6755af 2399
3f001415
JD
24002006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
2401
2402 During deterministic GLR operation, user actions should be able to
2403 influence the parse by changing yychar. To make this easier to fix and
2404 to make glr.c easier to evolve in general, don't maintain yytoken in
2405 parallel with yychar; just compute yytoken when needed.
2406 * tests/glr-regression.at (Incorrect lookahead during deterministic
2407 GLR): Check that setting yychar in a user action has the intended
2408 effect.
2409 * data/glr.c (yyGLRStack): Remove yytokenp member.
2410 (yyclearin): Don't set *yytokenp.
2411 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
2412 yychar rather than *yytokenp to determine the current lookahead.
2413 Compute yytoken locally when needed.
2414 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
2415 point to.
2416
2417 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
2418 after `--report' documentation.
2419
e2a8c0f5
PE
24202006-01-30 Paul Eggert <eggert@cs.ucla.edu>
2421
2422 * src/parse-gram.y (grammar_declaration): Location of printer
2423 symbol is @1, not list->location. Bug reported by twlevo.
2424 * tests/input.at (Incompatible Aliases): Adjust to above change.
2425
6b702268
PE
24262006-01-29 Paul Eggert <eggert@cs.ucla.edu>
2427
27622431
PE
2428 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
2429 all the test at once. This makes the output easier to read in the
2430 normal case.
2431
6b702268
PE
2432 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
2433 got from <http://bro-ids.org/download.html>. The bug is that
2434 when two actions appeared in succession, the second one was
2435 scanned before the first one was added to the grammar rule
2436 as a midrule action. Bison then output the incorrect warning
2437 "parse.y:905.17-906.36: warning: unused value: $3".
2438 * src/parse-gram.y (BRACED_CODE, action): These are no longer
2439 associated with a value.
2440 (rhs): Don't invoke grammar_current_rule_action_append.
2441 (action): Invoke it here instead.
2442 * src/reader.c (grammar_midrule_action): Now extern.
2443 (grammar_current_rule_action_append): Don't invoke
2444 grammar_midrule_action; that is now the scanner's job.
2445 * src/reader.h (last_string, last_braced_code_loc):
2446 (grammar_midrule_action): New decls.
2447 * src/scan-gram.l (last_string): Now extern, sigh.
2448 (last_braced_code_loc): New extern variable.
2449 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
2450 rule already has an action.
2451 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
2452 * tests/input.at (AT_CHECK_UNUSED_VALUES):
2453 Add some tests to check that the above changes fixed the bug.
2454
d40ba6c2
PE
24552006-01-27 Paul Eggert <eggert@cs.ucla.edu>
2456
2457 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
2458 All used changed. Check whether the symbol has a destructor,
2459 not whether it is typed.
2460 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
2461 that the values are still reported as unused. All line numbers
2462 adjusted.
2463
401aace6
PE
24642006-01-23 Paul Eggert <eggert@cs.ucla.edu>
2465
2466 Work around a bug in bro 0.8, which underparenthesizes its
2467 definition of YYLLOC_DEFAULT.
2468 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
2469 their arguments.
2470 * data/lalr1.cc: Likewise.
2471 * data/yacc.cc: Likewise.
2472
06f01bc4
PE
24732006-01-22 Paul Eggert <eggert@cs.ucla.edu>
2474
401aace6
PE
2475 Work around a bug in Pike 7.0, and give the Pike folks a
2476 better way to override the usual int widths.
2477 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
2478 user can override the types.
2479 (short): #undef, to work around a bug in Pike 7.0.
2480 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
2481 (union yyalloc.yyss): Use yytype_int16 rather than short.
2482 All uses changed.
2483 (yysigned_char): Remove.
2484 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
2485 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
2486 * tests/regression.at (Web2c Actions): Adjust to above changes.
2487
2488 * src/reader.c (check_and_convert_grammar): New function.
2489 (reader): Close the input file even if something went wrong during
2490 parsing. Minor file descriptor leak reported by twlevo.
2491
06f01bc4
PE
2492 * src/assoc.c (assoc_to_string): Use a default: abort (); case
2493 to pacify gcc -Wswitch-default.
2494 * src/scan-gram.l (adjust_location): Use a default: break; case
2495 to pacify gcc -Wswitch-default.
2496 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
2497 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
2498 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
2499 Move these decls to scan-skel.l, since they don't need to be
2500 visible elsewhere.
2501 * src/scan-skel.l: Accept the above decls.
2502 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
2503 is used.
2504
02650b7f
PE
25052006-01-21 Paul Eggert <eggert@cs.ucla.edu>
2506
2507 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
2508 since we don't want to insist on a version number at the start
2509 of the changelog every time.
2510 * Makefile.maint: Sync from coreutils a bit better.
2511 (sc_trailing_blank): Renamed from sc_trailing_space.
2512 All uses changed.
2513 (sc_no_if_have_config_h, sc_require_config_h):
2514 (sc_prohibit_assert_without_use): New rules.
2515 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
2516 (sc_dd_max_sym_length): Fix leading spaces in rule.
2517 (sc_system_h_headers): Prefix with @.
2518 (sc_useless_cpp_parens, m4-check): Output line numbers.
2519 (changelog-check): Allow version only in head.
2520 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
2521 satisfy new Makefile.maint rule.
2522 * data/glr.c: Likewise.
2523 * data/glr.cc: Likewise.
2524 * data/lalr1.cc: Likewise.
2525 * data/yacc.c: Likewise.
2526 * lib/ebitsetv.c: Likewise.
2527 * lib/lbitset.c: Likewise.
2528 * lib/subpipe.c: Likewise.
2529 * lib/timevar.c: Likewise.
2530 * src/system.h: Likewise.
2531 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
2532 * djgpp/Makefile.maint: Add copyright notice.
2533 * djgpp/README.in: Likewise.
2534 * djgpp/config.bat: Likewise.
2535 * djgpp/config.site: Likewise.
2536 * djgpp/config_h.sed: Likewise.
2537 * djgpp/djunpack.bat: Likewise.
2538 * djgpp/config.sed: Fix copyright notice to match standard format.
2539 * djgpp/subpipe.h: Likewise.
2540 * lib/bitsetv-print.c: Likewise.
2541 * lib/bitsetv.c: Likewise.
2542 * lib/subpipe.h: Likewise.
2543 * lib/timevar.c: Likewise.
2544 * lib/timevar.h: Likewise.
2545 * djgpp/subpipe.c: Use standard recipe for config.h.
2546 * lib/abitset.c: Likewise.
2547 * lib/bitset.c: Likewise.
2548 * lib/bitset_stats.c: Likewise.
2549 * lib/bitsetv-print.c: Likewise.
2550 * lib/bitsetv.c: Likewise.
2551 * lib/ebitsetv.c: Likewise.
2552 * lib/get-errno.c: Likewise.
2553 * lib/lbitset.c: Likewise.
2554 * lib/subpipe.c: Likewise.
2555 * lib/timevar.c: Likewise.
2556 * lib/vbitset.c: Likewise.
2557 * tests/local.at: Likewise.
2558 * src/scan-gram.l: Don't include verify.h, since system.h does
2559 that for us.
2560 * .x-sc_require_config_h: New file.
2561 * .x-sc_unmarked_diagnostics: New file.
2562
287c78f6
PE
25632006-01-20 Paul Eggert <eggert@cs.ucla.edu>
2564
287c78f6
PE
2565 Be a bit more systematic about using 'abort'.
2566 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
2567 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
2568 Put 'default: abort ();' before some other case, to satisfy older
2569 pedantic compilers.
2570 * lib/bitset_stats.c (bitset_stats_init): Likewise.
2571 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
2572 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
2573 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
2574 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
2575 (get_decision_str, get_orientation_str, get_node_alignment_str):
2576 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
2577 (get_linestyle_str, get_arrowstyle_str): Likewise.
2578 * src/conflicts.c (resolve_sr_conflict):
2579 Use a default case rather than one for the one remaining enum
2580 value, to catch invalid enum values as well.
2581 * src/lalr.c (set_goto_map, map_goto):
2582 Prefer "assert (FOO);" to "if (!FOO) abort ();".
2583 * src/nullable.c (nullable_compute, token_definitions_output):
2584 Likewise.
2585 * src/reader.c (packgram, reader): Likewise.
2586 * src/state.c (transitions_to, state_new, state_reduction_find):
2587 Likewise.
2588 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
2589 (symbol_pack): Likewise.
2590 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
2591 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
2592 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
2593 * src/system.h: Don't include <assert.h>.
2594 (assert): New macro.
2595
2596 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
2597 (Destructor Decl, Parser Function, Pure Calling):
2598 Describe rules for braces inside C code more carefully.
287c78f6 2599
c66dfadd
PE
26002006-01-19 Paul Eggert <eggert@cs.ucla.edu>
2601
c21493b8
PE
2602 Fix some porting glitches found by Nelson H. F. Beebe.
2603 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
2604 compilers that don't understand that abort () does not return.
2605 * src/state.c (transitions_to): Likewise.
2606 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
2607 that '#include <cstdlib>' works.
2608 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
2609 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
2610 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
2611 for the benefit of some pre-C99 compilers.
2612
b6e3facf
PE
2613 * bootstrap: Undo changes to gnulib files that autoreconf made.
2614
c66dfadd
PE
2615 Minor fixups to get 'make maintainer-check' to work.
2616 * configure.ac: Don't use -Wnested-externs, as it's incompatible
2617 with the new verify.h implementation.
2618 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
2619 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
2620 * data/yacc.c (YYUSE): Likewise.
2621 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
2622 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
2623 * src/parse-gram.y (declaration): Don't pass a string constant
2624 to a function that expects char *, since GCC might complain
2625 about the constant value.
2626 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
2627 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
2628 before #defining them.
2629 * tests/glr-regression.at
2630 (Incorrectly initialized location for empty right-hand side in GLR):
2631 In yyerror, use the msg arg.
2632 (Corrupted semantic options if user action cuts parse):
2633 (Incorrect lookahead during deterministic GLR):
2634 (Incorrect lookahead during nondeterministic GLR):
2635 Don't name a local var 'index'; it shadows string.h's 'index'.
2636
ed94ef2a
AD
26372006-01-19 Akim Demaille <akim@epita.fr>
2638
2639 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
2640 location, not just parts of it.
2641
e9ad4aec
PE
26422006-01-18 Paul Eggert <eggert@cs.ucla.edu>
2643
d6ca7905
PE
2644 * NEWS: Document the fact that multiple %unions are now allowed.
2645 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
2646 * TODO: This feature is now implemented, so remove it from
2647 the wishlist.
d6ca7905 2648
ef1b70e0
PE
2649 * Makefile.maint: Merge with coreutils Makefile.maint.
2650 (CVS_LIST): Use build-aux version if available.
2651 (VERSION_REGEXP): New macro.
2652 (syntax-check-rules): Add sc_no_if_have_config_h,
2653 sc_prohibit_assert_without_use, sc_require_config_h,
2654 sc_useless_cpp_parens.
2655 (sc_obsolete_symbols): Check for O_NDELAY.
2656 (sc_dd_max_sym_length): Track coreutils.
2657 (sc_unmarked_diagnostics): Look in all files, not just *.c.
2658 (sc_useless_cpp_parens): New rule.
2659 (news-date-check): Look for version or today's date.
2660 (changelog-check): Don't require version number near head.
2661 (copyright-check): Use current year instead of hardwiring 2005.
2662 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
2663 (announcement): Add --gpg-key-ID.
2664
2665 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
2666 with "file system".
2667
2073ce56 2668 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
2669 array. Problem reported by twlevo.
2670 * src/reader.c (packgram): Prepend a new sentinel before ritem.
2671 * src/lalr.c (build_relations): Rely on new sentinel.
2672 * src/gram.c (gram_free): Adjust to new sentinel.
2673
b7691f15
JD
26742006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
2675
2676 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
2677 yylookaheadNeeds. All uses updated.
2678 (yysplitStack): Rename local yynewLookaheadStatuses to
2679 yynewLookaheadNeeds.
2680 * data/glr-regression.at (Incorrect lookahead during nondeterministic
2681 GLR): In comments, change `lookahead status' to `lookahead need'.
2682
ddee1b06
PH
26832006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2684
2685 * data/glr.c (yysplitStack): A little stylistic rewrite.
2686
12f4614d
PH
26872006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2688
2689 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
2690
32c29292
JD
26912006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
2692
2693 * doc/bison.texinfo: Fix some typos.
2694 (GLR Semantic Actions): New subsection discussing special
2695 considerations because GLR semantic actions might be deferred.
2696 (Actions): Mention look-ahead usage of yylval.
2697 (Actions and Locations): Mention look-ahead usage of yylloc.
2698 (Special Features for Use in Actions): Add YYEOF entry and mention it
2699 in the yychar entry.
2700 In the yychar entry, remove mention of the local yychar case (pure
2701 parser) since this is irrelevant information when writing semantic
2702 actions and since it's already discussed in `Bison Symbols' where
2703 yychar is otherwise described as an external variable.
2704 In the yychar entry, don't call it the `current' look-ahead since it
2705 isn't when semantic actions are deferred.
2706 In the yychar and yyclearin entries, add note about deferred semantic
2707 actions.
2708 Add yylloc and yylval entries discussing look-ahead usage.
2709 (Look-Ahead Tokens): When discussing yychar, don't call it the
2710 `current' look-ahead, and do mention yylval and yylloc.
2711 (Error Recovery): Cross-reference `Action Features' when mentioning
2712 yyclearin.
2713 (Bison Symbols): In the yychar entry, don't call it the `current'
2714 look-ahead.
2715 In the yylloc and yylval entries, mention look-ahead usage.
2716
de366a2f 27172006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
2718
2719 * tests/glr-regression.at: Update copyright year to 2006.
2720
bf70fa87
JD
27212006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2722
2723 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
2724 use during nondeterministic operation to track which stacks have
2725 actually needed the current lookahead.
2726 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
2727 Allocate, deallocate, resize, and otherwise shuffle space for
2728 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
2729 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
2730 appropriately during nondeterministic operation.
2731 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
2732 members to store the current lookahead to be used by the deferred
2733 user action.
2734 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
2735 from which the RHS is taken. Set the lookahead members of the new
2736 yySemanticOption according to the lookahead status for stack yyk.
2737 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
2738 yyaddDeferredAction.
2739 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
2740 members of yySemanticOption before invoking yyuserAction, and then set
2741 them back to their current values afterward.
2742 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
2743 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
2744 * tests/glr-regression.at: Remove `.' from the ends of recent test case
2745 titles for consistency.
2746 (Leaked merged semantic value if user action cuts parse): In order to
2747 suppress lint warnings, use arguments in merge function, and assign
2748 char value < 128 in main.
2749 (Incorrect lookahead during deterministic GLR): New test case.
2750 (Incorrect lookahead during nondeterministic GLR): New test case.
2751
05449a2c
JD
27522006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2753
de366a2f 2754 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
2755 !yyvaluep as signal that no semantic value is available to print.
2756 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
2757 to print a semantic value.
2758
4158e0a1 27592006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 2760
4158e0a1
JD
2761 * tests/glr-regression.at: For consistency with my newer test cases,
2762 don't thank myself.
2763
d659304d
JD
27642006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
2765
2766 * data/glr.c (yyresolveValue): When merging semantic options, if at
2767 least one user action succeeds but a later one cuts the parse, then
2768 destroy the semantic value before returning rather than leaking it.
2769 (yyresolveStates): If a user action cuts the parse and thus
2770 yyresolveValue fails, ignore the (unset) semantic value rather than
2771 corrupting the yyGLRState, and empty the semantic options list since
2772 the user actions should have called all necessary destructors.
2773 Simplify code with YYCHK.
2774 * tests/glr-regression.at (Corrupted semantic options if user action
2775 cuts parse): New test case.
2776 (Undesirable destructors if user action cuts parse): New test case.
2777 Before applying any of this patch, this test case never actually failed
2778 for me... but only because the corrupted semantic options usually
2779 masked this bug.
2780 (Leaked merged semantic value if user action cuts parse): New test
2781 case.
2782
6ec2c0f2
AD
27832006-01-05 Akim Demaille <akim@epita.fr>
2784
2785 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
2786
1b9c21fb
PE
27872006-01-04 Paul Eggert <eggert@cs.ucla.edu>
2788
2789 * data/c.m4 (b4_c_modern): New macro, with a new provision for
2790 _MSC_VER. Problem reported by Cenzato Marco.
2791 (b4_c_function_def): Use it.
2792 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
2793 b4_c_modern.
2794 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
2795 than rolling our own.
2796
84866159
AD
27972006-01-04 Akim Demaille <akim@epita.fr>
2798
2799 Also warn about non-used mid-rule values.
2800 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
2801 member.
2802 (symbol_list_new): Adjust.
2803 * src/reader.c (symbol_typed_p): New.
2804 (grammar_rule_check): Use it.
2805 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
2806 Check its rule.
2807 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
2808 Use it.
2809 * tests/actions.at (Exotic Dollars): Adjust.
2810
378f4bd8
AD
28112006-01-04 Akim Demaille <akim@epita.fr>
2812
2813 * src/reader.c (grammar_midrule_action): If $$ is set in a
2814 mid-rule, move the `used' bit to its lhs.
2815 * tests/input.at (Unused values): New.
2816 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
2817
e2a21b6f
PE
28182006-01-03 Paul Eggert <eggert@cs.ucla.edu>
2819
54662697
PE
2820 * doc/bison.texinfo (Bison Options): Say more accurately what
2821 --yacc does.
2822 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
2823 about declarations in the grammar when in Yacc mode, as POSIX does
2824 not require a diagnostic when the grammar uses extensions.
2825
2826 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
2827
073f9288
PE
2828 Warn about dubious constructions like "%token T T".
2829 Reported by twlevo.
2830 * src/symtab.h (struct symbol.declared): New member.
2831 * src/symtab.c (symbol_new): Initialize it to false.
2832 (symbol_class_set): New arg DECLARING, specifying whether
2833 this is a declaration that we want to warn about, if there
2834 is more than one of them. All uses changed.
2835
1221b78a
PE
2836 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
2837 Allow multiple %union directives, whose contents concatenate.
2838 * src/parse-gram.y (grammar_declaration): Likewise.
2839 Use muscle_code_grow, so that we don't need stype_line any more.
2840 All uses changed.
2841
2842 * src/muscle_tab.c (muscle_grow): Fix comment.
2843
e2a21b6f
PE
2844 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
2845 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
2846 Update copyright year to 2006.
2847
8f7e3cf9
AD
28482006-01-03 Akim Demaille <akim@epita.fr>
2849
2850 Have glr.cc pass (some of) the calc.at tests.
2851 * data/glr.cc (b4_parse_param_orig): New.
2852 (b4_parse_param): Improve its definition, and bound it more
2853 clearly in the skeleton.
2854 (b4_epilogue): Append, instead of prepending, in order to keep
2855 #line consistency.
2856 Simplify the generation of auxiliary functions: locations and
2857 purity are mandated.
2858 (b4_global_tokens_and_yystype): Honor it.
2859 * data/location.cc (c++.m4): Don't include it.
2860 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
2861 and AT_SKEL_CC_IF.
2862 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
2863 AT_LALR1_CC_IF.
2864 Be sure to initialize the first position's filename.
2865 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
2866 mandated anyway.
2867 (AT_CHECK_CALC_GLR_CC): New.
2868 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
2869
3953ed88
AD
28702006-01-02 Akim Demaille <akim@epita.fr>
2871
2872 * src/output.c (output_skeleton): Don't hard wire the inclusion of
2873 c.m4.
0a96ba81 2874 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
2875 * data/glr.cc: Do not include stack.hh.
2876
9ecafbbf
AD
28772006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2878
2879 * data/glr.c: Reformat whitespace with tabs.
2880 (b4_lpure_formals): Remove this unused m4 macro.
2881 * tests/cxx-type.at: Reformat whitespace with tabs.
2882 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
2883 since it's a member. Rename type to isNterm for clarity.
2884
c4d497a0
AD
28852005-12-29 Akim <akim@sulaco.local>
2886
2887 Let glr.cc catch up with symbol_value_print.
2888 * data/glr.cc (b4_yysymprint_generate): Replace by...
2889 (b4_yy_symbol_print_generate): this.
2890 (yy_symbol_print, yy_symbol_value_print): Declare them.
2891
4517da37
PE
28922005-12-28 Paul Eggert <eggert@cs.ucla.edu>
2893
2894 * src/location.h (boundary): Note that a line or column equal
2895 to INT_MAX indicates an overflow.
2896 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
2897 (rule_length_overflow, increment_rule_length, add_column_width):
2898 New functions.
2899 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
2900 (<SC_BRACED_CODE>"}"):
2901 Use increment_rule_length rather than incrementing it by hand.
2902 (adjust_location, handle_syncline): Diagnose overflow.
2903 (handle_action_dollar, handle_action_at):
2904 Fix bug with monstrosities like $-2147483648.
2905 Remove now-unnecessary checks.
2906 (scan_integer): Verify assumptions and remove now-unnecessary checks.
2907 (convert_ucn_to_byte): Verify assumptions.
2908 (handle_syncline): New arg LOC. All callers changed.
2909 Don't store through a value derived from char const * pointer.
2910
2911 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
2912 GCC warnings.
2913
e3233bf6
PE
29142005-12-27 Paul Eggert <eggert@cs.ucla.edu>
2915
2916 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
2917 Remove unnecessary forward static decls.
2918
8f3596a6
AD
29192005-12-27 Akim Demaille <akim@epita.fr>
2920
2921 * src/reader.c (grammar_current_rule_check): Also check that $$
2922 is used.
2923 Take the rule to check as argument, hence rename as...
2924 (grammar_rule_check): this.
2925 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
2926 Rename as...
2927 (grammar_rule_begin, grammar_rule_end): these, for consistency.
2928 (grammar_midrule_action, grammar_symbol_append): Now static.
2929 * tests/torture.at (input): Don't rely on the default action
2930 being always performed.
2931 * tests/calc.at: "Set" $$ even when the action is "cut" with
2932 YYERROR or other.
2933 * tests/actions.at (Exotic Dollars): Instead of using unused
2934 values, check that the warning is issued.
2935
721be13c
PE
29362005-12-22 Paul Eggert <eggert@cs.ucla.edu>
2937
2938 * NEWS: Improve wording for unused-value warnings.
2939
a0af42fc
AD
29402005-12-22 Akim Demaille <akim@epita.fr>
2941
2942 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
2943 (b4_yysymprint_generate): Rename as...
2944 (b4_yy_symbol_print_generate): this.
2945 Generate yy_symbol_print instead of yysymprint.
2946 Generate also yy_symbol_value_print, and use it.
2947
affac613
AD
29482005-12-22 Akim Demaille <akim@epita.fr>
2949
721be13c 2950 * NEWS: Warn about unused values.
affac613
AD
2951 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
2952 a `used' member.
2953 (symbol_list_n_get, symbol_list_n_used_set): New.
2954 (symbol_list_n_type_name_get): Use symbol_list_n_get.
2955 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
2956 * src/reader.c (grammar_current_rule_check): Check that values are
2957 used.
2958 * src/symtab.c (symbol_print): Accept 0.
2959 * tests/existing.at: Remove the type information.
2960 Empty the actions.
2961 Remove useless actions (beware of mid-rule actions: perl -000
2962 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
2963 * tests/actions.at (Exotic Dollars): Use unused values.
2964 * tests/calc.at: Likewise.
2965 * tests/glr-regression.at (No users destructors if stack 0 deleted):
2966 Likewise.
2967
2968 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
2969 rule_useful_p.
2970
9d9b8b70
PE
29712005-12-21 Paul Eggert <eggert@cs.ucla.edu>
2972
8bb4c753
PE
2973 Undo 2005-12-01 tentative license wording change. The wording is
2974 still being reviewed by the lawyers, and we don't want to wait for
2975 them before publishing a test release. For now, revert to the
2976 previous wording.
2977 * NEWS: Undo 2005-12-01 change.
2978 * data/glr.c: Revert to previous license wording.
2979 * data/glr.cc: Likewise.
2980 * data/lalr1.cc: Likewise.
2981 * data/location.cc: Likewise.
2982 * data/yacc.c: Likewise.
2983
9d9b8b70
PE
2984 * NEWS: Reword %destructor vs YYABORT etc.
2985 * data/glr.c: Use American spacing, for consistency.
2986 * data/glr.cc: Likewise.
2987 * data/lalr1.cc: Likewise.
2988 * data/yacc.c: Likewise.
2989 * data/yacc.c: Reformat comments slightly.
2990 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
2991 for consistency. Fix some spelling errors and reword recently-included
2992 text slightly.
2993 * tests/cxx-type.at: Cast results of malloc, for C++.
2994
2c3b392a
AD
29952005-12-21 Joel E. Denny <address@hidden>
2996
2997 * tests/cxx-type.at: Construct a tree, count the parents of shared
2998 nodes, and free each node once and only once. Previously, the memory
2999 for semantic values was leaked instead.
3000
d6cff4dc
AD
30012005-12-21 Joel E. Denny <address@hidden>
3002
3003 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
3004 (yylval, yylloc): If pure, #define to yystackp->yyval and
3005 yystackp->yyloc similar to yychar and yynerrs.
3006 (yyparse): If pure, remove local yylval and yylloc. Add local
3007 yystackp to accommodate pure definitions of yylval and yylloc.
3008 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
3009 yylvalp and yyllocp to &yylval and &yylloc.
3010 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
3011 namespace. Previously, nerrs and char were missing, but lval and lloc
3012 weren't necessary.
3013 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
3014 yylvalp and yyllocp parameters since, if pure, these are now always
3015 accessible through yystackp. If not pure, they are still accessible
3016 globally.
3017 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
3018 `if (YYID (N))' to pacify lint.
3019
a85284cf
AD
30202005-12-21 Akim Demaille <akim@epita.fr>
3021
3022 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
3023 destroy the RHS symbols of a rule.
3024 * data/yacc.c (yylen): Initialize to 0.
3025 Keep its value to the number of items to possibly shift.
3026 In particular, a regular successful parse that ends on YYFINAL by
3027 a (internal) YYACCEPT must not have yylen != 0.
3028 (yyerrorlab, yyreturn): Pop the RHS.
3029 Reorder a bit to emphasize the `shifting' bits of code.
3030 (YYPOPSTACK): Now accept a number of items to pop.
3031 * data/lalr1.cc: Likewise.
3032 * data/glr.c: Formatting changes.
3033 Use goto instead of fall through.
3034 * doc/bison.texinfo (Destructor Decl): Complete.
3035
d508c281
JMG
30362005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3037
3038 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3039 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
3040 * djgpp/config.bat: Replace every occurence of the file name
3041 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3042 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3043 * djgpp/config.sed: Replace every occurence of the file name
3044 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
3045 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
3046 * djgpp/djunpack.bat: DJGPP specific file.
3047 * djgpp/fnchange.lst: DJGPP specific file.
3048 * djgpp/README.in: Add new information about how to unpack the bison
3049 source on MSDOS and other systems which have 8.3 file name restrictions
3050 using djunpack.bat and fnchange.lst.
3051
3e7a2cd9
PE
30522005-12-12 Paul Eggert <eggert@cs.ucla.edu>
3053
3054 * bootstrap (build_cvs_prefix): Remove; unused.
3055 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
3056 when getting gnulib.
3057
30582005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
3059
3060 * data/glr.c: Reorder typedef declarations for structs to match order
3061 of struct declarations.
3062 Rename yystack everywhere to yystackp except in yyparse where it's not
3063 a pointer.
3064 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
3065 consistency.
3066 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
3067 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
3068 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
3069 lint.
3070
877519f8
PE
30712005-12-09 Paul Eggert <eggert@cs.ucla.edu>
3072
0eca5a39
PE
3073 * tests/sets.at (Accept): Fix typos in regular expression used to
3074 sed out the final state number.
3075
2cec9080
PE
3076 Work around portability problem on Solaris 10: flex-generated
3077 files include <stdio.h> before <config.h>, which messes up
3078 because the latter defines __EXTENSIONS__. Address the problem
3079 by creating two new little files that include <config.h> first,
3080 then include the flex-generated files. Rewrite everyone else
3081 to include <config.h> first, as well.
3082 * lib/timevar.c: Always include "config.h".
3083 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
3084 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
3085 (EXTRA_bison_SOURCES): New macro.
3086 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
3087 * src/system.h: Don't include config.h.
3088 * src/LR0.c: Include <config.h> first.
3089 * src/assoc.c: Likewise.
3090 * src/closure.c: Likewise.
3091 * src/complain.c: Likewise.
3092 * src/conflicts.c: Likewise.
3093 * src/derives.c: Likewise.
3094 * src/files.c: Likewise.
3095 * src/getargs.c: Likewise.
3096 * src/gram.c: Likewise.
3097 * src/lalr.c: Likewise.
3098 * src/location.c: Likewise.
3099 * src/main.c: Likewise.
3100 * src/muscle_tab.c: Likewise.
3101 * src/nullable.c: Likewise.
3102 * src/output.c: Likewise.
3103 * src/parse-gram.y: Likewise.
3104 * src/print.c: Likewise.
3105 * src/print_graph.c: Likewise.
3106 * src/reader.c: Likewise.
3107 * src/reduce.c: Likewise.
3108 * src/relation.c: Likewise.
3109 * src/state.c: Likewise.
3110 * src/symlist.c: Likewise.
3111 * src/symtab.c: Likewise.
3112 * src/tables.c: Likewise.
3113 * src/uniqstr.c: Likewise.
3114 * src/vcg.c: Likewise.
3115
877519f8
PE
3116 * src/parse-gram.y: Fix minor problems uncovered by lint.
3117 (current_lhs, current_lhs_location): Now static.
3118 (current_assoc): Remove unused variable.
3119
3120 Cleanups so that Bison-generated parsers have less lint.
3121 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
3122 Prepend /*ARGSUSED*/, for lint's sake.
3123 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
3124 definition if 'lint' is defined.
3125 (YYID): New macro (or function, if lint).
3126 All uses of /*CONSTCOND*/0 replaced by YYID(0).
3127 * data/yacc.c: Likewise.
3128 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
3129 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
3130 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
3131 is C++ only.
3132 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
3133 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
3134 Use YYID(0) rather than 0, for lint.
3135 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
3136 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
3137
f5228370
PE
31382005-12-07 Paul Eggert <eggert@cs.ucla.edu>
3139
3140 * tests/glr-regression.at
3141 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
3142 Close memory leak reported by twlevo.
3143
69ce078b
PE
31442005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
3145
6ff99711
PE
3146 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
3147 all stacks.
3148 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
3149 * tests/glr-regression.at (No users destructors if stack 0 deleted):
3150 New test case.
3151 (Duplicated user destructor for lookahead): This test now is expected
3152 to succeed.
3153
af3412cd
PE
31542005-12-01 Paul Eggert <eggert@cs.ucla.edu>
3155
32b5b719 3156 * NEWS: Document the following change.
af3412cd
PE
3157 * data/yacc.c: Say "parser skeleton" rather than "file", since
3158 it's no longer just a file.
3159 * data/glr.c: Grant a special exception for C GLR parsers, that
3160 reads like the already-existing exception for C LALR(1) parsers.
3161 * data/glr.cc: Likewise.
3162 * data/lalr1.cc: Likewise.
3163 * data/location.cc: Likewise.
3164 * data/yacc.c: Reword the "written by" statement to clarify that
3165 it was the parser skeleton, not the entire output file.
3166 * data/glr.c: Written by Paul Hilfinger.
3167 * data/glr.cc: Written by Akim Demaille.
3168 * data/lalr1.cc: Likewise.
3169
035aa4a0
PE
31702005-11-18 Paul Eggert <eggert@cs.ucla.edu>
3171
d9963c85
PE
3172 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
3173 Fix typos in previous change that broke 'make check'.
3174 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
3175 supported in C.
3176 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
3177 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
3178 We can revert this once things settle down.
3179
035aa4a0
PE
3180 * src/conflicts.c (conflicts_print): Don't print file name twice
3181 when %expect fails because there were no conflicts.
3182 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
3183 change.
3184 * tests/conflicts.at (%expect not enough, %expect too much):
3185 (%expect with reduce conflicts): Adjust to new behavior.
3186
31872005-11-18 Akim Demaille <akim@epita.fr>
3188
3189 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
3190 errors.
3191 * NEWS: Document this.
3192 * doc/bison.texinfo (Expect Decl): Likewise.
3193
d1ff7a7c
AD
31942005-11-16 Akim Demaille <akim@epita.fr>
3195
3196 Generalize the display of semantic values and locations in traces.
3197 * data/glr.c (yy_reduce_print): Fix indices (again).
3198 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
3199 literal integers.
3200 * data/lalr1.cc (yyreduce_print): Rename as...
3201 (yy_reduce_print): this.
3202 Display values and locations.
3203 * data/yacc.c (yy_reduce_print): Likewise.
3204 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
3205 (yysymprint): Move higher to be visible from yy_reduce_print).
3206 (yyparse): Adjust.
3207 * tests/calc.at: Adjust the expected length of the traces.
3208
6de5398d
AD
32092005-11-14 Akim Demaille <akim@epita.fr>
3210
3211 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
3212 from 1 to N, while values and location start at 0.
3213 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
3214
a1373f55
AD
32152005-11-14 Akim Demaille <akim@epita.fr>
3216
3217 * data/glr.c (yy_reduce_print): Fix the $ number.
3218
613d8952
AD
32192005-11-14 Akim Demaille <akim@epita.fr>
3220
3221 "Use" parse parameters.
3222 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
3223 * data/glr.c, data/glr.cc: Use them.
3224 * data/glr.c (YYUSE): Have a C++ definition that supports
3225 non-pointer types.
3226
b2741627
AD
32272005-11-14 Akim Demaille <akim@epita.fr>
3228
3229 * data/glr.c (yyexpandGLRStack): Declare only if defined.
3230
5059b5c8
AD
32312005-11-14 Akim Demaille <akim@epita.fr>
3232
42249483
AD
3233 * data/glr.cc: New.
3234 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 3235
4626a15d
AD
32362005-11-12 Akim Demaille <akim@epita.fr>
3237
3238 Let position and location be PODs.
3239 * data/location.cc (position::initialize, location::initialize): New.
3240 (position::position, location::location): Define only if
3241 b4_location_constructors is defined.
3242 * data/lalr1.cc (b4_location_constructors): Define it for backward
3243 compatibility.
3244 * doc/bison.texinfo (Initial Action Decl): Use initialize.
3245
32462005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
3247
3248 * data/lalr1.cc: Move the body of the ctor and dtor into the
3249 parser file (instead of the header).
3250 Wrap the implementations in a "namespace yy".
3251
32522005-11-12 Akim Demaille <akim@epita.fr>
3253
3254 Have glr.c include its header file when created.
3255 * data/glr.c (b4_shared_declarations): New.
3256 Output them verbatim in the parser if !%defines, otherwise
3257 output then in the header file, and include it instead.
3258
1989d947
AD
32592005-11-11 Akim Demaille <akim@epita.fr>
3260
3261 * data/glr.c: Comment changes.
3262
32632005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
3264
3265 When yydebug, report semantic and location values for reductions.
3266 * data/glr.c (yy_reduce_print): Report the semantic values and the
3267 locations.
3268 (YY_REDUCE_PRINT): Adjust.
3269 (yyglrReduce): Use them.
3270 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
3271 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
3272 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
3273 traces.
3274
02998094
AD
32752005-11-10 Akim Demaille <akim@epita.fr>
3276
3277 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
3278 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
3279 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
3280
5210672f
PE
32812005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
3282
3283 * m4/cxx.m4, examples/Makefile.am: Don't build
3284 examples/calc++ if no C++ compiler is available. (trivial change)
3285
a8991a1d
AD
32862005-11-09 Akim Demaille <akim@epita.fr>
3287
3288 * src/scan-skel.l: Use a couple of asserts.
3289
36b5e963
AD
32902005-11-03 Akim Demaille <akim@epita.fr>
3291
3292 In some (weird) cases, the final state number is incorrect.
3293 Reported by Alexandre Duret-Lutz.
3294 * src/LR0.c (state_list_append): Remove the computation of
3295 final_state.
3296 (save_reductions): Do it here.
3297 (get_state): Alpha conversion.
3298 (generate_states): Use a for loop.
3299 * src/gram.h (item_number_is_rule_number)
3300 (item_number_is_symbol_number): New.
3301 * src/state.c: Use assert.
3302 * src/system.h: Include assert.h.
3303 * tests/sets.at (Accept): New.
3304
44e7ead1
PH
33052005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3306
3307 * data/glr.c (yyfill): Adjust comment.
36b5e963 3308 (yyresolveAction): Initialize default location properly
44e7ead1
PH
3309 for empty right-hand sides.
3310 (yydoAction): Ditto.
3311 Add comment explaining apparently dead code.
36b5e963
AD
3312 * tests/glr-regression.at
3313 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 3314 New test.
36b5e963 3315
e10a80ee
PE
33162005-10-30 Paul Eggert <eggert@cs.ucla.edu>
3317
3318 * bootstrap (cleanup_gnulib): New function. Use it to clean up
3319 gnulib when interrupted. This fixes some race conditions and
3320 works around some portability problems (one noted by Paul
3321 Hilfinger).
3322
067b32ee
AD
33232005-10-22 Akim <akim@epita.fr>
3324
3325 * Makefile.cfg: Adjust to config -> build-aux.
3326 Reported by twledo.
3327
4b367315
AD
33282005-10-21 Akim Demaille <akim@epita.fr>
3329
3330 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
3331 the %parse-params.
3332 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
3333 * data/yacc.c (b4_Pure_if): Rename as...
3334 (b4_yacc_pure_if): this.
3335 (YY_SYMBOL_PRINT, yyparse): Adjust.
3336 * doc/bison.texinfo: Formatting changes.
3337
24cc23d9
AD
33382005-10-21 Akim Demaille <akim@epita.fr>
3339
3340 Finish the transition config -> build-aux.
3341 * configure.ac, Makefile.am: Use build-aux.
3342 * config/prev-version, config/announce-gen, config/Makefile.am:
3343 Move to...
3344 * build-aux/prev-version, build-aux/announce-gen,
3345 * build-aux/Makefile.am: here.
3346
d4476375
AD
33472005-10-14 Akim Demaille <akim@epita.fr>
3348
3349 * examples/calc++/test: Use set -x only when VERBOSE.
3350
302c0aee
PE
33512005-10-13 Paul Eggert <eggert@cs.ucla.edu>
3352
3353 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
3354 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
3355
7625ec2c
AD
33562005-10-13 Akim Demaille <akim@epita.fr>
3357
3358 * src/scan-skel.l: Output the base name parts of the parser and
3359 header file names.
302c0aee 3360 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
3361 additional checks.
3362 Use this to exercise C++ outputs in subdirs.
3363 Reported by Oleg Smolsky.
3364
ba0fe3c7
PE
33652005-10-12 Paul Eggert <eggert@cs.ucla.edu>
3366
3367 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
3368 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
3369 Problem reported by John P. Hartmann.
3370 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
3371 already defined it.
3372
9b8a5ce0
AD
33732005-10-12 Akim Demaille <akim@epita.fr>
3374
3375 * src/parse-gram.y (version_check): Exit 63 to please missing
3376 (stands for "version mismatch).
3377 * tests/input.at, doc/bison.texinfo: Adjust.
3378
4f6e011e
PE
33792005-10-10 Paul Eggert <eggert@cs.ucla.edu>
3380
3381 Work around portability problems with Visual Age C compiler
3382 (xlc and xlC_r) reported by John P. Hartmann.
3383 * data/location.cc (initial_column, initial_line): Remove.
3384 All uses replaced by 0 and 1.
3385 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
3386 that xlc complains about.
3387 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 3388 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 3389 as __STDC__.
4d7aa45e
PE
3390 * data/yacc.c (YYMODERN_C): New macro, which also looks at
3391 __STDC_VERSION__. Use it everywhere instead of looking at
3392 __STDC__ and __cplusplus.
4f6e011e 3393
a1b3bf8c
AD
33942005-10-10 Akim Demaille <akim@epita.fr>
3395
3396 * examples/calc++/test: Be quiet unless VERBOSE.
3397
412e44aa
PE
33982005-10-05 Paul Eggert <eggert@cs.ucla.edu>
3399
2a4647a3
PE
3400 * data/c.m4 (yydestruct, yysymprint):
3401 Use YYUSE instead of casting to void.
3402 * data/glr.c (YYUSE): New macro.
3403 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3404 Use it instead of rolling our own.
3405 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3406 (YYCHK1):
3407 Use /*CONSTCOND*/ to suppress lint warnings.
3408 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
3409 (YY_STACK_PRINT): Use 'false' not '0'.
3410 (YYUSE): New macro.
3411 (yysymprint_, yydestruct_): Use it instead of rolling our own.
3412 * data/yacc.c (YYUSE): New macro.
3413 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
3414 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
3415 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
3416
3417
412e44aa
PE
3418 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
3419 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
3420
88c6637f
PE
34212005-10-04 Paul Eggert <eggert@cs.ucla.edu>
3422
2f4f028d
PE
3423 Undo the parts of the unlocked-I/O change that substituted
3424 putc or puts for printf. This might hurt performance a bit,
3425 but some people prefer the printf style.
3426 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
3427 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
3428 All uses replaced by YYFPRINTF and YYDPRINTF.
3429 * data/yacc.c: Likewise.
3430 * lib/bitset.c (bitset_print): Likewise.
3431 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
3432 putc and puts.
3433 * lib/lbitset.c (debug_lbitset): Likewise.
3434 * src/closure.c (print_firsts, print_fderives): Likewise.
3435 * src/gram.c (grammar_dump): Likewise.
3436 * src/lalr.c (look_ahead_tokens_print): Likewise.
3437 * src/output.c (escaped_output): Likewise.
3438 (user_actions_output): Break apart two printfs.
3439 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
3440 * src/reduce.c (reduce_print): Likewise.
3441 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
3442 * src/system.h: Include unlocked-io.h rathe than stdio.h.
3443
88c6637f
PE
3444 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
3445 Use assignments rather than casts-to-void to suppress
3446 unused-variable warnings. This pacifies 'lint'.
3447 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
3448 unused-variable warnings.
3449
fb32e373
JMG
34502005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3451
3452 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
3453
edb8f44f
PE
34542005-10-02 Paul Eggert <eggert@cs.ucla.edu>
3455
fb9c0b33
PE
3456 Use unlocked I/O for a minor performance improvement on hosts like
3457 GNU/Linux and Solaris that support unlocked I/O. The basic idea
3458 is to use the gnlib unlocked-io module, and to prefer putc and
3459 puts to printf when either will work (since the latter doesn't
3460 come in an unlocked flavor).
3461 * bootstrap (gnulib_modules): Add unlocked-io.
3462 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
3463 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
3464 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
3465 and similarly for puts and putc and printf.
3466 * data/yacc.c: Likewise.
3467 * lib/bitset.c (bitset_print): Likewise.
3468 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
3469 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
3470 to printf.
3471 * lib/lbitset.c (debug_lbitset): Likewise.
3472 * src/closure.c (print_firsts, print_fderives): Likewise.
3473 * src/gram.c (grammar_dump): Likewise.
3474 * src/lalr.c (look_ahead_tokens_print): Likewise.
3475 * src/output.c (escaped_output): Likewise.
3476 (user_actions_output): Coalesce two printfs.
2f4f028d 3477 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
3478 * src/reduce.c (reduce_print): Likewise.
3479 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 3480 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 3481
edb8f44f
PE
3482 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
3483 this confuses xgettext.
3484
b50d2359
AD
34852005-10-02 Akim Demaille <akim@epita.fr>
3486
3487 * bootstrap (gnulib_modules): Add strverscmp.
3488 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
3489 * m4/.cvsignore: Add strverscmp.m4.
3490 * src/parse-gram.y (%require): New token, new rule.
3491 (version_check): New.
3492 * src/scan-gram.l (%require): Adjust.
3493 * tests/input.at (AT_REQUIRE): New.
3494 Use it.
3495 * doc/bison.texinfo (Require Decl): New.
3496 (Calc++ Parser): Use %require.
3497
21667f64
AD
34982005-10-02 Akim Demaille <akim@epita.fr>
3499
3500 * data/location.cc: New.
3501
2b81e969
AD
35022005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
3503 Akim Demaille <akim@epita.fr>
3504
3505 Make sure -odir/foo.cc creates dir/location.hh etc.
3506 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
3507 (spec_file_prefix, spec_verbose_file, spec_graph_file)
3508 (spec_defines_file): Now const.
3509 (dir_prefix): New.
3510 (short_base_name): Remove.
3511 * src/files.c: Adjust.
3512 (dirname.h): Include.
3513 (base_name): Don't prototype it.
3514 (finput): Remove, duplicates gram_in.
3515 (full_base_name, short_base_name): Replace by...
3516 (all_but_ext, all_but_tab_ext): these.
3517 (compute_base_names): Rename as...
3518 (compute_file_name_parts): this.
3519 Update to compute the new variables, including dir_prefix.
3520 Adjust dependencies.
3521 * src/output.c (prepare): Output them.
3522 * src/reader.c: Adjust to use gram_in, not finput.
3523 * src/scan-skel.l (@dir_prefix@): New.
3524
ad6a9b97
JMG
35252005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3526
3527 * lib/subpipe.c: New function end_of_output_subpipe() added
3528 to allow support for non-posix systems. This is a no-op function
3529 for posix systems.
3530
3531 * lib/subpipe.h: New function end_of_output_subpipe() added
3532 to allow support for non-posix systems. This is a no-op function
3533 for posix systems.
3534
3535 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
3536 handle the lack of pipe/fork functionality on non-posix systems.
3537
3538 * djgpp/Makefile.maint: DJGPP specific file.
3539
3540 * djgpp/README.in: DJGPP specific file.
3541
3542 * djgpp/config.bat: DJGPP specific configuration file.
3543
3544 * djgpp/config.sed: DJGPP specific configuration file.
3545
3546 * djgpp/config.site: DJGPP specific configuration file.
3547
3548 * djgpp/config_h.sed: DJGPP specific configuration file.
3549
3550 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
3551
3552 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
3553
fc695704
AD
35542005-10-02 Akim Demaille <akim@epita.fr>
3555
3556 * data/location.cc: New, extract from...
3557 * data/lalr1.cc: here.
3558 (location.hh): Include it after the user prologue, in case the
3559 filename type is defined by the user.
3560 Forward declation location and position before the pre-prologue.
3561 (yyresult_): Rename as...
3562 (yyresult): this, it's a local variable, not an attribute.
3563 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
3564
35652005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
3566
3567 * examples/extexi: Restore the #line generation.
3568
fb9712a9
AD
35692005-09-30 Akim Demaille <akim@epita.fr>,
3570 Alexandre Duret-Lutz <adl@gnu.org>
3571
3572 Move the token type and YYSTYPE in the parser class.
3573 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
3574 (parser::token): New, from the moved free definition of tokens.
3575 (parser::semantic_value): Now a full definition instead of an
3576 indirection to YYSTYPE.
3577 (b4_post_prologue): No longer included in the header file, but
3578 in the implementation file.
3579 * doc/bison.texi (C+ Language Interface): Update.
3580 * src/parse-gram.y: Support unary %define.
3581 * tests/actions.at: Define global_tokens_and_yystype for backward
3582 compatibility until we update the tests.
3583 * tests/calc.at: Idem.
3584 (first_line, first_column, last_line, last_column): Define for lalr1.cc
3585 to simplify the code.
3586
55f0c7b1
PE
35872005-09-29 Paul Eggert <eggert@cs.ucla.edu>
3588
3589 Port to SunOS 4.1.4, which lacks strtoul and strerror.
3590 Ah, the good old days! Problem reported by Peter Klein.
3591 * bootstrap (gnulib_modules): Add strerror, strtoul.
3592 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
3593 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
3594
fb9712a9 35952005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
3596
3597 * data/c.m4 (b4_error_verbose_if): New.
3598 * data/lalr1.cc: Use it.
3599 (YYERROR_VERBOSE_IF): Remove.
3600 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
3601 parser members, replaced by...
3602 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
3603 local variables.
3604 (yysyntax_error_): Takes the state number as argument.
3605 (yyreduce_print_): Use the argument yyrule, not the former
3606 attribute yyn_.
3607
8a6f72f3
PE
36082005-09-26 Paul Eggert <eggert@cs.ucla.edu>
3609
3610 * bootstrap (gnulib_modules): Add verify.
3611 * lib/.cvsignore: Add verify.h.
3612 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
3613 * src/system.h (verify): Remove.
3614 Include verify.h instead.
3615 * src/tables.c (tables_generate): Use new API for 'verify'.
3616
0d50976f
PE
36172005-09-21 Paul Eggert <eggert@cs.ucla.edu>
3618
ebc3737e
PE
3619 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
3620 local variables whose names begin with 'yy'.
3621 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
3622 Trivial changes from Joel E. Denny.
3623
0d50976f
PE
3624 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
3625 it itself.
3626 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
3627 don't use alloca any more.
3628
3629 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
3630 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 3631 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
3632 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
3633 to match yacc.c, to test more hosts.
3634
a05b79df
PE
36352005-09-20 Paul Eggert <eggert@cs.ucla.edu>
3636
55289366
PE
3637 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
3638 doesn't affect behavior.
3639 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
3640 Solaris, AIX, MSC.
3641 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
3642 This works a bit better with glibc, if user code has already included
3643 stdlib.h.
3644 * doc/bison.texinfo (Bison Parser): Document that users can't
3645 arbitrarily use malloc and free for other purposes. Document
3646 that <alloca.h> and <malloc.h> might be included.
3647 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
3648 user must declare alloca.
3649
a05b79df
PE
3650 * HACKING (release): Forwarn the Translation Project about
3651 stable releses.
3652
3ab2ca22
AD
36532005-09-20 Akim Demaille <akim@epita.fr>
3654
3655 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
3656
a9739e7c
PE
36572005-09-19 Paul Eggert <eggert@cs.ucla.edu>
3658
a702593e
PE
3659 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
3660 (YYSTACK_ALLOC_MAXIMUM): Use it.
3661 (yysyntax_error): New function.
3662 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
3663 multiple syntax errors are reported, and alloca is being used.
3664 Instead, reallocate buffers twice as big each time, so that
3665 we waste at most half the allocated memory. Start with a small
3666 (128-byte) buffer that will suffice in most cases anyway.
3667 Use yysyntax_error to do most of the work.
3668
3669 * doc/bison.texinfo (Error Reporting, Table of Symbols):
3670 yynerrs is the number of errors reported, not the number of
3671 errors encountered.
3672
a9739e7c
PE
3673 * tests/glr-regression.at (Duplicated user destructor for lookahead):
3674 Mark it as expected to fail.
3675 Cast result of malloc; problem reported by twlevo@xs4all.nl.
3676 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
3677 Don't start user-code symbols with "yy", to avoid name space problems.
3678
f479c6c6
AD
36792005-09-19 Akim Demaille <akim@epita.fr>
3680
3681 Remove the traits, failed experiment.
3682 It never proved useful, and anyway because of the current
3683 definition, it was not possible to have several specialization of
3684 this traits, making it useless.
3685 * data/lalr1.cc (yy:traits): Remove.
3686 Inline its definitions in the parser class.
3687
e2586f82
AD
36882005-09-19 Akim Demaille <akim@epita.fr>
3689
3690 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
3691 least Mac OSX with a /usr/local install of gettext.
3692
2e8cf949
AD
36932005-09-19 Akim Demaille <akim@epita.fr>
3694
3695 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
3696 and yytoken for similarity with the other skeletons.
3697
c7fb0b90
AD
36982005-09-19 Akim Demaille <akim@epita.fr>
3699
4e26c69e 3700 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 3701
1bd0deda
PE
37022005-09-16 Paul Eggert <eggert@cs.ucla.edu>
3703
3704 * NEWS: Version 2.1.
3705
3706 * NEWS: Remove notice of yytname change, since it was never in an
3707 official release.
3708 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
3709 diagnostic.
3710 * src/output.c (prepare): Likewise.
3711 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
3712 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
3713 is not defined. This is an awful hack, but it's enough for now.
3714 All callers changed.
3715 * tests/glr-regression-at (make_value): Args are const pointers now,
3716 to avoid GCC warning.
3717 (Duplicated user destructor for lookahead): New test. Currently
3718 skipped. It fails on my host but I'm not sure it'll always fail.
3719
37202005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
3721
3722 * src/symtab.h (struct symbol): Declare the printer and destructor
3723 as const, to avoid accidental calls to free.
3724 (symbol_destructor_set, symbol_printer_set): Adjust.
3725 * src/symtab.c: Adjust.
3726
1bd0deda 37272005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
3728
3729 * data/c.m4 (b4_token_enums): New.
3730 (b4_token_defines): Rename as...
3731 (b4_token_enums_defines): this.
3732 (b4_token_defines): New, output only the #defines.
3733 * data/yacc.c, data/glr.c: Adjust.
3734 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
3735 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
3736 as default values.
3737
dbcdae2d
AD
37382005-09-16 Akim Demaille <akim@epita.fr>
3739
3740 * data/lalr1.cc (yylex_): Remove, inline its code.
3741 (yyreport_syntax_error_): Remove, replaced by...
3742 (yysyntax_error_): this which returns a string and leaves to the
3743 caller the call to the users' error function.
3744 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
3745 Move from members of the parser object...
3746 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
3747 to local variables of the parse function.
3748
70d8f291
AD
37492005-09-16 Akim Demaille <akim@epita.fr>
3750
3751 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
3752 since it's in Bison's name space.
3753
b47dbebe
PE
37542005-09-15 Paul Eggert <eggert@cs.ucla.edu>
3755
ae199bf1
PE
3756 * data/glr.c (yyresolveValue): Add default case to pacify
3757 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
3758
b47dbebe
PE
3759 * NEWS: Document when yyparse started to return 2.
3760 * doc/bison.texinfo (Parser Function): Document when yyparse
3761 returns 2.
3762
3763 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
3764 (b4_filename_type): Renamed back from b4_file_name_type. All uses
3765 changed.
3766 (class position): file_name -> filename (reverting). All uses changed.
3767
37682005-09-14 Paul Eggert <eggert@cs.ucla.edu>
3769
3770 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
3771 do anything if $@ exists. This reverts part of the 2005-07-07
3772 patch.
3773
00292f66
PE
37742005-09-11 Paul Eggert <eggert@cs.ucla.edu>
3775
3776 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
3777 contains obsolete information and isn't worth distributing as a
3778 separate file anyway.
3779 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
3780 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
3781 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
3782 (yyparse): Abort if user code uses longjmp to throw an unexpected
3783 value.
3784
a420f962
PE
37852005-09-09 Paul Eggert <eggert@cs.ucla.edu>
3786
00292f66
PE
3787 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
3788 Suggested by twlevo@xs4all.nl.
3789
127287e9
PE
3790 * data/glr.c (YYCHK1): Do not assume YYE is in range.
3791 This avoids a diagnostic from gcc -Wswitch-enum.
3792 Problem reported by twlevo@xs4all.nl.
3793
a420f962
PE
3794 * doc/bison.texinfo: Don't use "filename", as per GNU coding
3795 standards. Use "file name" or "file" or "name", depending on
3796 the context.
3797 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
3798 not to hack/foo.tab.c.
3799 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
3800 * data/glr.c: b4_filename -> b4_file_name.
3801 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
3802 All uses changed.
3803 (class position): filename -> file_name. All uses changed.
3804 * data/yacc.c: b4_filename -> b4_file_name.
3805 * lib/bitset.h: filename -> file_name in local vars.
3806 * lib/bitset_stats.c: Likewise.
3807 * src/files.c: Likewise.
3808 * src/scan-skel.l ("@output ".*\n): Likewise.
3809 * src/files.c (file_name_split): Renamed from filename_split.
3810 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
3811
38122005-09-08 Paul Eggert <eggert@cs.ucla.edu>
3813
3814 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
3815 to accommodate latest gnulib.
3816
3817 * tests/glr-regression.at (Duplicate representation of merged trees):
3818 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
3819
3820 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
3821 needed.
3822
42a6501d
PE
38232005-08-26 Paul Eggert <eggert@cs.ucla.edu>
3824
3825 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
3826 All uses changed. Invoke user destructor after an error during a
3827 split parse (trivial change from Joel E. Denny).
3828
3829 * tests/glr-regression.at
3830 (User destructor after an error during a split parse): New test case.
3831 Problem reported by Joel E. Denny in:
3832 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
3833
ef9a1faf
PE
38342005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3835
5b4aaf78
PE
3836 * README-cvs: Give URLs for recommended tools.
3837 Mention Gzip version problem, and bootstrapping issues.
3838 Remove troubleshooting section, as it's somewhat obsolete.
3839
b5240ba5
PE
3840 * bootstrap (no_cache): New var, to accommodate different wget
3841 variants. Use it instead of '-C off'. Problem reported by
3842 twlevo@xs4all.nl.
3843
ef9a1faf
PE
3844 * data/glr.c (yydestroyStackItem): New function.
3845 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
3846 debugging information. Problem reported by Joel E. Denny.
3847
e6efa9da
AD
38482005-08-25 Akim Demaille <akim@epita.fr>
3849
3850 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
3851
adc90f13
PE
38522005-08-24 Paul Eggert <eggert@cs.ucla.edu>
3853
3854 * data/glr.c (yyrecoverSyntaxError, yyreturn):
3855 Don't invoke destructor on unresolved entries.
3856 * tests/glr-regression.at
3857 (User destructor for unresolved GLR semantic value): New test case.
3858 Problem reported by Joel E. Denny in:
3859 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
3860
f9315de5
PE
38612005-08-21 Paul Eggert <eggert@cs.ucla.edu>
3862
15d29c1f
PE
3863 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
3864 Add strnlen.c.
3865 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
3866 lib-prefix.m4, po.m4.
3867
dd5f2af2
PE
3868 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
3869 in yydestruct diagnostic, since it might not be an error.
3870 Problem reported by Joel Denny near end of
3871 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 3872 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
3873 * data/yacc.c (yyreturn): Likewise.
3874 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
3875
3876 * src/files.c: Remove obsolete FIXME comment.
3877
3878 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
3879 with the other templates, and to fix bogus run-on messages such
3880 as the one reported at the end of
3881 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
3882 All callers changed to avoid the newline.
3883 (yyprocessOneStack): Output two lines rather than one, to accommodate
3884 the above change. This changes the debug output format slightly.
3885
f9315de5
PE
3886 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
3887 reported by Joel E. Denny in
3888 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
3889 (trivial change).
3890 * tests/glr-regression.at (Duplicate representation of merged trees):
3891 New test, from Joel E. Denny in:
3892 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
3893 * THANKS: Add Joel E. Denny.
3894
3895 * configure.ac (AC_INIT): Bump to 2.0c.
3896
04098407
PE
38972005-07-24 Paul Eggert <eggert@cs.ucla.edu>
3898
3899 * NEWS: Version 2.0b.
3900
ca5d2013
PE
3901 * Makefile.am (SUBDIRS): Put examples before tests, so that
3902 "make check" doesn't finish with "All 1 tests passed".
3903
3d54b576
PE
3904 * tests/regression.at (Token definitions): Don't rely on
3905 AT_PARSER_CHECK for data that contains backslashes. It currently
3906 uses 'echo', and 'echo' isn't portable if its argument contains
3907 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
3908 that the byte '\0xff' is not printable in the C locale; it is,
3909 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
3910 not printable, so use '\0x81' to test.
3911
d53ae497
PE
3912 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
3913 version of GCC, since the macro is used with non-GCC compilers.
3914
fc01665e
PE
3915 Fix core dump reported by Pablo De Napoli in
3916 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
3917 * tests/regression.at (Invalid inputs with {}): New test.
3918 * src/parse-gram.y (token_name): Translate type before using
3919 it as an index.
3920
04098407
PE
3921 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
3922 the user's name space. All uses changed to __attribute__
3923 ((__unused__)).
3924 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
3925 Add __attribute__ ((__noreturn__)).
3926
3927 * etc/clcommit: Remove. We weren't using it, and it failed
3928 "make maintainer-distcheck".
3929 * Makefile.maint: Merge from coreutils.
3930 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
3931 (syntax-check-rules): Change list of rules as described below.
3932 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
3933 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
3934 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
3935 (sc_trailing_space): New rules.
3936 (sc_xalloc_h_in_src): Remove.
3937 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
3938 (sc_space_tab, sc_error_exit_success, sc_changelog):
3939 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
3940 (makefile-check, po-check, author_mark_check):
3941 (makefile_path_separator_check, copyright-check):
3942 Use grep -n, to make it easier to find violations.
3943 Use CVS_LIST and CVS_LIST_EXCEPT.
3944 (header_regexp, h_re): Remove.
3945 (dd_c): New macro.
3946 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
3947 (my-distcheck): Use more-modern GCC flags.
3948 (signatures, %.asc): Remove.
3949 (rel-files, announcement): Remove signatures.
3950 Restore old updating code, even though we don't use it, so
3951 that we're the same as coreutils.
3952 (alpha, beta, major): Depend on news-date-check.
3953 Make the upload commands.
3954
3955 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
3956 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
3957 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
3958 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
3959 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
3960 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
3961 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
3962 * tests/sets.at: Likewise.
3963
3964 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
3965 we comment out the Autoconf version number.
3966 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
3967 it's error-prone and "make maintainer-distcheck" rejects it.
3968
3969 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
3970 Indent calls to "error" to pacify "make maintainer-distcheck",
3971 when the calls are not intended to be translated.
3972 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
3973
3974 * src/Makefile.am (DEFS): Use +=, to pacify
3975 "make maintainer-distcheck".
3976 (bison_SOURCES): Add scan-skel.h.
3977 (sc_tight_scope): New rule, from coreutils.
3978
3979 * src/files.c (src_extension, header_extension):
3980 Now static, not extern.
3981 * src/getargs.c (short_options): Likewise.
3982 * src/muscle_tab.c (muscle_table): Likewise.
3983 * src/parse-gram.y (current_class, current_type, current_prec):
3984 Likewise.
3985 * src/reader.c (grammar_end, previous_rule_end): Likewise.
3986 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
3987 * src/main.c (main): Cast bindtextdomain and textdomain calls to
3988 void, to avoid warning when NLS is disabled.
3989 * src/output.c: Include scan-skel.h.
3990 (scan_skel): Remove decl, since scan-skel.h does this.
3991 (output_skeleton):
3992 Indent calls to "error" to pacify "make maintainer-distcheck".
3993 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
3994 * src/reader.h (gram_end, gram_lineno): New decls to pacify
3995 "make maintainer-distcheck".
3996 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
3997 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
3998 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
3999 (skel_lex_destroy, scan_skel): Move these decls to...
4000 * src/scan-skel.h: New file.
4001 * src/uniqstr.c (uniqstr_assert):
4002 Indent calls to "error" to pacify "make maintainer-distcheck".
4003
4004 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
4005 not @VAR@.
4006
4007 * tests/torture.at: Revamp to avoid misuse of atoi that
4008 "make maintainer-distcheck" complained about.
4009
4010 * examples/extexi (message): Don't print a message more than once,
4011 and omit line-number decoration that makes Emacs compile think
4012 that informative messages are worth worrying about.
4013
40142005-07-22 Paul Eggert <eggert@cs.ucla.edu>
4015
4016 * configure.ac: Update version number.
4017
4018 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
4019 accidentally.
4020 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
4021 autogenerated by the maintainer.
4022 * examples/calc++/.cvsignore: Add *.yy.
4023
4024 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
4025 * lib/bitset_stats.c (bitset_stats_init): Likewise.
4026 * lib/bitsetv.c (bitsetv_alloc): Likewise.
4027
4028 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
4029
4030 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
4031 from maintainer-distcheck about casting the argument of 'free'.
4032
4033 * NEWS: Mention recent yytname changes.
4034 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
4035
4036 * bootstrap: For translations that have not yet been upgraded to
4037 the new runtime-po domain, prime the pump by extracting the
4038 relevant strings from the obsolete translations. This code can be
4039 removed once the bison-runtime domain has been translated by each
4040 team.
4041
4042 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
4043 now that token names are already quoted.
4044
4045 Fix problem reported by Anthony Heading.
4046 * data/glr.c (YYTOKEN_TABLE): New macro.
4047 (yytname): Define if YYTOKEN_TABLE.
4048 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
4049 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
4050 (YYERROR_VERBOSE): Define the same way the other skeletons do.
4051 * src/output.c (prepare_symbols): Output token_table_flag.
4052
0ffda363
PE
40532005-07-21 Paul Eggert <eggert@cs.ucla.edu>
4054
4055 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
4056 again if the first call fails.
4057
4058 * data/glr.c (yytnamerr): New function.
4059 (yyreportSyntaxError): Use it to dequote most string literals.
4060 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
4061 with other skeletons. All uses changed.
4062 (yytnameerr_): New function.
4063 (yyreport_syntax_error): Use it to dequote most string literals.
4064 * data/yacc.c (yytnamerr): New function.
4065 (yyerrlab): Use it to decode most string literals.
4066 * doc/bison.texinfo (Decl Summary, Calling Convention):
4067 Clarify quoting convention of yytname.
4068 * src/output.c (prepare_symbols): Quote all names. This undoes
4069 the 2005-04-17 change, which is now accomplished (mostly) via
4070 changes in the parsers as described above.
4071 * tests/regression.at (Token definitions, Web2c Actions):
4072 Undo most 2005-04-17 change here, too.
4073
40742005-07-20 Paul Eggert <eggert@cs.ucla.edu>
4075
4076 Fix more problems reported by twlevo@xs4all.nl.
4077 * tests/cxx-type.at: Don't pipe output of ./types through sed to
4078 remove trailing spaces. This loses the exit status of ./types,
4079 and isn't needed since ./types shouldn't be emitting trailing
4080 spaces.
4081 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
4082 as the stack isn't valid in that case.
4083
4084 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4085 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4086 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4087 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
4088 is used.
4089 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
4090 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
4091 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
4092 Likewise.
4093
4094 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
4095 overly-picky compilers that reject 'char *foo = "bar";'.
4096
4097 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
4098 to FILE * parameter, not to stderr. This fixes a typo introduced
4099 in the 2005-07-12 change.
4100
4101 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
4102 warnings from GCC 4.
4103
4104 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
4105 (yyglrShiftDefer, yysplitStack):
4106 Remove unused parameters b4_pure_formals. All uses changed.
4107 (yyglrShift): Remove unused parameters b4_user_formals.
4108 All uses changed.
4109 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
4110
6100a9aa
PE
41112005-07-18 Paul Eggert <eggert@cs.ucla.edu>
4112
258b75ca
PE
4113 Destructor cleanups and regularization among the three skeletons.
4114 * NEWS: Document the behavior changes.
4115 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
4116 stack before failing, as the cleanup code will do it for us now.
4117 * data/lalr1.cc (yyerrlab): Likewise.
4118 * data/glr.c (yyparse): Pop everything off the stack before
4119 freeing it, so that destructors get called properly.
4120 * data/lalr1.cc (yyreturn): Likewise.
4121 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
4122 This is more consistent.
4123 * doc/bison.texinfo (Destructor Decl): Mention more reasons
4124 why destructors might be called. 1.875 -> 2.1.
4125 (Destructor Decl, Decl Summary, Table of Symbols):
4126 Some English-language cleanups for %destructor.
4127 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
4128 Add output line for destructor of start symbol.
4129 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
4130 because of that same extra output line.
4131
1a059451
PE
4132 * NEWS: Document minor wording changes in diagnostics of
4133 Bison-generated parsers.
4134 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
4135 Remove unused formals. All uses changed.
4136 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
4137 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
4138 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
4139 Rename yyoverflowab to yyexhaustedlab.
4140 When memory exhaustion occurs during syntax-error reporting,
4141 report it separately rather than in a single diagnostic; this
4142 eases translation.
4143 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
4144 (Memory Exhausted): Renamed from Parser Stack Overflow.
4145 Revamp wording slightly to prefer "memory exhaustion".
4146 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
4147
97460c78
PE
4148 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
4149
30757c8c
PE
4150 Add i18n support to the GLR skeleton. Partially fix the C++
4151 skeleton; a C++ expert needs to finish this. Remove debugging
4152 msgids; there's little point to having them translated, since they
4153 can be understood only by someone who can read the
4154 (English-language) source code.
4155
4156 Generate runtime-po/bison-runtime.pot automatically, so that we
4157 don't have to worry about garbage getting in that file. We'll
4158 make sure after the next official release that old msgids don't
4159 get lost. See
4160 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
4161
4162 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
4163 Now auto-generated.
4164 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
4165 Fix typos in explanations of the runtime file.
4166 * bootstrap: Change gettext keyword from YYI18N to YY_.
4167 Use standard Makefile.in.in in runtime-po, since we'll arrange
4168 for backward-compatible bison-runtime.po files in a different way.
4169 * data/glr.c (YY_): New macro, from yacc.c.
4170 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
4171 Translate messages intended for users.
4172 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
4173 the wording in the other skeletons. We don't know that the memory
4174 is virtual.
4175 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
4176 Use same method that yacc.c uses.
4177 Don't translate debugging messages.
4178 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
4179 it doesn't work (yet), and requires C++ expertise to fix.
4180 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
4181 Move defn to a more logical place, to be consistent with other
4182 skeletons.
4183 Don't translate debugging messages.
4184 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
4185 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
4186 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
4187 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
4188
ac8c5689
PE
4189 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
4190 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
4191 void, not int.
4192 * tests/glr-regression.at (Badly Collapsed GLR States):
4193 Likewise.
4194 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
4195 yylex should return 0 at EOF rather than aborting.
4196
6100a9aa
PE
4197 Improve tests for stack overflow in GLR parser.
4198 Problem reported by twlevo@xs4all.nl.
4199 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
4200 All uses removed.
4201 (yyStackOverflow): Just longjmp, but with value 2 so that caller
4202 can handle the problem.
4203 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
4204 (yyparse): New local variable yyresult to record the result.
4205 Use result of setjmp to set it, rather than storing itinto
4206 struct.
4207 (yyDone): Remove label.
4208 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
4209 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
4210 if YYABORT is used).
4211 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
4212 yyparse status; put status > 1 into diagnostic.
4213 Check that status==2 works.
4214 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
4215 Use exit status 3 for failure to open (which shouldn't happen).
4216
15f40952
PE
42172005-07-17 Paul Eggert <eggert@cs.ucla.edu>
4218
67fd79c4
PE
4219 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
4220 1 on syntax error; just let yyparse do its thing.
4221 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
4222 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
4223 (Exploding the Stack Size with Alloca):
4224 (Exploding the Stack Size with Malloc):
4225 Expect exit status 2, not 1, since the parser is supposed to blow
4226 its stack. Problem reported by twlevo@xs4all.nl.
4227
15f40952
PE
4228 * data/glr.c (yyparse): Don't assume that the initial calls
4229 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
4230 Print a stack-overflow message and fail instead.
4231 Initialize the line-number information before creating the stack,
4232 so that the stack-overflow message can report line zero safely.
4233
f32c66b5
PE
42342005-07-14 Paul Eggert <eggert@cs.ucla.edu>
4235
a22ff96f 4236 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
4237 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
4238 (yyuserMerge): Provide a default case if b4_mergers is empty.
4239 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
4240 * tests/glr-regression.at
4241 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 4242 Add casts to pacify C++ compilers.
1beb0b24
PE
4243 * tests/glr-regression.at (Improper merging of GLR delayed action
4244 sets): Declare yylex before using it.
f32c66b5 4245 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
4246 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
4247 test for valgrind; valgrind is independent of g++.
4248 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
4249 for compatibility with POSIX 1003.1-2001 (if running coreutils).
4250 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
4251 Use a destructor, so that we can expand the stack. Change
4252 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 4253
d741bd1b
PE
42542005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4255
4256 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
4257 a valgrind failure. Problem reported by twlevo@xs4all.nl.
4258
0410a6e0
PE
42592005-07-13 Paul Eggert <eggert@cs.ucla.edu>
4260
4261 * PACKAGING: New file, suggested by Bruno Haible and taken from
4262 similar wording in gettext's PACKAGING file.
4263 * NEWS: Mention PACKAGING.
4264 * Makefile.am (EXTRA_DIST): Add PACKAGING.
4265
f7ab6a50
PE
42662005-07-12 Paul Eggert <eggert@cs.ucla.edu>
4267
baf785db 4268 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
4269 * bootstrap: Get runtime translations into runtime-po.
4270 Create runtime-po files automatically, if possible.
4271 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
4272 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
4273 does not infringe on the user's name space.
4274 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
4275 * doc/bison.texinfo (Internationalization): Revamp the English
4276 and Texinfo syntax a bit, to try to make it clearer.
4277 (Bison Options, Option Cross Key): Mention --print-localedir.
4278 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
4279 YYENABLE_NLS. Quote a bit more.
4280 * runtime-po/.cvsignore: New file.
4281 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
4282 * runtime-po/Rules-quot: Remove; now created by bootstrap.
4283 * runtime-po/quot.sed: Likewise.
4284 * runtime-po/boldquot.sed: Likewise.
4285 * runtime-po/en@quot.header: Likewise.
4286 * runtime-po/en@boldquot.header: Likewise.
4287 * runtime-po/insert-header.sin: Likewise.
4288 * runtime-po/remove-potcdate.sin: Likewise.
4289 * runtime-po/Makevars: Likewise.
4290 * runtime-po/LINGUAS: Likewise.
4291 * runtime-po/de.po: Likewise; we will rely on the translation project
4292 to maintain this, so "bootstrap" should get it.
0410a6e0 4293 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
4294 its value.
4295 * src/main.c (main): Bind the bison-runtime domain, too.
4296
42972005-07-12 Bruno Haible <bruno@clisp.org>
4298
4299 * data/yacc.c: Include <libintl.h> when NLS is enabled.
4300 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
4301 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
4302 * runtime-po: New directory.
4303 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
4304 $(DOMAIN).pot-update rule, so that old messages are never dropped.
4305 * runtime-po/Rules-quot: New file, copied from po/.
4306 * runtime-po/quot.sed: Likewise.
4307 * runtime-po/boldquot.sed: Likewise.
4308 * runtime-po/en@quot.header: Likewise.
4309 * runtime-po/en@boldquot.header: Likewise.
4310 * runtime-po/insert-header.sin: Likewise.
4311 * runtime-po/remove-potcdate.sin: Likewise.
4312 * runtime-po/Makevars: New file.
4313 * runtime-po/POTFILES.in: New file.
4314 * runtime-po/LINGUAS: New file.
4315 * runtime-po/bison-runtime.pot: New file.
4316 * runtime-po/de.po: New file.
4317 * m4/bison.m4: New file.
4318 * Makefile.am (SUBDIRS): Add runtime-po.
4319 (aclocaldir, aclocal_DATA): New variables.
4320 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
4321 Define aclocaldir.
4322 * src/getargs.c (usage): Document --print-localedir option.
4323 (PRINT_LOCALEDIR_OPTION): New enum item.
4324 (long_options): Add --print-localedir option.
4325 (getargs): Handle --print-localedir option.
4326 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
4327 (Internationalization): New section.
4328
22dda0f0
AD
43292005-07-12 Akim Demaille <akim@epita.fr>
4330
4331 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
4332 for consistency with the rest of the code.
4333 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
4334 Add separators.
4335
82b248ad
AD
43362005-07-12 Akim Demaille <akim@epita.fr>
4337
4338 * src/parse-gram.y: Use %printer instead of YYPRINT.
4339
fa0e9314
AD
43402005-07-12 Akim Demaille <akim@epita.fr>
4341
867a3e00
AD
4342 * src/symtab.h, src/symtab.c (symbol_print): New.
4343 * src/symlist.h, src/symlist.c (symbol_list_print): New.
4344 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
4345
43462005-07-12 Akim Demaille <akim@epita.fr>
4347
4348 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
4349 b4_at_dollar and b4_dollar_dollar.
4350
e054b190
PE
43512005-07-11 Paul Eggert <eggert@cs.ucla.edu>
4352
4353 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
4354 and Pennello's paper.
4355
34160ec4
PE
43562005-07-09 Paul Eggert <eggert@cs.ucla.edu>
4357
407d4a75
PE
4358 * data/yacc.c (yyparse): Undo previous patch. Instead,
4359 set yylsp[0] and yyvsp[0] only if the initial action
4360 sets yylloc and yylval, respectively.
4361
34160ec4
PE
4362 * data/yacc.c (yyparse): In the initial action, set
4363 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
4364 This avoids the use of undefined variables if the initial
4365 action does not set yylloc and/or yylval.
4366
c3d5a4a7
PE
43672005-07-07 Paul Eggert <eggert@cs.ucla.edu>
4368
b34d96c1
PE
4369 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
4370 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
4371 Remove from CVS. These files are automatically generated.
4372 * examples/extexi: Clarify that this file is now part of Bison,
4373 not GNU M4, and that it works with any POSIX-compatible Awk.
4374 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
4375 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
4376 so that we also get calc++-parser.yy. Geneate it.
4377 Use $(AWK), not gawk, since any conforming Awk will do.
4378 Put comment before action, since older 'make' can't handle comment
4379 in action.
4380 $(BUILT_SOURCES): List all built sources, not just some of them.
4381 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
4382 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
4383 $($(calc_sources_generated)): Remove unnecessary test for existence
4384 of target. (This had a shell syntax error anyway; a stray "x".)
4385 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
4386 calc++-parser.yy.
4387 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
4388
c3d5a4a7
PE
4389 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
4390 implied by the other modules.
4391
828c373b
AD
43922005-07-06 Akim Demaille <akim@epita.fr>
4393
4394 Bind examples/calc++ to the package.
4395 * examples/calc++/Makefile: Remove, replaced by...
4396 * examples/calc++/Makefile.am: ... this new file.
4397 * examples/calc++/test: Remove input.
4398 * examples/calc++/compile: Remove.
4399 * examples/Makefile.am: New.
4400 * configure.ac, Makefile.am: Adjust.
4401 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
4402
63cb01d6
PE
44032005-07-05 Paul Eggert <eggert@cs.ucla.edu>
4404
fd2df2ed
PE
4405 * data/glr.c (yyFail): Drastically simplify; since the format argument
4406 never had any % directives, we can simply pass it to yyerror.
4407 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
4408 be modified later, as that is the usual style in glr.c.
4409 Problems reported by Paul Hilfinger.
4410
63cb01d6
PE
4411 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
4412 and size overflow errors.
4413 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
4414 in case the user prolog sets feature-test macros like _GNU_SOURCE.
4415 (YYSIZEMAX): New macro.
4416 (yystpcpy): New function, taken from yacc.c.
4417 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
4418 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
4419 so that we don't have to maintain their signatures.
4420 (yyFail): Check for buffer overflow, by using vsnprintf rather
4421 than vsprintf. Allocate a bigger buffer if possible.
4422 Report an error if buffer allocation fails.
4423 (yyStackOverflow): New function.
4424 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
4425 the initialization was successful. It might fail if storage was
4426 exhausted.
4427 (yyexpandGLRStack): Add more checks for storage allocation failure.
4428 Use yyStackOverflow to report failures.
4429 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
4430 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
4431 Don't assume stack number fits in int.
4432 (yysplitStack): Check for storage allocation failure.
4433 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
4434 can print diagnostics on storage allocation failure. All callers
4435 changed.
4436 (yyresolveValue): Use yybool for boolean.
4437 (yyreportSyntaxError): Check for size-calculation overflow.
4438 This code is taken from yacc.c.
4439 (yyparse): Check for storage allocation errors when allocating
4440 the initial stack.
4441
1c59e0a1
AD
44422005-07-05 Akim Demaille <akim@epita.fr>
4443
4444 Extract calc++ from the documentation.
4445 * doc/bison.texinfo (Calc++): Add the extraction marks.
4446 * examples/extexi: New, from the aborted GNU Programming 2E.
4447 Separate the different paragraph of a file with empty lines.
4448 * examples/Makefile: Use it to extract the whole calc++ example.
4449
8a0adb01
AD
44502005-06-24 Akim Demaille <akim@epita.fr>
4451
4452 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
4453 class typedefs.
4454
12545799
AD
44552005-06-22 Akim Demaille <akim@epita.fr>
4456
4457 * doc/bison.texinfo (C++ Language Interface): First stab.
4458 (C++ Parsers): Remove.
4459
99be0235
AD
44602005-06-22 Akim Demaille <akim@epita.fr>
4461
4462 * data/lalr1.cc (yylex_): Honor %lex-param.
4463
0ffd4fd1
AD
44642005-06-22 Akim Demaille <akim@epita.fr>
4465
4466 Start a set of simple examples.
4467 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
4468 * examples/calc++/calc++-driver.hh,
4469 * examples/calc++/calc++-parser.yy,
4470 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
4471 * examples/calc++/compile, examples/calc++/test: New.
4472
0925ebb4
PE
44732005-06-09 Paul Eggert <eggert@cs.ucla.edu>
4474
4475 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
4476 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
4477 which stems from the 2005-05-27 patch.
4478
43d3b664
PH
44792005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4480
4481 * data/glr.c: Modify treatment of unused parameters to permit use
4482 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
4483
3062864d
PE
44842005-05-30 Paul Eggert <eggert@cs.ucla.edu>
4485
4486 Fix infringement on user name space reported by Janos Zoltan Szabo.
4487 * data/yacc.c (yyparse): strlen -> yystrlen.
4488
989b5b8e
AD
44892005-05-30 Akim Demaille <akim@epita.fr>
4490
4491 * data/lalr1.cc (_): New.
4492 Translate the various messages.
4493
bedf57f5
PE
44942005-05-27 Paul Eggert <eggert@cs.ucla.edu>
4495
4496 Fix infringement on user name space reported by Bruno Haible.
4497 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
4498 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
4499 the user's name space.
4500 (alloca): Include <stdlib.h> to get it, if it's not built in.
4501 (YYMALLOC, YYFREE): Define only if needed.
4502 (malloc, free): Declare, but only if needed, as this infringes on
4503 the user name space.
4504
4d1801f1
PE
45052005-05-25 Paul Eggert <eggert@cs.ucla.edu>
4506
4507 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
4508 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
4509 with %d format.
4510 * lib/ebitset.c (min, max): Undef before defining.
4511 * lib/vbitset.c (min, max): Likewise.
4512 * lib/subpipe.c (create_subpipe): Save local variables in case
4513 vfork clobbers them.
4514
45152005-05-24 Bruno Haible <bruno@clisp.org>
4516
4517 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
4518 error message syntax used by gcc-4.0.
4519
b94a9e1e
PE
45202005-05-23 Paul Eggert <eggert@cs.ucla.edu>
4521
85ac3861
PE
4522 * README: Mention m4 1.4.3. Remove obsolete advice about
4523 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
4524
b94a9e1e
PE
4525 * bootstrap: Remove workaround for problem I encountered with
4526 gettext 0.14.1; it seems to be fixed now.
4527
51c30d21
PE
45282005-05-22 Paul Eggert <eggert@cs.ucla.edu>
4529
009ce67d
PE
4530 * NEWS: Version 2.0a.
4531
f2a97c62
PE
4532 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
4533 the previous change.
4534
c8775f93
PE
4535 Various maintainer cleanups.
4536 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
4537 conftest*, for benefit of CVS commands run at the same time as
4538 "configure". Add build-aux, since "bootstrap" now creates it and
4539 its subfiles.
4540 * Makefile.cfg (move_if_change): Remove.
4541 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
4542 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
4543 (po_repo, do-po-update, po-update, wget_files, get-targets):
4544 (config.guess-url_prefix, config.sub-url_prefix):
4545 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
4546 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
4547 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
4548 Remove.
4549 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
4550 this is now the recommended name.
4551 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
4552 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
4553 ylwrap. These files now go into build-aux.
4554 * config/move-if-change: Remove.
4555 * config/prev-version.txt: Bump from 1.75 to 2.0.
4556
3ea5f0ec
PE
4557 * bootstrap: Add stdio-safer, unistd-safer modules.
4558 Remove m4/glibc2.m4 (introduced by latest gnulib, but
4559 we don't need it).
4560 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
4561 fopen-safer.c, stdio-safer.h, unistd-safer.h.
4562 * lib/subpipe.c: Include "unistd-safer.h".
4563 (create_subpipe): Make sure all the newly-created
4564 file descriptors are > 2, so that diagnostics don't
4565 get sent down them (which might cause Bison to hang, in theory).
4566 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
4567 * src/files.c (xfopen): Use fopen_safer, not fopen.
4568
51c30d21
PE
4569 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
4570 yesterday's yacc.c fix.
4571
cea1469d
PE
45722005-05-21 Paul Eggert <eggert@cs.ucla.edu>
4573
3ea5f0ec
PE
4574 * data/glr.c, data/lalr1.cc: Update copyright date.
4575
cea1469d
PE
4576 Fix a destructor bug reported by Wolfgang Spraul in
4577 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
4578 * data/yacc.c (yyabortlab): Don't call destructor, and
4579 don't set yychar to EMPTY.
4580 (yyoverflowlab): Don't call destructor.
4581 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
4582 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
4583 since we no longer output the message "discarding lookahead token
4584 end of input ()".
4585
5e6f62f2
PH
45862005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4587
4588 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
4589 fix a small glitch in debugging output.
4590 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
4591 after YY_SYMBOL_PRINT where needed.
4592
4593 (struct yyGLRState): Add some comments.
4594 (struct yySemanticOption): Add some comments.
4595 (union yyGLRStackItem): Add comment.
4596
4597 (yymergeOptionSets): Correct this to properly perform the union,
4598 avoiding infinite reported by Michael Rosien.
4599 Update comment.
4600
4601 * tests/glr-regression.at: Add test for GLR merging error reported
4602 by M. Rosien.
cea1469d 4603
0fb669f9
PE
46042005-05-13 Paul Eggert <eggert@cs.ucla.edu>
4605
4606 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
4607 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
4608 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
4609 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
4610 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
4611 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
4612 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
4613 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
4614 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
4615 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
4616 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
4617 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
4618 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
4619 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
4620 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
4621 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
4622 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
4623 src/derives.h, src/files.c, src/files.h, src/getargs.c,
4624 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
4625 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
4626 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
4627 src/output.h, src/parse-gram.c, src/parse-gram.h,
4628 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
4629 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
4630 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
4631 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
4632 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
4633 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
4634 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
4635 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
4636 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
4637 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
4638 tests/reduce.at, tests/regression.at, tests/sets.at,
4639 tests/synclines.at, tests/testsuite.at, tests/torture.at:
4640 Update FSF postal mail address.
4641
51f4735e
PE
46422005-05-11 Paul Eggert <eggert@cs.ucla.edu>
4643
4644 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
4645 Problem reported by Ralf Menzel.
4646
80ce3401
PE
46472005-05-01 Paul Eggert <eggert@cs.ucla.edu>
4648
4649 * tests/actions.at: Test that stack overflow invokes destructors.
4650 From Marcus Holland-Moritz.
4651 * data/yacc.c (yyerrlab): Move the code that destroys the stack
4652 from here....
4653 (yyreturn): to here. That way, destructors are called properly
4654 even if the stack overflows, or the user calls YYACCEPT or
4655 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
4656 (yyoverflowlab): Destroy the lookahead.
4657
46582005-04-24 Paul Eggert <eggert@cs.ucla.edu>
4659
4660 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
4661
72f000b0
PE
46622005-04-17 Paul Eggert <eggert@cs.ucla.edu>
4663
4664 * NEWS: Bison-generated C parsers no longer quote literal strings
4665 associated with tokens.
4666 * src/output.c (prepare_symbols): Don't escape strings,
4667 since users don't want to see C escapes.
4668 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
4669 in diagnostics.
c19683bb 4670 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
4671 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
4672
1094323f
PE
46732005-04-16 Paul Eggert <eggert@cs.ucla.edu>
4674
4675 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
4676 the data size is known to be too small and we can't increase it.
4677 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
4678
ca407bdf
PE
46792005-04-15 Paul Eggert <eggert@cs.ucla.edu>
4680
4681 * src/parse-gram.y: Include quotearg.h.
4682 (string_as_id): Quote $1 before using it as a key, since the
4683 lexer no longer quotes it for us.
4684 (string_content): Don't strip quotes, since lexer no longer
4685 quotes it for us.
4686 * src/scan-gram.l: Include quotearg.h.
4687 ("\""): Omit quote.
4688 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
4689 a key, since the rest of the lexer doesn't quote it.
4690 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
4691 * tests/regression.at (Token definitions): Check for backslashes
4692 in token strings.
4693
4694 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
4695 (YYSIZE_T): Define to unsigned long int when using an older compiler.
4696 (yyparse): Revamp code to generate long syntax error message, to
4697 make it easier to translate, and to avoid problems with arithmetic
4698 overflow. Change "virtual memory" to "memory" in diagnostic, since
4699 we don't know whether the memory is virtual.
4700
1ce59070
PE
47012005-04-13 Paul Eggert <eggert@cs.ucla.edu>
4702
4703 * NEWS: Bison-generated C parsers now use the _ macro to
4704 translate strings.
4705 * data/yacc.c (_) [!defined _]: New macro.
4706 All English strings wrapped inside this macro.
4707 * doc/bison.texinfo (Bison Parser): Document _.
4708 * po/POTFILES.in: Include src/parse-gram.c, since it now
4709 includes translateable strings that parse-gram.y doesn't.
4710
a749a695
PE
47112005-04-12 Paul Eggert <eggert@cs.ucla.edu>
4712
4713 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
4714 reverting the 2004-10-11 change to this function.
4715 (symbol_check_alias_consistency): Don't call symbol_type_set
4716 if the type name is already correct.
4717 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
4718
8fb1053b
PE
47192005-03-25 Paul Eggert <eggert@cs.ucla.edu>
4720
4721 * tests/regression.at (Token definitions): Don't use a token named
4722 c, as that generates a "#define c ..." that runs afoul of buggy
4723 stdlib.h that uses the identifier c as a member of struct
4724 drand48_data. Problem reported by Horst Wente.
4725
ff498c4a
PE
47262005-03-21 Paul Eggert <eggert@cs.ucla.edu>
4727
4728 * bootstrap: Change translation URL from
4729 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
4730 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
4731 redirection glitches. Problem reported by twlevo@xs4all.nl.
4732
65211d70
PE
47332005-03-20 Paul Eggert <eggert@cs.ucla.edu>
4734
4735 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
4736 after operands; POSIX says this isn't portable for the c99 command.
4737
9577fb1f
PE
47382005-03-18 Paul Eggert <eggert@cs.ucla.edu>
4739
4740 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
4741 immediately if a data overrun has occurred; this may help us track
4742 down what may be a spurious failure on MacOS.
4743
78b178f7
PE
47442005-03-17 Paul Eggert <eggert@cs.ucla.edu>
4745
a2599d0f
PE
4746 Respond to problems reported by twlevo@xs4all.nl.
4747
4748 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
4749
78b178f7
PE
4750 * src/vcg.h: Comment fix.
4751 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
4752 (G_CMAX): Change to -1 instead of INT_MAX.
4753
4754 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 4755
7296e729
PE
47562005-03-15 Paul Eggert <eggert@cs.ucla.edu>
4757
4758 * src/tables.c (state_number_to_vector_number): Put it inside an
4759 "#if 0", since it's not currently used. Problem reported by
4760 Roland McGrath.
4761
05ac60f3
PE
47622005-03-06 Paul Eggert <eggert@cs.ucla.edu>
4763
4764 * src/output.c (escaped_output): Renamed from
4765 escaped_file_name_output, since we now use it for symbol tags as
4766 well. All uses changed.
4767 (symbol_destructors_output, symbol_printers_output):
4768 Escape symbol tags too.
4769 Problem reported by Matyas Forstner in
4770 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
4771
4772 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
4773 not needed.
4774 * src/output.c (user_actions_output, token_definitions_output,
4775 symbol_destructors_output, symbol_printers_output): Likewise.
4776 * src/reader.c (prologue_augment): Likewise.
4777 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
4778
4779 * src/vcg.c (output_edge): Don't quote linestyle arg.
4780 Problem reported by twlevo@xs4all.nl.
4781
7eb453ac
PE
47822005-02-28 Paul Eggert <eggert@cs.ucla.edu>
4783
4784 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
4785 example, reported by Derek M Jones. Also, make the example even
4786 more outrageous, to better illustrate how bad the problem is.
4787
4c04c52a
PE
47882005-02-24 Paul Eggert <eggert@cs.ucla.edu>
4789
4790 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
4791 putsym. Typo reported by Sebastian Piping.
4792
a61e1620
PE
47932005-02-23 Paul Eggert <eggert@cs.ucla.edu>
4794
4795 * doc/bison.texinfo (Language and Grammar): some -> same
4796 (Epilogue): int he -> in the
4797 Typos reported by Sebastian Piping via Justin Pence.
4798
9ec93868
PE
47992005-02-07 Paul Eggert <eggert@cs.ucla.edu>
4800
4801 * tests/glr-regression.at (Improper handling of embedded actions
4802 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
4803 embedded actions and $-N in GLR parsers", work around an Autoconf bug
4804 with dollar signs in test names.
4805 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
4806 for a similar reason.
4807
73ce7e7e
PE
48082005-01-28 Paul Eggert <eggert@cs.ucla.edu>
4809
4810 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
4811 wants to redefine G_VIEW.
4812
2e72b98e
PE
48132005-01-27 Paul Eggert <eggert@cs.ucla.edu>
4814
4815 * src/vcg.c (get_view_str): Remove case for normal_view.
4816 Problem reported by twlevo@xs4all.nl.
4817
e0d634e5
PE
48182005-01-24 Paul Eggert <eggert@cs.ucla.edu>
4819
ccf830a4
PE
4820 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
4821 Problem reported by twlevo@xs4all.nl.
4822
e0d634e5
PE
4823 * doc/bison.texinfo: Change @dircategory from "GNU programming
4824 tools" to "Software development". Requested by Richard Stallman
4825 via Karl Berry.
4826
7bbc8cb0
PE
48272005-01-23 Paul Eggert <eggert@cs.ucla.edu>
4828
4829 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
4830 Problem reported by twlevo@xs4all.nl.
4831
08b770bc
PE
48322005-01-21 Paul Eggert <eggert@cs.ucla.edu>
4833
4834 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
4835 keyword; it's not needed with modern compilers, and it doesn't
4836 affect correctness with older compilers. Suggested by
4837 twlevo@xs4all.nl.
4838
95f22ad2
PE
48392005-01-17 Paul Eggert <eggert@cs.ucla.edu>
4840
4841 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
4842 gcc -Wswitch-default.
4843 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
4844 * data/yacc.c (yyparse): Likewise.
4845
d229d15c
PE
48462005-01-12 Paul Eggert <eggert@cs.ucla.edu>
4847
4848 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
4849 already. Let config.h define any nonstandard values.
4850
ecadd90f
PE
48512005-01-10 Paul Eggert <eggert@cs.ucla.edu>
4852
4853 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
4854 for the benefit of slower hosts. Problem reported by
4855 Nelson H. F. Beebe.
4856
213744b5
PE
48572005-01-07 Paul Eggert <eggert@cs.ucla.edu>
4858
4859 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
4860 being defined and not used.
4861 * data/lalr1.cc (yyparse): Likewise.
4862 Use "if (false)" rather than "if (0)".
4863
249d3236
PE
48642005-01-05 Paul Eggert <eggert@cs.ucla.edu>
4865
4866 * TODO: Mention that we should allow NUL bytes in tokens.
4867
987cc1fb
PE
48682005-01-02 Paul Eggert <eggert@cs.ucla.edu>
4869
4870 * src/scan-skel.l (<<EOF>>): Don't close standard output.
4871 Problem reported by Hans Aberg.
4872
08fe02d9
PE
48732005-01-01 Paul Eggert <eggert@cs.ucla.edu>
4874
4875 * src/getargs.c (version): Happy new year; update overall
4876 program copyright date from 2004 to 2005.
4877
4878 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
4879 Problem reported by Hans Aberg.
4880 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
4881 (Output file names.): Add a test for the case when standard output
4882 is closed.
4883
010c0266
PE
48842004-12-26 Paul Eggert <eggert@cs.ucla.edu>
4885
4886 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
4887 to fix an oversight in the Bison 2.0 manual.
4888
da12206a
PE
48892004-12-25 Paul Eggert <eggert@cs.ucla.edu>
4890
4891 * NEWS: Version 2.0. Reformat the existing news items since
4892 1.875, so that related items are grouped together.
3a4734aa 4893 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
4894 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
4895
c935d934
PE
4896 * tests/torture.at (Exploding the Stack Size with Alloca): Set
4897 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
4898 otherwise, we're not testing alloca. Unfortunately there's no
4899 simple way to consult HAVE_ALLOCA here.
4900
da12206a
PE
4901 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
4902 for yymsg, too.
4903
4904 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
4905 hand. This avoids a warning about comparing int to size_t when
4906 GCC warnings are enabled.
4907
0a2c5137
PE
49082004-12-22 Paul Eggert <eggert@cs.ucla.edu>
4909
d7e14fc0
PE
4910 * NEWS: Bison-generated parsers no longer default to using the
4911 alloca function (when available) to extend the parser stack, due
4912 to widespread problems in unchecked stack-overflow detection.
4913 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
4914 responsibility to set it to a positive value. This lets the user
4915 specify a value that is not a preprocessor constant.
4916 * data/yacc.c (YYMAXDEPTH): Likewise.
4917 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
4918 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
4919 to be a compile-time constant. However, explain the constraints on it.
4920 Also, explain the constraints on YYINITDEPTH.
4921 (Table of Symbols): Explain that alloca is no longer the default.
4922 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
4923 to 1.
4924
0a2c5137
PE
4925 * doc/bison.texinfo (Location Default Action): Mention that n must
4926 be zero when k is zero. Suggested by Frank Heckenbach.
4927
e019c247
AD
49282004-12-22 Akim Demaille <akim@epita.fr>
4929
4930 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
4931 (parser::state_type, parser::semantic_type, parser::location_type):
4932 Private, not public.
4933 (parser::parse): Return ints, not bool.
4934 Returning a bool introduces a problem: 0 corresponds to false, and
4935 it seems weird to return false on success. Returning true changes
4936 the conventions for yyparse.
4937 Alternatively we could return void and send an exception.
4938 There is no clear consensus (yet?).
4939 (state_stack, semantic_stack, location_stack): Rename as...
4940 (state_stack_type, semantic_stack_type, location_stack_type): these.
4941 Private, not public.
4942 * tests/c++.at: New.
4943 * tests/testsuite.at, tests/Makefile.am: Adjust.
4944
72731bb7
AD
49452004-12-21 Akim Demaille <akim@epita.fr>
4946
4947 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
4948
9a0d8bec
AD
49492004-12-21 Akim Demaille <akim@epita.fr>
4950
4951 Don't impose std::string for filenames.
4952
4953 * data/lalr1.cc (b4_filename_type): New.
4954 (position::filename): Use it.
4955 (parser.hh): Move the inclusion of stack.hh and location.hh below
4956 the user code, so that needed headers for the filename type can be
4957 included first.
72731bb7
AD
4958 Forward declare them before the user code.
4959 * tests/Makefile.am (check-local, installcheck-local): Pass
4960 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 4961
99880de5
AD
49622004-12-20 Akim Demaille <akim@epita.fr>
4963
4964 Use more STL like names: my_class instead of MyClass.
4965
4966 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
4967 (SemanticStack, SemanticType, StateStack, StateType)
4968 (TokenNumberType, Stack, Slice, Traits, Parser::location)
4969 (Parser::value): Rename as...
4970 (location_stack, location_type, rhs_number_type, semantic_stack)
4971 (semantic_type, state_stack, state_type, token_number_type, stack)
4972 (slice, traits, parser::yylloc, parser::yylval): these.
4973
4974 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
4975
9bec482e
PE
49762004-12-19 Paul Eggert <eggert@cs.ucla.edu>
4977
4978 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
4979 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
4980
f6fbd3da
PE
49812004-12-17 Paul Eggert <eggert@cs.ucla.edu>
4982
4983 Remove uses of 'short int' and 'unsigned short int'. This raises
4984 some arbitrary limits. It uses more memory but nowadays that's
4985 not much of an issue.
4986
4987 This change does not affect the generated parsers; that's a different
4988 task, as some users will want to conserve memory there.
4989
4990 Ideally we should use size_t to represent all object counts, and
4991 something like ptrdiff_t to represent signed differences of object
4992 counts; but that will require more code-cleanup than I have the
4993 time to do right now.
4994
4995 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
4996 Use size_t, not int or short int, to count objects.
4997 * src/closure.c (nritemset, closure): Likewise.
4998 * src/closure.h (nritemset, closure): Likewise.
4999 * src/nullable.c (nullable_compute): Likewise.
5000 * src/print.c (print_core): Likewise.
5001 * src/print_graph.c (print_core): Likewise.
5002 * src/state.c (state_compare, state_hash): Likewise.
5003 * src/state.h (struct state): Likewise.
5004 * src/tables.c (default_goto, goto_actions): Likewise.
5005
5006 * src/gram.h (rule_number, rule): Use int, not short int.
5007 * src/output.c (prepare_rules): Likewise.
5008 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
5009 errs, reductions): Likewise.
5010 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
5011 Likewise.
5012 * src/tables.c (vector_number, tally, action_number,
5013 ACTION_NUMBER_MINIMUM): Likewise.
5014 * src/output.c (muscle_insert_short_int_table): Remove.
5015
efeed023
AD
50162004-12-17 Akim Demaille <akim@epita.fr>
5017
5018 * data/lalr1.cc: Extensive Doxygenation.
5019 (error_): Rename as...
5020 (error): this, since it is visible to the user.
5021 Adjust callers.
5022 (Parser::message): Now an automatic variable from...
5023 (Parser::yyreport_syntax_error_): here.
5024 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
5025 Parser::error.
5026 * tests/input.at: Escape $.
5027
bc82c5a5
PE
50282004-12-16 Paul Eggert <eggert@cs.ucla.edu>
5029
5030 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
5031 Parenthesize rhs to avoid obscure problems with mistakes like
5032 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
5033 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5034 b4_rhs_location): Likewise.
5035 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
5036 b4_rhs_location): Likewise.
5037
fd19f271
AD
50382004-12-16 Akim Demaille <akim@epita.fr>
5039
5040 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
5041 yacc.c: be sure to stay within yycheck_.
5042 * tests/actions.at: Re-enable C++ tests.
5043
10454ea4
AD
50442004-12-16 Akim Demaille <akim@epita.fr>
5045
5046 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
5047 real.
5048
c5b95ccf
AD
50492004-12-16 Akim Demaille <akim@epita.fr>
5050
5051 Use #define to handle the %name-prefix.
5052
5053 * data/glr.c, data/yacc.c: Comment changes.
5054 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
5055 so that one can refer to yylex in the parser file, and have it
5056 renamed, as is the case with other skeletons.
5057
617a8f12
AD
50582004-12-16 Akim Demaille <akim@epita.fr>
5059
5060 Move lalr1.cc internals into yy*.
5061
5062 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
5063 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
5064 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
5065 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
5066 (empty_, final_, terror_, errcode_, ntokens_)
5067 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
5068 (looka_, ilooka_, error_range_, nerrs_):
5069 Rename as...
5070 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
5071 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
5072 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
5073 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
5074 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
5075 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
5076 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
5077 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
5078 these.
5079
1e547e6e
PE
50802004-12-15 Paul Eggert <eggert@cs.ucla.edu>
5081
5082 Fix some problems reported by twlevo at xs4all.
5083 * src/symtab.c (symbol_new): Report an error if the input grammar
5084 contains too many symbols. This is better than calling abort() later.
5085 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
5086 (struct node, struct graph):
5087 Rename member expand to stretch. All uses changed.
5088 (struct graph): Remove member layoutalgorithm. All uses removed.
5089 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
5090 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
5091 All uses changed.
5092 (N_STRETCH): Rename from N_EXPAND. All uses changed.
5093
735d6bd4
AD
50942004-12-15 Akim Demaille <akim@epita.fr>
5095
5096 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
5097 Add more Doxygen comments.
5098 (symprint_, stack_print_, reduce_print_, destruct_, pop)
5099 (report_syntax_error_, translate_): Rename as...
5100 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
5101 (yypop_, yyreport_syntax_error_, yytranslate_): this.
5102
2e1f5829
AD
51032004-12-15 Akim Demaille <akim@epita.fr>
5104
5105 * data/lalr1.cc (lex_): Rename as...
5106 (yylex_): this.
5107 Move the trace here.
5108 Take the %name-prefix into account.
5109 Reported by Alexandre Duret-Lutz.
5110
a3cb6248
AD
51112004-12-15 Akim Demaille <akim@epita.fr>
5112
5113 Simplify the C++ parser constructor.
5114
5115 * data/lalr1.cc (debug_): Rename as...
5116 (yydebug_): so that the parser's internals are always in the yy*
5117 pseudo namespace.
5118 Adjust uses.
5119 (b4_parse_param_decl): Remove the leading comma as it is now only
5120 called as unique argument list.
5121 (Parser::Parser): Remove the constructor accepting a location and
5122 an initial debugging level.
5123 Remove from the other ctor the argument for the debugging level.
5124 (debug_level_type, debug_level, set_debug_level): New.
5125
5126 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
5127 constructor calls.
5128
07fed891
AD
51292004-12-15 Akim Demaille <akim@epita.fr>
5130
5131 Remove b4_root related material: failure experiment
a3cb6248 5132 (which goal was to allow to derive from a class).
07fed891
AD
5133
5134 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
5135 definitions and uses.
5136
e603eaa5
PE
51372004-12-14 Paul Eggert <eggert@cs.ucla.edu>
5138
5139 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
5140 not 2, since it's not portable to subtract 1 from the start of an
5141 array. The new item 0 is never set or used. All uses changed.
5142
5143 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
5144 the default definition of YYLLOC_DEFAULT. Problem reported
5145 by Frank Heckenbach.
5146
fafb007d
PE
51472004-12-12 Paul Eggert <eggert@cs.ucla.edu>
5148
5149 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
5150 the normal case and one for the error case. Just use the
5151 first one uniformly. Problem reported by Frank Heckenbach.
5152 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
5153 use exactly the same macro in both places.
5154 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
5155 so that the normal-case YYRHSLOC works for the error case too.
5156 All uses changed.
5157 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
5158 (YYLLOC_DEFAULT): Use the same macro as glr.c.
5159 * doc/bison.texinfo (Location Default Action): Don't claim that
5160 we have an array of locations. Use the same macro for both glr
5161 and lalr parsers. Mention YYRHSLOC. Mention what happens when
5162 the index is 0.
5163
48814dcd
PE
51642004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5165
a4e1a53b
PE
5166 * HACKING: Update email addresses to send announcements to.
5167
48814dcd
PE
5168 * configure.ac (AC_INIT): Bump version to 1.875f.
5169
337116ba
PE
51702004-12-10 Paul Eggert <eggert@cs.ucla.edu>
5171
5172 * NEWS: Version 1.875e.
5173 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
5174
5175 * src/scan-skel.l: Include "complain.h", for "fatal".
5176
5177 * src/relation.h (relation_print, relation_digraph):
5178 Relation sizes are of type relation_node, not size_t (this is
5179 merely a doc fix, since the two types are equivalent).
5180 (relation_transpose): Relation sizes are of type relation_node,
5181 not int.
5182 * src/relation.c: Likewise.
5183 (top, infinity): Now of type relation_node, not int.
5184 (traverse, relation_transpose): Use relation_node, not int.
5185
5186 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
5187 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
5188 (yyparse): Remove unused local introduced in 2004-10-25 patch.
5189
5190 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 5191 specifying whether the test should be skipped. Use it tp
337116ba 5192 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 5193 fail on some hosts, and should be skipped.
337116ba 5194
da2a7671
PE
51952004-12-08 Paul Eggert <eggert@cs.ucla.edu>
5196
5197 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
5198 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
5199 unless otherwise specified below.
5200
5201 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
5202 to allocate kernel_base, kernel_items, kernel_size, since
5203 they needn't be initialized to 0.
5204 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
5205 * src/closure.c (new_closure): Likewise, for itemset.
5206 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
5207 * src/lalr.c (set_goto_map): Likewise, for temp_map.
5208 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
5209 (build_relations): Likewise for edge, states1, includes.
5210 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
5211 * src/reader.c (packgram): Likewise, for ritem, rules.
5212 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
5213 * src/relation.c (relation_digraph): Likewise for VERTICES.
5214 (relation_transpose): Likewise for new_R, end_R.
5215 * src/symtab.c (symbols_token_translations_init): Likewise for
5216 token_translations.
5217 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
5218 (token_actions): Likewise for yydefact, actrow, conflrow,
5219 conflict_list.
5220 (save_column): Likewise for froms[symno], tos[symno].
5221 (goto_actions): Likewise for state_count.
5222 (pack_table): Likewise for base, pos, check.
5223 (tables_generate): Likewise for width.
5224
5225 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
5226 for initial core. Just have a separate core, so we needn't worry
5227 about whether kernel_size and kernel_base are initialized.
5228
5229 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
5230 kernel_size, kernel_items): Remove unnecessary initialization.
5231 * src/conflicts.c (conflicts): Likewise.
5232 * src/derives.c (derives): Likewise.
5233 * src/muscle_tablc (muscle_insert): Likewise.
5234 * src/relation.c (relation_digraph): Likewise.
5235 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
5236 conflrow, conflict_table, conflict_list, table, check):
5237 Likewise.
5238
5239 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
5240 This is because all callers pass unsigned int.
5241 * src/closure.h (new_closure): Likewise.
5242
5243 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
5244 (build_relations): Initialize includes[i] in all cases.
5245 * src/reader.c (packgram): Always initialize rules[ruleno].prec
5246 and rules[ruleno].precsym. Initialize members in order.
5247 * src/relation.c (relation_transpose): Always initialize new_R[i]
5248 and end_R[i].
5249 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
5250
5251 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
5252 conflict_list[0] was always 0, but now it isn't initialized.
5253
5254 * src/table.c (table_grow): When conflict_table grew, the grown
5255 area wasn't cleared. Fix this.
5256
5257 * lib/.cvsignore: Add strdup.c, strdup.h.
5258 * m4/.cvsignore: Add strdup.m4.
5259
00baeeac
PE
52602004-12-07 Paul Eggert <eggert@cs.ucla.edu>
5261
5262 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
5263 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
5264 GOTO_NUMBER_MAXIMUM, since we occasionally compute
5265 ngotos + 1 without checking for overflow.
5266 (build_relations): Use END_NODE, not -1, to denote end of edges.
5267 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
5268 build_relations): Use goto_number, not int, for goto numbers.
5269 * src/tables.c (save_column, default_goto): Likewise.
5270
be3d9d42
AD
52712004-11-23 Akim Demaille <akim@epita.fr>
5272
5273 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
5274 of #defining from yystype.
5275 Don't typedef yystype, C++ does not need it.
5276 This lets it possible to forward declare it as union.
5277
78e526d5
PE
52782004-11-23 Paul Eggert <eggert@cs.ucla.edu>
5279
5280 * bootstrap (gnulib_modules): Add extensions.
5281 Problem reported by Jim Meyering.
5282
afbb696d
PE
52832004-11-22 Paul Eggert <eggert@cs.ucla.edu>
5284
5285 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
5286 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
5287 src/system.h, src/tables.c: XFREE -> free, to accommodate
5288 recent change to gnulib xalloc.h.
78e526d5 5289 Problem reported by Jim Meyering.
afbb696d 5290
c1f8f16a
AD
52912004-11-17 Akim Demaille <akim@epita.fr>
5292
5293 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
5294
db7e5eb5 52952004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
5296 Alexandre Duret-Lutz <adl@gnu.org>
5297
5298 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
5299 changes.
5300 (YYCDEBUG): Adjust.
5301 Use it instead of cdebug_.
5302 (Parser::debug_stream, Parser::set_debug_stream): New.
5303 (Parser::symprint_): Define cdebug_ for temporary backward
5304 compatibility.
5305 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
5306 debug_stream ().
5307
68e11668
AD
53082004-11-17 Akim Demaille <akim@epita.fr>
5309
5310 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
5311 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
5312 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
5313 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
5314
97cbc73e
PE
53152004-10-27 Paul Eggert <eggert@cs.ucla.edu>
5316
5317 * data/glr.c (yyloc_default): Remove; not used.
5318 Problem reported by Frank Heckenbach.
5319
e342c3be
AD
53202004-10-25 Akim Demaille <akim@epita.fr>
5321
5322 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
5323 Introduce another definition to address simple location arrays.
5324 (yyGLRStack): New member: yyerror_range.
5325 (yyrecoverSyntaxError, yyparse): Update it.
5326 (yyrecoverSyntaxError): Use it when shifting the error token to
5327 have an accurate range, equivalent to the one computed by both
5328 yacc.c and lalr1.cc.
5329 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
5330 that column numbers start at column 0, as per GNU Coding
5331 Standards, the others tests, and the doc.
5332 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
5333 Adjust to the above change (first column is 0).
5334 And adjust the location of the "<error>", now covering the whole
5335 line.
5336
93602feb 53372004-10-22 Akim Demaille <akim@epita.fr>
04098407 5338 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
5339
5340 Remove some arbitrary limits on goto numbers and relations.
5341 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
5342 initial values, since they're never used.
5343 (set_goto_map): ngotos is now unsigned, so test for overflow
5344 by seeing whether it wraps around to zero.
5345 * src/lalr.h (goto_number): Now size_t, not short int.
5346 (GOTO_NUMBER_MAXIMUM): Remove.
5347 * src/relation.c (relation_print, traverse, relation_transpose):
5348 Check for END_NODE rather than looking at sign.
5349 * src/relation.h (END_NODE): New macro.
5350 (relation_node): Now size_t, not short int.
5351
dba08b04
PE
53522004-10-22 Paul Eggert <eggert@cs.ucla.edu>
5353
5354 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
5355 keyword, not an identifier. Problem reported by Baron Schwartz in
5356 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
5357
df09ef2e
AD
53582004-10-11 Akim Demaille <akim@epita.fr>
5359
5360 * src/symtab.c (symbol_check_alias_consistency): Also check
5361 type names, destructors, and printers.
5362 Reported by Alexandre Duret-Lutz.
5363 Recode the handling of associativity and precedence in terms
5364 of symbol_precedence_set.
5365 Accept no redeclaration at all, not even equal to the previous
5366 value.
5367 (redeclaration): New.
5368 Use it to factor redeclaration complaints.
5369 (symbol_make_alias): Don't set the type of the alias, let
5370 symbol_check_alias_consistency do it as for other features.
5371 * src/symtab.h (symbol): Add new member prec_location, and
5372 type_location.
5373 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
5374 * tests/input.at (Incompatible Aliases): New.
5375
146bc99d
PE
53762004-10-09 Paul Eggert <eggert@cs.ucla.edu>
5377
5378 .cvsignore fixes to accommodate gnulib changes,
5379 and the practice of naming build directories "_build".
5380 * .cvsignore: Add "_*". Sort.
5381 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
5382 * m4/.cvsignore: Add "*_gl.m4".
5383
e503aa60
AD
53842004-10-06 Akim Demaille <akim@epita.fr>
5385
5386 * src/parse-gram.y (add_param): Fix the truncation of trailing
5387 spaces.
5388
b4a20338
AD
53892004-10-05 Akim Demaille <akim@epita.fr>
5390
5391 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
5392 whether the reducion was empty or not. This leaves room to
5393 improve the use of YYLLOC_DEFAULT in such a case.
5394 lalr1.cc is still experimental, so changing this is acceptable.
5395 And finally, there are probably not many users who changed the
5396 handling of locations in GLR, so changing is admissible too.
5397
5398 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
5399 empty reduction, set @$ to an empty location ending the previously
5400 stacked symbol.
5401 Adjust uses to make sure the code is triggered on empty
5402 reductions.
5403 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
5404 expected output: empty reductions have empty locations.
5405
f85a5e6f
AD
54062004-09-29 Akim Demaille <akim@epita.fr>
5407
5408 * data/lalr1.cc: Move towards a more standard C++ coding style
5409 for templates: Class < T > -> Class<T>.
5410
b203fc2c
AD
54112004-09-29 Akim Demaille <akim@epita.fr>
5412
5413 * data/lalr1.cc: Reinstall the former ctor, for sake of
5414 compatibility, but warn it will be removed.
5415 Move towards a more standard C++ coding style (i.e., type *var ->
5416 type* var).
5417
5b7e1e73
PE
54182004-09-27 Paul Eggert <eggert@cs.ucla.edu>
5419
3fee967f
PE
5420 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
5421 since it's less likely to work if NULs are involved in the future.
5b7e1e73 5422
0dcca5c2
AD
54232004-09-27 Akim Demaille <akim@epita.fr>
5424
5425 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
5426
6dde1c82
AD
54272004-09-27 Akim Demaille <akim@epita.fr>
5428
5429 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 5430 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
5431 and argument names.
5432 (b4_cc_constructor_call): Likewise.
5433
b233d555
AD
54342004-09-24 Akim Demaille <akim@epita.fr>
5435
5436 * src/parse-gram.y (add_param): Strip the leading and trailing
5437 blanks from a formal argument declaration.
5438 (YY_LOCATION_PRINT): New.
5439
619404e3
AD
54402004-09-24 Akim Demaille <akim@epita.fr>
5441
5442 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
5443 after the location.
5444
dd8d9022
AD
54452004-09-24 Akim Demaille <akim@epita.fr>
5446
5447 * doc/bison.texinfo (Table of Symbols): Sort.
5448
0092f063
AD
54492004-09-21 Akim Demaille <akim@epita.fr>
5450
5451 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
5452 the useless parentheses.
5453 Suggested by Paul Eggert.
5454
451364ed
AD
54552004-09-20 Akim Demaille <akim@epita.fr>
5456
5457 Let the initial-action act on the look-ahead, and use it for the
5458 "initial push" (corresponding to an hypothetical beginning-of-file).
5459 And let lalr1.cc honor %initial-action.
5460
5461 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
5462 example.
5463 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
5464 (Parser::Parser): Remove the ctor that used to initialize it.
5465 (Parser::parse): Like in the other skeletons, issue the "starting
5466 parse" message before any action.
5467 Honor %initial-action.
5468 Initialize the stacks with the lookahead.
5469 * data/yacc.c: Let $$ and @$ in %initial-action designate the
5470 look-ahead.
5471 Push them in the stacks.
5472 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
5473
18d192f0
AD
54742004-09-20 Akim Demaille <akim@epita.fr>
5475
5476 * doc/bison.texinfo (Initial Action Decl): New.
5477
b8458aa5
AD
54782004-09-20 Akim Demaille <akim@epita.fr>
5479
5480 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
5481 clearer criterion to define it.
5482 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
5483 When reducing on an empty RHS, use the latest stacked location as
5484 location.
5485 yylloc is not always available.
5486 * data/glr.c: Likewise.
5487 Also, honor initial-actions.
5488
3fc16193
AD
54892004-09-20 Akim Demaille <akim@epita.fr>
5490
5491 * data/yacc.c (YY_LOCATION_PRINT): New.
5492 Define when we know YYLTYPE's structure, i.e., when the default
5493 YYLLOC_DEFAULT is used.
5494 * data/c.m4 (b4_yysymprint_generate): Use it.
5495 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
5496 value of the result.
5497 (error_start_): Replace with...
5498 (error_range_): this location array.
5499 This allows to replace code relying on the implementation of
5500 locations by portable code.
5501 * data/yacc.c (yylerrsp): Replace with...
5502 (yyerror_range): this.
5503 Every time a token is popped, update yyerror_range[0], to have an
5504 accurate location for the error token.
5505 * data/glr.c (YY_LOCATION_PRINT): New.
5506 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
5507 deference a pointer.
5508 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
5509 report the location in %printers.
5510
5511 * src/scan-skel.l: Instead of abort, report error messages to ease
5512 understanding skeleton scanning failures.
5513
ecfe33e7
AD
55142004-09-16 Akim Demaille <akim@epita.fr>
5515
5516 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
5517 (iterator, const_iterator): these, to be more in the C++ spirit.
5518 Also, return reverse iterators so that when displaying the stack
5519 we display its bottom first.
5520 (Parser::stack_print_, Parser::reduce_print_): Match the messages
5521 from yacc.c.
5522 We should probably use vector here though.
5523
1576d44d
AD
55242004-09-16 Akim Demaille <akim@epita.fr>
5525
5526 Have more complete shift traces.
5527
5528 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
5529 to report Shifts instead of ad hoc YYDPRINTF invocations,
5530 including for the error token.
5531 * data/lalr1.cc (symprint_): Output the location.
5532 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
5533 output the location within the %printer.
5534 Activate GLR tests, at least to make sure they compile properly.
5535 They still don't pass though.
5536 * tests/calc.at: Adjust expect verbose output, since now "Entering
5537 state..." is on a different line than the "Shifting" message.
5538
9c66f418
AD
55392004-09-08 Akim Demaille <akim@epita.fr>
5540
5541 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
5542 Bison directive from the Bison file to the invocation of this
5543 macro, so that these directives are passed to
5544 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
5545 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
5546 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
5547 the extra Bison directives instead of the whole series.
5548 Change the grammar so that there are recoverable errors, and
5549 unrecoverable errors. Now we can have the parser give up before
5550 consuming the whole input. As a result we now can observe that
5551 the lookahead is freed when needed.
5552 Change the parser source to parse argv[1] instead of a hard coded
5553 string.
5554 Simplify yylex, and give a value and location to EOF.
5555 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
5556 passed directives already coded in the file.
5557 Add some tests to check the location of "error".
5558 For some tests, the C++ parser is correct, and not yacc.c.
5559 For other tests, they provide different, but unsatisfying, values,
5560 so keep the C++ value so that at least one parser is "correct"
5561 according to the test suite.
5562 (Actions after errors): Remove, this is subsumed by the
5563 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
5564
52d5733f
AD
55652004-09-06 Akim Demaille <akim@epita.fr>
5566
5567 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 5568 (Parser::pop): New.
52d5733f
AD
5569 Use it.
5570
a0e68930
AD
55712004-09-06 Akim Demaille <akim@epita.fr>
5572
5573 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
5574 argument, an informative message.
5575 Call YY_SYMBOL_PRINT.
5576 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
5577 * data/lalr1.cc (destruct_): Likewise.
5578 In addition, no longer depend on b4_yysymprint_generate and
5579 b4_yydestruct_generate to generate these functions, do it "by
5580 hand".
5581
e757bb10
AD
55822004-09-03 Akim Demaille <akim@epita.fr>
5583
5584 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
5585 invoked, yydestruct the lookahead.
5586 * tests/calc.at (Calculator $1): Update the expected lengths of
5587 traces: there is an added line for the discarded lookahead.
5588 * doc/bison.texinfo (Destructor Decl): Some rewording.
5589 Define "discarded" symbols.
5590
0fe1f06d
AD
55912004-09-02 Akim Demaille <akim@epita.fr>
5592
5593 * data/lalr1.cc (translate_, destruct_): No reason to be static.
5594
284acc8b
AD
55952004-09-02 Akim Demaille <akim@epita.fr>
5596
5597 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
5598 (YYDSYMPRINTF): Rename as...
5599 (YY_SYMBOL_PRINT): this.
5600 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
5601 two.
5602 Use it instead of direct symprint_ calls.
5603 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
5604 one.
5605
a5eb1ed2
AD
56062004-09-02 Akim Demaille <akim@epita.fr>
5607
b7c72fe1
AD
5608 * data/lalr1.cc (b4_yysymprint_generate): New.
5609 (symprint_): New member function, defined when YYDEBUG.
5610 Use it consistently instead of token/nterm debugging output by
5611 hand.
a5eb1ed2
AD
5612 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
5613 %printer calls to use cdebug_ when using lalr1.cc.
5614
417141dd
AD
56152004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
5616
5617 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
5618 with #ifdef YYDEBUG.
5619
2fa09258
AD
56202004-08-26 Akim Demaille <akim@epita.fr>
5621
5622 * doc/bison.texinfo (Implementing Loops): Rename as...
5623 (Implementing Gotos/Loops): this.
5624
9378b508
PE
56252004-08-13 Paul Eggert <eggert@cs.ucla.edu>
5626
5627 Adjust to latest gnulib.
5628 * bootstrap (gnulib_modules): Add xalloc-die.
5629 Set LC_ALL=C so that file names sort consistently.
5630 Prefer the gnulib copies of gettext.m4, glibc21.m4,
5631 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
5632 uintmax_t.m4, ulonglong.m4.
5633 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
5634 po.m4 since we are now using _gl.m4 instead.
5635
87a8ad5c
PE
56362004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
5637
5638 * src/scan-action.l: Remove. Scanning of semantic actions is
5639 handled in scan-gram.l.
5640
dca81a78
PE
56412004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
5642
5643 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
5644
5645 * src/location.h (struct): The file member is a uniqstr.
5646 (equal_boundaries): Use UNIQSTR_EQ for comparison.
5647
c9cbf7c5
PE
56482004-07-22 Paul Eggert <eggert@cs.ucla.edu>
5649
5650 Fix bug with non-%union parsers that have printers or destructors,
5651 which led to a Bison core dump. Reported by Peter Fales in
5652 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 5653
c9cbf7c5
PE
5654 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
5655 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
5656 not to our own type.
5657 * src/output.c (symbol_destructors_output, symbol_printers_output):
5658 Don't assume %union.
5659 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
5660 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
5661 UNION-FLAG. All callers changed.
5662 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
5663 Use type char, not unsigned int, when declaring an array of char;
5664 this lets us remove a cast.
5665 (Printers and Destructors): Add non-%union test cases.
5666
fa7e68c3
PE
56672004-06-21 Paul Eggert <eggert@cs.ucla.edu>
5668
5669 * doc/bison.texinfo: Minor editorial changes, mostly to the new
5670 GLR writeups. E.g., avoid frenchspacing and the future tense,
5671 change "lookahead" to "look-ahead", and change "wrt" to "with
5672 respect to".
2fa09258 5673
fa7e68c3
PE
56742004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5675
5676 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
5677 New sections, split off from the GLR Parsers section. Put the new
5678 Simple GLR Parser near the start of the GLR section, for clarity.
5679 Rewrite connective text.
5680
99a9344e
PE
56812004-06-21 Frank Heckenbach <frank@g-n-u.de>
5682
5683 * doc/bison.texinfo (Simple GLR Parsers): New section.
5684
8dd162d3
PE
56852004-06-21 Paul Eggert <eggert@cs.ucla.edu>
5686
5687 * NEWS, TODO, doc/bison.texinfo:
5688 Use "look-ahead" instead of "lookahead", to be consistent.
5689 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
5690 while we're fixing "look-ahead".
5691 * src/conflicts.c (shift_set): Renamed from shiftset.
5692 (look_ahead_set): Renamed from lookaheadset.
5693 * src/print.c: Likewise.
5694 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
5695 name for "lookahead".
5696 (report_types, usage): Likewise.
5697 * src/getargs.h (report_look_ahead_tokens): Renamed from
5698 report_lookaheads.
5699 * src/lalr.c (compute_look_ahead_tokens): Renamed from
5700 compute_lookaheads.
5701 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
5702 (look_ahead_tokens_print): Renamed from lookaheads_print.
5703 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
5704 state_rule_lookaheads_print.
5705 * src/state.h: Likewise.
5706 (reductions.look_ahead_tokens): Renamed from lookaheads.
5707 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
5708 AT_DATA_LOOKAHEADS_GRAMMAR.
5709
57a90331
PE
57102004-06-03 Paul Eggert <eggert@cs.ucla.edu>
5711
5712 * README: Update location of patched M4 distribution.
5713
8ed3234a
PE
57142004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
5715
5716 Don't assume the C++ compiler takes the same arguments as the C compiler
5717 (trivial change).
5718 * configure.ac (O0CXXFLAGS): New var.
5719 * tests/atlocal.in (CXXFLAGS): Use it.
5720
07971983
PE
57212004-05-29 Paul Eggert <eggert@cs.ucla.edu>
5722
5723 Fix some "make check" problems with C++ reported by
5724 Albert Chin-A-Young for Tru64 C++ in this thread:
5725 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
5726
5727 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
5728 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
5729 Output to a .cc file for C++, not to a .c file.
5730 * tests/calc.at (AT_CHECK_CALC): Likewise.
5731 * tests/regression.at (AT_CHECK_DANCER): Likewise.
5732 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
5733
29058652
PE
57342004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
5735
5736 * tests/calc.at, tests/actions.at: Workaround for SGI
5737 C++ compiler. (trivial change)
5738
62cb8a99
PE
57392004-05-27 Paul Eggert <eggert@cs.ucla.edu>
5740
fd418816
PE
5741 Spent a few hours checking out which prerequisite versions the
5742 current sources actually require. I went all the way back to
5743 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
5744 a seemingly endless set of combinations of versions more recent
5745 than that. The bottom line is that the current sources require
5746 fairly recent versions of the build tools, and it'll be some work
5747 to change this.
5748 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
5749 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
5750 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
5751 Add comments explaining why those particular versions are
5752 currently needed.
2fa09258 5753
62cb8a99
PE
5754 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
5755 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 5756 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
5757
5758 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
5759 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
5760
caa52c10
PE
57612004-05-26 Paul Eggert <eggert@cs.ucla.edu>
5762
5763 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
5764 0.11.5. Suggested by Bruno Haible.
5765 * bootstrap: Remove gettext version checking.
5766
5767 * doc/bison.texinfo (Decl Summary): Also mention that %union
5768 can depend on prerequisite types. Problem reported by Tim
5769 Van Holder.
5770
4bfd5e4e
PE
57712004-05-25 Paul Eggert <eggert@cs.ucla.edu>
5772
2cef3017
PE
5773 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
5774 * README-alpha: Don't tell people not to package this.
5775
b9c85d5c
PE
5776 * bootstrap: Don't assume $(...) works; use `...` instead.
5777 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
5778 gettext better.
5779
4bfd5e4e
PE
5780 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
5781 put into the -d output file, and mention what to do if YYSTYPE is
5782 defined as a macro.
5783
6a36ff94
PE
57842004-05-24 Paul Eggert <eggert@cs.ucla.edu>
5785
6712933e
PE
5786 Undo change made earlier today: it caused autopoint to not bring
5787 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
5788 autopoint's.
5789
5790 * bootstrap: Check that gettext version matches what's in
5791 configure.ac. Warn users to ignore robots.txt ERROR 404.
5792 * bootstrap: Undo today's earlier change (logged below).
5793 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 5794
6a36ff94
PE
5795 The gettext version checking is causing more trouble than it's
5796 curing; remove it. Problem reported by Paul Hilfinger.
5797
5798 * bootstrap: Issue a warning that one can expect a message
5799 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
5800 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
5801
209ea708
PE
58022004-05-23 Paul Eggert <eggert@cs.ucla.edu>
5803
5804 Ensure that the C++ compiler used for testing actually works on a
5805 simple test program; if not, skip the C++-related tests. Problem
5806 reported by Vin Shelton in:
161a71f3 5807 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
5808
5809 * m4/cxx.m4: New file.
5810 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
5811 * tests/atlocal.in (BISON_CXX_WORKS): Add.
5812 * tests/local.at (AT_COMPILE_CXX): Use it.
5813
41ca2549
PE
58142004-05-21 Paul Eggert <eggert@cs.ucla.edu>
5815
383e69dc
PE
5816 * data/glr.c (yylloc): Output this macro even if locations are not
5817 being generated, as the GLR parser needs it even in that case.
5818 Problem reported by Troy A. Johnson
5819 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
5820
41ca2549
PE
5821 * configure.ac (AC_INIT): Update to 1.875e.
5822
e476c87d
PE
58232004-05-21 Paul Eggert <eggert@cs.ucla.edu>
5824
5825 * NEWS: Version 1.875d.
5826 * configure.ac (AC_INIT): Likewise.
5827 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
5828
5829 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
5830 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
5831 lalr1.cc runs afoul of the first, and the last two are no longer
5832 supported by GCC 3.4.0.
5833 * README: Mention GNU m4 1.4 or later; mention m4 patches.
5834 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
5835
233a88ad
PE
58362004-05-06 Paul Eggert <eggert@cs.ucla.edu>
5837
5838 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
5839 unsigned int, for compatibility with latest gnulib hash module.
5840 * src/state.c (state_hash, state_hasher): Likewise.
5841 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
5842 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 5843
12ffdd28
PE
58442004-05-03 Paul Eggert <eggert@cs.ucla.edu>
5845
5846 * NEWS: Unescaped newlines are no longer allowed in char & strings.
5847
5848 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
5849 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
5850 character and string literals.
5851 (unexpected_end): New function.
5852 (unexpected_eof): Use it.
5853 (unexpected_newline): New function.
5854 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
5855 actions.
e476c87d 5856
12ffdd28
PE
5857 * NEWS: Document %expect-rr.
5858
5859 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
5860 Fix typo by replacing $1 with $option.
5861 Remove more 'intl'-related files.
9668e2be 5862 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
5863
5864 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
5865 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
5866 strtoul.c.
5867 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
5868 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
5869 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
5870 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
5871 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
5872 * src/.cvsignore: Add *.output.
5873
5874 * src/parse-gram.y: Put copyright notice inside %{ %} so it
5875 gets copied to the output file.
e476c87d 5876
1f65350a
PE
58772004-04-28 Paul Eggert <eggert@twinsun.com>
5878
5879 Get files from the gnulib and po repositories, instead of relying
5880 on them being in our CVS. Upgrade to latest versions of gnulib
5881 and Automake.
5882
5883 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
5884 * bootstrap: Bootstrap from gnulib and po repositories.
5885 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
5886 * README-cvs: Document these changes. Remove version numbers from
5887 mentions of build tools, since they change so often. Mention Flex.
5888
5889 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
5890 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
5891 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
5892 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 5893 does this for us.
12ffdd28
PE
5894 (AC_ISC_POSIX): Remove; we no longer support this
5895 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
5896 (AC_HEADER_STDC): Remove: we now assume C89 or better.
5897 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
5898 Do not check for C89 headers, except for locale.h which is used
5899 by the Yacc library and must port to K&R hosts.
5900 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
5901 Do not check for C89 functions, except for setlocale which is
5902 used by the Yacc library.
5903 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
5904 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
5905 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
5906 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
5907 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
5908 AM_GNU_GETTEXT): Remove; now done by:
5909 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
5910 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
5911 for us.
5912
5913 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
5914 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
5915 Define to empty, as gnulib.mk will do the rest for us.
5916 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
5917 for us.
5918 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
5919 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
5920
5921 * src/files.c: Include gnulib's xstrndup.h.
5922
5923 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
5924 (REALLOC): Use xnrealloc, for likewise.
5925 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
5926 (strnlen, memrchr): Remove decls; functions no longer used.
5927 Include <stpcpy.h>.
5928
5929 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
5930 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
5931 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
5932 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
5933 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
5934 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
5935 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
5936 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
5937 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
5938 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
5939 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
5940 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
5941 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
5942 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
5943 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
5944 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
5945 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
5946 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
5947 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
5948 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
5949 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
5950 Remove, as these files are now generated automatically
5951 by bootstrap or automake.
5952
5953 * po/ChangeLog: Remove: all but one entry was a duplicate
5954 of this file, and I moved that 2000-11-02 entry here.
5955
5956 * config/.cvsignore: Add Makefile, depcomp, install-sh.
5957 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
5958 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
5959 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
5960 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
5961 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
5962 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
5963 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
5964 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
5965 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
5966 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
5967 xstrndup.h.
5968 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
5969 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
5970 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
5971 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
5972 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
5973 * src/.cvsignore: Remove *_.c.
5974
5975
5976 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
5977 support it. (The latest stable gzip doesn't.)
5978
59792004-04-27 Paul Eggert <eggert@twinsun.com>
5980
5981 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
5982 case, as stos_ is now used by destructors due to the 2004-02-09
5983 change.
5984
5985 Remove more K&R C support.
5986 * lib/libiberty.y (PARAMS): Remove. All uses removed.
5987 * lib/subpipe.c (errno): Remove decl.
5988 Include <stdlib.h> unconditionally.
5989 (EXIT_FAILURE): Remove macro.
5990 * src/complain.c (vfprintf, strerror): Remove.
5991 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
5992 unconditionally.
5993 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
5994 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
5995 (strchr, strspn, memchr): Remove decls.
5996 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
5997 unconditionally. Do not declare perror.
5998 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
5999 unconditionally.
6000
6001 * src/complain.c (_): Remove useless defn, as system.h defines this.
6002
6003 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
6004 with latest obstack.h.
6005 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
6006 to procedure types, as obstack.h now does that for us.
6007 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
6008
6009 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
6010 so that this include file can stand alone.
6011 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
6012 does this now. Include subpipe.h first after config.h, to
6013 test whether it can stand alone.
6014
6015 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
6016 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
6017 unused declaration.
6018
6019 * tests/synclines.at (%union synch line): Put a dummy member in
6020 the union, because empty unions aren't allowed in C. Caught
6021 by GCC 3.4.0.
6022
4f16766c
PE
60232004-04-13 Jim Meyering <jim@meyering.net>
6024
6025 * src/conflicts.c (conflicts_print): Correct format string typo:
6026 use `%%' to produce literal `%'. (trivial change)
6027
779e7ceb
PE
60282004-03-30 Paul Eggert <eggert@twinsun.com>
6029
6030 * src/getargs.c (version): Update copyright year to 2004.
6031
6032 * data/c.m4 (b4_int_type): Use 'short int' rather than
6033 'short', and similarly for 'long', 'unsigned', etc.
6034 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
6035 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
6036 yy_yypstack, yydumpstack): Likewise.
6037 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
6038 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
6039 Likewise.
6040 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
6041 yy_stack_print, yyparse): Likewise.
6042 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
6043 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
6044 * lib/bitset.c (bitset_print): Likewise.
6045 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
6046 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
6047 * lib/bitsetv.c (bitsetv_dump): Likewise.
6048 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
6049 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
6050 Likewise.
6051 * src/LR0.c (allocate_itemsets): Likewise.
6052 * src/gram.h (rule_number, rule): Likewise.
6053 * src/lalr.h (goto_number): Likewise.
6054 * src/nullable.c (nullable_compute): Likewise.
6055 * src/output.c (prepare_rules): Likewise.
6056 * src/relation.c (relation_print, relation_digraph): Likewise.
6057 * src/relation.h (relation_node): Likewise.
6058 * src/state.h (state_number, transitions, errs, reductions,
6059 struct state): Likewise.
6060 * src/symtab.h (symbol_number, struct symbol): Likewise.
6061 * src/tables.c (vector_number, tally, action_number,
6062 default_goto, goto_actions): Likewise.
6063 * tests/existing.at (GNU Cim Grammar): Likewise.
6064 * tests/regression.at (Web2c Actions): Likewise.
6065
6066 * src/output.c (muscle_insert_short_int_table): Renamed from
6067 muscle_insert_short_table. All uses changed.
6068
d6328241
PH
60692004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6070
6071 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
6072 (declaration): Replace expected_conflicts with expected_sr_conflicts.
6073 Add %expect-rr rule.
4f16766c 6074
d6328241
PH
6075 * src/scan-gram.l: Recognize %expect-rr.
6076
4f16766c 6077 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 6078 expected_conflicts.
4f16766c 6079 (expected_rr_conflicts): Declare.
d6328241
PH
6080
6081 * src/conflicts.c (expected_sr_conflicts): Rename from
6082 expected_conflicts.
6083 (expected_rr_conflicts): Define.
6084 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
6085 for GLR parsers.
6086 Use expected_sr_conflicts in place of expected_conflicts.
6087 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 6088
d6328241 6089 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 6090
1452af69
PE
60912004-03-08 Paul Eggert <eggert@gnu.org>
6092
6093 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 6094 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
6095
6096 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
6097 in lalr1.cc.
6098 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
6099 * src/scan-gram.l (scan_integer): New function.
6100 ({int}): Use it.
6101 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
6102 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
6103 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
6104 Say "long int", not "long", for uniformity with GNU style.
6105
006d217d
PE
61062004-02-25 Paul Eggert <eggert@twinsun.com>
6107
6108 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
6109 compilers. This fixes a problem with Intel's C++ compiler being
6110 chatty, reported by Guido Trentalancia in
161a71f3 6111 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 6112
c2729758
ADL
61132004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
6114
6115 Support %destructor and merge error locations in lalr1.cc.
6116
6117 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
6118 (Parser::stos_): Define unconditionally.
6119 (Parser::destruct_): New method. Generate its body with
6120 b4_yydestruct_generate.
6121 (Parser::error_start_): New attribute.
6122 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
6123 token which are discarded.
6124 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
6125 error_start_ when erroneous token are discarded.
6126 (Parser::parse) <yyerrlab1>: Compute the location of the error
6127 token so that it covers all the discarded tokens.
6128 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
6129 it can be called with `%skeleton "lalr1.cc"', and do that.
6130
dd0e0635
PE
61312004-02-02 Paul Eggert <eggert@twinsun.com>
6132
6133 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
6134 $(top_srcdir)/lib and ../lib. This fixes a bug reported
6135 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
6136 There's no need to mention top_builddir since Automake does that
6137 for us.
6138 (INCLUDES): Remove, as Automake says it's obsolescent.
6139 Contents migrated into AM_CPPFLAGS as described above.
6140 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
6141
61422004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6143
6144 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
6145 (yyreportSyntaxError): Handle case where lookahead token is
6146 YYEMPTY.
6147
be16239b
PH
61482004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6149
6150 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
6151 resulting parsers are compilable with C++.
6152
5fa90832
PE
61532003-12-23 Paul Eggert <eggert@twinsun.com>
6154
6155 * config/depcomp, config/install-sh: Sync with Automake 1.8.
6156 * src/output.c (output_skeleton): Rename local var.
6157 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
6158 Bison tokens, as this runs afoul of the 2003-10-07 change that
6159 disallowed NUL bytes in character constants or string literals.
6160
6161 * tests/local.at: Require Autoconf 2.59's Autotest.
6162 * tests/testsuite.at: Don't include local.at, since we now assume
6163 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
6164 including it.
6165 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
6166 multiple inclusion warnings.
dd0e0635 6167
b165c324
AD
61682003-12-02 Akim Demaille <akim@epita.fr>
6169
6170 * doc/bison.texinfo (How Can I Reset the Parser): More about start
6171 conditions.
6172 From Bruno Haible.
6173
26e06a21
ADL
61742003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
6175
6176 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
6177
92ac3705
PE
61782003-10-07 Paul Eggert <eggert@twinsun.com>
6179
6a5ecb38
PE
6180 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
6181 if testsuite doesn't exist.
6182
92ac3705
PE
6183 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
6184 literals, unfortunately.
6185 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
6186 Complain about NUL bytes in character constants or string literals.
6187
91d2c560
PE
61882003-10-05 Paul Eggert <eggert@twinsun.com>
6189
6190 * NEWS: Don't document %no-default-prec, as it's still
6191 too experimental.
6192 * doc/bison.texinfo: Document %no-default-prec only if
6193 the defaultprec flag is set. Normally it's not.
6194
0cc3da3a
PE
61952003-10-04 Paul Eggert <eggert@twinsun.com>
6196
6197 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
6198 non-modifiable lvalue, instead of a modifiable one.
6199 * doc/bison.texinfo (Actions): Document that $$ can
6200 be assigned to. Do not claim that $$ and $N are
6201 array element references: user code should not rely on this.
6202
22fccf95
PE
62032003-10-01 Paul Eggert <eggert@twinsun.com>
6204
6205 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
6206 (grammar_declaration): Use it.
6207 * src/scan-gram.l: New token %no-default-prec.
6208 * tests/conflicts.at: Revamp tests to use %no-default-prec.
6209 * NEWS, doc/bison.texinfo: Document the above.
6210
fc8f2965
AD
62112003-10-01 Akim Demaille <akim@epita.fr>
6212
6213 VCG no longer supports long_straight_phase.
6214
6215 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
6216 * src/print_graph.c (print_graph): Adjust.
6217
39a06c25
PE
62182003-09-30 Frank Heckenbach <frank@g-n-u.de>
6219 and Paul Eggert <eggert@twinsun.com>
6220
6221 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
6222 Table of Symbols): Document %default-prec.
6223 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
6224 (grammar_declaration): Set default_prec on %default-prec.
6225 * src/scan-gram.l (%default-prec): New token.
6226 * src/reader.h (default_prec): New flag.
6227 * src/reader.c: Likewise.
6228 (packgram): Handle it.
6229 * tests/conflicts.at (%default-prec without %prec,
6230 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 6231
39a06c25
PE
62322003-09-30 Paul Eggert <eggert@twinsun.com>
6233
6234 * tests/testsuite.at: Include local.at, not input.at, fixing
6235 a typo in the 2003-08-25 patch.
6236
62b6aef9
AD
62372003-08-27 Akim Demaille <akim@epita.fr>
6238
6239 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
6240 GCC warnings.
6241
89e1cc61
AD
62422003-08-26 Akim Demaille <akim@epita.fr>
6243
6244 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
6245 "<\#" to avoid magic from Gnus when posting parts of this script.
6246
a08460b0
AD
62472003-08-26 Akim Demaille <akim@epita.fr>
6248
6249 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
6250 (Parser::parse): here.
6251 Adjust: nerrs and errstatus is now replaced by...
6252 (Parser::nerrs_, Parser::errstatus_): New.
6253
603f1cfd
AD
62542003-08-25 Akim Demaille <akim@epita.fr>
6255
6256 * config/announce-gen, Makefile.cfg: New.
6257 * Makefile.am: Adjust.
6258 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
6259 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
6260
cd3684cf
AD
62612003-08-25 Akim Demaille <akim@epita.fr>
6262
6263 When reducing initial empty rules, Bison parser read an initial
6264 location that is not defined. This results in garbage, and that
6265 affects Bison's own parser. Therefore we need (i) to extend Bison
6266 to support a means to initialize this location, and (ii) to use
6267 this CVS Bison to fix CVS Bison's parser.
6268
6269 * src/reader.h, reader.c (epilogue_augment): Remove, replace
6270 with...
6271 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
6272 * src/parse-gram.y: Adjust.
6273 (%initial-action): New.
6274 (%error-verbose): Since we require CVS Bison, there is no reason
6275 not to use it.
6276 * src/scan-gram.l: Adjust.
6277 * src/Makefile.am (YACC): New, to make sure we use our own parser.
6278 * data/yacc.c (yyparse): Use b4_initial_action.
6279
4e03e201
AD
62802003-08-25 Akim Demaille <akim@epita.fr>
6281
6282 * doc/bison.texinfo: Don't promote stdout for error messages.
6283
8c182d05
AD
62842003-08-25 Akim Demaille <akim@epita.fr>
6285
6286 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
6287 From Alexandre Duret-Lutz.
6288
6a60c4cf
PE
62892003-08-25 Akim Demaille <akim@epita.fr>
6290
6291 Version 1.875c.
6292
25f66e1a
AD
62932003-08-25 Akim Demaille <akim@epita.fr>
6294
6295 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
6296 Use them.
6297
5348bfbe
AD
62982003-08-25 Akim Demaille <akim@epita.fr>
6299
6300 * data/lalr1.cc (Parser::reduce_print_): New.
6301 Use it.
6302
47301314
AD
63032003-08-25 Akim Demaille <akim@epita.fr>
6304
6305 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
6306 error recovery loops. This patch is based on
161a71f3 6307 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
6308 Also, augment the similarity between lalr1.cc and yacc.c.
6309 Note: the locations of error recovery rules are not correct yet.
6310
6311 * data/lalr1.cc: Comment changes to augment the similarity between
6312 lalr1.cc and yacc.c.
6313 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
6314 (yyerrlab1): Remove, but where it used to be (now the bottom part of
6315 yyerrlab), when hitting EOF, pop the whole stack here instead of
6316 merely falling thru the default error handling mechanism.
6317 (yyerrorlab): New label, with the old contents of YYERROR,
6318 plus the following change: pop the stack of rhs corresponding
6319 to the production that invoked YYERROR. That is how Yacc
6320 behaves (required by POSIX).
6321 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
6322 fail.
6323
1f7a61ff
AD
63242003-08-25 Akim Demaille <akim@epita.fr>
6325
6326 Tune local.at so that people can "autom4te -l autotest calc.at -o
6327 calc" for instance, to extract a sub test suite.
6328
6329 * tests/testsuite.at: Move the initialization, Autotest version
6330 requirement, and AT_TESTED invocation into...
6331 * tests/local.at: here.
6332 * tests/testsuite.at: Include it for compatibility with Autoconf
6333 2.57.
6334 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
6335 be ignore.
6336
327b5b56
PE
63372003-08-04 Paul Eggert <eggert@twinsun.com>
6338
6339 Rework code slightly to avoid gcc -Wtraditional warnings.
6340 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
6341 The returned value is now stored in *YY0. All callers changed.
6342 * src/output.c (merge_output): Adjust to the above change.
6343
0051e3ed
PE
63442003-07-26 Paul Eggert <eggert@twinsun.com>
6345
6346 * data/glr.c (YYASSERT): New macro.
6347 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
6348 yyresolveStates, yyprocessOneStack):
6349 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
6350 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 6351
137437c6
PE
63522003-07-25 Paul Eggert <eggert@twinsun.com>
6353
5b620e06
PE
6354 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
6355 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 6356 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
6357 by Frank Heckenbach, though I have omitted the structure-initialization
6358 part of his glr-knr.diff patch since I recall that the Portable
6359 C Compiler didn't require that change.
6360
137437c6
PE
6361 Let the user specify how to allocate and free memory.
6362 Derived from a suggestion by Frank Heckenbach in
161a71f3 6363 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
6364 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
6365 All uses of free, malloc, realloc changed to use these macros,
6366 and unnecessary casts removed.
6367 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
6368
ddb85ca5
PE
63692003-07-06 Matthias Mann <MatthiasMann@gmx.de>
6370
6371 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
6372 use s.empty() rather than s == "" to test for empty string; see
161a71f3 6373 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
6374 (trivial change)
6375
39910e09
AD
63762003-06-25 Akim Demaille <akim@epita.fr>
6377
6378 * config/depcomp, config/install-sh: Update from masters.
6379
0ae99356
PE
63802003-06-20 Paul Eggert <eggert@twinsun.com>
6381
6382 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
6383 and return properly parenthesized result.
6384 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
6385 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
6386 Remove unnecessary parentheses from uses.
6387 * doc/bison.texinfo (Location Default Action): Describe the
6388 conventions for parentheses.
6389
cd05d13c
PE
63902003-06-19 Paul Eggert <eggert@twinsun.com>
6391
81fd08ca
PE
6392 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
6393 yyreportTree): Do not assume that size_t is the same width as int,
6394 when printing sizes. Print sizes using an unsigned format.
6395 Problem reported by Frank Heckenbach in
161a71f3 6396 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 6397
cd05d13c
PE
6398 Port to Forte Developer 7 C compiler.
6399 * data/glr.c (struct YYLTYPE): If locations are not being used,
6400 declare a single dummy member, as empty structs do not conform
6401 to the C standard.
6402 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
6403 the Forte Developer 7 C compiler complains that end-of-loop
6404 code is not reached.
6405
4dcf140b
PE
64062003-06-17 Paul Eggert <eggert@twinsun.com>
6407
6408 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
6409 avoid warnings from picky compilers about redefinition of PARAMS.
6410
8dd76bee
PE
64112003-06-17 Paul Eggert <eggert@twinsun.com>
6412
6413 Version 1.875b.
6414
6415 * NEWS: Document 1.875b.
6416
6417 * lib/bbitset.h: Do not include config.h; that's the includer's job.
6418 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
6419 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
6420 Don't use 'index' in comments, as it's a builtin fn on some hosts.
6421 * lib/bitset_stats.c: Include gettext.h unconditionally, as
6422 per recent gettext manual's suggestion.
6423 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
6424 Use prototypes, not old-style definitions.
6425 * lib/lbitset.c (lbitset_unused_clear): Likewise.
6426 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
6427 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
6428 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
6429 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
6430 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
6431 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
6432 vbitset_or_and_cmp, vbitset_copy): Likewise.
6433
6434 * lib/libiberty.h: Do not include config.h; that's the includer's job.
6435 Do not include <stdlib.h>.
6436 (PARAMS): Define unconditionally for C89.
6437 (ATTRIBUTE_NORETURN): Remove.
6438 (ATTRIBUTE_UNUSED): Define unconditionally.
6439
6440 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 6441 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
6442 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
6443 * lib/vbitset.c, lib/vbitset.h: New files.
6444 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
6445 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
6446 from libbitset.
6447
6448 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
6449 `How Can I Reset @code{yyparse}', since texinfo does not allow
6450 arbitrary @ in node names.
6451
6452 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
6453 shouldn't be needed according to the gettext 0.12.1 documentation
6454 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 6455 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 6456 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 6457 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 6458
8dd76bee
PE
6459 * lib/.cvsignore: Add stdbool.h.
6460 * m4/.cvsignore: Add nls.m4, po.m4.
6461
6462 Upgrade to CVS gnulib.
6463 * stdbool_.h: File renamed from stdbool.h.in.
6464 * configure.ac (AM_STDBOOL_H): Invoke this instead of
6465 AC_HEADER_STDBOOL.
6466 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
6467 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
6468 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
6469 (MOSTLYCLEANFILES): New var.
6470 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
6471 (stdbool.h): New rule.
6472 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
6473 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
6474 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
6475 m4/quote.m4: Upgrade to today's gnulib.
6476
6477 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
6478 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
6479 the tests right now.
6480 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
6481 yyerror are declared before use; C99 requires this.
6482
25005f6a
PH
64832003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6484
6485 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
6486 first.
6487 (yyrecoverSyntaxError): Correct the logic for setting and testing
6488 yyerrState.
6489 Correct comment on handling EOF.
6490 Allow states with only a default reduction, rather than failing
8dd76bee 6491 (I can't quite reconstruct why these were not allowed before).
25005f6a 6492
137437c6 6493 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 6494 buffer overruns, corrupting state.
8dd76bee
PE
6495
6496 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
6497 definition.
6498 * src/reader.h (max_left_semantic_context): New variable declaration.
6499 * src/scan-gram.l (max_left_semantic_context): Define.
6500 (handle_action_dollar): Update max_left_semantic_context.
6501 * data/glr.c (YYMAXLEFT): New definition.
6502 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
6503 (yyresolveAction): Ditto.
6504
6505 Fixes to problems with location handling in GLR parsers reported by
6506 Frank Heckenbach (2003/06/05).
6507
6508 * data/glr.c (YYLTYPE): Make trivial if locations not used.
6509 (YYRHSLOC): Add parentheses, and define only if locations used.
6510 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
6511 locations not used.
6512 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
6513 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 6514
25005f6a
PH
6515 * tests/cxx-type.at: Exercise location information; update tests
6516 to differentiate output with and without locations.
8dd76bee 6517 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
6518 because default YYLTYPE not yet defined.
6519 Change semantic actions to compute strings, rather than printing
6520 them directly (to test proper passing of semantics values). Change
6521 output to prefix notation and update test data and expected results.
6522 (yylex): Track locations.
6523 (stmtMerge): Return value rather than printing, and include arguments
6524 in value.
8dd76bee 6525
711f40b7
PE
65262003-06-03 Paul Eggert <eggert@twinsun.com>
6527
6528 Avoid warnings generated by GCC 2.95.4 when Bison is
6529 configured with --enable-gcc-warnings.
6530 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
6531 yy::]b4_parser_class_name[::translate_,
6532 yy::Stack::operator[] (unsigned),
6533 yy::Stack::operator[] (unsigned) const,
6534 yy::Slice::operator[] (unsigned),
6535 yy::Slice::operator[] (unsigned) const):
6536 Rename local vars to avoid warnings.
6537 * tests/glr-regression.at (Improper handling of embedded actions
6538 and $-N in GLR parsers): Remove unused local variable from yylex.
6539 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
6540 (void) as arg when not pure, since we now assume C89 when building
6541 Bison. Pacify GCC by using parameter.
6542
ac695f7d
PE
65432003-06-02 Paul Eggert <eggert@twinsun.com>
6544
6545 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
6546 yy::Location::lines, yy::Location::columns): Rename arguments
6547 to avoid shadowing; this removes a warning generated by GCC 3.3.
6548
26ec81e0
PE
65492003-06-01 Paul Eggert <eggert@twinsun.com>
6550
6551 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
6552 to g++, as GCC 3.3 complains if you do it.
6553 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
6554 everything that WARNING_CFLAGS has, except omit warnings
6555 not suitable for C++.
6556 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
6557 * tests/atlocal.in (CXXFLAGS): New var.
6558 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
6559
6560 Fix a GLR parser bug I reported in February; see
161a71f3 6561 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
6562 The problem was that GLR parsers did not conform to the C standard,
6563 because actions like { $1 = $2 + $3; } expanded to expressions
6564 that invoked YYFILL in separate subexpressions, and YYFILL assigned
6565 to a local variable. The C standard says that expressions
6566 like (var = f ()) + (var = f ()) have undefined behavior.
6567 Another problem was that GCC sometimes issues warnings that
6568 yyfill and its parameters are unused.
6569
6570 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
6571 as possibly unused.
6572 (yyfill): New function.
6573 (YYFILL): Use it.
6574 (yyuserAction): Change type of yynormal to bool, so that it matches
6575 the new yyfill signature. Mark it as possibly unused.
6576
6577
6578 Follow up on a bug I reported in February, where a Bison-generated
6579 parser can loop. Provide a test case and a fix for yacc.c. I
6580 don't have a fix for lalr1.cc or for glr.c, unfortunately.
6581 The original bug report is in:
161a71f3 6582 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
6583
6584 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
6585 macro's size was becoming unwieldy.
6586 (yyerrlab): Do not discard an empty lookahead symbol, as this
6587 might destroy garbage.
6588 (yyerrorlab): New label, with the old contents of YYERROR,
6589 plus the following change: pop the stack of rhs corresponding
6590 to the production that invoked YYERROR. That is how Yacc
6591 behaves, and POSIX requires this behavior.
6592 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
6593 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
6594 Define 'alarm' to do nothing if unistd.h is not available.
6595 Add a new rule "exp: '-' error;" to test the above change to
6596 data/yacc.c. Use 'alarm' to abort any test taking longer than
6597 10 seconds, as it's probably looping.
6598 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
6599 Also, the new yacc.c generates two fewer diagnostics for an
6600 existing test.
6601
d0829076
PE
66022003-05-24 Paul Eggert <eggert@twinsun.com>
6603
c6ae27df
PE
6604 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
6605 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
6606 This fixes a problem reported by John Bowman when the Compaq/HP
6607 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
6608 -ansi -Wall -gall).
6609 * data/yacc.c (union yyalloc): Likewise.
6610 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 6611
d0829076
PE
6612 Switch from 'int' to 'bool' where that makes sense.
6613
6614 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
6615 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
6616 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
6617 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
6618 Return or accept bool, not int. All callers changed.
6619 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
6620 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
6621 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
6622 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
6623 bitset_or_and_cmp_): Likewise.
6624 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
6625 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
6626 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
6627 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
6628 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
6629 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
6630 bitset_stats_or_and_cmp): Likewise.
6631 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
6632 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
6633 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
6634 ebitset_xor_cmp): Likewise.
6635 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
6636 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
6637 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
6638 lbitset_xor_cmp): Likewise.
6639 * lib/bbitset.h: Include <stdbool.h>.
6640 (struct bitset_vtable): The following members now return bool, not
6641 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
6642 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
6643 or_and_cmp).
6644 * src/conflicts.c (count_rr_conflicts): Likewise.
6645 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
6646 All uses changed.
6647 * lib/ebitset.c (ebitset_obstack_init): Likewise.
6648 * lib/lbitset.c (lbitset_obstack_init): Likewise.
6649 * src/getargs.c (debug_flag, defines_flag, locations_flag,
6650 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
6651 graph_flag): Likewise.
6652 * src/getargs.h (debug_flag, defines_flag, locations_flag,
6653 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
6654 graph_flag): Likewise.
6655 * src/output.c (error_verbose): Likewise.
6656 * src/output.h (error_verbose): Likewise.
6657 * src/reader.c (start_flag, typed): Likewise.
6658 * src/reader.h (typed): Likewise.
6659 * src/getargs.c (LOCATIONS_OPTION): New constant.
6660 (long_options, getargs): Use it.
6661 * src/lalr.c (build_relations): Use bool, not int.
6662 * src/nullable.c (nullable_compute): Likewise.
6663 * src/print.c (print_reductions): Likewise.
6664 * src/tables.c (action_row, pack_vector): Likewise.
6665 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
6666 * src/output.c (prepare): Use it.
6667 * src/output.c (token_definitions_output,
6668 symbol_destructors_output, symbol_destructors_output): Use string,
6669 not boolean integer, to keep track of whether to output separator.
6670 * src/print_graph.c (print_core): Likewise.
6671 * src/state.c (state_rule_lookaheads_print): Likewise.
6672
6673 * config/install-sh: Sync from automake 1.7.5.
6674
6b2584b7
PE
66752003-05-14 Paul Eggert <eggert@twinsun.com>
6676
6677 * src/parse-gram.y (rules_or_grammar_declaration): Require a
6678 semicolon after a grammar declaration, in the interest of possible
6679 future changes to the Bison input language.
6680 Do not allow a stray semicolon at the start of the grammar.
6681 (rhses.1): Allow one or more semicolons after any rule, including
6682 just before "|" as required by POSIX.
6683 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
6684 grammar.
6685
caf37a36
ADL
66862003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
6687
6688 %parse-param support for lalr1.cc.
6689
6690 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
6691 b4_cc_constructor_calls, b4_cc_constructor_call,
6692 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
6693 definitions.
6694 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
6695 parse-param arguments.
6696 (yy::b4_parser_class_name): Declare instance variables to
6697 hold parse-param arguments.
6698 * tests/calc.at: s/value/semantic_value/ because value clashes
6699 with a member of yy::b4_parser_class_name. Adjust C++ code
6700 to handle %parse-param. Enable %parse-param test in C++.
6701
3ab37077
PE
67022003-05-12 Paul Eggert <eggert@twinsun.com>
6703
6704 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
6705 English a bit. Fix fclose typo. Change "const char" to "char
6706 const", and use ANSI C rather than K&R for "main". Suggest
6707 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
6708 and suggest yy_switch_to_buffer.
6709
67102003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
6711
6712 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
6713 C89. This avoids a diagnostic on compilers that define __STDC__
6714 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 6715 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 6716
e743727f
PE
67172003-05-03 Paul Eggert <eggert@twinsun.com>
6718
6719 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
6720 Do not overrun array bounds.
6721 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 6722 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 6723
916708d5
AD
67242003-04-29 Akim Demaille <akim@epita.fr>
6725
6726 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
6727 * src/getargs.c, src/getargs.h: here, as bool, not int.
6728 (nondeterministic_parser): New.
6729 * src/parse-gram.y, src/scan-gram.l: Support
6730 %nondeterministic-parser.
6731 * src/output.c (prepare): Use nondeterministic_parser instead
6732 of glr_parser where appropriate.
6733 * src/tables.c (conflict_row, action_row, save_row)
6734 (token_actions, token_actions, pack_vector): Ditto.
6735
a06ea4aa
AD
67362003-04-29 Akim Demaille <akim@epita.fr>
6737
6738 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
6739
211074ca
AD
67402003-04-29 Akim Demaille <akim@epita.fr>
6741
6742 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
6743 with %pure-parser and %locations to exercise the patch from Yakov
6744 Markovitch below.
6745
6175ffe3
PE
67462003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
6747
6748 * data/yacc.c: (b4_lex_param): Corrected for the case where
6749 %lex-param is provided and %pure-parser isn't.
6750
b1e95857
PE
67512003-04-27 Paul Eggert <eggert@twinsun.com>
6752
6753 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 6754 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
6755 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
6756 if it is not defined.
6757 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
6758
acda9df6
PE
67592003-04-26 Paul Eggert <eggert@twinsun.com>
6760
3470c57b
PE
6761 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
6762 Declare to be of type suitable for the ninf value itself, not of
6763 type suitable for the corresponding table, since the latter might
6764 be unsigned but the ninf value might be negative. This fixes a
6765 bug reported by Alexandre Duret-Lutz in
161a71f3 6766 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 6767
acda9df6
PE
6768 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
6769 invokes it. We shouldn't invoke it twice because it will attempt
6770 to put error.o in the archive twice. This fixes a glitch reported
6771 by Martin Mokrejs in
161a71f3 6772 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 6773
b5250f26
PE
67742003-04-21 Paul Eggert <eggert@twinsun.com>
6775
6776 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
6777 to gnulib.
6778
089ac0f1
PE
67792003-04-21 Yakov Markovitch <Markovitch@iso.ru>
6780
6781 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
6782 Fix obvious typo that results in uncompilable GLR parsers
6783 when both %pure-parser and %locations are used. (trivial change)
6784
5ededac6
PE
67852003-04-17 Paul Eggert <eggert@twinsun.com>
6786
1b8f2fff
PE
6787 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
6788 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
6789 Do not insert the expected token via unput, as this runs afoul
6790 of a POSIX-compatibility bug in flex 2.5.31.
6791 All uses changed to BEGIN the parent state,
6792 since we no longer insert the expected token via unput.
6793 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
6794 that is no longer emitted after the above change.
6795
5ededac6
PE
6796 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
6797 the first one. This change is from Paul Hilfinger, and it fixes
6798 regression reported by Werner Lemberg in
161a71f3 6799 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
6800
6801 (resolve_sr_conflict): Don't invoke state_errs_set
6802 unless one or more tokens have been explicitly made errors.
6803 Otherwise, the above change causes Bison to abort.
6804
6805 * tests/existing.at (GNU pic Grammar): New test case, taken from
6806 Lemberg's email.
6807
b8be9132
AD
68082003-03-31 Akim Demaille <akim@epita.fr>
6809
6810 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
6811
d423d460
AD
68122003-03-31 Akim Demaille <akim@epita.fr>
6813
6814 * src/output.c (prepare_symbols): Avoid trailing spaces in the
6815 output.
6816
c7e441b4
AD
68172003-03-31 Akim Demaille <akim@epita.fr>
6818
6819 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
6820 From Paul Hilfinger.
6821
231897ad
AD
68222003-03-29 Akim Demaille <akim@epita.fr>
6823
6824 * m4/error.m4: Do not put under dynamic conditions some code which
6825 expansion is under static control.
6826
5b066063
AD
68272003-03-29 Akim Demaille <akim@epita.fr>
6828
6829 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
6830
22a74fec
AD
68312003-03-29 Akim Demaille <akim@epita.fr>
6832
6833 * doc/bison.texinfo (Strings are Destroyed): New.
6834
0eee27e7
PE
68352003-03-13 Paul Eggert <eggert@twinsun.com>
6836
6837 * .cvsignore: Add configure.lineno.
6838 * src/.cvsignore: Add yacc.
6839 * tests/.cvsignore: Add testsuite.log.
6840 * doc/fdl.texi: Sync with latest FSF version.
6841
f61aad93
PE
68422003-03-12 Paul Eggert <eggert@twinsun.com>
6843
537636c7
PE
6844 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
6845 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
6846 cursor, instead of leaving it undefined. This fixes a bug
6847 reported by Tim Van Holder in
161a71f3 6848 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
6849 * tests/input.at (Torturing the Scanner): Test the scanner on
6850 an empty input file, which was Tim Van Holder's test case.
6851
6852 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
6853 <sys/resource.h> can be included, include sys/time.h and
6854 sys/times.h first, if available. This works around the SunOS
6855 4.1.4 porting bug reported by Bruce Becker in
161a71f3 6856 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
6857
6858 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
6859 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
6860 AC_HEADER_SYS_WAIT.
6861
f61aad93
PE
6862 Merge changes from gnulib. This was prompted because the CVS
6863 snapshot didn't build on Solaris 7 due to strnlen problems.
6864
6865 These changes need to be merged back into gnulib:
6866 * lib/hash.c: Include <stdbool.h> unconditionally.
6867 * m4/onceonly.m4 (m4_quote): New macro.
6868 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
6869 Quote AC_FOREACH variable-expansions properly.
6870 The 2003-01-03 obstack.h change also needs merging.
6871 {end of changes requiring merging}
5b066063 6872
f61aad93
PE
6873 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
6874 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
6875 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
6876 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
6877 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
6878 New files, imported from gnulib.
6879 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
6880 above.
6881
6882 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
6883 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
6884 gnulib sources.
6885
6886 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
6887 Add.
6888 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
6889 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
6890 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
6891 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
6892 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
6893 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
6894 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
6895 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
6896 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
6897 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
6898 (jm_PREREQ_ARGMATCH): Remove.
6899 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
6900 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
6901
6902 * src/system.h: Include <stdbool.h> unconditionally.
6903
6904 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
6905 assuming at least C89 in the bitset code for some time now.
6906
d2ffe116
AD
69072003-03-03 Akim Demaille <akim@epita.fr>
6908
6909 * ro.po: New.
6910
052826fd
AD
69112003-03-02 Akim Demaille <akim@epita.fr>
6912
6913 * doc/bison.texinfo (Table of Symbols): Reactivate the
6914 documentation for %lex-param, and %parse-param.
6915
c4749565
AD
69162003-03-02 Akim Demaille <akim@epita.fr>
6917
6918 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
6919 generate verbose error messages.
6920 Use the number of tokens as an upper bound in yytname, as it
6921 cannot be a non terminal.
6922
d5286af1
AD
69232003-03-02 Akim Demaille <akim@epita.fr>
6924
6925 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
6926 message.
6927
22e304a6
AD
69282003-03-02 Akim Demaille <akim@epita.fr>
6929
22e304a6
AD
6930 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
6931 Use them to exercise yycheck overrun.
6932 Based on Andrew Suffield's grammar.
6933
67a25fed
AD
69342003-03-02 Akim Demaille <akim@epita.fr>
6935
6936 Create tests/local.at for Bison generic testing macros.
6937
6938 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
6939 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
6940 This new file.
6941 * tests/calc.at (AT_CHECK_CALC): Adjust.
6942 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
6943 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
6944 * tests/local.at: here.
6945 (AT_COMPILE_CXX): Tags the tests using it as c++.
6946 Ignore the test if CXX is not functional.
6947
9c2b381f
PE
69482003-03-01 Paul Eggert <eggert@twinsun.com>
6949
6950 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
6951 not loc->end, since loc->end might contain garbage and this leads
6952 to undefined behavior on some platforms.
6953 (id_loc, token_start): Use (IF_LINTed) initial values that do not
6954 depend on *loc, so that the reader doesn't give the the false
6955 impression that *loc is initialized.
6956 (<INITIAL>"%%"): Do not bother setting code_start, since its value
6957 does not survive the return.
6958
0433ba88
AD
69592003-03-01 Akim Demaille <akim@epita.fr>
6960
6961 * src/scan-gram.l (code_start): Always initialize it when entering
6962 into yylex, as SC_EPILOGUE is activated *before* the corresponding
6963 yylex invocation. An alternative would be making it static, but
6964 then it starts with the second %%'s beginning, instead of its end.
6965
b305ea69
PE
69662003-02-28 Paul Eggert <eggert@twinsun.com>
6967
6968 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
6969 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 6970 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 6971
c3d25e01
PE
69722003-02-26 Paul Eggert <eggert@twinsun.com>
6973
6974 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
6975 Remove Sequent/Pyramid discussion (nobody uses them any more).
6976 Merge VMS and MS-DOS discussion; these ports may well be dead
6977 but let's keep mentioning them for now. Put <> around email
6978 addresses. Add copyright notice.
6979
c267ffbc
PE
69802003-02-24 Paul Eggert <eggert@twinsun.com>
6981
6982 * data/glr.c (yy_reduce_print): yylineno -> yylno,
6983 to avoid collision with flex use of yylineno.
6984 Problem reported by Bruce Lilly in
161a71f3 6985 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
6986 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
6987 * data/yacc.c (yy_reduce_print): Likewise.
6988
6989 * config/depcomp: Sync with Automake 1.7.3.
6990
f939fc12
AD
69912003-02-21 Akim Demaille <akim@epita.fr>
6992
6993 * data/lalr1.cc: Use temporary variables instead of casts to
6994 change integer types.
6995 Suggested by Paul Eggert.
6996
95923bd6
AD
69972003-02-21 Akim Demaille <akim@epita.fr>
6998
6999 * doc/bison.texinfo: Use "location" consistently to refer to @n,
7000 to avoid confusions with lalr1.cc's notion of Position.
7001 Suggested by Paul Eggert.
7002
2cdc240e
AD
70032003-02-20 Akim Demaille <akim@epita.fr>
7004
7005 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
7006 before initial_columns.
7007 (location.hh): Use consistent variable names when defining the
7008 operator<<.
7009 Use "last" so that we subtract from Positions, not from unsigned.
7010
5d003116
AD
70112003-02-20 Akim Demaille <akim@epita.fr>
7012
7013 * data/lalr1.cc (position.hh): New subfile, including the extended
7014 and Doxygen'ed documentation of class Position.
7015 (location.hh): Use it.
7016 Document a` la Doxygen.
ba1ecc07 7017 With the help of Benoit Perrot.
5d003116 7018
d02b25f9
AD
70192003-02-20 Akim Demaille <akim@epita.fr>
7020
7021 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
7022 AT_YACC_IF.
7023 Redefine AT_YYERROR_SEES_LOC_IF using it.
7024 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
7025 not defined.
7026 Don't use the location in yy::Parser::error_ and
7027 yy::Parser::print_ when not %locations.
7028 Activate more lalr1.cc tests.
7029
0d1c3a04
AD
70302003-02-19 Akim Demaille <akim@epita.fr>
7031
7032 * data/lalr1.cc: When displaying a line number, be sure to make it
7033 an int.
7034
60a777aa
AD
70352003-02-19 Akim Demaille <akim@epita.fr>
7036
7037 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
7038 Remove, useless.
7039 (YYABORT, YYACCEPT, YYERROR): New.
7040 * tests/calc.at: Renable the lalr1.cc test.
7041
0b86fc41
AD
70422003-02-19 Akim Demaille <akim@epita.fr>
7043
7044 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
7045 error recovery, mixing with/without pops and discarding of the
7046 lookahead.
7047 Exercise YYERROR.
7048 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
7049
da99a5dc
PE
70502003-02-17 Paul Eggert <eggert@twinsun.com>
7051
7052 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
7053 * tests/testsuite.at (AT_COMPILE): Use them.
7054 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 7055 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 7056
93b8c255
PE
70572003-02-12 Paul Eggert <eggert@twinsun.com>
7058
7059 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
7060 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 7061 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
7062 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
7063 Check for malloc failure, for consistency with yacc.c.
7064 (yytname_size): Remove, for consistency with yacc.c.
7065
7066 The bug still remains in data/lalr1.cc, as I didn't have time
7067 to fix it there.
7068
7548fed2
AD
70692003-02-06 Akim Demaille <akim@epita.fr>
7070
7071 * configure.ac (GXX): Rename as...
7072 (CXX): this, to keep the original Autoconf semantics.
7073 Require 2.57.
7074 * data/lalr1.cc: Fix b4_copyright invocations.
7075 If YYDEBUG is not defined, don't depend upon name_ being defined.
7076 (location.hh): Include string and iostream.
7077 (Position::filename): New member.
7078 (Position::Position ()): New.
7079 (operator<< (Position)): New.
7080 (operator- (Position, int)): New.
7081 (Location::first, Location::last): Rename as...
7082 (Location::begin, Location::end): these, to mock the conventional
7083 iterator names.
7084 (operator<< (Location)): New.
7085 * tests/atlocal.in (CXX): New.
7086 * tests/testsuite.at (AT_COMPILE_CXX): New.
7087 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
7088 locations in a more synthetic way.
7089 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
7090 lalr1.cc is used.
7091 Adjust the C locations to match those from Emacs: first column is
7092 column 0.
7093 Change all the expected results.
7094 Conform to the GCS: simplify the locations when applicable.
7095 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
7096 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
7097 these CPP macros with the m4 macros new defined by...
7098 (AT_CHECK_PUSHDEFS): this, i.e.:
7099 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 7100 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
7101 New macros.
7102 (AT_CHECK_POPDEFS): Undefine them.
7103 (AT_CHECK_CALC_LALR1_CC): New.
7104 Use it for the first lalr1.cc test.
7105
43a176ef
AD
71062003-02-04 Akim Demaille <akim@epita.fr>
7107
7108 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
7109 Location as is defined.
7110
fc049e9c
AD
71112003-02-04 Akim Demaille <akim@epita.fr>
7112
7113 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
7114 name_ being defined.
7115
a737b216
PE
71162003-02-03 Paul Eggert <eggert@twinsun.com>
7117
7118 * src/gram.h (start_symbol): Remove unused decl.
7119
7120 Use more-consistent naming conventions for local vars.
7121
7122 * src/derives.c (derives_compute): Change type of local var from
7123 int to rule_number.
7124 * src/gram.c (grammar_rules_partial_print): Likewise.
7125 * src/print.c (print_core): Likewise.
7126 * src/reduce.c (reduce_grammar_tables): Likewise.
7127
7128 * src/gram.c (grammar_dump): Change name of item_number *
7129 local var from r to rp.
7130 * src/nullable.c (nullable_compute): Likewise.
7131
7132 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
7133
7134 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
7135 for symbol or symbol_number var.
7136 * src/reader.c (grammar_start_symbol_set): Likewise.
7137 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
7138 Likewise.
7139 * src/state.c (transitions_to): Likewise.
7140 * src/state.h: Likewise.
7141 * src/tables.c (symbol_number_to_vector_number): Likewise.
7142
7143 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
7144 char * var.
7145
7146 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
7147 var.
7148
7149 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
7150 var.
7151
7152 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
7153 Use str, not s, for char * var. Use ch, not c, for character var.
7154 Use size for size var.
7155
7156 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
7157 char * var.
7158 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
7159 uniqstr var.
7160 * src/uniqstr.h: Likewise.
7161
7162 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
7163 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
7164 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
7165 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
7166 param to have same name as that of enum, so that we don't use
7167 "s" to stand for a non-state.
7168
68e93ad5
AD
71692003-02-02 Akim Demaille <akim@epita.fr>
7170
7171 * src/scan-skel.l: Scan more than one inert character per yylex
7172 invocation.
7173
92898986
PE
71742003-02-01 Paul Eggert <eggert@twinsun.com>
7175
7176 Version 1.875a.
7177
1d9d5d71
PE
7178 * po/LINGUAS: Add ms.
7179
0435d061
AD
71802003-01-30 Akim Demaille <akim@epita.fr>
7181
7182 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
7183
6029a57f
PH
71842003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7185
7186 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
7187 of $1.
0435d061
AD
7188
7189 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 7190 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 7191 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 7192
6029a57f
PH
7193 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
7194 (b4_rhs_location): Ditto.
0435d061 7195 (yyfill): New function to copy from stack tree into array
6029a57f 7196 incrementally.
0435d061
AD
7197 (yyuserAction): Modify to allow incremental move of semantic values
7198 to rhs array when in GLR mode.
7199 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
7200 as needed.
7201 Remove dummy use of yystack, as there is now a guaranteed use.
7202 (yydoAction): Modify to allow incremental move of semantic values
7203 to rhs array when in GLR mode.
7204 (yyresolveAction): Ditto.
7205 (yyglrShiftDefer): Update comment.
0435d061 7206 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
7207 (yyglrReduce): Ditto.
7208 (yydoAction): Ditto
0435d061 7209
6029a57f
PH
7210 * tests/glr-regr1.at: Rename to ...
7211 * tests/glr-regression.at: Add new regression test for the problems
7212 described above (adapted from S. Eken).
7213 Update copyright notice.
7214 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
7215 * tests/Makefile.am: Ditto.
7216
6cee6297
PE
72172003-01-28 Paul Eggert <eggert@twinsun.com>
7218
7219 * data/lalr1.cc: Do not use @output_header_name@ unless
7220 b4_defines_flag is set. This fixes two bugs reported by
7221 Tim Van Holder in
161a71f3
PE
7222 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
7223 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 7224
b2a836b5
PE
72252003-01-21 Paul Eggert <eggert@twinsun.com>
7226
7227 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
7228 we don't need to worry about yyerrlab1 being reported as an
7229 "unused label" by non-GCC C compilers. The downside is that if
7230 locations are used then a couple of statements are duplicated each
7231 time YYERROR is invoked, but the upside is that the warnings
7232 should vanish.
7233 (yyerrlab1): Move code to YERROR.
7234 (yyerrlab2): Remove. Change uses back to yyerrlab1.
7235 This reverts some of the 2002-12-27 change.
7236
4196b931
PE
72372003-01-17 Paul Eggert <eggert@twinsun.com>
7238
7239 * src/output.c (symbol_printers_output): Fix typo that led
7240 to core dump. Problem reported by Antonio Rus in
161a71f3 7241 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 7242
3ae831b4
AD
72432003-01-13 Akim Demaille <akim@epita.fr>,
7244 Quoc Peyrot <chojin@lrde.epita.fr>,
7245 Robert Anisko <anisko_r@lrde.epita.fr>
7246
7247 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
7248 when the stacks contain one element, as the loop would otherwise
7249 free the last state, and then use the top state (the one we just
7250 popped). This means that the initial elements will not be freed
7251 explicitly, as is the case in yacc.c; it is not a problem, as
7252 these elements have fake values.
7253
e3aa65c5
PE
72542003-01-11 Paul Eggert <eggert@twinsun.com>
7255
7256 * NEWS: %expect-violations are now just warnings, reverting
7257 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
7258 bootstrapping problem reported by Matthias Klose; see
161a71f3 7259 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
7260 * src/conflicts.c (conflicts_print): Likewise.
7261 * tests/conflicts.at (%expect not enough, %expect too much,
7262 %expect with reduce conflicts): Likewise.
7263 * doc/bison.texinfo (Expect Decl): Document this. Also mention
7264 that the warning is enabled if the number of conflicts changes
7265 (not necessarily increases).
7266
7267 * src/getargs.c (version): Update copyright year.
7268
f0057011
AD
72692003-01-09 Akim Demaille <akim@epita.fr>
7270
7271 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
7272
1ee6d2a0
PE
72732003-01-08 Paul Eggert <eggert@twinsun.com>
7274
7275 * Makefile.maint (WGETFLAGS):
7276 New macro, containing "-C off" to disable proxy caches.
7277 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
7278 (rel-check): Use $(WGET) instead of wget.
7279
d4fd77c4
PE
72802003-01-06 Paul Eggert <eggert@twinsun.com>
7281
7282 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
7283 the GLR paper of Scott, Johnstone and Hussain.
7284
464c6927
PE
72852003-01-04 Paul Eggert <eggert@twinsun.com>
7286
d600ee67
PE
7287 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
7288 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
7289 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
7290 (EXTRA_LIBRARIES): New var, for liby.a.
7291 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
7292 (EXTRA_SCRIPTS): New var, for yacc.
7293
464c6927
PE
7294 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
7295 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
7296 Problem reported by Nelson H. F. Beebe.
7297
72982003-01-03 Paul Eggert <eggert@twinsun.com>
7299
7300 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
7301 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
7302 when compiling Bison 1.875's `bitset bset = obstack_alloc
7303 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
7304
7305 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
7306 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
7307 grow to a huge size with typical invocation.
d600ee67 7308
464c6927
PE
7309 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
7310 Use the pattern recommended by Autoconf 2.57, except also protect
7311 against double-definition.
7312 * src/system.h: Likewise.
7313 Portability issues reported by Nelson H. F. Beebe.
d600ee67 7314
464c6927
PE
7315 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
7316 All uses changed. Provide a definition in both C and C++.
7317 (yytrue, yyfalse): Define even if defined (__cplusplus).
7318
7319 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
7320 Reported by Nelson H. F. Beebe.
d600ee67 7321
464c6927
PE
7322 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
7323
0f42c7d5
PE
73242003-01-02 Paul Eggert <eggert@twinsun.com>
7325
7326 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
7327 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
7328 Bug reported by Nelson H. F. Beebe.
7329
dc546b0f
PE
73302003-01-01 Paul Eggert <eggert@twinsun.com>
7331
7332 * Version 1.875.
7333
2c09b6a7
PE
73342002-12-30 Paul Eggert <eggert@twinsun.com>
7335
7336 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
7337 Moved here from...
7338 (<INITIAL>","): Here. This causes stray "," to be treated
7339 more uniformly.
7340
dc546b0f 7341 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
7342 last brace in braced code when not in Yacc mode, for compatibility
7343 with Bison 1.35. This resurrects the 2001-12-15 patch to
7344 src/reader.c.
7345
7346 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
7347 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
7348
535c0f63
PE
73492002-12-28 Paul Eggert <eggert@twinsun.com>
7350
7351 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
7352 that of SYM's type. This fixes Debian bug 168069, reported by
7353 Thomas Olsson.
d600ee67 7354
963fcc17
PE
73552002-12-28 Paul Eggert <eggert@twinsun.com>
7356
7357 Version 1.75f.
7358
7359 Switch back to the Yacc style of conflict reports, undoing some
7360 of the 2002-07-30 change.
7361 * doc/bison.texinfo (Understanding): Use Yacc style for
7362 conflict reports. Also, use new way of locating rules.
7363 * src/conflicts.c (conflict_report):
7364 Renamed from conflict_report_yacc, removing the old
7365 'conflict_report'. Translate the entire conflict report at once,
7366 so that we don't assume that "," has the same interpretation in
7367 all languages.
7368 (conflicts_output): Use Yacc-style conflict report for each state,
7369 instead of our more-complicated style.
7370 (conflicts_print): Use Yacc-style conflict report, except print
7371 the input file name when not emulating Yacc.
7372 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
7373 Conflicted Reduction, %expect not enough, %expect too much,
7374 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
7375 * tests/existing.at (GNU Cim Grammar): Likewise.
7376 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
7377
7378 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
7379 fatal): Don't invoke fflush; it's not needed and it might even be
7380 harmful for stdout, as stdout might not be open.
7381 * src/reduce.c (reduce_print): Likewise.
7382
b1efe548
PE
73832002-12-27 Paul Eggert <eggert@twinsun.com>
7384
7385 Fix a bug where error locations were not being recorded correctly.
7386 This problem was originally reported by Paul Hilfinger in
161a71f3 7387 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
7388
7389 * data/yacc.c (yyparse): New local var yylerrsp, to record the
7390 top of the location stack's error locations.
7391 (yyerrlab): Set it. When discarding a token, push its location
7392 onto yylerrsp so that we don't lose track of the error's end.
7393 (yyerrlab1): Now is only the target of YYERROR, so that we can
7394 properly record the location of the action that failed. For GCC
7395 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
7396 GCC warning about yyerrlab1 being unused if YYERROR is unused.
7397 (yyerrlab2): New label, which yyerrlab now falls through to.
7398 Compute the error's location by applying YYLLOC_DEFAULT to
7399 the locations of all the symbols that went into the error.
7400 * doc/bison.texinfo (Location Default Action): Mention that
7401 YYLLOC_DEFAULT is also invoked for syntax errors.
7402 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7403 Error locations include the locations of all the tokens that were
7404 discarded, not just the last token.
d600ee67 7405
983c5c2c
PE
74062002-12-26 Paul Eggert <eggert@twinsun.com>
7407
b1efe548
PE
7408 * src/files.c: Include quote.h.
7409 (compute_output_file_names): Warn if we detect conflicting
7410 outputs to the same file. This should catch the misunderstanding
7411 exemplified by Debian Bug 165349, reported by Bruce Stephens..
7412
7413 * src/conflicts.c (conflicts_print): If the user specifies
7414 "%expect N", report an error if there are any reduce/reduce
7415 conflicts. This is what the manual says should happen.
7416 This fixes Debian bug 130890, reported by Anthony DeRobertis.
7417 * tests/conflicts.at (%expect with reduce conflicts): New test.
7418
983c5c2c
PE
7419 Don't use m4_include on relative file names, as it doesn't work as
7420 desired if there happens to be a file with that name under ".".
d600ee67 7421
983c5c2c
PE
7422 * m4sugar/version.m4: Remove; it was included but it wasn't used.
7423 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
7424 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
7425 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
7426 * src/output.c (output_skeleton): Use full path names when
7427 specifying a file to include; don't rely on include path, as
7428 it's unreliable when the working file contains a file with
7429 that name.
d600ee67 7430
983c5c2c
PE
74312002-12-25 Paul Eggert <eggert@twinsun.com>
7432
7433 Remove obsolete references to bison.simple and bison.hairy.
7434 Problem mentioned by Aubin Mahe in
161a71f3 7435 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
7436 * data/glr.c: Comment fix.
7437 * doc/bison.1: Remove references. Also, mention "yacc".
7438
7439 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
7440 with -g option.
7441
7442 * src/parse-gram.y (declaration): Use enum "report_states" rather
7443 than its numeric value 1.
7444
7445 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
7446 opening a new one. This fixes Debian bug 165349, reported by
7447 Bruce Stephens.
7448
23f2d9dc
PE
74492002-12-24 Paul Eggert <eggert@twinsun.com>
7450
7451 Version 1.75e.
7452
7453 * Makefile.maint (cvs-update): Don't assume that the shell
7454 supports $(...), as Solaris sh doesn't.
7455
7456 * src/parse-gram.y (lloc_default): Remove test for empty
7457 nonterminals at the end, since it didn't change the result.
7458
74592002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
7460
7461 If the user does not define YYSTYPE as a macro, Bison now declares it
7462 using typedef instead of defining it as a macro. POSIX requires this.
7463 For consistency, YYLTYPE is also declared instead of defined.
7464
7465 %union directives can now have a tag before the `{', e.g., the
7466 directive `%union foo {...}' now generates the C code
7467 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
7468 The default union tag is `YYSTYPE', for compatibility with Solaris 9
7469 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
7470 instead of `yyltype'.
7471
7472 `yystype' and `yyltype' are now obsolescent macros instead of being
7473 typedefs or tags; they are no longer documented and will be
7474 withdrawn in a future release.
7475
7476 * data/glr.c (b4_location_type): Remove.
7477 (YYSTYPE): Renamed from yystype.
7478 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
7479 (struct YYLTYPE): Renamed from struct yyltype.
7480 (YYLTYPE): Renamed from yyltype.
7481 (yyltype, yystype): New (and obsolescent) macros,
7482 for backward compatibility.
7483 * data/yacc.c: Likewise.
7484
7485 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
7486 does not specify a union tag. This is for compatibility with
7487 Solaris 9 yacc.
7488
7489 * src/parse-gram.y (add_param): 2nd arg is now char * not char
7490 const *, since it is now modified by stripping surrounding { }.
7491 (current_braced_code): Remove.
7492 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
7493 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
7494 trailing " {...}". Now of type <chars>.
7495 (grammar_declaration): Adjust to bundled tokens.
7496 (code_content): Remove; stripping is now done by add_param.
7497 (print_token_value): Print contents of bundled tokens.
7498 (token_name): New function.
7499
7500 * src/reader.h (braced_code, current_braced_code): Remove.
7501 (token_name): New decl.
7502
7503 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
7504 token_type, not braced_code code_kind. All uses changed.
7505 (SC_PRE_CODE): New state, for scanning after a keyword that
7506 has (or usually has) an immediately-following braced code.
7507 (token_type): New local var, to keep track of which token type
7508 to return when scanning braced code.
7509 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 7510 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
7511 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
7512 instead of returning a token type immediately.
7513 (<INITIAL>"{"): Set token type.
7514 (<SC_BRACED_CODE>"}"): Use it.
7515 (handle_action_dollar, handle_action_at): Now returns bool
7516 indicating success. Fail if ! current_rule; this prevents a core dump.
7517 (handle_symbol_code_dollar, handle_symbol_code_at):
7518 Remove; merge body into caller.
7519 (handle_dollar, handle_at): Complain in invalid contexts.
7520
7521 * NEWS, doc/bison.texinfo: Document the above.
7522 * NEWS: Fix years and program names in copyright notice.
7523
879ca4f8
PE
75242002-12-17 Paul Eggert <eggert@twinsun.com>
7525
7526 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
7527 Reporting, Table of Symbols): Omit mentions of %lex-param and
7528 %parse-param from the documentation for now.
7529
1c5fe69d
PE
75302002-12-15 Paul Eggert <eggert@twinsun.com>
7531
7532 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
7533 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
7534 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
7535 disagreed with the Bison documentation. Bug
7536 reported by Andrew Walrond.
d600ee67 7537
1c5fe69d
PE
7538 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
7539 as the caller now does that.
7540 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
7541 (YYEMPTY): Parenthesize right hand side, since others use it.
7542 (yyparse): Don't assume that our generated code is the only code
7543 that sets yychar.
7544
d1de5372
PE
75452002-12-13 Paul Eggert <eggert@twinsun.com>
7546
7547 Version 1.75d.
7548
7549 POSIX requires a "yacc" command.
7550 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
7551 (MOSTLYCLEANFILES): Add yacc.
7552 (yacc): New rule.
1c5fe69d 7553 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
7554 as an alias for bison y.
7555
7556 * po/LINGUAS: Add da.
d600ee67 7557
d1de5372
PE
7558 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
7559 problem with latest <getopt.h>.
7560 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
7561
7562 * doc/fdl.texi: Upgrade to 1.2.
7563 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
7564 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
7565 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
7566 gnulib.
7567 * config/install-sh: Sync with autotools.
7568
7569 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 7570 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
7571 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
7572 locations are requested.
7573 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
7574 locations are requested.
7575
d0f3fe23
PE
75762002-12-12 Paul Eggert <eggert@twinsun.com>
7577
7578 Remove unportable casts and storage allocation tricks.
7579 While we're at it, remove almost all casts, since they
7580 usually aren't needed and are a sign of trouble.
7581
7582 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
7583
7584 * src/derives.c (derives_compute): Do not subtract NTOKENS from
7585 the pointer DSET returned by malloc; this isn't portable.
7586 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
7587 Similarly for DERIVES.
7588 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
7589 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
7590 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
7591
7592 * src/derives.c (derives_compute): Do not bother invoking
7593 int_of_rule_number, since rule numbers are integers.
7594
7595 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
7596 rather than XMALLOC (char, N).
7597
7598 * src/files.c (filename_split): Rewrite to avoid cast.
7599
7600 * src/gram.h (symbol_number_as_item_number,
7601 item_number_as_symbol_number, rule_number_as_item_number,
7602 item_number_as_rule_number):
7603 Now inline functions rather than macros, to avoid casts.
7604 * src/state.h (state_number_as_int): Likewise.
7605 * src/tables.c (state_number_to_vector_number,
7606 symbol_number_to_vector_number): Likewise.
7607
7608 * src/gram.h (int_of_rule_number): Remove; no longer used.
7609
7610 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
7611 since the resulting storage is always stored into.
7612
7613 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
7614 where it's needed.
7615
7616 * src/muscle_tab.c (muscle_m4_output):
7617 Now inline. Return bool, not int.
7618 * src/state.c (state_compare): Likewise.
7619 * src/symtab.c (symbol_check_defined,
7620 symbol_check_alias_consistency, symbol_pack, symbol_translation,
7621 hash_compare_symbol, hash_symbol):
7622 Likewise.
7623 * src/uniqstr.c (uniqstr_print): Likewise.
7624 * src/muscle_tab.c (muscle_m4_output_processor):
7625 New function, to avoid casts.
7626 * src/state.c (state_comparator, stage_hasher): Likewise.
7627 * src/symtab.c (symbol_check_defined_processor,
7628 symbol_check_alias_consistency_processor, symbol_pack_processor,
7629 symbol_translation_processor, hash_symbol_comparator,
7630 hash_symbol_hasher): Likewise.
7631 * src/uniqstr.c (uniqstr_print_processor): Likewise.
7632 * src/muscle_tab.c (muscles_m4_output):
7633 Use new functions instead of casting old functions unportably.
7634 * src/state.c (state_hash_new): Likewise.
7635 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
7636 symbols_token_translations_init):
7637 Likewise.
7638 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
7639
7640 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
7641 var instead of casting to long, to avoid casts.
7642 (prepare_states): Use MALLOC rather than alloca, so that we don't
7643 have to worry about alloca.
7644 * src/state.c (state_hash_lookup): Likewise.
7645
7646 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
7647 local var instead of casting to unsigned char, to avoid casts.
7648
7649 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
7650 STATE_ALLOC): Remove.
7651 (transitions_new, errs_new, reductions_new, state_new): Use malloc
7652 rather than calloc, and use offsetof to avoid allocating slightly
7653 too much storage.
7654 (state_new): Initialize all members.
7655
7656 * src/state.c (state_hash): Use unsigned accumulator, not signed.
7657
7658 * src/symtab.c (symbol_free): Remove; unused.
7659 (symbol_get): Remove cast in lhs of assignment.
7660 (symbols_do): Now static. Accept generic arguments, not
7661 hashing-related ones.
7662
7663 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
7664 (symbol_processor): Remove.
7665 (symbols_do): Remove decl; now static.
7666
7667 * src/system.h (alloca): Remove; decl no longer needed.
7668 (<stddef.h>): Include, for offsetof.
7669 (<inttypes.>, <stdint.h>): Include if available.
7670 (uintptr_t): New type, if system lacks it.
7671 (CALLOC, MALLOC, REALLOC): New macros.
7672 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
7673 new macros.
7674
7675 * src/tables.c (table_size): Now int, to pacify GCC.
7676 (table_grow, table_ninf_remap): Use signed table size.
7677 (save_row): Don't bother initializing locals when not needed.
7678 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
7679 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
7680
7681 * src/vcg.h: Correct misspellings.
7682
7683 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
7684
7685
7686 * src/getargs.c (getargs): Don't assume EOF == -1.
7687
26b4a969
PE
76882002-12-09 Paul Eggert <eggert@twinsun.com>
7689
7690 Change identifier spellings to avoid collisions with names
7691 that are reserved by POSIX.
7692
7693 Don't use names ending in _t, since POSIX reserves them.
7694 For consistency, remove _e and _s endings -- they're weren't
7695 needed to remove ambiguity. All uses changed.
7696 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
7697 turn was just renamed from struniq_t.
7698 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
7699 which in turn was just renamed from struniq_processor_t.
7700 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
7701 in turn was renamed from hash_compare_struniq_t.
7702 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
7703 (state_list): Renamed from state_list_t.
7704 * src/assoc.h (assoc): Renamed from assoc_t.
7705 * src/conflicts.c (enum conflict_resolution): Renamed from
7706 enum conflict_resolution_e.
7707 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
7708 (rule_list): Renamed from rule_list_t.
7709 * src/getargs.h (enum trace): Renamed from enum trace_e.
7710 (enum report): Renamed from enum report_e.
7711 * src/gram.h (item_number): Renamed from item_number_t.
7712 (rule_number): Renamed from rule_number_t.
7713 (struct rule_s): Remove the "rule_s" part; not used.
7714 (rule): Renamed from rule_t.
7715 (rule_filter): Renamed from rule_filter_t.
7716 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
7717 (goto_list): Renamed from goto_list_t.
7718 * src/lalr.h (goto_number): Renamed from goto_number_t.
7719 * src/location.h (location): Renamed from location_t.
7720 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
7721 and moved here from:
7722 * src/muscle_tab.h (muscle_entry_t): here.
7723 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
7724 (rule_list): Renamed from rule_list_t.
7725 * src/print_graph.c (static_graph): Renamed from graph.
7726 * src/reader.h (braced_code): Renamed from braced_code_t.
7727 Remove brace_code_e tag.
7728 * src/relation.h (relation_node): Renamed from relation_node_t.
7729 (relation_nodes): Renamed from relation_nodes_t.
7730 (relation): Renamed from relation_t.
7731 * src/state.h (state_number): Renamed from state_number_t.
7732 (struct state): Renamed from struct state_s.
7733 (state): Renamed from state_t.
7734 (transitions): Renamed from transitions_t. Unused (and
7735 misspelled) transtion_s tag removed.
7736 (errs): Renamed from errs_t. Unused errs_s tag removed.
7737 (reductions): Renamed from reductions_t. Unused tag
7738 reductions_s removed.
7739 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
7740 (struct symbol_list): Renamed from struct symbol_list_s.
7741 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
7742 (struct symbol): Renamed from struct symbol_s.
7743 (symbol): Renamed from symbol_t.
7744 * src/tables.c (vector_number): Renamed from vector_number_t.
7745 (action_number): Renamed from action_t.
7746 * src/tables.h (base_number): Renamed from base_t.
7747 * src/vcg.h (enum color): Renamed from enum color_e.
7748 (enum textmode): Renamed from enum textmode_e.
7749 (enum shape): Renamed from enum shape_e.
7750 (struct colorentry): Renamed from struct colorentry_s.
7751 (struct classname): Renamed from struct classname_s.
7752 (struct infoname): Renamed from struct infoname_s.
7753 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
7754 (enum decision): Renamed from enum decision_e.
7755 (enum orientation): Renamed from enum orientation_e.
7756 (enum alignment): Renamed from enum alignment_e.
7757 (enum arrow_mode): Renamed from enum arrow_mode_e.
7758 (enum crossing_type): Renamed from enum crossing_type_e.
7759 (enum view): Renamed from enum view_e.
7760 (struct node): Renamed from struct node_s.
7761 (node): Renamed from node_t.
7762 (enum linestyle): Renamed from enum linestyle_e.
7763 (enum arrowstyle): Renamed from enum arrowstyle_e.
7764 (struct edge): Renamed from struct edge.
7765 (edge): Renamed from edge_t.
7766 (struct graph): Renamed from struct graph_s.
7767 (graph): Renamed from graph_t.
7768 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
7769 Rename value_t -> value.
7770 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
7771 value_t_as_yystype -> value_as_yystype.
7772
7773 Don't include <errno.h> in the mainstream code, since it
7774 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
7775 * lib/get-errno.c, lib/get-errno.h: New files.
7776 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
7777 get-errno.c.
7778 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
7779 * src/output.c (output_skeleton): Likewise.
7780 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
7781 instead of errno.
7782 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
7783 Likewise.
7784 (handle_action_dollar, handle_action_at): Likewise.
7785 * src/system.h: Do not include <errno.h>.
7786 (TAB_EXT): Renamed from EXT_TAB.
7787 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
7788
7789 Avoid str[a-z]*, since <string.h> reserves that name space.
7790 Change all instances of "struniq" in names to "uniqstr", and
7791 likewise for "STRUNIQ" and "UNIQSTR".
7792 * src/uniqstr.c: Renamed from src/struniq.c.
7793 * src/uniqstr.h: Renamed from src/struniq.h.
7794 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
7795 * src/files.c (strsuffix): Remove; unused.
7796 (concat2): Renamed from stringappend. Now static.
7797 * src/files.h (strsuffix, stringappend): Remove; unused.
7798 * src/parse-gram.y (<chars>): Renamed from <string>.
7799 (<uniqstr>): Renamed from <struniq>.
7800 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
7801 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
7802 (struct graph_s.expand): Renamed from struct graph_s.stretch.
7803 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
7804 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
7805 (N_EXPAND): Renamed from N_STRETCH.
7806
7807 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
7808 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
7809 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
7810 Remove; unused.
7811 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
7812 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
7813 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
7814 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
7815 (BASE_MAXIMUM): Renamed from BASE_MAX.
7816 (BASE_MINIMUM): Renamed from BASE_MIN.
7817 (ACTION_MAX): Remove; unused.
7818 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
7819 Unnecessary casts removed from above defines.
7820
7821
7822 Fix misspelling in names.
7823 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
7824 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
7825 G_NODE_ALIGNEMENT.
7826
7827
7828 * lib/timevar.c (timevar_report): Renamed from time_report,
7829 for consistency with other names.
7830 * lib/timevar.h (timevar_report): New decl.
7831 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
7832
7833
7834 Sort include-file uses.
7835
7836 Reorder all include files under src to be in the order "system.h".
7837 then the ../lib include files in angle brackets (alphabetized),
7838 then the . include files in double-quotes (alphabetized). Fix
7839 dependency breakages encountered in this process, as follows:
7840 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
7841 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
7842 * src/state.h: Include "symtab.h".
7843
996b1c7e
PE
78442002-12-08 Paul Eggert <eggert@twinsun.com>
7845
7846 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
7847 since this causes problems when __file__ contains character
7848 sequences like "@" that are treated specially by src/scan-skel.l.
7849 Instead, just use the file's basename. This fixes the bug
7850 reported by Martin Mokrejs in
161a71f3 7851 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 7852
e19c4e5d
PE
78532002-12-06 Paul Eggert <eggert@twinsun.com>
7854
7855 Add support for rules that do not have trailing semicolons, as
7856 POSIX requires. Improve the quality of locations in Bison
7857 diagnostics.
26b4a969 7858
e19c4e5d
PE
7859 * src/location.c: Include <quotearg.h>.
7860 (empty_location): Now const.
7861 (location_print): New function. Follow the recommendation of the
7862 GNU Coding Standards for locations that span file boundaries.
7863 * src/location.h: Do not include <quotearg.h>; no longer needed.
7864 (boundary): New type.
7865 (location_t): Use it. This allows locations to span file boundaries.
7866 All member uses changed: file -> start.file or end.file (as needed),
7867 first_line -> start.line, first_column -> start.column,
7868 last_line -> end.line, last_column -> end.column.
7869 (equal_boundaries): New function.
7870 (LOCATION_RESET, LOCATION_STEP): Remove.
7871 (LOCATION_PRINT): Remove. All callers changed to use location_print.
7872 (empty_location): Now const.
7873 (location_print): New decl.
7874 * src/parse-gram.y (lloc_default): New function, which handles
7875 empty locations more accurately.
7876 (YYLLOC_DEFAULT): Use it.
7877 (%token COLON): Remove.
7878 (%token ID_COLON): New token.
26b4a969 7879 (rules): Use it.
e19c4e5d
PE
7880 (declarations, rules): Remove trailing semicolon.
7881 (declaration, rules_or_grammar_declaration):
7882 Allow empty (";") declaration.
7883 (symbol_def): Remove empty actions; no longer needed.
7884 (rules_or_grammar_declaration): Remove trailing semicolon.
7885 (semi_colon.opt): Remove.
7886 * src/reader.h: Include location.h.
7887 (scanner_cursor): New decl.
7888 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
7889 rolling our own.
7890 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
7891 of *loc.
7892 (STEP): Remove. No longer needed, now that adjust_location does
7893 the work. All uses removed.
7894 (scanner_cursor): New var.
7895 (adjust_location): Renamed from extend_location. It now sets
7896 *loc and adjusts the scanner cursor. All uses changed.
7897 Don't bother testing for CR.
7898 (handle_syncline): Remove location arg; now updates scanner cursor.
7899 All callers changed.
7900 (unexpected_end_of_file): Now accepts start boundary of token or
7901 comment, not location. All callers changed. Update scanner cursor,
7902 not the location.
7903 (SC_AFTER_IDENTIFIER): New state.
7904 (context_state): Renamed from c_context. All uses changed.
7905 (id_loc, code_start, token_start): New local vars.
7906 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
7907 processing of Yacc white space and equivalents here.
7908 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
7909 instead of returning ID immediately, since we need to search for
7910 a subsequent colon.
7911 (<INITIAL>"'", "\""): Save token_start.
7912 (<INITIAL>"%{", "{", "%%"): Save code_start.
7913 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
7914 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
7915 BEGIN context_state at end, not INITIAL.
7916 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
7917 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
7918 Return correct token start.
7919 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
7920 the start of a character, string or multiline comment is found.
7921 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
7922 Reduction): Adjust reported locations to match the more-precise
7923 results now expected.
7924 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
7925 * tests/reduce.at (Useless Rules, Reduced Automaton,
7926 Underivable Rules): Likewise.
7927 * tests/regression.at (Invalid inputs): No longer `expecting ";"
7928 or "|"' now that so many other tokens are allowed by the new grammar.
7929
7930 * src/complain.h (current_file): Remove duplicate decl;
7931 current_file is now owned by files.h.
7932 * src/complain.c, src/scan-gram.l: Include files.h.
7933
79342002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 7935
e19c4e5d
PE
7936 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
7937 promotes to int; it might be unsigned int.
7938 * data/yacc.c (yy_reduce_print): Likewise.
7939
7940 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
7941 be #defined in the prologue, not in the Bison declarations.
7942 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 7943
b64755e3
PE
79442002-12-02 Paul Eggert <eggert@twinsun.com>
7945
7946 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
7947 * lib/strtoul.c: New file, from gnulib.
7948 This fixes a porting bug reported by Peter Klein in
161a71f3 7949 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 7950
6e746484
PE
79512002-11-30 Paul Eggert <eggert@twinsun.com>
7952
b64755e3
PE
7953 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
7954 and put only a forward declaration in the prologue. This is for
7955 consistency with the other scanner helper functions.
7956
6ba55592
PE
7957 Type clashes now generate warnings, not errors, since it
7958 appears that POSIX may allow some grammars with type clashes.
7959 * src/reader.c (grammar_current_rule_check): Warn about
7960 type clashes instead of complaining.
7961 * tests/input.at (Type Clashes): Expect warnings, not complaints.
7962
6e746484
PE
7963 Add Yacc library, since POSIX requires it.
7964 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
7965 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
7966 * lib/main.c, lib/yyerror.c: New files.
7967
7968 gram_error can be static; it need not be extern.
7969 * src/reader.h (gram_error): Remove decl.
7970 * src/parse-gram.y (gram_error): Now static. Add static decl.
7971 (print_token_value): Omit parameter names from forward decl,
7972 for consistency.
7973
88510f9c
PE
79742002-11-29 Paul Eggert <eggert@twinsun.com>
7975
6e746484
PE
7976 * doc/bison.texinfo: Emphasize that yylex and yyerror must
7977 be declared before being used. E.g., one should typically
7978 declare them in the prologue. Use GNU coding style in examples.
7979 Put "const" consistently after the type it modifies. Mention
7980 that C99 supports "inline". Mention that yyerror traditionally
7981 returns "int".
7982
88510f9c
PE
7983 %parse-param and %lex-param now take just one argument, the
7984 declaration; the argument name is deduced from the declaration.
7985
7986 * doc/bison.texinfo (Parser Function, Pure Calling, Error
7987 Reporting, Table of Symbols): Document this.
7988 * src/parse-gram.y (add_param): New function.
7989 (COMMA): Remove.
7990 (declaration): Implement new rule for %parse-param and %lex-param.
7991 * src/scan-gram.l: "," now elicits a warning, rather than being
7992 a token; this is more compatible with byacc.
7993 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
7994
bb92250c
PE
79952002-11-27 Paul Eggert <eggert@twinsun.com>
7996
7997 Rename identifiers to avoid real and potential collisions.
7998
7999 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
8000 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 8001 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
8002 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
8003 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
8004 * src/parse-gram.y (print_token_value): Renamed from yyprint.
8005 All uses changed.
8006 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
8007 The name "yycontrol" violates the name space rules, and this stuff
8008 wasn't being used anyway.
8009 (input): Remove action; this stuff wasn't being used.
8010 (gram_error): Rename local variable yylloc -> loc.
8011 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
8012 (YY_DECL): Don't use "yy" at start of local variables.
8013 All uses changed, e.g., yylloc -> loc.
8014 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
8015 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
8016 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
8017 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
8018
8019 * src/parse-gram.y (gram_error): loc is now const *.
8020 * src/reader.h (gram_error): Likewise.
8021
3af4feb2
PE
80222002-11-24 Paul Eggert <eggert@twinsun.com>
8023
8024 Version 1.75c.
8025
8026 * tests/actions.at (Actions after errors): Use an output format
8027 more similar to that of the Printers and Destructors test.
8028 Test the position of the ';' token too.
8029 (Printers and Destructors): Likewise.
8030 (Printers and Destructors: %glr-parser): Remove for now, to avoid
8031 unnecessarily alarming people when the test fails.
8032
8033 * data/yacc.c (yyerrlab1): Move this label down, so that the
8034 parser does not discard the lookahead token if the user code
8035 invokes YYERROR. This change is required for POSIX conformance.
8036
8037 * lib/error.c: Sync with gnulib.
8038
80392002-11-22 Paul Eggert <eggert@twinsun.com>
8040
8041 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
8042 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
8043 * lib/xmalloc.c: Likewise.
26b4a969 8044
58004308
PE
80452002-11-20 Paul Eggert <eggert@twinsun.com>
8046
8047 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
8048
80492002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 8050
58004308
PE
8051 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
8052 should use `if (! x) abort ();' rather than `assert (x);', and
8053 anyway it's one less thing to worry about configuring.
8054
8055 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
8056 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
8057 and replace all instances of assert with abort.
8058 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
8059 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
8060
8061 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
8062 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
8063 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
8064 hash_find_entry, hash_rehash, hash_insert): Likewise.
8065 * src/conflicts.c (resolve_sr_conflict): Likewise.
8066 * src/lalr.c (set_goto_map, map_goto): Likewise.
8067 * src/nullable.c (nullable_compute): Likewise.
8068 * src/output.c (prepare_rules, token_definitions_output): Likewise.
8069 * src/reader.c (packgram, reader): Likewise.
8070 * src/state.c (state_new, state_free, state_transitions_set,
8071 state_reduction_find): Likewise.
8072 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
8073 symbol_pack): Likewise.
8074 * src/tables.c (conflict_row, pack_vector): Likewise.
8075 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
8076 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
8077 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
8078 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
8079
8080 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
8081 (ARGMATCH_CONSTRAINT): New macro.
8082 (ARGMATCH_ASSERT): Use it.
8083
8084 * src/system.h (verify): New macro.
8085 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
8086 rather than assert.
8087 * src/tables.c (tables_generate): Likewise.
8088
8089 * src/struniq.c (struniq_assert): Now returns void, and aborts
8090 if the assertion is false.
8091 (struniq_assert_p): Remove.
8092 * src/struniq.h: Likewise.
8093
76ae8198
PE
80942002-11-18 Paul Eggert <eggert@twinsun.com>
8095
8096 * data/glr.c (yygetLRActions): Replace `yyindex' with
8097 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
8098 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 8099 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 8100
d3c4e709
AD
81012002-11-18 Akim Demaille <akim@epita.fr>
8102
8103 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
8104 space.
8105 From Tim Van Holder.
8106
8d8a7238
PE
81072002-11-17 Paul Eggert <eggert@twinsun.com>
8108
8109 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
8110 to "SyntaxError" for consistency with my 2002-11-15 change.
8111
8112 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
8113 not define to {}, since this breaks the common use of `YYDPRINTF
8114 ((...));' if a single statement is desired (e.g. before `else').
8115 Work around GCC warnings by surrounding corresponding calls with
8116 {} if needed.
8117 (yyhasResolvedValue): Remove unused function.
8118 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
8119 loop body.
8120 (yyreportSyntaxError): Renamed from yyreportParseError.
8121 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
8122 All uses changed.
8123 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
8124 extern when possible. Remove unused initializations.
8125
b0937b22
AD
81262002-11-16 Akim Demaille <akim@epita.fr>
8127
8128 Augment the similarity between GLR and LALR traces.
8129
8130 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
8131 (YY_REDUCE_PRINT): New.
8132 (yyparse): Use them.
8133 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
8134 YYDPRINT here.
8135 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
8136 state reached after the reduction/recovery, since...
8137 (yyparse, yyprocessOneStack): Report the state we are entering in.
8138
c5e3e510
AD
81392002-11-16 Akim Demaille <akim@epita.fr>
8140
8141 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
8142 Add support for --trace=skeleton.
8143 * src/scan-skel.l: %option debug.
8144 Scan strings of non-@ or \n instead of character by character.
8145 (scan_skel): Handle trace_skeleton.
8146 (QPUTS): New.
8147 (@output_parser_name@, @output_header_name@): ``Restore'' their
8148 support (used to be M4 macros).
8149 * data/yacc.c: Quote larger chunks, a la glr.c.
8150 * data/lalr1.cc: Likewise.
8151 The header guards are no longer available, so use some other
8152 string than `YYLSP_NEEDED'.
8153
4c6cc1db
AD
81542002-11-16 Akim Demaille <akim@epita.fr>
8155
8156 Make the ``Printers and Destructors'' test more verbose, taking
8157 `yacc.c''s behavior as (possibly wrong) reference.
8158
8159 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
8160 instead of fprint on stdout.
8161 Set and report the last_line of the symbols.
8162 Consistently display values and locations.
8163
6d9e8019
PE
81642002-11-16 Paul Eggert <eggert@twinsun.com>
8165
8166 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
8167
6e649e65
PE
81682002-11-15 Paul Eggert <eggert@twinsun.com>
8169
b25d88f6
PE
8170 * tests/actions.at (Actions after errors): New test case.
8171
6e649e65
PE
8172 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
8173 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
8174 tests/action.at, tests/calc.at, tests/conflicts.at,
8175 tests/cxx-type.at, tests/regression.at:
8176 "parse error" -> "syntax error" for POSIX compatibility.
8177 "parsing stack overflow..." -> "parser stack overflow" so
8178 that code matches Bison documentation.
8179
0f39aab9
AD
81802002-11-15 Akim Demaille <akim@epita.fr>
8181
8182 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
8183 take two BRACED_CODE, not two string_content.
8184 Free the scanner's obstack when we are done.
8185 (code_content): New.
8186 * tests/calc.at: Adjust.
8187 * doc/bison.texinfo: Adjust.
8188 Also, make sure to include the `,' for these declarations.
8189
761c1926
AD
81902002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
8191
8192 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
8193 definition; avoids potential autoreconf problems.
8194
b0f98b10
AD
81952002-11-15 Akim Demaille <akim@epita.fr>
8196
8197 Always check the value returned by yyparse.
8198
8199 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
8200 returned by yyparse.
8201 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
8202 Adjust calls.
8203 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
8204 returned by yyparse.
8205
970785f1
PH
82062002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8207
8208 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
8209 on input.at test.
8210
8fcc7db1
PE
82112002-11-14 Paul Eggert <eggert@twinsun.com>
8212
7ec1b48e
PE
8213 * src/output.c (output_skeleton): Call xfopen instead of
8214 duplicating xfopen's body.
8215
cfff7583 8216 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 8217 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 8218
8fcc7db1
PE
8219 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
8220 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
8221 Group compiler. Instead, use "$CC -E bar.c". Include the .h
8222 file twice in the grammar, as an extra check.
8223
8224 * tests/input.at (Torturing the Scanner): Surround the
8225 backslash-newline tests with "#if 0", to make it less likely that
8226 we'll run into compiler bugs. Bring back solitary \ inside
8227 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 8228 test backslash-newline in C character constant.
8fcc7db1 8229
4e8d992c
AD
82302002-11-14 Akim Demaille <akim@epita.fr>
8231
8232 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
8233 status of the compiler.
f32b346d 8234 Calling `exit 1' is no longer needed.
4e8d992c
AD
8235 Reported by Nelson H. F. Beebe.
8236
9501dc6e
AD
82372002-11-14 Akim Demaille <akim@epita.fr>
8238
8239 * tests/atlocal.in (CPPFLAGS): We have config.h.
8240 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
8241 New.
8242 * tests/actions.at, tests/calc.at, tests/conflicts.at,
8243 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
8244 * tests/regression.at, tests/torture.at: Use them for all the
8245 grammars that are to be compiled.
8246 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
8247 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
8248 * doc/bison.texinfo (GLR Parsers): Document `inline'.
8249
18b519c0
AD
82502002-11-14 Akim Demaille <akim@epita.fr>
8251
8252 * doc/bison.texinfo: Various formatting changes (alignments in
8253 samples, additional @group/@end group, GCS in samples.
8254 Use @deffn instead of simple @table to define the directives,
8255 macros, variables etc.
8256
9a86cdb9
PE
82572002-11-13 Paul Eggert <eggert@twinsun.com>
8258
daa33def 8259 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 8260 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 8261
daa33def 8262 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 8263 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
8264 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
8265 * tests/headers.at (export YYLTYPE): Likewise.
8266
8267 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 8268 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 8269
9a86cdb9
PE
8270 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
8271 comments, since they're not portable. Use GNU coding style.
8272
9c1e26bd
AD
82732002-11-13 Akim Demaille <akim@epita.fr>
8274
8275 * data/yacc.c: Leave bigger chunks of quoted text.
8276 (YYDSYMPRINTF): New.
8277 Use it to report symbol activities.
8278 * data/glr.c (YYDSYMPRINTF): New.
8279 Use it.
8280
87f721cc
PE
82812002-11-12 Paul Eggert <eggert@twinsun.com>
8282
8283 Version 1.75b.
8284
8285 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
8286 (yyglrReduce): Return yyok, not 0.
8287 This should avoid the enumerated-type warnings reported
464c6927 8288 by Nelson H. F. Beebe in
161a71f3 8289 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
8290
8291 * lib/bbitset.h (BITSET_INLINE): Remove.
8292 * lib/bitset.h [! BITSET_INLINE]: Remove.
8293 (bitset_set, bitset_reset, bitset_test): Rename local vars
8294 to avoid shadowing warnings by GCC.
8295
8296 * data/glr.c (inline): Remove #define. It's the user's
8297 responsibility to #define it away, just like 'const'.
464c6927 8298 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 8299 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 8300
87f721cc
PE
8301 * Makefile.maint (po-check): Scan .l and .y files instead of the
8302 .c and the .h files that they generate. This fixes the bug
8303 reported by Tim Van Holder in:
161a71f3 8304 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
8305 Look for N_ as well as for _. Try to avoid matching #define for
8306 N_ and _.
8307 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
8308 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
8309 * src/scan-gram.l: Revamp regular expressions so that " and '
8310 do not confuse xgettext.
8311
8312 * src/struniq.h (struniq_new): Do not declare the return type
8313 to be 'const'; this violates the C standard.
8314 * src/struniq.c (struniq_new): Likewise.
8315
be14ade5
AD
83162002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
8317
8318 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
8319 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
8320 linker.
8321
05291fbc
AD
83222002-11-12 Akim Demaille <akim@epita.fr>
8323
8324 * Makefile.maint: Sync with Autoconf:
8325 (local_updates): New.
8326
1f5fd52e
AD
83272002-11-12 Akim Demaille <akim@epita.fr>
8328
8329 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
8330
283f1e64
AD
83312002-11-12 Akim Demaille <akim@epita.fr>
8332
8333 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
8334 locations.
8335
886b69d1
AD
83362002-11-12 Akim Demaille <akim@epita.fr>
8337
8338 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
8339 not yyvalue.
8340
3df37415
AD
83412002-11-12 Akim Demaille <akim@epita.fr>
8342
8343 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
8344 Use it to test the GLR parser.
8345
7bd6c77e
AD
83462002-11-12 Akim Demaille <akim@epita.fr>
8347
8348 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
8349 defines it.
8350 * data/glr.c (yystos): New.
8351 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
8352 (YYDSYMPRINT): New.
8353 (yyval): Don't define it, it is handled via M4.
8354 (yyrecoverParseError): Free verbosely the discarded symbols.
8355 * data/yacc.c (yysymprint): Remove, rather...
8356 (b4_yysymprint_generate): invoke.
8357 * data/c.m4 (b4_yysymprint_generate): New.
8358 Accept pointers as arguments, as opposed to the version from
8359 yacc.c.
8360 (b4_yydestruct_generate): Likewise.
8361 * tests/cations.at (Printers and Destructors): Use Bison directives
8362 instead of CPP macros.
8363 Don't rely on internal details.
8364
b0400cc6
AD
83652002-11-12 Akim Demaille <akim@epita.fr>
8366
8367 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
8368 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
8369 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
8370 it against YYEMPTY and so forth), work on yytoken (i.e., set
8371 it to YYEMPTY etc.).
8372 (yydestruct): Replace with a b4_yydestruct_generate invocation.
8373 (b4_symbol_actions): Remove.
8374 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
8375 for 0, end-of-input.
8376
72f889cc
AD
83772002-11-12 Akim Demaille <akim@epita.fr>
8378
8379 * doc/bison.texinfo (Destructor Decl): New.
8380
b1ae9233
AD
83812002-11-12 Akim Demaille <akim@epita.fr>
8382
8383 * src/tables.c (tables_generate): Use free for pointers that
8384 cannot be NULL, not XFREE.
8385 (pack_vector): Use assert, not fatal, for bound violations.
8386 * src/state.c (state_new): Likewise.
8387 * src/reader.c (reader): Likewise.
8388 * src/lalr.c (set_goto_map): Likewise.
72f889cc 8389 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
8390 the file name.
8391
7ec2d4cd
AD
83922002-11-12 Akim Demaille <akim@epita.fr>
8393
8394 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
8395 Restore.
8396 * src/scan-gram.l (last_string): Is global to the file, not to
8397 yylex.
8398 * src/parse-gram.y (input): Don't append the epilogue here,
8399 (epilogue.opt): do it here, and free the scanner's obstack.
8400 * src/reader.c (epilogue_set): Rename as...
8401 (epilogue_augment): this.
8402 * data/c.m4 (b4_epilogue): Defaults to empty.
8403
573a6cd3
AD
84042002-11-12 Akim Demaille <akim@epita.fr>
8405
8406 * src/getargs.c (long_options): Remove duplicates.
8407 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
8408 Remove.
8409 * doc/bison.rnh: Remove.
8410 * doc/bison.texinfo (VMS Invocation): Remove.
8411
95612cfa
AD
84122002-11-12 Akim Demaille <akim@epita.fr>
8413
8414 * src/struniq.h, src/struniq.c (struniq_t): Is const.
8415 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
8416
8417 Use struniq for symbols.
8418
8419 * src/symtab.h (symbol_t): The tag member is a struniq.
8420 (symbol_type_set): Adjust.
8421 * src/symtab.c (symbol_new): Takes a struniq.
8422 (symbol_free): Don't free the tag member.
8423 (hash_compare_symbol_t, hash_symbol_t): Rename as...
8424 (hash_compare_symbol, hash_symbol): these.
8425 Use the fact that tags as struniqs.
8426 (symbol_get): Use struniq_new.
8427 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
8428 Returns a strniq.
8429 * src/reader.h (merger_list, grammar_currentmerge_set): The name
8430 and type members are struniqs.
8431 * src/reader.c (get_merge_function)
8432 (grammar_current_rule_merge_set): Adjust.
8433 (TYPE, current_type): Are struniq.
8434
8435 Use struniq for file names.
8436
8437 * src/files.h, src/files.c (infile): Split into...
8438 (grammar_file, current_file): these.
8439 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
8440 * src/reduce.c (reduce_print): Likewise.
8441 * src/getargs.c (getargs): Likewise.
8442 * src/complain.h, src/complain.c: Likewise.
8443 * src/main.c (main): Call struniqs_new early enough to use it for
8444 file names.
8445 Don't free the input file name.
8446
3e6656f9
AD
84472002-11-12 Akim Demaille <akim@epita.fr>
8448
8449 * src/symtab.c (symbol_free): Remove dead deactivated code:
8450 type_name are properly removed.
8451 Don't use XFREE to free items that cannot be NULL.
8452 * src/struniq.h, src/struniq.c: New.
8453 * src/main.c (main): Initialize/free struniqs.
8454 * src/parse-gram.y (%union): Add astruniq member.
8455 (yyprint): Adjust.
8456 * src/scan-gram.l (<{tag}>): Return a struniq.
8457 Free the obstack bit that used to store it.
8458 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
8459
7672019c
PE
84602002-11-11 Paul Eggert <eggert@twinsun.com>
8461
8462 Revamp to fix many (but not all) of the C- and M4-related quoting
8463 problems. Among other things, this fixes the Bison bug reported
8464 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 8465 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
8466
8467 Use new @ escapes consistently. Represent brackets with @{ and @}
8468 rather than @<:@ and @:>@, since this works a bit better with dumb
8469 editors like vi. Represent @ with @@, since @ is now consistently
8470 an escape. Use @oline@ and @ofile@ rather than __oline__ and
8471 __ofile__, to avoid unexpected expansions. Similarly, use @output
8472 rather than #output.
8473
8474 * data/c.m4 (b4_copyright): Omit file name from comment, since
8475 the file name could contain "*/".
8476 (b4_synclines_flag): Don't quote the 2nd argument; it should already
8477 be quoted. All uses changed.
8478
8479 * data/glr.c: Use new @ escapes consistently.
8480 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
8481 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
8482 Remove, since they couldn't handle arbitrary characters in file
8483 names.
8484 * data/lalr1.cc: Likewise.
8485 * data/yacc.c: Likewise.
8486
8487 * src/files.c (output_infix): Remove; all uses removed.
8488 * src/files.h: Likewise.
8489
8490 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
8491 mishandled funny characters in file names, and anyway it isn't
8492 needed any more.
8493 * data/yacc.c: Likewise.
8494 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
8495
8496 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
8497 * data/yacc.c: Likewise.
8498
8499 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
8500 strings now.
8501 (muscle_init): Quote filename as a C string.
8502 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
8503 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
8504 * src/output.c (escaped_file_name_output): New function.
8505 (prepare_symbols): Quote tokens for M4.
8506 (prepare): Don't insert output_infix, output_prefix,
8507 output_parser_name, output_header_name; this is now down by scan-skel.
8508 Insert skeleton as a C string.
8509
8510 * src/output.c (user_actions_output, symbol_destructors_output,
8511 symbol_printers_output): Quote filenames for C and M4.
8512 * src/reader.c (prologue_augment, epilogue_set): Likewise.
8513
8514 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
8515 escapes other than \\ and \'; this simplifies the code.
8516 (<SC_STRING>): Likewise, for \\ and \".
8517 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
8518 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
8519 Use new escapes @{ and @} for [ and ].
8520
8521 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
8522 them with auto vars.
8523 Switch to new escape scheme, where @ is the escape character uniformly.
8524 Abort if a stray escape character is found. Avoid unbounded input
8525 buffer when parsing non-escaped text.
8526
8527 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
8528 __oline__, #output, $@, and @{ do not have unintended meanings.
8529
acea4f3b
PE
85302002-11-09 Paul Eggert <eggert@twinsun.com>
8531
8532 Fix the test failure due to GCC warnings described in
161a71f3 8533 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
8534 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
8535 evaluate to 0 if it's impossible for NINF to be in the respective
8536 table.
8537 (yygetLRActions, yyrecoverParseError): Use them.
8538
8539 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
8540 counted in the token inserted at end of file. Now takes
8541 location_t *, not location_t, so that the location can be
8542 adjusted. All uses changed.
8543
8544 * tests/regression.at (Invalid inputs): Adjust wording in
8545 diagnostic to match the new behavior.
8546
8547 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
8548 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
8549 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
8550 abort ();'. This reduces the runtime of the "Many lookaheads"
8551 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
8552 GCC 3.2.
8553
20ef1ad5
PE
85542002-11-07 Paul Eggert <eggert@twinsun.com>
8555
8556 * src/parse-gram.y (CHARACTER): Remove unused token.
8557 All uses removed.
8558
8559 * src/scan-gram.l: Remove stack option. We no longer use the
8560 stack, since the stack was never deeper than 1; instead, use the
8561 new auto var c_context to record the stacked value.
8562
8563 Remove nounput option. At an unexpected end of file, we now unput
8564 the minimal input necessary to end cleanly; this simplifies the
8565 code.
8566
8567 Avoid unbounded token sizes where this is easy.
8568
8569 (unexpected_end_of_file): New function.
8570 Use it to systematize the error message on unexpected EOF.
8571 (last-string): Now auto, not static.
8572 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
8573 (scanner_last_string_free): Remove; not used.
8574 (percent_percent_count): Move decl to just before use.
8575 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
8576 not the (never otherwised-used) CHARACTER.
8577
93724f13
AD
85782002-11-07 Akim Demaille <akim@epita.fr>
8579
8580 Let yyerror always receive the msg as last argument, so that
8581 yyerror can be variadic.
8582
8583 * data/yacc.c (b4_yyerror_args): New.
8584 Use it when calling yyerror.
8585 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
8586 Use it when calling yyerror.
8587 * doc/bison.texinfo (Error Reporting): Adjust.
8588 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
8589 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
8590
6e40b4eb
AD
85912002-11-06 Akim Demaille <akim@epita.fr>
8592
8593 #line should have quoted strings.
8594 Ideally, this should be done by m4_quotearg.
8595
8596 * src/scan-skel.l: Include quotearg.h.
8597 Quote __ofile__.
8598 * src/output.c (symbol_printers_output)
8599 (symbol_destructors_output): Quote the file name.
8600
2dfbfc12
AD
86012002-11-06 Akim Demaille <akim@epita.fr>
8602
8603 * tests/regression.at (Invalid inputs): Adjust to the recent
8604 messages.
8605
437c2d80
AD
86062002-11-06 Akim Demaille <akim@epita.fr>
8607
8608 Restore --no-lines.
8609 Reported by Jim Kent.
8610
8611 * data/c.m4 (b4_syncline): New.
8612 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
8613 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
8614 * src/output.c (user_actions_output): Likewise.
8615 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 8616 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 8617
900c5db5
AD
86182002-11-06 Akim Demaille <akim@epita.fr>
8619
8620 * src/main.c (main): Free `infile'.
8621 * src/scan-gram.l (handle_syncline): New.
8622 Recognize `#line'.
8623 * src/output.c (user_actions_output, symbol_destructors_output)
8624 (symbol_printers_output): Use the location's file name, not
8625 infile.
8626 * src/reader.c (prologue_augment, epilogue_set): Likewise.
8627
e183b123 86282002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 8629
e183b123 8630 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 8631 either has GLR conflict entries.
e183b123 8632
193eb6b7
PE
86332002-11-05 Paul Eggert <eggert@twinsun.com>
8634
e183b123
PE
8635 * src/scan-gram.l: Use more accurate diagnostics, e.g.
8636 "integer out of range" rather than "invalid value".
8637 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
8638 accordingly.
8639
193eb6b7
PE
8640 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
8641 Also, remove one static variable in the scanner.
8642
8643 * src/scan-gram.l (braces_level): Now auto, not static.
8644 Initialize to zero if the compiler is being picky.
8645 (INITIAL): Clear braces_level instead of incrementing it.
8646 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
8647 as POSIX 1003.1-2001 requires.
8648 * src/system.h (IF_LINT): New macro, taken from coreutils.
8649 * configure.ac: Define "lint" if --enable-gcc-warnings.
8650
29c01725
AD
86512002-11-05 Akim Demaille <akim@epita.fr>
8652
8653 * src/scan-gram.l: When it starts with `%', complain about the
8654 whole directive, not just that `invalid character: %'.
8655
8aeac3ca
AD
86562002-11-04 Akim Demaille <akim@epita.fr>
8657
8658 * Makefile.maint: Update from Autoconf.
8659 (update, cvs-update, po-update, do-po-update): New.
8660
793a58bb
AD
86612002-11-04 Akim Demaille <akim@epita.fr>
8662
8663 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
8664 and yyerror.
8665 Have yyerror `use' its arguments.
8666 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
8667 returns true when location & yacc & pure & parse-param.
8668 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
8669
c4d720cd
AD
86702002-11-04 Akim Demaille <akim@epita.fr>
8671
8672 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
8673 clashes.
8674 * src/scan-gram.l: Use [\'] instead of ['] to pacify
8675 font-lock-mode.
8676 Use complain_at.
8677 Use quote, not quote_n since LOCATION_PRINT no longer uses the
8678 slot 0.
8679
613a0dc5
PE
86802002-11-03 Paul Eggert <eggert@twinsun.com>
8681
8682 * src/reader.c (get_merge_function, grammar_current_rule_check):
8683 Use consistent diagnostics for reporting type name clashes.
8684 Quote the types with <>, for consistency with Yacc.
8685 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
8686
2a8d363a
AD
86872002-11-03 Akim Demaille <akim@epita.fr>
8688
8689 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
8690 New.
8691 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
8692 (b4_parse_param): Remove.
8693 Use b4_identification.
8694 Propagate b4_pure_args where needed to pass them to yyerror.
8695 * data/glr.m4 (b4_parse_param): Remove.
8696 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
8697 (b4_lpure_formals): New.
8698 Use b4_identification.
8699 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
8700 b4_user_formals and b4_user_args.
8701 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
8702 (yyreportAmbiguity): When using a pure parser, also need
8703 the location, and the parse-params.
8704 Adjust callers.
8705 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
8706 When using a pure parser, also need the parse-params.
8707 Adjust callers.
8708 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
8709 (%pure-parser + %parse-param) LALR and GLR parsers.
8710 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
8711 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
8712 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
8713 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
8714 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
8715 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
8716 * doc/bison.texinfo: Untabify the whole file.
8717 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
8718 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
8719 (Error Reporting): Adjust to these new directives.
8720 Document %error-verbose, deprecate YYERROR_VERBOSE.
8721
9e32add8
AD
87222002-11-03 Akim Demaille <akim@epita.fr>
8723
8724 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
8725 AT_CHECK_CALC_GLR invocations to use % directives, instead of
8726 command line options.
8727 * tests/cxx-type.at: Formatting changes.
8728
b02d90a5
PE
87292002-11-03 Paul Eggert <eggert@twinsun.com>
8730
8731 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
8732 to count columns correctly, and to check for invalid inputs.
9e32add8 8733
b02d90a5
PE
8734 Use mbsnwidth to count columns correctly. Account for tabs, too.
8735 Include mbswidth.h.
8736 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
8737 (extend_location): New function.
8738 (YY_LINES): Remove.
8739
8740 Handle CRLF in C code rather than in Lex code.
8741 (YY_INPUT): New macro.
8742 (no_cr_read): New function.
8743
8744 Scan UCNs, even though we don't fully handle them yet.
8745 (convert_ucn_to_byte): New function.
8746
8747 Handle backslash-newline correctly in C code.
8748 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
8749 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
8750 all uses changed.
8751 (tag, splice): New EREs. Do not allow NUL or newline in tags.
8752 Use {splice} wherever C allows backslash-newline.
8753 YY_STEP after space, newline, vertical-tab.
8754 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 8755
b02d90a5
PE
8756 (letter, id): Don't assume ASCII; e.g., spell out a-z.
8757
8758 ({int}, handle_action_dollar, handle_action_at): Check for integer
8759 overflow.
9e32add8 8760
b02d90a5
PE
8761 (YY_STEP): Omit trailing semicolon, so that it's more like C.
8762
8763 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
8764 as well as \000. Check for UCHAR_MAX, not 255.
8765 Allow \x with an arbitrary positive number of digits, as in C.
8766 Check for overflow here.
8767 Allow \? and UCNs, for compatibility with C.
8768
8769 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
8770 with quote slot used by complain_at.
8771
8772 * tests/input.at: Add tests for backslash-newline, m4 quotes
8773 in symbols, long literals, and funny escapes in strings.
8774
8775 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
8776 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
8777 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
8778 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
8779 * m4/mbswidth.m4: New file, from GNU coreutils.
8780
8781 * doc/bison.texinfo (Grammar Outline): Document // comments.
8782 (Symbols): Document that trigraphs have no special meaning in Bison,
8783 nor is backslash-newline allowed.
8784 (Actions): Document that trigraphs have no special meaning.
8785
8786 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
8787 no longer used.
8788
87892002-11-02 Paul Eggert <eggert@twinsun.com>
8790
8791 * src/reader.c: Don't include quote.h; not needed.
8792 (get_merge_function): Reword warning to be consistent with
8793 type clash diagnostic in grammar_current_rule_check.
8794
8795 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
8796 bug in trigraph handling.
8797
8798 * src/output.c (prepare_symbols): When printing token names,
8799 escape "[" as "@<:@" and likewise for "]".
8800
8801 * src/system.h (errno): Remove declaration, as we are now
8802 assuming C89 or better, and C89 guarantees errno.
8803
762b212b
PE
88042002-10-30 Paul Eggert <eggert@twinsun.com>
8805
8806 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
8807 Check for close failures.
8808 * src/files.h (xfclose): Return void, not int, since it always
8809 returned zero.
8810 * src/files.c (xfclose): Likewise. Report I/O error if ferror
8811 indicates one.
8812 * src/output.c (output_skeleton): Use xfclose rather than fclose
8813 and ferror. xfclose now checks ferror.
8814
8815 * data/glr.c (YYLEFTMOST_STATE): Remove.
8816 (yyreportTree): Use a stack-based leftmost state. This avoids
8817 our continuing battles with bogus warnings about initializers.
8818
56100c60
AD
88192002-10-30 Akim Demaille <akim@epita.fr>
8820
8821 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
8822 #if.
8823
51b4a04c
PH
88242002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8825
8826 * tests/glr-regr1.at: New test for reported regressions.
8827 * tests/testsuite.at: Add glr-regr1.at test.
8828 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 8829
bf1ebda2
PE
88302002-10-24 Paul Eggert <eggert@twinsun.com>
8831
5c16c6b1
PE
8832 Version 1.75a.
8833
bf1ebda2
PE
8834 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
8835 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
8836 we use malloc. Don't assume 'A' through 'Z' are contiguous.
8837 Don't assume strdup exists; POSIX says its an XSI extension.
8838 Check for buffer overflow on input.
8839
b526ee61
AD
88402002-10-24 Akim Demaille <akim@epita.fr>
8841
8842 * src/output.c (output_skeleton): Don't disable M4sugar comments
8843 too soon: it results in comments being expanded.
8844 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
8845 first output.
8846
f1886bb2
AD
88472002-10-24 Akim Demaille <akim@epita.fr>
8848
8849 * data/yacc.c (m4_int_type): New.
8850 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
8851 char' as only yacc.c wants K&R portability.
8852 * data/glr.c (yysigned_char): Remove.
8853 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
8854 Reported by Quoc Peyrot.
8855
c5576256
PE
88562002-10-23 Paul Eggert <eggert@twinsun.com>
8857
8858 * src/main.c (main): With --trace=time, report times even if a
8859 non-fatal error occurs. Formerly, the times were reported in some
8860 such cases but not in others.
8861 * src/reader.c (reader): Just return if a complaint has been issued,
8862 instead of exiting, so that 'main' can report times.
8863
27b0ffea
AD
88642002-10-22 Akim Demaille <akim@epita.fr>
8865
8866 * src/system.h: Include sys/types.
8867 Reported by Bert Deknuydt.
8868
223a7883
PE
88692002-10-23 Paul Eggert <eggert@twinsun.com>
8870
8871 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
8872 Suggested by Art Haas.
8873
88742002-10-22 Paul Eggert <eggert@twinsun.com>
8875
8876 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
8877 decl; not needed any more.
8878 * src/main.c (main): Use return to exit, undoing yesterday's change.
8879 The last OS that we could find where this wouldn't work is
8880 SunOS 3.5, and that's too old to worry about now.
8881
8882 * data/glr.c (struct yyltype): Define members even when not
8883 doing locations. This is more consistent with yacc.c, and it
8884 works around the following bug reports:
161a71f3
PE
8885 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
8886 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 8887
223a7883
PE
8888 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
8889 @acronym consistently. Standardize on "Yacc" instead of "YACC",
8890 "Algol" instead of "ALGOL". Give a bit more history about BNF.
8891
8b76775a
AD
88922002-10-22 Akim Demaille <akim@epita.fr>
8893
8894 * data/README: New.
8895
6db10d14
PE
88962002-10-21 Paul Eggert <eggert@twinsun.com>
8897
8898 Be consistent about 'bool'; the old code used an enum in one
8899 module and an int in another, and this violates the C standard.
8900 * m4/stdbool.m4: New file, from coreutils 4.5.3.
8901 * configure.ac (AC_HEADER_STDBOOL): Add.
8902 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
8903 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
8904 * src/symtab.c (hash_compare_symbol_t): Likewise.
8905 * src/system.h (bool, false, true): Use a definition consistent
8906 with ../lib/hash.c. All uses changed.
8907
8908 * src/complain.c (warning_issued): Renamed from warn_message_count,
8909 so that we needn't worry about integer overflow (!).
8910 Now of type bool. All uses changed.
8911 (complaint_issued): Renamed from complain_message_count; likewise.
8912
8913 * src/main.c (main): Use exit to exit with failure.
27b0ffea 8914
6db10d14
PE
8915 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
8916 rather than 1 and 0.
8917 * src/main.c (main): Likewise.
8918 * src/getargs.c (getargs): Likewise.
8919 * src/reader.c (reader): Likewise.
8920
8921 * src/getarg.c (getargs): Remove duplicate code for
8922 "Try `bison --help'".
8923
8924 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
8925 What was that "2" for?
8926
8927 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
8928 * src/getargs.c (usage): Likewise.
8929
8930 * src/getargs.c (getargs): When there are too few operands, report
8931 the last one. When there are too many, report the first extra
8932 one. This is how diffutils does it.
8933
92a060fd
PE
89342002-10-20 Paul Eggert <eggert@twinsun.com>
8935
8936 Remove K&R vestiges.
8937 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
8938 * src/complain.c (VA_START): Remove. Assume prototypes.
8939 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
8940 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
8941 fatal): Assume prototypes.
8942 * src/complain.h: Assume prototypes.
8943 * src/system.h (PARAMS): Remove.
8944 Include <limits.h> unconditionally, since it's guaranteeed even
8945 for a freestanding C89 compiler.
8946 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
8947 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 8948
e7cb57c0
AD
89492002-10-20 Akim Demaille <akim@epita.fr>
8950
8951 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
8952 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
8953 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
8954 (yyresolveStates, yyresolveAction, yyresolveStack)
8955 (yyprocessOneStack): Use them.
8956 (yy_reduce_print): New.
8957 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
8958
0245f82d
AD
89592002-10-20 Akim Demaille <akim@epita.fr>
8960
8961 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
8962 arguments and output `void'.
8963 (b4_c_function): Rename as...
8964 (b4_c_function_def): this.
8965 (b4_c_function_decl, b4_c_ansi_function_def)
8966 (b4_c_ansi_function_decl): New.
8967 Change the interpretation of the arguments: before `int, foo', now
8968 `int foo, foo'.
8969 * data/yacc.c (yyparse): Prototype and define thanks to these.
8970 Adjust b4_c_function_def uses.
8971 * data/glr.c (yyparse): Likewise, but ANSI only.
8972
39912f52
AD
89732002-10-20 Akim Demaille <akim@epita.fr>
8974
8975 * src/output.c (prepare): Move the definition of `tokens_number',
8976 `nterms_number', `undef_token_number', `user_token_number_max'
8977 to...
8978 (prepare_tokens): Here.
8979 (prepare_tokens): Rename as...
8980 (prepare_symbols): this.
8981 (prepare): Move the definition of `rules_number' to...
8982 (prepare_rules): here.
8983 (prepare): Move the definition of `last', `final_state_number',
8984 `states_number' to...
8985 (prepare_states): here.
8986 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
8987
20c1e2ad
AD
89882002-10-20 Akim Demaille <akim@epita.fr>
8989
8990 * src/tables.h, src/tables.c, src/output.c: Comment changes.
8991
21964f43
AD
89922002-10-20 Akim Demaille <akim@epita.fr>
8993
8994 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
8995 * data/c.m4: here.
8996
66d30cd4
AD
89972002-10-20 Akim Demaille <akim@epita.fr>
8998
8999 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
9000 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
9001 `pair'.
9002 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
9003 `name' to...
9004 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
9005 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
9006 These.
9007
95f2c9fe
PE
90082002-10-19 Paul Eggert <eggert@twinsun.com>
9009
9010 Do not create a temporary file, as that involves security and
9011 cleanup headaches. Instead, use a pair of pipes.
9012 Derived from a suggestion by Florian Krohm.
9013 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
9014 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
9015 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
9016 (BISON_PREREQ_SUBPIPE): Add.
9017 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
9018 Add subpipe.h, subpipe.c.
9019 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
9020 * po/POTFILES.in: Add lib/subpipe.c.
9021 * src/output.c: Include "subpipe.h".
9022 (m4_invoke): Remove decl.
9023 (scan_skel): New decl.
9024 (output_skeleton): Use pipe rather than temporary file for m4 input.
9025 Check that m4sugar.m4 is readable, to avoid deadlock.
9026 Check for pipe I/O error.
9027 * src/scan-skel.l (readpipe): Remove decl.
9028 (scan_skel): New function, to be used in place of m4_invoke.
9029 Read from stream rather than file.
66d30cd4 9030
95f2c9fe
PE
9031 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
9032 float, as this generates a warning on Solaris 8 + GCC 3.2 with
9033 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
9034 this generates a more-accurate value anyway.
9035
9036 * lib/timevar.c (timervar_accumulate): Rename locals to
9037 avoid confusion with similarly-named more-global.
9038 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
9039
9040 * src/output.c (prepare): Use xstrdup to convert char const *
9041 to char *, to avoid GCC warning.
9042
c19988b7
AD
90432002-10-19 Akim Demaille <akim@epita.fr>
9044
9045 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
9046 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
9047 Use them to have `calc.y' ready for %pure-parser.
9048 * data/yacc.c (YYLEX): Pass a yylex return type to
9049 b4_c_function_call.
9050
ae7453f2
AD
90512002-10-19 Akim Demaille <akim@epita.fr>
9052
9053 Prototype support of %lex-param and %parse-param.
9054
9055 * src/parse-gram.y: Add the definition of the %lex-param and
9056 %parse-param tokens, plus their rules.
9057 Drop the `_' version of %glr-parser.
9058 Add the "," token.
9059 * src/scan-gram.l (INITIAL): Scan them.
9060 * src/muscle_tab.c: Comment changes.
9061 (muscle_insert, muscle_find): Rename `pair' as `probe'.
9062 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
9063 (muscle_entry_s): The `value' member is no longer const.
9064 Adjust all dependencies.
9065 * src/muscle_tab.c (muscle_init): Adjust: use
9066 MUSCLE_INSERT_STRING.
9067 Initialize the obstack earlier.
9068 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
9069 (muscle_pair_list_grow): New.
9070 * data/c.m4 (b4_c_function_call, b4_c_args): New.
9071 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
9072 * tests/calc.at: Use %locations, not --locations.
9073 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
9074
0e575721
AD
90752002-10-19 Akim Demaille <akim@epita.fr>
9076
9077 * src/getargs.c (usage): Take status as argument and exit
9078 accordingly.
9079 Report the traditional `Try ... --help' message when status != 0.
9080 (usage, version): Don't take a FILE * as arg, it is pointless.
9081 (getargs): When there is an incorrect number of arguments, make it
9082 an error, and report it GNUlically thanks to `usage ()'.
9083
724ce7f5
PE
90842002-10-18 Paul Eggert <eggert@twinsun.com>
9085
3a781eb2
PE
9086 * data/glr.c (yyreportParseError): Don't assume that sprintf
9087 yields the length of the printed string, as this is not true
9088 on SunOS 4.1.4. Reported by Peter Klein.
9089
724ce7f5
PE
9090 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
9091 * tests/conflicts.at (%nonassoc and eof): Likewise.
9092 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
9093
473d0a75
AD
90942002-10-17 Akim Demaille <akim@epita.fr>
9095
9096 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
9097 * src/getargs.c (trace_types, trace_args): Adjust.
9098 * src/reader.c (grammar_current_rule_prec_set)
9099 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
9100 Standardize error messages.
9101 And s/@prec/%prec/!
9102 (reader): Use trace_flag to enable scanner/parser debugging,
9103 instead of an adhoc scheme.
9104 * src/scan-gram.l: Remove trailing debugging code.
9105
e76d2469
PE
91062002-10-16 Paul Eggert <eggert@twinsun.com>
9107
93e2236a
PE
9108 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
9109 MUSCLE_TAB_H.
9110
e76d2469
PE
9111 * NEWS: Officially drop support for building Bison with K&R C,
9112 since it didn't work anyway and it's not worth worrying about.
9113 * Makefile.maint (wget_files): Remove ansi2knr.c.
9114 (ansi2knr.c-url_prefix): Remove.
9115 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
9116 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9117 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9118
5bd1c419
PE
91192002-10-15 Paul Eggert <eggert@twinsun.com>
9120
9121 Stop using the "enum_" trick for K&R-style function definitions;
9122 it confused me, and I was the author! Instead, assume that people
9123 who want to use K&R C compilers (when using these modules in GCC,
9124 perhaps?) will run ansi2knr.
9125
9126 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
9127 All uses of "enum_" changed to "enum ".
9128 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9129 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 9130
5bd1c419
PE
9131 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
9132 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
9133 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
9134 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
9135 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
9136 abitset_not, abitset_ones, abitset_or, abitset_or_and,
9137 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
9138 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
9139 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
9140 Use function prototypes; this removes the need for declaring
9141 static functions simply to provide their prototypes.
9142 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
9143 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
9144 bitset_count_, bitset_create, bitset_dump, bitset_first,
9145 bitset_free, bitset_init, bitset_last, bitset_next,
9146 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
9147 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
9148 bitset_print, bitset_release_memory, bitset_toggle_,
9149 bitset_type_choose, bitset_type_get, bitset_type_name_get,
9150 debug_bitset): Likewise.
9151 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
9152 * lib/bitset_stats.c (bitset_log_histogram_print,
9153 bitset_percent_histogram_print, bitset_stats_and,
9154 bitset_stats_and_cmp, bitset_stats_and_or,
9155 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
9156 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
9157 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
9158 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
9159 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
9160 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
9161 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
9162 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
9163 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
9164 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
9165 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
9166 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
9167 bitset_stats_zero): Likewise.
9168 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9169 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9170 bitsetv_dump, debug_bitsetv): Likewise.
9171 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
9172 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
9173 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
9174 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
9175 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
9176 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
9177 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
9178 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
9179 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
9180 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
9181 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
9182 Likewise.
9183 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
9184 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
9185 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
9186 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
9187 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
9188 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
9189 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
9190 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
9191 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
9192 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
9193 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 9194
ae26e1f0
AD
91952002-10-14 Akim Demaille <akim@epita.fr>
9196
9197 Version 1.75.
9198
d43baf71
AD
91992002-10-14 Akim Demaille <akim@epita.fr>
9200
9201 * tests/Makefile.am (maintainer-check-posix): New.
9202
7ebc83e3
AD
92032002-10-14 Akim Demaille <akim@epita.fr>
9204
9205 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
9206 member.
9207
05846dae
AD
92082002-10-14 Akim Demaille <akim@epita.fr>
9209
9210 * src/tables.c (table_ninf_remap): base -> tab.
9211 Reported by Matt Rosing.
9212
1318e37d
PE
92132002-10-14 Paul Eggert <eggert@twinsun.com>
9214
447fbb17
PE
9215 * tests/action.at, tests/calc.at, tests/conflicts.at,
9216 tests/cxx-type.at, tests/headers.at, tests/input.at,
9217 tests/regression.at, tests/synclines.at, tests/torture.at:
9218 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
9219 so that the tests still work even if POSIXLY_CORRECT is set.
9220 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 9221
1318e37d
PE
9222 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
9223 for portability to K&R hosts. Fix typo: signed char is guaranteed
9224 only to 127, not to 128.
9225 * data/glr.c (yysigned_char): New type.
9226 * data/yacc.c (yysigned_char): Likewise.
9227 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
9228
cc0f0794
PE
92292002-10-13 Paul Eggert <eggert@twinsun.com>
9230
5038f418
PE
9231 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
9232 true due to limited range of data type" warning from GCC.
9233
cc0f0794
PE
9234 * data/c.m4 (b4_token_defines): Protect against double-inclusion
9235 by wrapping enum yytokentype's definition inside #ifndef
9236 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
9237
6fed0802
AD
92382002-10-13 Akim Demaille <akim@epita.fr>
9239
9240 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
9241 Un yy- yyrhs to avoid the name clash with the global YYRHS.
9242
32f0598d
AD
92432002-10-13 Akim Demaille <akim@epita.fr>
9244
9245 * Makefile.maint: Update from Autoconf 2.54.
9246 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
9247
7ea9a33f
AD
92482002-10-13 Akim Demaille <akim@epita.fr>
9249
9250 * src/print.c (print_state): Separate the list of solved conflicts
9251 from the other items.
9252 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
9253
ea99527d
AD
92542002-10-13 Akim Demaille <akim@epita.fr>
9255
9256 Let nondeterministic skeletons be usable with deterministic
9257 tables.
9258
9259 With the patch, GAWK compiled by GCC without -O2 passes its test
9260 suite using a GLR parser driven by LALR tables. It fails with -O2
9261 because `struct stat' gives two different answers on my machine:
9262 88 (definition of an auto var) and later 96 (memset on this var).
9263 Hence the stack is badly corrumpted. The headers inclusion is to
9264 blame: if I move the awk.h inclusion before GLR's system header
9265 inclusion, the two struct stat have the same size.
9266
9267 * src/tables.c (pack_table): Always create conflict_table.
9268 (token_actions): Always create conflict_list.
9269 * data/glr.c (YYFLAG): Remove, unused.
9270
f377f69f
AD
92712002-10-13 Akim Demaille <akim@epita.fr>
9272
9273 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
9274 (O0FLAGS): New.
9275 (VALGRIND, GXX): New.
9276 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
9277 * tests/bison.in: Run $PREBISON a pre-command.
9278 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
9279 (maintainer-check-g++): New.
9280 * Makefile.am (maintainer-check): New.
9281
2a1fe6ed
AD
92822002-10-13 Akim Demaille <akim@epita.fr>
9283
9284 * data/glr.c: Formatting changes.
9285 Tweak some trace messages to match yacc.c's.
9286
f50adbbd
AD
92872002-10-13 Akim Demaille <akim@epita.fr>
9288
9289 GLR parsers sometimes raise parse errors instead of performing the
9290 default reduction.
9291 Reported by Charles-Henry de Boysson.
9292
9293 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 9294 check the length of the traces when %glr.
f50adbbd
AD
9295 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
9296 GLR's traces.
9297 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
9298 Test GLR parsers.
9299 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
9300 (yyltype): Remove the yy prefix from the member names.
9301 (yytable): Complete its comment.
9302 (yygetLRActions): Map error action number from YYTABLE from
9303 YYTABLE_NINF to 0.
9304 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
9305 (which was a bug: it should have been YYTABEL_NINF, and yet it was
9306 not satisfying as we could compare an YYACTION computed from
9307 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
9308 only value for error actions.
9309 (yyreportParseError): In verbose parse error messages, don't issue
9310 `error' in the list of expected tokens.
9311 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
9312 next action to perform to match glr.c's decoding.
9313 (yytable): Complete its comment.
9314
bcbad5b9
PE
93152002-10-13 Paul Eggert <eggert@twinsun.com>
9316
9317 Fix problem reported by Henrik Grubbstroem in
161a71f3 9318 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
9319 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
9320 because the Bison parser reads the second action before reducing
9321 the first one.
9322 * src/scan-gram.l (rule_length): New static var.
9323 Use it to keep track of the rule length in the scanner, since
9324 we can't expect the parser to be in lock-step sync with the scanner.
9325 (handle_action_dollar, handle_action_at): Use this var.
9326 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 9327
14904b89
PE
93282002-10-12 Paul Eggert <eggert@twinsun.com>
9329
1fe611e5
PE
9330 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
9331 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
9332 Include <sys/time.h> when checking for clock_t and struct tms.
9333 Use same include order as source.
9334 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 9335 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 9336
1fe611e5
PE
9337 * lib/timevar.c: Update copyright date and clarify comments.
9338 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 9339
1fe611e5
PE
9340 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
9341 GCC version as of today, then merge Bison's changes.
9342 Change "GCC" to "Bison" in copyright notice. timevar.def's
9343 author is Akim, so change that too.
9344
98194095
PE
9345 * src/reader.c (grammar_current_rule_check):
9346 Don't worry about the default action if $$ is untyped.
9347 Prevents bogus warnings reported by Jim Gifford in
161a71f3 9348 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 9349
14904b89
PE
9350 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
9351 * data/glr.c, data/lalr1.cc, data/yacc.c:
9352 Output token definitions before the first part of user declarations.
9353 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 9354 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 9355
ff6dca18
PE
93562002-10-11 Paul Eggert <eggert@twinsun.com>
9357
9358 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
9359 (yyparse): here. This undoes some of the 2002-07-25 change.
9360 Compatibility problem reported by Ralf S. Engelschall with
9361 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
9362
eb714592
AD
93632002-10-11 Akim Demaille <akim@epita.fr>
9364
9365 * tests/regression.at Characters Escapes): New.
9366 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
9367 characters.
9368 Reported by Jan Nieuwenhuizen.
9369
b7195100
AD
93702002-10-11 Akim Demaille <akim@epita.fr>
9371
9372 * po/id.po: New.
9373
f28a0f2d
PE
93742002-10-10 Paul Eggert <eggert@twinsun.com>
9375
9376 Portability fixes for bitsets; this also avoids several GCC
9377 warnings.
9378
9379 * lib/abitset.c: Include <stddef.h>, for offsetof.
9380 * lib/lbitset.c: Likewise.
9381
9382 * lib/abitset.c (abitset_bytes): Return a size that is aligned
9383 properly for vectors of objects. Do not assume that adding a
9384 header size to a multiple of a word size yields a value that is
9385 properly aligned for the whole union.
9386 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9387
9388 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
9389 unique names for structures.
9390 * lib/ebitset.c (ebitset_bytes): Likewise.
9391 * lib/lbitset.c (lbitset_bytes): Likewise.
9392
9393 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
9394 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
9395 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
9396 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
9397 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
9398 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
9399 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
9400 to improve the type-checking that GCC can do.
9401 * lib/bitset.c (bitset_op4_cmp): Likewise.
9402 * lib/bitset_stats.c (bitset_stats_count,
9403 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
9404 bitset_stats_copy, bitset_stats_disjoint_p,
9405 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
9406 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
9407 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
9408 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
9409 bitset_stats_and_or_cmp, bitset_stats_andn_or,
9410 bitset_stats_andn_or_cmp, bitset_stats_or_and,
9411 bitset_stats_or_and_cmp): Likewise.
9412 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
9413 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
9414 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
9415 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
9416
9417 * lib/abitset.h: Include bitset.h, not bbitset.h.
9418 * lib/ebitset.h: Likewise.
9419 * lib/lbitset.h: Likewise.
9420
9421 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
9422 All instances of parameters of type enum bitset_opts are now of
9423 type enum_bitset_opts, to conform to the C Standard, and similarly
9424 for enum_bitset_type.
9425 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
9426 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
9427
9428 Do not use "struct bitset_struct" to mean different things in
9429 different modules. Not only is this confusing, it violates
9430 the C Standard, which requires that structure types in different
9431 modules must be compatible if one is to be passed to the other.
9432 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
9433 All instances of "struct bitset_struct *" replaced with "bitset".
9434 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
9435 (union bitset_union, struct abitset_struct, struct ebitset_struct,
9436 struct lbitset_struct, struct bitset_stats_struct): New types.
9437 All uses of struct bitset_struct changed to union bitset_union,
9438 etc.
ba0fe3c7 9439 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
9440 struct bitset_struct): Remove.
9441 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
9442 struct bitset_struct): Remove.
9443 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
9444 bitset_struct): Remove.
9445 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
9446 Likewise.
9447
9448 Do not call a function of type T using a call that assumes the
9449 function is of a different type U. Standard C requires that a
9450 function must be called with a type that is compatible with its
9451 definition.
9452 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9453 New decls.
9454 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
9455 New functions.
9456 * lib/ebitset.c (PFV): Remove.
9457 * lib/lbitset.c (PFV): Likewise.
9458 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
9459 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
9460 decls.
9461 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
9462 (ebitset_vtable): Use them.
9463 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
9464 lbitset_xor): New functions.
9465 (lbitset_vtable): Use them.
9466
9467 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
9468 Declare.
9469
9470 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
9471 GCC warning.
9472 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
9473 Use offsetof, for simplicity.
9474
6fbe4984
PE
94752002-10-06 Paul Eggert <eggert@twinsun.com>
9476
9477 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
9478 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 9479 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
9480 which was inadvertently undone by the 2002-09-30 patch.
9481 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
9482 the same width as int.
9483
420f93c8
PE
94842002-10-04 Paul Eggert <eggert@twinsun.com>
9485
9486 Version 1.50.
9487
9488 * configure.ac (AC_INIT), NEWS: Increment version number.
9489
9490 * doc/bison.texinfo: Minor spelling, grammar, and white space
9491 fixes.
9492 (Symbols): Mention that any negative value returned from yylex
9493 signifies end-of-input. Warn about negative chars. Mention
9494 the portable Standard C character set.
9495
9496 The GNU coding standard says CFLAGS and YFLAGS are reserved
9497 for the installer to set.
9498 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
9499 * src/Makefile.am (AM_CFLAGS): Likewise.
9500 (AM_YFLAGS): Renamed from YFLAGS.
9501
9502 Fix some MAX and MIN problems.
9503 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
9504 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
9505 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
9506 * src/reader.c (reader): Use it.
9507
9508 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
9509 POSIX 1003.1-2001 has removed fgrep.
9510
95112002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
9512
9513 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
9514 interpreted as signed.
9515 * lib/ebitset.c (ebitset_list): Fix bug.
9516
ff68026d
PE
95172002-10-01 Paul Eggert <eggert@twinsun.com>
9518
9519 More fixes for 64-bit hosts and large bitsets.
9520
9521 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
9522 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
9523 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
9524 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
9525 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
9526 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
9527 bitset_count_): Likewise.
9528 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
9529 bitset_first, bitset_last): Likewise.
9530 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
9531 bitset_stats_list_reverse, bitset_stats_size,
9532 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
9533 Likewise.
9534 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9535 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
9536 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
9537 bitsetv_reflexive_transitive_closure): Likewise.
9538 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
9539 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
9540 Likewise.
9541 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
9542 Likewise.
420f93c8 9543
ff68026d
PE
9544 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
9545 Use size_t, not unsigned int, to count bytes.
9546 * lib/abitset.h (abitset_bytes): Likewise.
9547 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
9548 Likewise.
9549 * lib/bitset.h (bitset_bytes): Likewise.
9550 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
9551 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
9552 * lib/bitsetv.c (bitsetv_alloc): Likewise.
9553 * lib/ebitset.c (ebitset_bytes): Likewise.
9554 * lib/ebitset.h (ebitset_bytes): Likewise.
9555 * lib/lbitset.c (lbitset_bytes): Likewise.
9556 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 9557
ff68026d
PE
9558 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
9559 abitset_subset_p, abitset_disjoint_p, abitset_and,
9560 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
9561 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
9562 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
9563 abitset_or_and, abitset_or_and_cmp):
9564 Use bitset_windex instead of unsigned int.
9565 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
9566 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
9567 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
9568 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
9569 Likewise.
9570 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 9571
ff68026d
PE
9572 * lib/bitset.c (bitset_print):
9573 Use proper printf formats for widths of integer types.
9574 * lib/bitset_stats.c (bitset_percent_histogram_print,
9575 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
9576 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
9577 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
9578 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 9579
ff68026d
PE
9580 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
9581 BITSET_SIZE_MAX): New macros.
9582 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
9583 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
9584 to BITSET_WINDEX_MAX.
9585
9586 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
9587 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
9588 since we now return the bitset_bindex type (not int).
9589
9590 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
9591 when computing sizes.
9592 * lib/ebitset.c (ebitset_elts_grow): Likewise.
9593
9594 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
9595 and avoid cast to unsigned.
9596
6aa452a6
AD
95972002-09-30 Akim Demaille <akim@epita.fr>
9598
9599 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
9600 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
9601 Updates from Michael Hayes.
9602
927f7817
AD
96032002-09-30 Art Haas <ahaas@neosoft.com>
9604
9605 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
9606 invocations.
9607 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
9608 defined.
9609
9738f41e
AD
96102002-09-27 Akim Demaille <akim@epita.fr>
9611
9612 Version 1.49c.
9613
a5c75d7f
AD
96142002-09-27 Akim Demaille <akim@epita.fr>
9615
9616 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
9617 (Because of AC_LIBSOURCE).
9618
8280e179
AD
96192002-09-27 Akim Demaille <akim@epita.fr>
9620
9621 Playing with Autoscan.
9622
9623 * configure.ac: Remove the old LIBOBJ tweaks.
9624 (AC_REPLACE_FUNCS): Add strrchr and strtol.
9625 * lib/strrchr.c: New.
9626 * lib/strtol.c: New, from the Coreutils 4.5.1.
9627
ae64af35
AD
96282002-09-27 Akim Demaille <akim@epita.fr>
9629
9630 Playing with Autoscan.
9631
9632 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
9633 * lib/Makefile.am (libbison_a_SOURCES): No longer include
9634 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
9635 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
9636 Coreutils 4.5.1.
9637
d1a1114f
AD
96382002-09-24 Akim Demaille <akim@epita.fr>
9639
9640 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
9641 (Frequently Asked Questions, Parser Stack Overflow): New.
9642
b906441c
AD
96432002-09-13 Akim Demaille <akim@epita.fr>
9644
9645 Playing with autoscan.
9646
9647 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
9648 * src/files.c (skeleton_find): Remove, unused.
9649 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
9650 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
9651
bd701811
AD
96522002-09-13 Akim Demaille <akim@epita.fr>
9653
9654 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
9655 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
9656
e0a13e7b
AD
96572002-09-13 Akim Demaille <akim@epita.fr>
9658
9659 * configure.ac: Require 2.54.
9660 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
9661 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
9662 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
9663 Remove, provided by Autoconf macros.
9664
c97011bf
AD
96652002-09-12 Akim Demaille <akim@epita.fr>
9666
9667 * m4/prereq.m4: Update, from Coreutils 4.5.1.
9668
d862b1be
AD
96692002-09-12 Akim Demaille <akim@epita.fr>
9670
9671 * m4/prereq.m4: Update, from Fileutils 4.1.5.
9672 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
9673 Reported by Martin Mokrejs.
9674
3d38c03a
AD
96752002-09-10 Akim Demaille <akim@epita.fr>
9676
9677 * src/parse-gram.y: Associate a human readable string to each
9678 token type.
9679 * tests/regression.at (Invalid inputs): Adjust.
9680
b6347355
AD
96812002-09-10 Gary V. Vaughan <gary@gnu.org>
9682
9683 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
9684 with an Autoconf-2.5x style configure.ac.
9685
09ba4ab2
PE
96862002-09-06 Paul Eggert <eggert@twinsun.com>
9687
9688 * doc/bison.texinfo (Conditions): Make explicit that the GPL
9689 exception applies only to yacc.c. This is a modification of a
9690 patch originally suggested by Akim Demaille.
9691
21846f69
AD
96922002-09-06 Akim Demaille <akim@epita.fr>
9693
09ba4ab2
PE
9694 * data/c.m4 (b4_copyright): Move the GPL exception comment from
9695 here to...
9696 * data/yacc.c: here.
9697
21846f69
AD
9698 * data/lalr1.cc (struct yyltype): Don't define it, since we use
9699 LocationType.
9700 (b4_ltype): Default to yy::Location from location.hh.
9701
c0ad8bf3
AD
97022002-09-04 Jim Meyering <jim@meyering.net>
9703
9704 * data/yacc.c: Guard the declaration of yytoknum also with
9705 `#ifdef YYPRINT', so it is declared only when used.
9706
3a93251e
AD
97072002-09-04 Akim Demaille <akim@epita.fr>
9708
9709 * configure.in: Rename as...
9710 * configure.ac: this.
9711 Bump to 1.49c.
9712
427c0dda
AD
97132002-09-04 Akim Demaille <akim@epita.fr>
9714
9715 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
9716 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
9717 translate maintainer only messages.
9718
6a254321
PE
97192002-08-12 Paul Eggert <eggert@twinsun.com>
9720
645e30d1
PE
9721 Version 1.49b.
9722
6a254321
PE
9723 * Makefile.am (SUBDIRS): Remove intl.
9724 (DISTCLEANFILES): Remove.
9725 * NEWS: Mention that GNU M4 is now required. Clarify what is
9726 meant by "larger grammars". Mention the pt_BR translation.
9727 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
9728 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
9729 Bump version from 0.11.2 to 0.11.5.
9730 (BISON_PREREQ_STAGE): Remove.
9731 (AM_GNU_GETTEXT): Use external gettext.
9732 (AC_OUTPUT): Remove intl/Makefile.
9733
9734 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
9735
9736 * data/glr.c: Include string.h, for strlen.
9737 (yyreportParseError): Use size_t for yysize.
9738 (yy_yypstack): No longer nested inside yypstates, as nested
9739 functions are not portable. Do not assume size_t is the
9740 same width as int.
9741 (yypstates): Do not assume that ptrdiff_t is the same width
9742 as int, and similarly for yyposn and YYINDEX.
9743
9744 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
9745
9746 * lib/Makefile.am (INCLUDES): Do not include from the intl
9747 directory, which has been removed.
9748 * src/Makefile.am (INCLUDES): Likewise.
9749
9750 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
9751 (bitsets_sources, additional_bitsets_sources, timevars_sources):
9752 New vars.
9753
9754 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
9755 * tests/Makefile.am (EXTRA_DIST): Likewise.
9756
9757 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
9758 Do not assume that bitset_windex is the same width as unsigned.
9759
9760 * lib/abitset.c (abitset_unused_clear): Do not assume that
9761 bitset_word is the same width as int.
9762 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
9763 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
9764 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
9765 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
9766 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
9767
9768 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
9769 portability to one's complement hosts!).
9770 * lib/ebitset.c (ebitset_op1): Likewise.
9771 * lib/lbitset.c (lbitset_op1): Likewise.
9772
9773 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
9774 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
9775 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
9776 Sync with fileutils.
9777 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
9778 lib/gettext.h: Sync with diffutils.
9779
9780 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
9781 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
9782
9783 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
9784 PROTOTYPES to check for prototypes, and "defined __STDC__" to
9785 check for void *.
9786
9787 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
9788 size_t; the old version tried to do this but casted improperly.
9789 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
9790 (bitset_test): Now returns int, not unsigned long.
9791
9792 * lib/bitset_stats.c: Include "gettext.h".
9793 (_): New macro.
9794 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
9795 name locals "index", as it generates unnecessary warnings on some
9796 hosts that have an "index" function.
9797
9798 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
9799 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
9800 they need translation.
9801 * src/LR0.c (state_list_append, new_itemsets, get_state,
9802 append_states, generate_states): Likewise.
9803 * src/assoc.c (assoc_to_string): Likewise.
9804 * src/closure.c (print_closure, set_firsts, closure): Likewise.
9805 * src/gram.c (grammar_dump): Likewise.
9806 * src/injections.c (injections_compute): Likewise.
9807 * src/lalr.c (lookaheads_print): Likewise.
9808 * src/relation.c (relation_transpose): Likewise.
9809 * src/scan-gram.l: Likewise.
9810 * src/tables.c (table_grow, pack_vector): Likewise.
9811
9812 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
9813 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
9814 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
9815 * m4/mbstate_t.m4: Sync with fileutils.
9816 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
9817
9818 * po/LINGUAS: Add pt_BR.
9819 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
9820 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
9821 lib/timevar.c.
9822 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
9823 manual recommends.
9824 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
9825
9826 * src/complain.c (strerror_r): Remove decl; not needed.
9827 (strerror): Use same pattern as ../lib/error.c.
9828
9829 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
9830
9831 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
9832
9833 * src/main.c (main): Cast result of bindtextdomain and textdomain
9834 to void, to avoid a GCC warning when --disable-nls is in effect.
9835
9836 * src/scan-gram.l: Use strings rather than escapes when possible,
9837 to minimize the number of warnings from xgettext.
9838 (handle_action_dollar, handle_action_at): Don't use isdigit,
9839 as it mishandles negative chars and it may not work as expected
9840 outside the C locale.
9841
9842 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
9843 this is a GCC extension and is not portable to other compilers.
9844
9845 * src/system.h (alloca): Use same pattern as ../lib/error.c.
9846 Do not include <ctype.h>; no longer needed.
9847 Do not include <malloc.h>; no longer needed (and generates
9848 warnings on OpenBSD 3.0).
9849
9850 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
9851 it's not portable.
9852
9853 * tests/regression.at: Do not use 'cc -c input.c -o input';
9854 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
9855
9856 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
9857 exit status as failure, not just exit status 1. Sun C exits
9858 with status 2 sometimes.
9859
9860 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
9861 Use it for the two large tests.
9862
c8f002c7
AD
98632002-08-02 Akim Demaille <akim@epita.fr>
9864
9865 * src/conflicts.c (conflicts_output): Don't output rules never
9866 reduced here, since anyway that computation doesn't work.
9867 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
9868 (rule_useless_p, rule_never_reduced_p): New.
9869 (grammar_rules_partial_print): Use a filter instead of a range.
9870 Display the title only if needed.
9871 (grammar_rules_print): Adjust.
9872 (grammar_rules_never_reduced_report): New.
9873 * src/tables.c (action_row): Move the computation of rules never
9874 reduced to...
9875 (token_actions): here.
9876 * src/main.c (main): Make the parser before making the report, so
9877 that rules never reduced are computed.
9878 Call grammar_rules_never_reduced_report.
9879 * src/print.c (print_results): Report rules never reduced.
9880 * tests/conflicts.at, tests/reduce.at: Adjust.
9881
cd08e51e
AD
98822002-08-01 Akim Demaille <akim@epita.fr>
9883
9884 Instead of attaching lookaheads and duplicating the rules being
9885 reduced by a state, attach the lookaheads to the reductions.
9886
9887 * src/state.h (state_t): Remove the `lookaheads',
9888 `lookaheads_rule' member.
9889 (reductions_t): Add a `lookaheads' member.
9890 Use a regular array for the `rules'.
9891 * src/state.c (reductions_new): Initialize the lookaheads member
9892 to 0.
9893 (state_rule_lookaheads_print): Adjust.
9894 * src/state.h, src/state.c (state_reductions_find): New.
9895 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
9896 (count_rr_conflicts): Adjust.
9897 * src/lalr.c (LArule): Remove.
9898 (add_lookback_edge): Adjust.
9899 (state_lookaheads_count): New.
9900 (states_lookaheads_initialize): Merge into...
9901 (initialize_LA): this.
9902 (lalr_free): Adjust.
9903 * src/main.c (main): Don't free nullable and derives too early: it
9904 is used by --verbose.
9905 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
9906
bb0027a9
AD
99072002-08-01 Akim Demaille <akim@epita.fr>
9908
9909 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
9910 `rule_number_t**'.
9911 (set_derives, free_derives): Rename as...
9912 (derives_compute, derives_free): this.
9913 Adjust all dependencies.
9914 * src/nullable.c (set_nullable, free_nullable): Rename as...
9915 (nullable_compute, nullable_free): these.
9916 (rule_list_t): Store rule_t *, not rule_number_t.
9917 * src/state.c (state_rule_lookaheads_print): Directly compare rule
9918 pointers, instead of their numbers.
9919 * src/main.c (main): Call nullable_free, and derives_free earlier,
9920 as they were lo longer used.
9921
3325ddc4
AD
99222002-08-01 Akim Demaille <akim@epita.fr>
9923
9924 * lib/timevar.c (get_time): Include children time.
9925 * src/lalr.h (LA, LArule): Don't export them: used with the
9926 state_t.
9927 * src/lalr.c (LA, LArule): Static.
9928 * src/lalr.h, src/lalr.c (lalr_free): New.
9929 * src/main.c (main): Call it.
9930 * src/tables.c (pack_vector): Check whether loc is >= to the
9931 table_size, not >.
9932 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
9933 (tables_generate): do it, since that's also it which allocates
9934 them.
9935 Don't free LA and LArule, main does.
9936
c6f1a33c
AD
99372002-07-31 Akim Demaille <akim@epita.fr>
9938
9939 Separate parser tables computation and output.
9940
9941 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
9942 (conflict_list, conflict_list_cnt, table, check, table_ninf)
9943 (yydefgoto, yydefact, high): Move to...
9944 * src/tables.h, src/tables.c: here.
9945 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
9946 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
9947 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
9948 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
9949 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
9950 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
9951 (action_row, save_row, token_actions, save_column, default_goto)
9952 (goto_actions, sort_actions, matching_state, pack_vector)
9953 (table_ninf_remap, pack_table, prepare_actions): Move to...
9954 * src/tables.c: here.
9955 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
9956 * src/output.c (token_actions, output_base, output_conflicts)
9957 (output_check): Merge into...
9958 (prepare_actions): this.
9959 (actions_output): Rename as...
9960 (user_actions_output): this.
9961 * src/main.c (main): Call tables_generate and tables_free.
9962
1509d42f
AD
99632002-07-31 Akim Demaille <akim@epita.fr>
9964
9965 Steal GCC's --time-report support.
9966
9967 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
9968 stolen/adjusted from GCC.
9969 * m4/stage.m4: Remove time related checks.
9970 * m4/timevar.m4: New.
9971 * configure.in: Adjust.
9972 * src/system.h: Adjust to using timevar.h.
9973 * src/getargs.h, src/getargs.c: Support trace_time for
9974 --trace=time.
9975 * src/main.c (stage): Remove.
9976 (main): Replace `stage' invocations with timevar calls.
9977 * src/output.c: Insert pertinent timevar calls.
9978
273a74fa
AD
99792002-07-31 Akim Demaille <akim@epita.fr>
9980
9981 Let --trace have arguments.
9982
9983 * src/getargs.h (enum trace_e): New.
9984 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
9985 (long_options, short_options): --trace/-T takes an optional
9986 argument.
9987 Change all the uses of trace_flag to reflect the new flags.
9988 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
9989
9990 Strengthen `stage' portability.
9991
9992 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
9993 * configure.in: Use it.
9994 Don't check for malloc.h and sys/times.h.
9995 * src/system.h: Include them when appropriate.
9996 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
9997 times and struct tms are available.
9998
217598da
AD
99992002-07-30 Akim Demaille <akim@epita.fr>
10000
10001 In verbose parse error message, don't report `error' as an
10002 expected token.
10003 * tests/actions.at (Printers and Destructors): Adjust.
10004 * tests/calc.at (Calculator $1): Adjust.
10005 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
10006 error message, do not report the parser accepts the error token in
10007 that state.
10008
52489d44
AD
100092002-07-30 Akim Demaille <akim@epita.fr>
10010
10011 Normalize conflict related messages.
10012
10013 * src/complain.h, src/complain.c (warn, complain): New.
10014 * src/conflicts.c (conflicts_print): Use them.
10015 (conflict_report_yacc): New, extracted from...
10016 (conflicts_print): here.
10017 * tests/conflicts.at, tests/existing.at: Adjust.
10018
e8832397
AD
100192002-07-30 Akim Demaille <akim@epita.fr>
10020
10021 Report rules which are never reduced by the parser: those hidden
10022 by conflicts.
10023
10024 * src/LR0.c (save_reductions): Don't make the final state too
10025 different: save its reduction (accept) instead of having a state
10026 without any action (no shift or goto, no reduce).
10027 Note: the final state is now a ``regular'' state, i.e., the
10028 parsers now contain `reduce 0' as default reduction.
10029 Nevertheless, since they decide to `accept' when yystate =
10030 final_state, they still will not reduce rule 0.
10031 * src/print.c (print_actions, print_reduction): Adjust.
10032 * src/output.c (action_row): Track reduced rules.
10033 (token_actions): Report rules never reduced.
10034 * tests/conflicts.at, tests/regression.at: Adjust.
10035
caf23d24
AD
100362002-07-30 Akim Demaille <akim@epita.fr>
10037
10038 `stage' was accidently included in a previous patch.
10039 Initiate its autoconfiscation.
10040
10041 * configure.in: Look for malloc.h and sys/times.h.
10042 * src/main.c (stage): Adjust.
10043 Report only when trace_flag.
10044
640748ee
AD
100452002-07-29 Akim Demaille <akim@epita.fr>
10046
10047 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
10048 state_number_t.
10049 (errs_t): symbol_t*, not symbol_number_t.
10050 (reductions_t): rule_t*, not rule_number_t.
10051 (FOR_EACH_SHIFT): New.
10052 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
10053 * src/print.c, src/print_graph.c: Adjust.
10054
88bce5a2
AD
100552002-07-29 Akim Demaille <akim@epita.fr>
10056
10057 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
10058
10059 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
10060 (endtoken, accept): these.
10061 * src/reader.c (reader): Set endtoken's default tag to "$end".
10062 Set undeftoken's tag to "$undefined" instead of "$undefined.".
10063 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
10064 Adjust.
10065
1bfb97db
AD
100662002-07-29 Akim Demaille <akim@epita.fr>
10067
10068 * src/reduce.c (reduce_grammar): When the language is empty,
10069 complain about the start symbol, not the axiom.
10070 Use its location.
10071 * tests/reduce.at (Empty Language): New.
10072
fc5734fe
AD
100732002-07-26 Akim Demaille <akim@epita.fr>
10074
10075 * src/reader.h, src/reader.c (gram_error): ... can't get
10076 yycontrol without making too strong assumptions on the parser
10077 itself.
10078 * src/output.c (prepare_tokens): Use the real 0th value of
10079 token_translations instead of `0'.
10080 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
10081 visible here.
10082 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
10083 for the time being: %locations ought to provide it to yyerror.
10084
3650b4b8
AD
100852002-07-25 Akim Demaille <akim@epita.fr>
10086
10087 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
10088 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
10089 * tests/regression.at (Web2c Actions): Adjust.
10090
4b3d3a8e
AD
100912002-07-25 Akim Demaille <akim@epita.fr>
10092
10093 Stop storing rules from 1 to nrules + 1.
10094
10095 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
10096 * src/nullable.c, src/output.c, src/print.c, src/reader.c
10097 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
10098 Iterate from 0 to nrules.
10099 Use rule_number_as_item_number and item_number_as_rule_number.
10100 Adjust to `derive' now containing possibly 0.
10101 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
10102 Handle the `- 1' part in rule numbers from/to item numbers.
10103 * src/conflicts.c (log_resolution): Fix the message which reversed
10104 shift and reduce.
10105 * src/output.c (action_row): Initialize default_rule to -1.
10106 (token_actions): Adjust.
10107 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
10108 expected output.
10109 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
10110
4a2a22f4
AD
101112002-07-25 Akim Demaille <akim@epita.fr>
10112
10113 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
10114 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
10115 (b4_c_knr_arg_decl): New.
10116 * data/yacc.c: Use it to define yysymprint, yydestruct, and
10117 yyreport_parse_error.
10118
b8df3223
AD
101192002-07-25 Akim Demaille <akim@epita.fr>
10120
10121 * data/yacc.c (yyreport_parse_error): New, extracted from...
10122 (yyparse): here.
10123 (yydestruct, yysymprint): Move above yyparse.
10124 Be K&R compliant.
10125
a762e609
AD
101262002-07-25 Akim Demaille <akim@epita.fr>
10127
10128 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
10129 replace...
10130 (b4_sint_type, b4_uint_type): these.
10131 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
10132 * tests/regression.at (Web2c Actions): Adjust.
10133
12b0043a
AD
101342002-07-25 Akim Demaille <akim@epita.fr>
10135
10136 * src/gram.h (TIEM_NUMBER_MAX): New.
10137 (item_number_of_rule_number, rule_number_of_item_number): Rename
10138 as...
10139 (rule_number_as_item_number, item_number_as_rule_number): these.
10140 Adjust dependencies.
10141 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
10142 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
10143 (symbol_number_to_vector_number): New.
10144 (order): Of vector_number_t* type.
10145 (base_t, BASE_MAX, BASE_MIN): New.
10146 (froms, tos, width, pos, check): Of base_t type.
10147 (action_number_t, ACTION_MIN, ACTION_MAX): New.
10148 (actrow): Of action_number_t type.
10149 (conflrow): Of unsigned int type.
10150 (table_ninf, base_ninf): New.
10151 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
10152 (muscle_insert_int_table, muscle_insert_base_table)
10153 (muscle_insert_rule_number_table): New.
10154 (prepare_tokens): Output `toknum' as int_table.
10155 (action_row): Returns a rule_number_t.
10156 Use ACTION_MIN, not SHRT_MIN.
10157 (token_actions): yydefact is rule_number_t*.
10158 (table_ninf_remap): New.
10159 (pack_table): Use it for `base' and `table'.
10160 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
10161 replaced with...
10162 (YYPACT_NINF, YYTABLE_NINF): these.
10163 (yypact, yytable): Compute their types instead of hard-coded
10164 `short'.
10165 * tests/regression.at (Web2c Actions): Adjust.
10166
5dde258a
AD
101672002-07-19 Akim Demaille <akim@epita.fr>
10168
10169 * src/scan-gram.l (id): Can start with an underscore.
10170
a945ec39
AD
101712002-07-16 Akim Demaille <akim@epita.fr>
10172
10173 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
10174 Adjust all former `associativity' dependencies.
10175 * src/symtab.c (symbol_new): Default associativity is `undef', not
10176 `right'.
10177 (symbol_check_alias_consistence): Adjust.
10178
fae437e8
AD
101792002-07-09 Akim Demaille <akim@epita.fr>
10180
10181 * doc/bison.texinfo: Properly set the ``header'' part.
10182 Use @dircategory ``GNU programming tools'' as per Texinfo's
10183 documentation.
10184 Use @copying.
10185
1a715ef2
AD
101862002-07-09 Akim Demaille <akim@epita.fr>
10187
10188 * lib/quotearg.h: Protect against multiple inclusions.
10189 * src/location.h (location_t): Add a `file' member.
10190 (LOCATION_RESET, LOCATION_PRINT): Adjust.
10191 * src/complain.c (warn_at, complain_at, fatal_at): Drop
10192 `error_one_per_line' support.
10193
a5d50994
AD
101942002-07-09 Akim Demaille <akim@epita.fr>
10195
10196 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
10197 * src/reader.c (lineno): Remove.
10198 Adjust all dependencies.
10199 (get_merge_function): Take a location and use complain_at.
10200 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
10201 * tests/regression.at (Invalid inputs, Mixing %token styles):
10202 Adjust.
10203
b275314e
AD
102042002-07-09 Akim Demaille <akim@epita.fr>
10205
10206 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
10207 recovery rule, and forbid extensions when --yacc.
10208 (gram_error): Use complain_at.
10209 * src/reader.c (reader): Exit if there were parse errors.
10210
865b9df1
AD
102112002-07-09 Akim Demaille <akim@epita.fr>
10212
10213 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
10214 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
10215 Reported by R Blake <blakers@mac.com>.
10216
c76e14da
AD
102172002-07-09 Akim Demaille <akim@epita.fr>
10218
10219 * data/yacc.c: Output the copyright notive in the header.
10220
7db2ed2d
AD
102212002-07-03 Akim Demaille <akim@epita.fr>
10222
10223 * src/output.c (froms, tos): Are state_number_t.
10224 (save_column): sp, sp1, and sp2 are state_number_t.
10225 (prepare): Rename `final' as `final_state_number', `nnts' as
10226 `nterms_number', `nrules' as `rules_number', `nstates' as
10227 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
10228 unused.
10229 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
10230 * data/lalr1.cc (nsym_): Remove, unused.
10231
e68e0410
AD
102322002-07-03 Akim Demaille <akim@epita.fr>
10233
10234 * src/lalr.h, src/lalr.c (goto_number_t): New.
10235 * src/lalr.c (goto_list_t): New.
10236 Propagate them.
10237 * src/nullable.c (rule_list_t): New.
10238 Propagate.
10239 * src/types.h: Remove.
10240
e1a4f3a4
AD
102412002-07-03 Akim Demaille <akim@epita.fr>
10242
10243 * src/closure.c (print_fderives): Use rule_rhs_print.
10244 * src/derives.c (print_derives): Use rule_rhs_print.
10245 (rule_list_t): New, replaces `shorts'.
10246 (set_derives): Add comments.
10247 * tests/sets.at (Nullable, Firsts): Adjust.
10248
536545f3
AD
102492002-07-03 Akim Demaille <akim@epita.fr>
10250
10251 * src/output.c (prepare_actions): Free `tally' and `width'.
10252 (prepare_actions): Allocate and free `order'.
10253 * src/symtab.c (symbols_free): Free `symbols'.
10254 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
10255 * src/output.c (m4_invoke): Move to...
10256 * src/scan-skel.l: here.
10257 (<<EOF>>): Close yyout, and free its name.
10258
8b752b00
AD
102592002-07-03 Akim Demaille <akim@epita.fr>
10260
10261 Fix some memory leaks, and fix a bug: state 0 was examined twice.
10262
10263 * src/LR0.c (new_state): Merge into...
10264 (state_list_append): this.
10265 (new_states): Merge into...
10266 (generate_states): here.
10267 (set_states): Don't ensure a proper `errs' state member here, do it...
10268 * src/conflicts.c (conflicts_solve): here.
10269 * src/state.h, src/state.c: Comment changes.
10270 (state_t): Rename member `shifts' as `transitions'.
10271 Adjust all dependencies.
10272 (errs_new): For consistency, also take the values as argument.
10273 (errs_dup): Remove.
10274 (state_errs_set): New.
10275 (state_reductions_set, state_transitions_set): Assert that no
10276 previous value was assigned.
10277 (state_free): New.
10278 (states_free): Use it.
10279 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
10280 temporary storage: use `errs' and `nerrs' as elsewhere.
10281 (set_conflicts): Allocate and free this `errs'.
10282
613f5e1a
AD
102832002-07-02 Akim Demaille <akim@epita.fr>
10284
10285 * lib/libiberty.h: New.
10286 * lib: Update the bitset implementation from upstream.
10287 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
10288 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
10289 * src/main.c: Adjust bitset stats calls.
10290
26e0cadc
PE
102912002-07-01 Paul Eggert <eggert@twinsun.com>
10292
10293 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
10294 char, so that negative chars don't collide with $.
10295
1154cced
AD
102962002-06-30 Akim Demaille <akim@epita.fr>
10297
10298 Have the GLR tests be `warning' checked, and fix the warnings.
10299
10300 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
10301 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
10302 (yyremoveDeletes): `yyi' and `yyj' are size_t.
10303 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
10304 (yyaddDeferredAction): static.
10305 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
10306 (yyreportParseError): yyprefix is const.
10307 yytokenp is used only when verbose.
10308 (yy__GNUC__): Replace with __GNUC__.
10309 (yypdumpstack): yyi is size_t.
10310 (yypreference): Un-yy local variables and arguments, to avoid
10311 clashes with `yyr1'. Anyway, we are not in the user name space.
10312 (yytname_size): be an int, as is compared with ints.
10313 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
10314 Use them.
10315 * tests/cxx-gram.at: Use quotation to protect $1.
10316 Use AT_COMPILE to enable warnings hunts.
10317 Prototype yylex and yyerror.
10318 `Use' argc.
10319 Include `string.h', not `strings.h'.
10320 Produce and prototype stmtMerge only when used.
10321 yylex takes a location.
10322
97650f4e
AD
103232002-06-30 Akim Demaille <akim@epita.fr>
10324
10325 We spend a lot of time in quotearg, in particular when --verbose.
10326
10327 * src/symtab.c (symbol_get): Store a quoted version of the key.
10328 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
10329 Adjust all callers.
10330
d2576365
AD
103312002-06-30 Akim Demaille <akim@epita.fr>
10332
10333 * src/state.h (reductions_t): Rename member `nreds' as num.
10334 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
10335 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
10336
ccaf65bc
AD
103372002-06-30 Akim Demaille <akim@epita.fr>
10338
10339 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
10340 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
10341 (shifts_to): Rename as...
10342 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
10343 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
10344 (TRANSITION_IS_DISABLED, transitions_to): these.
10345
87675353
AD
103462002-06-30 Akim Demaille <akim@epita.fr>
10347
10348 * src/print.c (print_shifts, print_gotos): Merge into...
10349 (print_transitions): this.
10350 (print_transitions, print_errs, print_reductions): Align the
10351 lookaheads columns.
10352 (print_core, print_transitions, print_errs, print_state,
10353 print_grammar): Output empty lines separator before, not after.
10354 (state_default_rule_compute): Rename as...
10355 (state_default_rule): this.
10356 * tests/conflicts.at (Defaulted Conflicted Reduction),
10357 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
10358 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
10359
ce4ccb4b
AD
103602002-06-30 Akim Demaille <akim@epita.fr>
10361
10362 Display items as we display rules.
10363
10364 * src/gram.h, src/gram.c (rule_lhs_print): New.
10365 * src/gram.c (grammar_rules_partial_print): Use it.
10366 * src/print.c (print_core): Likewise.
10367 * tests/conflicts.at (Defaulted Conflicted Reduction),
10368 (Unresolved SR Conflicts): Adjust.
10369 (Unresolved SR Conflicts): Adjust and rename as...
10370 (Resolved SR Conflicts): this, as was meant.
10371 * tests/regression.at (Web2c Report): Adjust.
10372
bc933ef1
AD
103732002-06-30 Akim Demaille <akim@epita.fr>
10374
10375 * src/print.c (state_default_rule_compute): New, extracted from...
10376 (print_reductions): here.
10377 Pessimize, but clarify the code.
10378 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
10379
53d4308d
AD
103802002-06-30 Akim Demaille <akim@epita.fr>
10381
10382 * src/output.c (action_row): Let default_rule be always a rule
10383 number.
10384
574fb2d5
AD
103852002-06-30 Akim Demaille <akim@epita.fr>
10386
10387 * src/closure.c (print_firsts, print_fderives, closure):
10388 Use BITSET_EXECUTE.
10389 * src/lalr.c (lookaheads_print): Likewise.
10390 * src/state.c (state_rule_lookaheads_print): Likewise.
10391 * src/print_graph.c (print_core): Likewise.
10392 * src/print.c (print_reductions): Likewise.
10393 * src/output.c (action_row): Likewise.
10394 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
10395
05811fd7
AD
103962002-06-30 Akim Demaille <akim@epita.fr>
10397
10398 * src/print_graph.c: Use report_flag.
10399
0e4d5753
AD
104002002-06-30 Akim Demaille <akim@epita.fr>
10401
10402 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
10403 to...
10404 * src/relation.h, src/relation.c (traverse, relation_digraph)
10405 (relation_print, relation_transpose): New.
10406
24c7d800
AD
104072002-06-30 Akim Demaille <akim@epita.fr>
10408
10409 * src/state.h, src/state.c (shifts_to): New.
10410 * src/lalr.c (build_relations): Use it.
10411
9222837b
AD
104122002-06-30 Akim Demaille <akim@epita.fr>
10413
10414 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
10415 (item_number_of_rule_number, rule_number_of_item_number): New.
10416 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
10417 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
10418 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
10419 Propagate their use.
10420 Much remains to be done, in particular wrt `shorts' from types.h.
10421
260008e5
AD
104222002-06-30 Akim Demaille <akim@epita.fr>
10423
10424 * src/symtab.c (symbol_new): Initialize the `printer' member.
10425
8a731ca8
AD
104262002-06-30 Akim Demaille <akim@epita.fr>
10427
10428 * src/LR0.c (save_reductions): Remove, replaced by...
10429 * src/state.h, src/state.c (state_reductions_set): New.
10430 (reductions, errs): Rename as...
10431 (reductions_t, errs_t): these.
10432 Adjust all dependencies.
10433
32e1e0a4
AD
104342002-06-30 Akim Demaille <akim@epita.fr>
10435
10436 * src/LR0.c (state_list_t, state_list_append): New.
10437 (first_state, last_state): Now symbol_list_t.
10438 (this_state): Remove.
10439 (new_itemsets, append_states, save_reductions): Take a state_t as
10440 argument.
10441 (set_states, generate_states): Adjust.
10442 (save_shifts): Remove, replaced by...
10443 * src/state.h, src/state.c (state_shifts_set): New.
10444 (shifts): Rename as...
10445 (shifts_t): this.
10446 Adjust all dependencies.
10447 * src/state.h (state_t): Remove the `next' member.
10448
e5fb6710
AD
104492002-06-30 Akim Demaille <akim@epita.fr>
10450
10451 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
10452 escaped in slot 0.
10453
c7ca99d4
AD
104542002-06-30 Akim Demaille <akim@epita.fr>
10455
10456 Use hash.h for the state hash table.
10457
10458 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
10459 (allocate_storage): Use state_hash_new.
10460 (free_storage): Use state_hash_free.
10461 (new_state, get_state): Adjust.
10462 * src/lalr.h, src/lalr.c (states): Move to...
10463 * src/states.h (state_t): Remove the `link' member, no longer
10464 used.
10465 * src/states.h, src/states.c: here.
10466 (state_hash_new, state_hash_free, state_hash_lookup)
10467 (state_hash_insert, states_free): New.
10468 * src/states.c (state_table, state_compare, state_hash): New.
10469 * src/output.c (output_actions): Do not free states now, since we
10470 still need to know the final_state number in `prepare', called
10471 afterwards. Do it...
10472 * src/main.c (main): here: call states_free after `output'.
10473
df0e7316
AD
104742002-06-30 Akim Demaille <akim@epita.fr>
10475
10476 * src/state.h, src/state.c (state_new): New, extracted from...
10477 * src/LR0.c (new_state): here.
10478 * src/state.h (STATE_ALLOC): Move to...
10479 * src/state.c: here.
10480 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
10481 * src/state.h, src/state.c: here.
10482
39f41916
AD
104832002-06-30 Akim Demaille <akim@epita.fr>
10484
10485 * src/reader.c (gensym): Rename as...
10486 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
10487 (getsym): Rename as...
10488 (symbol_get): this.
10489
d57650a5
AD
104902002-06-30 Akim Demaille <akim@epita.fr>
10491
10492 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
10493 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
10494 * src/output.c, src/print.c, src/print_graph.c: Propagate.
10495 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
10496
5a08f1ce
AD
104972002-06-30 Akim Demaille <akim@epita.fr>
10498
10499 Make the test suite pass with warnings checked.
10500
10501 * tests/actions.at (Printers and Destructors): Improve.
10502 Avoid unsigned vs. signed issues.
10503 * tests/calc.at: Don't exercise the scanner here, do it...
10504 * tests/input.at (Torturing the Scanner): here.
10505
720623af
PH
105062002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10507
88e7e941 10508 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
10509 reorganize first lines parallel to yacc.c.
10510
fb8135fa
AD
105112002-06-28 Akim Demaille <akim@epita.fr>
10512
10513 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
10514 (b4_token_enum, b4_token_defines): New, factored from...
10515 * data/lalr1.cc, data/yacc.c, glr.c: here.
10516
41442480
AD
105172002-06-28 Akim Demaille <akim@epita.fr>
10518
10519 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
10520 unused variables.
10521 * src/output.c (merger_output): static.
10522
e0e5bf84
AD
105232002-06-28 Akim Demaille <akim@epita.fr>
10524
ba0fe3c7 10525 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
10526 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
10527 pacify GCC.
10528 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 10529
676385e2
PH
105302002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10531
10532 Accumulated changelog for new GLR parsing features.
10533
6a254321 10534 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
10535 conflicts_total_count.
10536 * src/conflicts.h: Ditto.
10537 * src/output.c (token_actions): Use the new name.
10538 (output_conflicts): Change conflp => conflict_list_heads, and
10539 confl => conflict_list for better readability.
10540 * data/glr.c: Use the new names.
10541 * NEWS: Add self to GLR announcement.
e0e5bf84 10542
676385e2
PH
10543 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
10544
10545 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
10546 Akim Demaille.
10547
10548 * data/bison.glr: Change name to glr.c
10549 * data/glr.c: Renamed from bison.glr.
10550 * data/Makefile.am: Add glr.c
e0e5bf84
AD
10551
10552 * src/getargs.c:
10553
676385e2 10554 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 10555 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 10556
676385e2
PH
10557 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10558
10559 * data/bison.glr: Be sure to restore the
10560 current #line when returning to the skeleton contents after having
10561 exposed the input file's #line.
10562
10563 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10564
10565 * data/bison.glr: Bring up to date with changes to bison.simple.
10566
10567 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10568
10569 * data/bison.glr: Correct definitions that use b4_prefix.
10570 Various reformatting.
10571 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
10572 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
10573 yytokenp argument; now part of stack.
10574 (yychar): Define to behave as documented.
10575 (yyclearin): Ditto.
e0e5bf84 10576
676385e2
PH
10577 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10578
10579 * src/reader.h: Add declaration for free_merger_functions.
10580
10581 * src/reader.c (merge_functions): New variable.
10582 (get_merge_function): New function.
10583 (free_merger_functions): New function.
10584 (readgram): Check for %prec that is not followed by a symbol.
10585 Handle %dprec and %merge declarations.
10586 (packgram): Initialize dprec and merger fields in rules array.
10587
10588 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
10589 conflict_list_cnt, conflict_list_free): New variables.
10590 (table_grow): Also grow conflict_table.
e0e5bf84 10591 (prepare_rules): Output dprec and merger tables.
676385e2 10592 (conflict_row): New function.
e0e5bf84 10593 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
10594 default reduction in conflicted states for GLR parser so that there
10595 are spaces for the conflict lists.
10596 (save_row): Also save conflict information.
10597 (token_actions): Allocate conflict list.
10598 (merger_output): New function.
10599 (pack_vector): Pack conflict table, too.
10600 (output_conflicts): New function to output yyconflp and yyconfl.
10601 (output_check): Allocate conflict_tos.
10602 (output_actions): Output conflict tables, also.
10603 (output_skeleton): Output b4_mergers definition.
10604 (prepare): Output b4_max_rhs_length definition.
10605 Use 'bison.glr' as default skeleton for GLR parsers.
10606
10607 * src/gram.c (glr_parser): New flag.
10608 (grammar_free): Call free_merger_functions.
10609
10610 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
10611 all pairs of conflicting reductions, rather than just all tokens
10612 causing conflicts. Needed to size conflict tables.
e0e5bf84 10613 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
10614 interface.
10615 (conflicts_print): Ditto.
10616 (count_total_conflicts): New function.
10617
10618 * src/reader.h (merger_list): New type.
10619 (merge_functions): New variable.
10620
10621 * src/lex.h (tok_dprec, tok_merge): New token types.
10622
10623 * src/gram.h (rule_s): Add dprec and merger fields.
10624 (glr_parser): New flag.
10625
10626 * src/conflicts.h (count_total_conflicts): New function.
10627
10628 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
10629
10630 * doc/bison.texinfo (Generalized LR Parsing): New section.
10631 (GLR Parsers): New section.
10632 (Language and Grammar): Mention GLR parsing.
10633 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
10634 Correct typo ("tge" -> "the").
10635
10636 * data/bison.glr: New skeleton for GLR parsing.
10637
10638 * tests/cxx-gram.at: New tests for GLR parsing.
10639
10640 * tests/testsuite.at: Include cxx-gram.at.
10641
10642 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 10643
676385e2
PH
10644 * src/parse-gram.y:
10645
10646 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
10647
10648 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 10649
b5480d74 106502002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
10651
10652 * src/options.h, src/options.c: Remove.
10653 * src/getargs.c (short_options, long_options): New.
10654
60491a94
AD
106552002-06-27 Akim Demaille <akim@epita.fr>
10656
10657 * data/bison.simple, data/bison.c++: Rename as...
10658 * data/yacc.c, data/lalr1.cc: these.
10659 * doc/bison.texinfo (Environment Variables): Remove.
10660
9be0c25b
AD
106612002-06-25 Raja R Harinath <harinath@cs.umn.edu>
10662
10663 * src/getargs.c (report_argmatch): Initialize strtok().
10664
1ae72863
AD
106652002-06-20 Akim Demaille <akim@epita.fr>
10666
10667 * data/bison.simple (b4_symbol_actions): New, replaces...
10668 (b4_symbol_destructor, b4_symbol_printer): these.
10669 (yysymprint): Be sure to call YYPRINT only for tokens, and using
10670 user token numbers.
10671
87542d29
AD
106722002-06-20 Akim Demaille <akim@epita.fr>
10673
10674 * data/bison.simple (yydestructor): Rename as...
10675 (yydestruct): this.
10676
1a31ed21
AD
106772002-06-20 Akim Demaille <akim@epita.fr>
10678
10679 * src/symtab.h, src/symtab.c (symbol_type_set)
10680 (symbol_destructor_set, symbol_precedence_set): The location is
10681 the last argument.
10682 Adjust all callers.
10683
e776192e
AD
106842002-06-20 Akim Demaille <akim@epita.fr>
10685
10686 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
10687 internals.
10688 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
10689 Takes a location.
10690 * src/symtab.h, src/symtab.c (symbol_class_set)
10691 (symbol_user_token_number_set): Likewise.
10692 Adjust all callers.
10693 Promote complain_at.
10694 * tests/input.at (Type Clashes): Adjust.
10695
5c1180b3
AD
106962002-06-20 Akim Demaille <akim@epita.fr>
10697
10698 * data/bison.simple (YYLEX): Fix the declaration when
10699 %pure-parser.
10700
e3170060
AD
107012002-06-20 Akim Demaille <akim@epita.fr>
10702
10703 * data/bison.simple (yysymprint): Don't print the token number,
10704 just its name.
10705 * tests/actions.at (Destructors): Rename as...
10706 (Printers and Destructors): this.
10707 Also exercise %printer.
10708
253862fd
AD
107092002-06-20 Akim Demaille <akim@epita.fr>
10710
10711 * data/bison.simple (YYDSYMPRINT): New.
10712 Use it to remove many of the #if YYDEBUG/if (yydebug).
10713
366eea36
AD
107142002-06-20 Akim Demaille <akim@epita.fr>
10715
10716 * src/symtab.h, src/symtab.c (symbol_t): printer and
10717 printer_location are new members.
10718 (symbol_printer_set): New.
10719 * src/parse-gram.y (PERCENT_PRINTER): New token.
10720 Handle its associated rule.
10721 * src/scan-gram.l: Adjust.
10722 (handle_destructor_at, handle_destructor_dollar): Rename as...
10723 (handle_symbol_code_at, handle_symbol_code_dollar): these.
10724 * src/output.c (symbol_printers_output): New.
10725 (output_skeleton): Call it.
10726 * data/bison.simple (yysymprint): New. Cannot be named yyprint
10727 since there are already many grammar files with a user `yyprint'.
10728 Replace the calls to YYPRINT to calls to yysymprint.
10729 * tests/calc.at: Adjust.
10730 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
10731 taking advantage of parser very internal details (stack size!).
10732
4f25ebb0
AD
107332002-06-20 Akim Demaille <akim@epita.fr>
10734
10735 * src/scan-gram.l: Complete the scanner with the missing patterns
10736 to pacify Flex.
10737 Use `quote' and `symbol_tag_get' where appropriate.
10738
93b68a0e
AD
107392002-06-19 Akim Demaille <akim@epita.fr>
10740
10741 * tests/actions.at (Destructors): Augment to test locations.
10742 * data/bison.simple (yydestructor): Pass it the current location
10743 if locations are enabled.
10744 Prototype only when __STDC__ or C++.
10745 Change the argument names to move into the yy name space: there is
10746 user code here.
10747
58612f1d
AD
107482002-06-19 Akim Demaille <akim@epita.fr>
10749
74310291
AD
10750 * data/bison.simple (b4_pure_if): New.
10751 Use it instead of #ifdef YYPURE.
10752
107532002-06-19 Akim Demaille <akim@epita.fr>
10754
10755 * data/bison.simple (b4_location_if): New.
58612f1d
AD
10756 Use it instead of #ifdef YYLSP_NEEDED.
10757
f25bfb75
AD
107582002-06-19 Akim Demaille <akim@epita.fr>
10759
10760 Prepare @$ in %destructor, but currently don't bind it in the
10761 skeleton, as %location use is not cleaned up yet.
10762
10763 * src/scan-gram.l (handle_dollar, handle_destructor_at)
10764 (handle_action_at): New.
10765 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
10766 a braced_code_t and a location as additional arguments.
10767 (handle_destructor_dollar): Instead of requiring `b4_eval', just
10768 unquote one when outputting `b4_dollar_dollar'.
10769 Adjust callers.
10770 * data/bison.simple (b4_eval): Remove.
10771 (b4_symbol_destructor): Adjust.
10772 * tests/input.at (Invalid @n): Adjust.
10773
c732d2c6
AD
107742002-06-19 Zack Weinberg <zack@codesourcery.com>
10775
10776 * doc/bison.texinfo: Document ability to have multiple
10777 prologue sections.
10778
8c165d89
AD
107792002-06-18 Akim Demaille <akim@epita.fr>
10780
10781 * src/files.c (compute_base_names): When computing the output file
10782 names from the input file name, strip the directory part.
10783
ca98bf57
AD
107842002-06-18 Akim Demaille <akim@epita.fr>
10785
10786 * data/bison.simple.new: Comment changes.
10787 Reported by Andreas Schwab.
10788
0bfb02ff
AD
107892002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
10790
10791 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
10792 there are no `label `yyoverflowlab' defined but not used' warnings
10793 when yyoverflow is defined.
10794
24c0aad7
AD
107952002-06-18 Akim Demaille <akim@epita.fr>
10796
10797 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
10798 new member.
10799 (symbol_destructor_set): Adjust.
10800 * src/output.c (symbol_destructors_output): Output the destructor
10801 locations.
10802 Output the symbol name.
10803 * data/bison.simple (b4_symbol_destructor): Adjust.
10804
5719c109
AD
108052002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
10806 and Akim Demaille <akim@epita.fr>
10807
10808 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
10809 what's left on the stack when the error recovery hits EOF.
10810 * tests/actions.at (Destructors): Complete to exercise this case.
10811
9280d3ef
AD
108122002-06-17 Akim Demaille <akim@epita.fr>
10813
10814 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
10815 arguments is really empty, not only equal to `[]'.
10816 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
10817 member.
10818 (symbol_destructor_set): New.
10819 * src/output.c (symbol_destructors_output): New.
10820 * src/reader.h (brace_code_t, current_braced_code): New.
10821 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
10822 (handle_dollar): Rename as...
10823 (handle_action_dollar): this.
10824 (handle_destructor_dollar): New.
10825 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
10826 (grammar_declaration): Use it.
10827 * data/bison.simple (yystos): Is always defined.
10828 (yydestructor): New.
10829 * tests/actions.at (Destructors): New.
10830 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
10831
dafdc66f
AD
108322002-06-17 Akim Demaille <akim@epita.fr>
10833
10834 * src/symlist.h, src/symlist.c (symbol_list_length): New.
10835 * src/scan-gram.l (handle_dollar, handle_at): Compute the
10836 rule_length only when needed.
10837 * src/output.c (actions_output, token_definitions_output): Output
10838 the full M4 block.
10839 * src/symtab.c: Don't access directly to the symbol tag, use
10840 symbol_tag_get.
10841 * src/parse-gram.y: Use symbol_list_free.
10842
56c47203
AD
108432002-06-17 Akim Demaille <akim@epita.fr>
10844
10845 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
10846 (symbol_list_prepend, get_type_name): Move to...
10847 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
10848 (symbol_list_prepend, symbol_list_n_type_name_get): here.
10849 Adjust all callers.
10850 (symbol_list_free): New.
10851 * src/scan-gram.l (handle_dollar): Takes a location.
10852 * tests/input.at (Invalid $n): Adjust.
10853
1e0bab92
AD
108542002-06-17 Akim Demaille <akim@epita.fr>
10855
10856 * src/reader.h, src/reader.c (symbol_list_new): Export it.
10857 (symbol_list_prepend): New.
10858 * src/parse-gram.y (%union): `list' is a new member.
10859 (symbols.1): New, replaces...
10860 (terms_to_prec.1, nterms_to_type.1): these.
10861 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
10862 Take a location as additional argument.
10863 Adjust all callers.
10864
04e60654
AD
108652002-06-15 Akim Demaille <akim@epita.fr>
10866
10867 * src/parse-gram.y: Move %token in the declaration section so that
10868 we don't depend upon CVS Bison.
10869
10e5b8bd
AD
108702002-06-15 Akim Demaille <akim@epita.fr>
10871
10872 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
10873 * src/print.c (print_core): Use it.
10874
9801d40c
AD
108752002-06-15 Akim Demaille <akim@epita.fr>
10876
10877 * src/conflicts.c (log_resolution): Accept the rule involved in
10878 the sr conflicts instead of the lookahead number that points to
10879 that rule.
10880 (flush_reduce): Accept the current lookahead vector as argument,
10881 instead of the index in LA.
10882 (resolve_sr_conflict): Accept the current number of lookahead
10883 bitset to consider for the STATE, instead of the index in LA.
10884 (set_conflicts): Adjust.
10885 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
10886
c0263492
AD
108872002-06-15 Akim Demaille <akim@epita.fr>
10888
10889 * src/state.h (state_t): Replace the `lookaheadsp' member, a
10890 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
10891 Adjust all dependencies.
10892 * src/lalr.c (initialize_lookaheads): Split into...
10893 (states_lookaheads_count, states_lookaheads_initialize): these.
10894 (lalr): Adjust.
10895
9757c359
AD
108962002-06-15 Akim Demaille <akim@epita.fr>
10897
10898 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
10899 out of...
10900 (grammar_rules_print): here.
10901 * src/reduce.c (reduce_output): Use it.
10902 * tests/reduce.at (Useless Rules, Reduced Automaton)
10903 (Underivable Rules): Adjust.
10904
6b98e4b5
AD
109052002-06-15 Akim Demaille <akim@epita.fr>
10906
10907 Copy BYacc's nice way to report the grammar.
10908
10909 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
10910 New.
10911 Don't print the rules' location, it is confusing and useless.
10912 (rule_print): Use grammar_rhs_print.
10913 * src/print.c (print_grammar): Use grammar_rules_print.
10914
6b98e4b5
AD
109152002-06-15 Akim Demaille <akim@epita.fr>
10916
10917 Complete and rationalize `useless thing' warnings.
10918
10919 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
10920 (symbol_tag_print): New.
10921 Use them everywhere in place of accessing directly the tag member.
10922 * src/gram.h, src/gram.c (rule_print): New.
10923 Use it where a rule used to be printed `by hand'.
10924 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
10925 (reduce_grammar_tables): Report the useless rules.
10926 (reduce_print): Useless things are a warning, not an error.
10927 Report it as such.
10928 * tests/reduce.at (Useless Nonterminals, Useless Rules):
10929 (Reduced Automaton, Underivable Rules): Adjust.
10930 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
10931 * tests/conflicts.at (Unresolved SR Conflicts)
10932 (Solved SR Conflicts): Adjust.
10933
ee000ba4
AD
109342002-06-15 Akim Demaille <akim@epita.fr>
10935
10936 Let symbols have a location.
10937
10938 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
10939 (getsym): Adjust.
10940 Adjust all callers.
10941 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
10942 Use location_t, not int.
10943 * src/symtab.c (symbol_check_defined): Take advantage of the
10944 location.
10945 * tests/regression.at (Invalid inputs): Adjust.
10946
8efe435c
AD
109472002-06-15 Akim Demaille <akim@epita.fr>
10948
10949 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
10950 (input): Don't try to initialize yylloc here, do it in the
10951 scanner.
10952 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
10953 * src/gram.h (rule_t): Change line and action_line into location
10954 and action_location, of location_t type.
10955 Adjust all dependencies.
10956 * src/location.h, src/location.c (empty_location): New.
10957 * src/reader.h, src/reader.c (grammar_start_symbol_set)
10958 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
10959 (grammar_current_rule_symbol_append)
10960 (grammar_current_rule_action_append): Expect a location as argument.
10961 * src/reader.c (grammar_midrule_action): Adjust to attach an
10962 action's location as dummy symbol location.
10963 * src/symtab.h, src/symtab.c (startsymbol_location): New.
10964 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
10965 the line numbers.
10966
1921f1d7
AD
109672002-06-14 Akim Demaille <akim@epita.fr>
10968
10969 Grammar declarations may be found in the grammar section.
10970
10971 * src/parse-gram.y (rules_or_grammar_declaration): New.
10972 (declarations): Each declaration may end with a semicolon, not
10973 just...
10974 (grammar_declaration): `"%union"'.
10975 (grammar): Branch to rules_or_grammar_declaration.
10976
4515534c
AD
109772002-06-14 Akim Demaille <akim@epita.fr>
10978
10979 * src/main.c (main): Invoke scanner_free.
10980
f958596b
AD
109812002-06-14 Akim Demaille <akim@epita.fr>
10982
10983 * src/output.c (m4_invoke): Extracted from...
10984 (output_skeleton): here.
10985 Free tempfile.
10986
2c569025
AD
109872002-06-14 Akim Demaille <akim@epita.fr>
10988
10989 * src/parse-gram.y (directives, directive, gram)
10990 (grammar_directives, precedence_directives, precedence_directive):
10991 Rename as...
10992 (declarations, declaration, grammar, grammar_declaration)
10993 (precedence_declaration, precedence_declarator): these.
10994 (symbol_declaration): New.
10995
592e8d4d
AD
109962002-06-14 Akim Demaille <akim@epita.fr>
10997
10998 * src/files.c (action_obstack): Remove, unused.
10999 (output_obstack): Remove it, and all its dependencies, as it is no
11000 longer needed.
11001 * src/reader.c (epilogue_set): Build the epilogue in the
11002 muscle_obstack.
11003 * src/output.h, src/output.c (muscle_obstack): Move to...
11004 * src/muscle_tab.h, src/muscle_tab.h: here.
11005 (muscle_init): Initialize muscle_obstack.
11006 (muscle_free): New.
11007 * src/main.c (main): Call it.
11008
0c15323d
AD
110092002-06-14 Akim Demaille <akim@epita.fr>
11010
11011 * src/location.h: New, extracted from...
11012 * src/reader.h: here.
11013 * src/Makefile.am (noinst_HEADERS): Merge into
11014 (bison_SOURCES): this.
11015 Add location.h.
11016 * src/parse-gram.y: Use location_t instead of Bison's.
11017 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
11018 Use location_t instead of ints.
11019
e96c9728
AD
110202002-06-14 Akim Demaille <akim@epita.fr>
11021
11022 * data/bison.simple, data/bison.c++: Be sure to restore the
11023 current #line when returning to the skeleton contents after having
11024 exposed the input file's #line.
11025
75d1fe16
AD
110262002-06-12 Akim Demaille <akim@epita.fr>
11027
11028 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
11029 eager.
11030 * tests/actions.at (Exotic Dollars): New.
11031
6c35d22c
AD
110322002-06-12 Akim Demaille <akim@epita.fr>
11033
11034 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
11035 ['"/] too eagerly.
11036 * tests/input.at (Torturing the Scanner): New.
11037
1d6412ad
AD
110382002-06-11 Akim Demaille <akim@epita.fr>
11039
11040 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
11041 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
11042 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
11043 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
11044 * src/reader.c (reader): Use it.
11045
4cdb01db
AD
110462002-06-11 Akim Demaille <akim@epita.fr>
11047
11048 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
11049 Adjust all callers.
11050 (scanner_last_string_free): New.
11051
44995b2e
AD
110522002-06-11 Akim Demaille <akim@epita.fr>
11053
11054 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
11055 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
11056 (last_string, YY_OBS_FREE): New.
11057 Use them when returning an ID.
11058
e9955c83
AD
110592002-06-11 Akim Demaille <akim@epita.fr>
11060
11061 Have Bison grammars parsed by a Bison grammar.
11062
11063 * src/reader.c, src/reader.h (prologue_augment): New.
11064 * src/reader.c (copy_definition): Remove.
11065
11066 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
11067 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
11068 (grammar_current_rule_prec_set, grammar_current_rule_check)
11069 (grammar_current_rule_symbol_append)
11070 (grammar_current_rule_action_append): Export.
11071 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
11072 (symbol_list_action_append): Remove.
11073 Hook the routines from reader.
11074 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
11075 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
11076
11077 * src/reader.c (read_declarations): Remove, unused.
11078
11079 * src/parse-gram.y: Handle the epilogue.
11080 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
11081 (grammar_start_symbol_set): this.
11082 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
11083 * src/reader.c (readgram): Remove, unused.
11084 (reader): Adjust to insert eoftoken and axiom where appropriate.
11085
11086 * src/reader.c (copy_dollar): Replace with...
11087 * src/scan-gram.h (handle_dollar): this.
11088 * src/parse-gram.y: Remove `%thong'.
11089
11090 * src/reader.c (copy_at): Replace with...
11091 * src/scan-gram.h (handle_at): this.
11092
11093 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
11094 New.
11095
11096 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
11097 time being.
11098
11099 * src/reader.h, src/reader.c (grammar_rule_end): New.
11100
11101 * src/parse.y (current_type, current_class): New.
11102 Implement `%nterm', `%token' support.
11103 Merge `%term' into `%token'.
11104 (string_as_id): New.
11105 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
11106 type name.
11107
11108 * src/parse-gram.y: Be sure to handle properly the beginning of
11109 rules.
11110
11111 * src/parse-gram.y: Handle %type.
11112 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
11113
11114 * src/parse-gram.y: More directives support.
11115 * src/options.c: No longer handle source directives.
11116
11117 * src/parse-gram.y: Fix %output.
11118
11119 * src/parse-gram.y: Handle %union.
11120 Use the prologue locations.
11121 * src/reader.c (parse_union_decl): Remove.
11122
11123 * src/reader.h, src/reader.c (epilogue_set): New.
11124 * src/parse-gram.y: Use it.
11125
11126 * data/bison.simple, data/bison.c++: b4_stype is now either not
11127 defined, then default to int, or to the contents of %union,
11128 without `union' itself.
11129 Adjust.
11130 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
11131
11132 * src/output.c (actions_output): Don't output braces, as they are
11133 already handled by the scanner.
11134
11135 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
11136 characters to themselves.
11137
11138 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
11139 that the epilogue has a proper #line.
11140
11141 * src/parse-gram.y: Handle precedence/associativity.
11142
11143 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
11144 a terminal.
11145 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
11146 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
11147 at all to define terminals that cannot be emitted.
11148
11149 * src/scan-gram.l: Escape M4 characters.
11150
11151 * src/scan-gram.l: Working properly with escapes in user
11152 strings/characters.
11153
11154 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
11155 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
11156 grammar.
11157 Use more modest sizes, as for the time being the parser does not
11158 release memory, and therefore the process swallows a huge amount
11159 of memory.
11160
11161 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
11162 stricter %token grammar.
11163
11164 * src/symtab.h (associativity): Add `undef_assoc'.
11165 (symbol_precedence_set): Do nothing when passed an undef_assoc.
11166 * src/symtab.c (symbol_check_alias_consistence): Adjust.
11167
11168 * tests/regression.at (Invalid %directive): Remove, as it is now
11169 meaningless.
11170 (Invalid inputs): Adjust to the new error messages.
11171 (Token definitions): The new grammar doesn't allow too many
11172 eccentricities.
11173
11174 * src/lex.h, src/lex.c: Remove.
11175 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
11176 (copy_character, copy_string2, copy_string, copy_identifier)
11177 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
11178 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
11179 (parse_action): Remove.
11180 * po/POTFILES.in: Adjust.
11181
2e047461
AD
111822002-06-11 Akim Demaille <akim@epita.fr>
11183
cd05d13c 11184 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
11185 rule's action member: return the action as a string.
11186 Don't require `rule_length' as an argument: compute it.
11187 (grammar_current_rule_symbol_append)
11188 (grammar_current_rule_action_append): New, eved out from
11189 (readgram): here.
11190 Remove `action_flag', `rulelength', unused now.
11191
9af3fbce
AD
111922002-06-11 Akim Demaille <akim@epita.fr>
11193
11194 * src/reader.c (grammar_current_rule_prec_set).
11195 (grammar_current_rule_check): New, eved out from...
11196 (readgram): here.
11197 Remove `xaction', `first_rhs': useless.
11198 * tests/input.at (Type clashes): New.
11199 * tests/existing.at (GNU Cim Grammar): Adjust.
11200
1485e106
AD
112012002-06-11 Akim Demaille <akim@epita.fr>
11202
11203 * src/reader.c (grammar_midrule_action): New, Eved out from
11204 (readgram): here.
11205
da4160c3
AD
112062002-06-11 Akim Demaille <akim@epita.fr>
11207
11208 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
11209 New.
11210 (readgram): Use them as replacement of inlined code, crule and
11211 crule1.
11212
f6d0f937
AD
112132002-06-11 Akim Demaille <akim@epita.fr>
11214
11215 * src/reader.c (grammar_end, grammar_symbol_append): New.
11216 (readgram): Use them.
11217 Make the use of `p' as local as possible.
11218
69078d4b
AD
112192002-06-10 Akim Demaille <akim@epita.fr>
11220
11221 GCJ's parser requires the tokens to be defined before the prologue.
11222
11223 * data/bison.simple: Output the token definition before the user's
11224 prologue.
11225 * tests/regression.at (Braces parsing, Duplicate string)
11226 (Mixing %token styles): Check the output from bison.
11227 (Early token definitions): New.
11228
5e424082
AD
112292002-06-10 Akim Demaille <akim@epita.fr>
11230
11231 * src/symtab.c (symbol_user_token_number_set): Don't complain when
11232 assigning twice the same user number to a token, so that we can
11233 use it in...
11234 * src/lex.c (lex): here.
11235 Also use `symbol_class_set' instead of hand written code.
11236 * src/reader.c (parse_assoc_decl): Likewise.
11237
44536b35
AD
112382002-06-10 Akim Demaille <akim@epita.fr>
11239
11240 * src/symtab.c, src/symtab.c (symbol_class_set)
11241 (symbol_user_token_number_set): New.
11242 * src/reader.c (parse_token_decl): Use them.
11243 Use a switch instead of ifs.
11244 Use a single argument.
11245
8b9f2372
AD
112462002-06-10 Akim Demaille <akim@epita.fr>
11247
11248 Remove `%thong' support as it is undocumented, unused, duplicates
11249 `%token's job, and creates useless e-mail traffic with people who
11250 want to know what it is, why it is undocumented, unused, and
11251 duplicates `%token's job.
11252
11253 * src/reader.c (parse_thong_decl): Remove.
11254 * src/options.c (option_table): Remove "thong".
11255 * src/lex.h (tok_thong): Remove.
11256
3ae2b51f
AD
112572002-06-10 Akim Demaille <akim@epita.fr>
11258
11259 * src/symtab.c, src/symtab.c (symbol_type_set)
11260 (symbol_precedence_set): New.
11261 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
11262 (value_components_used): Remove, unused.
11263
2f1afb73
AD
112642002-06-09 Akim Demaille <akim@epita.fr>
11265
11266 Move symbols handling code out of the reader.
11267
11268 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
11269 (axiom): Move to...
11270 * src/symtab.h, src/symtab.c: here.
11271
11272 * src/gram.c (start_symbol): Remove: use startsymbol->number.
11273 * src/reader.c (startval): Rename as...
11274 * src/symtab.h, src/symtab.c (startsymbol): this.
11275 * src/reader.c: Adjust.
11276
11277 * src/reader.c (symbol_check_defined, symbol_make_alias)
11278 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11279 (token_translations_init)
11280 Move to...
11281 * src/symtab.c: here.
11282 * src/reader.c (packsymbols): Move to...
11283 * src/symtab.h, src/symtab.c (symbols_pack): here.
11284 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
11285 argument.
11286
e9bca3ad
AD
112872002-06-03 Akim Demaille <akim@epita.fr>
11288
11289 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
11290 then statements.
11291
86eff183
AD
112922002-06-03 Akim Demaille <akim@epita.fr>
11293
11294 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
11295 structs with non literals.
11296 * src/scan-skel.l: never-interactive.
11297 * src/conflicts.c (enum conflict_resolution_e): No trailing
11298 comma.
11299 * src/getargs.c (usage): Split long literal strings.
11300 Reported by Hans Aberg.
11301
717be197
AD
113022002-05-28 Akim Demaille <akim@epita.fr>
11303
11304 * data/bison.c++: Use C++ ostreams.
11305 (cdebug_): New member.
11306
670ddffd
AD
113072002-05-28 Akim Demaille <akim@epita.fr>
11308
11309 * src/output.c (output_skeleton): Be sure to allocate enough room
11310 for `/' _and_ for `\0' in full_skeleton.
11311
769b430f
AD
113122002-05-28 Akim Demaille <akim@epita.fr>
11313
11314 * data/bison.c++: Catch up with bison.simple:
11315 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11316 and Paul Eggert <eggert@twinsun.com>: `error' handing.
11317 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
11318 and popping traces.
11319
7067cb36
PH
113202002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11321
11322 * src/output.c (output_skeleton): Put an explicit path in front of
11323 the skeleton file name, rather than relying on the -I directory,
11324 to partially alleviate effects of having a skeleton file lying around
11325 in the current directory.
769b430f 11326
4a713ec2
PH
113272002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11328
769b430f 11329 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
11330 obstack_printf should be obstack_fgrow1.
11331
b408954b
AD
113322002-05-26 Akim Demaille <akim@epita.fr>
11333
11334 * src/state.h (state_t): `solved_conflicts' is a new member.
11335 * src/LR0.c (new_state): Set it to 0.
11336 * src/conflicts.h, src/conflicts.c (print_conflicts)
11337 (free_conflicts, solve_conflicts): Rename as...
11338 (conflicts_print, conflicts_free, conflicts_solve): these.
11339 Adjust callers.
11340 * src/conflicts.c (enum conflict_resolution_e)
11341 (solved_conflicts_obstack): New, used by...
11342 (log_resolution): this.
11343 Adjust to attach the conflict resolution to each state.
11344 Complete the description with the precedence/associativity
11345 information.
11346 (resolve_sr_conflict): Adjust.
11347 * src/print.c (print_state): Output its solved_conflicts.
11348 * tests/conflicts.at (Unresolved SR Conflicts)
11349 (Solved SR Conflicts): Exercise --report=all.
11350
a49aecd5
AD
113512002-05-26 Akim Demaille <akim@epita.fr>
11352
11353 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
11354 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
11355 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
11356 (token_number_t, item_number_as_token_number)
11357 (token_number_as_item_number, muscle_insert_token_number_table):
11358 Rename as...
11359 (symbol_number_t, item_number_as_symbol_number)
11360 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
11361 these, since it is more appropriate.
11362
5504898e
AD
113632002-05-26 Akim Demaille <akim@epita.fr>
11364
11365 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
11366 `Error:' lines.
11367 * data/bison.simple (yystos) [YYDEBUG]: New.
11368 (yyparse) [YYDEBUG]: Display the symbols which are popped during
11369 error recovery.
11370 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
11371
ec3bc396
AD
113722002-05-25 Akim Demaille <akim@epita.fr>
11373
11374 * doc/bison.texinfo (Debugging): Split into...
11375 (Tracing): this new section, its former contents, and...
11376 (Understanding): this new section.
11377 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
11378 by...
11379 (report_flag): this.
11380 Adjust all dependencies.
11381 (report_args, report_types, report_argmatch): New.
11382 (usage, getargs): Report/support -r, --report.
11383 * src/options.h
11384 (struct option_table_struct): Rename as..,
11385 (struct option_table_s): this.
11386 Rename the `set_flag' member to `flag' to match with getopt_long's
11387 struct.
11388 * src/options.c (option_table): Split verbose into an entry for
11389 %verbose, and another for --verbose.
11390 Support --report/-r, so remove -r from the obsolete --raw.
11391 * src/print.c: Attach full item sets and lookaheads reports to
11392 report_flag instead of trace_flag.
11393 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
11394
78df8250
PE
113952002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11396 and Paul Eggert <eggert@twinsun.com>
769b430f 11397
78df8250
PE
11398 * data/bison.simple (yyparse): Correct error handling to conform to
11399 POSIX and yacc. Specifically, after syntax error is discovered,
11400 do not reduce further before shifting the error token.
11401 Clean up the code a bit by removing the labels yyerrdefault,
11402 yyerrhandle, yyerrpop.
11403 * NEWS: Document the above.
11404
c0c9ea05
PH
114052002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11406
11407 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
11408 type; it isn't always big enough, since it doesn't necessarily
11409 include non-terminals.
769b430f 11410 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
11411 the latter can be removed.
11412 (yy_token_number_type): Remove, only one use.
11413 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
11414 don't use TokenNumberType as element type.
769b430f 11415
c0c9ea05
PH
11416 * tests/regression.at: Modify expected output to agree with change
11417 to yyr1 and yytranslate.
769b430f 11418
6390a83f
FK
114192002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
11420
11421 * src/reader.c (parse_action): Use copy_character instead of
11422 obstack_1grow.
11423
db7c8e9a
AD
114242002-05-13 Akim Demaille <akim@epita.fr>
11425
11426 * tests/regression.at (Token definitions): Prototype yylex and
11427 yyerror.
11428
fcc61800
PH
114292002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11430
158c687b 11431 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
11432 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
11433 32-bit arithmetic.
11434 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
11435
5683e9b2
AD
114362002-05-07 Akim Demaille <akim@epita.fr>
11437
11438 * tests/synclines.at: Be sure to prototype yylex and yyerror to
11439 avoid GCC warnings.
11440
0c2d3f4c
AD
114412002-05-07 Akim Demaille <akim@epita.fr>
11442
11443 Kill GCC warnings.
11444
11445 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
11446 over the RHS of each rule.
11447 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
11448 * src/state.h (state_t): Member `nitems' is unsigned short.
11449 * src/LR0.c (get_state): Adjust.
11450 * src/reader.c (packgram): Likewise.
11451 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
11452 `Type'.
11453 (muscle_insert_int_table): Remove, unused.
11454 (prepare_rules): Remove `max'.
11455
1565b720
AD
114562002-05-06 Akim Demaille <akim@epita.fr>
11457
11458 * src/closure.c (print_firsts): Display of the symbol tags.
11459 (bitmatrix_print): Move to...
11460 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
11461 here.
11462 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
11463
cfaee611
AD
114642002-05-06 Akim Demaille <akim@epita.fr>
11465
11466 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
11467 hash_do_for_each.
11468
458be8e0
AD
114692002-05-06 Akim Demaille <akim@epita.fr>
11470
11471 * src/LR0.c (new_state, get_state): Instead of using the global
11472 `kernel_size' and `kernel_base', have two new arguments:
11473 `core_size' and `core'.
11474 Adjust callers.
11475
a900a624
AD
114762002-05-06 Akim Demaille <akim@epita.fr>
11477
11478 * src/reader.c (packgram): No longer end `ritem' with a 0
11479 sentinel: it is not used.
11480
d4e7d3a1
AD
114812002-05-05 Akim Demaille <akim@epita.fr>
11482
11483 New experimental feature: display the lookaheads in the report and
11484 graph.
11485
11486 * src/print (print_core): When --trace-flag, display the rules
11487 lookaheads.
11488 * src/print_graph.c (print_core): Likewise.
11489 Swap the arguments.
11490 Adjust caller.
11491
39ceb25b
AD
114922002-05-05 Akim Demaille <akim@epita.fr>
11493
11494 * tests/torture.at (Many lookaheads): New test.
11495
5372019f
AD
114962002-05-05 Akim Demaille <akim@epita.fr>
11497
11498 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
11499 (GENERATE_MUSCLE_INSERT_TABLE): this.
11500 (output_int_table, output_unsigned_int_table, output_short_table)
11501 (output_token_number_table, output_item_number_table): Replace with...
11502 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
11503 (muscle_insert_short_table, muscle_insert_token_number_table)
11504 (muscle_insert_item_number_table): these.
11505 Adjust all callers.
11506 (prepare_tokens): Don't free `translations', since...
11507 * src/reader.h, src/reader.c (grammar_free): do it.
11508 Move to...
11509 * src/gram.h, src/gram.c (grammar_free): here.
11510 * data/bison.simple, data/bison.c++: b4_token_number_max is now
11511 b4_translate_max.
11512
5df5f6d5
AD
115132002-05-05 Akim Demaille <akim@epita.fr>
11514
11515 * src/output.c (output_unsigned_int_table): New.
11516 (prepare_rules): `i' is unsigned.
11517 `prhs', `rline', `r2' are unsigned int.
11518 Rename muscle `rhs_number_max' as `rhs_max'.
11519 Output muscles `prhs_max', `rline_max', and `r2_max'.
11520 Free rline and r1.
11521 * data/bison.simple, data/bison.c++: Adjust to use these muscles
11522 to compute types instead of constant types.
11523 * tests/regression.at (Web2c Actions): Adjust.
11524
b87f8b21
AD
115252002-05-04 Akim Demaille <akim@epita.fr>
11526
11527 * src/symtab.h (SALIAS, SUNDEF): Rename as...
11528 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
11529 Adjust dependencies.
11530 * src/output.c (token_definitions_output): Be sure not to output a
11531 `#define 'a'' when fed with `%token 'a' "a"'.
11532 * tests/regression.at (Token definitions): New.
11533
8bb936e4
PE
115342002-05-03 Paul Eggert <eggert@twinsun.com>
11535
11536 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
11537 for K&R C.
11538
115392002-05-03 gettextize <bug-gnu-gettext@gnu.org>
11540
11541 * Makefile.am (SUBDIRS): Remove intl.
11542 (EXTRA_DIST): Add config/config.rpath.
11543
53c71a12
AD
115442002-05-03 Akim Demaille <akim@epita.fr>
11545
11546 * data/bison.simple (m4_if): Don't output empty enums.
11547 And actually, output valid enum definitions :(.
11548
289dd0cf
AD
115492002-05-03 Akim Demaille <akim@epita.fr>
11550
11551 * configure.bat: Remove, completely obsolete.
11552 * Makefile.am (EXTRA_DIST): Adjust.
11553 Don't distribute config.rpath...
11554 * config/Makefile.am (EXTRA_DIST): Do it.
11555
db85e524
AD
115562002-05-03 Akim Demaille <akim@epita.fr>
11557
11558 * configure.in (GETTEXT_VERSION): New.
11559 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
11560
83ccf991
AD
115612002-05-03 Akim Demaille <akim@epita.fr>
11562
11563 * data/bison.simple (b4_token_enum): New.
11564 (b4_token_defines): Use it to output tokens both as #define and
11565 enums.
11566 Suggested by Paul Eggert.
11567 * src/output.c (token_definitions_output): Don't output spurious
11568 white spaces.
11569
1f418995
AD
115702002-05-03 Akim Demaille <akim@epita.fr>
11571
11572 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
11573
45119f04
RA
115742002-05-02 Robert Anisko <robert@lrde.epita.fr>
11575
11576 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
11577 Update the stack class, give a try to deque as the default container.
11578
b2d52318
AD
115792002-05-02 Akim Demaille <akim@epita.fr>
11580
11581 * data/bison.simple (yyparse): Do not implement @$ = @1.
11582 (YYLLOC_DEFAULT): Adjust to do it.
11583 * doc/bison.texinfo (Location Default Action): Fix.
11584
3a8b4109
AD
115852002-05-02 Akim Demaille <akim@epita.fr>
11586
11587 * src/reader.c (parse_braces): Merge into...
11588 (parse_action): this.
11589
84614e13
AD
115902002-05-02 Akim Demaille <akim@epita.fr>
11591
11592 * configure.in (ALL_LINGUAS): Remove.
11593 * po/LINGUAS, hr.po: New.
11594
fdbcd8e2
AD
115952002-05-02 Akim Demaille <akim@epita.fr>
11596
11597 Remove the so called hairy (semantic) parsers.
11598
11599 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
11600 * src/gram.h, src/gram.c (semantic_parser): Remove.
11601 (rule_t): Remove the guard and guard_line members.
11602 * src/lex.h (token_t): remove tok_guard.
11603 * src/options.c (option_table): Remove %guard and %semantic_parser
11604 support.
11605 * src/output.c, src/output.h (guards_output): Remove.
11606 (prepare): Adjust.
11607 (token_definitions_output): Don't output the `T'
11608 tokens (???).
11609 (output_skeleton): Don't output the guards.
11610 * src/files.c, src/files.c (attrsfile): Remove.
11611 * src/reader.c (symbol_list): Remove the guard and guard_line
11612 members.
11613 Adjust dependencies.
11614 (parse_guard): Remove.
11615 * data/bison.hairy: Remove.
11616 * doc/bison.texinfo (Environment Variables): Remove occurrences of
11617 BISON_HAIRY.
11618
82b6cb3f
AD
116192002-05-02 Akim Demaille <akim@epita.fr>
11620
11621 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
11622 (parse_guard): Rename the formal argument `stack_offset' as
11623 `rule_length', which is more readable.
11624 Adjust callers.
11625 (copy_at, copy_dollar): Instead of outputting the hard coded
11626 values of $$, $n and so forth, output invocation to b4_lhs_value,
11627 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
11628 Note: this patch partially drops `semantic-parser' support: it
11629 always does `rule_length - n', where semantic parsers ought to
11630 always use `-n'.
82b6cb3f
AD
11631 * data/bison.simple, data/bison.c++ (b4_lhs_value)
11632 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
11633
6cbfbcc5
AD
116342002-05-02 Akim Demaille <akim@epita.fr>
11635
11636 * configure.in (AC_INIT): Bump to 1.49b.
11637 (AM_INIT_AUTOMAKE): Short invocation.
11638
b8548114
AD
116392002-05-02 Akim Demaille <akim@epita.fr>
11640
11641 Version 1.49a.
11642
c20cd1fa
AD
116432002-05-01 Akim Demaille <akim@epita.fr>
11644
11645 * src/skeleton.h: Remove.
11646
8a9566d4
AD
116472002-05-01 Akim Demaille <akim@epita.fr>
11648
11649 * src/skeleton.h: Fix the #endif.
11650 Reported by Magnus Fromreide.
11651
8c6d399a
PE
116522002-04-26 Paul Eggert <eggert@twinsun.com>
11653
11654 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
11655 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 11656 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 11657
2b7ed18a
RA
116582002-04-25 Robert Anisko <robert@lrde.epita.fr>
11659
11660 * src/scan-skel.l: Postprocess quadrigraphs.
11661
11662 * src/reader.c (copy_character): New function, used to output
11663 single characters while replacing `[' and `]' with quadrigraphs, to
11664 avoid troubles with M4 quotes.
11665 (copy_comment): Output characters with copy_character.
11666 (read_additionnal_code): Likewise.
11667 (copy_string2): Likewise.
11668 (copy_definition): Likewise.
11669
11670 * tests/calc.at: Exercise M4 quoting.
11671
34a89c50
AD
116722002-04-25 Akim Demaille <akim@epita.fr>
11673
11674 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
11675 between `!' and the command.
11676 Reported by Paul Eggert.
11677
0dd1580a
RA
116782002-04-24 Robert Anisko <robert@lrde.epita.fr>
11679
11680 * tests/calc.at: Exercise prologue splitting.
11681
11682 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
11683 `b4_post_prologue' instead of `b4_prologue'.
11684
11685 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
11686 muscles.
11687 (output): Free pre_prologue_obstack and post_prologue_obstack.
11688 * src/files.h, src/files.c (attrs_obstack): Remove.
11689 (pre_prologue_obstack, post_prologue_obstack): New.
11690 * src/reader.c (copy_definition): Add a parameter to specify the
11691 obstack to fill, instead of using attrs_obstack unconditionally.
11692 (read_declarations): Pass pre_prologue_obstack to copy_definition if
11693 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
11694
83c1796f
PE
116952002-04-23 Paul Eggert <eggert@twinsun.com>
11696
11697 * data/bison.simple: Remove unnecessary commentary and white
11698 space differences from 1_29-branch.
11699 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
11700
11701 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
11702 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
11703 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
11704 constructors or destructors.
11705
11706 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
11707
1207eeac
AD
117082002-04-23 Akim Demaille <akim@epita.fr>
11709
11710 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
11711 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
11712 location with columns.
11713 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
11714 All reported by Paul Eggert.
11715
78ab8f67
AD
117162002-04-22 Akim Demaille <akim@epita.fr>
11717
11718 * src/reduce.c (dump_grammar): Move to...
11719 * src/gram.h, src/gram.c (grammar_dump): here.
11720 Be sure to separate long item numbers.
11721 Don't read the members of a rule's prec if its nil.
11722
133c20e2
AD
117232002-04-22 Akim Demaille <akim@epita.fr>
11724
11725 * src/output.c (table_size, table_grow): New.
11726 (MAXTABLE): Remove, replace uses with table_size.
11727 (pack_vector): Instead of dying when the table is too big, grow it.
11728
9515e8a7
AD
117292002-04-22 Akim Demaille <akim@epita.fr>
11730
11731 * data/bison.simple (yyr1): Its type is that of a token number.
11732 * data/bison.c++ (r1_): Likewise.
11733 * tests/regression.at (Web2c Actions): Adjust.
11734
23c5a174
AD
117352002-04-22 Akim Demaille <akim@epita.fr>
11736
11737 * src/reader.c (token_translations_init): 256 is now the default
11738 value for the error token, i.e., it will be assigned another
11739 number if the user assigned 256 to one of her tokens.
11740 (reader): Don't force 256 to error.
11741 * doc/bison.texinfo (Symbols): Adjust.
11742 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
11743 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
11744 etc. instead of 10, 20, 30 (which was used to `jump' over error
11745 (256) and undefined (2)).
11746
5fbb0954
AD
117472002-04-22 Akim Demaille <akim@epita.fr>
11748
11749 Propagate more token_number_t.
11750
11751 * src/gram.h (token_number_as_item_number)
11752 (item_number_as_token_number): New.
11753 * src/output.c (GENERATE_OUTPUT_TABLE): New.
11754 Use it to create output_item_number_table and
11755 output_token_number_table.
11756 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
11757 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
11758 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
11759 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
11760
4f940944
AD
117612002-04-22 Akim Demaille <akim@epita.fr>
11762
11763 * src/output.h, src/output.c (get_lines_number): Remove.
11764
3ded9a63
AD
117652002-04-19 Akim Demaille <akim@epita.fr>
11766
11767 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
11768 as Lex/Flex'.
11769 (Debugging): More details about enabling the debugging features.
11770 (Table of Symbols): Describe $$, $n, @$, and @n.
11771 Suggested by Tim Josling.
11772
e0c471a9
AD
117732002-04-19 Akim Demaille <akim@epita.fr>
11774
11775 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
11776
fecc10cd
AD
117772002-04-10 Akim Demaille <akim@epita.fr>
11778
11779 * src/system.h: Rely on HAVE_LIMITS_H.
11780 Suggested by Paul Eggert.
11781
51dec47b
AD
117822002-04-09 Akim Demaille <akim@epita.fr>
11783
11784 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
11785 full stderr, and strip it according to the bison options, instead
11786 of composing the error message from different bits.
11787 This makes it easier to check for several error messages.
11788 Adjust all the invocations.
11789 Add an invocation exercising the error token.
11790 Add an invocation demonstrating a stupid error message.
11791 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
11792 Adjust the tests.
11793 Error message are for stderr, not stdout.
11794
007a50a4
AD
117952002-04-09 Akim Demaille <akim@epita.fr>
11796
11797 * src/gram.h, src/gram.c (error_token_number): Remove, use
11798 errtoken->number.
11799 * src/reader.c (reader): Don't specify the user token number (2)
11800 for $undefined, as it uselessly prevents using it.
11801 * src/gram.h (token_number_t): Move to...
11802 * src/symtab.h: here.
11803 (state_t.number): Is a token_number_t.
11804 * src/print.c, src/reader.c: Use undeftoken->number instead of
11805 hard coded 2.
11806 (Even though this 2 is not the same as above: the number of the
11807 undeftoken remains being 2, it is its user token number which
11808 might not be 2).
11809 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
11810 `user_token_number_max'.
11811 Output `undef_token_number'.
11812 * data/bison.simple, data/bison.c++: Use them.
11813 Be sure to map invalid yylex return values to
11814 `undef_token_number'. This saves us from gratuitous SEGV.
11815
11816 * tests/conflicts.at (Solved SR Conflicts)
11817 (Unresolved SR Conflicts): Adjust.
11818 * tests/regression.at (Web2c Actions): Adjust.
11819
06446ccf
AD
118202002-04-08 Akim Demaille <akim@epita.fr>
11821
11822 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
11823 Adding #line.
11824 Remove the duplicate `typedefs'.
11825 (RhsNumberType): Fix the declaration and various other typos.
11826 Use __ofile__.
11827 * data/bison.simple: Use __ofile__.
11828 * src/scan-skel.l: Handle __ofile__.
11829
62a3e4f0
AD
118302002-04-08 Akim Demaille <akim@epita.fr>
11831
11832 * src/gram.h (item_number_t): New, the type of item numbers in
11833 RITEM. Note that it must be able to code symbol numbers as
11834 positive number, and the negation of rule numbers as negative
11835 numbers.
11836 Adjust all dependencies (pretty many).
11837 * src/reduce.c (rule): Remove this `short *' pointer: use
11838 item_number_t.
11839 * src/system.h (MINSHORT, MAXSHORT): Remove.
11840 Include `limits.h'.
11841 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
11842 (shortcpy): Remove.
11843 (MAXTABLE): Move to...
11844 * src/output.c (MAXTABLE): here.
11845 (prepare_rules): Use output_int_table to output rhs.
11846 * data/bison.simple, data/bison.c++: Adjust.
11847 * tests/torture.at (Big triangle): Move the limit from 254 to
11848 500.
11849 * tests/regression.at (Web2c Actions): Ajust.
11850
11851 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
11852 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
11853 passes, but produces negative #line number, once fixed, GCC is
11854 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
11855 C), it passes.
11856 * src/state.h (state_h): Code input lines on ints, not shorts.
11857
bb88b0fc
AD
118582002-04-08 Akim Demaille <akim@epita.fr>
11859
11860 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
11861 and then the grammar.
11862
9a636f47
AD
118632002-04-08 Akim Demaille <akim@epita.fr>
11864
11865 * src/system.h: No longer using strndup.
11866
680e8701
AD
118672002-04-07 Akim Demaille <akim@epita.fr>
11868
11869 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
11870 * src/output.c (output_table_data): Return the longest number.
11871 (prepare_tokens): Output `token_number_max').
11872 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
11873 New.
11874 Use them to define yy_token_number_type/TokenNumberType.
11875 Use this type for yytranslate.
11876 * tests/torture.at (Big triangle): Push the limit from 124 to
11877 253.
11878 * tests/regression.at (Web2c Actions): Adjust.
11879
817e9f41
AD
118802002-04-07 Akim Demaille <akim@epita.fr>
11881
11882 * tests/torture.at (Big triangle): New.
11883 (GNU AWK Grammar, GNU Cim Grammar): Move to...
11884 * tests/existing.at: here.
11885
5123689b
AD
118862002-04-07 Akim Demaille <akim@epita.fr>
11887
11888 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
11889 nritems.
11890 Adjust dependencies.
11891
f3849179
AD
118922002-04-07 Akim Demaille <akim@epita.fr>
11893
11894 * src/reader.c: Normalize increments to prefix form.
11895
bd02036a
AD
118962002-04-07 Akim Demaille <akim@epita.fr>
11897
11898 * src/reader.c, symtab.c: Remove debugging code.
11899
db8837cb
AD
119002002-04-07 Akim Demaille <akim@epita.fr>
11901
11902 Rename all the `bucket's as `symbol_t'.
11903
11904 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
11905 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
11906 * src/symtab.c, src/symtab.h (bucket): Rename as...
11907 (symbol_t): this.
11908 (symbol_list_new, bucket_check_defined, bucket_make_alias)
11909 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
11910 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
11911 (buckets_new, buckets_free, buckets_do): Rename as...
11912 (symbol_list_new, symbol_check_defined, symbol_make_alias)
11913 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11914 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
11915 (symbols_new, symbols_free, symbols_do): these.
11916
72a23c97
AD
119172002-04-07 Akim Demaille <akim@epita.fr>
11918
11919 Use lib/hash for the symbol table.
11920
11921 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
11922 EOF.
11923 * src/lex.c (lex): Set the `number' member of new terminals.
11924 * src/reader.c (bucket_check_defined, bucket_make_alias)
11925 (bucket_check_alias_consistence, bucket_translation): New.
11926 (reader, grammar_free, readgram, token_translations_init)
11927 (packsymbols): Adjust.
11928 (reader): Number the predefined tokens.
11929 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
11930 for predefined tokens.
11931 * src/symtab.h (bucket): Remove all the hash table related
11932 members.
11933 * src/symtab.c (symtab): Replace by...
11934 (bucket_table): this.
11935 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
11936 (buckets_new, buckets_do): New.
11937
280a38c3
AD
119382002-04-07 Akim Demaille <akim@epita.fr>
11939
11940 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
11941 (start_symbol, max_user_token_number, semantic_parser)
11942 (error_token_number): Initialize.
11943 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
11944 Initialize.
11945 (reader): Don't.
11946 (errtoken, eoftoken, undeftoken, axiom): Extern.
11947
03b31c0c
AD
119482002-04-07 Akim Demaille <akim@epita.fr>
11949
11950 * src/gram.h (rule_s): prec and precsym are now pointers
11951 to the bucket giving the priority/associativity.
11952 Member `associativity' removed: useless.
11953 * src/reduce.c, src/conflicts.c: Adjust.
11954
8b3df748
AD
119552002-04-07 Akim Demaille <akim@epita.fr>
11956
11957 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
11958 Properly escape the symbols' TAG when outputting them.
11959
e601aa1d
AD
119602002-04-07 Akim Demaille <akim@epita.fr>
11961
11962 * src/lalr.h (LA): Is a bitsetv, not bitset*.
11963
b0299a2e
AD
119642002-04-07 Akim Demaille <akim@epita.fr>
11965
11966 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
11967 (LArule): this, which is an array to rule_t*.
11968 * src/print.c, src/conflicts.c: Adjust.
11969
d7e1f00c
AD
119702002-04-07 Akim Demaille <akim@epita.fr>
11971
11972 * src/gram.h (rule_t): Rename `number' as `user_number'.
11973 `number' is a new member.
11974 Adjust dependencies.
11975 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
11976
cc9305dd
AD
119772002-04-07 Akim Demaille <akim@epita.fr>
11978
11979 As a result of the previous patch, it is no longer needed
11980 to reorder ritem itself.
11981
11982 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
11983
b0940840
AD
119842002-04-07 Akim Demaille <akim@epita.fr>
11985
11986 Be sure never to walk through RITEMS, but use only data related to
11987 the rules themselves. RITEMS should be banished.
11988
11989 * src/output.c (output_token_translations): Rename as...
11990 (prepare_tokens): this.
11991 In addition to `translate', prepare the muscles `tname' and
11992 `toknum', which were handled by...
11993 (output_rule_data): this.
11994 Remove, and move the remainder of its outputs into...
11995 (prepare_rules): this new routines, which also merges content from
11996 (output_gram): this.
11997 (prepare_rules): Be sure never to walk through RITEMS.
11998 (output_stos): Rename as...
11999 (prepare_stos): this.
12000 (output): Always invoke prepare_states, after all, just don't use it
12001 in the output if you don't need it.
12002
643a5994
AD
120032002-04-07 Akim Demaille <akim@epita.fr>
12004
12005 * src/LR0.c (new_state): Display `nstates' as the name of the
12006 newly created state.
12007 Adjust to initialize first_state and last_state if needed.
12008 Be sure to distinguish the initial from the final state.
12009 (new_states): Create the itemset of the initial state, and use
12010 new_state.
12011 * src/closure.c (closure): Now that the initial state has its
12012 items properly set, there is no need for a special case when
12013 creating `ruleset'.
12014
12015 As a result, now the rule 0, reducing to $axiom, is visible in the
12016 outputs. Adjust the test suite.
12017
12018 * tests/conflicts.at (Solved SR Conflicts)
12019 (Unresolved SR Conflicts): Adjust.
12020 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
12021 * tests/conflicts.at (S/R in initial): New.
12022
b4c4ccc2
AD
120232002-04-07 Akim Demaille <akim@epita.fr>
12024
12025 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
12026 the RHS of the rules.
12027 * src/output.c (output_gram): Likewise.
12028
bba97eb2
AD
120292002-04-07 Akim Demaille <akim@epita.fr>
12030
12031 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
12032 bucket.
12033 Adjust all dependencies.
12034 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
12035 `number' of the buckets too.
12036 * src/gram.h: Include `symtab.h'.
12037 (associativity): Move to...
12038 * src/symtab.h: here.
12039 No longer include `gram.h'.
12040
c3b407f4
AD
120412002-04-07 Akim Demaille <akim@epita.fr>
12042
12043 * src/gram.h, src/gram.c (rules_rhs_length): New.
12044 (ritem_longest_rhs): Use it.
12045 * src/gram.h (rule_t): `number' is a new member.
12046 * src/reader.c (packgram): Set it.
12047 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
12048 the end of `rules', and count them out of `nrules'.
12049 (reduce_output, dump_grammar): Adjust.
12050 * src/print.c (print_grammar): It is no longer needed to check for
12051 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
12052 * tests/reduce.at (Reduced Automaton): New test.
12053
11652ab3
AD
120542002-04-07 Akim Demaille <akim@epita.fr>
12055
12056 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
12057 lacking `+ 1' to nrules, Bison reported as useless a token if it
12058 was used solely to set the precedence of the last rule...
12059
26b23c1a
AD
120602002-04-07 Akim Demaille <akim@epita.fr>
12061
12062 * data/bison.c++, data/bison.simple: Don't output the current file
12063 name in #line, to avoid useless diffs between two identical
12064 outputs under different names.
12065
18bcecb0
AD
120662002-04-07 Akim Demaille <akim@epita.fr>
12067
12068 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
12069 Normalize loops to using `< nrules + 1', not `<= nrules'.
12070
fa770c86
AD
120712002-04-07 Akim Demaille <akim@epita.fr>
12072
12073 * TODO: Update.
12074
d9b739c3
AD
120752002-04-07 Akim Demaille <akim@epita.fr>
12076
12077 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
12078 bucket.value as bucket.number.
12079
99013900
AD
120802002-04-07 Akim Demaille <akim@epita.fr>
12081
12082 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
12083 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
12084 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
12085 RHS, instead of being an index in RITEMS.
12086
e966383b
PE
120872002-04-04 Paul Eggert <eggert@twinsun.com>
12088
12089 * doc/bison.texinfo: Update copyright date.
12090 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
12091 (Symbols): Warn about running Bison in one character set,
12092 but compiling and/or running in an incompatible one.
12093 Warn about character code 256, too.
12094
120952002-04-03 Paul Eggert <eggert@twinsun.com>
12096
12097 * src/bison.data (YYSTACK_ALLOC): Depend on whether
12098 YYERROR_VERBOSE is nonzero, not whether it is defined.
12099
12100 Merge changes from bison-1_29-branch.
c307773e 12101
8d6c48b9
PE
121022002-03-20 Paul Eggert <eggert@twinsun.com>
12103
12104 Merge fixes from Debian bison_1.34-1.diff.
12105
12106 * configure.in (AC_PREREQ): 2.53.
12107
e53c6322
AD
121082002-03-20 Akim Demaille <akim@epita.fr>
12109
12110 * src/conflicts.c (log_resolution): Argument `resolution' is const.
12111
9ffbeca7
PE
121122002-03-19 Paul Eggert <eggert@twinsun.com>
12113
21db0b2a
PE
12114 * src/bison.simple (YYCOPY): New macro.
12115 (YYSTACK_RELOCATE): Use it.
12116 Remove Type arg; no longer needed. All callers changed.
12117 (yymemcpy): Remove; no longer needed.
12118
9ffbeca7
PE
12119 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
12120 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
12121
642cb8f8
AD
121222002-03-19 Akim Demaille <akim@epita.fr>
12123
12124 Test and fix the #line outputs.
12125
12126 * tests/atlocal.at (GCC): New.
12127 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 12128 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
12129 (Action synch line, Epilogue synch line): New tests.
12130 * src/reader.c (parse_union_decl): Define the muscle stype_line.
12131 * data/bison.simple, data/bison.c++: Use it.
12132
3c31a486
AD
121332002-03-19 Akim Demaille <akim@epita.fr>
12134
12135 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
12136 (Solved SR Conflicts, %expect not enough, %expect right)
12137 (%expect too much): Move to...
12138 * tests/conflicts.at: this new file.
12139
0d8bed56
AD
121402002-03-19 Akim Demaille <akim@epita.fr>
12141
12142 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
12143 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
12144 that we can move to enums for instance.
12145 * src/output.c (token_definitions_output): Output a list of
12146 `token-name, token-number' instead of the #define.
12147 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
12148
9208d17f
AD
121492002-03-14 Akim Demaille <akim@epita.fr>
12150
12151 Use Gettext 0.11.1.
12152
af27eacb
RA
121532002-03-09 Robert Anisko <robert@lrde.epita.fr>
12154
12155 * data/bison.c++: Make the user able to add members to the generated
12156 parser by subclassing.
12157
9101a310
RA
121582002-03-05 Robert Anisko <robert@lrde.epita.fr>
12159
12160 * src/reader.c (read_additionnal_code): `c' should be an integer, not
12161 a character.
12162 Reported by Nicolas Tisserand and Nicolas Burrus.
12163
fff9bf0b
RA
121642002-03-04 Robert Anisko <robert@lrde.epita.fr>
12165
12166 * src/reader.c: Warn about lacking semi-colons, do not complain.
12167
64dba31e
RA
121682002-03-04 Robert Anisko <robert@lrde.epita.fr>
12169
12170 * data/bison.c++: Remove a debug line.
12171
374f5a14
RA
121722002-03-04 Robert Anisko <robert@lrde.epita.fr>
12173
12174 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
12175 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
12176 provide a default implementation.
12177
bfcf1f3a
AD
121782002-03-04 Akim Demaille <akim@epita.fr>
12179
12180 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
12181 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
12182 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
12183 * tests/semantic.at (Parsing Guards): Similarly.
12184 * src/reader.at (readgram): Complain if the last rule is not ended
12185 with a semi-colon.
12186
65ccf9fc
AD
121872002-03-04 Akim Demaille <akim@epita.fr>
12188
12189 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
12190 * src/closure.c: here.
12191 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
12192 RTC.
12193 * src/warshall.h, src/warshall.c: Remove.
12194 * tests/sets.at (Broken Closure): Adjust.
12195
d0039cbc
AD
121962002-03-04 Akim Demaille <akim@epita.fr>
12197
12198 * src/output.c (output_skeleton): tempdir is const.
12199 bytes_read is unused.
12200
345cea78
AD
122012002-03-04 Akim Demaille <akim@epita.fr>
12202
12203 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12204 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
12205 Update.
12206 From Michael Hayes.
12207
564801f7
AD
122082002-03-04 Akim Demaille <akim@epita.fr>
12209
12210 * src/closure.c (closure): `r' is unused.
12211
e5352bc7
AD
122122002-03-04 Akim Demaille <akim@epita.fr>
12213
12214 * tests/sets.at (Broken Closure): Add the ending `;'.
12215 * src/reader.at (readgram): Complain if a rule is not ended with a
12216 semi-colon.
12217
914feea9
AD
122182002-03-04 Akim Demaille <akim@epita.fr>
12219
12220 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
12221 (count_sr_conflicts): Use bitset_count.
12222 * src/reduce.c (inaccessable_symbols): Ditto.
12223 (bits_size): Remove.
12224 * src/warshall.h, src/warshall.c: Convert to bitsetv.
12225
f0250de6
AD
122262002-03-04 Akim Demaille <akim@epita.fr>
12227
12228 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
12229 * src/reduce.c: Remove the `bitset_zero's following the
12230 `bitset_create's, as now it is performed by the latter.
12231
ef017502
AD
122322002-03-04 Akim Demaille <akim@epita.fr>
12233
12234 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
12235 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
12236 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
12237 latest sources from Michael.
12238
76514394
AD
122392002-03-04 Akim Demaille <akim@epita.fr>
12240
12241 * src/output.c (output): Don't free the grammar.
12242 * src/reader.c (grammar_free): New.
12243 * src/main.c (main): Call it and don't free symtab here.
12244
55024580
AD
122452002-03-04 Akim Demaille <akim@epita.fr>
12246
12247 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
12248 before returning.
12249 Reported by Benoit Perrot.
12250
f9abaa2c
AD
122512002-03-04 Akim Demaille <akim@epita.fr>
12252
12253 Use bitset operations when possible, not loops over bits.
12254
12255 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
12256 bitset_or.
12257 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
12258 * src/reduce.c (useless_nonterminals): Formatting changes.
12259 * src/warshall.c (TC): Use bitset_or.
12260
0e721e75
AD
122612002-03-04 Akim Demaille <akim@epita.fr>
12262
12263 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
12264 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
12265 Ditto.
12266
0fb1ffb1
AD
122672002-03-04 Akim Demaille <akim@epita.fr>
12268
12269 * src/lalr.c (F): Now a bitset*.
12270 Adjust all dependencies.
12271
b86796bf
AD
122722002-03-04 Akim Demaille <akim@epita.fr>
12273
12274 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
12275 Adjust all dependencies.
12276
602bbf31
AD
122772002-03-04 Akim Demaille <akim@epita.fr>
12278
12279 * src/L0.c, src/LR0.h (nstates): Be size_t.
12280 Adjust comparisons (signed vs unsigned).
12281 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
12282 bitset*.
12283 Adjust all dependencies.
12284
d8a0245c
AD
122852002-03-04 Akim Demaille <akim@epita.fr>
12286
12287 * src/closure.c (firsts): Now, also a bitset.
12288 Adjust all dependencies.
12289 (varsetsize): Remove, now unused.
12290 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
12291
34ba9743
AD
122922002-03-04 Akim Demaille <akim@epita.fr>
12293
12294 * src/print.c: Convert to use bitset.h, not hand coded iterations
12295 over ints.
12296
ed86e78c
AD
122972002-03-04 Akim Demaille <akim@epita.fr>
12298
12299 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
12300
dfdb1797
AD
123012002-03-04 Akim Demaille <akim@epita.fr>
12302
12303 * src/closure.c (ruleset): Be a bitset.
12304 (rulesetsize): Remove.
12305
7086e707
AD
123062002-03-04 Akim Demaille <akim@epita.fr>
12307
12308 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
12309 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
12310 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
12311 * src/closure.c (fderives): Be an array of bitsets.
12312
98254360
RA
123132002-02-28 Robert Anisko <robert@lrde.epita.fr>
12314
12315 * data/bison.c++: Merge the two generated headers. Insert a copyright
12316 notice in each output file.
12317
a75c057f
AD
123182002-02-28 Akim Demaille <akim@epita.fr>
12319
12320 * data/bison.c++: Copy the prologue of bison.simple to fetch
12321 useful M4 definitions, such as b4_header_guard.
12322
06b00abc
AD
123232002-02-25 Akim Demaille <akim@epita.fr>
12324
12325 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
12326 translator friendly scheme for the bgr
12327 copyright notice.
06b00abc 12328
70e7d534
AD
123292002-02-25 Akim Demaille <akim@epita.fr>
12330
12331 * src/output.c (header_output): Remove, now handled completely via
12332 M4.
12333
abe017f6
AD
123342002-02-25 Akim Demaille <akim@epita.fr>
12335
12336 * m4/m4.m4: New, from CVS Autoconf.
12337 * configure.in: Invoke it.
12338 * src/output.c (output_skeleton): Use its result instead of the
12339 hard coded name.
12340
381fb12e
AD
123412002-02-25 Akim Demaille <akim@epita.fr>
12342
12343 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
12344 Fileutils 4.1.5.
12345 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
12346 * src/output.c (output_skeleton): Use mkstemp to create a real
12347 temporary file.
12348 Move the filling of `skeleton' and its muscle to...
12349 (prepare): here.
12350 (output): Move the definition of the prologue muscle to...
12351 (prepare): here.
12352 * src/system.h (DEFAULT_TMPDIR): New.
12353
6f38107f
PE
123542002-02-14 Paul Eggert <eggert@twinsun.com>
12355
12356 Remove the support for C++ namespace cleanliness; it was
12357 causing more problems than it was curing, since it didn't work
12358 properly on some nonstandard C++ compilers. This can wait
12359 for a proper C++ parser.
12360
12361 * NEWS: Document this.
12362 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
12363 of C++, as it's treated like C now.
12364 * src/bison.simple (YYSTD): Remove.
12365 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
12366 Treat C++ just like Standard C instead of trying to support
12367 namespace cleanliness.
12368
80cce3da
AD
123692002-02-14 Akim Demaille <akim@epita.fr>
12370
12371 * tests/regression.at (else): Adjust to Andreas' change.
12372
842e8679
AD
123732002-02-14 Akim Demaille <akim@epita.fr>
12374
12375 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
12376
4bda3f10
AD
123772002-02-13 Andreas Schwab <schwab@suse.de>
12378
12379 * src/output.c (output_rule_data): Don't output NULL, it might
12380 not be defined yet.
12381
4162fa07 123822002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 12383
4162fa07
RA
12384 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
12385 (Copyright notice): Update.
b418ecd8 12386
bd16a5dc
AD
123872002-02-11 Akim Demaille <akim@epita.fr>
12388
12389 * tests/regression.at (%nonassoc and eof): Don't include
12390 nonportable headers.
12391
8d69a1a3
RA
123922002-02-08 Robert Anisko <robert@lrde.epita.fr>
12393
12394 * data/bison.c++: Correct error recovery. Make the user able to
12395 initialize the starting location.
12396
9b2d0677
AD
123972002-02-07 Akim Demaille <akim@epita.fr>
12398
12399 * tests/input.at: New.
12400
69e2658b
RA
124012002-02-07 Robert Anisko <robert@lrde.epita.fr>
12402
12403 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 12404 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
12405 directives around tables only needed for debugging.
12406
4aacc3a7
RA
124072002-02-07 Robert Anisko <robert@lrde.epita.fr>
12408
12409 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
12410 C++ parsers.
12411 (yy::b4_name::parse): Use print_.
12412
762a801e
RA
124132002-02-07 Robert Anisko <robert@lrde.epita.fr>
12414
12415 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
12416
4bb2bc3f
RA
124172002-02-07 Robert Anisko <robert@lrde.epita.fr>
12418
12419 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
12420 C++ parsers.
12421 (yy::b4_name::parse): Build verbose error messages, and use error_.
12422
6b45a3ca
RA
124232002-02-06 Robert Anisko <robert@lrde.epita.fr>
12424
12425 * data/bison.c++: Fix m4 quoting in comments.
12426
50997c6e
RA
124272002-02-06 Robert Anisko <robert@lrde.epita.fr>
12428
12429 * data/bison.c++: Adjust the parser code. Fix some muscles that were
12430 not expanded by m4.
12431
3f3eed27
AD
124322002-02-05 Akim Demaille <akim@epita.fr>
12433
12434 * data/bison.c++: Adjust to the M4 back end.
12435 More is certainly needed.
12436
be2a1a68
AD
124372002-02-05 Akim Demaille <akim@epita.fr>
12438
12439 Give a try to M4 as a back end.
12440
12441 * lib/readpipe.c: New, from wdiff.
12442 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
12443 BISON_HAIRY.
12444 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
12445 specific values. Now it is m4 that performs the lookup.
12446 * src/parse-skel.y: Remove.
12447 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
12448 * src/output.c (actions_output, guards_output)
12449 (token_definitions_output): No longer keeps track of the output
12450 line number, hence remove the second argument.
12451 (guards_output): Check against the guard member of a rule, not the
12452 action member.
12453 Adjust callers.
12454 (output_skeleton): Don't look for the skeleton location, let m4 do
12455 that.
12456 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
12457 file will be used.
12458 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
12459 (prepare): Given that for the time being changesyntax is not
12460 usable in M4, rename the muscles using `-' to `_'.
12461 Define `defines_flag', `output_parser_name' and `output_header_name'.
12462 * src/output.h (actions_output, guards_output)
12463 (token_definitions_output): Adjust prototypes.
12464 * src/scan-skel.l: Instead of scanning the skeletons, it now
12465 processes the output of m4: `__oline__' and `#output'.
12466 * data/bison.simple: Adjust to be used by M4(sugar).
12467 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
12468 to date.
12469 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
12470 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
12471 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
12472 shamelessly stolen from CVS Autoconf.
12473
beda758b
AD
124742002-02-05 Akim Demaille <akim@epita.fr>
12475
12476 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
12477 * configure.in: Check for the declarations of free and malloc.
12478 * src/muscle_tab.c: Adjust.
12479
5ece6d43
AD
124802002-02-05 Akim Demaille <akim@epita.fr>
12481
12482 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
12483 which have no values.
12484
5bb18f9a
AD
124852002-02-05 Akim Demaille <akim@epita.fr>
12486
12487 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
12488 * data/: here.
12489
894dd62e
PE
124902002-01-29 Paul Eggert <eggert@twinsun.com>
12491
12492 * src/bison.simple (YYSIZE_T): Do not define merely because
12493 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
12494 On some platforms, <alloca.h> does not declare YYSTD (size_t).
12495
82841af7
AD
124962002-01-27 Akim Demaille <akim@epita.fr>
12497
12498 Fix `%nonassoc and eof'.
12499
12500 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
12501 which were not properly copied! Replace
12502 memcpy (res->errs, src->errs, src->nerrs);
12503 with
12504 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
12505 !!!
12506 * tests/regression.at (%nonassoc and eof): Adjust to newest
12507 Autotest: `.' is not in the PATH.
12508
318b76e9
AD
125092002-01-27 Akim Demaille <akim@epita.fr>
12510
12511 * tests/sets.at (AT_EXTRACT_SETS): New.
12512 (Nullable): Use it.
12513 (Firsts): New.
12514
30d2f3d5
AD
125152002-01-26 Akim Demaille <akim@epita.fr>
12516
12517 * tests/actions.at, tests/calc.at, tests/headers.at,
12518 * tests/torture.at: Adjust to the newest Autotest which no longer
12519 forces `.' in the PATH.
12520
30f8c395
AD
125212002-01-25 Akim Demaille <akim@epita.fr>
12522
12523 * tests/regression.at (%nonassoc and eof): New.
12524 Suggested by Robert Anisko.
12525
29ae55f1
AD
125262002-01-24 Akim Demaille <akim@epita.fr>
12527
12528 Bison dumps core when trying to complain about broken input files.
12529 Reported by Cris van Pelt.
12530
12531 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
12532 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
12533 into...
12534 (Invalid inputs): Strengthen: exercise parse_percent_token.
12535
2b548aa6
RA
125362002-01-24 Robert Anisko <robert.anisko@epita.fr>
12537
12538 * src/Makefile.am: Add bison.c++.
12539 * src/bison.c++: New skeleton.
12540
bb0146c2
AD
125412002-01-21 Paolo Bonzini <bonzini@gnu.org>
12542
12543 * po/it.po: New.
12544
bec30531
AD
125452002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
12546
12547 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
12548
fc6edc45
MA
125492002-01-20 Marc Autret <marc@gnu.org>
12550
12551 * src/files.c (compute_output_file_names): Fix
12552
5e5d5415
MA
125532002-01-20 Marc Autret <marc@gnu.org>
12554
12555 * tests/output.at: New test.
12556 * src/files.c (compute_base_names): Don't map extensions when
12557 the YACC flag is set, use defaults.
12558 Reported by Evgeny Stambulchik.
12559
44ea3fbd
MA
125602002-01-20 Marc Autret <marc@gnu.org>
12561
ba0fe3c7
PE
12562 * src/system.h: Need to define __attribute__ away for non-GCC
12563 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
12564 Suggested by Albert Chin-A-Young.
12565
338963d1
TVH
125662002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
12567
12568 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
12569 canonical definition.
12570 * src/system.h: Use the canonical definition for PARAMS (avoids
12571 a conflict with the macro from lib/hash.h).
12572
c57b2479
AD
125732002-01-11 Akim Demaille <akim@epita.fr>
12574
12575 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 12576 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 12577
b85810ae
AD
125782002-01-09 Akim Demaille <akim@epita.fr>
12579
12580 * src/files.c, src/files.h (output_infix): New.
12581 (tab_extension): Remove.
12582 (compute_base_names): Compute the former, drop the latter.
12583 * src/output.c (prepare): Insert the muscles `output-infix', and
12584 `output-suffix'.
12585 * src/parse-skel.y (string, string.1): New.
12586 (section.header): Use it.
12587 (section.yacc): Remove.
12588 (prefix): Remove too.
12589 * src/scan-skel.l: Adjust.
12590 * src/bison.simple, src/bison.hairy: Adjust.
12591
cae60122
AD
125922002-01-09 Akim Demaille <akim@epita.fr>
12593
12594 * configure.in (WERROR_CFLAGS): Compute it.
12595 * src/Makefile.am (CFLAGS): Pass it.
12596 * tests/atlocal.in (CFLAGS): Idem.
12597 * src/files.c: Fix a few warnings.
12598 (get_extension_index): Remove, unused.
12599
ae404801
AD
126002002-01-08 Akim Demaille <akim@epita.fr>
12601
12602 * src/getargs.c (AS_FILE_NAME): New.
12603 (getargs): Use it to convert DOSish file names.
12604 * src/files.c (base_name): Rename as full_base_name to avoid
12605 clashes with `base_name ()'.
12606 (filename_split): New.
12607 (compute_base_names): N-th rewrite, using filename_split.
12608
22312b71
AD
126092002-01-08 Akim Demaille <akim@epita.fr>
12610
12611 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
12612 New, stolen from the Fileutils 4.1.
12613 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
12614 * configure.in: Check for the presence of memrchr, and of its
12615 prototype.
12616
a67cef01
TVH
126172002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
12618
12619 * lib/hash.h (__P): Added definition for this macro.
12620 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
12621 BUILT_SOURCES, to ensure they are generated first.
12622 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
12623 %error-verbose to allow bootstrapping with bison 1.30x.
12624
2b25d624
AD
126252002-01-06 Akim Demaille <akim@epita.fr>
12626
12627 * src/reader.c (parse_braces): Don't fetch the next char, the
12628 convention is to fetch on entry.
12629 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
12630 'switch' without a following semicolon.
12631 * tests/regression.at (braces parsing): New.
12632
3460813b
AD
126332002-01-06 Akim Demaille <akim@epita.fr>
12634
12635 Bison is dead wrong in its RR conflict reports.
12636
12637 * tests/torture.at (GNU Cim Grammar): New.
12638 * src/conflicts.c (count_rr_conflicts): Fix.
12639
73784c64
AD
126402002-01-06 Akim Demaille <akim@epita.fr>
12641
12642 Creating package.m4 from configure.ac causes too many problems.
12643
12644 * tests/Makefile.am (package.m4): Create it by hand,
12645 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
12646
25d81090
AD
126472002-01-06 Akim Demaille <akim@epita.fr>
12648
12649 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
12650 skeleton.h.
12651
a9b8959e
PE
126522002-01-04 Paul Eggert <eggert@twinsun.com>
12653
12654 * doc/bison.texinfo (Debugging):
12655 Remove YYSTDERR; it's no longer defined or used.
12656 Also, s/cstdio.h/cstdio/.
12657
25d81090
AD
126582002-01-03 Akim Demaille <akim@epita.fr>
12659
12660 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
12661
1109455c
AD
126622002-01-03 Akim Demaille <akim@epita.fr>
12663
12664 * src/parse-skel.y (process_skeleton): Don't bind the parser's
12665 tracing code to --trace, wait for a better --trace option, with
12666 args.
12667
7ea5e977
AD
126682002-01-03 Akim Demaille <akim@epita.fr>
12669
12670 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
12671 The ISO C++ standard is extremely clear about it: stderr is
12672 considered a macro, not a regular symbol (see table 94 `Header
12673 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
12674 Therefore std:: does not apply to it. It still does with fprintf.
12675 Also, s/cstdio.h/cstdio/.
12676
fab5b110
AD
126772002-01-03 Akim Demaille <akim@epita.fr>
12678
12679 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
12680 for non system headers.
12681
aed7fd9b
AD
126822002-01-02 Akim Demaille <akim@epita.fr>
12683
12684 Equip the skeleton chain with location tracking, runtime trace,
12685 pure parser and scanner.
12686
12687 * src/parse-skel.y: Request a pure parser, locations, and prefix
12688 renaming.
12689 (%union): Having several members with the same type does not help
12690 type mismatches, simplify.
12691 (YYPRINT, yyprint): New.
12692 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
12693 (skel_error): this.
12694 Handle locations.
12695 * src/scan-skel.l: Adjust to these changes.
12696 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
12697 (LOCATION_PRINT, skel_control_t): New.
12698
24fad99e
AD
126992001-12-30 Akim Demaille <akim@epita.fr>
12700
12701 * src/parse-skel.y: Get rid of the shift/reduce conflict:
12702 replace `gb' with BLANKS.
12703 * src/scan-skel.l: Adjust.
12704
a4b36db4
AD
127052001-12-30 Akim Demaille <akim@epita.fr>
12706
12707 * src/system.h: We don't need nor want bcopy.
12708 Throw away MS-DOS crap: we don't need getpid.
12709 * configure.in: We don't need strndup. It was even causing
12710 problems: because Flex includes the headers *before* us,
12711 _GNU_SOURCE is not defined by config.h, and therefore strndup was
12712 not visible.
12713 * lib/xstrndup.c: New.
12714 * src/scan-skel.l: Use it.
12715 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
12716 * src/parse-skel.y: Use %directives instead of #defines.
12717
1239777d
AD
127182001-12-30 Akim Demaille <akim@epita.fr>
12719
12720 * src/skeleton.h: New.
12721 * src/output.c (output_parser, output_master_parser): Remove, dead
12722 code.
12723 * src/output.h (get_lines_number, actions_output, guards_output)
12724 (token_definitions_output): Prototype them.
12725 * src/parse-skel.y: Add the license notice.
12726 Include output.h and skeleton.h.
12727 (process_skeleton): Returns void, and takes a single parameter.
12728 * src/scan-skel.l: Add the license notice.
12729 Include skeleton.h.
12730 Don't use %option yylineno: it seems that then Flex imagines
12731 REJECT has been used, and therefore it won't reallocate its
12732 buffers (which makes no other sense to me than a bug). It results
12733 in warnings for `unused: yy_flex_realloc'.
12734
9b3add5b
RA
127352001-12-30 Robert Anisko <robert.anisko@epita.fr>
12736
12737 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
12738 (MUSCLE_INSERT_PREFIX): ...to there.
12739 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
12740 (MUSCLE_INSERT_PREFIX): Move from here...
12741
12742 * src/bison.hairy: Add a section directive. Put braces around muscle
12743 names. This parser skeleton is still broken, but Bison should not
12744 choke on a bad muscle 'syntax'.
12745 * src/bison.simple: Add a section directive. Put braces around muscle
12746 names.
12747
12748 * src/files.h (strsuffix, stringappend): Add declarations.
12749 (tab_extension): Add declaration.
12750 (short_base_name): Add declaration.
12751
12752 * src/files.c (strsuffix, stringappend): No longer static. These
12753 functions are used in the skeleton parser.
12754 (tab_extension): New.
12755 (compute_base_names): Use the computations done in this function
fab5b110 12756 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
12757 names.
12758 (short_base_name): No longer static.
12759
12760 * src/output.c (output_skeleton): New.
12761 (output): Disable call to output_master_parser, and give a try to
12762 a new skeleton handling system.
12763 (guards_output, actions_output): No longer static.
12764 (token_definitions_output, get_lines_number): No longer static.
12765
12766 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
12767
fab5b110 12768 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
12769 parse-skel.y.
12770
12771 * src/parse-skel.y: New file.
12772 * src/scan-skel.l: New file.
12773
b5b61c61
AD
127742001-12-29 Akim Demaille <akim@epita.fr>
12775
12776 %name-prefix is broken.
12777
12778 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
12779 Adjust all dependencies.
12780 * tests/headers.at (export YYLTYPE): Strengthen this test: use
12781 %name-prefix.
12782
12783 Renaming yylval but not yylloc is not consistent. Now we do.
12784
12785 * src/bison.simple: Prefix yylloc if used.
12786 * doc/bison.texinfo (Decl Summary): Document that.
12787
8c9a50be
AD
127882001-12-29 Akim Demaille <akim@epita.fr>
12789
12790 * doc/bison.texinfo: Promote `%long-directive' over
12791 `%long_directive'.
12792 Remove all references to fixed-output-files, yacc is enough.
12793
d99361e6
AD
127942001-12-29 Akim Demaille <akim@epita.fr>
12795
12796 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
12797 user prologue. These are defaults.
12798 * tests/actions.at (Mid-rule actions): Make sure the user can
12799 define YYDEBUG and YYERROR_VERBOSE.
12800
b9cecb91
AD
128012001-12-29 Akim Demaille <akim@epita.fr>
12802
12803 * src/output.c (header_output): Don't forget to export YYLTYPE and
12804 yylloc.
12805 * tests/headers.at (export YYLTYPE): New, make sure it does.
12806 * tests/regression.at (%union and --defines, Invalid CPP headers):
12807 Move to...
12808 * tests/headers.at: here.
12809
aea13e97
AD
128102001-12-29 Akim Demaille <akim@epita.fr>
12811
12812 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
12813
931394cb
AD
128142001-12-29 Akim Demaille <akim@epita.fr>
12815
12816 * tests/actions.at (Mid-rule actions): Output on a single line
12817 instead of several.
12818
704a47c4
AD
128192001-12-29 Akim Demaille <akim@epita.fr>
12820
12821 * doc/bison.texinfo: Formatting changes.
12822
091e20bb
AD
128232001-12-29 Akim Demaille <akim@epita.fr>
12824
12825 Don't store the token defs in a muscle, just be ready to output it
12826 on command. Now possible via `symbols'. Fixes a memory leak.
12827
12828 * src/output.c (token_definitions_output): New.
12829 (output_parser, header_output): Use it.
12830 * src/reader.c (symbols_save): Remove.
12831
cce71710
AD
128322001-12-29 Akim Demaille <akim@epita.fr>
12833
12834 * src/bison.simple: Do not provide a default for YYSTYPE and
12835 YYLTYPE before the user's prologue. Otherwise it's hardly... a
12836 default.
12837
82c035a8
AD
128382001-12-29 Akim Demaille <akim@epita.fr>
12839
12840 Mid-rule actions are simply... ignored!
12841
12842 * src/reader.c (readgram): Be sure to attach mid-rule actions to
12843 the empty-rule associated to the dummy symbol, not to the host
12844 rule.
12845 * tests/actions.at (Mid-rule actions): New.
12846
8419d367
AD
128472001-12-29 Akim Demaille <akim@epita.fr>
12848
12849 Memory leak.
12850
12851 * src/reader.c (reader): Free grammar.
12852
375d5806
AD
128532001-12-29 Akim Demaille <akim@epita.fr>
12854
12855 Memory leak.
12856
12857 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
12858 since it allocates it for each state, although only one is needed.
12859 (allocate_storage): Do it here.
12860
f51cb8ff
AD
128612001-12-29 Akim Demaille <akim@epita.fr>
12862
12863 * src/options.h, src/options.c (create_long_option_table): Rename
12864 as...
12865 (long_option_table_new): this, with a clearer prototype.
12866 (percent_table): Remove, unused,
12867 * src/getargs.c (getargs): Adjust.
12868
29e88316
AD
128692001-12-29 Akim Demaille <akim@epita.fr>
12870
12871 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
12872 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
12873 as states.
12874
b9f71f19
AD
128752001-12-29 Akim Demaille <akim@epita.fr>
12876
12877 * src/lalr.c (build_relations): Rename `states' as `states1'.
12878 Sorry, I don't understand exactly what it is, no better name...
12879
1a2b5d37
AD
128802001-12-29 Akim Demaille <akim@epita.fr>
12881
12882 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
12883 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
12884 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
12885 as rules.
12886
1cca533e
AD
128872001-12-29 Akim Demaille <akim@epita.fr>
12888
12889 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
12890 ago.
12891
c03ae966
AD
128922001-12-29 Akim Demaille <akim@epita.fr>
12893
12894 * src/reader.c, src/reader.h (user_toknums): Remove.
12895 Adjust all users to use symbols[i]->user_token_number.
12896
5a670b1e
AD
128972001-12-29 Akim Demaille <akim@epita.fr>
12898
12899 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
12900 Adjust all users to use symbols[i]->prec or ->assoc.
12901
ad949da9
AD
129022001-12-29 Akim Demaille <akim@epita.fr>
12903
12904 * src/reader.c, src/reader.h (tags): Remove.
12905 Adjust all users to use symbols[i]->tag.
12906
0e78e603
AD
129072001-12-29 Akim Demaille <akim@epita.fr>
12908
12909 * src/gram.h, src/gram.c (symbols): New, similar to state_table
12910 and rule_table.
12911 * src/reader.c (packsymbols): Fill this table.
12912 Drop sprec.
12913 * src/conflicts.c (resolve_sr_conflict): Adjust.
12914 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
12915 single table.
12916 Use symbols[i]->tag instead of tags[i].
12917
213e640e
AD
129182001-12-29 Akim Demaille <akim@epita.fr>
12919
12920 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
12921 In addition, put a comment in there, to replace...
12922 * tests/regression.at (%union and C comments): Remove.
12923
e7b8bef1
AD
129242001-12-29 Akim Demaille <akim@epita.fr>
12925
12926 * tests/regression.at (Web2c Actions): Blindly move the actual
12927 output as expected output. The contents *seem* right to me, but I
12928 can't pretend reading perfectly parser tables... Nonetheless, all
12929 the other tests pass correctly, the table look OK, even though the
12930 presence of `$axiom' is to be noted: AFAICS it is useless (but
12931 harmless).
12932
b68e7744
AD
129332001-12-29 Akim Demaille <akim@epita.fr>
12934
12935 * src/reader.c (readgram): Don't add the rule 0 if there were no
12936 rules read. In other words, add it _after_ having performed
12937 grammar sanity checks.
12938 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
12939
78d5bae9
AD
129402001-12-29 Akim Demaille <akim@epita.fr>
12941
12942 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
12943 visible, and some states have now a different number.
12944
ff442794
AD
129452001-12-29 Akim Demaille <akim@epita.fr>
12946
12947 * src/reader.c (readgram): Bind the initial rule's lineno to that
12948 of the first rule.
12949 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
12950 (Solved SR Conflicts): Adjust rule 0's line number.
12951
610ab194
AD
129522001-12-29 Akim Demaille <akim@epita.fr>
12953
12954 Fix the `GAWK Grammar' failure.
12955
12956 * src/LR0.c (final_state): Initialize to -1 so that we do compute
12957 the reductions of the first state which was mistakenly confused
12958 with the final state because precisely final_state was initialized
12959 to 0.
12960 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
12961 now noticed by Bison.
12962 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
12963 have a reduction on $default.
12964
29d29c8f
AD
129652001-12-29 Akim Demaille <akim@epita.fr>
12966
12967 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
12968 rule line numbers.
12969 * src/closure.c (print_closure): Likewise.
12970 * src/derives.c (print_derives): Likewise.
12971 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
12972 now.
12973
7c6b64d0
AD
129742001-12-29 Akim Demaille <akim@epita.fr>
12975
12976 * src/lalr.c (lookaheads_print): New.
12977 (lalr): Call it when --trace-flag.
12978 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
12979 are dumped.
12980
3d4daee3
AD
129812001-12-29 Akim Demaille <akim@epita.fr>
12982
12983 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
12984 when walking through ritem, even via rule->rhs.
12985 * src/reduce.c (dump_grammar, useful_production, reduce_output)
12986 (useful_production, useless_nonterminals): Likewise.
12987 (reduce_grammar_tables): Likewise, plus update nritems.
12988 * src/nullable.c (set_nullable): Likewise.
12989 * src/lalr.c (build_relations): Likewise.
12990 * tests/sets.at (Nullable): Adjust.
12991 Fortunately, now, the $axiom is no longer nullable.
12992
9e7f6bbd
AD
129932001-12-29 Akim Demaille <akim@epita.fr>
12994
12995 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
12996 the 0-sentinel.
12997 * src/gram.c (ritem_longest_rhs): Likewise.
12998 * src/reduce.c (nonterminals_reduce): Likewise.
12999 * src/print_graph.c (print_graph): Likewise.
13000 * src/output.c (output_rule_data): Likewise.
13001 * src/nullable.c (set_nullable): Likewise.
13002
255ef638
AD
130032001-12-29 Akim Demaille <akim@epita.fr>
13004
13005 * src/output.c: Comment changes.
13006
0d8a7363
AD
130072001-12-27 Paul Eggert <eggert@twinsun.com>
13008
13009 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
13010 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
13011 Sparc, as they were causing more porting problems than the
13012 (minor) performance improvement was worth.
13013
13014 Also, catch up with 1.31's YYSTD.
13015
3db472b9
AD
130162001-12-27 Akim Demaille <akim@epita.fr>
13017
13018 * src/output.c (output_gram): Rely on nritems, not the
13019 0-sentinel. See below.
13020 Use -1 as separator, not 0.
13021 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
13022 Rely on -1 as separator in yyrhs, instead of 0.
13023 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
13024 twice `Now at end of input', therefore there are two lines less to
13025 expect.
13026
b365aa05
AD
130272001-12-27 Akim Demaille <akim@epita.fr>
13028
13029 * tests/regression.at (Unresolved SR Conflicts):
13030 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
13031 below.
13032
30171f79
AD
130332001-12-27 Akim Demaille <akim@epita.fr>
13034
13035 * src/LR0.c (new_state): Recognize the final state by the fact it
13036 is reached by eoftoken.
13037 (insert_start_shifting_state, insert_eof_shifting_state)
13038 (insert_accepting_state, augment_automaton): Remove, since now
13039 these states are automatically computed from the initial state.
13040 (generate_states): Adjust.
13041 * src/print.c: When reporting a rule number to the user, substract
13042 1, so that the axiom rule is rule 0, and the first user rule is 1.
13043 * src/reduce.c: Likewise.
13044 * src/print_graph.c (print_core): For the time being, just as for
13045 the report, depend upon --trace-flags to dump the full set of
13046 items.
13047 * src/reader.c (readgram): Once the grammar read, insert the rule
13048 0: `$axiom: START-SYMBOL $'.
13049 * tests/set.at: Adjust: rule 0 is now displayed, and since the
13050 number of the states has changed (the final state is no longer
13051 necessarily the last), catch up.
13052
75142d45
AD
130532001-12-27 Akim Demaille <akim@epita.fr>
13054
13055 Try to make the use of the eoftoken valid. Given that its value
13056 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
13057 is used instead of > 0 where appropriate, (ii), depend upon nritems
13058 instead of the 0-sentinel.
13059
13060 * src/gram.h, src/gram.c (nritems): New.
13061 Expected to be duplication of nitems, but for the time being...
13062 * src/reader.c (packgram): Assert nritems and nitems are equal.
13063 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
13064 * src/closure.c (print_closure, print_fderives): Likewise.
13065 * src/gram.c (ritem_print): Likewise.
13066 * src/print.c (print_core, print_grammar): Likewise.
13067 * src/print_graph.c: Likewise.
13068
b7c49edf
AD
130692001-12-27 Akim Demaille <akim@epita.fr>
13070
13071 * src/main.c (main): If there are complains after grammar
13072 reductions, then output the report anyway if requested, then die.
13073 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
13074 * src/reader.c (eoftoken): New.
13075 (parse_token_decl): If the token being defined has value `0', it
13076 is the eoftoken.
13077 (packsymbols): No longer hack `tags' to insert `$' by hand.
13078 Be sure to preserve the value of the eoftoken.
13079 (reader): Make sure eoftoken is defined.
13080 Initialize nsyms to 0: now eoftoken is created just like the others.
13081 * src/print.c (print_grammar): Don't special case the eof token.
13082 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
13083 lie anyway, albeit pleasant.
13084 * tests/calc.at: Exercise error messages with eoftoken.
13085 Change the grammar so that empty input is invalid.
13086 Adjust expectations.
13087 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
13088
ec2da99f
AD
130892001-12-27 Akim Demaille <akim@epita.fr>
13090
13091 * configure.in: Check the protos of strchr ans strspn.
13092 Replace strchr if needed.
13093 * src/system.h: Provide the protos of strchr, strspn and memchr if
13094 missing.
13095 * lib/strchr.c: New.
13096 * src/reader.c (symbols_save): Use strchr.
13097
8adfa272
AD
130982001-12-27 Akim Demaille <akim@epita.fr>
13099
13100 * src/print.c, src/print_graph.c (escape): New.
13101 Use it to quote the TAGS outputs.
13102 * src/print_graph.c (print_state): Now errors are in red, and
13103 reductions in green.
13104 Prefer high to wide: output the state number on a line of its own.
13105
80dac38c
AD
131062001-12-27 Akim Demaille <akim@epita.fr>
13107
13108 * src/state.h, src/state.c (reductions_new): New.
13109 * src/LR0.c (set_state_table): Let all the states have a
13110 `reductions', even if reduced to 0.
13111 (save_reductions): Adjust.
13112 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
13113 * src/print.c (print_reductions, print_actions): Adjust.
13114 * src/output.c (action_row): Adjust.
13115
2cec70b9
AD
131162001-12-27 Akim Demaille <akim@epita.fr>
13117
13118 * src/state.h, src/state.c (errs_new, errs_dup): New.
13119 * src/LR0.c (set_state_table): Let all the states have an errs,
13120 even if reduced to 0.
13121 * src/print.c (print_errs, print_reductions): Adjust.
13122 * src/output.c (output_actions, action_row): Adjust.
13123 * src/conflicts.c (resolve_sr_conflict): Adjust.
13124
13ca549a
AD
131252001-12-27 Akim Demaille <akim@epita.fr>
13126
13127 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
13128
5092aba5
AD
131292001-12-27 Akim Demaille <akim@epita.fr>
13130
13131 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
13132 * src/print.c: here.
13133 (lookaheadset, shiftset): New, used as additional storage by
13134 print_reductions.
13135 (print_results): Adjust.
13136 (print_shifts, print_gotos, print_errs): New, extracted from...
13137 (print_actions): here.
13138 * src/print_graph.c (print_actions): Remove dead code.
13139
11e2beca
AD
131402001-12-27 Akim Demaille <akim@epita.fr>
13141
13142 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
13143 `$n' and `@n'.
13144
dac3c910
AD
131452001-12-27 Akim Demaille <akim@epita.fr>
13146
13147 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
13148 (build_relations): Adjust.
13149
d0b0fefa
AD
131502001-12-27 Akim Demaille <akim@epita.fr>
13151
13152 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
13153 duplication.
13154
adc8c848
AD
131552001-12-27 Akim Demaille <akim@epita.fr>
13156
13157 * src/reader.c (packgram): Catch nitems overflows.
13158
14d293ac
AD
131592001-12-27 Akim Demaille <akim@epita.fr>
13160
13161 * src/files.c, src/files.h (guard_obstack): Remove.
13162 * src/output.c (output): Adjust.
13163 * src/reader.c (parse_braces): New, factoring...
13164 (copy_action, copy_guard): these two which are renamed as...
13165 (parse_action, parse_guard): these.
13166 As a voluntary consequence, using braces around guards is now
13167 mandatory.
13168
f499b062
AD
131692001-12-27 Akim Demaille <akim@epita.fr>
13170
13171 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
13172 * src/reader.c (symbol_list): `guard' and `guard_line' are new
13173 members.
13174 (symbol_list_new): Adjust.
13175 (copy_action): action_line is the first line, not the last.
13176 (copy_guard): Just as for actions, store the `action' only, not
13177 the switch/case/break flesh.
13178 Don't parse the user action that might follow the guard, let...
13179 (readgram): do it, i.e., now, there can be an action after a
13180 guard.
13181 In other words the guard is just explicitly optional.
13182 (packgram): Adjust.
13183 * src/output.c (guards_output): New.
13184 (output_parser): Call it when needed.
13185 (output): Also free the guard and attrs obstacks.
13186 * src/files.c, src/files.h (obstack_save): Remove.
13187 (output_files): Remove.
13188 As a result, if one needs the former `.act' file, using an
13189 appropriate skeleton which requires actions and guards is now
13190 required.
13191 * src/main.c (main): Adjust.
13192 * tests/semantic.at: New.
13193 * tests/regression.at: Use `input.y' as input file name.
13194 Avoid 8+3 problems by requiring input.c when the test needs the
13195 parser.
13196
d945f5cd
AD
131972001-12-27 Akim Demaille <akim@epita.fr>
13198
13199 * src/reader.c (symbol_list_new): Be sure to initialize all the
13200 fields.
13201
d200e455
AD
132022001-12-27 Akim Demaille <akim@epita.fr>
13203
13204 All the hacks using a final pseudo state are now useless.
13205
13206 * src/LR0.c (set_state_table): state_table holds exactly nstates.
13207 * src/lalr.c (nLA): New.
13208 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
13209 instead of lookaheadsp from the pseudo state (nstate + 1).
13210
f9507c28
AD
132112001-12-27 Akim Demaille <akim@epita.fr>
13212
13213 * src/output.c (action_row, token_actions): Use a state_t instead
13214 of a integer, and nlookaheads instead of the following state's
13215 lookaheadsp.
13216
065fbd27
AD
132172001-12-27 Akim Demaille <akim@epita.fr>
13218
13219 * src/conflicts.c (log_resolution, flush_shift)
13220 (resolve_sr_conflict, set_conflicts, solve_conflicts)
13221 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
13222 (conflicts_print, print_reductions): Use a state_t instead of an
13223 integer when referring to a state.
13224 As much as possible, depend upon nlookaheads, instead of the
13225 `lookaheadsp' member of the following state (since lookaheads of
13226 successive states are successive, the difference between state n + 1
13227 and n served as the number of lookaheads for state n).
13228 * src/lalr.c (add_lookback_edge): Likewise.
13229 * src/print.c (print_core, print_actions, print_state)
13230 (print_results): Likewise.
13231 * src/print_graph.c (print_core, print_actions, print_state)
13232 (print_graph): Likewise.
13233 * src/conflicts.h: Adjust.
13234
1b177bd7
AD
132352001-12-27 Akim Demaille <akim@epita.fr>
13236
13237 * src/bison.hairy: Formatting/comment changes.
13238 ANSIfy.
13239 Remove `register' indications.
13240 Add plenty of `static'.
13241
7742ddeb
AD
132422001-12-27 Akim Demaille <akim@epita.fr>
13243
13244 * src/output.c (prepare): Drop the muscle `ntbase' which
13245 duplicates ntokens.
13246 * src/bison.simple: Formatting/comment changes.
13247 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
13248 is an undocumented synonym.
13249
1fa14068
AD
132502001-12-22 Akim Demaille <akim@epita.fr>
13251
13252 * src/output.c (output_table_data): Change the prototype to use
13253 `int' for array ranges: some invocations do pass an int, not a
13254 short.
13255 Reported by Wayne Green.
13256
b9752825
AD
132572001-12-22 Akim Demaille <akim@epita.fr>
13258
13259 Some actions of web2c.y are improperly triggered.
13260 Reported by Mike Castle.
13261
13262 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
13263 * tests/regression.at (Web2c): Rename as...
13264 (Web2c Report): this.
13265 (Web2c Actions): New.
13266
776209d6
AD
132672001-12-22 Akim Demaille <akim@epita.fr>
13268
13269 Reductions in web2c.y are improperly reported.
13270 Reported by Mike Castle.
13271
13272 * src/conflicts.c (print_reductions): Fix.
13273 * tests/regression.at (Web2c): New.
13274
275fc3ad
AD
132752001-12-18 Akim Demaille <akim@epita.fr>
13276
13277 Some host fail on `assert (!"foo")', which expands to
13278 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
13279 Reported by Nelson Beebee.
13280
13281 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
13282 `#define it_succeeded 0' and `assert (it_succeeded)'.
13283
897668ee
MA
132842001-12-17 Marc Autret <autret_m@epita.fr>
13285
13286 * src/bison.simple: Don't hard code the skeleton line and filename.
13287 * src/output.c (output_parser): Rename 'line' as 'output_line'.
13288 New line counter 'skeleton_line' (skeleton-line muscle).
13289
ab3399e0
PE
132902001-12-17 Paul Eggert <eggert@twinsun.com>
13291
13292 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
13293 YYDEBUG must be defined to a nonzero value.
13294
13295 * src/bison.simple (yytname): Do not assume that the user defines
13296 YYDEBUG to a properly parenthesized expression.
13297
3877f72b
AD
132982001-12-17 Akim Demaille <akim@epita.fr>
13299
13300 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
13301 nlookaheads is a new member.
13302 Adjust all users.
13303 * src/lalr.h (nlookaheads): Remove this orphan declaration.
13304 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
13305 state.
776209d6 13306
331dbc1b
AD
133072001-12-17 Akim Demaille <akim@epita.fr>
13308
13309 * src/files.h, src/files.c (open_files, close_files): Remove.
13310 * src/main.c (main): Don't open/close files, nor invoke lex_free,
13311 let...
13312 * src/reader.c (reader): Do it.
776209d6 13313
be750e4c
AD
133142001-12-17 Akim Demaille <akim@epita.fr>
13315
13316 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 13317
709ae8c6
AD
133182001-12-17 Akim Demaille <akim@epita.fr>
13319
13320 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
13321 (flush_reduce): New.
13322 (resolve_sr_conflict): Adjust.
776209d6 13323
f87685c3
AD
133242001-12-17 Akim Demaille <akim@epita.fr>
13325
13326 * src/output.c (output_obstack): Be static and rename as...
13327 (format_obstack): this, to avoid any confusion with files.c's
13328 output_obstack.
13329 * src/reader.h (muscle_obstack): Move to...
13330 * src/output.h: here, since it's defined in output.c.
13331
837491d8
AD
133322001-12-17 Akim Demaille <akim@epita.fr>
13333
13334 * src/output.c (action_row, save_column, default_goto)
13335 (sort_actions, matching_state, pack_vector): Better variable
13336 locality.
13337
796d61fb
AD
133382001-12-17 Akim Demaille <akim@epita.fr>
13339
13340 * src/output.c: Various formatting changes.
776209d6 13341
64d15509
AD
133422001-12-17 Akim Demaille <akim@epita.fr>
13343
13344 * src/files.c (output_files): Free the output_obstack.
13345 * src/main.c (main): Call print and print_graph conditionally.
13346 * src/print.c (print): Work unconditionally.
13347 * src/print_graph.c (print_graph): Work unconditionally.
13348 * src/conflicts.c (log_resolution): Output only if verbose_flag.
13349
fbc8ecb7
MA
133502001-12-16 Marc Autret <autret_m@epita.fr>
13351
13352 * src/output.c (actions_output): Fix. When we use %no-lines,
13353 there is one less line per action.
13354
f0440388
MA
133552001-12-16 Marc Autret <autret_m@epita.fr>
13356
13357 * src/bison.simple: Remove a useless #line directive.
13358 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
13359 * src/output.c (get_lines_number): New.
776209d6 13360 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
13361 output muscles.
13362 Fix line numbering.
13363 (actions_output): Computes the number of lines taken by actions.
13364 (output_master_parser): Insert new skeleton which is the name of
13365 the output parser file name.
13366
a79986b8
MA
133672001-12-15 Marc Autret <autret_m@epita.fr>
13368
13369 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
13370
4ec8e00f
MA
133712001-12-15 Marc Autret <autret_m@epita.fr>
13372
13373 * src/output.c (output_gram): Keep track of the hairy one.
13374
1a4648ff
AD
133752001-12-15 Akim Demaille <akim@epita.fr>
13376
13377 Make `make distcheck' work.
13378
13379 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
13380 system.h which uses libgettext.h.
13381
9c2c67e6
AD
133822001-12-15 Akim Demaille <akim@epita.fr>
13383
13384 * src/nullable.c (set_nullable): Useless rules must be skipped,
13385 otherwise, since we range over their symbols, we might look at a
13386 nonterminal which no longer ``exists'', i.e., it is not counted in
13387 `nvars', hence we overflow our arrays.
13388
93ede233
AD
133892001-12-15 Akim Demaille <akim@epita.fr>
13390
13391 The header can also be produced directly, without any obstack!
13392 Yahoo!
13393
13394 * src/files.c, src/files.h (defines_obstack): Remove.
13395 (compute_header_macro): Global.
13396 (defines_obstack_save): Remove.
13397 * src/reader.c (parse_union_decl): No longer output to
13398 defines_obstack: its content can be found in the `stype' muscle
13399 anyway.
13400 (output_token_translations): Merge into...
13401 (symbols_output): this.
13402 Rename as...
13403 (symbols_save): this.
13404 (reader): Adjust.
13405 * src/output.c (header_output): New.
13406 (output): Call it.
13407
2666f928
AD
134082001-12-15 Akim Demaille <akim@epita.fr>
13409
13410 * src/reader.c (parse_union_decl): Instead of handling two obstack
13411 simultaneously, use one to define the `stype' muscle, and use the
13412 value of the latter to fill defines_obstack.
13413 (copy_comment): Remove.
13414 (copy_comment2): Work for a single obstack.
13415 Rename as...
13416 (copy_comment): this.
13417
428046f8
AD
134182001-12-15 Akim Demaille <akim@epita.fr>
13419
13420 * src/lex.c, src/lex.h (xgetc): No longer static.
13421 * src/reader.c (parse_union_decl): Revamp.
13422
ea52d706
AD
134232001-12-15 Akim Demaille <akim@epita.fr>
13424
13425 Still making progress in separating Bison into (i) input, (ii)
13426 process, (iii) output: now we can directly output the parser file
13427 without using table_obstack at all.
13428
13429 * src/files.c, src/files.h (table_obstack): Bye bye.
13430 (parser_file_name): New.
13431 * src/files.c (compute_output_file_names): Compute it.
13432 * src/output.c (actions_output, output_parser)
13433 (output_master_parser): To a file instead of an obstack.
13434
3f96f4dc
AD
134352001-12-15 Akim Demaille <akim@epita.fr>
13436
13437 Attach actions to rules, instead of pre-outputting them to
13438 actions_obstack.
13439
13440 * src/gram.h (rule_t): action and action_line are new members.
13441 * src/reader.c (symbol_list): Likewise.
13442 (copy_action): Save the actions within the rule.
13443 (packgram): Save them in rule_table.
13444 * src/output.c (actions_output): New.
13445 (output_parser): Use it on `%%actions'.
13446 (output_rule_data): Don't free rule_table.
13447 (output): Do it.
13448 (prepare): Don't save the `action' muscle.
13449 * src/bison.simple: s/%%action/%%actions/.
13450
51576fb3
AD
134512001-12-15 Akim Demaille <akim@epita.fr>
13452
13453 * src/reader.c (copy_action): When --yacc, don't append a `;'
13454 to the user action: let it fail if lacking.
dee049eb 13455 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 13456
2648a72d
AD
134572001-12-14 Akim Demaille <akim@epita.fr>
13458
13459 * src/lex.c (literalchar): Simply return the char you decoded, non
13460 longer mess around with obstacks and int pointers.
13461 Adjust all callers.
13462
92790e5b
AD
134632001-12-14 Akim Demaille <akim@epita.fr>
13464
13465 * src/lex.c (literalchar): Don't escape the special characters,
13466 just decode them, and keep them as char (before, eol was output as
13467 the 2 char string `\n' etc.).
13468 * src/output.c (output_rule_data): Use quotearg to output the
13469 token strings.
13470
927c1557
PE
134712001-12-13 Paul Eggert <eggert@twinsun.com>
13472
13473 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
13474 Do not infringe on the global user namespace when using C++.
13475 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
13476 All uses of `fprintf' and `stderr' changed.
13477
13478 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
13479
ed8e1f68
AD
134802001-12-13 Akim Demaille <akim@epita.fr>
13481
13482 The computation of nullable is broken: it doesn't handle empty
13483 RHS's properly.
13484
13485 * tests/torture.at (GNU AWK Grammar): New.
13486 * tests/sets.at (Nullable): New.
13487 * src/nullable.c (set_nullable): Instead of blindly looping over
13488 `ritems', loop over the rules, and then over their rhs's.
13489
13490 Work around Autotest bugs.
13491
13492 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
13493 frame, because Autotest understand lines starting with a `+' as
13494 traces from the shell. Then, they are not processed properly.
13495 Admittedly an Autotest bug, but we don't have time to wait for
13496 Autotest to catch up.
13497 * tests/regression.at (Broken Closure): Adjust to the new table
13498 frames.
13499 Move to...
13500 * tests/sets.at: here.
13501
cb581495
AD
135022001-12-13 Akim Demaille <akim@epita.fr>
13503
13504 * src/closure.c (closure): Use nrules instead of playing tricks
13505 with BITS_PER_WORD.
13506
2e729273
AD
135072001-12-13 Akim Demaille <akim@epita.fr>
13508
13509 * src/print.c (print_actions): Output the handling of `$' as the
13510 traces do: shifting the token EOF. Before EOF was treated as a
13511 nonterminal.
13512 * tests/regression.at: Adjust some tests.
13513 * src/print_graph.c (print_core): Complete the set of items via
13514 closure. The next-to-final and final states are still unsatisfying,
13515 but that's to be addressed elsewhere.
13516 No longer output the rule numbers, but do output the state number.
13517 A single loop for the shifts + gotos is enough, but picked a
13518 distinct color for each.
13519 (print_graph): Initialize and finalize closure.
13520
107f7dfb
AD
135212001-12-13 Akim Demaille <akim@epita.fr>
13522
13523 * src/reader.c (readgram): Remove dead code, an strip useless
13524 braces.
13525 (get_type): Remove, unused.
13526
9b53a24f
AD
135272001-12-12 Akim Demaille <akim@epita.fr>
13528
13529 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
13530 on that of lib/error.c.
13531
dbfb6dcd
AD
135322001-12-12 Akim Demaille <akim@epita.fr>
13533
13534 Some hosts don't like `/' in includes.
13535
13536 * src/system.h: Include libgettext.h without qualifying the path.
13537 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
13538 $(top_srcdir).
13539
c25fb648
MA
135402001-12-11 Marc Autret <autret_m@epita.fr>
13541
13542 * src/output.c (output_parser): Remove useless muscle.
13543
710ddc4f
MA
135442001-12-11 Marc Autret <autret_m@epita.fr>
13545
13546 * src/bison.simple: Remove #line just before %%epilogue. It
13547 is now handled in ...
13548 * src/reader.c (read_additionnal_code): Add the output of a
13549 #line for the epilogue.
13550
e83d80b8
MA
135512001-12-10 Marc Autret <autret_m@epita.fr>
13552
927c1557 13553 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
13554 replace precedent remove.
13555 * src/bison.simple: Remove #line before %%prologue because
13556 %%input-line is wrong at this time.
13557
971d5158
MA
135582001-12-10 Marc Autret <autret_m@epita.fr>
13559
13560 * src/reader.c (symbols_output): Clean up.
927c1557 13561 * src/output.c (output_gram, output): Clean up.
971d5158 13562
5edafffd
AD
135632001-12-10 Akim Demaille <akim@epita.fr>
13564
13565 * src/lalr.c (initialize_lookaheads): New. Extracted from...
13566 * src/LR0.c (set_state_table): here.
13567 * src/lalr.c (lalr): Call it.
13568
0279f8e9
AD
135692001-12-10 Akim Demaille <akim@epita.fr>
13570
13571 * src/state.h (shifts): Remove the `number' member: shifts are
13572 attached to state, hence no longer need to be labelled with a
13573 state number.
13574
190c4f5f
AD
135752001-12-10 Akim Demaille <akim@epita.fr>
13576
13577 Now that states have a complete set of members, the linked list of
13578 shifts is useless: just fill directly the state's shifts member.
13579
13580 * src/state.h (shifts): Remove the `next' member.
13581 * src/LR0.c (first_state, last_state): Remove.
13582 Adjust the callers.
13583 (augment_automaton): Don't look for the shifts that must be added
13584 a shift on EOF: it is those of the state we looked for! But now,
13585 since shifts are attached, it is no longer needed to looking
13586 merely by its id: its number.
13587
2a73b93d
AD
135882001-12-10 Akim Demaille <akim@epita.fr>
13589
13590 * src/LR0.c (augment_automaton): Better variable locality.
13591 Remove an impossible branch: if there is a state corresponding to
13592 the start symbol being shifted, then there is shift for the start
13593 symbol from the initial state.
13594
74392f6a
AD
135952001-12-10 Akim Demaille <akim@epita.fr>
13596
13597 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
13598 only when appropriate: when insert_start_shifting_state' is not
13599 invoked.
13600 * tests/regression.at (Rule Line Numbers): Adjust.
13601
37c82725
AD
136022001-12-10 Akim Demaille <akim@epita.fr>
13603
13604 * src/LR0.c (augment_automaton): Now that all states have shifts,
13605 merge the two cases addition shifts to the initial state.
13606
6a164e0c
AD
136072001-12-10 Akim Demaille <akim@epita.fr>
13608
13609 * src/lalr.c (set_state_table): Move to...
13610 * src/LR0.c: here.
13611 * src/lalr.c (lalr): Don't call it...
13612 * src/LR0.c (generate_states): do it.
13613 * src/LR0.h (first_state): Remove, only the table is used.
13614
7215de24
AD
136152001-12-10 Akim Demaille <akim@epita.fr>
13616
13617 * src/LR0.h (first_shift, first_reduction): Remove.
13618 * src/lalr.c: Don't use first_shift: find shifts through the
13619 states.
13620
80e25d4d
AD
136212001-12-10 Akim Demaille <akim@epita.fr>
13622
13623 * src/LR0.c: Attach shifts to states as soon as they are
13624 computed.
13625 * src/lalr.c (set_state_table): Instead of assigning shifts to
13626 state, just assert that the mapping was properly done.
13627
0ab3728b
AD
136282001-12-10 Akim Demaille <akim@epita.fr>
13629
13630 * src/LR0.c (insert_start_shift): Rename as...
13631 (insert_start_shifting_state): this.
13632 (insert_eof_shifting_state, insert_accepting_state): New.
13633 (augment_automaton): Adjust.
13634 Better locality of the variables.
13635 When looking if the start_symbol is shifted from the initial
13636 state, using `while (... symbol != start_symbol ...)' sounds
13637 better than `while (... symbol < start_symbol ...)': If fail
13638 to see how the order between symbols could be relevant!
13639
78af9bbc
AD
136402001-12-10 Akim Demaille <akim@epita.fr>
13641
13642 * src/getargs.h: Don't declare `spec_name_prefix' and
13643 `spec_file_prefix', declared by src/files.h.
13644 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
13645 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
13646 * src/output.c (prepare): Adjust.
13647 * src/reader.c (symbols_output): Likewise.
13648 * src/vmsgetargs.c: Vaguely adjust, but who cares?
13649
bdef2a41
AD
136502001-12-10 Akim Demaille <akim@epita.fr>
13651
13652 * src/muscle_tab.c (muscle_init): NULL is a better default than
13653 `"0"'.
13654
3735969c
AD
136552001-12-10 Akim Demaille <akim@epita.fr>
13656
13657 * src/reader.c (reader): Calling symbols_output once is enough.
13658
49701457
AD
136592001-12-10 Akim Demaille <akim@epita.fr>
13660
13661 Now that states have a complete set of members, the linked list of
13662 reductions is useless: just fill directly the state's reductions
13663 member.
13664
13665 * src/state.h (struct reductions): Remove member `number' and
13666 `next'.
13667 * src/LR0.c (first_reduction, last_reduction): Remove.
13668 (save_reductions): Don't link the new reductions, store them in
13669 this_state.
13670 * src/lalr.c (set_state_table): No need to attach reductions to
13671 states, it's already done.
13672 * src/output.c (output_actions): No longer free the shifts, then
13673 the reductions, then the states: free all the states and their
13674 members.
13675
0edad749
AD
136762001-12-10 Akim Demaille <akim@epita.fr>
13677
13678 * src/options.c (OPTN, DRTV, BOTH): New.
13679 (option_table): Use them.
13680
0edad749
AD
13681 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
13682 the job of system.h.
13683 * src/options.c: Don't include stdio.h and xalloc.h for the same
13684 reasons.
13685
5449dd0f
AD
136862001-12-10 Akim Demaille <akim@epita.fr>
13687
13688 * src/output.c (output, prepare): Make sure the values of the
13689 muscles `action' and `prologue' are 0-terminated.
13690
a870c567
AD
136912001-12-10 Akim Demaille <akim@epita.fr>
13692
13693 Clean up GCC warnings.
13694
13695 * src/reader.c (copy_action): `buf' is not used.
13696 (parse_skel_decl): Be static.
13697 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
13698 * src/options.h (create_long_option_table): Have a real prototype.
13699 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
13700 (hash_delete_at): Return const void *.
13701 Adjust casts to preserve the const.
13702
80df8768
AD
137032001-12-10 Akim Demaille <akim@epita.fr>
13704
13705 * configure.in: Require 2.52g.
13706 M4 is not needed, but AUTOM4TE is.
13707 * m4/m4.m4: Remove.
13708 * tests/Makefile.am: Adjust.
13709
f693ad14
AD
137102001-12-10 Akim Demaille <akim@epita.fr>
13711
13712 One structure for states is enough, even though theoretically
13713 there are LR(0) states and LALR(1) states.
13714
13715 * src/lalr.h (state_t): Remove.
13716 (state_table): Be state_t **, not state_t *.
13717 * src/state.h (core, CORE_ALLOC): Rename as...
13718 (state_t, STATE_ALLOC): this.
13719 Add the LALR(1) members: shifts, reductions, errs.
13720 * src/LR0.c (state_table): Rename as...
13721 (state_hash): this, to avoid name clashes with the global
13722 `state_table'.
13723 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
13724 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
13725
74ffbcb6
AD
137262001-12-10 Akim Demaille <akim@epita.fr>
13727
13728 Bison dumps core on bash.y.
13729 Reported by Pascal Bart.
13730
13731 * src/warshall.c (bitmatrix_print): New.
13732 (TC): Use it.
ba0fe3c7 13733 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
13734 j must be the outer loop.
13735 * tests/regression.at (Broken Closure): New.
13736
07708e19
AD
137372001-12-05 Akim Demaille <akim@epita.fr>
13738
13739 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
13740 its argument.
ba1ecc07 13741 Reported by Peter Hamorsky.
07708e19 13742
92b16366
AD
137432001-12-05 Akim Demaille <akim@epita.fr>
13744
13745 * src/conflicts.c (err_table): Remove.
13746 (resolve_sr_conflict): Adjust.
13747 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
13748 Rename as...
13749 (state_t.reductions, state_t.shifts): this.
13750
076ab033
AD
137512001-12-05 Akim Demaille <akim@epita.fr>
13752
13753 * src/reduce.c (reduce_grammar_tables): No longer disable the
13754 removal of useless rules via CPP but via `if (0)', so that the
13755 compiler still check the code is valid.
13756 For instance, it should have noticed `rline' no longer exists: use
13757 the `line' member of rule_t.
13758 * src/gram.c (dummy, rline): Remove, unused.
13759
3843c413
AD
137602001-12-05 Akim Demaille <akim@epita.fr>
13761
13762 * src/output.c (pack_vector): Use assert, not berror.
13763 * src/main.c (berror): Remove, unused.
13764
43168960
AD
137652001-12-05 Akim Demaille <akim@epita.fr>
13766
13767 New experimental feature: if --verbose --trace output all the
13768 items of a state, not only its kernel.
13769
13770 * src/print.c (print_core): If `trace_flag', then invoke closure
13771 before outputting the items of the state (print_core is no longer
13772 a correct name them).
13773 (print_results): Invoke new_closure/free_closure if needed.
13774
b2872512
AD
137752001-12-05 Akim Demaille <akim@epita.fr>
13776
13777 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
13778 * src/closure.c, src/closure.h (itemsetsize): Rename as...
13779 (nitemset): for consistency with the rest of the project.
13780
23cbcc6c
AD
137812001-12-05 Akim Demaille <akim@epita.fr>
13782
13783 * src/closure.c (print_closure): Improve.
13784 (closure): Use it for printing input and output.
13785
03ec521c
AD
137862001-12-05 Akim Demaille <akim@epita.fr>
13787
13788 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
13789 indexed by nonterminals.
13790
3a7456dd
AD
137912001-12-05 Akim Demaille <akim@epita.fr>
13792
13793 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
13794 what it was!).
13795 * src/warshall.h: Remove accidental duplication of the content.
13796
1cbcf2e7
AD
137972001-12-05 Akim Demaille <akim@epita.fr>
13798
13799 * src/closure.c (set_fderives): De-obfuscate.
13800
84182270
AD
138012001-12-05 Akim Demaille <akim@epita.fr>
13802
13803 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
13804
3f6f053c
AD
138052001-12-05 Akim Demaille <akim@epita.fr>
13806
13807 * src/closure.c (set_firsts): De-obfuscate.
13808
7a5350ba
AD
138092001-12-05 Akim Demaille <akim@epita.fr>
13810
13811 * src/output.c (action_row): De-obfuscate
13812 using the good o' techniques: arrays not pointers, variable
13813 locality, BITISSET, RESETBIT etc.
13814
d954473d
AD
138152001-12-05 Akim Demaille <akim@epita.fr>
13816
13817 Pessimize the code to simplify it: from now on, all the states
13818 have a valid SHIFTS, which NSHIFTS is possibly 0.
13819
13820 * src/LR0.c (shifts_new): Be global and move to..
13821 * src/state.c, src/state.h: here.
13822 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
13823 * src/print_graph: Adjust.
13824
9839bbe5
AD
138252001-12-05 Akim Demaille <akim@epita.fr>
13826
13827 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
13828 * src/conflicts.c: Use it.
13829 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
13830 incorrectly ``simplified''.
13831
9f136c07
AD
138322001-12-05 Akim Demaille <akim@epita.fr>
13833
13834 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
13835 using the good o' techniques: arrays not pointers, variable
13836 locality, BITISSET, RESETBIT etc.
13837
b608206e
AD
138382001-12-05 Akim Demaille <akim@epita.fr>
13839
13840 * src/state.h (SHIFT_SYMBOL): New.
13841 * src/conflicts.c: Use it to deobfuscate.
13842
52afa962
AD
138432001-12-05 Akim Demaille <akim@epita.fr>
13844
13845 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
13846 (print_reductions): De-obfuscate using the good o' techniques:
13847 arrays not pointers, variable locality, BITISSET.
13848
e74dc321
AD
138492001-12-05 Akim Demaille <akim@epita.fr>
13850
13851 * src/conflicts.c (print_reductions): Arrays, not pointers.
13852 Use BITISSET.
13853
768fca83
AD
138542001-12-05 Akim Demaille <akim@epita.fr>
13855
13856 * src/conflicts.c (print_reductions): Pessimize, but clarify.
13857
a17e599f
AD
138582001-12-05 Akim Demaille <akim@epita.fr>
13859
13860 * src/conflicts.c (print_reductions): Improve variable locality.
13861
a04bc341
AD
138622001-12-05 Akim Demaille <akim@epita.fr>
13863
13864 * src/conflicts.c (print_reductions): Pessimize, but clarify.
13865
c8ea038e
AD
138662001-12-05 Akim Demaille <akim@epita.fr>
13867
13868 * src/conflicts.c (print_reductions): Improve variable locality.
13869
aa2aab3c
AD
138702001-12-05 Akim Demaille <akim@epita.fr>
13871
13872 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
13873 * src/lalr.c: Use them.
13874
b178c8cc
AD
138752001-12-05 Akim Demaille <akim@epita.fr>
13876
13877 * src/LR0.c (augment_automaton): Formatting changes.
13878 Better variable locality.
13879
f67d13aa
AD
138802001-12-05 Akim Demaille <akim@epita.fr>
13881
13882 * src/lalr.c (matrix_print): New.
13883 (transpose): Use it.
13884 Use arrays instead of pointers.
13885
c2713865
AD
138862001-12-05 Akim Demaille <akim@epita.fr>
13887
13888 * src/lalr.c (maxrhs): Move to...
13889 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
13890 * src/lalr.c (build_relations): Adjust.
13891
9887c18a
AD
138922001-12-05 Akim Demaille <akim@epita.fr>
13893
13894 * src/lalr.c (transpose): Free the memory allocated to the
13895 argument, as it is replaced by the results by the unique caller.
13896 (build_relations): Merely invoke transpose: it handles the memory
13897 deallocation.
13898 Improve variable locality.
13899 Avoid variables used as mere abbreviations.
13900 (compute_lookaheads): Use arrays instead of pointers.
13901
4d4f699c
AD
139022001-12-05 Akim Demaille <akim@epita.fr>
13903
13904 * src/lalr.c (initialize_F): Improve variable locality.
13905 Avoid variables used as mere abbreviations.
13906
80a69750
AD
139072001-12-05 Akim Demaille <akim@epita.fr>
13908
13909 * src/derives.c (print_derives): Display the ruleno.
13910 * src/lalr.c (initialize_F, transpose): Better variable locality
13911 to improve readability.
13912 Avoid variables used as mere abbreviations.
13913
fe961097
AD
139142001-12-05 Akim Demaille <akim@epita.fr>
13915
13916 * src/lalr.c (traverse): Use arrays instead of pointers.
13917
e3e4e814
AD
139182001-12-05 Akim Demaille <akim@epita.fr>
13919
13920 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
13921 the handling of squeue.
13922 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
13923
630e182b
AD
139242001-12-05 Akim Demaille <akim@epita.fr>
13925
13926 Because useless nonterminals are now kept alive (instead of being
13927 `destroyed'), we now sometimes examine them, and store information
13928 related to them. Hence we need to know their number, and adjust
13929 memory allocations.
13930
13931 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
13932 static.
13933 * src/LR0.c (allocate_itemsets): The memory allocated to
13934 `symbol_count' was used for two different purpose: once to count
13935 the number of occurrences of each symbol, and later reassigned to
13936 `shift_symbol', containing the symbol that can be shifted from a
13937 given state.
13938 Deobfuscate, i.e., allocate, use and free `symbol_count' here
13939 only, and...
13940 (new_itemsets): Allocate `shift_symbol' here.
13941 (allocate_itemsets): symbol_count includes useless nonterminals.
13942 Make room for them.
13943 (free_storage): Use `free', not `XFREE', for pointers that cannot
13944 be null.
13945
81b51460
AD
139462001-12-05 Akim Demaille <akim@epita.fr>
13947
13948 * src/nullable.c (set_nullable): Deobfuscate the handling of
13949 ritem.
13950 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
13951
3067fbef
AD
139522001-12-05 Akim Demaille <akim@epita.fr>
13953
13954 * src/gram.c, src/gram.h (ritem_print): New.
13955 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
13956 (This useless function was defined only to work around VMS linkers
13957 that can't handle compilation units with variables only).
13958 * src/reduce.c (dump_grammar): Use it to trace the construction of
13959 ritem.
13960
c2bea5f9
PE
139612001-12-04 Paul Eggert <eggert@twinsun.com>
13962
7d27c823
PE
13963 * src/bison.simple (union yyalloc): Change member names
13964 to be the same as the stack names.
13965 (yyparse): yyptr is now union yyalloc *, not char *.
13966 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
13967 and may generate better code on some machines.
c2bea5f9
PE
13968 (yystpcpy): Use prototype if __STDC__ is defined, not just
13969 if __cplusplus is defined.
35687a9d 13970
2c8a9dfa
AD
139712001-11-30 Akim Demaille <akim@epita.fr>
13972
13973 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
13974 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
13975 Gettext doesn't compile cleanly, and dies with -Werror.
13976 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
13977 Include WARNING_CFLAGS here.
13978 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
13979 before being defined.
13980
f4e421e6
AD
139812001-11-27 Paul Eggert <eggert@twinsun.com>
13982
13983 * lib/quotearg.h (quotearg_n, quotearg_n_style):
13984 First arg is int, not unsigned.
13985 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
13986 (SIZE_MAX, UINT_MAX): New macros.
13987 (quotearg_n_options): Abort if N is negative.
13988 Avoid overflow check on hosts where size_t is 64 bits and int
13989 is 32 bits, as overflow is impossible there.
13990 Fix off-by-one typo that caused unnecessary reallocation.
13991
7093d0f5
AD
139922001-11-29 Paul Eggert <eggert@twinsun.com>
13993
13994 Name space cleanup in generated parser.
13995
13996 * doc/bison.texinfo (Bison Parser): Discuss system headers
13997 and their effect on the user name space.
13998
13999 * src/bison.simple:
14000 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
14001 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
14002 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
14003
14004 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
14005 on user names when possible.
14006
14007 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
14008 Simplify test for whather <alloca.h> exists.
14009
14010 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
14011
14012 (<stdio.h>): Include if YYDEBUG.
14013
14014 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
14015 ! defined (yyoverflow) && ! defined (yymemcpy).
14016
14017 (yymemcpy, yyparse): Rename local variables as needed so that
14018 they all begin with 'yy'.
14019
14020 (yystrlen, yystpcpy): New functions.
14021
14022 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
14023 All uses changed.
14024
14025 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
14026 instead of relying on string.h functions. Use YYSTACK_ALLOC
14027 and YYSTACK_FREE instead of malloc and free.
14028
fd51e5ff
AD
140292001-11-30 Akim Demaille <akim@epita.fr>
14030
14031 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
14032 before their first uses.
14033 (YYBISON, YYPURE): Move to the top of the output.
14034
7d13ff5f
AD
140352001-11-30 Akim Demaille <akim@epita.fr>
14036
14037 * tests/reduce.at (Useless Nonterminals): Fix.
14038
892a3995
AD
140392001-11-30 Akim Demaille <akim@epita.fr>
14040
14041 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
14042 if body instead of `;' to pacify GCC's warnings.
14043
68f1e3ed
AD
140442001-11-30 Akim Demaille <akim@epita.fr>
14045
14046 Instead of mapping the LHS of unused rules to -1, keep the LHS
14047 valid, but flag the rules as invalid.
14048
14049 * src/gram.h (rule_t): `useful' is a new member.
14050 * src/print.c (print_grammar): Adjust.
14051 * src/derives.c (set_derives): Likewise.
14052 * src/reader.c (packgram, reduce_output): Likewise.
14053 * src/reduce.c (reduce_grammar_tables): Likewise.
14054 * tests/reduce.at (Underivable Rules, Useless Rules): New.
14055
d2d1b42b
AD
140562001-11-30 Akim Demaille <akim@epita.fr>
14057
14058 * src/reduce.c (reduce_output): Formatting changes.
14059 * src/print.c (print_results, print_grammar): Likewise.
14060 * tests/regression.at (Rule Line Numbers)
14061 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
14062
760b53a8
AD
140632001-11-30 Akim Demaille <akim@epita.fr>
14064
14065 * src/reduce.c (nonterminals_reduce): Instead of throwing away
14066 useless nonterminals, move them at the end of the symbol arrays.
14067 (reduce_output): Adjust.
14068 * tests/reduce.at (Useless Nonterminals): Adjust.
14069
00238958
AD
140702001-11-30 Akim Demaille <akim@epita.fr>
14071
14072 * src/reduce.c: Various comment/formatting changes.
14073 (nonterminals_reduce): New, extracted from...
14074 (reduce_grammar_tables): here.
14075 (reduce_grammar): Call nonterminals_reduce.
14076
396452de
PE
140772001-11-29 Paul Eggert <eggert@twinsun.com>
14078
14079 * src/bison.simple (YYSTACK_REALLOC): Remove.
14080 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
14081 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
14082 New macros.
14083 (union yyalloc): New type.
14084 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
14085 an arbitrary restriction on hosts where size_t is wider than int.
14086
14087 (yyparse): Don't dump core if alloca or malloc fails; instead, report
14088 a parser stack overflow. Allocate just one block of memory for all
14089 three stacks, instead of allocating three blocks; this typically is
14090 faster and reduces fragmentation.
14091
14092 Do not limit the number of items in the stack to a value that fits
14093 in 'int', as this is an arbitrary limit on hosts with 64-bit
14094 size_t and 32-bit int.
14095
147e184c
MA
140962001-11-29 Marc Autret <autret_m@epita.fr>
14097
14098 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
14099 of defining YYERROR_VERBOSE.
14100 [AT_DATA]: $4 is now out of C declarations in the prologue.
14101
426cf563
MA
141022001-11-28 Marc Autret <autret_m@epita.fr>
14103
14104 * src/reader.c (parse_dquoted_param): New.
14105 (parse_skel_decl): Use it.
14106 * src/lex.h: Add its prototype.
14107 * src/lex.c (literalchar): Become not static.
14108
c7925b99
MA
141092001-11-28 Marc Autret <autret_m@epita.fr>
14110
14111 * src/output.h: And put its extern declaration here.
14112 * src/output.c (error_verbose): Define here.
14113 (prepare): Echo name modification.
14114 * src/getargs.h: Clean its extern declaration.
14115 * src/getargs.c (error_verbose_flag): Remove.
14116 (getargs): Remove case 'e'.
14117 * src/options.c (option_table): 'error-verbose' is now seen as simple
14118 percent option.
14119 Include output.h.
14120
14121 * src/reader.c (read_declarations): Remove case tok_include.
14122 (parse_include_decl): Remove.
14123 * src/lex.h (token_t): Remove tok_include.
14124 * src/options.c (option_table): 'include' is now a simple command line
14125 option.
14126
5b5d1929
MA
141272001-11-28 Marc Autret <autret_m@epita.fr>
14128
14129 * src/bison.simple: Adjust muscle names.
14130 * src/muscle_tab.c (muscle_init): Also rename the muscles.
14131 * src/output.c (prepare): s/_/-/ for the muscles names.
14132 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
14133
8850be4b
MA
141342001-11-28 Marc Autret <autret_m@epita.fr>
14135
14136 * src/bison.simple: Fix debug.
14137 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
14138
4a38e613
AD
141392001-11-28 Akim Demaille <akim@epita.fr>
14140
14141 * src/LR0.c (shifts_new): New.
14142 (save_shifts, insert_start_shift, augment_automaton): Use it.
14143
4b35e1c1
AD
141442001-11-28 Akim Demaille <akim@epita.fr>
14145
14146 * src/closure.c (closure): `b' and `ruleno' denote the same value:
14147 keep ruleno only.
14148
d2b04478
AD
141492001-11-28 Akim Demaille <akim@epita.fr>
14150
14151 * src/closure.c (closure): Instead of looping over word in array
14152 then bits in words, loop over bits in array.
14153
2c4c30aa
AD
141542001-11-28 Akim Demaille <akim@epita.fr>
14155
14156 * src/closure.c (closure): No longer optimize the special case
14157 where all the bits of `ruleset[r]' are set to 0, to make the code
14158 clearer.
14159
576890b7
AD
141602001-11-28 Akim Demaille <akim@epita.fr>
14161
14162 * src/closure.c (closure): `r' and `c' are new variables, used to
14163 de-obfuscate accesses to RULESET and CORE.
14164
cb487d7d
AD
141652001-11-28 Akim Demaille <akim@epita.fr>
14166
14167 * src/reduce.c (reduce_print): Use ngettext.
14168 (dump_grammar): Improve the trace accuracy.
14169
6013d43f
AD
141702001-11-28 Akim Demaille <akim@epita.fr>
14171
14172 * src/reduce.c (dump_grammar): Don't translate trace messages.
14173
cb4956ee
AD
141742001-11-28 Akim Demaille <akim@epita.fr>
14175
14176 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
14177 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
14178 as all tags are free'ed afterwards.
14179 From Enrico Scholz.
14180
648185ab
PE
141812001-11-27 Paul Eggert <eggert@twinsun.com>
14182
14183 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
14184 use alloca when we didn't want to, and vice versa.
14185
68254a03
MA
141862001-11-27 Marc Autret <autret_m@epita.fr>
14187
9113b58f
AD
14188 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
14189 initialization.
68254a03
MA
14190 * src/output.c (prepare): Remove its update.
14191
04d843a2
MA
141922001-11-27 Marc Autret <autret_m@epita.fr>
14193
14194 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
14195 Use %error-verbose.
14196
d2079671 141972001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
14198
14199 * src/bison.simple: Remove YYERROR_VERBOSE using.
14200 Use %%error_verbose.
14201 (yyparse): Likewise.
14202 * src/output.c (prepare): Give its final value.
14203 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
14204 * src/getargs.h: Add its extern declaration.
14205 * src/getargs.c (error_verbose_flag): New int.
14206 (getargs): Update to catch new case.
14207 * src/options.c (option_table): 'error-verbose' is a new option.
14208 (shortopts): Update.
14209
e0327bc8
AD
142102001-11-27 Akim Demaille <akim@epita.fr>
14211
14212 * src/system.h: Use intl/libgettext.h.
14213 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
14214
000f1a3c
AD
142152001-11-27 Akim Demaille <akim@epita.fr>
14216
14217 * tests/torture.at (Exploding the Stack Size with Malloc):
14218 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
14219
26cfe0be
AD
142202001-11-27 Akim Demaille <akim@epita.fr>
14221
14222 * src/files.c: Include error.h.
14223 Reported by Hans Aberg.
14224
f6bd5427
MA
142252001-11-26 Marc Autret <autret_m@epita.fr>
14226
d2079671 14227 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
14228 (read_declarations): Add case tok_include.
14229 * src/getargs.h (include): Add its extern definition.
14230 * src/getargs.c (include): New const char *.
14231 (getargs): Add case '-I'.
14232 * src/options.c (option_table): Add include as command line and
14233 percent option.
14234 * src/lex.h (token_t): Add tok_include.
14235
2ca209c1
AD
142362001-11-26 Akim Demaille <akim@epita.fr>
14237
14238 * src/reader.c (readgram): Make sure rules for mid-rule actions
14239 have a lineno equal to that of their host rule.
14240 Reported by Hans Aberg.
14241 * tests/regression.at (Rule Line Numbers): New.
14242
0e41b407
AD
142432001-11-26 Akim Demaille <akim@epita.fr>
14244
14245 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
14246 size_ts.
14247
142482001-11-26 Akim Demaille <akim@epita.fr>
14249
14250 * src/complain.c, src/complain.h (error): Remove, provided by
14251 lib/error.[ch].
14252
e0c40012
AD
142532001-11-26 Akim Demaille <akim@epita.fr>
14254
14255 * src/reader.c (read_declarations): Don't abort on tok_illegal,
14256 issue an error message.
14257 * tests/regression.at (Invalid %directive): New.
14258 Reported by Hans Aberg.
14259
5e147124
AD
142602001-11-26 Akim Demaille <akim@epita.fr>
14261
14262 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
14263 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
14264
a034c8b8
AD
142652001-11-26 Akim Demaille <akim@epita.fr>
14266
14267 * src/conflicts.c (conflicts_print): Don't complain at all when
14268 there are no reduce/reduce conflicts, and as many shift/reduce
14269 conflicts as expected.
14270 * tests/regression.at (%expect right): Adjust.
14271
c64a20f3
AD
142722001-11-23 Akim Demaille <akim@epita.fr>
14273
14274 * lib/alloca.c: Update, from fileutils.
14275
5b0d29bb
AD
142762001-11-23 Akim Demaille <akim@epita.fr>
14277
14278 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
14279
722c4bfe
AD
142802001-11-23 Akim Demaille <akim@epita.fr>
14281
14282 * src/system.h: Include alloca.h.
14283 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
14284
6255b435
AD
142852001-11-23 Akim Demaille <akim@epita.fr>
14286
14287 * src/print_graph.c (print_actions): Remove `rule', unused.
14288 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
14289 pacify GCC's signed < unsigned warnings.
14290 * src/closure.c (itemsetsize): Likewise.
14291 * src/reader.c (symbol_list_new): Static.
14292
b29b2ed5
AD
142932001-11-23 Akim Demaille <akim@epita.fr>
14294
14295 Attaching lineno to buckets is stupid, since only one copy of each
14296 symbol is kept, only the line of the first occurrence is kept too.
14297
14298 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
14299 * src/reader.c (rline_allocated): Remove, unused.
14300 (symbol_list): Have a `line' member.
14301 (symbol_list_new): New.
14302 (readgram): Use it.
14303 * src/print.c (print_grammar): Output the rule line numbers.
14304 * tests/regression.at (Solved SR Conflicts)
14305 (Unresolved SR Conflicts): Adjust.
14306 Reported by Hans Aberg.
14307
a81b1d4a
MA
143082001-11-22 Marc Autret <autret_m@epita.fr>
14309
14310 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
14311
c1ecb3c1
MA
143122001-11-22 Marc Autret <autret_m@epita.fr>
14313
14314 * src/muscle_tab.c (muscle_init): Remove initialization of
14315 skeleton muscle.
14316 * src/output.c (output_master_parser): Do it here.
14317
fbe01355
AD
143182001-11-20 Akim Demaille <akim@epita.fr>
14319
14320 * po/sv.po: New.
14321 * configure.in (ALL_LINGUAS): Adjust.
14322 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
14323 longer contains strings to translate.
14324
81e895c0
AD
143252001-11-19 Akim Demaille <akim@epita.fr>
14326
14327 * src/conflicts.c (conflicts_print): Add a missing \n.
14328
6bb1878b
AD
143292001-11-19 Akim Demaille <akim@epita.fr>
14330
14331 * src/nullable.c (nullable_print): New.
14332 (set_nullable): Call it when tracing.
14333 Better locality of variables.
14334
d9ec2d07
AD
143352001-11-19 Akim Demaille <akim@epita.fr>
14336
14337 * src/print.c (print_actions): Better locality of variables.
14338
720e5c1b
AD
143392001-11-19 Akim Demaille <akim@epita.fr>
14340
14341 * src/derives.c (print_derives): Fix and enrich.
14342 * src/closure.c (print_fderives): Likewise.
14343
fb908786
AD
143442001-11-19 Akim Demaille <akim@epita.fr>
14345
14346 * src/closure.c (itemsetend): Remove, replaced with...
14347 (itemsetsize): new.
14348
125ecb56
AD
143492001-11-19 Akim Demaille <akim@epita.fr>
14350
14351 * src/LR0.c (kernel_end): Remove, replaced with...
14352 (kernel_size): new.
14353
d8cf039f
AD
143542001-11-19 Akim Demaille <akim@epita.fr>
14355
14356 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
14357 to clarify.
14358
7bec0760
AD
143592001-11-19 Akim Demaille <akim@epita.fr>
14360
14361 * src/closure.c (closure): Use arrays instead of pointers to clarify.
14362
c87d4863
AD
143632001-11-19 Akim Demaille <akim@epita.fr>
14364
14365 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
14366 trace messages.
14367 * src/LR0.c: Likewise.
14368 (allocate_itemsets): Use arrays instead of pointers to clarify.
14369
9bfe901c
AD
143702001-11-19 Akim Demaille <akim@epita.fr>
14371
14372 * src/getargs.c (statistics_flag): Replace with...
14373 (trace_flag): New.
14374 (longopts): Accept --trace instead of --statistics.
14375 * src/getargs.h, src/options.c: Adjust.
14376 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
14377 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
14378
97db7bd4
AD
143792001-11-19 Akim Demaille <akim@epita.fr>
14380
cc72668c 14381 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
14382 pointers to clarify the code.
14383 (save_reductions, save_shifts): Factor common parts of alternatives.
14384
2c5f66ed
AD
143852001-11-19 Akim Demaille <akim@epita.fr>
14386
14387 * src/LR0.c (new_state, get_state): Complete TRACE code.
14388 * src/closure.c: Include `reader.h' to get `tags', needed by the
14389 trace code.
14390 Rename the conditional DEBUG as TRACE.
14391 Output consistently TRACEs to stderr, not stdout.
14392 * src/derives.c: Likewise.
14393 * src/reduce.c: (inaccessable_symbols): Using if is better style
14394 than goto.
14395 Use `#if TRACE' instead of `#if 0' for tracing code.
14396
300f275f
AD
143972001-11-19 Akim Demaille <akim@epita.fr>
14398
14399 * src/system.h (LIST_FREE, shortcpy): New.
14400 * src/LR0.c: Use them.
14401 * src/output.c (free_itemsets, free_reductions, free_shifts):
14402 Remove, replaced by LIST_FREE.
14403
f59c437a
AD
144042001-11-19 Akim Demaille <akim@epita.fr>
14405
14406 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
14407 (REDUCTIONS_ALLOC): New.
14408 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
14409 allocation.
14410
6986fd9e
AD
144112001-11-19 Akim Demaille <akim@epita.fr>
14412
14413 * src/LR0.c (new_state): Complete trace code.
14414 * src/nullable.c (set_nullable): Don't translate traces.
14415
4bc30f78
AD
144162001-11-19 Akim Demaille <akim@epita.fr>
14417
14418 * src/print_graph.c (print_core): Better locality of variables.
14419 * src/print.c (print_core): Likewise.
14420
08a946e0
AD
144212001-11-19 Akim Demaille <akim@epita.fr>
14422
14423 * src/vcg.c: You do the output, so you are responsible of the
14424 handling of VCG syntax, in particular: use quotearg.
14425 * src/print_graph.c: Don't.
14426 (print_actions): Don't output the actions as part of the nodes,
14427 since that's the job of the edges.
14428 (print_state): Don't output by hand: fill the node description,
9bfe901c 14429 and ask for its output.
08a946e0 14430
f0473484
AD
144312001-11-19 Akim Demaille <akim@epita.fr>
14432
cc72668c
AD
14433 * src/bison.simple (yyparse): When verbosely reporting an error,
14434 no longer put additional quotes around token names.
f0473484
AD
14435 * tests/calc.at: Adjust.
14436
e41dc700
AD
144372001-11-19 Akim Demaille <akim@epita.fr>
14438
14439 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
14440 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
14441 * src/output.c: Adjust.
14442
652a871c
AD
144432001-11-19 Akim Demaille <akim@epita.fr>
14444
14445 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
14446 (rule_t): this.
14447 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
14448
b2ed6e58
AD
144492001-11-19 Akim Demaille <akim@epita.fr>
14450
14451 * src/gram.h (rule_t): New.
14452 (rule_table): New.
14453 (rrhs, rlhs): Remove, part of state_t.
14454 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
14455 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
14456 * src/reader.c, src/reduce.c: Adjust.
14457
edad7067
AD
144582001-11-19 Akim Demaille <akim@epita.fr>
14459
14460 * src/reader.c (symbols_output): New, extracted from...
14461 (packsymbols): Here.
14462 (reader): Call it.
14463
3feec034
AD
144642001-11-19 Akim Demaille <akim@epita.fr>
14465
14466 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
14467 (maxrhs): this new function.
14468
ddcd5fdf
AD
144692001-11-19 Akim Demaille <akim@epita.fr>
14470
cc72668c 14471 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
14472 Adjust.
14473
bb527fc2
AD
144742001-11-19 Akim Demaille <akim@epita.fr>
14475
cc72668c 14476 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
14477 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14478 * src/lalr.c: Adjust.
14479
a845a697
AD
144802001-11-19 Akim Demaille <akim@epita.fr>
14481
14482 * src/lalr.c (initialize_LA): Only initialize LA. Let...
14483 (set_state_table): handle the `lookaheads' members.
14484
f004bf6a
AD
144852001-11-19 Akim Demaille <akim@epita.fr>
14486
cc72668c
AD
14487 * src/lalr.h (lookaheads): Removed array, whose contents is now
14488 a member of...
f004bf6a
AD
14489 (state_t): this structure.
14490 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14491 Adjust.
14492
de326cc0
AD
144932001-11-19 Akim Demaille <akim@epita.fr>
14494
cc72668c
AD
14495 * src/lalr.h (consistent): Removed array, whose contents is now
14496 a member of...
de326cc0
AD
14497 (state_t): this structure.
14498 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14499 Adjust.
14500
90b4416b
AD
145012001-11-19 Akim Demaille <akim@epita.fr>
14502
cc72668c
AD
14503 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
14504 contents are now members of...
90b4416b
AD
14505 (state_t): this structure.
14506 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
14507 Adjust.
14508
9703cc49
AD
145092001-11-19 Akim Demaille <akim@epita.fr>
14510
14511 * src/lalr.h (state_t): New.
14512 (state_table): Be a state_t * instead of a core **.
14513 (accessing_symbol): Remove, part of state_t.
14514 * src/lalr.c: Adjust.
14515 (set_accessing_symbol): Merge into...
14516 (set_state_table): this.
14517 * src/print_graph.c, src/conflicts.c: Adjust.
14518
d803322e
AD
145192001-11-14 Akim Demaille <akim@epita.fr>
14520
14521 * tests/calc.at, tests/output.at, tests/regression.at,
14522 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
14523 now the tests are run in private dirs, therefore AC_CLEANUP and
14524 family can be simplified to 0-ary.
14525 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
14526 use abs. path to find config.h.
14527 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
14528 stderr, there can be way too much random noise.
14529 Instead pass -Werror to GCC and rely on the exit status.
14530 Reported by Wolfram Wagner.
14531
3d76b07d
AD
145322001-11-14 Akim Demaille <akim@epita.fr>
14533
14534 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
14535 defined only if yyoverflow is defined, to avoid `warning: unused
14536 variable `yyvs1''.
14537 Reported by The Test Suite.
14538
09b503c8
AD
145392001-11-14 Akim Demaille <akim@epita.fr>
14540
14541 * src/print.c: Include reduce.h.
14542 Reported by Hans Aberg.
14543
145442001-11-14 Akim Demaille <akim@epita.fr>
14545
14546 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
14547 Revert a previous patch: these are really const.
14548 * src/conflicts.c (conflict_report): Additional useless pair of
14549 braces to pacify GCC's warnings for `if () if () {} else {}'.
14550 * src/lex.c (parse_percent_token): Replace equal_offset with
14551 arg_offset.
14552 arg is const.
14553 Be sure to strdup `arg' when used, since there is no reason for
14554 token_buffer not to change.
14555
0f37a994
AD
145562001-11-14 Akim Demaille <akim@epita.fr>
14557
14558 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
14559 definition.
14560 * src/main.c (main): Use them.
14561 Suggested by Hans Aberg.
14562
d39d93b8
AD
145632001-11-12 Akim Demaille <akim@epita.fr>
14564
14565 * src/system.h (ngettext): Now that we use ngettext, be sure to
14566 provide a default definition when NLS are not used.
14567
9edcd895
AD
145682001-11-12 Akim Demaille <akim@epita.fr>
14569
14570 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
14571 Use @kbd to denote user input.
14572 (Language and Grammar): ANSIfy the example.
14573 Adjust its layout for info/notinfo.
14574 (Location Tracking Calc): Output error messages to stderr.
14575 Output locations in a more GNUtically correct way.
14576 Fix a couple of Englishos.
14577 Adjust @group/@end group pairs.
14578
7da99ede
AD
145792001-11-12 Akim Demaille <akim@epita.fr>
14580
e3aa65c5 14581 %expect was not functioning at all.
7da99ede
AD
14582
14583 * src/conflicts.c (expected_conflicts): Set to -1.
14584 (conflict_report): Use ngettext.
14585 (conflicts_print): Check %expect and make its violation an error.
14586 * doc/bison.texinfo (Expect Decl): Adjust.
14587 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
14588 * tests/regression.at (%expect not enough, %expect right)
14589 (%expect too much): New.
14590
ba9dda1a
AD
145912001-11-12 Akim Demaille <akim@epita.fr>
14592
14593 * tests/regression.at (Conflicts): Rename as...
14594 (Unresolved SR Conflicts): this.
14595 (Solved SR Conflicts): New.
14596
337c5bd1
AD
145972001-11-12 Akim Demaille <akim@epita.fr>
14598
14599 * src/reduce.c (print_results): Rename as...
14600 (reduce_output): This.
14601 Output to OUT, passed as argument, instead of output_obstack.
14602 (dump_grammar): Likewise.
14603 (reduce_free): New.
14604 Also free V1.
14605 (reduce_grammar): No longer call reduce_output, since...
14606 * src/print.c (print_results): do it.
14607 * src/main.c (main): Call reduce_free;
14608
c73a41af
AD
146092001-11-12 Akim Demaille <akim@epita.fr>
14610
14611 * src/conflicts.c (print_reductions): Accept OUT as argument.
14612 Output to it, not to output_obstack.
14613 * src/print.c (print_actions): Adjust.
14614
0df87bb6
AD
146152001-11-12 Akim Demaille <akim@epita.fr>
14616
14617 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
14618 the result instead of using...
14619 (src_total, rrc_total, src_count, rrc_count): Remove.
14620 (any_conflicts): Remove.
14621 (print_conflicts): Split into...
14622 (conflicts_print, conflicts_output): New.
14623 * src/conflicts.h: Adjust.
14624 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 14625 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
14626 * tests/regression.at (Conflicts): New.
14627 Reported by Tom Lane.
14628
e4d3d4de
AD
146292001-11-12 Akim Demaille <akim@epita.fr>
14630
14631 * tests/regression.at (Invalid input): Remove, duplicate with
14632 ``Invalid input: 1''.
14633
6d7d248e
AD
146342001-11-12 Akim Demaille <akim@epita.fr>
14635
14636 * tests/torture.at (AT_DATA_STACK_TORTURE)
14637 (Exploding the Stack Size with Alloca)
14638 (Exploding the Stack Size with Malloc): New.
14639
e9e4c321
AD
146402001-11-12 Akim Demaille <akim@epita.fr>
14641
14642 * src/bison.simple (YYSTACK_REALLOC): New.
14643 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 14644 Reported by Per Allansson.
e9e4c321 14645
5f7e0832
AD
146462001-11-12 Pascal Bart <pascal.bart@epita.fr>
14647
14648 * src/bison.simple: Define type yystype instead of YYSTYPE, and
14649 define CPP macro, which substitute YYSTYPE by yystype.
14650 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
14651 with yyltype/YYLTYPE. This allows inclusion of the generated
14652 header within the parser if the compiler, such as GGC, accepts
14653 multiple equivalent #defines.
14654 From Akim.
14655
e3f1699f
AD
146562001-11-05 Akim Demaille <akim@epita.fr>
14657
14658 * src/reader.c (symbols_output): New, extracted from...
14659 (packsymbols): here.
14660 (reader): Adjust.
14661
65be0866
AD
146622001-11-05 Akim Demaille <akim@epita.fr>
14663
14664 * src/lex.c (parse_percent_token): s/quotearg/quote/.
14665
e4d910bf
AD
146662001-11-05 Akim Demaille <akim@epita.fr>
14667
14668 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
14669 pattern.
14670
951366c1
AD
146712001-11-05 Akim Demaille <akim@epita.fr>
14672
14673 * src/options.h (struct option_table_struct): set_flags is void*.
14674 * src/options.c (longopts): Support `--output' and `%output'.
14675 (usage): Adjust.
14676 * src/lex.h (tok_setopt): Remove, replaced with...
14677 (tok_intopt, tok_stropt): these new guys.
14678 * src/lex.c (getopt.h): Not needed.
14679 (token_buffer, unlexed_token_buffer): Not const.
14680 (percent_table): Promote `-' over `_' in directive names.
14681 Active `%name-prefix', `file-prefix', and `output'.
14682 (parse_percent_token): Accept possible arguments to directives.
14683 Promote `-' over `_' in directive names.
14684
d8988b2f
AD
146852001-11-04 Akim Demaille <akim@epita.fr>
14686
14687 * doc/bison.texinfo (Decl Summary): Split the list into
14688 `directives for grammars' and `directives for bison'.
14689 Sort'em.
14690 Add description of `%name-prefix', `file-prefix', and `output'.
14691 Promote `-' over `_' in directive names.
14692 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
14693 Simplify the description of `--name-prefix'.
14694 Promote `-' over `_' in directive names.
14695 Promote `--output' over `--output-file'.
14696 Fix the description of `--defines'.
14697 * tests/output.at: Exercise %file-prefix and %output.
14698
6468d18e
AD
146992001-11-02 Akim Demaille <akim@epita.fr>
14700
14701 * doc/refcard.tex: Update.
14702
6b7e85b9
AD
147032001-11-02 Akim Demaille <akim@epita.fr>
14704
14705 * src/symtab.h (SUNDEF): New.
14706 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
14707 stand for `uninitialized', instead of 0.
14708 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
14709 * src/lex.c (lex): Adjust.
14710
14711 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
14712 Number it 0.
14713 Let yylex return it instead of a plain 0.
14714 Reported by Dick Streefland.
14715
cd5aafcf
AD
147162001-11-02 Akim Demaille <akim@epita.fr>
14717
14718 * tests/regression.at (Mixing %token styles): New test.
14719
037ca2f1
AD
147202001-11-02 Akim Demaille <akim@epita.fr>
14721
14722 * src/reader.c (parse_thong_decl): Formatting changes.
14723 (token_translations_init): New, extracted from...
14724 (packsymbols): Here.
14725 Adjust.
14726
270a173c
AD
147272001-11-01 Akim Demaille <akim@epita.fr>
14728
14729 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
14730 Check that `9foo.y' produces correct cpp guards.
14731 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
14732 guards.
14733 Reported by Wwp.
14734
561f9a30
AD
147352001-11-01 Akim Demaille <akim@epita.fr>
14736
14737 * tests/regression.at (Invalid input: 2): New.
14738 * src/lex.c (unlexed_token_buffer): New.
14739 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
14740 too.
14741 Reported by Wwp.
14742
f987e9d2
AD
147432001-11-01 Akim Demaille <akim@epita.fr>
14744
14745 * tests/calc.at: Catch up with 1.30.
14746 * configure.in: Bump to 1.49a.
14747 Adjust to newer Autotest.
14748
0846f581
PB
147492001-10-19 Pascal Bart <pascal.bart@epita.fr>
14750
14751 * src/conflicts.c: Move global variables rrc_total and src_total ...
14752 (print_conflicts): here.
14753 * src/output.c (output): Free global variable user_toknums.
14754 * src/lex.c (token_obstack): Become static.
14755
3c1a79b3
AD
147562001-10-18 Akim Demaille <akim@epita.fr>
14757
14758 * tests/atlocal.in (GCC): Add.
14759 * tests/calc.at: s/m4_match/m4_bmatch/.
14760 s/m4_patsubst/m4_bpatsubst/.
14761 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
14762 * configure.in: AC_SUBST(GCC).
14763
5d52e7d0
MA
147642001-10-14 Marc Autret <autret_m@epita.fr>
14765
14766 * src/options.c (create_long_option_table): Fix.
14767
631aa1d3
AD
147682001-10-10 Akim Demaille <akim@epita.fr>
14769
14770 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
14771
f6ec6d13
AD
147722001-10-04 Akim Demaille <akim@epita.fr>
14773
14774 * src/reader.c (parse_union_decl): Push the caracters in
14775 union_obstack, not attrs_obstack.
14776
342b8b6e
AD
147772001-10-04 Akim Demaille <akim@epita.fr>
14778
14779 Merge in the branch 1.29.
14780
14781 * src/reader.c (packsymbols): Use a temporary obstack for
14782 `%%tokendef', since output_stack is already used elsewhere.
14783
14784 2001-10-02 Akim Demaille <akim@epita.fr>
14785
14786 Bump 1.29d.
14787
14788 2001-10-02 Akim Demaille <akim@epita.fr>
14789
14790 Version 1.29c.
14791
14792 2001-10-02 Akim Demaille <akim@epita.fr>
14793
14794 * tests/regression.at (Invalid CPP headers): New.
14795 From Alexander Belopolsky.
14796 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
14797
14798 2001-10-02 Akim Demaille <akim@epita.fr>
14799
14800 * tests/regression.at (Invalid input): New.
14801 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
14802 Reported by Shura.
14803
14804 2001-10-02 Akim Demaille <akim@epita.fr>
14805
14806 * tests/calc.at: Now that --debug works, the tests must be adjusted.
14807
14808 2001-10-02 Akim Demaille <akim@epita.fr>
14809
14810 * src/output.c (output_parser): Assert `skeleton'.
14811 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
14812 systems.
14813 From Shura.
14814
14815 2001-10-01 Marc Autret <autret_m@epita.fr>
14816
14817 * src/lex.h: Echo modifications.
14818 * src/lex.c (unlex): Parameter is now token_t.
14819 From Hans Aberg.
14820
14821 2001-10-01 Marc Autret <autret_m@epita.fr>
14822
14823 * src/main.c: Include lex.h.
14824 From Hans Aberg.
14825
14826 2001-09-29 Akim Demaille <akim@epita.fr>
14827
14828 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
14829
14830 2001-09-28 Akim Demaille <akim@epita.fr>
14831
14832 * tests/testsuite.at: Update to newer Autotest.
14833 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
14834
14835 2001-09-27 Akim Demaille <akim@epita.fr>
14836
14837 Position independent wrapper.
14838
14839 * tests/bison: Remove.
14840 * tests/bison.in: New.
14841 * configure.in: Adjust.
14842
14843 2001-09-27 Paul Eggert <eggert@twinsun.com>
14844
14845 Port quotearg fixes from tar 1.13.24.
14846
14847 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
14848 tm to be declared.
14849 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
14850 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
14851
14852 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
14853 * m4/mbrtowc.m4: New file.
14854 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
14855 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
14856
14857 2001-09-27 Akim Demaille <akim@epita.fr>
14858
14859 Bump to 1.29c.
14860
14861 2001-09-27 Akim Demaille <akim@epita.fr>
14862
14863 Version 1.29b.
14864
14865 2001-09-25 Akim Demaille <akim@epita.fr>
14866
14867 * src/system.h: Include `xalloc.h'.
14868 Remove it from the C files.
14869 * src/files.c (output_files): Free the obstacks.
14870 * src/lex.c (init_lex): Rename as...
14871 (lex_init): this.
14872 (lex_free): New.
14873 * src/main.c (main): Use it.
14874
14875 2001-09-24 Marc Autret <autret_m@epita.fr>
14876
14877 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
14878 to output informations in fout (FILE*).
14879 (open_graph, close_graph): Likewise.
14880 (output_graph, output_edge, output_node): Likewise.
14881 * src/vcg.h: Update function prototypes.
14882 * src/print_graph.c (print_graph): Open output graph file.
14883 (print_actions): Adjust.
14884 * src/files.h: Remove extern declaration.
14885 * src/files.c: Remove graph_obstack declaration.
14886 (open_files): Remove graph_obstack initialization.
14887 (output_files): Remove graph_obstack saving.
14888
14889 2001-09-24 Marc Autret <autret_m@epita.fr>
14890
14891 * src/files.c (compute_output_file_names): Fix.
14892
14893 2001-09-24 Marc Autret <autret_m@epita.fr>,
14894 Akim Demaille <akim@epita.fr>
14895
14896 * src/reader.c (reader): Remove call to free_symtab ().
14897 * src/main.c (main): Call it here.
14898 Include symtab.h.
14899 * src/conflicts.c (initialize_conflicts): Rename as...
14900 (solve_conflicts): this.
14901 * src/print.c (print_core, print_actions, print_state)
14902 (print_grammar): Dump to a file instead a `output_obstack'.
14903 (print_results): Dump `output_obstack', and then proceed with the
14904 FILE *.
14905 * src/files.c (compute_output_file_names, close_files): New.
14906 (output_files): Adjust.
14907 * src/main.c (main): Adjust.
14908
14909 2001-09-23 Marc Autret <autret_m@epita.fr>
14910
14911 * src/files.c (compute_header_macro): Computes header macro name
14912 from spec_defines_file when given.
14913
14914 2001-09-23 Marc Autret <autret_m@epita.fr>
14915
14916 * src/files.c (output_files): Add default extensions.
14917
14918 2001-09-22 Akim Demaille <akim@epita.fr>
14919
14920 * src/conflicts.c (finalize_conflicts): Rename as...
14921 (free_conflicts): this.
14922
14923 2001-09-22 Akim Demaille <akim@epita.fr>
14924
14925 * src/gram.c (gram_free): Rename back as...
14926 (dummy): this.
14927 (output_token_translations): Free `token_translations'.
14928 * src/symtab.c (free_symtab): Free the tag field.
14929
14930 2001-09-22 Akim Demaille <akim@epita.fr>
14931
14932 Remove `translations' as it is always set to true.
14933
14934 * src/gram.h: Adjust.
14935 * src/reader.c (packsymbols, parse_token_decl): Adjust
14936 * src/print.c (print_grammar): Adjust.
14937 * src/output.c (output_token_translations): Adjust.
14938 * src/lex.c (lex): Adjust.
14939 * src/gram.c: Be sure the set pointers to NULL.
14940 (dummy): Rename as...
14941 (gram_free): this.
14942
14943 2001-09-22 Akim Demaille <akim@epita.fr>
14944
14945 * configure.in: Invoke AM_LIB_DMALLOC.
14946 * src/system.h: Use dmalloc.
14947 * src/LR0.c: Be sure to have pointers initialized to NULL.
14948 (allocate_itemsets): Allocate kernel_items only if needed.
14949
14950 2001-09-22 Akim Demaille <akim@epita.fr>
14951
14952 * configure.in: Bump to 1.29b.
14953 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
14954 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
14955 need xmalloc.c in calc.y.
14956 From Pascal Bart.
14957
14958 2001-09-21 Akim Demaille <akim@epita.fr>
14959
14960 Version 1.29a.
14961 * Makefile.maint, config/config.guess, config/config.sub,
14962 * config/missing: Update from masters.
14963 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
14964 upon package.m4.
14965 * configure.in (ALL_LINGUAS): Add `tr'.
14966
14967 2001-09-21 Akim Demaille <akim@epita.fr>
14968
14969 * tests/Makefile.am (package.m4): Move to...
14970 ($(srcdir)/$(TESTSUITE)): here.
14971
14972 2001-09-20 Akim Demaille <akim@epita.fr>
14973
14974 * src/complain.c: No longer try to be standalone: use system.h.
14975 Don't assume __STDC__ is defined to 1. Just test if it is defined.
14976 * src/complain.h: Likewise.
14977 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
14978 Remove the unused variable `n'.
14979 From Albert Chin-A-Young.
14980
14981 2001-09-18 Marc Autret <autret_m@epita.fr>
14982
14983 * doc/bison.1: Update.
14984 * doc/bison.texinfo (Bison Options): Update --defines and --graph
14985 descriptions.
14986 (Option Cross Key): Update.
14987 Add --graph.
14988
14989 2001-09-18 Marc Autret <autret_m@epita.fr>
14990
14991 * tests/regression.at: New test (comment in %union).
14992
14993 2001-09-18 Marc Autret <autret_m@epita.fr>
14994
14995 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
14996 do that.
14997 Reported by Keith Browne.
14998
14999 2001-09-18 Marc Autret <autret_m@epita.fr>
15000
15001 * tests/output.at: Add tests for --defines and --graph.
15002
15003 2001-09-18 Marc Autret <autret_m@epita.fr>
15004
15005 * tests/output.at: Removes tests of %{header,src}_extension features.
15006
15007 2001-09-18 Akim Demaille <akim@epita.fr>
15008
15009 * tests/Makefile.am (package.m4): New.
15010 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
15011 (_AT_CHECK_CALC_ERROR): Likewise.
15012 Factor the `, ' part of verbose error messages.
15013
15014 2001-09-18 Marc Autret <autret_m@epita.fr>
15015
15016 * src/getargs.c (longopts): Declare --defines and --graph as options
15017 with optional arguments.
15018 * src/files.h: Add extern declarations.
15019 * src/files.c (spec_graph_file, spec_defines_file): New.
15020 (output_files): Update.
15021 Remove CPP-outed code.
15022
15023 2001-09-18 Marc Autret <autret_m@epita.fr>
15024
15025 Turn off %{source,header}_extension feature.
15026
15027 * src/files.c (compute_exts_from_gf): Update.
15028 (compute_exts_from_src): Update.
15029 (output_files): CPP-out useless code.
15030 * src/files.h: Remove {header,source}_extension extern declarations.
15031 * src/reader.c (parse_dquoted_param): CPP-out.
15032 (parse_header_extension_decl): Remove.
15033 (parse_source_extension_decl): Remove.
15034 (read_declarations): Remove cases tok_{hdrext,srcext}.
15035 * src/lex.c (percent_table): Remove {header,source}_extension entries.
15036 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
15037
15038 2001-09-10 Akim Demaille <akim@epita.fr>
15039
15040 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
15041 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
15042 (AT_CHECK_OUTPUT): this.
15043 Merely check ls' exit status, its output is useless.
15044
15045 2001-09-10 Akim Demaille <akim@epita.fr>
15046
15047 * tests/calc.at: Use m4_match.
15048 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
15049
15050 2001-09-10 Marc Autret <autret_m@epita.fr>,
15051 Akim Demaille <akim@epita.fr>
15052
15053 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
15054 enum color_e.
15055 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
15056 to `normal'.
15057 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
15058 * src/lex.h: Adjust prototype.
15059 (token_t): Add `tok_undef'.
15060 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
15061 (parse_percent_token): Now returns token_t.
15062 Add default statement in switch.
15063 (lex): Separate `c' as an input variable, from the token_t result
15064 part.
15065 (unlexed): Is a token_t.
15066
15067 2001-09-10 Akim Demaille <akim@epita.fr>
15068
15069 * configure.in: Bump to 1.29a.
15070
15071 2001-09-07 Akim Demaille <akim@epita.fr>
15072
15073 Version 1.29.
15074
15075 2001-08-30 Akim Demaille <akim@epita.fr>
15076
15077 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
15078 * m4/atconfig.m4: Remove.
15079 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
15080 * tests/bison: New.
15081 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
15082 m4_if, m4_patsubst, and m4_regexp.
15083 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
15084 `input' file instead of echo.
15085
15086 2001-08-29 Akim Demaille <akim@epita.fr>
15087
15088 Bump to 1.28e.
15089
15090 2001-08-29 Akim Demaille <akim@epita.fr>
15091
15092 Version 1.28d.
15093
15094 2001-08-29 Paul Eggert <eggert@twinsun.com>
15095
15096 * src/bison.simple (yyparse): Don't take the address of an
15097 item before the start of an array, as that doesn't conform to
15098 the C Standard.
15099
15100 2001-08-29 Robert Anisko <anisko_r@epita.fr>
15101
15102 * doc/bison.texinfo (Location Tracking Calc): New node.
15103
15104 2001-08-29 Paul Eggert <eggert@twinsun.com>
15105
15106 * src/output.c (output): Do not define const, as this now
15107 causes more problems than it cures.
15108
15109 2001-08-29 Akim Demaille <akim@epita.fr>
15110
15111 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
15112 the nodes.
15113 Be sure to tag the `detailmenu'.
15114
15115 2001-08-29 Akim Demaille <akim@epita.fr>
15116
15117 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
15118 download in a tmp dir.
15119
15120 2001-08-28 Marc Autret <autret_m@epita.fr>
15121
15122 * config/depcomp: New file.
15123
15124 2001-08-28 Marc Autret <autret_m@epita.fr>
15125
15126 * doc/bison.1 (mandoc): Adjust.
15127 From Juan Manuel Guerrero.
15128
15129 2001-08-28 Marc Autret <autret_m@epita.fr>
15130
15131 * src/print_graph.c (print_state): Fix.
15132
15133 2001-08-27 Marc Autret <autret_m@epita.fr>
15134
15135 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
15136 char * members.
15137 Echo modifications to the functions prototypes.
15138 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
15139
15140 2001-08-27 Marc Autret <autret_m@epita.fr>
15141
15142 * src/vcg.c: Include `xalloc.h'.
15143 (add_colorentry): New.
15144 (add_classname): New.
15145 (add_infoname): New.
15146 * src/vcg.h: Add new prototypes.
15147
15148 2001-08-27 Akim Demaille <akim@epita.fr>
15149
15150 * Makefile.maint: Sync. again with CVS Autoconf.
15151
15152 2001-08-27 Akim Demaille <akim@epita.fr>
15153
15154 * Makefile.maint: Formatting changes.
15155 (po-update, cvs-update, update): New targets.
15156 (AMTAR): Remove.
15157
15158 2001-08-27 Akim Demaille <akim@epita.fr>
15159
15160 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15161 * Makefile.maint: Sync. with CVS Autoconf.
15162
15163 2001-08-27 Marc Autret <autret_m@epita.fr>
15164
15165 * src/vcg.h (struct infoname_s): New.
15166 (struct colorentry_s): New.
15167 (graph_s): New fields {vertical,horizontal}_order in structure.
15168 Add `infoname' field.
15169 Add `colorentry' field;
15170 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
15171 (G_HORIZONTAL_ORDER): New.
15172 (G_INFONAME): New.
15173 (G_COLORENTRY): New.
15174 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
15175 Add output of `infoname'.
15176 Add output of `colorentry'.
15177
15178 2001-08-27 Marc Autret <autret_m@epita.fr>
15179
15180 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
15181 This one shadowed a global parameter.
15182
15183 2001-08-24 Marc Autret <autret_m@epita.fr>
15184
15185 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
15186 instead of `unsigned'.
15187 (print_state): Do not call obstack_object_size () in obstack_grow ()
15188 to avoid macro variables shadowing.
15189
15190 2001-08-23 Marc Autret <autret_m@epita.fr>
15191
15192 * src/lex.c (percent_table): Typo: s/naem/name/.
15193 Add graph option.
15194 Normalize new options declarations.
15195
15196 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
15197
15198 * tests/suite.at: Exercise %header_extension and %source_extension.
15199
15200 2001-08-16 Marc Autret <autret_m@epita.fr>
15201
15202 * src/reader.c (parse_dquoted_param): New.
15203 (parse_header_extension_decl): Use it.
15204 (parse_source_extension_decl): Likewise.
15205
15206 2001-08-16 Marc Autret <autret_m@epita.fr>
15207
15208 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
15209 (get_xxxx_str): Use assert () instead of complain ().
15210 Remove return invokations in default cases.
15211 (get_decision_str): Modify default behaviour. Remove second argument.
15212 Echo modifications on calls.
15213 (output_graph): Fix.
15214
15215 2001-08-16 Marc Autret <autret_m@epita.fr>
15216
15217 * src/getargs.c (usage): Update with ``-g, --graph''.
15218
15219 2001-08-16 Marc Autret <autret_m@epita.fr>
15220
15221 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
15222 (Option Cross Key): Likewise.
15223 * doc/bison.1: Update.
15224
1c8c2190
PB
152252001-09-25 Pascal Bart <pascal.bart@epita.fr>
15226
15227 * src/output.c (output_master_parser): Don't finish action_obstack.
15228 (output_parser): Don't care about the muscle action, here.
15229 (prepare): Copy the action_obstack in the action muscle.
15230 (output): Free action_obstack.
15231
180d45ba
PB
152322001-09-23 Pascal Bart <pascal.bart@epita.fr>
15233
15234 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
15235 will contain `%union' declaration.
15236 (parse_union_decl): Delete #line directive output.
15237 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
15238 informations about %union.
15239 (parse_union_decl): Copy the union_obstack in the muscle stype.
15240 * src/bison.simple: Add new #line directive.
15241 Add typdef %%stype YYSTYPE.
15242
c51d1a19
PB
152432001-09-23 Pascal Bart <pascal.bart@epita.fr>
15244
15245 * src/bison.simple: Add new `#line' directive.
15246
6f9344da
PB
152472001-09-22 Pascal Bart <pascal.bart@epita.fr>
15248
15249 * src/bison.simple: New `#line' directive.
15250 * src/output.c (output_parser): Support new dynamic muscle input_line.
15251
652def80
MA
152522001-09-22 Marc Autret <autret_m@epita.fr>
15253
15254 * src/output.c (output_master_parser): New.
15255 (output_parser): Be more re-entrant.
15256
25b222fa
MA
152572001-09-21 Marc Autret <autret_m@epita.fr>
15258
15259 * src/reader.c (copy_definition, parse_union_decl): Update and use
15260 `linef' muscle.
15261 (copy_action): Likewise.
15262 Use obstack_1grow ().
15263 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
15264
6bc35ae5
MA
152652001-09-21 Marc Autret <autret_m@epita.fr>
15266
15267 * src/options.c (option_table): Adjust.
15268 * src/lex.c (parse_percent_token): Fix.
15269
c0629aa1
PB
152702001-09-20 Pascal Bart <pascal.bart@epita.fr>
15271
15272 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 15273
82b6d266
PB
152742001-09-20 Pascal Bart <pascal.bart@epita.fr>
15275
15276 * src/lex.c (parse_percent_token): Change type of variable `tx', which
15277 is now an option_table_struct*.
15278 (option_strcmp): New function option_strcmp.
15279 (parse_percent_token): Call option_strcmp.
15280 * src/getargs.c (xalloc.h, options.h): Include it.
15281 (getargs): Call create_long_option_table.
15282 (getargs): Free longopts at the end of the function.
15283 (shortopts): Move in options.c.
15284 * src/options.c (create_long_option_table): New function. Convert
15285 information from option_table to option structure.
15286 * src/reader.c (options.h): Include it.
15287
15288 * src/Makefile.am: Adjust.
15289 * src/options.c (option_table): Create from longopts and percent_table.
15290 * src/getargs.c (longopts): Delete.
15291 * src/lex.c (struct percent_table_struct): Delete.
15292 (percent_table): Delete.
15293 (options.h): Include it.
15294 * src/options.c: Create.
15295 * src/options.h: Create.
15296 Declare enum opt_access_e.
15297 Define struct option_table_struct.
15298
75f5aaea
MA
152992001-09-20 Marc Autret <autret_m@epita.fr>
15300
15301 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
15302 sections of Bison.
15303
f508cb0a
PB
153042001-09-19 Pascal Bart <pascal.bart@epita.fr>
15305
15306 * src/bison.simple: s/%%filename/%%skeleton.
15307 * src/muscle_tab.c (getargs.h): Include it.
15308 (muscle_init): Insert new muscle skeleton.
15309
13105fc1
PB
153102001-09-18 Pascal Bart <pascal.bart@epita.fr>
15311
15312 * src/output.c (output_parser): Delete unused variable actions_dumped.
15313
b0c4483e
PB
153142001-09-07 Pascal Bart <pascal.bart@epita.fr>
15315
15316 * src/output.c (output): Delete call to reader_output_yylsp.
15317 * src/reader.c (reader): Likewise.
ba0fe3c7 15318 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 15319
11d82f03
MA
153202001-09-02 Marc Autret <autret_m@epita.fr>
15321
15322 * src/reader.c: Include muscle_tab.h.
15323 (parse_union_decl): Update.
15324 (parse_macro_decl): Rename parse_muscle_decl.
15325 Update to use renamed functions and variable.
15326 (read_declarations, copy_action, read_additionnal_code, : Updated
15327 with correct variables and functions names.
15328 (packsymbols, reader): Likewise.
342b8b6e 15329
11d82f03 15330 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 15331
11d82f03
MA
15332 * src/output.c: Include muscle_tab.h
15333 In all functions using macro_insert, change by using muscle_insert ().
15334 (macro_obstack): Rename muscle_obstack.
15335 Echo modifications in the whole file.
15336 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
15337 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
15338 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
15339
15340 * src/muscle_tab.h: Update double inclusion macros.
15341 (macro_entry_s): Rename muscle_entry_s.
15342 Update prototypes.
342b8b6e 15343
11d82f03
MA
15344 * src/muscle_tab.c: Include muscle_tab.h.
15345 Rename macro_tabble to muscle_table.
15346 (mhash1, mhash2, mcmp): Use muscle_entry.
15347 (macro_init): Rename muscle_init. Update.
15348 (macro_insert): Rename muscle_insert. Update.
15349 (macro_find): Rename muscle_find. Update.
15350
15351 * src/main.c: Include muscle_tab.h.
15352 (main): Call muscle_init ().
15353 * src/Makefile.am (bison_SOURCES): Echo modifications.
15354
93a37297
MA
153552001-09-02 Marc Autret <autret_m@epita.fr>
15356
f753cd62 15357 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 15358
f753cd62
MA
15359 * src/muscle_tab.c, src/muscle_tab.h: Add files.
15360
153612001-09-02 Marc Autret <autret_m@epita.fr>
15362
15363 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 15364
682d48cd
PB
153652001-09-01 Pascal Bart <pascal.bart@epita.fr>
15366
342b8b6e 15367 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
15368 filename.
15369
087c8fda
MA
153702001-09-01 Marc Autret <autret_m@epita.fr>
15371
15372 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
15373 to an explicit value to activate the feature. We do it here.
15374
dda680cb
PB
153752001-08-31 Pascal Bart <pascal.bart@epita.fr>
15376
15377 * src/output.c (prepare): Delete the `filename' muscule insertion.
15378 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
15379 (parse_union_decl): Likewise.
15380 * src/macrotab.c (macro_init): Initialize filename by infile.
15381
9e644e64
MA
153822001-08-31 Marc Autret <autret_m@epita.fr>
15383
15384 * src/bison.simple (YYLSP_NEEDED): New definition.
15385 * src/output.c (prepare): Add macro insertion of `locations_flag'
15386
17da6427
PB
153872001-08-31 Pascal Bart <pascal.bart@epita.fr>
15388
15389 * src/output.c (prepare): Delete insertion of previous muscles,
15390 and insert the `prefix' muscles.
15391 * src/macrotab.c (macro_init): Likewise.
15392 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 15393 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
15394 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
15395 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 15396 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
15397 name_prefix.
15398
e8cb70b9
PB
153992001-08-31 Pascal Bart <pascal.bart@epita.fr>
15400
15401 * src/main.c (main): Standardize.
15402 * src/output.c (output_table_data, output_parser): Likewise.
15403 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
15404
63c2d5de
MA
154052001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
15406
342b8b6e 15407 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
15408 %%epilogue.
15409 * src/output.c (output): Rename %%declarations to %%prologue.
15410 * src/bison.simple: Echo modifications.
342b8b6e 15411
d8cb5183
MA
154122001-08-31 Marc Autret <autret_m@epita.fr>
15413
15414 * src/reader.c (readgram): CleanUp.
15415 (output_token_defines): Likewise.
15416 (packsymbols): Likewise.
15417 (reader): Likewise.
15418 * src/output.c (output): CPP-out useless code.
15419
6c686258
PB
154202001-08-31 Pascal Bart <pascal.bart@epita.fr>
15421
342b8b6e 15422 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
15423 output_trailers and output_headers.
15424 * src/output.h: Remove obsolete functions prototypes of output_headers
15425 and output_trailers.
15426
8f451ef7
PB
154272001-08-30 Pascal Bart <pascal.bart@epita.fr>
15428
15429 * src/main.c: Include macrotab.h.
342b8b6e 15430 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
15431 Adjust functions prototypes.
15432 * src/macrotab.c (macro_insert): Constify key and value.
15433 (macro_find): Constify key.
15434 (macro_insert): Include 'xalloc.h'
15435 (macro_insert): Use XMALLOC.
15436 (macro_find): Constify return value.
15437 * src/output.c (output_table_data): Rename table to table_data.
15438 (output_parser): Constify macro_key, macro_value.
15439
997b6fd0 154402001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
15441
15442 * src/reader.c (parse_skel_decl): New.
342b8b6e 15443 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
15444 * src/lex.h (token_t): New token `tok_skel'.
15445 * src/lex.c (percent_table): Add skeleton option entry.
15446 Standardize.
15447
ff48177d
MA
154482001-08-29 Marc Autret <autret_m@epita.fr>
15449
15450 * src/bison.simple: Add %%user_code directive at the end.
15451 * src/reader.c (read_additionnal_code): New.
15452 (reader): Use it.
15453 * src/output.c (output_program): Remove.
15454 (output): Update.
15455
b33160bf
MA
154562001-08-28 Marc Autret <autret_m@epita.fr>
15457
15458 * src/output.c (output_actions): Clean up.
4e5caae2 15459 (output_gram): CPP-out useless code.
b33160bf
MA
15460 * src/reader.c (reader): Clean up, CPP-out useless code.
15461
d1a2daf7
PB
154622001-08-28 Pascal Bart <pascal.bart@epita.fr>
15463
342b8b6e 15464 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 15465 directive.
d1a2daf7
PB
15466 * src/bison.simple: Add `%%definitions'.
15467
2b763dfe
MA
154682001-08-28 Marc Autret <autret_m@epita.fr>
15469
15470 * config/depcomp: New file.
15471
f1a87ef6
PE
154722001-08-27 Paul Eggert <eggert@twinsun.com>
15473
15474 * src/bison.simple (yyparse): Don't take the address of an
15475 item before the start of an array, as that doesn't conform to
15476 the C Standard.
15477
82e236e2
RA
154782001-08-27 Robert Anisko <robert.anisko@epita.fr>
15479
f1a87ef6 15480 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
15481 obstack. It was done too late here.
15482
15483 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
15484 completely wrong.
15485 (reader): Initialize the macro obstack here, since we need it to grow
15486 '%define' directives.
15487
15488 * src/reader.h: Declare the macro obstack as extern.
15489
b0cfa28a
RA
154902001-08-27 Robert Anisko <robert.anisko@epita.fr>
15491
15492 * src/output.c (output_parser): Fix. Store single '%' characters in
15493 the output obstack instead of throwing them away.
15494
6fc74234
AD
154952001-08-27 Akim Demaille <akim@epita.fr>
15496
15497 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
15498
9c76d118
RA
154992001-08-25 Robert Anisko <robert.anisko@epita.fr>
15500
15501 * lib/Makefile.am: Adjust.
15502
a8289c62
RA
155032001-08-25 Robert Anisko <robert.anisko@epita.fr>
15504
15505 * src/bison.simple: Update and add '%%' directives.
15506
b6610515
RA
155072001-08-25 Robert Anisko <robert.anisko@epita.fr>
15508
15509 * src/reader.c (reader): Remove calls to 'output_headers' and
15510 'output_trailers'. Remove some C output.
15511 (readgram): Disable a piece of code that was writing a default
15512 definition for 'YYSTYPE'.
15513 (reader_output_yylsp): Remove.
15514 (packsymbols): Output token defintions to a macro.
15515 (copy_definition): Disable C output.
6fc74234 15516
b6610515
RA
15517 * src/reader.c (parse_macro_decl): New function used to parse macro
15518 declarations.
15519 (copy_string2): Put the body of copy_string into this new function.
15520 Add a parameter to let the caller choose whether he wants to copy the
15521 string delimiters or not.
15522 (copy_string): Be a simple call to copy_string2 with the last argument
15523 bound to true.
15524 (read_declarations): Add case for macro definition.
15525 (copy_identifier): New.
6fc74234 15526 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
15527 rather than lex.
15528
26f609ff
RA
155292001-08-25 Robert Anisko <robert.anisko@epita.fr>
15530
15531 * src/output.c (prepare): Add prefixed names.
15532 (output_parser): Output semantic actions.
15533 (output_parser): Fix bug on '%%line' directives.
6fc74234 15534
26f609ff
RA
15535 * src/output.c (output_headers): Remove. The C code printed by this
15536 function should now be in the skeletons.
15537 (output_trailers): Remove.
15538 (output): Disable call to 'reader_output_yylsp'.
15539 (output_rule_data): Do not output tables to the table obstack.
15540
15541 * src/output.c: Remove some C dedicated output.
15542 Improve the use of macro and output obstacks.
15543 (output_defines): Remove.
6fc74234 15544
26f609ff
RA
15545 * src/output.c (output_token_translations): Associate 'translate'
15546 table with a macro. No output to the table obstack.
15547 (output_gram): Same for 'rhs' and 'prhs'.
15548 (output_stos): Same for 'stos'.
15549 (output_rule_data): Same for 'r1' and 'r2'.
15550 (token_actions): Same for 'defact'.
15551 (goto_actions): Same for 'defgoto'.
15552 (output_base): Same for 'pact' and 'pgoto'.
15553 (output_table): Same for 'table'.
15554 (output_check): Same for 'check'.
6fc74234 15555
26f609ff
RA
15556 * src/output.c (output_table_data): New function.
15557 (output_short_table): Remove.
15558 (output_short_or_char_table): Remove.
6fc74234 15559
26f609ff
RA
15560 * src/output.c (output_parser): Replace most of the skeleton copy code
15561 with something new. Skeletons are now processed character by character
15562 rather than line by line, and Bison looks for '%%' macros. This is the
15563 first step in making Bison's output process (a lot) more flexible.
15564 (output_parser): Use the macro table.
15565
6f43b113
RA
155662001-08-25 Robert Anisko <robert.anisko@epita.fr>
15567
15568 * src/main.c (main): Initialize the macro table.
15569
dd3127cf
RA
155702001-08-25 Robert Anisko <robert.anisko@epita.fr>
15571
15572 * src/lex.c (percent_table): Add tok_define.
15573 * src/lex.h: Add tok_define.
15574
aa321494
RA
155752001-08-25 Robert Anisko <robert.anisko@epita.fr>
15576
15577 * src/macrotab.c: New file.
15578 * src/macrotab.h: New file.
15579 * src/Makefile.am: Update.
15580
68bd3b6b
RA
155812001-08-25 Robert Anisko <robert.anisko@epita.fr>
15582
15583 * lib/hash.c: New file.
15584 * lib/hash.h: New file.
15585 * lib/Makefile.am: Update.
15586
45f8dd1e
AD
155872001-08-15 Akim Demaille <akim@epita.fr>
15588
15589 Version 1.28c.
15590
40a64a7a 155912001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
15592
15593 * src/reader.c (readgram): Indent output macro YYSTYPE.
15594 (packsymbols): Likewise.
15595 (output_token_defines): Likewise.
15596 * src/files.c: Standardize.
15597 (compute_header_macro): New.
15598 (defines_obstack_save): New. Use compute_header_macro.
15599 (output_files): Update. Use defines_obstack_save.
15600
f9a8293a
AD
156012001-08-15 Akim Demaille <akim@epita.fr>
15602
15603 * doc/bison.texinfo (Table of Symbols): Document
15604 YYSTACK_USE_ALLOCA.
15605
150ca7a7
AD
156062001-08-15 Akim Demaille <akim@epita.fr>
15607
15608 * missing: Update from CVS Automake.
15609 * config/config.guess, config/config.sub, config/texinfo.tex:
15610 Update from gnu.org.
15611
69b5cec4
AD
156122001-08-15 Akim Demaille <akim@epita.fr>
15613
15614 * Makefile.maint: Sync with CVS Autoconf.
15615
f2b5126e
PB
156162001-08-14 Pascal Bart <pascal.bart@epita.fr>
15617
69b5cec4 15618 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
15619 `fdl.texi'.
15620 * doc/fdl.texi: Add to package.
15621
4ecbf796
MA
156222001-08-14 Marc Autret <autret_m@epita.fr>
15623
15624 Turn on %{source,header}_extension features.
15625
69b5cec4 15626 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
15627 source_extension.
15628 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 15629 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
15630 between options.
15631
95fb5662
MA
156322001-08-14 Marc Autret <autret_m@epita.fr>
15633
15634 * src/files.c (compute_base_names): Add extensions computing when
15635 `--file-prefix' used.
15636 Standardize function calls.
15637
78d09da9
MA
156382001-08-13 Marc Autret <autret_m@epita.fr>
15639
69b5cec4 15640 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
15641 defining it (defined but null disables alloca).
15642
5a009f2c
MA
156432001-08-13 Marc Autret <autret_m@epita.fr>
15644
15645 * src/bison.simple (_yy_memcpy): CPP reformat.
15646
1e41465a
PB
156472001-08-13 Pascal Bart <pascal.bart@epita.fr>
15648
15649 * tests/atconfig.in (CPPFLAGS): Fix.
15650
c67a198d
PB
156512001-08-10 Pascal Bart <pascal.bart@epita.fr>
15652
79282c6c 15653 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
15654 `gpl.texi'.
15655 * doc/gpl.texi: Add to package.
15656
09a6de7e
MA
156572001-08-10 Marc Autret <autret_m@epita.fr>
15658
15659 * src/print_graph.h: Fix.
15660 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
15661
b77b9ee0
AD
156622001-08-10 Akim Demaille <akim@epita.fr>
15663
15664 * src/system.h: Provide default declarations for stpcpy, strndup,
15665 and strnlen.
15666
3e259915
MA
156672001-08-10 Robert Anisko <anisko_r@epita.fr>
15668
15669 * doc/bison.texinfo (Locations): Update @$ stuff.
15670
ca96bc2d
MA
156712001-08-09 Robert Anisko <anisko_r@epita.fr>
15672
15673 * src/bison.simple (YYLLOC_DEFAULT): Update.
15674 (yyparse): Adjust.
15675
fdc6758b
MA
156762001-08-08 Marc Autret <autret_m@epita.fr>
15677
b77b9ee0 15678 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
15679 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
15680 Reported by Fabrice Bauzac.
957d4dbf 15681
600cad3b
MA
156822001-08-08 Marc Autret <autret_m@epita.fr>
15683
15684 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
15685 * src/vcg.c (output_node): Fix.
15686 * src/vcg.h: Cleanup.
15687 * src/print_graph.c: Add comments.
b77b9ee0 15688 (node_output_size): New global variable. Simplify the formatting of
600cad3b 15689 the VCG graph output.
b77b9ee0 15690 (print_actions): Unused code is now used. It notifies the final state
600cad3b 15691 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 15692 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
15693 blue.
15694 Get the current node name and node_obstack by argument.
15695 (node_obstack): New variable.
15696 (print_state): Manage node_obstack.
15697 (print_core): Use node_obstack given by argument.
15698 A node is not only computed here but in print_actions also.
15699 (print_graph): CPP out useless code instead of commenting it.
15700
976e528f
AD
157012001-08-07 Pascal Bart <pascal.bart@epita.fr>
15702
15703 * tests/atconfig.in (CPPFLAGS): Fix.
15704
20e8e5ca
AD
157052001-08-07 Akim Demaille <akim@epita.fr>
15706
15707 * src/print_graph.c (quote): New.
15708 (print_core): Use it.
15709
957d4dbf 157102001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 15711
3e3da797
AD
15712 * src/vcg.c (complain.h): Include it.
15713 Unepitaize `return' invocations.
c4b66126 15714 [NDEBUG] (main): Remove.
79282c6c 15715 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
15716 * src/files.c (open_files): Initialize graph_obstack.
15717 * src/print_graph.c (print_actions): CPP out useless code.
15718 (print_core): Don't output the last `\n' in labels.
15719 Use `quote'.
15720 * src/files.c (output_files): Output the VCG file.
15721 * src/main.c (main): Invoke print_graph ();
3e3da797 15722
957d4dbf 157232001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
15724
15725 Automaton VCG graph output.
15726 Using option ``-g'' or long option ``--graph'', you can generate
15727 a gram_filename.vcg file containing a VCG description of the LALR (1)
15728 automaton of your grammar.
15729
15730 * src/main.c: Call to print_graph() function.
15731 * src/getargs.h: Update.
15732 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
15733 (graph_flag): New flag.
15734 (longopts): Update.
15735 (getargs): Add case `g'.
15736 * src/files.c (graph_obstack): New obstack struct.
15737 (open_files): Initialize new obstack.
15738 (output_files): Saves graph_obstack if required.
15739 * src/files.h (graph_obstack): New extern declaration.
15740 * src/Makefile.am: Add new source files.
15741
927c1557 157422001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
15743
15744 * src/print_graph.c, src/print_graph.h (graph): New.
15745 * src/vcg.h: New file.
15746 * src/vcg.c: New file, VCG graph handling.
15747
7333d403
AD
157482001-08-06 Marc Autret <autret_m@epita.fr>
15749
15750 Add of %source_extension and %header_extension which specify
15751 the source or/and the header output file extension.
15752
15753 * src/files.c (compute_base_names): Remove initialisation of
15754 src_extension and header_extension.
15755 (compute_exts_from_gf): Update.
15756 (compute_exts_from_src): Update.
15757 (output_files): Update.
15758 * src/reader.c (parse_header_extension_decl): New.
15759 (parse_source_extension_decl): New.
15760 (read_declarations): New case statements for the new tokens.
15761 * src/lex.c (percent_table): Add entries for %source_extension
15762 and %header_extension.
15763 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
15764
84163231
AD
157652001-08-06 Marc Autret <autret_m@epita.fr>
15766
15767 * configure.in: Bump to 1.28c.
15768 * doc/bison.texinfo: Texinfo thingies.
15769
8303fc42
AD
157702001-08-04 Pascal Bart <pascal.bart@epita.fr>
15771
15772 * tests/atconfig.in (CPPFLAGS): Add.
15773 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
15774
70a84437
AD
157752001-08-03 Akim Demaille <akim@epita.fr>
15776
15777 Version 1.28b.
15778
2ce10144
AD
157792001-08-03 Akim Demaille <akim@epita.fr>
15780
15781 * tests/Makefile.am (check-local): Ship testsuite.
15782 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
15783 Include `string.h'.
15784
1e3e4bc1
AD
157852001-08-03 Akim Demaille <akim@epita.fr>
15786
15787 * configure.in: Try using -Wformat when compiling.
15788
42b45b7f
AD
157892001-08-03 Akim Demaille <akim@epita.fr>
15790
15791 * configure.in: Bump to 1.28b.
15792
8f13fe33
AD
157932001-08-03 Akim Demaille <akim@epita.fr>
15794
15795 * src/complain.c: Adjust strerror_r portability issues.
15796
b37ba92c
AD
157972001-08-03 Akim Demaille <akim@epita.fr>
15798
15799 Version 1.28a.
15800
b0ce6046
AD
158012001-08-03 Akim Demaille <akim@epita.fr>
15802
15803 * src/getargs.c, src/getarg.h (skeleton)): Constify.
15804 * src/lex.c (literalchar): Avoid name clashes on `buf'.
15805 * src/getargs.c: Include complain.h.
15806 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
15807 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
15808
d01c415b
AD
158092001-08-03 Akim Demaille <akim@epita.fr>
15810
15811 * src/reader.c (readgram): Display hidden chars in error messages.
15812
459dd1a6
AD
158132001-08-03 Akim Demaille <akim@epita.fr>
15814
15815 Update to gettext 0.10.39.
15816
53b74c0c
AD
158172001-08-03 Akim Demaille <akim@epita.fr>
15818
15819 * lib/strspn.c: New.
15820
234a3be3
AD
158212001-08-01 Marc Autret <autret_m@epita.fr>
15822
15823 * doc/bison.texinfo: Update.
15824 * doc/bison.1 (mandoc): Update.
15825 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
15826 * src/files.c: Support output files extensions computing.
15827 (src_extension): New static variable.
15828 (header_extension): New static variable.
15829 (tr): New function.
15830 (get_extension_index): New function, gets the index of an extension
15831 filename in a string.
15832 (compute_exts_from_gf): New function, computes extensions from the
15833 grammar file extension.
15834 (compute_exts_from_src): New functions, computes extensions from the
15835 C source file extension, file given by ``-o'' option.
15836 (compute_base_names): Update.
15837 (output_files): Update.
15838
847bf1f5
AD
158392001-08-01 Robert Anisko <anisko_r@epita.fr>
15840
d995fee7 15841 * doc/bison.texi: Document @$.
847bf1f5
AD
15842 (Locations): New section.
15843
d074a105
AD
158442001-07-18 Akim Demaille <akim@epita.fr>
15845
15846 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
15847 * config/prev-version.txt, config/move-if-change: New.
15848 * Makefile.am: Adjust.
15849
3419715d
AD
158502001-07-08 Pascal Bart <pascal.bart@epita.fr>
15851
15852 * src/bison.simple (yyparse): Suppress warning `comparaison
15853 between signed and unsigned'.
15854
62ab6972
AD
158552001-07-05 Pascal Bart <pascal.bart@epita.fr>
15856
15857 * src/getargs.h (raw_flag): Remove.
15858 * src/getargs.c: Die on `-r'/`--raw'.
15859 * src/lex.c (parse_percent_token): Die on `%raw'.
15860 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
15861 * tests/calc.at: Suppress test with option `--raw'.
15862
1e24cc5b
AD
158632001-07-14 Akim Demaille <akim@epita.fr>
15864
15865 * config/: New.
15866 * configure.in: Require Autoconf 2.50.
15867 Update to gettext 0.10.38.
15868
32dfccf8
AD
158692001-03-16 Akim Demaille <akim@epita.fr>
15870
15871 * doc/bison.texinfo: ANSIfy the examples.
15872
cd5bd6ac
AD
158732001-03-16 Akim Demaille <akim@epita.fr>
15874
15875 * getargs.c (skeleton): New variable.
15876 (longopts): --skeleton is a new option.
15877 (shortopts, getargs): -S is a new option.
15878 * getargs.h: Declare skeleton.
15879 * output.c (output_parser): Use it.
15880
5141b016
AD
158812001-03-16 Akim Demaille <akim@epita.fr>
15882
15883 * m4/strerror_r.m4: New.
15884 * m4/error.m4: Run AC_FUNC_STRERROR_R.
15885 * lib/error.h, lib/error.c: Update.
15886
447992b9
AD
158872001-03-16 Akim Demaille <akim@epita.fr>
15888
15889 * src/getargs.c (longopts): Clean up.
15890
274d42ce
AD
158912001-02-21 Akim Demaille <akim@epita.fr>
15892
15893 * src/reader.c (gensym): `gensym_count' is your own.
15894 Use a static buf to create the symbol name, as token_buffer is no
15895 longer a buffer.
15896
22c821f3
AD
158972001-02-08 Akim Demaille <akim@epita.fr>
15898
15899 * src/conflicts.c (conflict_report): Be sure not to append to res
15900 between two calls, which could happen if both first sprintf were
15901 skipped, but not the first cp += strlen.
15902
18569462
AD
159032001-02-08 Akim Demaille <akim@epita.fr>
15904
15905 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
15906 New, from fileutils 4.0.37.
15907 * configure.in: Require Autoconf 2.49c. I took some time before
15908 making this decision. This is the only way out for portability
15909 issues in Bison, it would mean way too much duplicate effort to
15910 import in Bison features implemented in 2.49c since 2.13.
15911 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
15912
0d8f3c8a
AD
159132001-02-02 Akim Demaille <akim@epita.fr>
15914
15915 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 15916 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 15917
f17bcd1f
AD
159182001-01-19 Akim Demaille <akim@epita.fr>
15919
15920 Get rid of the ad hoc handling of token_buffer in the scanner: use
15921 the obstacks.
15922
15923 * src/lex.c (token_obstack): New.
15924 (init_lex): Initialize it. No longer call...
15925 (grow_token_buffer): this. Remove it.
15926 Adjust all the places which used it to use the obstack.
15927
511e79b3
AD
159282001-01-19 Akim Demaille <akim@epita.fr>
15929
15930 * src/lex.h: Rename all the tokens:
15931 s/\bENDFILE\b/tok_eof/g;
15932 s/\bIDENTIFIER\b/tok_identifier/g;
15933 etc.
15934 Let them be enums, not #define, to ease debugging.
15935 Adjust all the code.
15936
0d6508ef
AD
159372001-01-18 Akim Demaille <akim@epita.fr>
15938
15939 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
15940 * src/lex.c (maxtoken, grow_token_buffer): Static.
15941
6deb4447
AD
159422001-01-18 Akim Demaille <akim@epita.fr>
15943
15944 Since we now use obstacks, more % directives can be enabled.
15945
15946 * src/lex.c (percent_table): Also accept `%yacc',
15947 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
15948 `%debug'.
15949 Handle the actions for `%semantic_parser' and `%pure_parser' here,
15950 instead of returning a token.
15951 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
15952 * src/reader.c (read_declarations): Adjust.
15953 * src/files.c (open_files): Don't call `compute_base_names', don't
15954 compute `attrsfile' since they depend upon data which might be
15955 *in* the input file now.
15956 (output_files): Do it here.
15957 * src/output.c (output_headers): Document the fact that this patch
15958 introduces a guaranteed SEGV for semantic parsers.
15959 * doc/bison.texinfo: Document them.
15960 * tests/suite.at: Exercise these %options.
15961
ff4423cc
AD
159622000-12-20 Akim Demaille <akim@epita.fr>
15963
15964 Also handle the output file (--verbose) with obstacks.
15965
15966 * files.c (foutput): Remove.
15967 (output_obstack): New.
15968 Adjust all dependencies.
15969 * src/conflicts.c: Return a string.
15970 * src/system.h (obstack_grow_string): Rename as...
15971 (obstack_sgrow): this. Be ready to work with non literals.
15972 (obstack_fgrow4): New.
15973
956dba3a
AD
159742000-12-20 Akim Demaille <akim@epita.fr>
15975
15976 * src/files.c (open_files): Fix the computation of short_base_name
15977 in the case of `-o foo.tab.c'.
15978
337bab46
AD
159792000-12-20 Akim Demaille <akim@epita.fr>
15980
15981 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
15982 (copy_dollar): Now that everything uses obstacks, get rid of the
15983 FILE * parameters.
15984
5d3214b8
AD
159852000-12-20 Akim Demaille <akim@epita.fr>
15986
15987 * src/files.c (open_files): Actually the `.output' file is based
15988 on the short_base_name, not base_name.
15989 * tests/suite.at (Checking output file names): Adjust.
15990
29092a57
AD
159912000-12-20 Akim Demaille <akim@epita.fr>
15992
15993 * src/bison.s1: Remove, we now use directly...
15994 * src/bison.simple: this.
15995 * src/Makefile.am: Use pkgdata instead of data.
15996
ea5607fd
AD
159972000-12-20 Akim Demaille <akim@epita.fr>
15998
15999 * src/files.c (guard_obstack): New.
16000 (open_files): Initialize it.
16001 (output_files): Dump it...
16002 * src/files.h: Export it.
16003 * src/reader.c (copy_guard): Use it.
16004
27110317
AD
160052000-12-19 Akim Demaille <akim@epita.fr>
16006
16007 * src/files.c (outfile, defsfile, actfile): Removed as global
16008 vars.
16009 (open_files): Don't compute them.
16010 (output_files): Adjust.
16011 (base_name, short_base_name): Be global.
16012 Adjust dependencies.
16013
19c50364
AD
160142000-12-19 Akim Demaille <akim@epita.fr>
16015
16016 * src/files.c (strsuffix): New.
16017 (stringappend): Be just like strcat but allocate.
16018 (base_names): Eve out from open_files.
16019 Try to simplify the rather hairy computation of base_name and
16020 short_base_name.
16021 (open_files): Use it.
16022 * tests/suite.at (Checking output file names): New test.
16023
573c1d9f
AD
160242000-12-19 Akim Demaille <akim@epita.fr>
16025
16026 * src/system.h (obstack_grow_literal_string): Rename as...
16027 (obstack_grow_string): this.
16028 * src/output.c (output_parser): Recognize `%% actions' instead of
16029 `$'.
16030 * src/bison.s1: s/$/%% actions/.
16031 * src/bison.hairy: Likewise.
16032
ef7ddedd
AD
160332000-12-19 Akim Demaille <akim@epita.fr>
16034
16035 * src/output.c (output_parser): Compute the `#line' lines when
16036 there are.
16037 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
16038 Suggested by Hans Aberg.
16039
ff61dabd
AD
160402000-12-19 Akim Demaille <akim@epita.fr>
16041
16042 Let the handling of the skeleton files be local to the procedures
16043 that use it.
16044
16045 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
16046 longer static.
16047 (fparser, open_extra_files): Remove.
16048 (open_files, output_files): Don't take care of fparser.
16049 * src/files.h: Adjust.
16050 * src/output.c (output_parser): Open and close the file to the
16051 skeleton.
16052 * src/reader.c (read_declarations): When %semantic_parser, open
16053 fguard.
16054
55b96341
AD
160552000-12-19 Akim Demaille <akim@epita.fr>
16056
16057 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
16058 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
16059
358c15b7
AD
160602000-12-19 Akim Demaille <akim@epita.fr>
16061
16062 * src/files.c (open_files): Yipee! We no longer need all the code
16063 looking for `/tmp' since we have no tmp file.
16064
7de3329e
AD
160652000-12-19 Akim Demaille <akim@epita.fr>
16066
16067 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
16068 New macros.
16069 * src/files.c (open_files): Less dependency on MSDOS etc.
16070
3abcd459
AD
160712000-12-14 Akim Demaille <akim@epita.fr>
16072
16073 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
16074 Provide a default definition.
16075 Use it when executing the default @ action.
16076 * src/reader.c (reader_output_yylsp): No longer include
16077 `timestamp' and `text' in the default YYLTYPE.
16078
2a91a95e
AD
160792000-12-12 Akim Demaille <akim@epita.fr>
16080
16081 * src/reader.c (copy_definition, parse_union_decl, copy_action)
16082 (copy_guard): Quote the file names.
16083 Reported by Laurent Mascherpa.
16084
14d3eb9b
AD
160852000-12-12 Akim Demaille <akim@epita.fr>
16086
16087 * src/output.c (output_headers, output_program, output): Be sure
16088 to escape special characters when outputting filenames.
16089 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
16090 (output_headers): Don't depend on them, Use ACTSTR.
16091
d7045ec6
AD
160922000-11-17 Akim Demaille <akim@epita.fr>
16093
16094 * lib/obstack.h: Formatting changes.
16095 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
16096 prevents type checking.
16097 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
16098 cast the value to (void *): assigning a `foo *' to a `void *'
16099 variable is valid.
16100 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
16101 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
16102 append characters.
16103
6fd54b73
AD
161042000-11-17 Akim Demaille <akim@epita.fr>
16105
16106 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
16107 as...
16108 (suite.m4, regression.m4, calc.m4): these.
16109 * tests/atgeneral.m4: Update from CVS Autoconf.
16110
4c50eae6
AD
161112000-11-17 Akim Demaille <akim@epita.fr>
16112
16113 * tests/regression.m4 (%union and --defines): New test,
16114 demonstrating a current bug in the obstack implementation.
16115
a35f64ea
AD
161162000-11-17 Akim Demaille <akim@epita.fr>
16117
16118 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
16119 macros.
16120 Use them to declare the variables which are global or local to
16121 `yyparse'.
16122
7de23534
AD
161232000-11-17 Akim Demaille <akim@epita.fr>
16124
16125 * acconfig.h: Remove, no longer used.
16126
aa7815f5
AD
161272000-11-07 Akim Demaille <akim@epita.fr>
16128
16129 * src: s/Copyright (C)/Copyright/g.
16130
5af1f549
AD
161312000-11-07 Akim Demaille <akim@epita.fr>
16132
16133 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
16134 defining.
16135 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
16136
553e2b22
AD
161372000-11-07 Akim Demaille <akim@epita.fr>
16138
16139 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
16140 Merge in a single CPP if/else.
16141
8a4f41d6
AD
161422000-11-07 Akim Demaille <akim@epita.fr>
16143
16144 * src/output.c (output): Remove useless variables.
16145 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
16146 argument `data' for consistency with the prototypes.
16147 Qualify it `const'.
16148 (obstack_copy, obstack_copy0): Rename the second argument as
16149 `address' for consistency. Qualify it `const'.
16150 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
16151 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
16152 `const' their input argument (`data' or `address').
16153 Adjust the corresponding macros to include `const' in casts.
16154
095a3fb5
AD
161552000-11-03 Akim Demaille <akim@epita.fr>
16156
16157 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
16158 s/PFILE1/BISON_HAIRY/.
16159 Adjust dependencies.
16160
d1cdce7c
AD
161612000-11-03 Akim Demaille <akim@epita.fr>
16162
090c5ebf 16163 For some reason, this was not applied.
d1cdce7c
AD
16164
16165 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16166 `unlink': it's no longer used.
16167
9311529b
AD
161682000-11-03 Akim Demaille <akim@epita.fr>
16169
16170 * src/files.c (skeleton_find): New function, eved out of...
16171 (open_files, open_extra_files): here.
16172
d8880f69
AD
161732000-11-03 Akim Demaille <akim@epita.fr>
16174
16175 Don't use `atexit'.
16176
16177 * src/files.c (obstack_save): New function.
16178 (done): Rename as...
16179 (output_files): this.
16180 Use `obstack_save'.
16181 * src/main.c (main): Don't use `atexit' to register `done', since
16182 it no longer has to remove tmp files, just call `output_files'
16183 when there are no errors.
16184
0dbb648e
AD
161852000-11-02 Akim Demaille <akim@epita.fr>
16186
16187 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
16188 `unlink': it's no longer used.
16189 * src/files.h: Formatting changes.
16190
896fe5c1
AD
161912000-11-02 Akim Demaille <akim@epita.fr>
16192
16193 Remove the last uses of mktemp and unlink/delete.
16194
16195 * src/files.c (fdefines, ftable): Removed.
16196 (defines_ostack, table_obstack): New.
16197 Adjust dependencies of the former into uses of the latter.
16198 * src/output.c (output_short_or_char_table, output_short_table):
16199 Convert to using obstacks.
16200 * src/reader.c (copy_comment2): Accept one FILE * and two
16201 obstacks.
16202 (output_token_defines, reader_output_yylsp): Use obstacks.
16203 * src/system.h (obstack_fgrow3): New.
1f65350a 16204 * po/POTFILES.in: Adjust.
896fe5c1 16205
dd60faec
AD
162062000-11-01 Akim Demaille <akim@epita.fr>
16207
16208 Change each use of `fattrs' into a use of `attrs_obstack'.
16209
16210 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
16211 * src/files.c (fattrs): Remove.
16212 (attrs_obstack): New.
16213 Adjust all dependencies.
16214 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
16215
8c7ebe49
AD
162162000-11-01 Akim Demaille <akim@epita.fr>
16217
16218 Introduce obstacks.
16219 Change each use of `faction' into a use of `action_obstack'.
16220
16221 * lib/obstack.h, lib/obstack.c: New files.
16222 * src/files.c (faction): Remove.
16223 (action_obstack): New.
16224 Adjust all dependencies.
16225
77aee789
AD
162262000-10-20 Akim Demaille <akim@epita.fr>
16227
16228 * lib/quote.h (PARAMS): New macro. Use it.
16229
43591cec
AD
162302000-10-16 Akim Demaille <akim@epita.fr>
16231
16232 * src/output.c (output_short_or_char_table): New function.
16233 (output_short_table, output_token_translations): Use it.
16234 (goto_actions): Use output_short_table.
16235
1e9798d5
AD
162362000-10-16 Akim Demaille <akim@epita.fr>
16237
16238 * src/symtab.c (bucket_new): New function.
16239 (getsym): Use it.
16240
16241 * src/output.c (output_short_table): New argument to display the
16242 comment associated with the table.
16243 Adjust dependencies.
16244 (output_gram): Use it.
16245 (output_rule_data): Nicer output layout for YYTNAME.
16246
f282676b
AD
162472000-10-16 Akim Demaille <akim@epita.fr>
16248
16249 * src/lex.c (read_typename): New function.
16250 (lex): Use it.
16251 * src/reader.c (copy_dollar): Likewise.
16252
550a72a3
AD
162532000-10-16 Akim Demaille <akim@epita.fr>
16254
16255 * src/reader.c (copy_comment2): Expect the input stream to be on
16256 the `/' which is suspected to open a comment, instead of being
16257 called after `//' or `/*' was read.
16258 (copy_comment, copy_definition, parse_union_decl, copy_action)
16259 (copy_guard): Adjust.
16260
131e2fef
AD
162612000-10-16 Akim Demaille <akim@epita.fr>
16262
16263 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
16264 `read_signed_integer'.
16265
79282c5a
AD
162662000-10-16 Akim Demaille <akim@epita.fr>
16267
16268 * src/reader.c (copy_dollar): New function.
16269 (copy_guard, copy_action): Use it.
16270
ff4a34be
AD
162712000-10-16 Akim Demaille <akim@epita.fr>
16272
16273 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
16274 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
16275 New files, from Fileutils 4.0.27.
16276 * src/main.c (printable_version): Remove.
16277 * src/lex.c, src/reader.c: Use `quote'.
16278
162792000-10-04 Akim Demaille <akim@epita.fr>
16280
16281 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
16282
14ded682
AD
162832000-10-04 Akim Demaille <akim@epita.fr>
16284
16285 * doc/bison.texinfo: Various typos spotted by Neil Booth.
16286
8e03724b
AD
162872000-10-04 Akim Demaille <akim@epita.fr>
16288
16289 When a literal string is used to define two different tokens,
16290 `bison -v' segfaults.
16291 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
16292
16293 * tests/regression.m4: New file.
16294 Include the core of the sample provided by Piotr Gackiewicz.
16295 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
16296 properly.
16297
a9e64249
AD
162982000-10-04 Akim Demaille <akim@epita.fr>
16299
16300 * src/reader.c (parse_expect_decl): Keep `count' within the size
16301 of `buffer'.
16302 From Neil Booth.
16303
da9abf43
AD
163042000-10-02 Paul Eggert <eggert@twinsun.com>
16305
16306 * bison.s1 (yyparse): Assign the default value
16307 unconditionally, to avoid a GCC warning and make the parser a
16308 tad smaller.
16309
c33638bb
AD
163102000-10-02 Akim Demaille <akim@epita.fr>
16311
16312 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
16313 options.
16314
444c570a
AD
163152000-10-02 Akim Demaille <akim@epita.fr>
16316
16317 * src/derives.c, src/print.c, src/reduce.c: To ease the
16318 translation, move some `\n' out of the translated strings.
16319
89cab50d
AD
163202000-10-02 Akim Demaille <akim@epita.fr>
16321
16322 The location tracking mechanism is precious for parse error
16323 messages. Nevertheless, it is enabled only when `@n' is used in
16324 the grammar, which is a different issue (you can use it in error
16325 message, but not in the grammar per se). Therefore, there should
16326 be another means to enable it.
16327
16328 * src/getargs.c (getargs): Support `--locations'.
16329 (usage): Report it.
16330 * src/getargs.h (locationsflag): Export it.
16331 * src/lex.c (percent_table): Support `%locations'.
16332 * src/reader.c (yylsp_needed): Remove this variable, now replaced
16333 with `locationsflag'.
16334 * doc/bison.texinfo: Document `--locations' and `%locations'.
16335 Sort the options.
16336 * tests/calc.m4: Test it.
16337
16338 For regularity of the names, replace each
16339 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
16340 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
16341 In addition replace each `flag' with `_flag'.
16342
d6c2cba0
AD
163432000-10-02 Akim Demaille <akim@epita.fr>
16344
16345 Also test parse error messages, including with YYERROR_VERBOSE.
16346
16347 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
16348 associative).
16349 Use it to check the computations.
16350 Use it to check `nonassoc' is honored.
16351 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
16352 `--yyerror-verbose'.
16353 (_AT_CHECK_CALC): Adjust to this option.
16354 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
16355
5a35a6cb
AD
163562000-10-02 Akim Demaille <akim@epita.fr>
16357
16358 Test also `--verbose', `--defines' and `--name-prefix'. Testing
16359 the latter demonstrates a flaw in the handling of non debugging
16360 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
16361 was used in order to simplify:
16362
16363 #if YYDEBUG
16364 if (yydebug)
16365 {
16366 ...
16367 }
16368 #endif
16369
16370 into
16371
16372 if (yydebug)
16373 {
16374 ...
16375 }
16376
16377 unfortunately this leads to a CPP conflict when
16378 `--name-prefix=foo' is used since it produces `#define yydebug
16379 foodebug'.
16380
16381 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
16382 (YYDPRINTF): New macro.
16383 Spread its use.
16384 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
16385 the bison options.
16386 Also test `--verbose', `--defines' and `--name-prefix'.
16387
71da9eea
AD
163882000-10-02 Akim Demaille <akim@epita.fr>
16389
16390 Improve the readability of the produced parsers.
16391
16392 * src/bison.s1: Formatting changes.
16393 Improve the comment related to the `$' mark.
16394 (yydefault): Don't fall through to `yyresume': `goto' there.
16395 * src/output.c (output_parser): When the `$' is met, skip the end
16396 of its line.
16397 New variable, `number_of_dollar_signs', to check there's exactly
16398 one `$' in the parser skeleton.
16399
95e36146
AD
164002000-10-02 Akim Demaille <akim@epita.fr>
16401
16402 * lib/xstrdup.c: New file, from the fileutils.
16403 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
16404 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
16405 instead of strlen + xmalloc + strcpy.
16406 * src/symtab.c (copys): Remove, use xstrdup instead.
16407
d7020c20
AD
164082000-10-02 Akim Demaille <akim@epita.fr>
16409
16410 * src/gram.h (associativity): New enum type which replaces the
16411 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
16412 `right_assoc', `left_assoc' and `non_assoc'.
16413 Adjust all dependencies.
16414 * src/reader.c: Formatting changes.
16415 (LTYPESTR): Don't define it, use it as a literal in
16416 `reader_output_yylsp'.
16417 * src/symtab.h (symbol_class): New enum type which replaces the
16418 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
16419 `sunknown', `stoken and `snterm'.
16420
1916f98e
AD
164212000-10-02 Akim Demaille <akim@epita.fr>
16422
16423 * src/getargs.c (fixed_outfiles): Rename as...
16424 (yaccflag): for consistency and accuracy.
16425 Adjust dependencies.
16426
d7913476
AD
164272000-10-02 Akim Demaille <akim@epita.fr>
16428
16429 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
16430 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
16431 difficult and introduced a lot of core dump. It turns out that
16432 Bison used an implementation of `xmalloc' based on `calloc', and
16433 at various places it does depend upon the initialization to 0. I
16434 have not tried to isolate the pertinent places, and all the former
16435 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
16436 someone should address this issue.
16437
16438 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
16439 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
16440 files.
16441 Adjust dependencies.
16442 * src/warshall.h: New file.
16443 Propagate.
16444
340ef489
AD
164452000-10-02 Akim Demaille <akim@epita.fr>
16446
16447 Various anti-`extern in *.c' changes.
16448
16449 * src/system.h: Include `assert.h'.
16450
b2ca4022
AD
164512000-10-02 Akim Demaille <akim@epita.fr>
16452
16453 * src/state.h (nstates, final_state, first_state, first_shift)
16454 (first_reduction): Move their exportation from here...
16455 * src/LR0.h: to here.
16456 Adjust dependencies.
16457 * src/getargs.c (statisticsflag): New variable.
16458 Add support for `--statistics'.
16459 Adjust dependencies.
16460
16461 Remove a lot of now useless `extern' statements in most files.
16462
403b315b
AD
164632000-10-02 Akim Demaille <akim@epita.fr>
16464
16465 * src/LR0.h: New file.
16466 Propagate its use.
16467
07a58c13
AD
164682000-10-02 Akim Demaille <akim@epita.fr>
16469
16470 * src/print.h: New file.
16471 Propagate its use.
16472 * src/print.c: Formatting and ordering changes.
16473 (verbose, terse): Replace with...
16474 (print_results): this new function.
16475 Adjust dependencies.
16476
0619caf0
AD
164772000-10-02 Akim Demaille <akim@epita.fr>
16478
16479 * src/conflicts.c (conflict_report): New function.
16480 (conflict_log, verbose_conflict_log): Replace with...
16481 (print_conflicts): this function.
16482 Adjust dependencies.
16483 * src/conflicts.h: New file.
16484 Propagate its inclusion.
16485
3519ec76
AD
164862000-10-02 Akim Demaille <akim@epita.fr>
16487
16488 * src/nullable.h: New file.
16489 Propagate its inclusion.
16490 * src/nullable.c: Formatting changes.
16491
015acc48
AD
164922000-10-02 Akim Demaille <akim@epita.fr>
16493
16494 * src/reduce.h: New file.
16495 Propagate its inclusion.
16496 * src/reduce.c: Topological sort and other formatting changes.
16497 (bool, TRUE, FALSE): Move their definition to...
16498 * src/system.h: here.
16499
8963a27b
AD
165002000-10-02 Akim Demaille <akim@epita.fr>
16501
16502 * src/files.c: Formatting changes.
16503 (tryopen, tryclose, openfiles): Rename as...
16504 (xfopen, xfclose, open_files): this.
16505 (stringappend): static.
16506 * src/files.h: Complete the list of exported symbols.
16507 Propagate its use.
16508
a70083a3
AD
165092000-10-02 Akim Demaille <akim@epita.fr>
16510
16511 * src/reader.h: New file.
16512 Propagate its use instead of tedious list of `extern' and
16513 prototypes.
16514 * src/reader.c: Formatting changes, topological sort,
16515 s/register//.
16516
abadc117
AD
165172000-10-02 Akim Demaille <akim@epita.fr>
16518
16519 * src/lex.h: Prototype `lex.c' exported functions.
16520 * src/reader.c: Adjust.
16521 * src/lex.c: Formatting changes.
16522 (safegetc): Rename as...
16523 (xgetc): this.
16524
720d742f
AD
165252000-10-02 Akim Demaille <akim@epita.fr>
16526
16527 * src/lalr.h: New file.
16528 Propagate its inclusion instead of prototypes and `extern'.
16529 * src/lalr.c: Formatting changes, topological sorting etc.
16530
f2acea59
AD
165312000-10-02 Akim Demaille <akim@epita.fr>
16532
16533 * src/output.c (token_actions): Introduce a temporary array,
16534 YYDEFACT, that makes it possible for this function to use
16535 output_short_table.
16536
d019d655
AD
165372000-10-02 Akim Demaille <akim@epita.fr>
16538
16539 `user_toknums' is output as a `short[]' in `output.c', while it is
16540 defined as a `int[]' in `reader.c'. For consistency with the
16541 other output tables, `user_toknums' is now defined as a table of
16542 shorts.
16543
16544 * src/reader.c (user_toknums): Be a short table instead of an int
16545 table.
16546 Adjust dependencies.
16547
16548 Factor the short table outputs.
16549
16550 * src/output.c (output_short_table): New function.
16551 * src/output.c (output_gram, output_stos, output_rule_data)
16552 (output_base, output_table, output_check): Use it.
16553
6c89f1c1
AD
165542000-10-02 Akim Demaille <akim@epita.fr>
16555
16556 * src/output.c (output): Topological sort of the functions, in
16557 order to get rid of the `static' prototypes.
16558 No longer use `register'.
16559 * src/output.h: New file.
16560 Propagate its inclusion in files explicitly prototyping functions
16561 from output.c.
16562
d9efd181
AD
165632000-09-21 Akim Demaille <akim@epita.fr>
16564
16565 * src/atgeneral.m4: Update from Autoconf.
16566
c29240e7 165672000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
16568
16569 * src/closure.h: New file.
16570 * src/closure.c: Formatting changes, topological sort over the
16571 functions, use of closure.h.
16572 (initialize_closure, finalize_closure): Rename as...
16573 (new_closure, free_closure): these. Adjust dependencies.
16574 * src/LR0.c: Formatting changes, topological sort, use of
16575 cloture.h.
16576 (initialize_states): Rename as...
16577 (new_states): this.
16578 * src/Makefile.am (noinst_HEADERS): Adjust.
16579
499daa50
AD
165802000-09-20 Akim Demaille <akim@epita.fr>
16581
16582 * src/acconfig.h: Don't protect config.h against multiple
16583 inclusion.
16584 Don't define PARAMS.
16585 * src/system.h: Define PARAMS.
16586 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
16587 purpose of config.h. system.h must not try to fix wrong
16588 definitions in config.h.
16589
cc84fd5d
AD
165902000-09-20 Akim Demaille <akim@epita.fr>
16591
16592 * src/derives.h: New file.
16593 * src/main.c, src/derives.h: Use it.
16594 Formatting changes.
16595 * src/Makefile.am (noinst_HEADERS): Adjust.
16596
db5b3a89
AD
165972000-09-20 Akim Demaille <akim@epita.fr>
16598
16599 * tests/atgeneral.m4: Update from Autoconf.
16600 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
16601 (AT_CHECK_CALC): New macros.
16602 Use these macros to test bison with options `', `--raw',
16603 `--debug', `--yacc', `--yacc --debug'.
16604
ceed8467
AD
166052000-09-19 Akim Demaille <akim@epita.fr>
16606
16607 * src/output.c: Formatting changes.
16608 * src/machine.h: Remove, leaving its contents in...
16609 * src/system.h: here.
16610 Include stdio.h.
16611 Adjust all dependencies on stdio.h and machine.h.
16612 * src/getargs.h: New file.
16613 Let all `extern' declarations about getargs.c be replaced with
16614 inclusion of `getargs.h'.
16615 * src/Makefile.am (noinst_HEADERS): Adjust.
16616
16617 * tests/calc.m4 (yyin): Be initialized in main, not on the global
16618 scope.
16619 (yyerror): Returns void, not int.
16620 * doc/bison.texinfo: Formatting changes.
16621
05a1d24b
AD
166222000-09-19 Akim Demaille <akim@epita.fr>
16623
16624 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
16625 portable.
16626
cbd25751
AD
166272000-09-18 Akim Demaille <akim@epita.fr>
16628
16629 * configure.in: Append WARNING_CFLAGS to CFLAGS.
16630 * src/Makefile.am (INCLUDES): Don't.
16631 Be ready to fetch headers in lib/.
16632
13863333
AD
166332000-09-18 Akim Demaille <akim@epita.fr>
16634
16635 * doc/bison.texinfo: Update the copyright.
16636 ANSIfy and GNUify the examples.
16637 Remove the old menu.
16638
0d533154
AD
166392000-09-18 Akim Demaille <akim@epita.fr>
16640
16641 First set of tests: use the `calc' example from the documentation.
16642
16643 * src/bison.s1 (yyparse): Condition the code using `yytname' which
16644 is defined only when YYDEBUG is.
16645 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
16646 * src/files.c (tryopen, tryclose): Formatting changes.
16647 Move to the top and be static.
16648 * src/reader.c (read_signed_integer): Likewise.
16649 * tests/calc.m4: New file.
16650 * Makefile.am, suite.m4: Adjust.
16651 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
16652
e79137ac
AD
166532000-09-18 Akim Demaille <akim@epita.fr>
16654
16655 Add support for an Autotest test suite for Bison.
16656
16657 * m4/m4.m4, m4/atconfig.m4: New files.
16658 * m4/Makefile.am (EXTRA_DIST): Adjust.
16659 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
16660 files.
16661 * src/getargs.c: Display a more standard --version message.
16662 * src/reader.c (reader): Formatting changes.
16663 No longer depend upon VERSION_STRING.
16664 * configure.in: No longer use `dnl'.
16665 Set up the test suite and the new directory `tests/.
16666 (VERSION_STRING): Remove.
16667
27821bff
AD
166682000-04-14 Akim Demaille <akim@epita.fr>
16669
16670 * src/reader.c (copy_comment2): New function, same as former
16671 `copy_comment', but outputs into two FILE *.
16672 (copy_comment): Use it.
16673 (parse_union_decl): Use it.
16674 (get_type, parse_start_decl): Use the same `invalid' message.
16675 (parse_start_decl, parse_union_decl): Use the same `multiple'
16676 message.
16677 (parse_union_decl, copy_guard, copy_action): Use the same
16678 `unmatched' message.
16679 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
16680
cfe5fbc0
AD
166812000-03-31 Akim Demaille <akim@epita.fr>
16682
16683 * src/files.c (tryopen, tryclose): Move to the top.
16684 Be static.
16685
cb7db13e
AD
166862000-03-31 Akim Demaille <akim@epita.fr>
16687
16688 * src/main.c (main): Don't call `done', exit does it.
16689
a0f6b076
AD
166902000-03-31 Akim Demaille <akim@epita.fr>
16691
36281465
AD
16692 * allocate.c: s/return (foo)/return foo/.
16693 * lalr.c: Likewise.
16694 * LR0.c: Likewise.
16695 * output.c: Likewise.
16696 * reader.c: Likewise.
16697 * symtab.c: Likewise.
16698 * vmsgetargs.c: Likewise.
16699
167002000-03-31 Akim Demaille <akim@epita.fr>
16701
16702 Clean up the error reporting functions.
a0f6b076
AD
16703
16704 * src/report.c: New file.
16705 * src/report.h: Likewise.
16706 * src/Makefile.am: Adjust.
16707 * m4/error.m4: New file.
16708 * m4/Makefile.am: Adjust.
16709 * configure.in (jm_PREREQ_ERROR): Call it.
16710 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
16711 Remove.
16712 (fatal, fatals): Remove. All callers use complain.c::fatal.
16713 (warn, warni, warns, warnss, warnss): Remove. All callers use
16714 complain.c::complain.
16715 (toomany): Remove, use fatal instead.
16716 * src/files.c (done): No argument, use complain_message_count.
16717 * src/main.c (main): Register `done' to `atexit'.
16718
16719 * src/getargs.c (usage): More `fputs', less `fprintf'.
16720
18539825
AD
167212000-03-28 Akim Demaille <akim@epita.fr>
16722
16723 * lib/: New directory.
16724 * Makefile.am (SUBDIRS): Adjust.
16725 * configure.in: Adjust.
16726 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
16727 useless.
16728 * src/alloca.c: Moved to lib/.
16729 * src/getopt.c: Likewise.
16730 * src/getopt1.c: Likewise.
16731 * src/getopt.h: Likewise.
16732 * src/ansi2knr.c: Likewise.
16733 * src/ansi2knr.1: Likewise.
16734 * src/Makefile.am: Adjust.
16735 * lib/Makefile.am: New file.
16736
9f306f2a
AD
167372000-03-28 Akim Demaille <akim@epita.fr>
16738
16739 * src/getargs.c (usage): Refresh the help message.
16740
0ba347b6
AD
167412000-03-17 Akim Demaille <akim@epita.fr>
16742
16743 * src/getopt1.c: Updated from textutils 2.0e
16744 * src/getopt.c: Likewise.
16745 * src/getopt.h: Likewise.
16746
dbe7f271
AD
167472000-03-17 Akim Demaille <akim@epita.fr>
16748
16749 * src/Makefile.am (bison.simple): Fix the awk program: quote only
16750 the file name, not the whole `#line LINE FILE'.
16751
75bbe78d
AD
167522000-03-17 Akim Demaille <akim@epita.fr>
16753
16754 On syntax errors, report the token on which we choked.
16755
aa5fd0ee
AD
16756 * src/bison.s1 (yyparse): In the label yyerrlab, when
16757 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 16758
7b306f52
AD
167592000-03-17 Akim Demaille <akim@epita.fr>
16760
aa5fd0ee 16761 * src/reader.c (copy_at): New function.
7b306f52
AD
16762 (copy_guard): Use it.
16763 (copy_action): Use it.
16764
e87b5700
AD
167652000-03-17 Akim Demaille <akim@epita.fr>
16766
16767 Be kind to translators, save some useless translations.
16768
aa5fd0ee 16769 * src/main.c (banner): New function.
e87b5700
AD
16770 (fatal_banner): Use it.
16771 (warn_banner): Use it.
16772
ae3c3164
AD
167732000-03-17 Akim Demaille <akim@epita.fr>
16774
aa5fd0ee
AD
16775 * src/reader.c (copy_definition): Use copy_string and
16776 copy_comment. Removed now unused `match', `ended',
16777 `cplus_comment'.
ae3c3164
AD
16778 (copy_comment, copy_string): Moved, to be visible from
16779 copy_definition.
16780
4dc58e7c
AD
167812000-03-17 Akim Demaille <akim@epita.fr>
16782
aa5fd0ee
AD
16783 * src/reader.c (copy_string): Declare `static inline'. No
16784 problems with inline, since it is checked by configure.
4dc58e7c
AD
16785 (copy_comment): Likewise.
16786
0a6384c4
AD
167872000-03-17 Akim Demaille <akim@epita.fr>
16788
aa5fd0ee 16789 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 16790
3cef001a
AD
167912000-03-17 Akim Demaille <akim@epita.fr>
16792
aa5fd0ee 16793 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
16794 (copy_action): Use it. Removed now unused `match', `ended',
16795 `cplus_comment'.
16796 (copy_guard): Likewise.
16797
ca36d2ef
AD
167982000-03-17 Akim Demaille <akim@epita.fr>
16799
aa5fd0ee 16800 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
16801 (copy_action): Use it.
16802 (copy_guard): Likewise.
16803
6666f98f
AD
168042000-03-17 Akim Demaille <akim@epita.fr>
16805
16806 Change the handling of @s so that they behave exactly like $s.
16807 There is now a pseudo variable @$ (readble and writable), location
16808 of the lhs of the rule (by default ranging from the location of
16809 the first symbol of the rhs, to the location of the last symbol,
16810 or, if the rhs is empty, YYLLOC).
16811
16812 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
16813 yyval.
16814 (yyparse): When providing a default semantic action, provide a
16815 default location action.
16816 (after the $): No longer change `*YYLSP', just stack YYLOC the
16817 same way you stack YYVAL.
16818 * src/reader.c (read_declarations): Use warns.
16819 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
16820 (copy_action, case '@'): Likewise.
16821 Use a standard error message, to save useless work from
16822 translators.
16823
41aca2e0
AD
168242000-03-17 Akim Demaille <akim@epita.fr>
16825
aa5fd0ee
AD
16826 * src/bison.s1: Formatting and cosmetics changes.
16827 * src/reader.c: Likewise.
41aca2e0
AD
16828 Update the Copyright notice.
16829
dc08c1d5
AD
168302000-03-17 Akim Demaille <akim@epita.fr>
16831
aa5fd0ee
AD
16832 * src/bison.s1 (#line): All set to `#line' only, since the
16833 Makefile now handles them.
dc08c1d5 16834
9ee3c97b
AD
168352000-03-16 Akim Demaille <akim@epita.fr>
16836
16837 * src/output.c (output_rule_data): Output the documentation of
16838 some of the tables.
16839 (Copyright notice): Update.
16840 Formatting changes.
16841
0de741ca
AD
168422000-03-16 Akim Demaille <akim@epita.fr>
16843
16844 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
16845 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
16846 One `#if YYDEBUG' remains, since it uses variables which are
16847 defined only if `YYDEBUG != 0'.
16848
bb10be54
AD
168492000-03-16 Akim Demaille <akim@epita.fr>
16850
16851 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
16852 and related variables so that the similarities are highlighted.
16853
b07b484a
AD
168542000-03-16 Akim Demaille <akim@epita.fr>
16855
16856 * src/bison.s1: Properly indent CPP directives.
16857
361f60b3
AD
168582000-03-16 Akim Demaille <akim@epita.fr>
16859
16860 * src/bison.s1: Properly indent the `alloca' CPP section.
16861
8c44d3ec
AD
168622000-03-16 Akim Demaille <akim@epita.fr>
16863
16864 Do not hard code values of directories in `configure.in'.
16865 Update the `configure' tool chain.
16866
16867 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
16868 src/makefile.am.
16869 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
16870 (AC_OUTPUT): Add m4/Makefile.
16871 Bump to bison 1.28a, 1.29 has never been released.
16872 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
16873 handled via src/Makefile.am.
16874 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
16875 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
16876 autoheader.
16877 * Makefile.am (SUBDIRS): Add m4.
16878 (ACLOCAL_AM_FLAGS): New variable.
16879 (AUTOMAKE_OPTIONS): Add check-news.
16880 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
16881 the proper line number and file name.
16882 (DEFS): Propagate the location of bison library files and of the
16883 locale files.
16884 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
16885 builddir.
16886 * acinclude.m4: Remove, replaced by the directory m4.
16887 * m4/Makefile.am (EXTRA_DIST): New variable.
16888 * m4/gettext.m4: New file, from the fileutils.
16889 * m4/lcmessage.m4: Likewise
16890 * m4/progtest.m4: Likewise.
16891 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
16892
f95997e7
AD
168932000-03-10 Akim Demaille <akim@epita.fr>
16894
16895 * src/closure.c:
16896 Formatting changes of various comments.
16897 Respect the GNU coding standards at various places.
16898 Don't use `_()' when no translation is needed.
16899
169001999-12-13 Jesse Thilo <jthilo@gnu.org>
16901
16902 * src/files.c:
16903 OS/2 honors TMPDIR environment variable.
16904
169051999-12-13 Jesse Thilo <jthilo@gnu.org>
16906
16907 * doc/bison.texinfo: Tweaked spelling and grammar.
16908 Updated ISBN.
16909 Removed reference to price of printed copy.
16910 Mention BISON_SIMPLE and BISON_HAIRY.
16911
169121999-12-13 Jesse Thilo <jthilo@gnu.org>
16913
16914 * configure.in, NEWS:
16915 Bison 1.29 released.
16916
169171999-10-27 Jesse Thilo <jthilo@gnu.org>
16918
16919 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
16920 Added reference card.
16921
169221999-07-26 Jesse Thilo <jthilo@gnu.org>
16923
16924 * po/ru.po: Added Russian translation.
16925
169261999-07-26 Jesse Thilo <jthilo@gnu.org>
16927
16928 * configure.in: Added Russian translation.
16929
169301999-07-06 Jesse Thilo <jthilo@gnu.org>
16931
16932 * configure.in, NEWS, README:
16933 Released version 1.28.
16934
169351999-06-14 Jesse Thilo <jthilo@gnu.org>
16936
16937 * src/system.h:
16938 Squashed redefinition warning on some systems.
16939
16940 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
16941 Have configure build version string instead of relying on ANSI string
16942 concatentation.
16943
169441999-06-14 Jesse Thilo <jthilo@gnu.org>
16945
16946 * po/POTFILES.in: Got rid of version.c.
16947
169481999-06-14 Jesse Thilo <jthilo@gnu.org>
16949
16950 * acconfig.h, configure.in:
16951 Have configure build version string instead of relying on ANSI string
16952 concatentation.
16953
169541999-06-08 Jesse Thilo <jthilo@gnu.org>
16955
16956 * doc/bison.1:
16957 Dropped mention of `+' for long-named options.
16958
169591999-05-30 Jesse Thilo <jthilo@gnu.org>
16960
16961 * src/files.c: Added <unistd.h> for unlink().
16962
16963 * src/Makefile.am, src/system.h:
16964 I18n fixes.
16965
169661999-05-30 Jesse Thilo <jthilo@gnu.org>
16967
16968 * README: Added a FAQ list.
16969
16970 * configure.in, acconfig.h:
16971 I18n fixes.
16972
169731999-05-30 Jesse Thilo <jthilo@gnu.org>
16974
16975 * doc/FAQ, doc/Makefile.am:
16976 Added a FAQ list.
16977
169781999-05-19 Jesse Thilo <jthilo@gnu.org>
16979
16980 * src/alloc.h, src/symtab.h, src/version.c:
16981 Protected inclusion of "config.h" with HAVE_CONFIG_H.
16982
169831999-04-18 Jesse Thilo <jthilo@gnu.org>
16984
16985 * src/.cvsignore, src/Makefile.am:
16986 Reorganized: sources in `src', documentation in `doc'.
16987
16988 * src/lex.c (literalchar):
16989 fixed the code for escaping double quotes (thanks
16990 Jonathan Czisny.)
16991
169921999-04-18 Jesse Thilo <jthilo@gnu.org>
16993
16994 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
16995 Adjusted paths to reflect directory reorganization.
16996
169971999-04-18 Jesse Thilo <jthilo@gnu.org>
16998
16999 * doc/.cvsignore, doc/Makefile.am:
17000 Reorganized: sources in `src', documentation in `doc'.
17001
170021999-04-18 Jesse Thilo <jthilo@gnu.org>
17003
17004 * configure.in:
17005 Updated AC_INIT file to reflect directory reorganization.
17006
17007 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
17008 Reorganized: sources in `src', documentation in `doc'.
17009
170101999-04-13 Jesse Thilo <jthilo@gnu.org>
17011
17012 * src/allocate.c:
17013 Don't declare calloc() and realloc() if not necessary.
17014
170151999-04-13 Jesse Thilo <jthilo@gnu.org>
17016
17017 * configure.in, acconfig.h, acinclude.m4:
17018 Don't declare calloc() and realloc() if not necessary.
17019
170201999-03-23 Jesse Thilo <jthilo@gnu.org>
17021
17022 * po/.cvsignore: Added i18n support.
17023
170241999-03-23 Jesse Thilo <jthilo@gnu.org>
17025
17026 * acconfig.h, configure.in, Makefile.am:
17027 Added i18n support.
17028
170291999-03-22 Jesse Thilo <jthilo@gnu.org>
17030
17031 * src/bison.s1: Fixed #line numbers.
17032
170331999-03-15 Jesse Thilo <jthilo@gnu.org>
17034
17035 * po/es.po, po/fr.po, po/nl.po, po/de.po:
17036 Added PO files from Translation Project.
17037
170381999-03-03 Jesse Thilo <jthilo@gnu.org>
17039
17040 * Makefile.am:
17041 Added support for non-ANSI compilers (ansi2knr).
17042
170431999-02-16 Jesse Thilo <jthilo@gnu.org>
17044
17045 * configure.in: Bumped version number to 1.27.
17046
17047 * Makefile.am:
17048 Added `bison.simple' to list of files removed by `make distclean'.
17049
170501999-02-12 Jesse Thilo <jthilo@gnu.org>
17051
17052 * src/files.c, src/files.h:
17053 Defined locations of parser files in config.h instead of Makefile.
17054
170551999-02-12 Jesse Thilo <jthilo@gnu.org>
17056
17057 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
17058 Defined locations of parser files in config.h instead of Makefile.
17059
170601999-02-09 Jesse Thilo <jthilo@gnu.org>
17061
17062 * Makefile.am:
17063 Removed inappropriate use of $< macro.
17064
170651999-02-05 Jesse Thilo <jthilo@gnu.org>
17066
17067 * po/Makefile.in.in, po/POTFILES.in:
17068 Add `po' directory skeleton.
17069
170701999-01-27 Jesse Thilo <jthilo@gnu.org>
17071
17072 * README: Document help-bison list.
17073
17074 * configure.in: Add check for mkstemp().
17075
170761999-01-20 Jesse Thilo <jthilo@gnu.org>
17077
17078 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
17079 Hush a few compiler warnings.
17080
17081 * src/files.c:
17082 Add tryclose(), which verifies that fclose was successful.
17083 Hush a couple of compiler warnings.
17084
170851999-01-20 Jesse Thilo <jthilo@gnu.org>
17086
17087 * Makefile.am, OChangeLog:
17088 ChangeLog is now automatically generated. Include the old version as
17089 OChangeLog.
17090
170911999-01-14 Jesse Thilo <jthilo@gnu.org>
17092
17093 * 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:
17094 Update FSF address.
17095
170961999-01-14 Jesse Thilo <jthilo@gnu.org>
17097
17098 * doc/bison.texinfo: Fix formatting glitch.
17099
17100 * doc/bison.texinfo: Update FSF address.
17101
171021999-01-14 Jesse Thilo <jthilo@gnu.org>
17103
17104 * acconfig.h: Update FSF address.
17105
171061999-01-08 Jesse Thilo <jthilo@gnu.org>
17107
17108 * src/system.h:
17109 Don't define PACKAGE here, since config.h defines it.
17110
171111998-12-30 Jesse Thilo <jthilo@gnu.org>
17112
17113 * src/reader.c: Update copyright date.
17114
17115 * src/main.c:
17116 Ditch sprintf to statically-sized buffers in fatal/warn functions in
17117 favor of output directly to stderr (avoids buffer overruns).
17118
17119 * src/reader.c: Some checks for premature EOF.
17120
17121 * 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:
17122 Use prototypes if the compiler understands them.
17123
17124 * src/files.c: Honor TMPDIR on Unix hosts.
17125 Use prototypes if the compiler understands them.
17126
17127 * src/reader.c:
17128 Fix a couple of buffer overrun bugs.
17129 Use prototypes if the compiler understands them.
17130
17131 * src/system.h: Include unistd.h and ctype.h.
17132 Use #ifdef instead of #if for NLS symbols.
17133
171341998-12-30 Jesse Thilo <jthilo@gnu.org>
17135
17136 * doc/bison.texinfo:
17137 Delete comment "consider using @set for edition number, etc..." since
17138 we now are doing so.
17139
171401998-12-30 Jesse Thilo <jthilo@gnu.org>
17141
17142 * configure.in:
17143 Use prototypes if the compiler understands them.
17144
17145 * NEWS: Document 1.26 highlights.
17146
17147 * Makefile.am: Require Automake 1.3 or later.
17148
17149 * acconfig.h:
17150 Use prototypes if the compiler understands them.
17151
171521998-12-29 Jesse Thilo <jthilo@gnu.org>
17153
17154 * src/version.c:
17155 Use VERSION symbol from automake for version number.
17156
171571998-12-29 Jesse Thilo <jthilo@gnu.org>
17158
17159 * acconfig.h, configure.in, version.cin:
17160 Use VERSION symbol from automake for version number.
17161
171621998-11-28 Jesse Thilo <jthilo@gnu.org>
17163
17164 * Makefile.am:
17165 Distribute original version of simple parser (bison.s1), not built
17166 version (bison.simple).
17167
171681998-11-28 Jesse Thilo <jthilo@gnu.org>
17169
17170 * doc/bison.texinfo: Add info dir entry.
17171
17172 * doc/bison.texinfo:
17173 Let automake put version number into documentation.
17174
171751998-11-26 Jesse Thilo <jthilo@gnu.org>
17176
17177 * src/bison.cld, src/build.com, src/vmshlp.mar:
17178 Add non-RCS files from /gd/gnu/bison.
17179
171801998-11-26 Jesse Thilo <jthilo@gnu.org>
17181
17182 * doc/bison.1:
17183 Document the BISON_HAIRY and BISON_SIMPLE variables.
17184
171851998-11-25 Jesse Thilo <jthilo@gnu.org>
17186
17187 * src/version.c: Build version.c automatically.
17188
17189 * src/reader.c:
17190 Fix token numbering (used to start at 258, not 257).
17191
17192 * src/system.h: Include config.h.
17193
17194 * src/getargs.c: Update bug report address.
17195
17196 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
17197 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
17198
171991998-11-25 Jesse Thilo <jthilo@gnu.org>
17200
17201 * Makefile.am:
17202 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17203
17204 * configure.in, version.cin:
17205 Build version.c automatically.
17206
17207 * AUTHORS: Add AUTHORS file.
17208
17209 * README: Update bug report address.
17210
17211 * bison.simple:
17212 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
17213
17214 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
17215 Add automake stuff.
17216
172171998-11-25 Jesse Thilo <jthilo@gnu.org>
17218
17219 * doc/bison.texinfo: Clean up some formatting.
17220
172211998-05-05 Richard Stallman <rms@gnu.org>
17222
17223 * doc/bison.texinfo:
17224 Explain better why to make a pure parser.
17225
172261998-01-05 Richard Stallman <rms@gnu.org>
17227
17228 * src/files.c (openfiles):
17229 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
17230 find a temporary directory, if possible. Do not unlink files while
17231 they are open.
17232
172331997-08-25 Richard Stallman <rms@gnu.org>
17234
17235 * src/reader.c (stack_offset;):
17236 Change some warni to warns.
17237
17238 * src/lex.c (literalchar): Use warns, not warni.
17239
172401997-06-28 Richard Stallman <rms@gnu.org>
17241
17242 * src/bison.s1: Add a Bison version comment.
17243
17244 * src/main.c (fatal, warn, berror):
17245 Use program_name.
17246
172471997-06-28 Richard Stallman <rms@gnu.org>
17248
17249 * Makefile.in (bison_version): New variable.
17250 (dist): Use that variable.
17251 (bison.s1): Substitute the Bison version into bison.simple.
17252
17253 * bison.simple: Add a Bison version comment.
17254
172551997-06-18 Richard Stallman <rms@gnu.org>
17256
17257 * src/main.c (fatal, warn, berror):
17258 Make error messages standard.
17259 (toomany): Improve error message text.
17260
17261 * 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:
17262 new.h renamed to alloc.h.
17263
172641997-06-18 Richard Stallman <rms@gnu.org>
17265
17266 * Makefile.in: new.h renamed to alloc.h.
17267
172681997-05-24 Richard Stallman <rms@gnu.org>
17269
17270 * src/lex.c (literalchar):
17271 Fix the code for escaping \, " and '.
17272
17273 (lex): Avoid trouble when there are many chars
17274 to discard in a char literal with just several chars in it.
17275
172761997-05-17 Richard Stallman <rms@gnu.org>
17277
17278 * src/bison.s1:
17279 Use malloc, if using alloca is troublesome.
17280 (YYSTACK_USE_ALLOCA): New flag macro.
17281 Define it for some systems and compilers.
17282 (YYSTACK_ALLOC): New macro.
17283 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17284 If it was malloc'd, free it.
17285
172861997-05-17 Richard Stallman <rms@gnu.org>
17287
17288 * bison.simple:
17289 Use malloc, if using alloca is troublesome.
17290 (YYSTACK_USE_ALLOCA): New flag macro.
17291 Define it for some systems and compilers.
17292 (YYSTACK_ALLOC): New macro.
17293 (yyparse): Use YYSTACK_ALLOC to allocate stack.
17294 If it was malloc'd, free it.
17295
172961997-04-23 Richard Stallman <rms@gnu.org>
17297
17298 * src/bison.s1:
17299 (alloca) [__hpux]: Always define as __builtin_alloca.
17300
173011997-04-23 Richard Stallman <rms@gnu.org>
17302
17303 * bison.simple:
17304 (alloca) [__hpux]: Always define as __builtin_alloca.
17305
173061997-04-22 Richard Stallman <rms@gnu.org>
17307
17308 * src/bison.s1:
17309 [__hpux]: Include alloca.h (right for HPUX 10)
17310 instead of declaring alloca (right for HPUX 9).
17311
17312 * src/bison.s1 (__yy_memcpy):
17313 Declare arg `count' as unsigned int.
17314 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17315
173161997-04-22 Richard Stallman <rms@gnu.org>
17317
17318 * bison.simple:
17319 [__hpux]: Include alloca.h (right for HPUX 10)
17320 instead of declaring alloca (right for HPUX 9).
17321
17322 * bison.simple (__yy_memcpy):
17323 Declare arg `count' as unsigned int.
17324 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
17325
173261997-01-03 Richard Stallman <rms@gnu.org>
17327
17328 * src/allocate.c: [__STDC__ or _MSC_VER]:
17329 Declare calloc and realloc to return void *.
17330
173311997-01-02 Richard Stallman <rms@gnu.org>
17332
17333 * src/system.h:
17334 [_MSC_VER]: Include stdlib.h and process.h.
17335 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
17336
17337 * src/main.c (main): Return FAILURE as a value.
17338 (printable_version): Declare arg as int, not char.
17339
173401997-01-02 Richard Stallman <rms@gnu.org>
17341
17342 * Makefile.in (dist):
17343 Explicitly check for symlinks, and copy them.
17344
173451996-12-19 Richard Stallman <rms@gnu.org>
17346
17347 * src/files.c:
17348 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
17349
173501996-12-18 Paul Eggert <eggert@gnu.org>
17351
17352 * src/bison.s1 (yyparse):
17353 If __GNUC__ and YYPARSE_PARAM are both defined,
17354 declare yyparse to have a void * argument.
17355
173561996-12-18 Paul Eggert <eggert@gnu.org>
17357
17358 * bison.simple (yyparse):
17359 If __GNUC__ and YYPARSE_PARAM are both defined,
17360 declare yyparse to have a void * argument.
17361
173621996-12-17 Richard Stallman <rms@gnu.org>
17363
17364 * src/reduce.c (nbits): Add some casts.
17365
173661996-08-12 Richard Stallman <rms@gnu.org>
17367
17368 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
17369
173701996-08-12 Richard Stallman <rms@gnu.org>
17371
17372 * bison.simple: Test _MSDOS as well as _MSDOS_.
17373
173741996-07-31 Richard Stallman <rms@gnu.org>
17375
17376 * src/bison.s1:
17377 [__sun && __i386]: Include alloca.h.
17378
173791996-07-31 Richard Stallman <rms@gnu.org>
17380
17381 * bison.simple:
17382 [__sun && __i386]: Include alloca.h.
17383
173841996-07-30 Richard Stallman <rms@gnu.org>
17385
17386 * src/bison.s1: Comment change.
17387
17388 * src/bison.s1: Test _MSDOS_, not MSDOS.
17389
173901996-07-30 Richard Stallman <rms@gnu.org>
17391
17392 * bison.simple: Comment change.
17393
17394 * bison.simple: Test _MSDOS_, not MSDOS.
17395
173961996-06-01 Richard Stallman <rms@gnu.org>
17397
17398 * 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:
17399 Insert `_' macro around many string constants.
17400
17401 * src/main.c:
17402 Insert `_' macro around many string constants.
17403
17404 (main): Call setlocale, bindtextdomain and textdomain.
17405
17406 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
17407 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
17408 [ENABLE_NLS]: Include libintl.h.
17409 [ENABLE_NLS] (gettext): Define.
17410 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
17411 (N_, PACKAGE, LOCALEDIR): New macros.
17412
174131996-06-01 Richard Stallman <rms@gnu.org>
17414
17415 * POTFILES.in: New file.
17416
17417 * Makefile.in (allocate.o):
17418 Define target explicitly.
17419
17420 * Makefile.in (CFLAGS): Set to @CFLAGS@.
17421 (LDFLAGS): Set to @LDFLAGS@.
17422 (configure): Run autoconf only if preceding `cd' succeeds.
17423 (bison.s1): Redirect output to temporary file then move the
17424 temporary to the target, rather than redirecting directly to bison.s1.
17425 (clean): Remove config.status and config.log.
17426 (distclean): Don't remove config.status here.
17427
174281996-05-12 Richard Stallman <rms@gnu.org>
17429
17430 * src/bison.s1:
17431 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17432
174331996-05-12 Richard Stallman <rms@gnu.org>
17434
17435 * bison.simple:
17436 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
17437
174381996-05-11 Richard Stallman <rms@gnu.org>
17439
17440 * src/bison.s1 (__yy_memcpy):
17441 Really reorder the args, as was supposedly done on Feb 14 1995.
17442 (yyparse): Calls changed accordingly.
17443
174441996-05-11 Richard Stallman <rms@gnu.org>
17445
17446 * Makefile.in (dist): Don't use $(srcdir).
17447
17448 * bison.simple (__yy_memcpy):
17449 Really reorder the args, as was supposedly done on Feb 14 1995.
17450 (yyparse): Calls changed accordingly.
17451
174521996-01-27 Richard Stallman <rms@gnu.org>
17453
17454 * src/output.c (output_rule_data):
17455 Test YYERROR_VERBOSE in the conditional
17456 around the definition of ttyname.
17457
174581995-12-29 Richard Stallman <rms@gnu.org>
17459
17460 * src/bison.s1:
17461 Fix line numbers in #line commands.
17462
174631995-12-29 Richard Stallman <rms@gnu.org>
17464
17465 * bison.simple:
17466 Fix line numbers in #line commands.
17467
174681995-12-27 Richard Stallman <rms@gnu.org>
17469
17470 * src/bison.s1 (YYPARSE_PARAM_DECL):
17471 In C++, make it always null.
17472 (YYPARSE_PARAM_ARG): New macro.
17473 (yyparse): Use YYPARSE_PARAM_ARG.
17474
174751995-12-27 Richard Stallman <rms@gnu.org>
17476
17477 * bison.simple (YYPARSE_PARAM_DECL):
17478 In C++, make it always null.
17479 (YYPARSE_PARAM_ARG): New macro.
17480 (yyparse): Use YYPARSE_PARAM_ARG.
17481
174821995-11-29 Richard Stallman <rms@gnu.org>
17483
17484 * doc/bison.texinfo:
17485 Describe literal string tokens, %raw, %no_lines, %token_table.
17486
174871995-11-29 Daniel Hagerty <hag@gnu.org>
17488
17489 * doc/bison.texinfo: Fixed update date
17490
174911995-10-16 Richard Stallman <rms@gnu.org>
17492
17493 * src/version.c: Version 1.25.
17494
174951995-10-16 Richard Stallman <rms@gnu.org>
17496
17497 * NEWS: *** empty log message ***
17498
174991995-10-16 Richard Stallman <rms@gnu.org>
17500
17501 * doc/bison.1, doc/bison.rnh:
17502 Add new options.
17503
175041995-10-15 Richard Stallman <rms@gnu.org>
17505
17506 * src/vmsgetargs.c, src/getargs.c:
17507 Added -n, -k, and -raw switches.
17508 (noparserflag, toknumflag, rawtoknumflag): New variables.
17509
17510 * src/symtab.h (SALIAS):
17511 New #define for adding aliases to %token.
17512 (struct bucket): Added `alias' field.
17513
17514 * src/reduce.c (reduce_grammar):
17515 Revise error message.
17516 (print_notices): Remove final `.' from error message.
17517
17518 * src/reader.c (reader_output_yylsp):
17519 New function.
17520 (readgram): Use `#if 0' around code that accepted %command
17521 inside grammar rules: The documentation doesn't allow it,
17522 and it will fail since the %command processors scan for the next %.
17523 (parse_token_decl): Extended the %token
17524 declaration to allow a multi-character symbol as an alias.
17525 (parse_thong_decl): New function.
17526 (read_declarations): Added %thong declarations.
17527 (read_declarations): Handle NOOP to deal with allowing
17528 % declarations as another means to specify the flags.
17529 (readgram): Allow %prec prior to semantics embedded in a rule.
17530 (skip_to_char, read_declarations, copy_definition)
17531 (parse_token_decl, parse_start_decl, parse_type_decl)
17532 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
17533 (get_type_name, copy_guard, copy_action, readgram)
17534 (get_type, packsymbols): Revised most error messages.
17535 Changed `fatal' to `warnxxx' to avoid aborting for error.
17536 Revised and use multiple warnxxx functions to avoid using VARARGS1.
17537 (read_declarations): Improve the error message for
17538 an invalid character. Do not abort.
17539 (read_declarations, copy_guard, copy_action): Use
17540 printable_version to avoid unprintable characters in printed output.
17541 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
17542 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
17543 Allow the type of a non-terminal can be given
17544 more than once, as long as all specifications give the same type.
17545
17546 * src/output.c:
17547 (output_headers, output_trailers, output, output_gram)
17548 (output_rule_data): Implement noparserflag variable.
17549 Implement toknumflag variable.
17550 (output): Call reader_output_yylsp to output LTYPESTR.
17551
17552 * src/main.c (main):
17553 If reader sees an error, don't process the grammar.
17554 (fatals): Updated to not use VARARGS1.
17555 (printable_version, int_to_string, warn, warni, warns, warnss)
17556 (warnsss): New error reporting functions. Avoid abort for error.
17557
17558 * src/lex.h:
17559 Added THONG and NOOP for alias processing.
17560 Added SETOPT for the new code that allows setting options with %flags.
17561
17562 * src/lex.c:
17563 Include getopt.h. Add some extern decls.
17564 (safegetc): New function to deal with EOF gracefully.
17565 (literalchar); new function to deal with reading \ escapes.
17566 (lex): Use literalchar.
17567 (lex): Implemented "..." tokens.
17568 (literalchar, lex, parse_percent_token): Made tokenbuffer
17569 always contain the token. This includes growing the token
17570 buffer while reading an integer.
17571 (parse_percent_token): Replaced if-else statement with percent_table.
17572 (parse_percent_token): Added % declarations as another
17573 way to specify the flags -n, -l, and -r. Also added hooks for
17574 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
17575 major changes to files.c.
17576 (lex) Retain in the incoming stream a character following
17577 an incorrect '/'.
17578 (skip_white_space, lex): Revised most error messages
17579 and changed fatal to warn to avoid aborting.
17580 (percent_table): Added %thong declarations.
17581
17582 * src/gram.h: Comment changes.
17583
17584 * src/files.c (openfiles, open_extra_files, done):
17585 Add faction flag
17586 and actfile file. Handle noparserflag. Both for -n switch.
17587
17588 * src/conflicts.c (resolve_sr_conflict):
17589 Remove use of alloca.
17590
175911995-06-01 Jim Meyering <meyering@gnu.org>
17592
17593 * doc/bison.texinfo: *** empty log message ***
17594
175951995-05-06 Richard Stallman <rms@gnu.org>
17596
17597 * src/bison.s1: Comment change.
17598
175991995-05-06 Richard Stallman <rms@gnu.org>
17600
17601 * bison.simple: Comment change.
17602
176031995-05-03 Richard Stallman <rms@gnu.org>
17604
17605 * src/version.c: Version now 1.24.
17606
17607 * src/bison.s1: Change distribution terms.
17608
17609 * src/version.c: Version now 1.23.
17610
176111995-05-03 Richard Stallman <rms@gnu.org>
17612
17613 * doc/bison.texinfo:
17614 Rewrite "Conditions for Using Bison".
17615 Update version to 1.24.
17616
176171995-05-03 Richard Stallman <rms@gnu.org>
17618
17619 * bison.simple: Change distribution terms.
17620
176211995-02-23 Richard Stallman <rms@gnu.org>
17622
17623 * src/files.c: Test __VMS_POSIX as well as VMS.
17624
176251995-02-14 Jim Meyering <meyering@gnu.org>
17626
17627 * src/bison.s1 (__yy_memcpy):
17628 Renamed from __yy_bcopy to avoid
17629 confusion. Reverse FROM and TO arguments to be consistent with
17630 those of memcpy.
17631
176321995-02-14 Jim Meyering <meyering@gnu.org>
17633
17634 * bison.simple (__yy_memcpy):
17635 Renamed from __yy_bcopy to avoid
17636 confusion. Reverse FROM and TO arguments to be consistent with
17637 those of memcpy.
17638
176391994-11-10 David J. MacKenzie <djm@gnu.org>
17640
17641 * NEWS: reformat
17642
17643 * NEWS: New file.
17644
17645 * Makefile.in (DISTFILES): Include NEWS.
17646
17647 * Makefile.in (DISTFILES):
17648 Include install-sh, not install.sh.
17649
17650 * configure.in: Update to Autoconf v2 macro names.
17651
176521994-10-05 David J. MacKenzie <djm@gnu.org>
17653
17654 * Makefile.in: fix typo
17655
17656 * Makefile.in (prefix, exec_prefix):
17657 Let configure set them.
17658
176591994-09-28 David J. MacKenzie <djm@gnu.org>
17660
17661 * Makefile.in: Set datadir to $(prefix)/share.
17662
176631994-09-15 Richard Stallman <rms@gnu.org>
17664
17665 * src/bison.s1:
17666 Update copyright notice and GPL version.
17667
176681994-09-15 Richard Stallman <rms@gnu.org>
17669
17670 * bison.simple:
17671 Update copyright notice and GPL version.
17672
176731994-07-12 Richard Stallman <rms@gnu.org>
17674
17675 * src/reduce.c, src/reader.c:
17676 entered into RCS
17677
176781994-05-05 David J. MacKenzie <djm@gnu.org>
17679
17680 * Makefile.in: entered into RCS
17681
176821994-03-26 Richard Stallman <rms@gnu.org>
17683
17684 * src/bison.s1: entered into RCS
17685
176861994-03-26 Richard Stallman <rms@gnu.org>
17687
17688 * bison.simple: entered into RCS
17689
176901994-03-25 Richard Stallman <rms@gnu.org>
17691
17692 * src/main.c: entered into RCS
17693
176941994-03-24 Richard Stallman <rms@gnu.org>
17695
17696 * src/conflicts.c: entered into RCS
17697
176981994-01-02 Richard Stallman <rms@gnu.org>
17699
17700 * Makefile.in: *** empty log message ***
17701
177021993-11-21 Richard Stallman <rms@gnu.org>
17703
17704 * src/bison.s1: *** empty log message ***
17705
177061993-11-21 Richard Stallman <rms@gnu.org>
17707
17708 * doc/bison.texinfo: entered into RCS
17709
17710 * doc/bison.texinfo: *** empty log message ***
17711
177121993-11-21 Richard Stallman <rms@gnu.org>
17713
17714 * bison.simple: *** empty log message ***
17715
177161993-10-25 David J. MacKenzie <djm@gnu.org>
17717
17718 * doc/bison.texinfo: *** empty log message ***
17719
177201993-10-19 Richard Stallman <rms@gnu.org>
17721
17722 * src/bison.s1: *** empty log message ***
17723
177241993-10-19 Richard Stallman <rms@gnu.org>
17725
17726 * bison.simple: *** empty log message ***
17727
177281993-10-14 Richard Stallman <rms@gnu.org>
17729
17730 * src/bison.s1: *** empty log message ***
17731
177321993-10-14 Richard Stallman <rms@gnu.org>
17733
17734 * bison.simple: *** empty log message ***
17735
177361993-09-14 David J. MacKenzie <djm@gnu.org>
17737
17738 * doc/bison.texinfo: *** empty log message ***
17739
177401993-09-13 Noah Friedman <friedman@gnu.org>
17741
17742 * Makefile.in: *** empty log message ***
17743
177441993-09-10 Richard Stallman <rms@gnu.org>
17745
17746 * src/conflicts.c: *** empty log message ***
17747
17748 * src/system.h: entered into RCS
17749
177501993-09-10 Richard Stallman <rms@gnu.org>
17751
17752 * doc/bison.1: entered into RCS
17753
177541993-09-06 Noah Friedman <friedman@gnu.org>
17755
17756 * src/version.c: entered into RCS
17757
177581993-09-06 Noah Friedman <friedman@gnu.org>
17759
17760 * Makefile.in: *** empty log message ***
17761
177621993-07-30 David J. MacKenzie <djm@gnu.org>
17763
17764 * Makefile.in: *** empty log message ***
17765
177661993-07-24 Richard Stallman <rms@gnu.org>
17767
17768 * src/bison.s1: *** empty log message ***
17769
177701993-07-24 Richard Stallman <rms@gnu.org>
17771
17772 * bison.simple: *** empty log message ***
17773
177741993-07-08 David J. MacKenzie <djm@gnu.org>
17775
17776 * Makefile.in: *** empty log message ***
17777
177781993-07-04 Richard Stallman <rms@gnu.org>
17779
17780 * src/bison.s1: *** empty log message ***
17781
177821993-07-04 Richard Stallman <rms@gnu.org>
17783
17784 * bison.simple: *** empty log message ***
17785
177861993-06-26 David J. MacKenzie <djm@gnu.org>
17787
17788 * src/getargs.c: entered into RCS
17789
177901993-06-26 David J. MacKenzie <djm@gnu.org>
17791
17792 * doc/bison.texinfo: *** empty log message ***
17793
17794 * doc/bison.1: New file.
17795
177961993-06-25 Richard Stallman <rms@gnu.org>
17797
17798 * src/getargs.c: New file.
17799
178001993-06-16 Richard Stallman <rms@gnu.org>
17801
17802 * src/bison.s1: *** empty log message ***
17803
178041993-06-16 Richard Stallman <rms@gnu.org>
17805
17806 * bison.simple: *** empty log message ***
17807
178081993-06-03 Richard Stallman <rms@gnu.org>
17809
17810 * src/bison.s1: New file.
17811
178121993-06-03 Richard Stallman <rms@gnu.org>
17813
17814 * doc/bison.texinfo: *** empty log message ***
17815
178161993-06-03 Richard Stallman <rms@gnu.org>
17817
17818 * bison.simple: New file.
17819
178201993-05-19 Richard Stallman <rms@gnu.org>
17821
17822 * doc/bison.texinfo: New file.
17823
178241993-05-07 Noah Friedman <friedman@gnu.org>
17825
17826 * Makefile.in: *** empty log message ***
17827
178281993-04-28 Noah Friedman <friedman@gnu.org>
17829
17830 * src/reader.c: *** empty log message ***
17831
178321993-04-23 Noah Friedman <friedman@gnu.org>
17833
17834 * src/alloc.h: entered into RCS
17835
178361993-04-20 David J. MacKenzie <djm@gnu.org>
17837
17838 * src/version.c: *** empty log message ***
17839
17840 * src/files.c, src/allocate.c:
17841 entered into RCS
17842
17843 * src/reader.c: *** empty log message ***
17844
17845 * src/lex.c: entered into RCS
17846
17847 * src/conflicts.c: New file.
17848
17849 * src/symtab.c: entered into RCS
17850
17851 * src/alloc.h: New file.
17852
17853 * src/LR0.c: entered into RCS
17854
178551993-04-18 Noah Friedman <friedman@gnu.org>
17856
17857 * src/reader.c: New file.
17858
17859 * src/version.c: *** empty log message ***
17860
178611993-04-18 Noah Friedman <friedman@gnu.org>
17862
17863 * Makefile.in: *** empty log message ***
17864
178651993-04-17 Noah Friedman <friedman@gnu.org>
17866
17867 * Makefile.in: *** empty log message ***
17868
178691993-04-15 Richard Stallman <rms@gnu.org>
17870
17871 * src/main.c, src/files.c:
17872 New file.
17873
178741993-04-15 Noah Friedman <friedman@gnu.org>
17875
17876 * configure.in: entered into RCS
17877
17878 * configure.in: *** empty log message ***
17879
17880 * configure.in: New file.
17881
178821993-04-14 Richard Stallman <rms@gnu.org>
17883
17884 * Makefile.in: New file.
17885
178861993-04-13 Richard Stallman <rms@gnu.org>
17887
17888 * src/version.c: New file.
17889
178901993-03-25 Richard Stallman <rms@gnu.org>
17891
17892 * src/output.c: entered into RCS
17893
178941992-09-25 Richard Stallman <rms@gnu.org>
17895
17896 * configure.bat: entered into RCS
17897
178981992-06-22 Richard Stallman <rms@gnu.org>
17899
17900 * src/vmsgetargs.c: entered into RCS
17901
179021992-06-22 Richard Stallman <rms@gnu.org>
17903
17904 * doc/bison.rnh: entered into RCS
17905
179061992-04-20 David J. MacKenzie <djm@gnu.org>
17907
17908 * README: entered into RCS
17909
179101992-01-22 Richard Stallman <rms@gnu.org>
17911
17912 * src/machine.h: entered into RCS
17913
179141991-12-21 Richard Stallman <rms@gnu.org>
17915
17916 * src/lalr.c, src/closure.c:
17917 entered into RCS
17918
179191991-12-20 Richard Stallman <rms@gnu.org>
17920
17921 * src/state.h: entered into RCS
17922
179231991-12-18 Richard Stallman <rms@gnu.org>
17924
17925 * src/print.c, src/nullable.c, src/derives.c:
17926 entered into RCS
17927
179281991-11-03 David J. MacKenzie <djm@gnu.org>
17929
17930 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
17931 entered into RCS
17932
179331988-09-09 Richard Stallman <rms@gnu.org>
17934
17935 * src/bison.hairy: entered into RCS
17936
179371987-12-16 Richard Stallman <rms@gnu.org>
17938
17939 * REFERENCES: entered into RCS
dc546b0f 17940
f294a2c2 17941
04098407 17942 -----
f294a2c2 17943
04098407 17944 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
e2a21b6f
PE
17945 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
17946 Software Foundation, Inc.
f294a2c2 17947
04098407
PE
17948 Copying and distribution of this file, with or without
17949 modification, are permitted provided the copyright notice and this
17950 notice are preserved.
e9071366
AD
17951
17952$Id$