]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
Mention yyparse, too.
[bison.git] / ChangeLog
... / ...
CommitLineData
12005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
2
3 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
4 all stacks.
5 (yyparse): Iterate another stack in order to call user destructors.
6 * tests/glr-regression.at (No users destructors if stack 0 deleted):
7 New test case.
8 (Duplicated user destructor for lookahead): This test now is expected
9 to succeed.
10
112005-12-01 Paul Eggert <eggert@cs.ucla.edu>
12
13 * NEWS: Document the following change.
14 * data/yacc.c: Say "parser skeleton" rather than "file", since
15 it's no longer just a file.
16 * data/glr.c: Grant a special exception for C GLR parsers, that
17 reads like the already-existing exception for C LALR(1) parsers.
18 * data/glr.cc: Likewise.
19 * data/lalr1.cc: Likewise.
20 * data/location.cc: Likewise.
21 * data/yacc.c: Reword the "written by" statement to clarify that
22 it was the parser skeleton, not the entire output file.
23 * data/glr.c: Written by Paul Hilfinger.
24 * data/glr.cc: Written by Akim Demaille.
25 * data/lalr1.cc: Likewise.
26
272005-11-18 Paul Eggert <eggert@cs.ucla.edu>
28
29 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
30 Fix typos in previous change that broke 'make check'.
31 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
32 supported in C.
33 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
34 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
35 We can revert this once things settle down.
36
37 * src/conflicts.c (conflicts_print): Don't print file name twice
38 when %expect fails because there were no conflicts.
39 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
40 change.
41 * tests/conflicts.at (%expect not enough, %expect too much):
42 (%expect with reduce conflicts): Adjust to new behavior.
43
442005-11-18 Akim Demaille <akim@epita.fr>
45
46 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
47 errors.
48 * NEWS: Document this.
49 * doc/bison.texinfo (Expect Decl): Likewise.
50
512005-11-16 Akim Demaille <akim@epita.fr>
52
53 Generalize the display of semantic values and locations in traces.
54 * data/glr.c (yy_reduce_print): Fix indices (again).
55 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
56 literal integers.
57 * data/lalr1.cc (yyreduce_print): Rename as...
58 (yy_reduce_print): this.
59 Display values and locations.
60 * data/yacc.c (yy_reduce_print): Likewise.
61 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
62 (yysymprint): Move higher to be visible from yy_reduce_print).
63 (yyparse): Adjust.
64 * tests/calc.at: Adjust the expected length of the traces.
65
662005-11-14 Akim Demaille <akim@epita.fr>
67
68 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
69 from 1 to N, while values and location start at 0.
70 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
71
722005-11-14 Akim Demaille <akim@epita.fr>
73
74 * data/glr.c (yy_reduce_print): Fix the $ number.
75
762005-11-14 Akim Demaille <akim@epita.fr>
77
78 "Use" parse parameters.
79 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
80 * data/glr.c, data/glr.cc: Use them.
81 * data/glr.c (YYUSE): Have a C++ definition that supports
82 non-pointer types.
83
842005-11-14 Akim Demaille <akim@epita.fr>
85
86 * data/glr.c (yyexpandGLRStack): Declare only if defined.
87
882005-11-14 Akim Demaille <akim@epita.fr>
89
90 * data/glr.cc: New.
91 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
92
932005-11-12 Akim Demaille <akim@epita.fr>
94
95 Let position and location be PODs.
96 * data/location.cc (position::initialize, location::initialize): New.
97 (position::position, location::location): Define only if
98 b4_location_constructors is defined.
99 * data/lalr1.cc (b4_location_constructors): Define it for backward
100 compatibility.
101 * doc/bison.texinfo (Initial Action Decl): Use initialize.
102
1032005-11-12 Akim Demaille <akim@epita.fr>
104
105 * data/lalr1.cc: Move the body of the ctor and dtor into the
106 parser file (instead of the header).
107 Wrap the implementations in a "namespace yy".
108
1092005-11-12 Akim Demaille <akim@epita.fr>
110
111 Have glr.c include its header file when created.
112 * data/glr.c (b4_shared_declarations): New.
113 Output them verbatim in the parser if !%defines, otherwise
114 output then in the header file, and include it instead.
115
1162005-11-11 Akim Demaille <akim@epita.fr>
117
118 * data/glr.c: Comment changes.
119
1202005-11-11 Akim Demaille <akim@epita.fr>
121
122 When yydebug, report semantic and location values for reductions.
123 * data/glr.c (yy_reduce_print): Report the semantic values and the
124 locations.
125 (YY_REDUCE_PRINT): Adjust.
126 (yyglrReduce): Use them.
127 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
128 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
129 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
130 traces.
131
1322005-11-10 Akim Demaille <akim@epita.fr>
133
134 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
135 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
136 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
137
1382005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
139
140 * m4/cxx.m4, examples/Makefile.am: Don't build
141 examples/calc++ if no C++ compiler is available. (trivial change)
142
1432005-11-09 Akim Demaille <akim@epita.fr>
144
145 * src/scan-skel.l: Use a couple of asserts.
146
1472005-11-03 Akim Demaille <akim@epita.fr>
148
149 In some (weird) cases, the final state number is incorrect.
150 Reported by Alexandre Duret-Lutz.
151 * src/LR0.c (state_list_append): Remove the computation of
152 final_state.
153 (save_reductions): Do it here.
154 (get_state): Alpha conversion.
155 (generate_states): Use a for loop.
156 * src/gram.h (item_number_is_rule_number)
157 (item_number_is_symbol_number): New.
158 * src/state.c: Use assert.
159 * src/system.h: Include assert.h.
160 * tests/sets.at (Accept): New.
161
1622005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
163
164 * data/glr.c (yyfill): Adjust comment.
165 (yyresolveAction): Initialize default location properly
166 for empty right-hand sides.
167 (yydoAction): Ditto.
168 Add comment explaining apparently dead code.
169 * tests/glr-regression.at
170 (Incorrectly initialized location for empty right-hand side in GLR):
171 New test.
172
1732005-10-30 Paul Eggert <eggert@cs.ucla.edu>
174
175 * bootstrap (cleanup_gnulib): New function. Use it to clean up
176 gnulib when interrupted. This fixes some race conditions and
177 works around some portability problems (one noted by Paul
178 Hilfinger).
179
1802005-10-22 Akim <akim@epita.fr>
181
182 * Makefile.cfg: Adjust to config -> build-aux.
183 Reported by twledo.
184
1852005-10-21 Akim Demaille <akim@epita.fr>
186
187 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
188 the %parse-params.
189 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
190 * data/yacc.c (b4_Pure_if): Rename as...
191 (b4_yacc_pure_if): this.
192 (YY_SYMBOL_PRINT, yyparse): Adjust.
193 * doc/bison.texinfo: Formatting changes.
194
1952005-10-21 Akim Demaille <akim@epita.fr>
196
197 Finish the transition config -> build-aux.
198 * configure.ac, Makefile.am: Use build-aux.
199 * config/prev-version, config/announce-gen, config/Makefile.am:
200 Move to...
201 * build-aux/prev-version, build-aux/announce-gen,
202 * build-aux/Makefile.am: here.
203
2042005-10-14 Akim Demaille <akim@epita.fr>
205
206 * examples/calc++/test: Use set -x only when VERBOSE.
207
2082005-10-13 Paul Eggert <eggert@cs.ucla.edu>
209
210 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
211 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
212
2132005-10-13 Akim Demaille <akim@epita.fr>
214
215 * src/scan-skel.l: Output the base name parts of the parser and
216 header file names.
217 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
218 additional checks.
219 Use this to exercise C++ outputs in subdirs.
220 Reported by Oleg Smolsky.
221
2222005-10-12 Paul Eggert <eggert@cs.ucla.edu>
223
224 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
225 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
226 Problem reported by John P. Hartmann.
227 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
228 already defined it.
229
2302005-10-12 Akim Demaille <akim@epita.fr>
231
232 * src/parse-gram.y (version_check): Exit 63 to please missing
233 (stands for "version mismatch).
234 * tests/input.at, doc/bison.texinfo: Adjust.
235
2362005-10-10 Paul Eggert <eggert@cs.ucla.edu>
237
238 Work around portability problems with Visual Age C compiler
239 (xlc and xlC_r) reported by John P. Hartmann.
240 * data/location.cc (initial_column, initial_line): Remove.
241 All uses replaced by 0 and 1.
242 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
243 that xlc complains about.
244 * src/scan-skel.l (skel_wrap): Likewise.
245 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
246 as __STDC__.
247 * data/yacc.c (YYMODERN_C): New macro, which also looks at
248 __STDC_VERSION__. Use it everywhere instead of looking at
249 __STDC__ and __cplusplus.
250
2512005-10-10 Akim Demaille <akim@epita.fr>
252
253 * examples/calc++/test: Be quiet unless VERBOSE.
254
2552005-10-05 Paul Eggert <eggert@cs.ucla.edu>
256
257 * data/c.m4 (yydestruct, yysymprint):
258 Use YYUSE instead of casting to void.
259 * data/glr.c (YYUSE): New macro.
260 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
261 Use it instead of rolling our own.
262 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
263 (YYCHK1):
264 Use /*CONSTCOND*/ to suppress lint warnings.
265 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
266 (YY_STACK_PRINT): Use 'false' not '0'.
267 (YYUSE): New macro.
268 (yysymprint_, yydestruct_): Use it instead of rolling our own.
269 * data/yacc.c (YYUSE): New macro.
270 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
271 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
272 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
273
274
275 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
276 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
277
2782005-10-04 Paul Eggert <eggert@cs.ucla.edu>
279
280 Undo the parts of the unlocked-I/O change that substituted
281 putc or puts for printf. This might hurt performance a bit,
282 but some people prefer the printf style.
283 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
284 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
285 All uses replaced by YYFPRINTF and YYDPRINTF.
286 * data/yacc.c: Likewise.
287 * lib/bitset.c (bitset_print): Likewise.
288 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
289 putc and puts.
290 * lib/lbitset.c (debug_lbitset): Likewise.
291 * src/closure.c (print_firsts, print_fderives): Likewise.
292 * src/gram.c (grammar_dump): Likewise.
293 * src/lalr.c (look_ahead_tokens_print): Likewise.
294 * src/output.c (escaped_output): Likewise.
295 (user_actions_output): Break apart two printfs.
296 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
297 * src/reduce.c (reduce_print): Likewise.
298 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
299 * src/system.h: Include unlocked-io.h rathe than stdio.h.
300
301 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
302 Use assignments rather than casts-to-void to suppress
303 unused-variable warnings. This pacifies 'lint'.
304 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
305 unused-variable warnings.
306
3072005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
308
309 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
310
3112005-10-02 Paul Eggert <eggert@cs.ucla.edu>
312
313 Use unlocked I/O for a minor performance improvement on hosts like
314 GNU/Linux and Solaris that support unlocked I/O. The basic idea
315 is to use the gnlib unlocked-io module, and to prefer putc and
316 puts to printf when either will work (since the latter doesn't
317 come in an unlocked flavor).
318 * bootstrap (gnulib_modules): Add unlocked-io.
319 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
320 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
321 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
322 and similarly for puts and putc and printf.
323 * data/yacc.c: Likewise.
324 * lib/bitset.c (bitset_print): Likewise.
325 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
326 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
327 to printf.
328 * lib/lbitset.c (debug_lbitset): Likewise.
329 * src/closure.c (print_firsts, print_fderives): Likewise.
330 * src/gram.c (grammar_dump): Likewise.
331 * src/lalr.c (look_ahead_tokens_print): Likewise.
332 * src/output.c (escaped_output): Likewise.
333 (user_actions_output): Coalesce two printfs.
334 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
335 * src/reduce.c (reduce_print): Likewise.
336 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
337 * src/system.h: Include unlocked-io.h rather than stdio.h.
338
339 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
340 this confuses xgettext.
341
3422005-10-02 Akim Demaille <akim@epita.fr>
343
344 * bootstrap (gnulib_modules): Add strverscmp.
345 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
346 * m4/.cvsignore: Add strverscmp.m4.
347 * src/parse-gram.y (%require): New token, new rule.
348 (version_check): New.
349 * src/scan-gram.l (%require): Adjust.
350 * tests/input.at (AT_REQUIRE): New.
351 Use it.
352 * doc/bison.texinfo (Require Decl): New.
353 (Calc++ Parser): Use %require.
354
3552005-10-02 Akim Demaille <akim@epita.fr>
356
357 * data/location.cc: New.
358
3592005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
360 Akim Demaille <akim@epita.fr>
361
362 Make sure -odir/foo.cc creates dir/location.hh etc.
363 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
364 (spec_file_prefix, spec_verbose_file, spec_graph_file)
365 (spec_defines_file): Now const.
366 (dir_prefix): New.
367 (short_base_name): Remove.
368 * src/files.c: Adjust.
369 (dirname.h): Include.
370 (base_name): Don't prototype it.
371 (finput): Remove, duplicates gram_in.
372 (full_base_name, short_base_name): Replace by...
373 (all_but_ext, all_but_tab_ext): these.
374 (compute_base_names): Rename as...
375 (compute_file_name_parts): this.
376 Update to compute the new variables, including dir_prefix.
377 Adjust dependencies.
378 * src/output.c (prepare): Output them.
379 * src/reader.c: Adjust to use gram_in, not finput.
380 * src/scan-skel.l (@dir_prefix@): New.
381
3822005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
383
384 * lib/subpipe.c: New function end_of_output_subpipe() added
385 to allow support for non-posix systems. This is a no-op function
386 for posix systems.
387
388 * lib/subpipe.h: New function end_of_output_subpipe() added
389 to allow support for non-posix systems. This is a no-op function
390 for posix systems.
391
392 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
393 handle the lack of pipe/fork functionality on non-posix systems.
394
395 * djgpp/Makefile.maint: DJGPP specific file.
396
397 * djgpp/README.in: DJGPP specific file.
398
399 * djgpp/config.bat: DJGPP specific configuration file.
400
401 * djgpp/config.sed: DJGPP specific configuration file.
402
403 * djgpp/config.site: DJGPP specific configuration file.
404
405 * djgpp/config_h.sed: DJGPP specific configuration file.
406
407 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
408
409 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
410
4112005-10-02 Akim Demaille <akim@epita.fr>
412
413 * data/location.cc: New, extract from...
414 * data/lalr1.cc: here.
415 (location.hh): Include it after the user prologue, in case the
416 filename type is defined by the user.
417 Forward declation location and position before the pre-prologue.
418 (yyresult_): Rename as...
419 (yyresult): this, it's a local variable, not an attribute.
420 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
421
4222005-10-01 Akim Demaille <akim@epita.fr>
423
424 * examples/extexi: Restore the #line generation.
425
4262005-09-30 Akim Demaille <akim@epita.fr>,
427 Alexandre Duret-Lutz <adl@gnu.org>
428
429 Move the token type and YYSTYPE in the parser class.
430 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
431 (parser::token): New, from the moved free definition of tokens.
432 (parser::semantic_value): Now a full definition instead of an
433 indirection to YYSTYPE.
434 (b4_post_prologue): No longer included in the header file, but
435 in the implementation file.
436 * doc/bison.texi (C+ Language Interface): Update.
437 * src/parse-gram.y: Support unary %define.
438 * tests/actions.at: Define global_tokens_and_yystype for backward
439 compatibility until we update the tests.
440 * tests/calc.at: Idem.
441 (first_line, first_column, last_line, last_column): Define for lalr1.cc
442 to simplify the code.
443
4442005-09-29 Paul Eggert <eggert@cs.ucla.edu>
445
446 Port to SunOS 4.1.4, which lacks strtoul and strerror.
447 Ah, the good old days! Problem reported by Peter Klein.
448 * bootstrap (gnulib_modules): Add strerror, strtoul.
449 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
450 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
451
4522005-09-29 Akim Demaille <akim@epita.fr>
453
454 * data/c.m4 (b4_error_verbose_if): New.
455 * data/lalr1.cc: Use it.
456 (YYERROR_VERBOSE_IF): Remove.
457 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
458 parser members, replaced by...
459 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
460 local variables.
461 (yysyntax_error_): Takes the state number as argument.
462 (yyreduce_print_): Use the argument yyrule, not the former
463 attribute yyn_.
464
4652005-09-26 Paul Eggert <eggert@cs.ucla.edu>
466
467 * bootstrap (gnulib_modules): Add verify.
468 * lib/.cvsignore: Add verify.h.
469 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
470 * src/system.h (verify): Remove.
471 Include verify.h instead.
472 * src/tables.c (tables_generate): Use new API for 'verify'.
473
4742005-09-21 Paul Eggert <eggert@cs.ucla.edu>
475
476 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
477 local variables whose names begin with 'yy'.
478 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
479 Trivial changes from Joel E. Denny.
480
481 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
482 it itself.
483 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
484 don't use alloca any more.
485
486 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
487 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
488 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
489 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
490 to match yacc.c, to test more hosts.
491
4922005-09-20 Paul Eggert <eggert@cs.ucla.edu>
493
494 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
495 doesn't affect behavior.
496 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
497 Solaris, AIX, MSC.
498 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
499 This works a bit better with glibc, if user code has already included
500 stdlib.h.
501 * doc/bison.texinfo (Bison Parser): Document that users can't
502 arbitrarily use malloc and free for other purposes. Document
503 that <alloca.h> and <malloc.h> might be included.
504 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
505 user must declare alloca.
506
507 * HACKING (release): Forwarn the Translation Project about
508 stable releses.
509
5102005-09-20 Akim Demaille <akim@epita.fr>
511
512 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
513
5142005-09-19 Paul Eggert <eggert@cs.ucla.edu>
515
516 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
517 (YYSTACK_ALLOC_MAXIMUM): Use it.
518 (yysyntax_error): New function.
519 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
520 multiple syntax errors are reported, and alloca is being used.
521 Instead, reallocate buffers twice as big each time, so that
522 we waste at most half the allocated memory. Start with a small
523 (128-byte) buffer that will suffice in most cases anyway.
524 Use yysyntax_error to do most of the work.
525
526 * doc/bison.texinfo (Error Reporting, Table of Symbols):
527 yynerrs is the number of errors reported, not the number of
528 errors encountered.
529
530 * tests/glr-regression.at (Duplicated user destructor for lookahead):
531 Mark it as expected to fail.
532 Cast result of malloc; problem reported by twlevo@xs4all.nl.
533 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
534 Don't start user-code symbols with "yy", to avoid name space problems.
535
5362005-09-19 Akim Demaille <akim@epita.fr>
537
538 Remove the traits, failed experiment.
539 It never proved useful, and anyway because of the current
540 definition, it was not possible to have several specialization of
541 this traits, making it useless.
542 * data/lalr1.cc (yy:traits): Remove.
543 Inline its definitions in the parser class.
544
5452005-09-19 Akim Demaille <akim@epita.fr>
546
547 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
548 least Mac OSX with a /usr/local install of gettext.
549
5502005-09-19 Akim Demaille <akim@epita.fr>
551
552 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
553 and yytoken for similarity with the other skeletons.
554
5552005-09-19 Akim Demaille <akim@epita.fr>
556
557 * NEWS, configure.ac: Bump to 2.1a.
558
5592005-09-16 Paul Eggert <eggert@cs.ucla.edu>
560
561 * NEWS: Version 2.1.
562
563 * NEWS: Remove notice of yytname change, since it was never in an
564 official release.
565 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
566 diagnostic.
567 * src/output.c (prepare): Likewise.
568 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
569 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
570 is not defined. This is an awful hack, but it's enough for now.
571 All callers changed.
572 * tests/glr-regression-at (make_value): Args are const pointers now,
573 to avoid GCC warning.
574 (Duplicated user destructor for lookahead): New test. Currently
575 skipped. It fails on my host but I'm not sure it'll always fail.
576
5772005-09-16 Akim Demaille <akim@epita.fr>
578
579 * src/symtab.h (struct symbol): Declare the printer and destructor
580 as const, to avoid accidental calls to free.
581 (symbol_destructor_set, symbol_printer_set): Adjust.
582 * src/symtab.c: Adjust.
583
5842005-09-16 Akim Demaille <akim@epita.fr>
585
586 * data/c.m4 (b4_token_enums): New.
587 (b4_token_defines): Rename as...
588 (b4_token_enums_defines): this.
589 (b4_token_defines): New, output only the #defines.
590 * data/yacc.c, data/glr.c: Adjust.
591 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
592 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
593 as default values.
594
5952005-09-16 Akim Demaille <akim@epita.fr>
596
597 * data/lalr1.cc (yylex_): Remove, inline its code.
598 (yyreport_syntax_error_): Remove, replaced by...
599 (yysyntax_error_): this which returns a string and leaves to the
600 caller the call to the users' error function.
601 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
602 Move from members of the parser object...
603 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
604 to local variables of the parse function.
605
6062005-09-16 Akim Demaille <akim@epita.fr>
607
608 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
609 since it's in Bison's name space.
610
6112005-09-15 Paul Eggert <eggert@cs.ucla.edu>
612
613 * data/glr.c (yyresolveValue): Add default case to pacify
614 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
615
616 * NEWS: Document when yyparse started to return 2.
617 * doc/bison.texinfo (Parser Function): Document when yyparse
618 returns 2.
619
620 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
621 (b4_filename_type): Renamed back from b4_file_name_type. All uses
622 changed.
623 (class position): file_name -> filename (reverting). All uses changed.
624
6252005-09-14 Paul Eggert <eggert@cs.ucla.edu>
626
627 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
628 do anything if $@ exists. This reverts part of the 2005-07-07
629 patch.
630
6312005-09-11 Paul Eggert <eggert@cs.ucla.edu>
632
633 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
634 contains obsolete information and isn't worth distributing as a
635 separate file anyway.
636 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
637 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
638 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
639 (yyparse): Abort if user code uses longjmp to throw an unexpected
640 value.
641
6422005-09-09 Paul Eggert <eggert@cs.ucla.edu>
643
644 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
645 Suggested by twlevo@xs4all.nl.
646
647 * data/glr.c (YYCHK1): Do not assume YYE is in range.
648 This avoids a diagnostic from gcc -Wswitch-enum.
649 Problem reported by twlevo@xs4all.nl.
650
651 * doc/bison.texinfo: Don't use "filename", as per GNU coding
652 standards. Use "file name" or "file" or "name", depending on
653 the context.
654 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
655 not to hack/foo.tab.c.
656 (Calc++ Top Level): 2nd arg of main is not const.
657 * data/glr.c: b4_filename -> b4_file_name.
658 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
659 All uses changed.
660 (class position): filename -> file_name. All uses changed.
661 * data/yacc.c: b4_filename -> b4_file_name.
662 * lib/bitset.h: filename -> file_name in local vars.
663 * lib/bitset_stats.c: Likewise.
664 * src/files.c: Likewise.
665 * src/scan-skel.l ("@output ".*\n): Likewise.
666 * src/files.c (file_name_split): Renamed from filename_split.
667 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
668
6692005-09-08 Paul Eggert <eggert@cs.ucla.edu>
670
671 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
672 to accommodate latest gnulib.
673
674 * tests/glr-regression.at (Duplicate representation of merged trees):
675 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
676
677 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
678 needed.
679
6802005-08-26 Paul Eggert <eggert@cs.ucla.edu>
681
682 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
683 All uses changed. Invoke user destructor after an error during a
684 split parse (trivial change from Joel E. Denny).
685
686 * tests/glr-regression.at
687 (User destructor after an error during a split parse): New test case.
688 Problem reported by Joel E. Denny in:
689 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
690
6912005-08-25 Paul Eggert <eggert@cs.ucla.edu>
692
693 * README-cvs: Give URLs for recommended tools.
694 Mention Gzip version problem, and bootstrapping issues.
695 Remove troubleshooting section, as it's somewhat obsolete.
696
697 * bootstrap (no_cache): New var, to accommodate different wget
698 variants. Use it instead of '-C off'. Problem reported by
699 twlevo@xs4all.nl.
700
701 * data/glr.c (yydestroyStackItem): New function.
702 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
703 debugging information. Problem reported by Joel E. Denny.
704
7052005-08-25 Akim Demaille <akim@epita.fr>
706
707 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
708
7092005-08-24 Paul Eggert <eggert@cs.ucla.edu>
710
711 * data/glr.c (yyrecoverSyntaxError, yyreturn):
712 Don't invoke destructor on unresolved entries.
713 * tests/glr-regression.at
714 (User destructor for unresolved GLR semantic value): New test case.
715 Problem reported by Joel E. Denny in:
716 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
717
7182005-08-21 Paul Eggert <eggert@cs.ucla.edu>
719
720 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
721 Add strnlen.c.
722 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
723 lib-prefix.m4, po.m4.
724
725 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
726 in yydestruct diagnostic, since it might not be an error.
727 Problem reported by Joel Denny near end of
728 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
729 * data/lalr1.cc (yyerturn): Likewise.
730 * data/yacc.c (yyreturn): Likewise.
731 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
732
733 * src/files.c: Remove obsolete FIXME comment.
734
735 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
736 with the other templates, and to fix bogus run-on messages such
737 as the one reported at the end of
738 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
739 All callers changed to avoid the newline.
740 (yyprocessOneStack): Output two lines rather than one, to accommodate
741 the above change. This changes the debug output format slightly.
742
743 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
744 reported by Joel E. Denny in
745 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
746 (trivial change).
747 * tests/glr-regression.at (Duplicate representation of merged trees):
748 New test, from Joel E. Denny in:
749 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
750 * THANKS: Add Joel E. Denny.
751
752 * configure.ac (AC_INIT): Bump to 2.0c.
753
7542005-07-24 Paul Eggert <eggert@cs.ucla.edu>
755
756 * NEWS: Version 2.0b.
757
758 * Makefile.am (SUBDIRS): Put examples before tests, so that
759 "make check" doesn't finish with "All 1 tests passed".
760
761 * tests/regression.at (Token definitions): Don't rely on
762 AT_PARSER_CHECK for data that contains backslashes. It currently
763 uses 'echo', and 'echo' isn't portable if its argument contains
764 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
765 that the byte '\0xff' is not printable in the C locale; it is,
766 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
767 not printable, so use '\0x81' to test.
768
769 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
770 version of GCC, since the macro is used with non-GCC compilers.
771
772 Fix core dump reported by Pablo De Napoli in
773 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
774 * tests/regression.at (Invalid inputs with {}): New test.
775 * src/parse-gram.y (token_name): Translate type before using
776 it as an index.
777
778 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
779 the user's name space. All uses changed to __attribute__
780 ((__unused__)).
781 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
782 Add __attribute__ ((__noreturn__)).
783
784 * etc/clcommit: Remove. We weren't using it, and it failed
785 "make maintainer-distcheck".
786 * Makefile.maint: Merge from coreutils.
787 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
788 (syntax-check-rules): Change list of rules as described below.
789 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
790 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
791 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
792 (sc_trailing_space): New rules.
793 (sc_xalloc_h_in_src): Remove.
794 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
795 (sc_space_tab, sc_error_exit_success, sc_changelog):
796 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
797 (makefile-check, po-check, author_mark_check):
798 (makefile_path_separator_check, copyright-check):
799 Use grep -n, to make it easier to find violations.
800 Use CVS_LIST and CVS_LIST_EXCEPT.
801 (header_regexp, h_re): Remove.
802 (dd_c): New macro.
803 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
804 (my-distcheck): Use more-modern GCC flags.
805 (signatures, %.asc): Remove.
806 (rel-files, announcement): Remove signatures.
807 Restore old updating code, even though we don't use it, so
808 that we're the same as coreutils.
809 (alpha, beta, major): Depend on news-date-check.
810 Make the upload commands.
811
812 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
813 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
814 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
815 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
816 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
817 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
818 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
819 * tests/sets.at: Likewise.
820
821 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
822 we comment out the Autoconf version number.
823 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
824 it's error-prone and "make maintainer-distcheck" rejects it.
825
826 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
827 Indent calls to "error" to pacify "make maintainer-distcheck",
828 when the calls are not intended to be translated.
829 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
830
831 * src/Makefile.am (DEFS): Use +=, to pacify
832 "make maintainer-distcheck".
833 (bison_SOURCES): Add scan-skel.h.
834 (sc_tight_scope): New rule, from coreutils.
835
836 * src/files.c (src_extension, header_extension):
837 Now static, not extern.
838 * src/getargs.c (short_options): Likewise.
839 * src/muscle_tab.c (muscle_table): Likewise.
840 * src/parse-gram.y (current_class, current_type, current_prec):
841 Likewise.
842 * src/reader.c (grammar_end, previous_rule_end): Likewise.
843 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
844 * src/main.c (main): Cast bindtextdomain and textdomain calls to
845 void, to avoid warning when NLS is disabled.
846 * src/output.c: Include scan-skel.h.
847 (scan_skel): Remove decl, since scan-skel.h does this.
848 (output_skeleton):
849 Indent calls to "error" to pacify "make maintainer-distcheck".
850 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
851 * src/reader.h (gram_end, gram_lineno): New decls to pacify
852 "make maintainer-distcheck".
853 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
854 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
855 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
856 (skel_lex_destroy, scan_skel): Move these decls to...
857 * src/scan-skel.h: New file.
858 * src/uniqstr.c (uniqstr_assert):
859 Indent calls to "error" to pacify "make maintainer-distcheck".
860
861 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
862 not @VAR@.
863
864 * tests/torture.at: Revamp to avoid misuse of atoi that
865 "make maintainer-distcheck" complained about.
866
867 * examples/extexi (message): Don't print a message more than once,
868 and omit line-number decoration that makes Emacs compile think
869 that informative messages are worth worrying about.
870
8712005-07-22 Paul Eggert <eggert@cs.ucla.edu>
872
873 * configure.ac: Update version number.
874
875 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
876 accidentally.
877 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
878 autogenerated by the maintainer.
879 * examples/calc++/.cvsignore: Add *.yy.
880
881 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
882 * lib/bitset_stats.c (bitset_stats_init): Likewise.
883 * lib/bitsetv.c (bitsetv_alloc): Likewise.
884
885 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
886
887 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
888 from maintainer-distcheck about casting the argument of 'free'.
889
890 * NEWS: Mention recent yytname changes.
891 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
892
893 * bootstrap: For translations that have not yet been upgraded to
894 the new runtime-po domain, prime the pump by extracting the
895 relevant strings from the obsolete translations. This code can be
896 removed once the bison-runtime domain has been translated by each
897 team.
898
899 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
900 now that token names are already quoted.
901
902 Fix problem reported by Anthony Heading.
903 * data/glr.c (YYTOKEN_TABLE): New macro.
904 (yytname): Define if YYTOKEN_TABLE.
905 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
906 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
907 (YYERROR_VERBOSE): Define the same way the other skeletons do.
908 * src/output.c (prepare_symbols): Output token_table_flag.
909
9102005-07-21 Paul Eggert <eggert@cs.ucla.edu>
911
912 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
913 again if the first call fails.
914
915 * data/glr.c (yytnamerr): New function.
916 (yyreportSyntaxError): Use it to dequote most string literals.
917 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
918 with other skeletons. All uses changed.
919 (yytnameerr_): New function.
920 (yyreport_syntax_error): Use it to dequote most string literals.
921 * data/yacc.c (yytnamerr): New function.
922 (yyerrlab): Use it to decode most string literals.
923 * doc/bison.texinfo (Decl Summary, Calling Convention):
924 Clarify quoting convention of yytname.
925 * src/output.c (prepare_symbols): Quote all names. This undoes
926 the 2005-04-17 change, which is now accomplished (mostly) via
927 changes in the parsers as described above.
928 * tests/regression.at (Token definitions, Web2c Actions):
929 Undo most 2005-04-17 change here, too.
930
9312005-07-20 Paul Eggert <eggert@cs.ucla.edu>
932
933 Fix more problems reported by twlevo@xs4all.nl.
934 * tests/cxx-type.at: Don't pipe output of ./types through sed to
935 remove trailing spaces. This loses the exit status of ./types,
936 and isn't needed since ./types shouldn't be emitting trailing
937 spaces.
938 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
939 as the stack isn't valid in that case.
940
941 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
942 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
943 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
944 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
945 is used.
946 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
947 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
948 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
949 Likewise.
950
951 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
952 overly-picky compilers that reject 'char *foo = "bar";'.
953
954 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
955 to FILE * parameter, not to stderr. This fixes a typo introduced
956 in the 2005-07-12 change.
957
958 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
959 warnings from GCC 4.
960
961 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
962 (yyglrShiftDefer, yysplitStack):
963 Remove unused parameters b4_pure_formals. All uses changed.
964 (yyglrShift): Remove unused parameters b4_user_formals.
965 All uses changed.
966 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
967
9682005-07-18 Paul Eggert <eggert@cs.ucla.edu>
969
970 Destructor cleanups and regularization among the three skeletons.
971 * NEWS: Document the behavior changes.
972 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
973 stack before failing, as the cleanup code will do it for us now.
974 * data/lalr1.cc (yyerrlab): Likewise.
975 * data/glr.c (yyparse): Pop everything off the stack before
976 freeing it, so that destructors get called properly.
977 * data/lalr1.cc (yyreturn): Likewise.
978 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
979 This is more consistent.
980 * doc/bison.texinfo (Destructor Decl): Mention more reasons
981 why destructors might be called. 1.875 -> 2.1.
982 (Destructor Decl, Decl Summary, Table of Symbols):
983 Some English-language cleanups for %destructor.
984 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
985 Add output line for destructor of start symbol.
986 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
987 because of that same extra output line.
988
989 * NEWS: Document minor wording changes in diagnostics of
990 Bison-generated parsers.
991 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
992 Remove unused formals. All uses changed.
993 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
994 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
995 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
996 Rename yyoverflowab to yyexhaustedlab.
997 When memory exhaustion occurs during syntax-error reporting,
998 report it separately rather than in a single diagnostic; this
999 eases translation.
1000 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
1001 (Memory Exhausted): Renamed from Parser Stack Overflow.
1002 Revamp wording slightly to prefer "memory exhaustion".
1003 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
1004
1005 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
1006
1007 Add i18n support to the GLR skeleton. Partially fix the C++
1008 skeleton; a C++ expert needs to finish this. Remove debugging
1009 msgids; there's little point to having them translated, since they
1010 can be understood only by someone who can read the
1011 (English-language) source code.
1012
1013 Generate runtime-po/bison-runtime.pot automatically, so that we
1014 don't have to worry about garbage getting in that file. We'll
1015 make sure after the next official release that old msgids don't
1016 get lost. See
1017 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
1018
1019 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
1020 Now auto-generated.
1021 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
1022 Fix typos in explanations of the runtime file.
1023 * bootstrap: Change gettext keyword from YYI18N to YY_.
1024 Use standard Makefile.in.in in runtime-po, since we'll arrange
1025 for backward-compatible bison-runtime.po files in a different way.
1026 * data/glr.c (YY_): New macro, from yacc.c.
1027 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
1028 Translate messages intended for users.
1029 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
1030 the wording in the other skeletons. We don't know that the memory
1031 is virtual.
1032 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
1033 Use same method that yacc.c uses.
1034 Don't translate debugging messages.
1035 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
1036 it doesn't work (yet), and requires C++ expertise to fix.
1037 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
1038 Move defn to a more logical place, to be consistent with other
1039 skeletons.
1040 Don't translate debugging messages.
1041 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
1042 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
1043 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
1044 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
1045
1046 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
1047 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
1048 void, not int.
1049 * tests/glr-regression.at (Badly Collapsed GLR States):
1050 Likewise.
1051 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
1052 yylex should return 0 at EOF rather than aborting.
1053
1054 Improve tests for stack overflow in GLR parser.
1055 Problem reported by twlevo@xs4all.nl.
1056 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
1057 All uses removed.
1058 (yyStackOverflow): Just longjmp, but with value 2 so that caller
1059 can handle the problem.
1060 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
1061 (yyparse): New local variable yyresult to record the result.
1062 Use result of setjmp to set it, rather than storing itinto
1063 struct.
1064 (yyDone): Remove label.
1065 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
1066 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
1067 if YYABORT is used).
1068 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
1069 yyparse status; put status > 1 into diagnostic.
1070 Check that status==2 works.
1071 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
1072 Use exit status 3 for failure to open (which shouldn't happen).
1073
10742005-07-17 Paul Eggert <eggert@cs.ucla.edu>
1075
1076 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
1077 1 on syntax error; just let yyparse do its thing.
1078 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
1079 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
1080 (Exploding the Stack Size with Alloca):
1081 (Exploding the Stack Size with Malloc):
1082 Expect exit status 2, not 1, since the parser is supposed to blow
1083 its stack. Problem reported by twlevo@xs4all.nl.
1084
1085 * data/glr.c (yyparse): Don't assume that the initial calls
1086 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
1087 Print a stack-overflow message and fail instead.
1088 Initialize the line-number information before creating the stack,
1089 so that the stack-overflow message can report line zero safely.
1090
10912005-07-14 Paul Eggert <eggert@cs.ucla.edu>
1092
1093 Fix problems reported by twlevo@xs4all.nl.
1094 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
1095 (yyuserMerge): Provide a default case if b4_mergers is empty.
1096 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
1097 * tests/glr-regression.at
1098 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
1099 Add casts to pacify C++ compilers.
1100 * tests/glr-regression.at (Improper merging of GLR delayed action
1101 sets): Declare yylex before using it.
1102 * tests/Makefile.am (maintainer-check-g++): Fix a stray
1103 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
1104 test for valgrind; valgrind is independent of g++.
1105 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
1106 for compatibility with POSIX 1003.1-2001 (if running coreutils).
1107 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
1108 Use a destructor, so that we can expand the stack. Change
1109 YYSTYPE to char * so that we can free it. Cast result of malloc.
1110
11112005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
1112
1113 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
1114 a valgrind failure. Problem reported by twlevo@xs4all.nl.
1115
11162005-07-13 Paul Eggert <eggert@cs.ucla.edu>
1117
1118 * PACKAGING: New file, suggested by Bruno Haible and taken from
1119 similar wording in gettext's PACKAGING file.
1120 * NEWS: Mention PACKAGING.
1121 * Makefile.am (EXTRA_DIST): Add PACKAGING.
1122
11232005-07-12 Paul Eggert <eggert@cs.ucla.edu>
1124
1125 * NEWS: Document recent i18n improvements.
1126 * bootstrap: Get runtime translations into runtime-po.
1127 Create runtime-po files automatically, if possible.
1128 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
1129 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
1130 does not infringe on the user's name space.
1131 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
1132 * doc/bison.texinfo (Internationalization): Revamp the English
1133 and Texinfo syntax a bit, to try to make it clearer.
1134 (Bison Options, Option Cross Key): Mention --print-localedir.
1135 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
1136 YYENABLE_NLS. Quote a bit more.
1137 * runtime-po/.cvsignore: New file.
1138 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
1139 * runtime-po/Rules-quot: Remove; now created by bootstrap.
1140 * runtime-po/quot.sed: Likewise.
1141 * runtime-po/boldquot.sed: Likewise.
1142 * runtime-po/en@quot.header: Likewise.
1143 * runtime-po/en@boldquot.header: Likewise.
1144 * runtime-po/insert-header.sin: Likewise.
1145 * runtime-po/remove-potcdate.sin: Likewise.
1146 * runtime-po/Makevars: Likewise.
1147 * runtime-po/LINGUAS: Likewise.
1148 * runtime-po/de.po: Likewise; we will rely on the translation project
1149 to maintain this, so "bootstrap" should get it.
1150 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
1151 its value.
1152 * src/main.c (main): Bind the bison-runtime domain, too.
1153
11542005-07-12 Bruno Haible <bruno@clisp.org>
1155
1156 * data/yacc.c: Include <libintl.h> when NLS is enabled.
1157 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
1158 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
1159 * runtime-po: New directory.
1160 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
1161 $(DOMAIN).pot-update rule, so that old messages are never dropped.
1162 * runtime-po/Rules-quot: New file, copied from po/.
1163 * runtime-po/quot.sed: Likewise.
1164 * runtime-po/boldquot.sed: Likewise.
1165 * runtime-po/en@quot.header: Likewise.
1166 * runtime-po/en@boldquot.header: Likewise.
1167 * runtime-po/insert-header.sin: Likewise.
1168 * runtime-po/remove-potcdate.sin: Likewise.
1169 * runtime-po/Makevars: New file.
1170 * runtime-po/POTFILES.in: New file.
1171 * runtime-po/LINGUAS: New file.
1172 * runtime-po/bison-runtime.pot: New file.
1173 * runtime-po/de.po: New file.
1174 * m4/bison.m4: New file.
1175 * Makefile.am (SUBDIRS): Add runtime-po.
1176 (aclocaldir, aclocal_DATA): New variables.
1177 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
1178 Define aclocaldir.
1179 * src/getargs.c (usage): Document --print-localedir option.
1180 (PRINT_LOCALEDIR_OPTION): New enum item.
1181 (long_options): Add --print-localedir option.
1182 (getargs): Handle --print-localedir option.
1183 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
1184 (Internationalization): New section.
1185
11862005-07-12 Akim Demaille <akim@epita.fr>
1187
1188 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
1189 for consistency with the rest of the code.
1190 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
1191 Add separators.
1192
11932005-07-12 Akim Demaille <akim@epita.fr>
1194
1195 * src/parse-gram.y: Use %printer instead of YYPRINT.
1196
11972005-07-12 Akim Demaille <akim@epita.fr>
1198
1199 * src/symtab.h, src/symtab.c (symbol_print): New.
1200 * src/symlist.h, src/symlist.c (symbol_list_print): New.
1201 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
1202
12032005-07-12 Akim Demaille <akim@epita.fr>
1204
1205 * data/glr.c (b4_syncline): Fix (swap) the definitions of
1206 b4_at_dollar and b4_dollar_dollar.
1207
12082005-07-11 Paul Eggert <eggert@cs.ucla.edu>
1209
1210 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
1211 and Pennello's paper.
1212
12132005-07-09 Paul Eggert <eggert@cs.ucla.edu>
1214
1215 * data/yacc.c (yyparse): Undo previous patch. Instead,
1216 set yylsp[0] and yyvsp[0] only if the initial action
1217 sets yylloc and yylval, respectively.
1218
1219 * data/yacc.c (yyparse): In the initial action, set
1220 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
1221 This avoids the use of undefined variables if the initial
1222 action does not set yylloc and/or yylval.
1223
12242005-07-07 Paul Eggert <eggert@cs.ucla.edu>
1225
1226 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
1227 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
1228 Remove from CVS. These files are automatically generated.
1229 * examples/extexi: Clarify that this file is now part of Bison,
1230 not GNU M4, and that it works with any POSIX-compatible Awk.
1231 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
1232 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
1233 so that we also get calc++-parser.yy. Geneate it.
1234 Use $(AWK), not gawk, since any conforming Awk will do.
1235 Put comment before action, since older 'make' can't handle comment
1236 in action.
1237 $(BUILT_SOURCES): List all built sources, not just some of them.
1238 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
1239 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
1240 $($(calc_sources_generated)): Remove unnecessary test for existence
1241 of target. (This had a shell syntax error anyway; a stray "x".)
1242 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
1243 calc++-parser.yy.
1244 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
1245
1246 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
1247 implied by the other modules.
1248
12492005-07-06 Akim Demaille <akim@epita.fr>
1250
1251 Bind examples/calc++ to the package.
1252 * examples/calc++/Makefile: Remove, replaced by...
1253 * examples/calc++/Makefile.am: ... this new file.
1254 * examples/calc++/test: Remove input.
1255 * examples/calc++/compile: Remove.
1256 * examples/Makefile.am: New.
1257 * configure.ac, Makefile.am: Adjust.
1258 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
1259
12602005-07-05 Paul Eggert <eggert@cs.ucla.edu>
1261
1262 * data/glr.c (yyFail): Drastically simplify; since the format argument
1263 never had any % directives, we can simply pass it to yyerror.
1264 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
1265 be modified later, as that is the usual style in glr.c.
1266 Problems reported by Paul Hilfinger.
1267
1268 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
1269 and size overflow errors.
1270 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
1271 in case the user prolog sets feature-test macros like _GNU_SOURCE.
1272 (YYSIZEMAX): New macro.
1273 (yystpcpy): New function, taken from yacc.c.
1274 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
1275 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
1276 so that we don't have to maintain their signatures.
1277 (yyFail): Check for buffer overflow, by using vsnprintf rather
1278 than vsprintf. Allocate a bigger buffer if possible.
1279 Report an error if buffer allocation fails.
1280 (yyStackOverflow): New function.
1281 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
1282 the initialization was successful. It might fail if storage was
1283 exhausted.
1284 (yyexpandGLRStack): Add more checks for storage allocation failure.
1285 Use yyStackOverflow to report failures.
1286 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
1287 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
1288 Don't assume stack number fits in int.
1289 (yysplitStack): Check for storage allocation failure.
1290 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
1291 can print diagnostics on storage allocation failure. All callers
1292 changed.
1293 (yyresolveValue): Use yybool for boolean.
1294 (yyreportSyntaxError): Check for size-calculation overflow.
1295 This code is taken from yacc.c.
1296 (yyparse): Check for storage allocation errors when allocating
1297 the initial stack.
1298
12992005-07-05 Akim Demaille <akim@epita.fr>
1300
1301 Extract calc++ from the documentation.
1302 * doc/bison.texinfo (Calc++): Add the extraction marks.
1303 * examples/extexi: New, from the aborted GNU Programming 2E.
1304 Separate the different paragraph of a file with empty lines.
1305 * examples/Makefile: Use it to extract the whole calc++ example.
1306
13072005-06-24 Akim Demaille <akim@epita.fr>
1308
1309 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
1310 class typedefs.
1311
13122005-06-22 Akim Demaille <akim@epita.fr>
1313
1314 * doc/bison.texinfo (C++ Language Interface): First stab.
1315 (C++ Parsers): Remove.
1316
13172005-06-22 Akim Demaille <akim@epita.fr>
1318
1319 * data/lalr1.cc (yylex_): Honor %lex-param.
1320
13212005-06-22 Akim Demaille <akim@epita.fr>
1322
1323 Start a set of simple examples.
1324 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
1325 * examples/calc++/calc++-driver.hh,
1326 * examples/calc++/calc++-parser.yy,
1327 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
1328 * examples/calc++/compile, examples/calc++/test: New.
1329
13302005-06-09 Paul Eggert <eggert@cs.ucla.edu>
1331
1332 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
1333 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
1334 which stems from the 2005-05-27 patch.
1335
13362005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
1337
1338 * data/glr.c: Modify treatment of unused parameters to permit use
1339 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
1340
13412005-05-30 Paul Eggert <eggert@cs.ucla.edu>
1342
1343 Fix infringement on user name space reported by Janos Zoltan Szabo.
1344 * data/yacc.c (yyparse): strlen -> yystrlen.
1345
13462005-05-30 Akim Demaille <akim@epita.fr>
1347
1348 * data/lalr1.cc (_): New.
1349 Translate the various messages.
1350
13512005-05-27 Paul Eggert <eggert@cs.ucla.edu>
1352
1353 Fix infringement on user name space reported by Bruno Haible.
1354 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
1355 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
1356 the user's name space.
1357 (alloca): Include <stdlib.h> to get it, if it's not built in.
1358 (YYMALLOC, YYFREE): Define only if needed.
1359 (malloc, free): Declare, but only if needed, as this infringes on
1360 the user name space.
1361
13622005-05-25 Paul Eggert <eggert@cs.ucla.edu>
1363
1364 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
1365 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
1366 with %d format.
1367 * lib/ebitset.c (min, max): Undef before defining.
1368 * lib/vbitset.c (min, max): Likewise.
1369 * lib/subpipe.c (create_subpipe): Save local variables in case
1370 vfork clobbers them.
1371
13722005-05-24 Bruno Haible <bruno@clisp.org>
1373
1374 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
1375 error message syntax used by gcc-4.0.
1376
13772005-05-23 Paul Eggert <eggert@cs.ucla.edu>
1378
1379 * README: Mention m4 1.4.3. Remove obsolete advice about
1380 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
1381
1382 * bootstrap: Remove workaround for problem I encountered with
1383 gettext 0.14.1; it seems to be fixed now.
1384
13852005-05-22 Paul Eggert <eggert@cs.ucla.edu>
1386
1387 * NEWS: Version 2.0a.
1388
1389 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
1390 the previous change.
1391
1392 Various maintainer cleanups.
1393 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
1394 conftest*, for benefit of CVS commands run at the same time as
1395 "configure". Add build-aux, since "bootstrap" now creates it and
1396 its subfiles.
1397 * Makefile.cfg (move_if_change): Remove.
1398 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
1399 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
1400 (po_repo, do-po-update, po-update, wget_files, get-targets):
1401 (config.guess-url_prefix, config.sub-url_prefix):
1402 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
1403 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
1404 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
1405 Remove.
1406 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
1407 this is now the recommended name.
1408 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
1409 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
1410 ylwrap. These files now go into build-aux.
1411 * config/move-if-change: Remove.
1412 * config/prev-version.txt: Bump from 1.75 to 2.0.
1413
1414 * bootstrap: Add stdio-safer, unistd-safer modules.
1415 Remove m4/glibc2.m4 (introduced by latest gnulib, but
1416 we don't need it).
1417 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
1418 fopen-safer.c, stdio-safer.h, unistd-safer.h.
1419 * lib/subpipe.c: Include "unistd-safer.h".
1420 (create_subpipe): Make sure all the newly-created
1421 file descriptors are > 2, so that diagnostics don't
1422 get sent down them (which might cause Bison to hang, in theory).
1423 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
1424 * src/files.c (xfopen): Use fopen_safer, not fopen.
1425
1426 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
1427 yesterday's yacc.c fix.
1428
14292005-05-21 Paul Eggert <eggert@cs.ucla.edu>
1430
1431 * data/glr.c, data/lalr1.cc: Update copyright date.
1432
1433 Fix a destructor bug reported by Wolfgang Spraul in
1434 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
1435 * data/yacc.c (yyabortlab): Don't call destructor, and
1436 don't set yychar to EMPTY.
1437 (yyoverflowlab): Don't call destructor.
1438 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
1439 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
1440 since we no longer output the message "discarding lookahead token
1441 end of input ()".
1442
14432005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
1444
1445 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
1446 fix a small glitch in debugging output.
1447 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
1448 after YY_SYMBOL_PRINT where needed.
1449
1450 (struct yyGLRState): Add some comments.
1451 (struct yySemanticOption): Add some comments.
1452 (union yyGLRStackItem): Add comment.
1453
1454 (yymergeOptionSets): Correct this to properly perform the union,
1455 avoiding infinite reported by Michael Rosien.
1456 Update comment.
1457
1458 * tests/glr-regression.at: Add test for GLR merging error reported
1459 by M. Rosien.
1460
14612005-05-13 Paul Eggert <eggert@cs.ucla.edu>
1462
1463 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
1464 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
1465 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
1466 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
1467 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
1468 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
1469 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
1470 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
1471 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
1472 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
1473 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
1474 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
1475 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
1476 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
1477 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
1478 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
1479 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
1480 src/derives.h, src/files.c, src/files.h, src/getargs.c,
1481 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
1482 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
1483 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
1484 src/output.h, src/parse-gram.c, src/parse-gram.h,
1485 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
1486 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
1487 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
1488 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
1489 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
1490 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
1491 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
1492 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
1493 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
1494 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
1495 tests/reduce.at, tests/regression.at, tests/sets.at,
1496 tests/synclines.at, tests/testsuite.at, tests/torture.at:
1497 Update FSF postal mail address.
1498
14992005-05-11 Paul Eggert <eggert@cs.ucla.edu>
1500
1501 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
1502 Problem reported by Ralf Menzel.
1503
15042005-05-01 Paul Eggert <eggert@cs.ucla.edu>
1505
1506 * tests/actions.at: Test that stack overflow invokes destructors.
1507 From Marcus Holland-Moritz.
1508 * data/yacc.c (yyerrlab): Move the code that destroys the stack
1509 from here....
1510 (yyreturn): to here. That way, destructors are called properly
1511 even if the stack overflows, or the user calls YYACCEPT or
1512 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
1513 (yyoverflowlab): Destroy the lookahead.
1514
15152005-04-24 Paul Eggert <eggert@cs.ucla.edu>
1516
1517 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
1518
15192005-04-17 Paul Eggert <eggert@cs.ucla.edu>
1520
1521 * NEWS: Bison-generated C parsers no longer quote literal strings
1522 associated with tokens.
1523 * src/output.c (prepare_symbols): Don't escape strings,
1524 since users don't want to see C escapes.
1525 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
1526 in diagnostics.
1527 * tests/input.at (Torturing the Scanner): Likewise.
1528 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
1529
15302005-04-16 Paul Eggert <eggert@cs.ucla.edu>
1531
1532 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
1533 the data size is known to be too small and we can't increase it.
1534 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
1535
15362005-04-15 Paul Eggert <eggert@cs.ucla.edu>
1537
1538 * src/parse-gram.y: Include quotearg.h.
1539 (string_as_id): Quote $1 before using it as a key, since the
1540 lexer no longer quotes it for us.
1541 (string_content): Don't strip quotes, since lexer no longer
1542 quotes it for us.
1543 * src/scan-gram.l: Include quotearg.h.
1544 ("\""): Omit quote.
1545 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
1546 a key, since the rest of the lexer doesn't quote it.
1547 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
1548 * tests/regression.at (Token definitions): Check for backslashes
1549 in token strings.
1550
1551 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
1552 (YYSIZE_T): Define to unsigned long int when using an older compiler.
1553 (yyparse): Revamp code to generate long syntax error message, to
1554 make it easier to translate, and to avoid problems with arithmetic
1555 overflow. Change "virtual memory" to "memory" in diagnostic, since
1556 we don't know whether the memory is virtual.
1557
15582005-04-13 Paul Eggert <eggert@cs.ucla.edu>
1559
1560 * NEWS: Bison-generated C parsers now use the _ macro to
1561 translate strings.
1562 * data/yacc.c (_) [!defined _]: New macro.
1563 All English strings wrapped inside this macro.
1564 * doc/bison.texinfo (Bison Parser): Document _.
1565 * po/POTFILES.in: Include src/parse-gram.c, since it now
1566 includes translateable strings that parse-gram.y doesn't.
1567
15682005-04-12 Paul Eggert <eggert@cs.ucla.edu>
1569
1570 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
1571 reverting the 2004-10-11 change to this function.
1572 (symbol_check_alias_consistency): Don't call symbol_type_set
1573 if the type name is already correct.
1574 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
1575
15762005-03-25 Paul Eggert <eggert@cs.ucla.edu>
1577
1578 * tests/regression.at (Token definitions): Don't use a token named
1579 c, as that generates a "#define c ..." that runs afoul of buggy
1580 stdlib.h that uses the identifier c as a member of struct
1581 drand48_data. Problem reported by Horst Wente.
1582
15832005-03-21 Paul Eggert <eggert@cs.ucla.edu>
1584
1585 * bootstrap: Change translation URL from
1586 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
1587 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
1588 redirection glitches. Problem reported by twlevo@xs4all.nl.
1589
15902005-03-20 Paul Eggert <eggert@cs.ucla.edu>
1591
1592 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
1593 after operands; POSIX says this isn't portable for the c99 command.
1594
15952005-03-18 Paul Eggert <eggert@cs.ucla.edu>
1596
1597 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
1598 immediately if a data overrun has occurred; this may help us track
1599 down what may be a spurious failure on MacOS.
1600
16012005-03-17 Paul Eggert <eggert@cs.ucla.edu>
1602
1603 Respond to problems reported by twlevo@xs4all.nl.
1604
1605 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
1606
1607 * src/vcg.h: Comment fix.
1608 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
1609 (G_CMAX): Change to -1 instead of INT_MAX.
1610
1611 * data/yacc.c (yyparse): Omit spaces before #line.
1612
16132005-03-15 Paul Eggert <eggert@cs.ucla.edu>
1614
1615 * src/tables.c (state_number_to_vector_number): Put it inside an
1616 "#if 0", since it's not currently used. Problem reported by
1617 Roland McGrath.
1618
16192005-03-06 Paul Eggert <eggert@cs.ucla.edu>
1620
1621 * src/output.c (escaped_output): Renamed from
1622 escaped_file_name_output, since we now use it for symbol tags as
1623 well. All uses changed.
1624 (symbol_destructors_output, symbol_printers_output):
1625 Escape symbol tags too.
1626 Problem reported by Matyas Forstner in
1627 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
1628
1629 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
1630 not needed.
1631 * src/output.c (user_actions_output, token_definitions_output,
1632 symbol_destructors_output, symbol_printers_output): Likewise.
1633 * src/reader.c (prologue_augment): Likewise.
1634 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
1635
1636 * src/vcg.c (output_edge): Don't quote linestyle arg.
1637 Problem reported by twlevo@xs4all.nl.
1638
16392005-02-28 Paul Eggert <eggert@cs.ucla.edu>
1640
1641 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
1642 example, reported by Derek M Jones. Also, make the example even
1643 more outrageous, to better illustrate how bad the problem is.
1644
16452005-02-24 Paul Eggert <eggert@cs.ucla.edu>
1646
1647 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
1648 putsym. Typo reported by Sebastian Piping.
1649
16502005-02-23 Paul Eggert <eggert@cs.ucla.edu>
1651
1652 * doc/bison.texinfo (Language and Grammar): some -> same
1653 (Epilogue): int he -> in the
1654 Typos reported by Sebastian Piping via Justin Pence.
1655
16562005-02-07 Paul Eggert <eggert@cs.ucla.edu>
1657
1658 * tests/glr-regression.at (Improper handling of embedded actions
1659 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
1660 embedded actions and $-N in GLR parsers", work around an Autoconf bug
1661 with dollar signs in test names.
1662 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
1663 for a similar reason.
1664
16652005-01-28 Paul Eggert <eggert@cs.ucla.edu>
1666
1667 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
1668 wants to redefine G_VIEW.
1669
16702005-01-27 Paul Eggert <eggert@cs.ucla.edu>
1671
1672 * src/vcg.c (get_view_str): Remove case for normal_view.
1673 Problem reported by twlevo@xs4all.nl.
1674
16752005-01-24 Paul Eggert <eggert@cs.ucla.edu>
1676
1677 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
1678 Problem reported by twlevo@xs4all.nl.
1679
1680 * doc/bison.texinfo: Change @dircategory from "GNU programming
1681 tools" to "Software development". Requested by Richard Stallman
1682 via Karl Berry.
1683
16842005-01-23 Paul Eggert <eggert@cs.ucla.edu>
1685
1686 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
1687 Problem reported by twlevo@xs4all.nl.
1688
16892005-01-21 Paul Eggert <eggert@cs.ucla.edu>
1690
1691 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
1692 keyword; it's not needed with modern compilers, and it doesn't
1693 affect correctness with older compilers. Suggested by
1694 twlevo@xs4all.nl.
1695
16962005-01-17 Paul Eggert <eggert@cs.ucla.edu>
1697
1698 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
1699 gcc -Wswitch-default.
1700 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
1701 * data/yacc.c (yyparse): Likewise.
1702
17032005-01-12 Paul Eggert <eggert@cs.ucla.edu>
1704
1705 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
1706 already. Let config.h define any nonstandard values.
1707
17082005-01-10 Paul Eggert <eggert@cs.ucla.edu>
1709
1710 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
1711 for the benefit of slower hosts. Problem reported by
1712 Nelson H. F. Beebe.
1713
17142005-01-07 Paul Eggert <eggert@cs.ucla.edu>
1715
1716 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
1717 being defined and not used.
1718 * data/lalr1.cc (yyparse): Likewise.
1719 Use "if (false)" rather than "if (0)".
1720
17212005-01-05 Paul Eggert <eggert@cs.ucla.edu>
1722
1723 * TODO: Mention that we should allow NUL bytes in tokens.
1724
17252005-01-02 Paul Eggert <eggert@cs.ucla.edu>
1726
1727 * src/scan-skel.l (<<EOF>>): Don't close standard output.
1728 Problem reported by Hans Aberg.
1729
17302005-01-01 Paul Eggert <eggert@cs.ucla.edu>
1731
1732 * src/getargs.c (version): Happy new year; update overall
1733 program copyright date from 2004 to 2005.
1734
1735 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
1736 Problem reported by Hans Aberg.
1737 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
1738 (Output file names.): Add a test for the case when standard output
1739 is closed.
1740
17412004-12-26 Paul Eggert <eggert@cs.ucla.edu>
1742
1743 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
1744 to fix an oversight in the Bison 2.0 manual.
1745
17462004-12-25 Paul Eggert <eggert@cs.ucla.edu>
1747
1748 * NEWS: Version 2.0. Reformat the existing news items since
1749 1.875, so that related items are grouped together.
1750 * configure.ac (AC_INIT): Bump version to 2.0.
1751 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
1752
1753 * tests/torture.at (Exploding the Stack Size with Alloca): Set
1754 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
1755 otherwise, we're not testing alloca. Unfortunately there's no
1756 simple way to consult HAVE_ALLOCA here.
1757
1758 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
1759 for yymsg, too.
1760
1761 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
1762 hand. This avoids a warning about comparing int to size_t when
1763 GCC warnings are enabled.
1764
17652004-12-22 Paul Eggert <eggert@cs.ucla.edu>
1766
1767 * NEWS: Bison-generated parsers no longer default to using the
1768 alloca function (when available) to extend the parser stack, due
1769 to widespread problems in unchecked stack-overflow detection.
1770 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
1771 responsibility to set it to a positive value. This lets the user
1772 specify a value that is not a preprocessor constant.
1773 * data/yacc.c (YYMAXDEPTH): Likewise.
1774 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
1775 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
1776 to be a compile-time constant. However, explain the constraints on it.
1777 Also, explain the constraints on YYINITDEPTH.
1778 (Table of Symbols): Explain that alloca is no longer the default.
1779 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
1780 to 1.
1781
1782 * doc/bison.texinfo (Location Default Action): Mention that n must
1783 be zero when k is zero. Suggested by Frank Heckenbach.
1784
17852004-12-22 Akim Demaille <akim@epita.fr>
1786
1787 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
1788 (parser::state_type, parser::semantic_type, parser::location_type):
1789 Private, not public.
1790 (parser::parse): Return ints, not bool.
1791 Returning a bool introduces a problem: 0 corresponds to false, and
1792 it seems weird to return false on success. Returning true changes
1793 the conventions for yyparse.
1794 Alternatively we could return void and send an exception.
1795 There is no clear consensus (yet?).
1796 (state_stack, semantic_stack, location_stack): Rename as...
1797 (state_stack_type, semantic_stack_type, location_stack_type): these.
1798 Private, not public.
1799 * tests/c++.at: New.
1800 * tests/testsuite.at, tests/Makefile.am: Adjust.
1801
18022004-12-21 Akim Demaille <akim@epita.fr>
1803
1804 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
1805
18062004-12-21 Akim Demaille <akim@epita.fr>
1807
1808 Don't impose std::string for filenames.
1809
1810 * data/lalr1.cc (b4_filename_type): New.
1811 (position::filename): Use it.
1812 (parser.hh): Move the inclusion of stack.hh and location.hh below
1813 the user code, so that needed headers for the filename type can be
1814 included first.
1815 Forward declare them before the user code.
1816 * tests/Makefile.am (check-local, installcheck-local): Pass
1817 TESTSUITEFLAGS to the TESTSUITE.
1818
18192004-12-20 Akim Demaille <akim@epita.fr>
1820
1821 Use more STL like names: my_class instead of MyClass.
1822
1823 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
1824 (SemanticStack, SemanticType, StateStack, StateType)
1825 (TokenNumberType, Stack, Slice, Traits, Parser::location)
1826 (Parser::value): Rename as...
1827 (location_stack, location_type, rhs_number_type, semantic_stack)
1828 (semantic_type, state_stack, state_type, token_number_type, stack)
1829 (slice, traits, parser::yylloc, parser::yylval): these.
1830
1831 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
1832
18332004-12-19 Paul Eggert <eggert@cs.ucla.edu>
1834
1835 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
1836 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
1837
18382004-12-17 Paul Eggert <eggert@cs.ucla.edu>
1839
1840 Remove uses of 'short int' and 'unsigned short int'. This raises
1841 some arbitrary limits. It uses more memory but nowadays that's
1842 not much of an issue.
1843
1844 This change does not affect the generated parsers; that's a different
1845 task, as some users will want to conserve memory there.
1846
1847 Ideally we should use size_t to represent all object counts, and
1848 something like ptrdiff_t to represent signed differences of object
1849 counts; but that will require more code-cleanup than I have the
1850 time to do right now.
1851
1852 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
1853 Use size_t, not int or short int, to count objects.
1854 * src/closure.c (nritemset, closure): Likewise.
1855 * src/closure.h (nritemset, closure): Likewise.
1856 * src/nullable.c (nullable_compute): Likewise.
1857 * src/print.c (print_core): Likewise.
1858 * src/print_graph.c (print_core): Likewise.
1859 * src/state.c (state_compare, state_hash): Likewise.
1860 * src/state.h (struct state): Likewise.
1861 * src/tables.c (default_goto, goto_actions): Likewise.
1862
1863 * src/gram.h (rule_number, rule): Use int, not short int.
1864 * src/output.c (prepare_rules): Likewise.
1865 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
1866 errs, reductions): Likewise.
1867 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
1868 Likewise.
1869 * src/tables.c (vector_number, tally, action_number,
1870 ACTION_NUMBER_MINIMUM): Likewise.
1871 * src/output.c (muscle_insert_short_int_table): Remove.
1872
18732004-12-17 Akim Demaille <akim@epita.fr>
1874
1875 * data/lalr1.cc: Extensive Doxygenation.
1876 (error_): Rename as...
1877 (error): this, since it is visible to the user.
1878 Adjust callers.
1879 (Parser::message): Now an automatic variable from...
1880 (Parser::yyreport_syntax_error_): here.
1881 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
1882 Parser::error.
1883 * tests/input.at: Escape $.
1884
18852004-12-16 Paul Eggert <eggert@cs.ucla.edu>
1886
1887 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
1888 Parenthesize rhs to avoid obscure problems with mistakes like
1889 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
1890 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
1891 b4_rhs_location): Likewise.
1892 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
1893 b4_rhs_location): Likewise.
1894
18952004-12-16 Akim Demaille <akim@epita.fr>
1896
1897 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
1898 yacc.c: be sure to stay within yycheck_.
1899 * tests/actions.at: Re-enable C++ tests.
1900
19012004-12-16 Akim Demaille <akim@epita.fr>
1902
1903 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
1904 real.
1905
19062004-12-16 Akim Demaille <akim@epita.fr>
1907
1908 Use #define to handle the %name-prefix.
1909
1910 * data/glr.c, data/yacc.c: Comment changes.
1911 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
1912 so that one can refer to yylex in the parser file, and have it
1913 renamed, as is the case with other skeletons.
1914
19152004-12-16 Akim Demaille <akim@epita.fr>
1916
1917 Move lalr1.cc internals into yy*.
1918
1919 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
1920 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
1921 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
1922 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
1923 (empty_, final_, terror_, errcode_, ntokens_)
1924 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
1925 (looka_, ilooka_, error_range_, nerrs_):
1926 Rename as...
1927 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
1928 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
1929 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
1930 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
1931 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
1932 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
1933 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
1934 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
1935 these.
1936
19372004-12-15 Paul Eggert <eggert@cs.ucla.edu>
1938
1939 Fix some problems reported by twlevo at xs4all.
1940 * src/symtab.c (symbol_new): Report an error if the input grammar
1941 contains too many symbols. This is better than calling abort() later.
1942 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
1943 (struct node, struct graph):
1944 Rename member expand to stretch. All uses changed.
1945 (struct graph): Remove member layoutalgorithm. All uses removed.
1946 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
1947 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
1948 All uses changed.
1949 (N_STRETCH): Rename from N_EXPAND. All uses changed.
1950
19512004-12-15 Akim Demaille <akim@epita.fr>
1952
1953 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
1954 Add more Doxygen comments.
1955 (symprint_, stack_print_, reduce_print_, destruct_, pop)
1956 (report_syntax_error_, translate_): Rename as...
1957 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
1958 (yypop_, yyreport_syntax_error_, yytranslate_): this.
1959
19602004-12-15 Akim Demaille <akim@epita.fr>
1961
1962 * data/lalr1.cc (lex_): Rename as...
1963 (yylex_): this.
1964 Move the trace here.
1965 Take the %name-prefix into account.
1966 Reported by Alexandre Duret-Lutz.
1967
19682004-12-15 Akim Demaille <akim@epita.fr>
1969
1970 Simplify the C++ parser constructor.
1971
1972 * data/lalr1.cc (debug_): Rename as...
1973 (yydebug_): so that the parser's internals are always in the yy*
1974 pseudo namespace.
1975 Adjust uses.
1976 (b4_parse_param_decl): Remove the leading comma as it is now only
1977 called as unique argument list.
1978 (Parser::Parser): Remove the constructor accepting a location and
1979 an initial debugging level.
1980 Remove from the other ctor the argument for the debugging level.
1981 (debug_level_type, debug_level, set_debug_level): New.
1982
1983 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
1984 constructor calls.
1985
19862004-12-15 Akim Demaille <akim@epita.fr>
1987
1988 Remove b4_root related material: failure experiment
1989 (which goal was to allow to derive from a class).
1990
1991 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
1992 definitions and uses.
1993
19942004-12-14 Paul Eggert <eggert@cs.ucla.edu>
1995
1996 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
1997 not 2, since it's not portable to subtract 1 from the start of an
1998 array. The new item 0 is never set or used. All uses changed.
1999
2000 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
2001 the default definition of YYLLOC_DEFAULT. Problem reported
2002 by Frank Heckenbach.
2003
20042004-12-12 Paul Eggert <eggert@cs.ucla.edu>
2005
2006 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
2007 the normal case and one for the error case. Just use the
2008 first one uniformly. Problem reported by Frank Heckenbach.
2009 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
2010 use exactly the same macro in both places.
2011 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
2012 so that the normal-case YYRHSLOC works for the error case too.
2013 All uses changed.
2014 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
2015 (YYLLOC_DEFAULT): Use the same macro as glr.c.
2016 * doc/bison.texinfo (Location Default Action): Don't claim that
2017 we have an array of locations. Use the same macro for both glr
2018 and lalr parsers. Mention YYRHSLOC. Mention what happens when
2019 the index is 0.
2020
20212004-12-10 Paul Eggert <eggert@cs.ucla.edu>
2022
2023 * HACKING: Update email addresses to send announcements to.
2024
2025 * configure.ac (AC_INIT): Bump version to 1.875f.
2026
20272004-12-10 Paul Eggert <eggert@cs.ucla.edu>
2028
2029 * NEWS: Version 1.875e.
2030 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
2031
2032 * src/scan-skel.l: Include "complain.h", for "fatal".
2033
2034 * src/relation.h (relation_print, relation_digraph):
2035 Relation sizes are of type relation_node, not size_t (this is
2036 merely a doc fix, since the two types are equivalent).
2037 (relation_transpose): Relation sizes are of type relation_node,
2038 not int.
2039 * src/relation.c: Likewise.
2040 (top, infinity): Now of type relation_node, not int.
2041 (traverse, relation_transpose): Use relation_node, not int.
2042
2043 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
2044 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
2045 (yyparse): Remove unused local introduced in 2004-10-25 patch.
2046
2047 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
2048 specifying whether the test should be skipped. Use it tp
2049 specify that the [%defines %skeleton "lalr1.cc"] tests currently
2050 fail on some hosts, and should be skipped.
2051
20522004-12-08 Paul Eggert <eggert@cs.ucla.edu>
2053
2054 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
2055 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
2056 unless otherwise specified below.
2057
2058 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
2059 to allocate kernel_base, kernel_items, kernel_size, since
2060 they needn't be initialized to 0.
2061 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
2062 * src/closure.c (new_closure): Likewise, for itemset.
2063 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
2064 * src/lalr.c (set_goto_map): Likewise, for temp_map.
2065 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
2066 (build_relations): Likewise for edge, states1, includes.
2067 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
2068 * src/reader.c (packgram): Likewise, for ritem, rules.
2069 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
2070 * src/relation.c (relation_digraph): Likewise for VERTICES.
2071 (relation_transpose): Likewise for new_R, end_R.
2072 * src/symtab.c (symbols_token_translations_init): Likewise for
2073 token_translations.
2074 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
2075 (token_actions): Likewise for yydefact, actrow, conflrow,
2076 conflict_list.
2077 (save_column): Likewise for froms[symno], tos[symno].
2078 (goto_actions): Likewise for state_count.
2079 (pack_table): Likewise for base, pos, check.
2080 (tables_generate): Likewise for width.
2081
2082 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
2083 for initial core. Just have a separate core, so we needn't worry
2084 about whether kernel_size and kernel_base are initialized.
2085
2086 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
2087 kernel_size, kernel_items): Remove unnecessary initialization.
2088 * src/conflicts.c (conflicts): Likewise.
2089 * src/derives.c (derives): Likewise.
2090 * src/muscle_tablc (muscle_insert): Likewise.
2091 * src/relation.c (relation_digraph): Likewise.
2092 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
2093 conflrow, conflict_table, conflict_list, table, check):
2094 Likewise.
2095
2096 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
2097 This is because all callers pass unsigned int.
2098 * src/closure.h (new_closure): Likewise.
2099
2100 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
2101 (build_relations): Initialize includes[i] in all cases.
2102 * src/reader.c (packgram): Always initialize rules[ruleno].prec
2103 and rules[ruleno].precsym. Initialize members in order.
2104 * src/relation.c (relation_transpose): Always initialize new_R[i]
2105 and end_R[i].
2106 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
2107
2108 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
2109 conflict_list[0] was always 0, but now it isn't initialized.
2110
2111 * src/table.c (table_grow): When conflict_table grew, the grown
2112 area wasn't cleared. Fix this.
2113
2114 * lib/.cvsignore: Add strdup.c, strdup.h.
2115 * m4/.cvsignore: Add strdup.m4.
2116
21172004-12-07 Paul Eggert <eggert@cs.ucla.edu>
2118
2119 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
2120 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
2121 GOTO_NUMBER_MAXIMUM, since we occasionally compute
2122 ngotos + 1 without checking for overflow.
2123 (build_relations): Use END_NODE, not -1, to denote end of edges.
2124 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
2125 build_relations): Use goto_number, not int, for goto numbers.
2126 * src/tables.c (save_column, default_goto): Likewise.
2127
21282004-11-23 Akim Demaille <akim@epita.fr>
2129
2130 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
2131 of #defining from yystype.
2132 Don't typedef yystype, C++ does not need it.
2133 This lets it possible to forward declare it as union.
2134
21352004-11-23 Paul Eggert <eggert@cs.ucla.edu>
2136
2137 * bootstrap (gnulib_modules): Add extensions.
2138 Problem reported by Jim Meyering.
2139
21402004-11-22 Paul Eggert <eggert@cs.ucla.edu>
2141
2142 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
2143 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
2144 src/system.h, src/tables.c: XFREE -> free, to accommodate
2145 recent change to gnulib xalloc.h.
2146 Problem reported by Jim Meyering.
2147
21482004-11-17 Akim Demaille <akim@epita.fr>
2149
2150 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
2151
21522004-10-28 Akim Demaille <akim@epita.fr>,
2153 Alexandre Duret-Lutz <adl@gnu.org>
2154
2155 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
2156 changes.
2157 (YYCDEBUG): Adjust.
2158 Use it instead of cdebug_.
2159 (Parser::debug_stream, Parser::set_debug_stream): New.
2160 (Parser::symprint_): Define cdebug_ for temporary backward
2161 compatibility.
2162 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
2163 debug_stream ().
2164
21652004-11-17 Akim Demaille <akim@epita.fr>
2166
2167 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
2168 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
2169 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
2170 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
2171
21722004-10-27 Paul Eggert <eggert@cs.ucla.edu>
2173
2174 * data/glr.c (yyloc_default): Remove; not used.
2175 Problem reported by Frank Heckenbach.
2176
21772004-10-25 Akim Demaille <akim@epita.fr>
2178
2179 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
2180 Introduce another definition to address simple location arrays.
2181 (yyGLRStack): New member: yyerror_range.
2182 (yyrecoverSyntaxError, yyparse): Update it.
2183 (yyrecoverSyntaxError): Use it when shifting the error token to
2184 have an accurate range, equivalent to the one computed by both
2185 yacc.c and lalr1.cc.
2186 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
2187 that column numbers start at column 0, as per GNU Coding
2188 Standards, the others tests, and the doc.
2189 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
2190 Adjust to the above change (first column is 0).
2191 And adjust the location of the "<error>", now covering the whole
2192 line.
2193
21942004-10-22 Akim Demaille <akim@epita.fr>
2195 and Paul Eggert <eggert@cs.ucla.edu>
2196
2197 Remove some arbitrary limits on goto numbers and relations.
2198 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
2199 initial values, since they're never used.
2200 (set_goto_map): ngotos is now unsigned, so test for overflow
2201 by seeing whether it wraps around to zero.
2202 * src/lalr.h (goto_number): Now size_t, not short int.
2203 (GOTO_NUMBER_MAXIMUM): Remove.
2204 * src/relation.c (relation_print, traverse, relation_transpose):
2205 Check for END_NODE rather than looking at sign.
2206 * src/relation.h (END_NODE): New macro.
2207 (relation_node): Now size_t, not short int.
2208
22092004-10-22 Paul Eggert <eggert@cs.ucla.edu>
2210
2211 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
2212 keyword, not an identifier. Problem reported by Baron Schwartz in
2213 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
2214
22152004-10-11 Akim Demaille <akim@epita.fr>
2216
2217 * src/symtab.c (symbol_check_alias_consistency): Also check
2218 type names, destructors, and printers.
2219 Reported by Alexandre Duret-Lutz.
2220 Recode the handling of associativity and precedence in terms
2221 of symbol_precedence_set.
2222 Accept no redeclaration at all, not even equal to the previous
2223 value.
2224 (redeclaration): New.
2225 Use it to factor redeclaration complaints.
2226 (symbol_make_alias): Don't set the type of the alias, let
2227 symbol_check_alias_consistency do it as for other features.
2228 * src/symtab.h (symbol): Add new member prec_location, and
2229 type_location.
2230 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
2231 * tests/input.at (Incompatible Aliases): New.
2232
22332004-10-09 Paul Eggert <eggert@cs.ucla.edu>
2234
2235 .cvsignore fixes to accommodate gnulib changes,
2236 and the practice of naming build directories "_build".
2237 * .cvsignore: Add "_*". Sort.
2238 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
2239 * m4/.cvsignore: Add "*_gl.m4".
2240
22412004-10-06 Akim Demaille <akim@epita.fr>
2242
2243 * src/parse-gram.y (add_param): Fix the truncation of trailing
2244 spaces.
2245
22462004-10-05 Akim Demaille <akim@epita.fr>
2247
2248 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
2249 whether the reducion was empty or not. This leaves room to
2250 improve the use of YYLLOC_DEFAULT in such a case.
2251 lalr1.cc is still experimental, so changing this is acceptable.
2252 And finally, there are probably not many users who changed the
2253 handling of locations in GLR, so changing is admissible too.
2254
2255 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
2256 empty reduction, set @$ to an empty location ending the previously
2257 stacked symbol.
2258 Adjust uses to make sure the code is triggered on empty
2259 reductions.
2260 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
2261 expected output: empty reductions have empty locations.
2262
22632004-09-29 Akim Demaille <akim@epita.fr>
2264
2265 * data/lalr1.cc: Move towards a more standard C++ coding style
2266 for templates: Class < T > -> Class<T>.
2267
22682004-09-29 Akim Demaille <akim@epita.fr>
2269
2270 * data/lalr1.cc: Reinstall the former ctor, for sake of
2271 compatibility, but warn it will be removed.
2272 Move towards a more standard C++ coding style (i.e., type *var ->
2273 type* var).
2274
22752004-09-27 Paul Eggert <eggert@cs.ucla.edu>
2276
2277 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
2278 since it's less likely to work if NULs are involved in the future.
2279
22802004-09-27 Akim Demaille <akim@epita.fr>
2281
2282 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
2283
22842004-09-27 Akim Demaille <akim@epita.fr>
2285
2286 * data/lalr1.cc (b4_parse_param_decl_1): New.
2287 (b4_parse_param_decl): Use it to have different names between attribute
2288 and argument names.
2289 (b4_cc_constructor_call): Likewise.
2290
22912004-09-24 Akim Demaille <akim@epita.fr>
2292
2293 * src/parse-gram.y (add_param): Strip the leading and trailing
2294 blanks from a formal argument declaration.
2295 (YY_LOCATION_PRINT): New.
2296
22972004-09-24 Akim Demaille <akim@epita.fr>
2298
2299 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
2300 after the location.
2301
23022004-09-24 Akim Demaille <akim@epita.fr>
2303
2304 * doc/bison.texinfo (Table of Symbols): Sort.
2305
23062004-09-21 Akim Demaille <akim@epita.fr>
2307
2308 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
2309 the useless parentheses.
2310 Suggested by Paul Eggert.
2311
23122004-09-20 Akim Demaille <akim@epita.fr>
2313
2314 Let the initial-action act on the look-ahead, and use it for the
2315 "initial push" (corresponding to an hypothetical beginning-of-file).
2316 And let lalr1.cc honor %initial-action.
2317
2318 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
2319 example.
2320 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
2321 (Parser::Parser): Remove the ctor that used to initialize it.
2322 (Parser::parse): Like in the other skeletons, issue the "starting
2323 parse" message before any action.
2324 Honor %initial-action.
2325 Initialize the stacks with the lookahead.
2326 * data/yacc.c: Let $$ and @$ in %initial-action designate the
2327 look-ahead.
2328 Push them in the stacks.
2329 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
2330
23312004-09-20 Akim Demaille <akim@epita.fr>
2332
2333 * doc/bison.texinfo (Initial Action Decl): New.
2334
23352004-09-20 Akim Demaille <akim@epita.fr>
2336
2337 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
2338 clearer criterion to define it.
2339 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
2340 When reducing on an empty RHS, use the latest stacked location as
2341 location.
2342 yylloc is not always available.
2343 * data/glr.c: Likewise.
2344 Also, honor initial-actions.
2345
23462004-09-20 Akim Demaille <akim@epita.fr>
2347
2348 * data/yacc.c (YY_LOCATION_PRINT): New.
2349 Define when we know YYLTYPE's structure, i.e., when the default
2350 YYLLOC_DEFAULT is used.
2351 * data/c.m4 (b4_yysymprint_generate): Use it.
2352 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
2353 value of the result.
2354 (error_start_): Replace with...
2355 (error_range_): this location array.
2356 This allows to replace code relying on the implementation of
2357 locations by portable code.
2358 * data/yacc.c (yylerrsp): Replace with...
2359 (yyerror_range): this.
2360 Every time a token is popped, update yyerror_range[0], to have an
2361 accurate location for the error token.
2362 * data/glr.c (YY_LOCATION_PRINT): New.
2363 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
2364 deference a pointer.
2365 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
2366 report the location in %printers.
2367
2368 * src/scan-skel.l: Instead of abort, report error messages to ease
2369 understanding skeleton scanning failures.
2370
23712004-09-16 Akim Demaille <akim@epita.fr>
2372
2373 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
2374 (iterator, const_iterator): these, to be more in the C++ spirit.
2375 Also, return reverse iterators so that when displaying the stack
2376 we display its bottom first.
2377 (Parser::stack_print_, Parser::reduce_print_): Match the messages
2378 from yacc.c.
2379 We should probably use vector here though.
2380
23812004-09-16 Akim Demaille <akim@epita.fr>
2382
2383 Have more complete shift traces.
2384
2385 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
2386 to report Shifts instead of ad hoc YYDPRINTF invocations,
2387 including for the error token.
2388 * data/lalr1.cc (symprint_): Output the location.
2389 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
2390 output the location within the %printer.
2391 Activate GLR tests, at least to make sure they compile properly.
2392 They still don't pass though.
2393 * tests/calc.at: Adjust expect verbose output, since now "Entering
2394 state..." is on a different line than the "Shifting" message.
2395
23962004-09-08 Akim Demaille <akim@epita.fr>
2397
2398 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
2399 Bison directive from the Bison file to the invocation of this
2400 macro, so that these directives are passed to
2401 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
2402 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
2403 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
2404 the extra Bison directives instead of the whole series.
2405 Change the grammar so that there are recoverable errors, and
2406 unrecoverable errors. Now we can have the parser give up before
2407 consuming the whole input. As a result we now can observe that
2408 the lookahead is freed when needed.
2409 Change the parser source to parse argv[1] instead of a hard coded
2410 string.
2411 Simplify yylex, and give a value and location to EOF.
2412 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
2413 passed directives already coded in the file.
2414 Add some tests to check the location of "error".
2415 For some tests, the C++ parser is correct, and not yacc.c.
2416 For other tests, they provide different, but unsatisfying, values,
2417 so keep the C++ value so that at least one parser is "correct"
2418 according to the test suite.
2419 (Actions after errors): Remove, this is subsumed by the
2420 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
2421
24222004-09-06 Akim Demaille <akim@epita.fr>
2423
2424 * data/lalr1.cc: Adjust the indentation of the labels.
2425 (Parser::pop): New.
2426 Use it.
2427
24282004-09-06 Akim Demaille <akim@epita.fr>
2429
2430 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
2431 argument, an informative message.
2432 Call YY_SYMBOL_PRINT.
2433 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
2434 * data/lalr1.cc (destruct_): Likewise.
2435 In addition, no longer depend on b4_yysymprint_generate and
2436 b4_yydestruct_generate to generate these functions, do it "by
2437 hand".
2438
24392004-09-03 Akim Demaille <akim@epita.fr>
2440
2441 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
2442 invoked, yydestruct the lookahead.
2443 * tests/calc.at (Calculator $1): Update the expected lengths of
2444 traces: there is an added line for the discarded lookahead.
2445 * doc/bison.texinfo (Destructor Decl): Some rewording.
2446 Define "discarded" symbols.
2447
24482004-09-02 Akim Demaille <akim@epita.fr>
2449
2450 * data/lalr1.cc (translate_, destruct_): No reason to be static.
2451
24522004-09-02 Akim Demaille <akim@epita.fr>
2453
2454 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
2455 (YYDSYMPRINTF): Rename as...
2456 (YY_SYMBOL_PRINT): this.
2457 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
2458 two.
2459 Use it instead of direct symprint_ calls.
2460 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
2461 one.
2462
24632004-09-02 Akim Demaille <akim@epita.fr>
2464
2465 * data/lalr1.cc (b4_yysymprint_generate): New.
2466 (symprint_): New member function, defined when YYDEBUG.
2467 Use it consistently instead of token/nterm debugging output by
2468 hand.
2469 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
2470 %printer calls to use cdebug_ when using lalr1.cc.
2471
24722004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
2473
2474 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
2475 with #ifdef YYDEBUG.
2476
24772004-08-26 Akim Demaille <akim@epita.fr>
2478
2479 * doc/bison.texinfo (Implementing Loops): Rename as...
2480 (Implementing Gotos/Loops): this.
2481
24822004-08-13 Paul Eggert <eggert@cs.ucla.edu>
2483
2484 Adjust to latest gnulib.
2485 * bootstrap (gnulib_modules): Add xalloc-die.
2486 Set LC_ALL=C so that file names sort consistently.
2487 Prefer the gnulib copies of gettext.m4, glibc21.m4,
2488 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
2489 uintmax_t.m4, ulonglong.m4.
2490 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
2491 po.m4 since we are now using _gl.m4 instead.
2492
24932004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
2494
2495 * src/scan-action.l: Remove. Scanning of semantic actions is
2496 handled in scan-gram.l.
2497
24982004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
2499
2500 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
2501
2502 * src/location.h (struct): The file member is a uniqstr.
2503 (equal_boundaries): Use UNIQSTR_EQ for comparison.
2504
25052004-07-22 Paul Eggert <eggert@cs.ucla.edu>
2506
2507 Fix bug with non-%union parsers that have printers or destructors,
2508 which led to a Bison core dump. Reported by Peter Fales in
2509 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2510
2511 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
2512 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
2513 not to our own type.
2514 * src/output.c (symbol_destructors_output, symbol_printers_output):
2515 Don't assume %union.
2516 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
2517 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
2518 UNION-FLAG. All callers changed.
2519 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
2520 Use type char, not unsigned int, when declaring an array of char;
2521 this lets us remove a cast.
2522 (Printers and Destructors): Add non-%union test cases.
2523
25242004-06-21 Paul Eggert <eggert@cs.ucla.edu>
2525
2526 * doc/bison.texinfo: Minor editorial changes, mostly to the new
2527 GLR writeups. E.g., avoid frenchspacing and the future tense,
2528 change "lookahead" to "look-ahead", and change "wrt" to "with
2529 respect to".
2530
25312004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
2532
2533 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
2534 New sections, split off from the GLR Parsers section. Put the new
2535 Simple GLR Parser near the start of the GLR section, for clarity.
2536 Rewrite connective text.
2537
25382004-06-21 Frank Heckenbach <frank@g-n-u.de>
2539
2540 * doc/bison.texinfo (Simple GLR Parsers): New section.
2541
25422004-06-21 Paul Eggert <eggert@cs.ucla.edu>
2543
2544 * NEWS, TODO, doc/bison.texinfo:
2545 Use "look-ahead" instead of "lookahead", to be consistent.
2546 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
2547 while we're fixing "look-ahead".
2548 * src/conflicts.c (shift_set): Renamed from shiftset.
2549 (look_ahead_set): Renamed from lookaheadset.
2550 * src/print.c: Likewise.
2551 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
2552 name for "lookahead".
2553 (report_types, usage): Likewise.
2554 * src/getargs.h (report_look_ahead_tokens): Renamed from
2555 report_lookaheads.
2556 * src/lalr.c (compute_look_ahead_tokens): Renamed from
2557 compute_lookaheads.
2558 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
2559 (look_ahead_tokens_print): Renamed from lookaheads_print.
2560 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
2561 state_rule_lookaheads_print.
2562 * src/state.h: Likewise.
2563 (reductions.look_ahead_tokens): Renamed from lookaheads.
2564 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
2565 AT_DATA_LOOKAHEADS_GRAMMAR.
2566
25672004-06-03 Paul Eggert <eggert@cs.ucla.edu>
2568
2569 * README: Update location of patched M4 distribution.
2570
25712004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
2572
2573 Don't assume the C++ compiler takes the same arguments as the C compiler
2574 (trivial change).
2575 * configure.ac (O0CXXFLAGS): New var.
2576 * tests/atlocal.in (CXXFLAGS): Use it.
2577
25782004-05-29 Paul Eggert <eggert@cs.ucla.edu>
2579
2580 Fix some "make check" problems with C++ reported by
2581 Albert Chin-A-Young for Tru64 C++ in this thread:
2582 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
2583
2584 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
2585 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
2586 Output to a .cc file for C++, not to a .c file.
2587 * tests/calc.at (AT_CHECK_CALC): Likewise.
2588 * tests/regression.at (AT_CHECK_DANCER): Likewise.
2589 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
2590
25912004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
2592
2593 * tests/calc.at, tests/actions.at: Workaround for SGI
2594 C++ compiler. (trivial change)
2595
25962004-05-27 Paul Eggert <eggert@cs.ucla.edu>
2597
2598 Spent a few hours checking out which prerequisite versions the
2599 current sources actually require. I went all the way back to
2600 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
2601 a seemingly endless set of combinations of versions more recent
2602 than that. The bottom line is that the current sources require
2603 fairly recent versions of the build tools, and it'll be some work
2604 to change this.
2605 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
2606 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
2607 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
2608 Add comments explaining why those particular versions are
2609 currently needed.
2610
2611 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
2612 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
2613 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
2614
2615 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
2616 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
2617
26182004-05-26 Paul Eggert <eggert@cs.ucla.edu>
2619
2620 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
2621 0.11.5. Suggested by Bruno Haible.
2622 * bootstrap: Remove gettext version checking.
2623
2624 * doc/bison.texinfo (Decl Summary): Also mention that %union
2625 can depend on prerequisite types. Problem reported by Tim
2626 Van Holder.
2627
26282004-05-25 Paul Eggert <eggert@cs.ucla.edu>
2629
2630 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
2631 * README-alpha: Don't tell people not to package this.
2632
2633 * bootstrap: Don't assume $(...) works; use `...` instead.
2634 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
2635 gettext better.
2636
2637 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
2638 put into the -d output file, and mention what to do if YYSTYPE is
2639 defined as a macro.
2640
26412004-05-24 Paul Eggert <eggert@cs.ucla.edu>
2642
2643 Undo change made earlier today: it caused autopoint to not bring
2644 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
2645 autopoint's.
2646
2647 * bootstrap: Check that gettext version matches what's in
2648 configure.ac. Warn users to ignore robots.txt ERROR 404.
2649 * bootstrap: Undo today's earlier change (logged below).
2650 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
2651
2652 The gettext version checking is causing more trouble than it's
2653 curing; remove it. Problem reported by Paul Hilfinger.
2654
2655 * bootstrap: Issue a warning that one can expect a message
2656 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
2657 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
2658
26592004-05-23 Paul Eggert <eggert@cs.ucla.edu>
2660
2661 Ensure that the C++ compiler used for testing actually works on a
2662 simple test program; if not, skip the C++-related tests. Problem
2663 reported by Vin Shelton in:
2664 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
2665
2666 * m4/cxx.m4: New file.
2667 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
2668 * tests/atlocal.in (BISON_CXX_WORKS): Add.
2669 * tests/local.at (AT_COMPILE_CXX): Use it.
2670
26712004-05-21 Paul Eggert <eggert@cs.ucla.edu>
2672
2673 * data/glr.c (yylloc): Output this macro even if locations are not
2674 being generated, as the GLR parser needs it even in that case.
2675 Problem reported by Troy A. Johnson
2676 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
2677
2678 * configure.ac (AC_INIT): Update to 1.875e.
2679
26802004-05-21 Paul Eggert <eggert@cs.ucla.edu>
2681
2682 * NEWS: Version 1.875d.
2683 * configure.ac (AC_INIT): Likewise.
2684 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
2685
2686 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
2687 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
2688 lalr1.cc runs afoul of the first, and the last two are no longer
2689 supported by GCC 3.4.0.
2690 * README: Mention GNU m4 1.4 or later; mention m4 patches.
2691 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
2692
26932004-05-06 Paul Eggert <eggert@cs.ucla.edu>
2694
2695 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
2696 unsigned int, for compatibility with latest gnulib hash module.
2697 * src/state.c (state_hash, state_hasher): Likewise.
2698 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
2699 * src/uniqstr.c (hash_uniqstr): Likewise.
2700
27012004-05-03 Paul Eggert <eggert@cs.ucla.edu>
2702
2703 * NEWS: Unescaped newlines are no longer allowed in char & strings.
2704
2705 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
2706 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
2707 character and string literals.
2708 (unexpected_end): New function.
2709 (unexpected_eof): Use it.
2710 (unexpected_newline): New function.
2711 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
2712 actions.
2713
2714 * NEWS: Document %expect-rr.
2715
2716 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
2717 Fix typo by replacing $1 with $option.
2718 Remove more 'intl'-related files.
2719 Don't DEFUN AM_INTL_SUBDIR twice.
2720
2721 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
2722 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
2723 strtoul.c.
2724 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
2725 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
2726 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
2727 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
2728 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
2729 * src/.cvsignore: Add *.output.
2730
2731 * src/parse-gram.y: Put copyright notice inside %{ %} so it
2732 gets copied to the output file.
2733
27342004-04-28 Paul Eggert <eggert@twinsun.com>
2735
2736 Get files from the gnulib and po repositories, instead of relying
2737 on them being in our CVS. Upgrade to latest versions of gnulib
2738 and Automake.
2739
2740 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
2741 * bootstrap: Bootstrap from gnulib and po repositories.
2742 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
2743 * README-cvs: Document these changes. Remove version numbers from
2744 mentions of build tools, since they change so often. Mention Flex.
2745
2746 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
2747 (gl_USE_SYSTEM_EXTENSIONS): Add.
2748 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
2749 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
2750 does this for us.
2751 (AC_ISC_POSIX): Remove; we no longer support this
2752 ancient OS, as it gets in the way of latest Autoconf & gnulib.
2753 (AC_HEADER_STDC): Remove: we now assume C89 or better.
2754 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
2755 Do not check for C89 headers, except for locale.h which is used
2756 by the Yacc library and must port to K&R hosts.
2757 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
2758 Do not check for C89 functions, except for setlocale which is
2759 used by the Yacc library.
2760 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
2761 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
2762 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
2763 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
2764 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
2765 AM_GNU_GETTEXT): Remove; now done by:
2766 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
2767 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
2768 for us.
2769
2770 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
2771 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
2772 Define to empty, as gnulib.mk will do the rest for us.
2773 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
2774 for us.
2775 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
2776 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
2777
2778 * src/files.c: Include gnulib's xstrndup.h.
2779
2780 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
2781 (REALLOC): Use xnrealloc, for likewise.
2782 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
2783 (strnlen, memrchr): Remove decls; functions no longer used.
2784 Include <stpcpy.h>.
2785
2786 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
2787 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
2788 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
2789 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
2790 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
2791 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
2792 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
2793 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
2794 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
2795 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
2796 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
2797 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
2798 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
2799 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
2800 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
2801 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
2802 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
2803 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
2804 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
2805 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
2806 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
2807 Remove, as these files are now generated automatically
2808 by bootstrap or automake.
2809
2810 * po/ChangeLog: Remove: all but one entry was a duplicate
2811 of this file, and I moved that 2000-11-02 entry here.
2812
2813 * config/.cvsignore: Add Makefile, depcomp, install-sh.
2814 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
2815 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
2816 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
2817 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
2818 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
2819 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
2820 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
2821 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
2822 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
2823 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
2824 xstrndup.h.
2825 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
2826 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
2827 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
2828 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
2829 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
2830 * src/.cvsignore: Remove *_.c.
2831
2832
2833 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
2834 support it. (The latest stable gzip doesn't.)
2835
28362004-04-27 Paul Eggert <eggert@twinsun.com>
2837
2838 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
2839 case, as stos_ is now used by destructors due to the 2004-02-09
2840 change.
2841
2842 Remove more K&R C support.
2843 * lib/libiberty.y (PARAMS): Remove. All uses removed.
2844 * lib/subpipe.c (errno): Remove decl.
2845 Include <stdlib.h> unconditionally.
2846 (EXIT_FAILURE): Remove macro.
2847 * src/complain.c (vfprintf, strerror): Remove.
2848 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
2849 unconditionally.
2850 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
2851 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
2852 (strchr, strspn, memchr): Remove decls.
2853 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
2854 unconditionally. Do not declare perror.
2855 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
2856 unconditionally.
2857
2858 * src/complain.c (_): Remove useless defn, as system.h defines this.
2859
2860 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
2861 with latest obstack.h.
2862 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
2863 to procedure types, as obstack.h now does that for us.
2864 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
2865
2866 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
2867 so that this include file can stand alone.
2868 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
2869 does this now. Include subpipe.h first after config.h, to
2870 test whether it can stand alone.
2871
2872 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
2873 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
2874 unused declaration.
2875
2876 * tests/synclines.at (%union synch line): Put a dummy member in
2877 the union, because empty unions aren't allowed in C. Caught
2878 by GCC 3.4.0.
2879
28802004-04-13 Jim Meyering <jim@meyering.net>
2881
2882 * src/conflicts.c (conflicts_print): Correct format string typo:
2883 use `%%' to produce literal `%'. (trivial change)
2884
28852004-03-30 Paul Eggert <eggert@twinsun.com>
2886
2887 * src/getargs.c (version): Update copyright year to 2004.
2888
2889 * data/c.m4 (b4_int_type): Use 'short int' rather than
2890 'short', and similarly for 'long', 'unsigned', etc.
2891 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
2892 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
2893 yy_yypstack, yydumpstack): Likewise.
2894 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
2895 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
2896 Likewise.
2897 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
2898 yy_stack_print, yyparse): Likewise.
2899 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
2900 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
2901 * lib/bitset.c (bitset_print): Likewise.
2902 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
2903 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
2904 * lib/bitsetv.c (bitsetv_dump): Likewise.
2905 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
2906 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
2907 Likewise.
2908 * src/LR0.c (allocate_itemsets): Likewise.
2909 * src/gram.h (rule_number, rule): Likewise.
2910 * src/lalr.h (goto_number): Likewise.
2911 * src/nullable.c (nullable_compute): Likewise.
2912 * src/output.c (prepare_rules): Likewise.
2913 * src/relation.c (relation_print, relation_digraph): Likewise.
2914 * src/relation.h (relation_node): Likewise.
2915 * src/state.h (state_number, transitions, errs, reductions,
2916 struct state): Likewise.
2917 * src/symtab.h (symbol_number, struct symbol): Likewise.
2918 * src/tables.c (vector_number, tally, action_number,
2919 default_goto, goto_actions): Likewise.
2920 * tests/existing.at (GNU Cim Grammar): Likewise.
2921 * tests/regression.at (Web2c Actions): Likewise.
2922
2923 * src/output.c (muscle_insert_short_int_table): Renamed from
2924 muscle_insert_short_table. All uses changed.
2925
29262004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2927
2928 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
2929 (declaration): Replace expected_conflicts with expected_sr_conflicts.
2930 Add %expect-rr rule.
2931
2932 * src/scan-gram.l: Recognize %expect-rr.
2933
2934 * src/conflicts.h (expected_sr_conflicts): Rename from
2935 expected_conflicts.
2936 (expected_rr_conflicts): Declare.
2937
2938 * src/conflicts.c (expected_sr_conflicts): Rename from
2939 expected_conflicts.
2940 (expected_rr_conflicts): Define.
2941 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
2942 for GLR parsers.
2943 Use expected_sr_conflicts in place of expected_conflicts.
2944 Warn if expected_rr_conflicts used in non-GLR parser.
2945
2946 * doc/bison.texinfo: Add documentation for %expect-rr.
2947
29482004-03-08 Paul Eggert <eggert@gnu.org>
2949
2950 Add support for hex token numbers. Suggested by Odd Arild Olsen in
2951 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
2952
2953 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
2954 in lalr1.cc.
2955 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
2956 * src/scan-gram.l (scan_integer): New function.
2957 ({int}): Use it.
2958 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
2959 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
2960 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
2961 Say "long int", not "long", for uniformity with GNU style.
2962
29632004-02-25 Paul Eggert <eggert@twinsun.com>
2964
2965 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
2966 compilers. This fixes a problem with Intel's C++ compiler being
2967 chatty, reported by Guido Trentalancia in
2968 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
2969
29702004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
2971
2972 Support %destructor and merge error locations in lalr1.cc.
2973
2974 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
2975 (Parser::stos_): Define unconditionally.
2976 (Parser::destruct_): New method. Generate its body with
2977 b4_yydestruct_generate.
2978 (Parser::error_start_): New attribute.
2979 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
2980 token which are discarded.
2981 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
2982 error_start_ when erroneous token are discarded.
2983 (Parser::parse) <yyerrlab1>: Compute the location of the error
2984 token so that it covers all the discarded tokens.
2985 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
2986 it can be called with `%skeleton "lalr1.cc"', and do that.
2987
29882004-02-02 Paul Eggert <eggert@twinsun.com>
2989
2990 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
2991 $(top_srcdir)/lib and ../lib. This fixes a bug reported
2992 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
2993 There's no need to mention top_builddir since Automake does that
2994 for us.
2995 (INCLUDES): Remove, as Automake says it's obsolescent.
2996 Contents migrated into AM_CPPFLAGS as described above.
2997 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
2998
29992004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
3000
3001 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
3002 (yyreportSyntaxError): Handle case where lookahead token is
3003 YYEMPTY.
3004
30052004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3006
3007 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
3008 resulting parsers are compilable with C++.
3009
30102003-12-23 Paul Eggert <eggert@twinsun.com>
3011
3012 * config/depcomp, config/install-sh: Sync with Automake 1.8.
3013 * src/output.c (output_skeleton): Rename local var.
3014 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
3015 Bison tokens, as this runs afoul of the 2003-10-07 change that
3016 disallowed NUL bytes in character constants or string literals.
3017
3018 * tests/local.at: Require Autoconf 2.59's Autotest.
3019 * tests/testsuite.at: Don't include local.at, since we now assume
3020 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
3021 including it.
3022 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
3023 multiple inclusion warnings.
3024
30252003-12-02 Akim Demaille <akim@epita.fr>
3026
3027 * doc/bison.texinfo (How Can I Reset the Parser): More about start
3028 conditions.
3029 From Bruno Haible.
3030
30312003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
3032
3033 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
3034
30352003-10-07 Paul Eggert <eggert@twinsun.com>
3036
3037 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
3038 if testsuite doesn't exist.
3039
3040 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
3041 literals, unfortunately.
3042 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
3043 Complain about NUL bytes in character constants or string literals.
3044
30452003-10-05 Paul Eggert <eggert@twinsun.com>
3046
3047 * NEWS: Don't document %no-default-prec, as it's still
3048 too experimental.
3049 * doc/bison.texinfo: Document %no-default-prec only if
3050 the defaultprec flag is set. Normally it's not.
3051
30522003-10-04 Paul Eggert <eggert@twinsun.com>
3053
3054 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
3055 non-modifiable lvalue, instead of a modifiable one.
3056 * doc/bison.texinfo (Actions): Document that $$ can
3057 be assigned to. Do not claim that $$ and $N are
3058 array element references: user code should not rely on this.
3059
30602003-10-01 Paul Eggert <eggert@twinsun.com>
3061
3062 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
3063 (grammar_declaration): Use it.
3064 * src/scan-gram.l: New token %no-default-prec.
3065 * tests/conflicts.at: Revamp tests to use %no-default-prec.
3066 * NEWS, doc/bison.texinfo: Document the above.
3067
30682003-10-01 Akim Demaille <akim@epita.fr>
3069
3070 VCG no longer supports long_straight_phase.
3071
3072 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
3073 * src/print_graph.c (print_graph): Adjust.
3074
30752003-09-30 Frank Heckenbach <frank@g-n-u.de>
3076 and Paul Eggert <eggert@twinsun.com>
3077
3078 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
3079 Table of Symbols): Document %default-prec.
3080 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
3081 (grammar_declaration): Set default_prec on %default-prec.
3082 * src/scan-gram.l (%default-prec): New token.
3083 * src/reader.h (default_prec): New flag.
3084 * src/reader.c: Likewise.
3085 (packgram): Handle it.
3086 * tests/conflicts.at (%default-prec without %prec,
3087 %default-prec with %prec, %default-prec 1): New tests.
3088
30892003-09-30 Paul Eggert <eggert@twinsun.com>
3090
3091 * tests/testsuite.at: Include local.at, not input.at, fixing
3092 a typo in the 2003-08-25 patch.
3093
30942003-08-27 Akim Demaille <akim@epita.fr>
3095
3096 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
3097 GCC warnings.
3098
30992003-08-26 Akim Demaille <akim@epita.fr>
3100
3101 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
3102 "<\#" to avoid magic from Gnus when posting parts of this script.
3103
31042003-08-26 Akim Demaille <akim@epita.fr>
3105
3106 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
3107 (Parser::parse): here.
3108 Adjust: nerrs and errstatus is now replaced by...
3109 (Parser::nerrs_, Parser::errstatus_): New.
3110
31112003-08-25 Akim Demaille <akim@epita.fr>
3112
3113 * config/announce-gen, Makefile.cfg: New.
3114 * Makefile.am: Adjust.
3115 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
3116 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
3117
31182003-08-25 Akim Demaille <akim@epita.fr>
3119
3120 When reducing initial empty rules, Bison parser read an initial
3121 location that is not defined. This results in garbage, and that
3122 affects Bison's own parser. Therefore we need (i) to extend Bison
3123 to support a means to initialize this location, and (ii) to use
3124 this CVS Bison to fix CVS Bison's parser.
3125
3126 * src/reader.h, reader.c (epilogue_augment): Remove, replace
3127 with...
3128 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
3129 * src/parse-gram.y: Adjust.
3130 (%initial-action): New.
3131 (%error-verbose): Since we require CVS Bison, there is no reason
3132 not to use it.
3133 * src/scan-gram.l: Adjust.
3134 * src/Makefile.am (YACC): New, to make sure we use our own parser.
3135 * data/yacc.c (yyparse): Use b4_initial_action.
3136
31372003-08-25 Akim Demaille <akim@epita.fr>
3138
3139 * doc/bison.texinfo: Don't promote stdout for error messages.
3140
31412003-08-25 Akim Demaille <akim@epita.fr>
3142
3143 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
3144 From Alexandre Duret-Lutz.
3145
31462003-08-25 Akim Demaille <akim@epita.fr>
3147
3148 Version 1.875c.
3149
31502003-08-25 Akim Demaille <akim@epita.fr>
3151
3152 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
3153 Use them.
3154
31552003-08-25 Akim Demaille <akim@epita.fr>
3156
3157 * data/lalr1.cc (Parser::reduce_print_): New.
3158 Use it.
3159
31602003-08-25 Akim Demaille <akim@epita.fr>
3161
3162 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
3163 error recovery loops. This patch is based on
3164 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
3165 Also, augment the similarity between lalr1.cc and yacc.c.
3166 Note: the locations of error recovery rules are not correct yet.
3167
3168 * data/lalr1.cc: Comment changes to augment the similarity between
3169 lalr1.cc and yacc.c.
3170 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
3171 (yyerrlab1): Remove, but where it used to be (now the bottom part of
3172 yyerrlab), when hitting EOF, pop the whole stack here instead of
3173 merely falling thru the default error handling mechanism.
3174 (yyerrorlab): New label, with the old contents of YYERROR,
3175 plus the following change: pop the stack of rhs corresponding
3176 to the production that invoked YYERROR. That is how Yacc
3177 behaves (required by POSIX).
3178 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
3179 fail.
3180
31812003-08-25 Akim Demaille <akim@epita.fr>
3182
3183 Tune local.at so that people can "autom4te -l autotest calc.at -o
3184 calc" for instance, to extract a sub test suite.
3185
3186 * tests/testsuite.at: Move the initialization, Autotest version
3187 requirement, and AT_TESTED invocation into...
3188 * tests/local.at: here.
3189 * tests/testsuite.at: Include it for compatibility with Autoconf
3190 2.57.
3191 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
3192 be ignore.
3193
31942003-08-04 Paul Eggert <eggert@twinsun.com>
3195
3196 Rework code slightly to avoid gcc -Wtraditional warnings.
3197 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
3198 The returned value is now stored in *YY0. All callers changed.
3199 * src/output.c (merge_output): Adjust to the above change.
3200
32012003-07-26 Paul Eggert <eggert@twinsun.com>
3202
3203 * data/glr.c (YYASSERT): New macro.
3204 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
3205 yyresolveStates, yyprocessOneStack):
3206 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
3207 Derived from a suggestion by Frank Heckenbach.
3208
32092003-07-25 Paul Eggert <eggert@twinsun.com>
3210
3211 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
3212 for portability to K&R C (after ansi2knr, presumably). See
3213 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
3214 by Frank Heckenbach, though I have omitted the structure-initialization
3215 part of his glr-knr.diff patch since I recall that the Portable
3216 C Compiler didn't require that change.
3217
3218 Let the user specify how to allocate and free memory.
3219 Derived from a suggestion by Frank Heckenbach in
3220 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
3221 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
3222 All uses of free, malloc, realloc changed to use these macros,
3223 and unnecessary casts removed.
3224 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
3225
32262003-07-06 Matthias Mann <MatthiasMann@gmx.de>
3227
3228 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
3229 use s.empty() rather than s == "" to test for empty string; see
3230 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
3231 (trivial change)
3232
32332003-06-25 Akim Demaille <akim@epita.fr>
3234
3235 * config/depcomp, config/install-sh: Update from masters.
3236
32372003-06-20 Paul Eggert <eggert@twinsun.com>
3238
3239 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
3240 and return properly parenthesized result.
3241 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
3242 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
3243 Remove unnecessary parentheses from uses.
3244 * doc/bison.texinfo (Location Default Action): Describe the
3245 conventions for parentheses.
3246
32472003-06-19 Paul Eggert <eggert@twinsun.com>
3248
3249 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
3250 yyreportTree): Do not assume that size_t is the same width as int,
3251 when printing sizes. Print sizes using an unsigned format.
3252 Problem reported by Frank Heckenbach in
3253 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
3254
3255 Port to Forte Developer 7 C compiler.
3256 * data/glr.c (struct YYLTYPE): If locations are not being used,
3257 declare a single dummy member, as empty structs do not conform
3258 to the C standard.
3259 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
3260 the Forte Developer 7 C compiler complains that end-of-loop
3261 code is not reached.
3262
32632003-06-17 Paul Eggert <eggert@twinsun.com>
3264
3265 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
3266 avoid warnings from picky compilers about redefinition of PARAMS.
3267
32682003-06-17 Paul Eggert <eggert@twinsun.com>
3269
3270 Version 1.875b.
3271
3272 * NEWS: Document 1.875b.
3273
3274 * lib/bbitset.h: Do not include config.h; that's the includer's job.
3275 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
3276 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
3277 Don't use 'index' in comments, as it's a builtin fn on some hosts.
3278 * lib/bitset_stats.c: Include gettext.h unconditionally, as
3279 per recent gettext manual's suggestion.
3280 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
3281 Use prototypes, not old-style definitions.
3282 * lib/lbitset.c (lbitset_unused_clear): Likewise.
3283 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
3284 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
3285 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
3286 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
3287 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
3288 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
3289 vbitset_or_and_cmp, vbitset_copy): Likewise.
3290
3291 * lib/libiberty.h: Do not include config.h; that's the includer's job.
3292 Do not include <stdlib.h>.
3293 (PARAMS): Define unconditionally for C89.
3294 (ATTRIBUTE_NORETURN): Remove.
3295 (ATTRIBUTE_UNUSED): Define unconditionally.
3296
3297 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
3298 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
3299 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
3300 * lib/vbitset.c, lib/vbitset.h: New files.
3301 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
3302 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
3303 from libbitset.
3304
3305 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
3306 `How Can I Reset @code{yyparse}', since texinfo does not allow
3307 arbitrary @ in node names.
3308
3309 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
3310 shouldn't be needed according to the gettext 0.12.1 documentation
3311 but which seem to be needed anyway: codeset.m4 glibc21.m4
3312 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
3313 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
3314 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
3315
3316 * lib/.cvsignore: Add stdbool.h.
3317 * m4/.cvsignore: Add nls.m4, po.m4.
3318
3319 Upgrade to CVS gnulib.
3320 * stdbool_.h: File renamed from stdbool.h.in.
3321 * configure.ac (AM_STDBOOL_H): Invoke this instead of
3322 AC_HEADER_STDBOOL.
3323 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
3324 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
3325 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
3326 (MOSTLYCLEANFILES): New var.
3327 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
3328 (stdbool.h): New rule.
3329 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
3330 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
3331 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
3332 m4/quote.m4: Upgrade to today's gnulib.
3333
3334 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
3335 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
3336 the tests right now.
3337 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
3338 yyerror are declared before use; C99 requires this.
3339
33402003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3341
3342 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
3343 first.
3344 (yyrecoverSyntaxError): Correct the logic for setting and testing
3345 yyerrState.
3346 Correct comment on handling EOF.
3347 Allow states with only a default reduction, rather than failing
3348 (I can't quite reconstruct why these were not allowed before).
3349
3350 Fixes to avoid problem that $-N rules in GLR parsers can cause
3351 buffer overruns, corrupting state.
3352
3353 * src/output.c (prepare_rules): Output max_left_semantic_context
3354 definition.
3355 * src/reader.h (max_left_semantic_context): New variable declaration.
3356 * src/scan-gram.l (max_left_semantic_context): Define.
3357 (handle_action_dollar): Update max_left_semantic_context.
3358 * data/glr.c (YYMAXLEFT): New definition.
3359 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
3360 (yyresolveAction): Ditto.
3361
3362 Fixes to problems with location handling in GLR parsers reported by
3363 Frank Heckenbach (2003/06/05).
3364
3365 * data/glr.c (YYLTYPE): Make trivial if locations not used.
3366 (YYRHSLOC): Add parentheses, and define only if locations used.
3367 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
3368 locations not used.
3369 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
3370 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
3371
3372 * tests/cxx-type.at: Exercise location information; update tests
3373 to differentiate output with and without locations.
3374 Remove forward declarations of yylex and yyerror---caused errors
3375 because default YYLTYPE not yet defined.
3376 Change semantic actions to compute strings, rather than printing
3377 them directly (to test proper passing of semantics values). Change
3378 output to prefix notation and update test data and expected results.
3379 (yylex): Track locations.
3380 (stmtMerge): Return value rather than printing, and include arguments
3381 in value.
3382
33832003-06-03 Paul Eggert <eggert@twinsun.com>
3384
3385 Avoid warnings generated by GCC 2.95.4 when Bison is
3386 configured with --enable-gcc-warnings.
3387 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
3388 yy::]b4_parser_class_name[::translate_,
3389 yy::Stack::operator[] (unsigned),
3390 yy::Stack::operator[] (unsigned) const,
3391 yy::Slice::operator[] (unsigned),
3392 yy::Slice::operator[] (unsigned) const):
3393 Rename local vars to avoid warnings.
3394 * tests/glr-regression.at (Improper handling of embedded actions
3395 and $-N in GLR parsers): Remove unused local variable from yylex.
3396 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
3397 (void) as arg when not pure, since we now assume C89 when building
3398 Bison. Pacify GCC by using parameter.
3399
34002003-06-02 Paul Eggert <eggert@twinsun.com>
3401
3402 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
3403 yy::Location::lines, yy::Location::columns): Rename arguments
3404 to avoid shadowing; this removes a warning generated by GCC 3.3.
3405
34062003-06-01 Paul Eggert <eggert@twinsun.com>
3407
3408 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
3409 to g++, as GCC 3.3 complains if you do it.
3410 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
3411 everything that WARNING_CFLAGS has, except omit warnings
3412 not suitable for C++.
3413 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
3414 * tests/atlocal.in (CXXFLAGS): New var.
3415 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
3416
3417 Fix a GLR parser bug I reported in February; see
3418 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
3419 The problem was that GLR parsers did not conform to the C standard,
3420 because actions like { $1 = $2 + $3; } expanded to expressions
3421 that invoked YYFILL in separate subexpressions, and YYFILL assigned
3422 to a local variable. The C standard says that expressions
3423 like (var = f ()) + (var = f ()) have undefined behavior.
3424 Another problem was that GCC sometimes issues warnings that
3425 yyfill and its parameters are unused.
3426
3427 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
3428 as possibly unused.
3429 (yyfill): New function.
3430 (YYFILL): Use it.
3431 (yyuserAction): Change type of yynormal to bool, so that it matches
3432 the new yyfill signature. Mark it as possibly unused.
3433
3434
3435 Follow up on a bug I reported in February, where a Bison-generated
3436 parser can loop. Provide a test case and a fix for yacc.c. I
3437 don't have a fix for lalr1.cc or for glr.c, unfortunately.
3438 The original bug report is in:
3439 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
3440
3441 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
3442 macro's size was becoming unwieldy.
3443 (yyerrlab): Do not discard an empty lookahead symbol, as this
3444 might destroy garbage.
3445 (yyerrorlab): New label, with the old contents of YYERROR,
3446 plus the following change: pop the stack of rhs corresponding
3447 to the production that invoked YYERROR. That is how Yacc
3448 behaves, and POSIX requires this behavior.
3449 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
3450 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
3451 Define 'alarm' to do nothing if unistd.h is not available.
3452 Add a new rule "exp: '-' error;" to test the above change to
3453 data/yacc.c. Use 'alarm' to abort any test taking longer than
3454 10 seconds, as it's probably looping.
3455 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
3456 Also, the new yacc.c generates two fewer diagnostics for an
3457 existing test.
3458
34592003-05-24 Paul Eggert <eggert@twinsun.com>
3460
3461 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
3462 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
3463 This fixes a problem reported by John Bowman when the Compaq/HP
3464 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
3465 -ansi -Wall -gall).
3466 * data/yacc.c (union yyalloc): Likewise.
3467 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
3468
3469 Switch from 'int' to 'bool' where that makes sense.
3470
3471 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
3472 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
3473 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
3474 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
3475 Return or accept bool, not int. All callers changed.
3476 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
3477 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
3478 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
3479 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
3480 bitset_or_and_cmp_): Likewise.
3481 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
3482 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
3483 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
3484 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
3485 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
3486 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
3487 bitset_stats_or_and_cmp): Likewise.
3488 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
3489 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
3490 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
3491 ebitset_xor_cmp): Likewise.
3492 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
3493 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
3494 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
3495 lbitset_xor_cmp): Likewise.
3496 * lib/bbitset.h: Include <stdbool.h>.
3497 (struct bitset_vtable): The following members now return bool, not
3498 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
3499 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
3500 or_and_cmp).
3501 * src/conflicts.c (count_rr_conflicts): Likewise.
3502 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
3503 All uses changed.
3504 * lib/ebitset.c (ebitset_obstack_init): Likewise.
3505 * lib/lbitset.c (lbitset_obstack_init): Likewise.
3506 * src/getargs.c (debug_flag, defines_flag, locations_flag,
3507 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
3508 graph_flag): Likewise.
3509 * src/getargs.h (debug_flag, defines_flag, locations_flag,
3510 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
3511 graph_flag): Likewise.
3512 * src/output.c (error_verbose): Likewise.
3513 * src/output.h (error_verbose): Likewise.
3514 * src/reader.c (start_flag, typed): Likewise.
3515 * src/reader.h (typed): Likewise.
3516 * src/getargs.c (LOCATIONS_OPTION): New constant.
3517 (long_options, getargs): Use it.
3518 * src/lalr.c (build_relations): Use bool, not int.
3519 * src/nullable.c (nullable_compute): Likewise.
3520 * src/print.c (print_reductions): Likewise.
3521 * src/tables.c (action_row, pack_vector): Likewise.
3522 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
3523 * src/output.c (prepare): Use it.
3524 * src/output.c (token_definitions_output,
3525 symbol_destructors_output, symbol_destructors_output): Use string,
3526 not boolean integer, to keep track of whether to output separator.
3527 * src/print_graph.c (print_core): Likewise.
3528 * src/state.c (state_rule_lookaheads_print): Likewise.
3529
3530 * config/install-sh: Sync from automake 1.7.5.
3531
35322003-05-14 Paul Eggert <eggert@twinsun.com>
3533
3534 * src/parse-gram.y (rules_or_grammar_declaration): Require a
3535 semicolon after a grammar declaration, in the interest of possible
3536 future changes to the Bison input language.
3537 Do not allow a stray semicolon at the start of the grammar.
3538 (rhses.1): Allow one or more semicolons after any rule, including
3539 just before "|" as required by POSIX.
3540 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
3541 grammar.
3542
35432003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
3544
3545 %parse-param support for lalr1.cc.
3546
3547 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
3548 b4_cc_constructor_calls, b4_cc_constructor_call,
3549 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
3550 definitions.
3551 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
3552 parse-param arguments.
3553 (yy::b4_parser_class_name): Declare instance variables to
3554 hold parse-param arguments.
3555 * tests/calc.at: s/value/semantic_value/ because value clashes
3556 with a member of yy::b4_parser_class_name. Adjust C++ code
3557 to handle %parse-param. Enable %parse-param test in C++.
3558
35592003-05-12 Paul Eggert <eggert@twinsun.com>
3560
3561 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
3562 English a bit. Fix fclose typo. Change "const char" to "char
3563 const", and use ANSI C rather than K&R for "main". Suggest
3564 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
3565 and suggest yy_switch_to_buffer.
3566
35672003-05-05 Paul Eggert <eggert@twinsun.com>
3568
3569 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
3570 C89. This avoids a diagnostic on compilers that define __STDC__
3571 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
3572 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
3573
35742003-05-03 Paul Eggert <eggert@twinsun.com>
3575
3576 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
3577 Do not overrun array bounds.
3578 This should fix a bug reported today by Olatunji Oluwabukunmi in
3579 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
3580
35812003-04-29 Akim Demaille <akim@epita.fr>
3582
3583 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
3584 * src/getargs.c, src/getargs.h: here, as bool, not int.
3585 (nondeterministic_parser): New.
3586 * src/parse-gram.y, src/scan-gram.l: Support
3587 %nondeterministic-parser.
3588 * src/output.c (prepare): Use nondeterministic_parser instead
3589 of glr_parser where appropriate.
3590 * src/tables.c (conflict_row, action_row, save_row)
3591 (token_actions, token_actions, pack_vector): Ditto.
3592
35932003-04-29 Akim Demaille <akim@epita.fr>
3594
3595 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
3596
35972003-04-29 Akim Demaille <akim@epita.fr>
3598
3599 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
3600 with %pure-parser and %locations to exercise the patch from Yakov
3601 Markovitch below.
3602
36032003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
3604
3605 * data/yacc.c: (b4_lex_param): Corrected for the case where
3606 %lex-param is provided and %pure-parser isn't.
3607
36082003-04-27 Paul Eggert <eggert@twinsun.com>
3609
3610 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
3611 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
3612 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
3613 if it is not defined.
3614 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
3615
36162003-04-26 Paul Eggert <eggert@twinsun.com>
3617
3618 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
3619 Declare to be of type suitable for the ninf value itself, not of
3620 type suitable for the corresponding table, since the latter might
3621 be unsigned but the ninf value might be negative. This fixes a
3622 bug reported by Alexandre Duret-Lutz in
3623 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3624
3625 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
3626 invokes it. We shouldn't invoke it twice because it will attempt
3627 to put error.o in the archive twice. This fixes a glitch reported
3628 by Martin Mokrejs in
3629 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
3630
36312003-04-21 Paul Eggert <eggert@twinsun.com>
3632
3633 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
3634 to gnulib.
3635
36362003-04-21 Yakov Markovitch <Markovitch@iso.ru>
3637
3638 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
3639 Fix obvious typo that results in uncompilable GLR parsers
3640 when both %pure-parser and %locations are used. (trivial change)
3641
36422003-04-17 Paul Eggert <eggert@twinsun.com>
3643
3644 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
3645 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
3646 Do not insert the expected token via unput, as this runs afoul
3647 of a POSIX-compatibility bug in flex 2.5.31.
3648 All uses changed to BEGIN the parent state,
3649 since we no longer insert the expected token via unput.
3650 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
3651 that is no longer emitted after the above change.
3652
3653 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
3654 the first one. This change is from Paul Hilfinger, and it fixes
3655 regression reported by Werner Lemberg in
3656 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
3657
3658 (resolve_sr_conflict): Don't invoke state_errs_set
3659 unless one or more tokens have been explicitly made errors.
3660 Otherwise, the above change causes Bison to abort.
3661
3662 * tests/existing.at (GNU pic Grammar): New test case, taken from
3663 Lemberg's email.
3664
36652003-03-31 Akim Demaille <akim@epita.fr>
3666
3667 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
3668
36692003-03-31 Akim Demaille <akim@epita.fr>
3670
3671 * src/output.c (prepare_symbols): Avoid trailing spaces in the
3672 output.
3673
36742003-03-31 Akim Demaille <akim@epita.fr>
3675
3676 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
3677 From Paul Hilfinger.
3678
36792003-03-29 Akim Demaille <akim@epita.fr>
3680
3681 * m4/error.m4: Do not put under dynamic conditions some code which
3682 expansion is under static control.
3683
36842003-03-29 Akim Demaille <akim@epita.fr>
3685
3686 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
3687
36882003-03-29 Akim Demaille <akim@epita.fr>
3689
3690 * doc/bison.texinfo (Strings are Destroyed): New.
3691
36922003-03-13 Paul Eggert <eggert@twinsun.com>
3693
3694 * .cvsignore: Add configure.lineno.
3695 * src/.cvsignore: Add yacc.
3696 * tests/.cvsignore: Add testsuite.log.
3697 * doc/fdl.texi: Sync with latest FSF version.
3698
36992003-03-12 Paul Eggert <eggert@twinsun.com>
3700
3701 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
3702 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
3703 cursor, instead of leaving it undefined. This fixes a bug
3704 reported by Tim Van Holder in
3705 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
3706 * tests/input.at (Torturing the Scanner): Test the scanner on
3707 an empty input file, which was Tim Van Holder's test case.
3708
3709 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
3710 <sys/resource.h> can be included, include sys/time.h and
3711 sys/times.h first, if available. This works around the SunOS
3712 4.1.4 porting bug reported by Bruce Becker in
3713 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
3714
3715 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
3716 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
3717 AC_HEADER_SYS_WAIT.
3718
3719 Merge changes from gnulib. This was prompted because the CVS
3720 snapshot didn't build on Solaris 7 due to strnlen problems.
3721
3722 These changes need to be merged back into gnulib:
3723 * lib/hash.c: Include <stdbool.h> unconditionally.
3724 * m4/onceonly.m4 (m4_quote): New macro.
3725 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
3726 Quote AC_FOREACH variable-expansions properly.
3727 The 2003-01-03 obstack.h change also needs merging.
3728 {end of changes requiring merging}
3729
3730 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
3731 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
3732 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
3733 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
3734 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
3735 New files, imported from gnulib.
3736 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
3737 above.
3738
3739 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
3740 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
3741 gnulib sources.
3742
3743 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
3744 Add.
3745 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
3746 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
3747 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
3748 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
3749 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
3750 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
3751 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
3752 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
3753 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
3754 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
3755 (jm_PREREQ_ARGMATCH): Remove.
3756 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
3757 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
3758
3759 * src/system.h: Include <stdbool.h> unconditionally.
3760
3761 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
3762 assuming at least C89 in the bitset code for some time now.
3763
37642003-03-03 Akim Demaille <akim@epita.fr>
3765
3766 * ro.po: New.
3767
37682003-03-02 Akim Demaille <akim@epita.fr>
3769
3770 * doc/bison.texinfo (Table of Symbols): Reactivate the
3771 documentation for %lex-param, and %parse-param.
3772
37732003-03-02 Akim Demaille <akim@epita.fr>
3774
3775 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
3776 generate verbose error messages.
3777 Use the number of tokens as an upper bound in yytname, as it
3778 cannot be a non terminal.
3779
37802003-03-02 Akim Demaille <akim@epita.fr>
3781
3782 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
3783 message.
3784
37852003-03-02 Akim Demaille <akim@epita.fr>
3786
3787 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
3788 Use them to exercise yycheck overrun.
3789 Based on Andrew Suffield's grammar.
3790
37912003-03-02 Akim Demaille <akim@epita.fr>
3792
3793 Create tests/local.at for Bison generic testing macros.
3794
3795 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
3796 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
3797 This new file.
3798 * tests/calc.at (AT_CHECK_CALC): Adjust.
3799 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
3800 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
3801 * tests/local.at: here.
3802 (AT_COMPILE_CXX): Tags the tests using it as c++.
3803 Ignore the test if CXX is not functional.
3804
38052003-03-01 Paul Eggert <eggert@twinsun.com>
3806
3807 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
3808 not loc->end, since loc->end might contain garbage and this leads
3809 to undefined behavior on some platforms.
3810 (id_loc, token_start): Use (IF_LINTed) initial values that do not
3811 depend on *loc, so that the reader doesn't give the the false
3812 impression that *loc is initialized.
3813 (<INITIAL>"%%"): Do not bother setting code_start, since its value
3814 does not survive the return.
3815
38162003-03-01 Akim Demaille <akim@epita.fr>
3817
3818 * src/scan-gram.l (code_start): Always initialize it when entering
3819 into yylex, as SC_EPILOGUE is activated *before* the corresponding
3820 yylex invocation. An alternative would be making it static, but
3821 then it starts with the second %%'s beginning, instead of its end.
3822
38232003-02-28 Paul Eggert <eggert@twinsun.com>
3824
3825 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
3826 around a UnixWare 7.1.1 porting bug reported by John Hughes in
3827 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
3828
38292003-02-26 Paul Eggert <eggert@twinsun.com>
3830
3831 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
3832 Remove Sequent/Pyramid discussion (nobody uses them any more).
3833 Merge VMS and MS-DOS discussion; these ports may well be dead
3834 but let's keep mentioning them for now. Put <> around email
3835 addresses. Add copyright notice.
3836
38372003-02-24 Paul Eggert <eggert@twinsun.com>
3838
3839 * data/glr.c (yy_reduce_print): yylineno -> yylno,
3840 to avoid collision with flex use of yylineno.
3841 Problem reported by Bruce Lilly in
3842 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
3843 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
3844 * data/yacc.c (yy_reduce_print): Likewise.
3845
3846 * config/depcomp: Sync with Automake 1.7.3.
3847
38482003-02-21 Akim Demaille <akim@epita.fr>
3849
3850 * data/lalr1.cc: Use temporary variables instead of casts to
3851 change integer types.
3852 Suggested by Paul Eggert.
3853
38542003-02-21 Akim Demaille <akim@epita.fr>
3855
3856 * doc/bison.texinfo: Use "location" consistently to refer to @n,
3857 to avoid confusions with lalr1.cc's notion of Position.
3858 Suggested by Paul Eggert.
3859
38602003-02-20 Akim Demaille <akim@epita.fr>
3861
3862 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
3863 before initial_columns.
3864 (location.hh): Use consistent variable names when defining the
3865 operator<<.
3866 Use "last" so that we subtract from Positions, not from unsigned.
3867
38682003-02-20 Akim Demaille <akim@epita.fr>
3869
3870 * data/lalr1.cc (position.hh): New subfile, including the extended
3871 and Doxygen'ed documentation of class Position.
3872 (location.hh): Use it.
3873 Document a` la Doxygen.
3874 With the help of Benoit Perrot.
3875
38762003-02-20 Akim Demaille <akim@epita.fr>
3877
3878 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
3879 AT_YACC_IF.
3880 Redefine AT_YYERROR_SEES_LOC_IF using it.
3881 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
3882 not defined.
3883 Don't use the location in yy::Parser::error_ and
3884 yy::Parser::print_ when not %locations.
3885 Activate more lalr1.cc tests.
3886
38872003-02-19 Akim Demaille <akim@epita.fr>
3888
3889 * data/lalr1.cc: When displaying a line number, be sure to make it
3890 an int.
3891
38922003-02-19 Akim Demaille <akim@epita.fr>
3893
3894 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
3895 Remove, useless.
3896 (YYABORT, YYACCEPT, YYERROR): New.
3897 * tests/calc.at: Renable the lalr1.cc test.
3898
38992003-02-19 Akim Demaille <akim@epita.fr>
3900
3901 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
3902 error recovery, mixing with/without pops and discarding of the
3903 lookahead.
3904 Exercise YYERROR.
3905 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
3906
39072003-02-17 Paul Eggert <eggert@twinsun.com>
3908
3909 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
3910 * tests/testsuite.at (AT_COMPILE): Use them.
3911 This fixes the testsuite problem reported by Robert Lentz in
3912 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
3913
39142003-02-12 Paul Eggert <eggert@twinsun.com>
3915
3916 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
3917 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
3918 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
3919 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
3920 Check for malloc failure, for consistency with yacc.c.
3921 (yytname_size): Remove, for consistency with yacc.c.
3922
3923 The bug still remains in data/lalr1.cc, as I didn't have time
3924 to fix it there.
3925
39262003-02-06 Akim Demaille <akim@epita.fr>
3927
3928 * configure.ac (GXX): Rename as...
3929 (CXX): this, to keep the original Autoconf semantics.
3930 Require 2.57.
3931 * data/lalr1.cc: Fix b4_copyright invocations.
3932 If YYDEBUG is not defined, don't depend upon name_ being defined.
3933 (location.hh): Include string and iostream.
3934 (Position::filename): New member.
3935 (Position::Position ()): New.
3936 (operator<< (Position)): New.
3937 (operator- (Position, int)): New.
3938 (Location::first, Location::last): Rename as...
3939 (Location::begin, Location::end): these, to mock the conventional
3940 iterator names.
3941 (operator<< (Location)): New.
3942 * tests/atlocal.in (CXX): New.
3943 * tests/testsuite.at (AT_COMPILE_CXX): New.
3944 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
3945 locations in a more synthetic way.
3946 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
3947 lalr1.cc is used.
3948 Adjust the C locations to match those from Emacs: first column is
3949 column 0.
3950 Change all the expected results.
3951 Conform to the GCS: simplify the locations when applicable.
3952 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
3953 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
3954 these CPP macros with the m4 macros new defined by...
3955 (AT_CHECK_PUSHDEFS): this, i.e.:
3956 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
3957 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
3958 New macros.
3959 (AT_CHECK_POPDEFS): Undefine them.
3960 (AT_CHECK_CALC_LALR1_CC): New.
3961 Use it for the first lalr1.cc test.
3962
39632003-02-04 Akim Demaille <akim@epita.fr>
3964
3965 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
3966 Location as is defined.
3967
39682003-02-04 Akim Demaille <akim@epita.fr>
3969
3970 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
3971 name_ being defined.
3972
39732003-02-03 Paul Eggert <eggert@twinsun.com>
3974
3975 * src/gram.h (start_symbol): Remove unused decl.
3976
3977 Use more-consistent naming conventions for local vars.
3978
3979 * src/derives.c (derives_compute): Change type of local var from
3980 int to rule_number.
3981 * src/gram.c (grammar_rules_partial_print): Likewise.
3982 * src/print.c (print_core): Likewise.
3983 * src/reduce.c (reduce_grammar_tables): Likewise.
3984
3985 * src/gram.c (grammar_dump): Change name of item_number *
3986 local var from r to rp.
3987 * src/nullable.c (nullable_compute): Likewise.
3988
3989 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
3990
3991 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
3992 for symbol or symbol_number var.
3993 * src/reader.c (grammar_start_symbol_set): Likewise.
3994 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
3995 Likewise.
3996 * src/state.c (transitions_to): Likewise.
3997 * src/state.h: Likewise.
3998 * src/tables.c (symbol_number_to_vector_number): Likewise.
3999
4000 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
4001 char * var.
4002
4003 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
4004 var.
4005
4006 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
4007 var.
4008
4009 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
4010 Use str, not s, for char * var. Use ch, not c, for character var.
4011 Use size for size var.
4012
4013 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
4014 char * var.
4015 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
4016 uniqstr var.
4017 * src/uniqstr.h: Likewise.
4018
4019 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
4020 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
4021 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
4022 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
4023 param to have same name as that of enum, so that we don't use
4024 "s" to stand for a non-state.
4025
40262003-02-02 Akim Demaille <akim@epita.fr>
4027
4028 * src/scan-skel.l: Scan more than one inert character per yylex
4029 invocation.
4030
40312003-02-01 Paul Eggert <eggert@twinsun.com>
4032
4033 Version 1.875a.
4034
4035 * po/LINGUAS: Add ms.
4036
40372003-01-30 Akim Demaille <akim@epita.fr>
4038
4039 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
4040
40412003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4042
4043 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
4044 of $1.
4045
4046 Changes in response to error report by S. Eken: GLR mode does not
4047 handle negative $ indices or $ indices in embedded rules correctly.
4048 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
4049
4050 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
4051 (b4_rhs_location): Ditto.
4052 (yyfill): New function to copy from stack tree into array
4053 incrementally.
4054 (yyuserAction): Modify to allow incremental move of semantic values
4055 to rhs array when in GLR mode.
4056 Define YYFILL to use in user-defined actions to fill semantic array
4057 as needed.
4058 Remove dummy use of yystack, as there is now a guaranteed use.
4059 (yydoAction): Modify to allow incremental move of semantic values
4060 to rhs array when in GLR mode.
4061 (yyresolveAction): Ditto.
4062 (yyglrShiftDefer): Update comment.
4063 (yyresolveStates): Use X == NULL for pointers, not !X.
4064 (yyglrReduce): Ditto.
4065 (yydoAction): Ditto
4066
4067 * tests/glr-regr1.at: Rename to ...
4068 * tests/glr-regression.at: Add new regression test for the problems
4069 described above (adapted from S. Eken).
4070 Update copyright notice.
4071 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
4072 * tests/Makefile.am: Ditto.
4073
40742003-01-28 Paul Eggert <eggert@twinsun.com>
4075
4076 * data/lalr1.cc: Do not use @output_header_name@ unless
4077 b4_defines_flag is set. This fixes two bugs reported by
4078 Tim Van Holder in
4079 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
4080 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
4081
40822003-01-21 Paul Eggert <eggert@twinsun.com>
4083
4084 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
4085 we don't need to worry about yyerrlab1 being reported as an
4086 "unused label" by non-GCC C compilers. The downside is that if
4087 locations are used then a couple of statements are duplicated each
4088 time YYERROR is invoked, but the upside is that the warnings
4089 should vanish.
4090 (yyerrlab1): Move code to YERROR.
4091 (yyerrlab2): Remove. Change uses back to yyerrlab1.
4092 This reverts some of the 2002-12-27 change.
4093
40942003-01-17 Paul Eggert <eggert@twinsun.com>
4095
4096 * src/output.c (symbol_printers_output): Fix typo that led
4097 to core dump. Problem reported by Antonio Rus in
4098 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4099
41002003-01-13 Akim Demaille <akim@epita.fr>,
4101 Quoc Peyrot <chojin@lrde.epita.fr>,
4102 Robert Anisko <anisko_r@lrde.epita.fr>
4103
4104 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
4105 when the stacks contain one element, as the loop would otherwise
4106 free the last state, and then use the top state (the one we just
4107 popped). This means that the initial elements will not be freed
4108 explicitly, as is the case in yacc.c; it is not a problem, as
4109 these elements have fake values.
4110
41112003-01-11 Paul Eggert <eggert@twinsun.com>
4112
4113 * NEWS: %expect-violations are now just warnings, reverting
4114 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
4115 bootstrapping problem reported by Matthias Klose; see
4116 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
4117 * src/conflicts.c (conflicts_print): Likewise.
4118 * tests/conflicts.at (%expect not enough, %expect too much,
4119 %expect with reduce conflicts): Likewise.
4120 * doc/bison.texinfo (Expect Decl): Document this. Also mention
4121 that the warning is enabled if the number of conflicts changes
4122 (not necessarily increases).
4123
4124 * src/getargs.c (version): Update copyright year.
4125
41262003-01-09 Akim Demaille <akim@epita.fr>
4127
4128 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
4129
41302003-01-08 Paul Eggert <eggert@twinsun.com>
4131
4132 * Makefile.maint (WGETFLAGS):
4133 New macro, containing "-C off" to disable proxy caches.
4134 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
4135 (rel-check): Use $(WGET) instead of wget.
4136
41372003-01-06 Paul Eggert <eggert@twinsun.com>
4138
4139 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
4140 the GLR paper of Scott, Johnstone and Hussain.
4141
41422003-01-04 Paul Eggert <eggert@twinsun.com>
4143
4144 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
4145 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
4146 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
4147 (EXTRA_LIBRARIES): New var, for liby.a.
4148 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
4149 (EXTRA_SCRIPTS): New var, for yacc.
4150
4151 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
4152 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
4153 Problem reported by Nelson H. F. Beebe.
4154
41552003-01-03 Paul Eggert <eggert@twinsun.com>
4156
4157 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
4158 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
4159 when compiling Bison 1.875's `bitset bset = obstack_alloc
4160 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
4161
4162 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
4163 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
4164 grow to a huge size with typical invocation.
4165
4166 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
4167 Use the pattern recommended by Autoconf 2.57, except also protect
4168 against double-definition.
4169 * src/system.h: Likewise.
4170 Portability issues reported by Nelson H. F. Beebe.
4171
4172 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
4173 All uses changed. Provide a definition in both C and C++.
4174 (yytrue, yyfalse): Define even if defined (__cplusplus).
4175
4176 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
4177 Reported by Nelson H. F. Beebe.
4178
4179 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
4180
41812003-01-02 Paul Eggert <eggert@twinsun.com>
4182
4183 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
4184 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
4185 Bug reported by Nelson H. F. Beebe.
4186
41872003-01-01 Paul Eggert <eggert@twinsun.com>
4188
4189 * Version 1.875.
4190
41912002-12-30 Paul Eggert <eggert@twinsun.com>
4192
4193 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
4194 Moved here from...
4195 (<INITIAL>","): Here. This causes stray "," to be treated
4196 more uniformly.
4197
4198 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
4199 last brace in braced code when not in Yacc mode, for compatibility
4200 with Bison 1.35. This resurrects the 2001-12-15 patch to
4201 src/reader.c.
4202
4203 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
4204 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
4205
42062002-12-28 Paul Eggert <eggert@twinsun.com>
4207
4208 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
4209 that of SYM's type. This fixes Debian bug 168069, reported by
4210 Thomas Olsson.
4211
42122002-12-28 Paul Eggert <eggert@twinsun.com>
4213
4214 Version 1.75f.
4215
4216 Switch back to the Yacc style of conflict reports, undoing some
4217 of the 2002-07-30 change.
4218 * doc/bison.texinfo (Understanding): Use Yacc style for
4219 conflict reports. Also, use new way of locating rules.
4220 * src/conflicts.c (conflict_report):
4221 Renamed from conflict_report_yacc, removing the old
4222 'conflict_report'. Translate the entire conflict report at once,
4223 so that we don't assume that "," has the same interpretation in
4224 all languages.
4225 (conflicts_output): Use Yacc-style conflict report for each state,
4226 instead of our more-complicated style.
4227 (conflicts_print): Use Yacc-style conflict report, except print
4228 the input file name when not emulating Yacc.
4229 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
4230 Conflicted Reduction, %expect not enough, %expect too much,
4231 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
4232 * tests/existing.at (GNU Cim Grammar): Likewise.
4233 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
4234
4235 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
4236 fatal): Don't invoke fflush; it's not needed and it might even be
4237 harmful for stdout, as stdout might not be open.
4238 * src/reduce.c (reduce_print): Likewise.
4239
42402002-12-27 Paul Eggert <eggert@twinsun.com>
4241
4242 Fix a bug where error locations were not being recorded correctly.
4243 This problem was originally reported by Paul Hilfinger in
4244 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
4245
4246 * data/yacc.c (yyparse): New local var yylerrsp, to record the
4247 top of the location stack's error locations.
4248 (yyerrlab): Set it. When discarding a token, push its location
4249 onto yylerrsp so that we don't lose track of the error's end.
4250 (yyerrlab1): Now is only the target of YYERROR, so that we can
4251 properly record the location of the action that failed. For GCC
4252 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
4253 GCC warning about yyerrlab1 being unused if YYERROR is unused.
4254 (yyerrlab2): New label, which yyerrlab now falls through to.
4255 Compute the error's location by applying YYLLOC_DEFAULT to
4256 the locations of all the symbols that went into the error.
4257 * doc/bison.texinfo (Location Default Action): Mention that
4258 YYLLOC_DEFAULT is also invoked for syntax errors.
4259 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
4260 Error locations include the locations of all the tokens that were
4261 discarded, not just the last token.
4262
42632002-12-26 Paul Eggert <eggert@twinsun.com>
4264
4265 * src/files.c: Include quote.h.
4266 (compute_output_file_names): Warn if we detect conflicting
4267 outputs to the same file. This should catch the misunderstanding
4268 exemplified by Debian Bug 165349, reported by Bruce Stephens..
4269
4270 * src/conflicts.c (conflicts_print): If the user specifies
4271 "%expect N", report an error if there are any reduce/reduce
4272 conflicts. This is what the manual says should happen.
4273 This fixes Debian bug 130890, reported by Anthony DeRobertis.
4274 * tests/conflicts.at (%expect with reduce conflicts): New test.
4275
4276 Don't use m4_include on relative file names, as it doesn't work as
4277 desired if there happens to be a file with that name under ".".
4278
4279 * m4sugar/version.m4: Remove; it was included but it wasn't used.
4280 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
4281 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
4282 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
4283 * src/output.c (output_skeleton): Use full path names when
4284 specifying a file to include; don't rely on include path, as
4285 it's unreliable when the working file contains a file with
4286 that name.
4287
42882002-12-25 Paul Eggert <eggert@twinsun.com>
4289
4290 Remove obsolete references to bison.simple and bison.hairy.
4291 Problem mentioned by Aubin Mahe in
4292 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
4293 * data/glr.c: Comment fix.
4294 * doc/bison.1: Remove references. Also, mention "yacc".
4295
4296 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
4297 with -g option.
4298
4299 * src/parse-gram.y (declaration): Use enum "report_states" rather
4300 than its numeric value 1.
4301
4302 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
4303 opening a new one. This fixes Debian bug 165349, reported by
4304 Bruce Stephens.
4305
43062002-12-24 Paul Eggert <eggert@twinsun.com>
4307
4308 Version 1.75e.
4309
4310 * Makefile.maint (cvs-update): Don't assume that the shell
4311 supports $(...), as Solaris sh doesn't.
4312
4313 * src/parse-gram.y (lloc_default): Remove test for empty
4314 nonterminals at the end, since it didn't change the result.
4315
43162002-12-24 Paul Eggert <eggert@twinsun.com>
4317
4318 If the user does not define YYSTYPE as a macro, Bison now declares it
4319 using typedef instead of defining it as a macro. POSIX requires this.
4320 For consistency, YYLTYPE is also declared instead of defined.
4321
4322 %union directives can now have a tag before the `{', e.g., the
4323 directive `%union foo {...}' now generates the C code
4324 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
4325 The default union tag is `YYSTYPE', for compatibility with Solaris 9
4326 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
4327 instead of `yyltype'.
4328
4329 `yystype' and `yyltype' are now obsolescent macros instead of being
4330 typedefs or tags; they are no longer documented and will be
4331 withdrawn in a future release.
4332
4333 * data/glr.c (b4_location_type): Remove.
4334 (YYSTYPE): Renamed from yystype.
4335 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
4336 (struct YYLTYPE): Renamed from struct yyltype.
4337 (YYLTYPE): Renamed from yyltype.
4338 (yyltype, yystype): New (and obsolescent) macros,
4339 for backward compatibility.
4340 * data/yacc.c: Likewise.
4341
4342 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
4343 does not specify a union tag. This is for compatibility with
4344 Solaris 9 yacc.
4345
4346 * src/parse-gram.y (add_param): 2nd arg is now char * not char
4347 const *, since it is now modified by stripping surrounding { }.
4348 (current_braced_code): Remove.
4349 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
4350 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
4351 trailing " {...}". Now of type <chars>.
4352 (grammar_declaration): Adjust to bundled tokens.
4353 (code_content): Remove; stripping is now done by add_param.
4354 (print_token_value): Print contents of bundled tokens.
4355 (token_name): New function.
4356
4357 * src/reader.h (braced_code, current_braced_code): Remove.
4358 (token_name): New decl.
4359
4360 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
4361 token_type, not braced_code code_kind. All uses changed.
4362 (SC_PRE_CODE): New state, for scanning after a keyword that
4363 has (or usually has) an immediately-following braced code.
4364 (token_type): New local var, to keep track of which token type
4365 to return when scanning braced code.
4366 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
4367 <INITIAL>"%parse-param", <INITIAL>"%printer",
4368 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
4369 instead of returning a token type immediately.
4370 (<INITIAL>"{"): Set token type.
4371 (<SC_BRACED_CODE>"}"): Use it.
4372 (handle_action_dollar, handle_action_at): Now returns bool
4373 indicating success. Fail if ! current_rule; this prevents a core dump.
4374 (handle_symbol_code_dollar, handle_symbol_code_at):
4375 Remove; merge body into caller.
4376 (handle_dollar, handle_at): Complain in invalid contexts.
4377
4378 * NEWS, doc/bison.texinfo: Document the above.
4379 * NEWS: Fix years and program names in copyright notice.
4380
43812002-12-17 Paul Eggert <eggert@twinsun.com>
4382
4383 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
4384 Reporting, Table of Symbols): Omit mentions of %lex-param and
4385 %parse-param from the documentation for now.
4386
43872002-12-15 Paul Eggert <eggert@twinsun.com>
4388
4389 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
4390 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
4391 lookahead symbol, and which sets yychar in parser actions) and it
4392 disagreed with the Bison documentation. Bug
4393 reported by Andrew Walrond.
4394
4395 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
4396 as the caller now does that.
4397 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
4398 (YYEMPTY): Parenthesize right hand side, since others use it.
4399 (yyparse): Don't assume that our generated code is the only code
4400 that sets yychar.
4401
44022002-12-13 Paul Eggert <eggert@twinsun.com>
4403
4404 Version 1.75d.
4405
4406 POSIX requires a "yacc" command.
4407 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
4408 (MOSTLYCLEANFILES): Add yacc.
4409 (yacc): New rule.
4410 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
4411 as an alias for bison y.
4412
4413 * po/LINGUAS: Add da.
4414
4415 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
4416 problem with latest <getopt.h>.
4417 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
4418
4419 * doc/fdl.texi: Upgrade to 1.2.
4420 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
4421 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
4422 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
4423 gnulib.
4424 * config/install-sh: Sync with autotools.
4425
4426 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
4427 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
4428 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
4429 locations are requested.
4430 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
4431 locations are requested.
4432
44332002-12-12 Paul Eggert <eggert@twinsun.com>
4434
4435 Remove unportable casts and storage allocation tricks.
4436 While we're at it, remove almost all casts, since they
4437 usually aren't needed and are a sign of trouble.
4438
4439 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
4440
4441 * src/derives.c (derives_compute): Do not subtract NTOKENS from
4442 the pointer DSET returned by malloc; this isn't portable.
4443 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
4444 Similarly for DERIVES.
4445 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
4446 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
4447 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
4448
4449 * src/derives.c (derives_compute): Do not bother invoking
4450 int_of_rule_number, since rule numbers are integers.
4451
4452 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
4453 rather than XMALLOC (char, N).
4454
4455 * src/files.c (filename_split): Rewrite to avoid cast.
4456
4457 * src/gram.h (symbol_number_as_item_number,
4458 item_number_as_symbol_number, rule_number_as_item_number,
4459 item_number_as_rule_number):
4460 Now inline functions rather than macros, to avoid casts.
4461 * src/state.h (state_number_as_int): Likewise.
4462 * src/tables.c (state_number_to_vector_number,
4463 symbol_number_to_vector_number): Likewise.
4464
4465 * src/gram.h (int_of_rule_number): Remove; no longer used.
4466
4467 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
4468 since the resulting storage is always stored into.
4469
4470 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
4471 where it's needed.
4472
4473 * src/muscle_tab.c (muscle_m4_output):
4474 Now inline. Return bool, not int.
4475 * src/state.c (state_compare): Likewise.
4476 * src/symtab.c (symbol_check_defined,
4477 symbol_check_alias_consistency, symbol_pack, symbol_translation,
4478 hash_compare_symbol, hash_symbol):
4479 Likewise.
4480 * src/uniqstr.c (uniqstr_print): Likewise.
4481 * src/muscle_tab.c (muscle_m4_output_processor):
4482 New function, to avoid casts.
4483 * src/state.c (state_comparator, stage_hasher): Likewise.
4484 * src/symtab.c (symbol_check_defined_processor,
4485 symbol_check_alias_consistency_processor, symbol_pack_processor,
4486 symbol_translation_processor, hash_symbol_comparator,
4487 hash_symbol_hasher): Likewise.
4488 * src/uniqstr.c (uniqstr_print_processor): Likewise.
4489 * src/muscle_tab.c (muscles_m4_output):
4490 Use new functions instead of casting old functions unportably.
4491 * src/state.c (state_hash_new): Likewise.
4492 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
4493 symbols_token_translations_init):
4494 Likewise.
4495 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
4496
4497 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
4498 var instead of casting to long, to avoid casts.
4499 (prepare_states): Use MALLOC rather than alloca, so that we don't
4500 have to worry about alloca.
4501 * src/state.c (state_hash_lookup): Likewise.
4502
4503 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
4504 local var instead of casting to unsigned char, to avoid casts.
4505
4506 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
4507 STATE_ALLOC): Remove.
4508 (transitions_new, errs_new, reductions_new, state_new): Use malloc
4509 rather than calloc, and use offsetof to avoid allocating slightly
4510 too much storage.
4511 (state_new): Initialize all members.
4512
4513 * src/state.c (state_hash): Use unsigned accumulator, not signed.
4514
4515 * src/symtab.c (symbol_free): Remove; unused.
4516 (symbol_get): Remove cast in lhs of assignment.
4517 (symbols_do): Now static. Accept generic arguments, not
4518 hashing-related ones.
4519
4520 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
4521 (symbol_processor): Remove.
4522 (symbols_do): Remove decl; now static.
4523
4524 * src/system.h (alloca): Remove; decl no longer needed.
4525 (<stddef.h>): Include, for offsetof.
4526 (<inttypes.>, <stdint.h>): Include if available.
4527 (uintptr_t): New type, if system lacks it.
4528 (CALLOC, MALLOC, REALLOC): New macros.
4529 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
4530 new macros.
4531
4532 * src/tables.c (table_size): Now int, to pacify GCC.
4533 (table_grow, table_ninf_remap): Use signed table size.
4534 (save_row): Don't bother initializing locals when not needed.
4535 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
4536 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
4537
4538 * src/vcg.h: Correct misspellings.
4539
4540 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
4541
4542
4543 * src/getargs.c (getargs): Don't assume EOF == -1.
4544
45452002-12-09 Paul Eggert <eggert@twinsun.com>
4546
4547 Change identifier spellings to avoid collisions with names
4548 that are reserved by POSIX.
4549
4550 Don't use names ending in _t, since POSIX reserves them.
4551 For consistency, remove _e and _s endings -- they're weren't
4552 needed to remove ambiguity. All uses changed.
4553 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
4554 turn was just renamed from struniq_t.
4555 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
4556 which in turn was just renamed from struniq_processor_t.
4557 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
4558 in turn was renamed from hash_compare_struniq_t.
4559 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
4560 (state_list): Renamed from state_list_t.
4561 * src/assoc.h (assoc): Renamed from assoc_t.
4562 * src/conflicts.c (enum conflict_resolution): Renamed from
4563 enum conflict_resolution_e.
4564 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
4565 (rule_list): Renamed from rule_list_t.
4566 * src/getargs.h (enum trace): Renamed from enum trace_e.
4567 (enum report): Renamed from enum report_e.
4568 * src/gram.h (item_number): Renamed from item_number_t.
4569 (rule_number): Renamed from rule_number_t.
4570 (struct rule_s): Remove the "rule_s" part; not used.
4571 (rule): Renamed from rule_t.
4572 (rule_filter): Renamed from rule_filter_t.
4573 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
4574 (goto_list): Renamed from goto_list_t.
4575 * src/lalr.h (goto_number): Renamed from goto_number_t.
4576 * src/location.h (location): Renamed from location_t.
4577 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
4578 and moved here from:
4579 * src/muscle_tab.h (muscle_entry_t): here.
4580 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
4581 (rule_list): Renamed from rule_list_t.
4582 * src/print_graph.c (static_graph): Renamed from graph.
4583 * src/reader.h (braced_code): Renamed from braced_code_t.
4584 Remove brace_code_e tag.
4585 * src/relation.h (relation_node): Renamed from relation_node_t.
4586 (relation_nodes): Renamed from relation_nodes_t.
4587 (relation): Renamed from relation_t.
4588 * src/state.h (state_number): Renamed from state_number_t.
4589 (struct state): Renamed from struct state_s.
4590 (state): Renamed from state_t.
4591 (transitions): Renamed from transitions_t. Unused (and
4592 misspelled) transtion_s tag removed.
4593 (errs): Renamed from errs_t. Unused errs_s tag removed.
4594 (reductions): Renamed from reductions_t. Unused tag
4595 reductions_s removed.
4596 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
4597 (struct symbol_list): Renamed from struct symbol_list_s.
4598 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
4599 (struct symbol): Renamed from struct symbol_s.
4600 (symbol): Renamed from symbol_t.
4601 * src/tables.c (vector_number): Renamed from vector_number_t.
4602 (action_number): Renamed from action_t.
4603 * src/tables.h (base_number): Renamed from base_t.
4604 * src/vcg.h (enum color): Renamed from enum color_e.
4605 (enum textmode): Renamed from enum textmode_e.
4606 (enum shape): Renamed from enum shape_e.
4607 (struct colorentry): Renamed from struct colorentry_s.
4608 (struct classname): Renamed from struct classname_s.
4609 (struct infoname): Renamed from struct infoname_s.
4610 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
4611 (enum decision): Renamed from enum decision_e.
4612 (enum orientation): Renamed from enum orientation_e.
4613 (enum alignment): Renamed from enum alignment_e.
4614 (enum arrow_mode): Renamed from enum arrow_mode_e.
4615 (enum crossing_type): Renamed from enum crossing_type_e.
4616 (enum view): Renamed from enum view_e.
4617 (struct node): Renamed from struct node_s.
4618 (node): Renamed from node_t.
4619 (enum linestyle): Renamed from enum linestyle_e.
4620 (enum arrowstyle): Renamed from enum arrowstyle_e.
4621 (struct edge): Renamed from struct edge.
4622 (edge): Renamed from edge_t.
4623 (struct graph): Renamed from struct graph_s.
4624 (graph): Renamed from graph_t.
4625 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
4626 Rename value_t -> value.
4627 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
4628 value_t_as_yystype -> value_as_yystype.
4629
4630 Don't include <errno.h> in the mainstream code, since it
4631 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
4632 * lib/get-errno.c, lib/get-errno.h: New files.
4633 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
4634 get-errno.c.
4635 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
4636 * src/output.c (output_skeleton): Likewise.
4637 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
4638 instead of errno.
4639 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
4640 Likewise.
4641 (handle_action_dollar, handle_action_at): Likewise.
4642 * src/system.h: Do not include <errno.h>.
4643 (TAB_EXT): Renamed from EXT_TAB.
4644 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
4645
4646 Avoid str[a-z]*, since <string.h> reserves that name space.
4647 Change all instances of "struniq" in names to "uniqstr", and
4648 likewise for "STRUNIQ" and "UNIQSTR".
4649 * src/uniqstr.c: Renamed from src/struniq.c.
4650 * src/uniqstr.h: Renamed from src/struniq.h.
4651 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
4652 * src/files.c (strsuffix): Remove; unused.
4653 (concat2): Renamed from stringappend. Now static.
4654 * src/files.h (strsuffix, stringappend): Remove; unused.
4655 * src/parse-gram.y (<chars>): Renamed from <string>.
4656 (<uniqstr>): Renamed from <struniq>.
4657 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
4658 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
4659 (struct graph_s.expand): Renamed from struct graph_s.stretch.
4660 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
4661 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
4662 (N_EXPAND): Renamed from N_STRETCH.
4663
4664 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
4665 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
4666 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
4667 Remove; unused.
4668 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
4669 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
4670 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
4671 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
4672 (BASE_MAXIMUM): Renamed from BASE_MAX.
4673 (BASE_MINIMUM): Renamed from BASE_MIN.
4674 (ACTION_MAX): Remove; unused.
4675 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
4676 Unnecessary casts removed from above defines.
4677
4678
4679 Fix misspelling in names.
4680 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
4681 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
4682 G_NODE_ALIGNEMENT.
4683
4684
4685 * lib/timevar.c (timevar_report): Renamed from time_report,
4686 for consistency with other names.
4687 * lib/timevar.h (timevar_report): New decl.
4688 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
4689
4690
4691 Sort include-file uses.
4692
4693 Reorder all include files under src to be in the order "system.h".
4694 then the ../lib include files in angle brackets (alphabetized),
4695 then the . include files in double-quotes (alphabetized). Fix
4696 dependency breakages encountered in this process, as follows:
4697 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
4698 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
4699 * src/state.h: Include "symtab.h".
4700
47012002-12-08 Paul Eggert <eggert@twinsun.com>
4702
4703 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
4704 since this causes problems when __file__ contains character
4705 sequences like "@" that are treated specially by src/scan-skel.l.
4706 Instead, just use the file's basename. This fixes the bug
4707 reported by Martin Mokrejs in
4708 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
4709
47102002-12-06 Paul Eggert <eggert@twinsun.com>
4711
4712 Add support for rules that do not have trailing semicolons, as
4713 POSIX requires. Improve the quality of locations in Bison
4714 diagnostics.
4715
4716 * src/location.c: Include <quotearg.h>.
4717 (empty_location): Now const.
4718 (location_print): New function. Follow the recommendation of the
4719 GNU Coding Standards for locations that span file boundaries.
4720 * src/location.h: Do not include <quotearg.h>; no longer needed.
4721 (boundary): New type.
4722 (location_t): Use it. This allows locations to span file boundaries.
4723 All member uses changed: file -> start.file or end.file (as needed),
4724 first_line -> start.line, first_column -> start.column,
4725 last_line -> end.line, last_column -> end.column.
4726 (equal_boundaries): New function.
4727 (LOCATION_RESET, LOCATION_STEP): Remove.
4728 (LOCATION_PRINT): Remove. All callers changed to use location_print.
4729 (empty_location): Now const.
4730 (location_print): New decl.
4731 * src/parse-gram.y (lloc_default): New function, which handles
4732 empty locations more accurately.
4733 (YYLLOC_DEFAULT): Use it.
4734 (%token COLON): Remove.
4735 (%token ID_COLON): New token.
4736 (rules): Use it.
4737 (declarations, rules): Remove trailing semicolon.
4738 (declaration, rules_or_grammar_declaration):
4739 Allow empty (";") declaration.
4740 (symbol_def): Remove empty actions; no longer needed.
4741 (rules_or_grammar_declaration): Remove trailing semicolon.
4742 (semi_colon.opt): Remove.
4743 * src/reader.h: Include location.h.
4744 (scanner_cursor): New decl.
4745 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
4746 rolling our own.
4747 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
4748 of *loc.
4749 (STEP): Remove. No longer needed, now that adjust_location does
4750 the work. All uses removed.
4751 (scanner_cursor): New var.
4752 (adjust_location): Renamed from extend_location. It now sets
4753 *loc and adjusts the scanner cursor. All uses changed.
4754 Don't bother testing for CR.
4755 (handle_syncline): Remove location arg; now updates scanner cursor.
4756 All callers changed.
4757 (unexpected_end_of_file): Now accepts start boundary of token or
4758 comment, not location. All callers changed. Update scanner cursor,
4759 not the location.
4760 (SC_AFTER_IDENTIFIER): New state.
4761 (context_state): Renamed from c_context. All uses changed.
4762 (id_loc, code_start, token_start): New local vars.
4763 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
4764 processing of Yacc white space and equivalents here.
4765 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
4766 instead of returning ID immediately, since we need to search for
4767 a subsequent colon.
4768 (<INITIAL>"'", "\""): Save token_start.
4769 (<INITIAL>"%{", "{", "%%"): Save code_start.
4770 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
4771 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
4772 BEGIN context_state at end, not INITIAL.
4773 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
4774 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
4775 Return correct token start.
4776 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
4777 the start of a character, string or multiline comment is found.
4778 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
4779 Reduction): Adjust reported locations to match the more-precise
4780 results now expected.
4781 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
4782 * tests/reduce.at (Useless Rules, Reduced Automaton,
4783 Underivable Rules): Likewise.
4784 * tests/regression.at (Invalid inputs): No longer `expecting ";"
4785 or "|"' now that so many other tokens are allowed by the new grammar.
4786
4787 * src/complain.h (current_file): Remove duplicate decl;
4788 current_file is now owned by files.h.
4789 * src/complain.c, src/scan-gram.l: Include files.h.
4790
47912002-12-06 Paul Eggert <eggert@twinsun.com>
4792
4793 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
4794 promotes to int; it might be unsigned int.
4795 * data/yacc.c (yy_reduce_print): Likewise.
4796
4797 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
4798 be #defined in the prologue, not in the Bison declarations.
4799 This fixes Debian Bug 102878, reported by Shaul Karl.
4800
48012002-12-02 Paul Eggert <eggert@twinsun.com>
4802
4803 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
4804 * lib/strtoul.c: New file, from gnulib.
4805 This fixes a porting bug reported by Peter Klein in
4806 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
4807
48082002-11-30 Paul Eggert <eggert@twinsun.com>
4809
4810 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
4811 and put only a forward declaration in the prologue. This is for
4812 consistency with the other scanner helper functions.
4813
4814 Type clashes now generate warnings, not errors, since it
4815 appears that POSIX may allow some grammars with type clashes.
4816 * src/reader.c (grammar_current_rule_check): Warn about
4817 type clashes instead of complaining.
4818 * tests/input.at (Type Clashes): Expect warnings, not complaints.
4819
4820 Add Yacc library, since POSIX requires it.
4821 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
4822 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
4823 * lib/main.c, lib/yyerror.c: New files.
4824
4825 gram_error can be static; it need not be extern.
4826 * src/reader.h (gram_error): Remove decl.
4827 * src/parse-gram.y (gram_error): Now static. Add static decl.
4828 (print_token_value): Omit parameter names from forward decl,
4829 for consistency.
4830
48312002-11-29 Paul Eggert <eggert@twinsun.com>
4832
4833 * doc/bison.texinfo: Emphasize that yylex and yyerror must
4834 be declared before being used. E.g., one should typically
4835 declare them in the prologue. Use GNU coding style in examples.
4836 Put "const" consistently after the type it modifies. Mention
4837 that C99 supports "inline". Mention that yyerror traditionally
4838 returns "int".
4839
4840 %parse-param and %lex-param now take just one argument, the
4841 declaration; the argument name is deduced from the declaration.
4842
4843 * doc/bison.texinfo (Parser Function, Pure Calling, Error
4844 Reporting, Table of Symbols): Document this.
4845 * src/parse-gram.y (add_param): New function.
4846 (COMMA): Remove.
4847 (declaration): Implement new rule for %parse-param and %lex-param.
4848 * src/scan-gram.l: "," now elicits a warning, rather than being
4849 a token; this is more compatible with byacc.
4850 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
4851
48522002-11-27 Paul Eggert <eggert@twinsun.com>
4853
4854 Rename identifiers to avoid real and potential collisions.
4855
4856 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
4857 to avoid collision with lex macro described by Bruce Lilly in
4858 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
4859 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
4860 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
4861 * src/parse-gram.y (print_token_value): Renamed from yyprint.
4862 All uses changed.
4863 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
4864 The name "yycontrol" violates the name space rules, and this stuff
4865 wasn't being used anyway.
4866 (input): Remove action; this stuff wasn't being used.
4867 (gram_error): Rename local variable yylloc -> loc.
4868 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
4869 (YY_DECL): Don't use "yy" at start of local variables.
4870 All uses changed, e.g., yylloc -> loc.
4871 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
4872 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
4873 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
4874 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
4875
4876 * src/parse-gram.y (gram_error): loc is now const *.
4877 * src/reader.h (gram_error): Likewise.
4878
48792002-11-24 Paul Eggert <eggert@twinsun.com>
4880
4881 Version 1.75c.
4882
4883 * tests/actions.at (Actions after errors): Use an output format
4884 more similar to that of the Printers and Destructors test.
4885 Test the position of the ';' token too.
4886 (Printers and Destructors): Likewise.
4887 (Printers and Destructors: %glr-parser): Remove for now, to avoid
4888 unnecessarily alarming people when the test fails.
4889
4890 * data/yacc.c (yyerrlab1): Move this label down, so that the
4891 parser does not discard the lookahead token if the user code
4892 invokes YYERROR. This change is required for POSIX conformance.
4893
4894 * lib/error.c: Sync with gnulib.
4895
48962002-11-22 Paul Eggert <eggert@twinsun.com>
4897
4898 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
4899 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
4900 * lib/xmalloc.c: Likewise.
4901
49022002-11-20 Paul Eggert <eggert@twinsun.com>
4903
4904 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
4905
49062002-11-20 Paul Eggert <eggert@twinsun.com>
4907
4908 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
4909 should use `if (! x) abort ();' rather than `assert (x);', and
4910 anyway it's one less thing to worry about configuring.
4911
4912 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
4913 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
4914 and replace all instances of assert with abort.
4915 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
4916 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
4917
4918 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
4919 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
4920 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
4921 hash_find_entry, hash_rehash, hash_insert): Likewise.
4922 * src/conflicts.c (resolve_sr_conflict): Likewise.
4923 * src/lalr.c (set_goto_map, map_goto): Likewise.
4924 * src/nullable.c (nullable_compute): Likewise.
4925 * src/output.c (prepare_rules, token_definitions_output): Likewise.
4926 * src/reader.c (packgram, reader): Likewise.
4927 * src/state.c (state_new, state_free, state_transitions_set,
4928 state_reduction_find): Likewise.
4929 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
4930 symbol_pack): Likewise.
4931 * src/tables.c (conflict_row, pack_vector): Likewise.
4932 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
4933 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
4934 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
4935 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
4936
4937 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
4938 (ARGMATCH_CONSTRAINT): New macro.
4939 (ARGMATCH_ASSERT): Use it.
4940
4941 * src/system.h (verify): New macro.
4942 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
4943 rather than assert.
4944 * src/tables.c (tables_generate): Likewise.
4945
4946 * src/struniq.c (struniq_assert): Now returns void, and aborts
4947 if the assertion is false.
4948 (struniq_assert_p): Remove.
4949 * src/struniq.h: Likewise.
4950
49512002-11-18 Paul Eggert <eggert@twinsun.com>
4952
4953 * data/glr.c (yygetLRActions): Replace `yyindex' with
4954 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
4955 This fixes the regression with Sun ONE Studio 7 cc that I reported in
4956 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
4957
49582002-11-18 Akim Demaille <akim@epita.fr>
4959
4960 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
4961 space.
4962 From Tim Van Holder.
4963
49642002-11-17 Paul Eggert <eggert@twinsun.com>
4965
4966 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
4967 to "SyntaxError" for consistency with my 2002-11-15 change.
4968
4969 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
4970 not define to {}, since this breaks the common use of `YYDPRINTF
4971 ((...));' if a single statement is desired (e.g. before `else').
4972 Work around GCC warnings by surrounding corresponding calls with
4973 {} if needed.
4974 (yyhasResolvedValue): Remove unused function.
4975 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
4976 loop body.
4977 (yyreportSyntaxError): Renamed from yyreportParseError.
4978 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
4979 All uses changed.
4980 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
4981 extern when possible. Remove unused initializations.
4982
49832002-11-16 Akim Demaille <akim@epita.fr>
4984
4985 Augment the similarity between GLR and LALR traces.
4986
4987 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
4988 (YY_REDUCE_PRINT): New.
4989 (yyparse): Use them.
4990 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
4991 YYDPRINT here.
4992 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
4993 state reached after the reduction/recovery, since...
4994 (yyparse, yyprocessOneStack): Report the state we are entering in.
4995
49962002-11-16 Akim Demaille <akim@epita.fr>
4997
4998 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
4999 Add support for --trace=skeleton.
5000 * src/scan-skel.l: %option debug.
5001 Scan strings of non-@ or \n instead of character by character.
5002 (scan_skel): Handle trace_skeleton.
5003 (QPUTS): New.
5004 (@output_parser_name@, @output_header_name@): ``Restore'' their
5005 support (used to be M4 macros).
5006 * data/yacc.c: Quote larger chunks, a la glr.c.
5007 * data/lalr1.cc: Likewise.
5008 The header guards are no longer available, so use some other
5009 string than `YYLSP_NEEDED'.
5010
50112002-11-16 Akim Demaille <akim@epita.fr>
5012
5013 Make the ``Printers and Destructors'' test more verbose, taking
5014 `yacc.c''s behavior as (possibly wrong) reference.
5015
5016 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
5017 instead of fprint on stdout.
5018 Set and report the last_line of the symbols.
5019 Consistently display values and locations.
5020
50212002-11-16 Paul Eggert <eggert@twinsun.com>
5022
5023 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
5024
50252002-11-15 Paul Eggert <eggert@twinsun.com>
5026
5027 * tests/actions.at (Actions after errors): New test case.
5028
5029 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
5030 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
5031 tests/action.at, tests/calc.at, tests/conflicts.at,
5032 tests/cxx-type.at, tests/regression.at:
5033 "parse error" -> "syntax error" for POSIX compatibility.
5034 "parsing stack overflow..." -> "parser stack overflow" so
5035 that code matches Bison documentation.
5036
50372002-11-15 Akim Demaille <akim@epita.fr>
5038
5039 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
5040 take two BRACED_CODE, not two string_content.
5041 Free the scanner's obstack when we are done.
5042 (code_content): New.
5043 * tests/calc.at: Adjust.
5044 * doc/bison.texinfo: Adjust.
5045 Also, make sure to include the `,' for these declarations.
5046
50472002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
5048
5049 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
5050 definition; avoids potential autoreconf problems.
5051
50522002-11-15 Akim Demaille <akim@epita.fr>
5053
5054 Always check the value returned by yyparse.
5055
5056 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
5057 returned by yyparse.
5058 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
5059 Adjust calls.
5060 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
5061 returned by yyparse.
5062
50632002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5064
5065 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
5066 on input.at test.
5067
50682002-11-14 Paul Eggert <eggert@twinsun.com>
5069
5070 * src/output.c (output_skeleton): Call xfopen instead of
5071 duplicating xfopen's body.
5072
5073 Fix bugs reported by Nelson H. F. Beebe in
5074 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
5075
5076 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
5077 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
5078 Group compiler. Instead, use "$CC -E bar.c". Include the .h
5079 file twice in the grammar, as an extra check.
5080
5081 * tests/input.at (Torturing the Scanner): Surround the
5082 backslash-newline tests with "#if 0", to make it less likely that
5083 we'll run into compiler bugs. Bring back solitary \ inside
5084 comment, but add a closing comment to work around HP C bug. Don't
5085 test backslash-newline in C character constant.
5086
50872002-11-14 Akim Demaille <akim@epita.fr>
5088
5089 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
5090 status of the compiler.
5091 Calling `exit 1' is no longer needed.
5092 Reported by Nelson H. F. Beebe.
5093
50942002-11-14 Akim Demaille <akim@epita.fr>
5095
5096 * tests/atlocal.in (CPPFLAGS): We have config.h.
5097 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
5098 New.
5099 * tests/actions.at, tests/calc.at, tests/conflicts.at,
5100 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
5101 * tests/regression.at, tests/torture.at: Use them for all the
5102 grammars that are to be compiled.
5103 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
5104 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
5105 * doc/bison.texinfo (GLR Parsers): Document `inline'.
5106
51072002-11-14 Akim Demaille <akim@epita.fr>
5108
5109 * doc/bison.texinfo: Various formatting changes (alignments in
5110 samples, additional @group/@end group, GCS in samples.
5111 Use @deffn instead of simple @table to define the directives,
5112 macros, variables etc.
5113
51142002-11-13 Paul Eggert <eggert@twinsun.com>
5115
5116 Fix some bugs reported by Albert Chin-A-Young in
5117 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
5118
5119 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
5120 -o c"; the HP C compiler chatters during compilation.
5121 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
5122 * tests/headers.at (export YYLTYPE): Likewise.
5123
5124 * tests/input.at (Torturing the Scanner): Remove lines containing
5125 solitary backslashes, as they tickle a bug in the HP C compiler.
5126
5127 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
5128 comments, since they're not portable. Use GNU coding style.
5129
51302002-11-13 Akim Demaille <akim@epita.fr>
5131
5132 * data/yacc.c: Leave bigger chunks of quoted text.
5133 (YYDSYMPRINTF): New.
5134 Use it to report symbol activities.
5135 * data/glr.c (YYDSYMPRINTF): New.
5136 Use it.
5137
51382002-11-12 Paul Eggert <eggert@twinsun.com>
5139
5140 Version 1.75b.
5141
5142 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
5143 (yyglrReduce): Return yyok, not 0.
5144 This should avoid the enumerated-type warnings reported
5145 by Nelson H. F. Beebe in
5146 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
5147
5148 * lib/bbitset.h (BITSET_INLINE): Remove.
5149 * lib/bitset.h [! BITSET_INLINE]: Remove.
5150 (bitset_set, bitset_reset, bitset_test): Rename local vars
5151 to avoid shadowing warnings by GCC.
5152
5153 * data/glr.c (inline): Remove #define. It's the user's
5154 responsibility to #define it away, just like 'const'.
5155 This fixes one of the bugs reported by Nelson H. F. Beebe in
5156 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
5157
5158 * Makefile.maint (po-check): Scan .l and .y files instead of the
5159 .c and the .h files that they generate. This fixes the bug
5160 reported by Tim Van Holder in:
5161 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
5162 Look for N_ as well as for _. Try to avoid matching #define for
5163 N_ and _.
5164 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
5165 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
5166 * src/scan-gram.l: Revamp regular expressions so that " and '
5167 do not confuse xgettext.
5168
5169 * src/struniq.h (struniq_new): Do not declare the return type
5170 to be 'const'; this violates the C standard.
5171 * src/struniq.c (struniq_new): Likewise.
5172
51732002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
5174
5175 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
5176 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
5177 linker.
5178
51792002-11-12 Akim Demaille <akim@epita.fr>
5180
5181 * Makefile.maint: Sync with Autoconf:
5182 (local_updates): New.
5183
51842002-11-12 Akim Demaille <akim@epita.fr>
5185
5186 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
5187
51882002-11-12 Akim Demaille <akim@epita.fr>
5189
5190 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
5191 locations.
5192
51932002-11-12 Akim Demaille <akim@epita.fr>
5194
5195 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
5196 not yyvalue.
5197
51982002-11-12 Akim Demaille <akim@epita.fr>
5199
5200 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
5201 Use it to test the GLR parser.
5202
52032002-11-12 Akim Demaille <akim@epita.fr>
5204
5205 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
5206 defines it.
5207 * data/glr.c (yystos): New.
5208 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
5209 (YYDSYMPRINT): New.
5210 (yyval): Don't define it, it is handled via M4.
5211 (yyrecoverParseError): Free verbosely the discarded symbols.
5212 * data/yacc.c (yysymprint): Remove, rather...
5213 (b4_yysymprint_generate): invoke.
5214 * data/c.m4 (b4_yysymprint_generate): New.
5215 Accept pointers as arguments, as opposed to the version from
5216 yacc.c.
5217 (b4_yydestruct_generate): Likewise.
5218 * tests/cations.at (Printers and Destructors): Use Bison directives
5219 instead of CPP macros.
5220 Don't rely on internal details.
5221
52222002-11-12 Akim Demaille <akim@epita.fr>
5223
5224 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
5225 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
5226 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
5227 it against YYEMPTY and so forth), work on yytoken (i.e., set
5228 it to YYEMPTY etc.).
5229 (yydestruct): Replace with a b4_yydestruct_generate invocation.
5230 (b4_symbol_actions): Remove.
5231 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
5232 for 0, end-of-input.
5233
52342002-11-12 Akim Demaille <akim@epita.fr>
5235
5236 * doc/bison.texinfo (Destructor Decl): New.
5237
52382002-11-12 Akim Demaille <akim@epita.fr>
5239
5240 * src/tables.c (tables_generate): Use free for pointers that
5241 cannot be NULL, not XFREE.
5242 (pack_vector): Use assert, not fatal, for bound violations.
5243 * src/state.c (state_new): Likewise.
5244 * src/reader.c (reader): Likewise.
5245 * src/lalr.c (set_goto_map): Likewise.
5246 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
5247 the file name.
5248
52492002-11-12 Akim Demaille <akim@epita.fr>
5250
5251 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
5252 Restore.
5253 * src/scan-gram.l (last_string): Is global to the file, not to
5254 yylex.
5255 * src/parse-gram.y (input): Don't append the epilogue here,
5256 (epilogue.opt): do it here, and free the scanner's obstack.
5257 * src/reader.c (epilogue_set): Rename as...
5258 (epilogue_augment): this.
5259 * data/c.m4 (b4_epilogue): Defaults to empty.
5260
52612002-11-12 Akim Demaille <akim@epita.fr>
5262
5263 * src/getargs.c (long_options): Remove duplicates.
5264 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
5265 Remove.
5266 * doc/bison.rnh: Remove.
5267 * doc/bison.texinfo (VMS Invocation): Remove.
5268
52692002-11-12 Akim Demaille <akim@epita.fr>
5270
5271 * src/struniq.h, src/struniq.c (struniq_t): Is const.
5272 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
5273
5274 Use struniq for symbols.
5275
5276 * src/symtab.h (symbol_t): The tag member is a struniq.
5277 (symbol_type_set): Adjust.
5278 * src/symtab.c (symbol_new): Takes a struniq.
5279 (symbol_free): Don't free the tag member.
5280 (hash_compare_symbol_t, hash_symbol_t): Rename as...
5281 (hash_compare_symbol, hash_symbol): these.
5282 Use the fact that tags as struniqs.
5283 (symbol_get): Use struniq_new.
5284 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
5285 Returns a strniq.
5286 * src/reader.h (merger_list, grammar_currentmerge_set): The name
5287 and type members are struniqs.
5288 * src/reader.c (get_merge_function)
5289 (grammar_current_rule_merge_set): Adjust.
5290 (TYPE, current_type): Are struniq.
5291
5292 Use struniq for file names.
5293
5294 * src/files.h, src/files.c (infile): Split into...
5295 (grammar_file, current_file): these.
5296 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
5297 * src/reduce.c (reduce_print): Likewise.
5298 * src/getargs.c (getargs): Likewise.
5299 * src/complain.h, src/complain.c: Likewise.
5300 * src/main.c (main): Call struniqs_new early enough to use it for
5301 file names.
5302 Don't free the input file name.
5303
53042002-11-12 Akim Demaille <akim@epita.fr>
5305
5306 * src/symtab.c (symbol_free): Remove dead deactivated code:
5307 type_name are properly removed.
5308 Don't use XFREE to free items that cannot be NULL.
5309 * src/struniq.h, src/struniq.c: New.
5310 * src/main.c (main): Initialize/free struniqs.
5311 * src/parse-gram.y (%union): Add astruniq member.
5312 (yyprint): Adjust.
5313 * src/scan-gram.l (<{tag}>): Return a struniq.
5314 Free the obstack bit that used to store it.
5315 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
5316
53172002-11-11 Paul Eggert <eggert@twinsun.com>
5318
5319 Revamp to fix many (but not all) of the C- and M4-related quoting
5320 problems. Among other things, this fixes the Bison bug reported
5321 by Jan Hubicka when processing the Bash grammar; see:
5322 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
5323
5324 Use new @ escapes consistently. Represent brackets with @{ and @}
5325 rather than @<:@ and @:>@, since this works a bit better with dumb
5326 editors like vi. Represent @ with @@, since @ is now consistently
5327 an escape. Use @oline@ and @ofile@ rather than __oline__ and
5328 __ofile__, to avoid unexpected expansions. Similarly, use @output
5329 rather than #output.
5330
5331 * data/c.m4 (b4_copyright): Omit file name from comment, since
5332 the file name could contain "*/".
5333 (b4_synclines_flag): Don't quote the 2nd argument; it should already
5334 be quoted. All uses changed.
5335
5336 * data/glr.c: Use new @ escapes consistently.
5337 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
5338 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
5339 Remove, since they couldn't handle arbitrary characters in file
5340 names.
5341 * data/lalr1.cc: Likewise.
5342 * data/yacc.c: Likewise.
5343
5344 * src/files.c (output_infix): Remove; all uses removed.
5345 * src/files.h: Likewise.
5346
5347 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
5348 mishandled funny characters in file names, and anyway it isn't
5349 needed any more.
5350 * data/yacc.c: Likewise.
5351 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
5352
5353 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
5354 * data/yacc.c: Likewise.
5355
5356 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
5357 strings now.
5358 (muscle_init): Quote filename as a C string.
5359 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
5360 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
5361 * src/output.c (escaped_file_name_output): New function.
5362 (prepare_symbols): Quote tokens for M4.
5363 (prepare): Don't insert output_infix, output_prefix,
5364 output_parser_name, output_header_name; this is now down by scan-skel.
5365 Insert skeleton as a C string.
5366
5367 * src/output.c (user_actions_output, symbol_destructors_output,
5368 symbol_printers_output): Quote filenames for C and M4.
5369 * src/reader.c (prologue_augment, epilogue_set): Likewise.
5370
5371 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
5372 escapes other than \\ and \'; this simplifies the code.
5373 (<SC_STRING>): Likewise, for \\ and \".
5374 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
5375 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
5376 Use new escapes @{ and @} for [ and ].
5377
5378 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
5379 them with auto vars.
5380 Switch to new escape scheme, where @ is the escape character uniformly.
5381 Abort if a stray escape character is found. Avoid unbounded input
5382 buffer when parsing non-escaped text.
5383
5384 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
5385 __oline__, #output, $@, and @{ do not have unintended meanings.
5386
53872002-11-09 Paul Eggert <eggert@twinsun.com>
5388
5389 Fix the test failure due to GCC warnings described in
5390 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
5391 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
5392 evaluate to 0 if it's impossible for NINF to be in the respective
5393 table.
5394 (yygetLRActions, yyrecoverParseError): Use them.
5395
5396 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
5397 counted in the token inserted at end of file. Now takes
5398 location_t *, not location_t, so that the location can be
5399 adjusted. All uses changed.
5400
5401 * tests/regression.at (Invalid inputs): Adjust wording in
5402 diagnostic to match the new behavior.
5403
5404 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
5405 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
5406 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
5407 abort ();'. This reduces the runtime of the "Many lookaheads"
5408 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
5409 GCC 3.2.
5410
54112002-11-07 Paul Eggert <eggert@twinsun.com>
5412
5413 * src/parse-gram.y (CHARACTER): Remove unused token.
5414 All uses removed.
5415
5416 * src/scan-gram.l: Remove stack option. We no longer use the
5417 stack, since the stack was never deeper than 1; instead, use the
5418 new auto var c_context to record the stacked value.
5419
5420 Remove nounput option. At an unexpected end of file, we now unput
5421 the minimal input necessary to end cleanly; this simplifies the
5422 code.
5423
5424 Avoid unbounded token sizes where this is easy.
5425
5426 (unexpected_end_of_file): New function.
5427 Use it to systematize the error message on unexpected EOF.
5428 (last-string): Now auto, not static.
5429 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
5430 (scanner_last_string_free): Remove; not used.
5431 (percent_percent_count): Move decl to just before use.
5432 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
5433 not the (never otherwised-used) CHARACTER.
5434
54352002-11-07 Akim Demaille <akim@epita.fr>
5436
5437 Let yyerror always receive the msg as last argument, so that
5438 yyerror can be variadic.
5439
5440 * data/yacc.c (b4_yyerror_args): New.
5441 Use it when calling yyerror.
5442 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
5443 Use it when calling yyerror.
5444 * doc/bison.texinfo (Error Reporting): Adjust.
5445 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
5446 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
5447
54482002-11-06 Akim Demaille <akim@epita.fr>
5449
5450 #line should have quoted strings.
5451 Ideally, this should be done by m4_quotearg.
5452
5453 * src/scan-skel.l: Include quotearg.h.
5454 Quote __ofile__.
5455 * src/output.c (symbol_printers_output)
5456 (symbol_destructors_output): Quote the file name.
5457
54582002-11-06 Akim Demaille <akim@epita.fr>
5459
5460 * tests/regression.at (Invalid inputs): Adjust to the recent
5461 messages.
5462
54632002-11-06 Akim Demaille <akim@epita.fr>
5464
5465 Restore --no-lines.
5466 Reported by Jim Kent.
5467
5468 * data/c.m4 (b4_syncline): New.
5469 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
5470 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
5471 * src/output.c (user_actions_output): Likewise.
5472 (prepare): Define 'b4_synclines_flag'.
5473 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
5474
54752002-11-06 Akim Demaille <akim@epita.fr>
5476
5477 * src/main.c (main): Free `infile'.
5478 * src/scan-gram.l (handle_syncline): New.
5479 Recognize `#line'.
5480 * src/output.c (user_actions_output, symbol_destructors_output)
5481 (symbol_printers_output): Use the location's file name, not
5482 infile.
5483 * src/reader.c (prologue_augment, epilogue_set): Likewise.
5484
54852002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5486
5487 * src/tables.c (matching_state): Don't allow states to match if
5488 either has GLR conflict entries.
5489
54902002-11-05 Paul Eggert <eggert@twinsun.com>
5491
5492 * src/scan-gram.l: Use more accurate diagnostics, e.g.
5493 "integer out of range" rather than "invalid value".
5494 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
5495 accordingly.
5496
5497 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
5498 Also, remove one static variable in the scanner.
5499
5500 * src/scan-gram.l (braces_level): Now auto, not static.
5501 Initialize to zero if the compiler is being picky.
5502 (INITIAL): Clear braces_level instead of incrementing it.
5503 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
5504 as POSIX 1003.1-2001 requires.
5505 * src/system.h (IF_LINT): New macro, taken from coreutils.
5506 * configure.ac: Define "lint" if --enable-gcc-warnings.
5507
55082002-11-05 Akim Demaille <akim@epita.fr>
5509
5510 * src/scan-gram.l: When it starts with `%', complain about the
5511 whole directive, not just that `invalid character: %'.
5512
55132002-11-04 Akim Demaille <akim@epita.fr>
5514
5515 * Makefile.maint: Update from Autoconf.
5516 (update, cvs-update, po-update, do-po-update): New.
5517
55182002-11-04 Akim Demaille <akim@epita.fr>
5519
5520 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
5521 and yyerror.
5522 Have yyerror `use' its arguments.
5523 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
5524 returns true when location & yacc & pure & parse-param.
5525 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
5526
55272002-11-04 Akim Demaille <akim@epita.fr>
5528
5529 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
5530 clashes.
5531 * src/scan-gram.l: Use [\'] instead of ['] to pacify
5532 font-lock-mode.
5533 Use complain_at.
5534 Use quote, not quote_n since LOCATION_PRINT no longer uses the
5535 slot 0.
5536
55372002-11-03 Paul Eggert <eggert@twinsun.com>
5538
5539 * src/reader.c (get_merge_function, grammar_current_rule_check):
5540 Use consistent diagnostics for reporting type name clashes.
5541 Quote the types with <>, for consistency with Yacc.
5542 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
5543
55442002-11-03 Akim Demaille <akim@epita.fr>
5545
5546 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
5547 New.
5548 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
5549 (b4_parse_param): Remove.
5550 Use b4_identification.
5551 Propagate b4_pure_args where needed to pass them to yyerror.
5552 * data/glr.m4 (b4_parse_param): Remove.
5553 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
5554 (b4_lpure_formals): New.
5555 Use b4_identification.
5556 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
5557 b4_user_formals and b4_user_args.
5558 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
5559 (yyreportAmbiguity): When using a pure parser, also need
5560 the location, and the parse-params.
5561 Adjust callers.
5562 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
5563 When using a pure parser, also need the parse-params.
5564 Adjust callers.
5565 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
5566 (%pure-parser + %parse-param) LALR and GLR parsers.
5567 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
5568 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
5569 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
5570 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
5571 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
5572 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
5573 * doc/bison.texinfo: Untabify the whole file.
5574 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
5575 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
5576 (Error Reporting): Adjust to these new directives.
5577 Document %error-verbose, deprecate YYERROR_VERBOSE.
5578
55792002-11-03 Akim Demaille <akim@epita.fr>
5580
5581 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
5582 AT_CHECK_CALC_GLR invocations to use % directives, instead of
5583 command line options.
5584 * tests/cxx-type.at: Formatting changes.
5585
55862002-11-03 Paul Eggert <eggert@twinsun.com>
5587
5588 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
5589 to count columns correctly, and to check for invalid inputs.
5590
5591 Use mbsnwidth to count columns correctly. Account for tabs, too.
5592 Include mbswidth.h.
5593 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
5594 (extend_location): New function.
5595 (YY_LINES): Remove.
5596
5597 Handle CRLF in C code rather than in Lex code.
5598 (YY_INPUT): New macro.
5599 (no_cr_read): New function.
5600
5601 Scan UCNs, even though we don't fully handle them yet.
5602 (convert_ucn_to_byte): New function.
5603
5604 Handle backslash-newline correctly in C code.
5605 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
5606 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
5607 all uses changed.
5608 (tag, splice): New EREs. Do not allow NUL or newline in tags.
5609 Use {splice} wherever C allows backslash-newline.
5610 YY_STEP after space, newline, vertical-tab.
5611 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
5612
5613 (letter, id): Don't assume ASCII; e.g., spell out a-z.
5614
5615 ({int}, handle_action_dollar, handle_action_at): Check for integer
5616 overflow.
5617
5618 (YY_STEP): Omit trailing semicolon, so that it's more like C.
5619
5620 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
5621 as well as \000. Check for UCHAR_MAX, not 255.
5622 Allow \x with an arbitrary positive number of digits, as in C.
5623 Check for overflow here.
5624 Allow \? and UCNs, for compatibility with C.
5625
5626 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
5627 with quote slot used by complain_at.
5628
5629 * tests/input.at: Add tests for backslash-newline, m4 quotes
5630 in symbols, long literals, and funny escapes in strings.
5631
5632 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
5633 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
5634 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
5635 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
5636 * m4/mbswidth.m4: New file, from GNU coreutils.
5637
5638 * doc/bison.texinfo (Grammar Outline): Document // comments.
5639 (Symbols): Document that trigraphs have no special meaning in Bison,
5640 nor is backslash-newline allowed.
5641 (Actions): Document that trigraphs have no special meaning.
5642
5643 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
5644 no longer used.
5645
56462002-11-02 Paul Eggert <eggert@twinsun.com>
5647
5648 * src/reader.c: Don't include quote.h; not needed.
5649 (get_merge_function): Reword warning to be consistent with
5650 type clash diagnostic in grammar_current_rule_check.
5651
5652 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
5653 bug in trigraph handling.
5654
5655 * src/output.c (prepare_symbols): When printing token names,
5656 escape "[" as "@<:@" and likewise for "]".
5657
5658 * src/system.h (errno): Remove declaration, as we are now
5659 assuming C89 or better, and C89 guarantees errno.
5660
56612002-10-30 Paul Eggert <eggert@twinsun.com>
5662
5663 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
5664 Check for close failures.
5665 * src/files.h (xfclose): Return void, not int, since it always
5666 returned zero.
5667 * src/files.c (xfclose): Likewise. Report I/O error if ferror
5668 indicates one.
5669 * src/output.c (output_skeleton): Use xfclose rather than fclose
5670 and ferror. xfclose now checks ferror.
5671
5672 * data/glr.c (YYLEFTMOST_STATE): Remove.
5673 (yyreportTree): Use a stack-based leftmost state. This avoids
5674 our continuing battles with bogus warnings about initializers.
5675
56762002-10-30 Akim Demaille <akim@epita.fr>
5677
5678 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
5679 #if.
5680
56812002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5682
5683 * tests/glr-regr1.at: New test for reported regressions.
5684 * tests/testsuite.at: Add glr-regr1.at test.
5685 * tests/Makefile.am: Add glr-regr1.at test.
5686
56872002-10-24 Paul Eggert <eggert@twinsun.com>
5688
5689 Version 1.75a.
5690
5691 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
5692 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
5693 we use malloc. Don't assume 'A' through 'Z' are contiguous.
5694 Don't assume strdup exists; POSIX says its an XSI extension.
5695 Check for buffer overflow on input.
5696
56972002-10-24 Akim Demaille <akim@epita.fr>
5698
5699 * src/output.c (output_skeleton): Don't disable M4sugar comments
5700 too soon: it results in comments being expanded.
5701 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
5702 first output.
5703
57042002-10-24 Akim Demaille <akim@epita.fr>
5705
5706 * data/yacc.c (m4_int_type): New.
5707 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
5708 char' as only yacc.c wants K&R portability.
5709 * data/glr.c (yysigned_char): Remove.
5710 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
5711 Reported by Quoc Peyrot.
5712
57132002-10-23 Paul Eggert <eggert@twinsun.com>
5714
5715 * src/main.c (main): With --trace=time, report times even if a
5716 non-fatal error occurs. Formerly, the times were reported in some
5717 such cases but not in others.
5718 * src/reader.c (reader): Just return if a complaint has been issued,
5719 instead of exiting, so that 'main' can report times.
5720
57212002-10-22 Akim Demaille <akim@epita.fr>
5722
5723 * src/system.h: Include sys/types.
5724 Reported by Bert Deknuydt.
5725
57262002-10-23 Paul Eggert <eggert@twinsun.com>
5727
5728 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
5729 Suggested by Art Haas.
5730
57312002-10-22 Paul Eggert <eggert@twinsun.com>
5732
5733 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
5734 decl; not needed any more.
5735 * src/main.c (main): Use return to exit, undoing yesterday's change.
5736 The last OS that we could find where this wouldn't work is
5737 SunOS 3.5, and that's too old to worry about now.
5738
5739 * data/glr.c (struct yyltype): Define members even when not
5740 doing locations. This is more consistent with yacc.c, and it
5741 works around the following bug reports:
5742 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
5743 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
5744
5745 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
5746 @acronym consistently. Standardize on "Yacc" instead of "YACC",
5747 "Algol" instead of "ALGOL". Give a bit more history about BNF.
5748
57492002-10-22 Akim Demaille <akim@epita.fr>
5750
5751 * data/README: New.
5752
57532002-10-21 Paul Eggert <eggert@twinsun.com>
5754
5755 Be consistent about 'bool'; the old code used an enum in one
5756 module and an int in another, and this violates the C standard.
5757 * m4/stdbool.m4: New file, from coreutils 4.5.3.
5758 * configure.ac (AC_HEADER_STDBOOL): Add.
5759 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
5760 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
5761 * src/symtab.c (hash_compare_symbol_t): Likewise.
5762 * src/system.h (bool, false, true): Use a definition consistent
5763 with ../lib/hash.c. All uses changed.
5764
5765 * src/complain.c (warning_issued): Renamed from warn_message_count,
5766 so that we needn't worry about integer overflow (!).
5767 Now of type bool. All uses changed.
5768 (complaint_issued): Renamed from complain_message_count; likewise.
5769
5770 * src/main.c (main): Use exit to exit with failure.
5771
5772 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
5773 rather than 1 and 0.
5774 * src/main.c (main): Likewise.
5775 * src/getargs.c (getargs): Likewise.
5776 * src/reader.c (reader): Likewise.
5777
5778 * src/getarg.c (getargs): Remove duplicate code for
5779 "Try `bison --help'".
5780
5781 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
5782 What was that "2" for?
5783
5784 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
5785 * src/getargs.c (usage): Likewise.
5786
5787 * src/getargs.c (getargs): When there are too few operands, report
5788 the last one. When there are too many, report the first extra
5789 one. This is how diffutils does it.
5790
57912002-10-20 Paul Eggert <eggert@twinsun.com>
5792
5793 Remove K&R vestiges.
5794 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
5795 * src/complain.c (VA_START): Remove. Assume prototypes.
5796 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
5797 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
5798 fatal): Assume prototypes.
5799 * src/complain.h: Assume prototypes.
5800 * src/system.h (PARAMS): Remove.
5801 Include <limits.h> unconditionally, since it's guaranteeed even
5802 for a freestanding C89 compiler.
5803 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
5804 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
5805
58062002-10-20 Akim Demaille <akim@epita.fr>
5807
5808 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
5809 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
5810 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
5811 (yyresolveStates, yyresolveAction, yyresolveStack)
5812 (yyprocessOneStack): Use them.
5813 (yy_reduce_print): New.
5814 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
5815
58162002-10-20 Akim Demaille <akim@epita.fr>
5817
5818 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
5819 arguments and output `void'.
5820 (b4_c_function): Rename as...
5821 (b4_c_function_def): this.
5822 (b4_c_function_decl, b4_c_ansi_function_def)
5823 (b4_c_ansi_function_decl): New.
5824 Change the interpretation of the arguments: before `int, foo', now
5825 `int foo, foo'.
5826 * data/yacc.c (yyparse): Prototype and define thanks to these.
5827 Adjust b4_c_function_def uses.
5828 * data/glr.c (yyparse): Likewise, but ANSI only.
5829
58302002-10-20 Akim Demaille <akim@epita.fr>
5831
5832 * src/output.c (prepare): Move the definition of `tokens_number',
5833 `nterms_number', `undef_token_number', `user_token_number_max'
5834 to...
5835 (prepare_tokens): Here.
5836 (prepare_tokens): Rename as...
5837 (prepare_symbols): this.
5838 (prepare): Move the definition of `rules_number' to...
5839 (prepare_rules): here.
5840 (prepare): Move the definition of `last', `final_state_number',
5841 `states_number' to...
5842 (prepare_states): here.
5843 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
5844
58452002-10-20 Akim Demaille <akim@epita.fr>
5846
5847 * src/tables.h, src/tables.c, src/output.c: Comment changes.
5848
58492002-10-20 Akim Demaille <akim@epita.fr>
5850
5851 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
5852 * data/c.m4: here.
5853
58542002-10-20 Akim Demaille <akim@epita.fr>
5855
5856 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
5857 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
5858 `pair'.
5859 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
5860 `name' to...
5861 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
5862 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
5863 These.
5864
58652002-10-19 Paul Eggert <eggert@twinsun.com>
5866
5867 Do not create a temporary file, as that involves security and
5868 cleanup headaches. Instead, use a pair of pipes.
5869 Derived from a suggestion by Florian Krohm.
5870 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
5871 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
5872 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
5873 (BISON_PREREQ_SUBPIPE): Add.
5874 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
5875 Add subpipe.h, subpipe.c.
5876 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
5877 * po/POTFILES.in: Add lib/subpipe.c.
5878 * src/output.c: Include "subpipe.h".
5879 (m4_invoke): Remove decl.
5880 (scan_skel): New decl.
5881 (output_skeleton): Use pipe rather than temporary file for m4 input.
5882 Check that m4sugar.m4 is readable, to avoid deadlock.
5883 Check for pipe I/O error.
5884 * src/scan-skel.l (readpipe): Remove decl.
5885 (scan_skel): New function, to be used in place of m4_invoke.
5886 Read from stream rather than file.
5887
5888 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
5889 float, as this generates a warning on Solaris 8 + GCC 3.2 with
5890 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
5891 this generates a more-accurate value anyway.
5892
5893 * lib/timevar.c (timervar_accumulate): Rename locals to
5894 avoid confusion with similarly-named more-global.
5895 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
5896
5897 * src/output.c (prepare): Use xstrdup to convert char const *
5898 to char *, to avoid GCC warning.
5899
59002002-10-19 Akim Demaille <akim@epita.fr>
5901
5902 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
5903 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
5904 Use them to have `calc.y' ready for %pure-parser.
5905 * data/yacc.c (YYLEX): Pass a yylex return type to
5906 b4_c_function_call.
5907
59082002-10-19 Akim Demaille <akim@epita.fr>
5909
5910 Prototype support of %lex-param and %parse-param.
5911
5912 * src/parse-gram.y: Add the definition of the %lex-param and
5913 %parse-param tokens, plus their rules.
5914 Drop the `_' version of %glr-parser.
5915 Add the "," token.
5916 * src/scan-gram.l (INITIAL): Scan them.
5917 * src/muscle_tab.c: Comment changes.
5918 (muscle_insert, muscle_find): Rename `pair' as `probe'.
5919 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
5920 (muscle_entry_s): The `value' member is no longer const.
5921 Adjust all dependencies.
5922 * src/muscle_tab.c (muscle_init): Adjust: use
5923 MUSCLE_INSERT_STRING.
5924 Initialize the obstack earlier.
5925 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
5926 (muscle_pair_list_grow): New.
5927 * data/c.m4 (b4_c_function_call, b4_c_args): New.
5928 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
5929 * tests/calc.at: Use %locations, not --locations.
5930 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
5931
59322002-10-19 Akim Demaille <akim@epita.fr>
5933
5934 * src/getargs.c (usage): Take status as argument and exit
5935 accordingly.
5936 Report the traditional `Try ... --help' message when status != 0.
5937 (usage, version): Don't take a FILE * as arg, it is pointless.
5938 (getargs): When there is an incorrect number of arguments, make it
5939 an error, and report it GNUlically thanks to `usage ()'.
5940
59412002-10-18 Paul Eggert <eggert@twinsun.com>
5942
5943 * data/glr.c (yyreportParseError): Don't assume that sprintf
5944 yields the length of the printed string, as this is not true
5945 on SunOS 4.1.4. Reported by Peter Klein.
5946
5947 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
5948 * tests/conflicts.at (%nonassoc and eof): Likewise.
5949 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
5950
59512002-10-17 Akim Demaille <akim@epita.fr>
5952
5953 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
5954 * src/getargs.c (trace_types, trace_args): Adjust.
5955 * src/reader.c (grammar_current_rule_prec_set)
5956 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
5957 Standardize error messages.
5958 And s/@prec/%prec/!
5959 (reader): Use trace_flag to enable scanner/parser debugging,
5960 instead of an adhoc scheme.
5961 * src/scan-gram.l: Remove trailing debugging code.
5962
59632002-10-16 Paul Eggert <eggert@twinsun.com>
5964
5965 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
5966 MUSCLE_TAB_H.
5967
5968 * NEWS: Officially drop support for building Bison with K&R C,
5969 since it didn't work anyway and it's not worth worrying about.
5970 * Makefile.maint (wget_files): Remove ansi2knr.c.
5971 (ansi2knr.c-url_prefix): Remove.
5972 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
5973 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
5974 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
5975
59762002-10-15 Paul Eggert <eggert@twinsun.com>
5977
5978 Stop using the "enum_" trick for K&R-style function definitions;
5979 it confused me, and I was the author! Instead, assume that people
5980 who want to use K&R C compilers (when using these modules in GCC,
5981 perhaps?) will run ansi2knr.
5982
5983 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
5984 All uses of "enum_" changed to "enum ".
5985 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
5986 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
5987
5988 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
5989 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
5990 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
5991 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
5992 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
5993 abitset_not, abitset_ones, abitset_or, abitset_or_and,
5994 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
5995 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
5996 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
5997 Use function prototypes; this removes the need for declaring
5998 static functions simply to provide their prototypes.
5999 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
6000 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
6001 bitset_count_, bitset_create, bitset_dump, bitset_first,
6002 bitset_free, bitset_init, bitset_last, bitset_next,
6003 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
6004 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
6005 bitset_print, bitset_release_memory, bitset_toggle_,
6006 bitset_type_choose, bitset_type_get, bitset_type_name_get,
6007 debug_bitset): Likewise.
6008 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
6009 * lib/bitset_stats.c (bitset_log_histogram_print,
6010 bitset_percent_histogram_print, bitset_stats_and,
6011 bitset_stats_and_cmp, bitset_stats_and_or,
6012 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
6013 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
6014 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
6015 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
6016 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
6017 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
6018 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
6019 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
6020 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
6021 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
6022 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
6023 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
6024 bitset_stats_zero): Likewise.
6025 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
6026 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
6027 bitsetv_dump, debug_bitsetv): Likewise.
6028 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
6029 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
6030 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
6031 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
6032 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
6033 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
6034 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
6035 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
6036 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
6037 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
6038 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
6039 Likewise.
6040 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
6041 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
6042 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
6043 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
6044 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
6045 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
6046 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
6047 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
6048 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
6049 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
6050 lbitset_xor_cmp, lbitset_zero): Likewise.
6051
60522002-10-14 Akim Demaille <akim@epita.fr>
6053
6054 Version 1.75.
6055
60562002-10-14 Akim Demaille <akim@epita.fr>
6057
6058 * tests/Makefile.am (maintainer-check-posix): New.
6059
60602002-10-14 Akim Demaille <akim@epita.fr>
6061
6062 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
6063 member.
6064
60652002-10-14 Akim Demaille <akim@epita.fr>
6066
6067 * src/tables.c (table_ninf_remap): base -> tab.
6068 Reported by Matt Rosing.
6069
60702002-10-14 Paul Eggert <eggert@twinsun.com>
6071
6072 * tests/action.at, tests/calc.at, tests/conflicts.at,
6073 tests/cxx-type.at, tests/headers.at, tests/input.at,
6074 tests/regression.at, tests/synclines.at, tests/torture.at:
6075 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
6076 so that the tests still work even if POSIXLY_CORRECT is set.
6077 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
6078
6079 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
6080 for portability to K&R hosts. Fix typo: signed char is guaranteed
6081 only to 127, not to 128.
6082 * data/glr.c (yysigned_char): New type.
6083 * data/yacc.c (yysigned_char): Likewise.
6084 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
6085
60862002-10-13 Paul Eggert <eggert@twinsun.com>
6087
6088 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
6089 true due to limited range of data type" warning from GCC.
6090
6091 * data/c.m4 (b4_token_defines): Protect against double-inclusion
6092 by wrapping enum yytokentype's definition inside #ifndef
6093 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
6094
60952002-10-13 Akim Demaille <akim@epita.fr>
6096
6097 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
6098 Un yy- yyrhs to avoid the name clash with the global YYRHS.
6099
61002002-10-13 Akim Demaille <akim@epita.fr>
6101
6102 * Makefile.maint: Update from Autoconf 2.54.
6103 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
6104
61052002-10-13 Akim Demaille <akim@epita.fr>
6106
6107 * src/print.c (print_state): Separate the list of solved conflicts
6108 from the other items.
6109 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
6110
61112002-10-13 Akim Demaille <akim@epita.fr>
6112
6113 Let nondeterministic skeletons be usable with deterministic
6114 tables.
6115
6116 With the patch, GAWK compiled by GCC without -O2 passes its test
6117 suite using a GLR parser driven by LALR tables. It fails with -O2
6118 because `struct stat' gives two different answers on my machine:
6119 88 (definition of an auto var) and later 96 (memset on this var).
6120 Hence the stack is badly corrumpted. The headers inclusion is to
6121 blame: if I move the awk.h inclusion before GLR's system header
6122 inclusion, the two struct stat have the same size.
6123
6124 * src/tables.c (pack_table): Always create conflict_table.
6125 (token_actions): Always create conflict_list.
6126 * data/glr.c (YYFLAG): Remove, unused.
6127
61282002-10-13 Akim Demaille <akim@epita.fr>
6129
6130 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
6131 (O0FLAGS): New.
6132 (VALGRIND, GXX): New.
6133 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
6134 * tests/bison.in: Run $PREBISON a pre-command.
6135 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
6136 (maintainer-check-g++): New.
6137 * Makefile.am (maintainer-check): New.
6138
61392002-10-13 Akim Demaille <akim@epita.fr>
6140
6141 * data/glr.c: Formatting changes.
6142 Tweak some trace messages to match yacc.c's.
6143
61442002-10-13 Akim Demaille <akim@epita.fr>
6145
6146 GLR parsers sometimes raise parse errors instead of performing the
6147 default reduction.
6148 Reported by Charles-Henry de Boysson.
6149
6150 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
6151 check the length of the traces when %glr.
6152 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
6153 GLR's traces.
6154 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
6155 Test GLR parsers.
6156 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
6157 (yyltype): Remove the yy prefix from the member names.
6158 (yytable): Complete its comment.
6159 (yygetLRActions): Map error action number from YYTABLE from
6160 YYTABLE_NINF to 0.
6161 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
6162 (which was a bug: it should have been YYTABEL_NINF, and yet it was
6163 not satisfying as we could compare an YYACTION computed from
6164 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
6165 only value for error actions.
6166 (yyreportParseError): In verbose parse error messages, don't issue
6167 `error' in the list of expected tokens.
6168 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
6169 next action to perform to match glr.c's decoding.
6170 (yytable): Complete its comment.
6171
61722002-10-13 Paul Eggert <eggert@twinsun.com>
6173
6174 Fix problem reported by Henrik Grubbstroem in
6175 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
6176 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
6177 because the Bison parser reads the second action before reducing
6178 the first one.
6179 * src/scan-gram.l (rule_length): New static var.
6180 Use it to keep track of the rule length in the scanner, since
6181 we can't expect the parser to be in lock-step sync with the scanner.
6182 (handle_action_dollar, handle_action_at): Use this var.
6183 * tests/actions.at (Exotic Dollars): Test for the problem.
6184
61852002-10-12 Paul Eggert <eggert@twinsun.com>
6186
6187 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
6188 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
6189 Include <sys/time.h> when checking for clock_t and struct tms.
6190 Use same include order as source.
6191 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
6192 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
6193
6194 * lib/timevar.c: Update copyright date and clarify comments.
6195 (get_time) [IN_GCC]: Keep the GCC version for reference.
6196
6197 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
6198 GCC version as of today, then merge Bison's changes.
6199 Change "GCC" to "Bison" in copyright notice. timevar.def's
6200 author is Akim, so change that too.
6201
6202 * src/reader.c (grammar_current_rule_check):
6203 Don't worry about the default action if $$ is untyped.
6204 Prevents bogus warnings reported by Jim Gifford in
6205 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
6206
6207 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
6208 * data/glr.c, data/lalr1.cc, data/yacc.c:
6209 Output token definitions before the first part of user declarations.
6210 Fixes compatibility problem reported by Jim Gifford for kbd in
6211 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
6212
62132002-10-11 Paul Eggert <eggert@twinsun.com>
6214
6215 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
6216 (yyparse): here. This undoes some of the 2002-07-25 change.
6217 Compatibility problem reported by Ralf S. Engelschall with
6218 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
6219
62202002-10-11 Akim Demaille <akim@epita.fr>
6221
6222 * tests/regression.at Characters Escapes): New.
6223 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
6224 characters.
6225 Reported by Jan Nieuwenhuizen.
6226
62272002-10-11 Akim Demaille <akim@epita.fr>
6228
6229 * po/id.po: New.
6230
62312002-10-10 Paul Eggert <eggert@twinsun.com>
6232
6233 Portability fixes for bitsets; this also avoids several GCC
6234 warnings.
6235
6236 * lib/abitset.c: Include <stddef.h>, for offsetof.
6237 * lib/lbitset.c: Likewise.
6238
6239 * lib/abitset.c (abitset_bytes): Return a size that is aligned
6240 properly for vectors of objects. Do not assume that adding a
6241 header size to a multiple of a word size yields a value that is
6242 properly aligned for the whole union.
6243 * lib/bitsetv.c (bitsetv_alloc): Likewise.
6244
6245 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
6246 unique names for structures.
6247 * lib/ebitset.c (ebitset_bytes): Likewise.
6248 * lib/lbitset.c (lbitset_bytes): Likewise.
6249
6250 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
6251 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
6252 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
6253 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
6254 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
6255 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
6256 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
6257 to improve the type-checking that GCC can do.
6258 * lib/bitset.c (bitset_op4_cmp): Likewise.
6259 * lib/bitset_stats.c (bitset_stats_count,
6260 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
6261 bitset_stats_copy, bitset_stats_disjoint_p,
6262 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
6263 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
6264 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
6265 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
6266 bitset_stats_and_or_cmp, bitset_stats_andn_or,
6267 bitset_stats_andn_or_cmp, bitset_stats_or_and,
6268 bitset_stats_or_and_cmp): Likewise.
6269 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
6270 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
6271 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
6272 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
6273
6274 * lib/abitset.h: Include bitset.h, not bbitset.h.
6275 * lib/ebitset.h: Likewise.
6276 * lib/lbitset.h: Likewise.
6277
6278 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
6279 All instances of parameters of type enum bitset_opts are now of
6280 type enum_bitset_opts, to conform to the C Standard, and similarly
6281 for enum_bitset_type.
6282 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
6283 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
6284
6285 Do not use "struct bitset_struct" to mean different things in
6286 different modules. Not only is this confusing, it violates
6287 the C Standard, which requires that structure types in different
6288 modules must be compatible if one is to be passed to the other.
6289 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
6290 All instances of "struct bitset_struct *" replaced with "bitset".
6291 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
6292 (union bitset_union, struct abitset_struct, struct ebitset_struct,
6293 struct lbitset_struct, struct bitset_stats_struct): New types.
6294 All uses of struct bitset_struct changed to union bitset_union,
6295 etc.
6296 * lib/abitset.c (struct abitset_struct, abitset,
6297 struct bitset_struct): Remove.
6298 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
6299 struct bitset_struct): Remove.
6300 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
6301 bitset_struct): Remove.
6302 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
6303 Likewise.
6304
6305 Do not call a function of type T using a call that assumes the
6306 function is of a different type U. Standard C requires that a
6307 function must be called with a type that is compatible with its
6308 definition.
6309 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
6310 New decls.
6311 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
6312 New functions.
6313 * lib/ebitset.c (PFV): Remove.
6314 * lib/lbitset.c (PFV): Likewise.
6315 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
6316 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
6317 decls.
6318 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
6319 (ebitset_vtable): Use them.
6320 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
6321 lbitset_xor): New functions.
6322 (lbitset_vtable): Use them.
6323
6324 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
6325 Declare.
6326
6327 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
6328 GCC warning.
6329 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
6330 Use offsetof, for simplicity.
6331
63322002-10-06 Paul Eggert <eggert@twinsun.com>
6333
6334 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
6335 the same width as int. This reapplies a hunk of the 2002-08-12 patch
6336 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6337 which was inadvertently undone by the 2002-09-30 patch.
6338 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
6339 the same width as int.
6340
63412002-10-04 Paul Eggert <eggert@twinsun.com>
6342
6343 Version 1.50.
6344
6345 * configure.ac (AC_INIT), NEWS: Increment version number.
6346
6347 * doc/bison.texinfo: Minor spelling, grammar, and white space
6348 fixes.
6349 (Symbols): Mention that any negative value returned from yylex
6350 signifies end-of-input. Warn about negative chars. Mention
6351 the portable Standard C character set.
6352
6353 The GNU coding standard says CFLAGS and YFLAGS are reserved
6354 for the installer to set.
6355 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
6356 * src/Makefile.am (AM_CFLAGS): Likewise.
6357 (AM_YFLAGS): Renamed from YFLAGS.
6358
6359 Fix some MAX and MIN problems.
6360 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
6361 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
6362 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
6363 * src/reader.c (reader): Use it.
6364
6365 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
6366 POSIX 1003.1-2001 has removed fgrep.
6367
63682002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
6369
6370 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
6371 interpreted as signed.
6372 * lib/ebitset.c (ebitset_list): Fix bug.
6373
63742002-10-01 Paul Eggert <eggert@twinsun.com>
6375
6376 More fixes for 64-bit hosts and large bitsets.
6377
6378 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
6379 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
6380 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
6381 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
6382 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
6383 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
6384 bitset_count_): Likewise.
6385 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
6386 bitset_first, bitset_last): Likewise.
6387 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
6388 bitset_stats_list_reverse, bitset_stats_size,
6389 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
6390 Likewise.
6391 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
6392 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
6393 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
6394 bitsetv_reflexive_transitive_closure): Likewise.
6395 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
6396 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
6397 Likewise.
6398 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
6399 Likewise.
6400
6401 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
6402 Use size_t, not unsigned int, to count bytes.
6403 * lib/abitset.h (abitset_bytes): Likewise.
6404 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
6405 Likewise.
6406 * lib/bitset.h (bitset_bytes): Likewise.
6407 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
6408 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
6409 * lib/bitsetv.c (bitsetv_alloc): Likewise.
6410 * lib/ebitset.c (ebitset_bytes): Likewise.
6411 * lib/ebitset.h (ebitset_bytes): Likewise.
6412 * lib/lbitset.c (lbitset_bytes): Likewise.
6413 * lib/lbitset.h (lbitset_bytes): Likewise.
6414
6415 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
6416 abitset_subset_p, abitset_disjoint_p, abitset_and,
6417 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
6418 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
6419 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
6420 abitset_or_and, abitset_or_and_cmp):
6421 Use bitset_windex instead of unsigned int.
6422 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
6423 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
6424 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
6425 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
6426 Likewise.
6427 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
6428
6429 * lib/bitset.c (bitset_print):
6430 Use proper printf formats for widths of integer types.
6431 * lib/bitset_stats.c (bitset_percent_histogram_print,
6432 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
6433 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
6434 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
6435 * lib/lbitset.c (lbitset_bytes): Likewise.
6436
6437 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
6438 BITSET_SIZE_MAX): New macros.
6439 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
6440 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
6441 to BITSET_WINDEX_MAX.
6442
6443 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
6444 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
6445 since we now return the bitset_bindex type (not int).
6446
6447 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
6448 when computing sizes.
6449 * lib/ebitset.c (ebitset_elts_grow): Likewise.
6450
6451 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
6452 and avoid cast to unsigned.
6453
64542002-09-30 Akim Demaille <akim@epita.fr>
6455
6456 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
6457 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
6458 Updates from Michael Hayes.
6459
64602002-09-30 Art Haas <ahaas@neosoft.com>
6461
6462 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
6463 invocations.
6464 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
6465 defined.
6466
64672002-09-27 Akim Demaille <akim@epita.fr>
6468
6469 Version 1.49c.
6470
64712002-09-27 Akim Demaille <akim@epita.fr>
6472
6473 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
6474 (Because of AC_LIBSOURCE).
6475
64762002-09-27 Akim Demaille <akim@epita.fr>
6477
6478 Playing with Autoscan.
6479
6480 * configure.ac: Remove the old LIBOBJ tweaks.
6481 (AC_REPLACE_FUNCS): Add strrchr and strtol.
6482 * lib/strrchr.c: New.
6483 * lib/strtol.c: New, from the Coreutils 4.5.1.
6484
64852002-09-27 Akim Demaille <akim@epita.fr>
6486
6487 Playing with Autoscan.
6488
6489 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
6490 * lib/Makefile.am (libbison_a_SOURCES): No longer include
6491 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
6492 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
6493 Coreutils 4.5.1.
6494
64952002-09-24 Akim Demaille <akim@epita.fr>
6496
6497 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
6498 (Frequently Asked Questions, Parser Stack Overflow): New.
6499
65002002-09-13 Akim Demaille <akim@epita.fr>
6501
6502 Playing with autoscan.
6503
6504 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
6505 * src/files.c (skeleton_find): Remove, unused.
6506 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
6507 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
6508
65092002-09-13 Akim Demaille <akim@epita.fr>
6510
6511 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
6512 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
6513
65142002-09-13 Akim Demaille <akim@epita.fr>
6515
6516 * configure.ac: Require 2.54.
6517 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
6518 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
6519 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
6520 Remove, provided by Autoconf macros.
6521
65222002-09-12 Akim Demaille <akim@epita.fr>
6523
6524 * m4/prereq.m4: Update, from Coreutils 4.5.1.
6525
65262002-09-12 Akim Demaille <akim@epita.fr>
6527
6528 * m4/prereq.m4: Update, from Fileutils 4.1.5.
6529 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
6530 Reported by Martin Mokrejs.
6531
65322002-09-10 Akim Demaille <akim@epita.fr>
6533
6534 * src/parse-gram.y: Associate a human readable string to each
6535 token type.
6536 * tests/regression.at (Invalid inputs): Adjust.
6537
65382002-09-10 Gary V. Vaughan <gary@gnu.org>
6539
6540 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
6541 with an Autoconf-2.5x style configure.ac.
6542
65432002-09-06 Paul Eggert <eggert@twinsun.com>
6544
6545 * doc/bison.texinfo (Conditions): Make explicit that the GPL
6546 exception applies only to yacc.c. This is a modification of a
6547 patch originally suggested by Akim Demaille.
6548
65492002-09-06 Akim Demaille <akim@epita.fr>
6550
6551 * data/c.m4 (b4_copyright): Move the GPL exception comment from
6552 here to...
6553 * data/yacc.c: here.
6554
6555 * data/lalr1.cc (struct yyltype): Don't define it, since we use
6556 LocationType.
6557 (b4_ltype): Default to yy::Location from location.hh.
6558
65592002-09-04 Jim Meyering <jim@meyering.net>
6560
6561 * data/yacc.c: Guard the declaration of yytoknum also with
6562 `#ifdef YYPRINT', so it is declared only when used.
6563
65642002-09-04 Akim Demaille <akim@epita.fr>
6565
6566 * configure.in: Rename as...
6567 * configure.ac: this.
6568 Bump to 1.49c.
6569
65702002-09-04 Akim Demaille <akim@epita.fr>
6571
6572 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
6573 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
6574 translate maintainer only messages.
6575
65762002-08-12 Paul Eggert <eggert@twinsun.com>
6577
6578 Version 1.49b.
6579
6580 * Makefile.am (SUBDIRS): Remove intl.
6581 (DISTCLEANFILES): Remove.
6582 * NEWS: Mention that GNU M4 is now required. Clarify what is
6583 meant by "larger grammars". Mention the pt_BR translation.
6584 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
6585 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
6586 Bump version from 0.11.2 to 0.11.5.
6587 (BISON_PREREQ_STAGE): Remove.
6588 (AM_GNU_GETTEXT): Use external gettext.
6589 (AC_OUTPUT): Remove intl/Makefile.
6590
6591 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
6592
6593 * data/glr.c: Include string.h, for strlen.
6594 (yyreportParseError): Use size_t for yysize.
6595 (yy_yypstack): No longer nested inside yypstates, as nested
6596 functions are not portable. Do not assume size_t is the
6597 same width as int.
6598 (yypstates): Do not assume that ptrdiff_t is the same width
6599 as int, and similarly for yyposn and YYINDEX.
6600
6601 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
6602
6603 * lib/Makefile.am (INCLUDES): Do not include from the intl
6604 directory, which has been removed.
6605 * src/Makefile.am (INCLUDES): Likewise.
6606
6607 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
6608 (bitsets_sources, additional_bitsets_sources, timevars_sources):
6609 New vars.
6610
6611 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
6612 * tests/Makefile.am (EXTRA_DIST): Likewise.
6613
6614 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
6615 Do not assume that bitset_windex is the same width as unsigned.
6616
6617 * lib/abitset.c (abitset_unused_clear): Do not assume that
6618 bitset_word is the same width as int.
6619 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
6620 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
6621 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
6622 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
6623 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
6624
6625 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
6626 portability to one's complement hosts!).
6627 * lib/ebitset.c (ebitset_op1): Likewise.
6628 * lib/lbitset.c (lbitset_op1): Likewise.
6629
6630 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
6631 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
6632 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
6633 Sync with fileutils.
6634 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
6635 lib/gettext.h: Sync with diffutils.
6636
6637 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
6638 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
6639
6640 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
6641 PROTOTYPES to check for prototypes, and "defined __STDC__" to
6642 check for void *.
6643
6644 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
6645 size_t; the old version tried to do this but casted improperly.
6646 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
6647 (bitset_test): Now returns int, not unsigned long.
6648
6649 * lib/bitset_stats.c: Include "gettext.h".
6650 (_): New macro.
6651 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
6652 name locals "index", as it generates unnecessary warnings on some
6653 hosts that have an "index" function.
6654
6655 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
6656 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
6657 they need translation.
6658 * src/LR0.c (state_list_append, new_itemsets, get_state,
6659 append_states, generate_states): Likewise.
6660 * src/assoc.c (assoc_to_string): Likewise.
6661 * src/closure.c (print_closure, set_firsts, closure): Likewise.
6662 * src/gram.c (grammar_dump): Likewise.
6663 * src/injections.c (injections_compute): Likewise.
6664 * src/lalr.c (lookaheads_print): Likewise.
6665 * src/relation.c (relation_transpose): Likewise.
6666 * src/scan-gram.l: Likewise.
6667 * src/tables.c (table_grow, pack_vector): Likewise.
6668
6669 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
6670 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
6671 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
6672 * m4/mbstate_t.m4: Sync with fileutils.
6673 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
6674
6675 * po/LINGUAS: Add pt_BR.
6676 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
6677 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
6678 lib/timevar.c.
6679 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
6680 manual recommends.
6681 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
6682
6683 * src/complain.c (strerror_r): Remove decl; not needed.
6684 (strerror): Use same pattern as ../lib/error.c.
6685
6686 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
6687
6688 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
6689
6690 * src/main.c (main): Cast result of bindtextdomain and textdomain
6691 to void, to avoid a GCC warning when --disable-nls is in effect.
6692
6693 * src/scan-gram.l: Use strings rather than escapes when possible,
6694 to minimize the number of warnings from xgettext.
6695 (handle_action_dollar, handle_action_at): Don't use isdigit,
6696 as it mishandles negative chars and it may not work as expected
6697 outside the C locale.
6698
6699 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
6700 this is a GCC extension and is not portable to other compilers.
6701
6702 * src/system.h (alloca): Use same pattern as ../lib/error.c.
6703 Do not include <ctype.h>; no longer needed.
6704 Do not include <malloc.h>; no longer needed (and generates
6705 warnings on OpenBSD 3.0).
6706
6707 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
6708 it's not portable.
6709
6710 * tests/regression.at: Do not use 'cc -c input.c -o input';
6711 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
6712
6713 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
6714 exit status as failure, not just exit status 1. Sun C exits
6715 with status 2 sometimes.
6716
6717 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
6718 Use it for the two large tests.
6719
67202002-08-02 Akim Demaille <akim@epita.fr>
6721
6722 * src/conflicts.c (conflicts_output): Don't output rules never
6723 reduced here, since anyway that computation doesn't work.
6724 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
6725 (rule_useless_p, rule_never_reduced_p): New.
6726 (grammar_rules_partial_print): Use a filter instead of a range.
6727 Display the title only if needed.
6728 (grammar_rules_print): Adjust.
6729 (grammar_rules_never_reduced_report): New.
6730 * src/tables.c (action_row): Move the computation of rules never
6731 reduced to...
6732 (token_actions): here.
6733 * src/main.c (main): Make the parser before making the report, so
6734 that rules never reduced are computed.
6735 Call grammar_rules_never_reduced_report.
6736 * src/print.c (print_results): Report rules never reduced.
6737 * tests/conflicts.at, tests/reduce.at: Adjust.
6738
67392002-08-01 Akim Demaille <akim@epita.fr>
6740
6741 Instead of attaching lookaheads and duplicating the rules being
6742 reduced by a state, attach the lookaheads to the reductions.
6743
6744 * src/state.h (state_t): Remove the `lookaheads',
6745 `lookaheads_rule' member.
6746 (reductions_t): Add a `lookaheads' member.
6747 Use a regular array for the `rules'.
6748 * src/state.c (reductions_new): Initialize the lookaheads member
6749 to 0.
6750 (state_rule_lookaheads_print): Adjust.
6751 * src/state.h, src/state.c (state_reductions_find): New.
6752 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
6753 (count_rr_conflicts): Adjust.
6754 * src/lalr.c (LArule): Remove.
6755 (add_lookback_edge): Adjust.
6756 (state_lookaheads_count): New.
6757 (states_lookaheads_initialize): Merge into...
6758 (initialize_LA): this.
6759 (lalr_free): Adjust.
6760 * src/main.c (main): Don't free nullable and derives too early: it
6761 is used by --verbose.
6762 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
6763
67642002-08-01 Akim Demaille <akim@epita.fr>
6765
6766 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
6767 `rule_number_t**'.
6768 (set_derives, free_derives): Rename as...
6769 (derives_compute, derives_free): this.
6770 Adjust all dependencies.
6771 * src/nullable.c (set_nullable, free_nullable): Rename as...
6772 (nullable_compute, nullable_free): these.
6773 (rule_list_t): Store rule_t *, not rule_number_t.
6774 * src/state.c (state_rule_lookaheads_print): Directly compare rule
6775 pointers, instead of their numbers.
6776 * src/main.c (main): Call nullable_free, and derives_free earlier,
6777 as they were lo longer used.
6778
67792002-08-01 Akim Demaille <akim@epita.fr>
6780
6781 * lib/timevar.c (get_time): Include children time.
6782 * src/lalr.h (LA, LArule): Don't export them: used with the
6783 state_t.
6784 * src/lalr.c (LA, LArule): Static.
6785 * src/lalr.h, src/lalr.c (lalr_free): New.
6786 * src/main.c (main): Call it.
6787 * src/tables.c (pack_vector): Check whether loc is >= to the
6788 table_size, not >.
6789 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
6790 (tables_generate): do it, since that's also it which allocates
6791 them.
6792 Don't free LA and LArule, main does.
6793
67942002-07-31 Akim Demaille <akim@epita.fr>
6795
6796 Separate parser tables computation and output.
6797
6798 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
6799 (conflict_list, conflict_list_cnt, table, check, table_ninf)
6800 (yydefgoto, yydefact, high): Move to...
6801 * src/tables.h, src/tables.c: here.
6802 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
6803 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
6804 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
6805 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
6806 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
6807 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
6808 (action_row, save_row, token_actions, save_column, default_goto)
6809 (goto_actions, sort_actions, matching_state, pack_vector)
6810 (table_ninf_remap, pack_table, prepare_actions): Move to...
6811 * src/tables.c: here.
6812 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
6813 * src/output.c (token_actions, output_base, output_conflicts)
6814 (output_check): Merge into...
6815 (prepare_actions): this.
6816 (actions_output): Rename as...
6817 (user_actions_output): this.
6818 * src/main.c (main): Call tables_generate and tables_free.
6819
68202002-07-31 Akim Demaille <akim@epita.fr>
6821
6822 Steal GCC's --time-report support.
6823
6824 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
6825 stolen/adjusted from GCC.
6826 * m4/stage.m4: Remove time related checks.
6827 * m4/timevar.m4: New.
6828 * configure.in: Adjust.
6829 * src/system.h: Adjust to using timevar.h.
6830 * src/getargs.h, src/getargs.c: Support trace_time for
6831 --trace=time.
6832 * src/main.c (stage): Remove.
6833 (main): Replace `stage' invocations with timevar calls.
6834 * src/output.c: Insert pertinent timevar calls.
6835
68362002-07-31 Akim Demaille <akim@epita.fr>
6837
6838 Let --trace have arguments.
6839
6840 * src/getargs.h (enum trace_e): New.
6841 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
6842 (long_options, short_options): --trace/-T takes an optional
6843 argument.
6844 Change all the uses of trace_flag to reflect the new flags.
6845 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
6846
6847 Strengthen `stage' portability.
6848
6849 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
6850 * configure.in: Use it.
6851 Don't check for malloc.h and sys/times.h.
6852 * src/system.h: Include them when appropriate.
6853 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
6854 times and struct tms are available.
6855
68562002-07-30 Akim Demaille <akim@epita.fr>
6857
6858 In verbose parse error message, don't report `error' as an
6859 expected token.
6860 * tests/actions.at (Printers and Destructors): Adjust.
6861 * tests/calc.at (Calculator $1): Adjust.
6862 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
6863 error message, do not report the parser accepts the error token in
6864 that state.
6865
68662002-07-30 Akim Demaille <akim@epita.fr>
6867
6868 Normalize conflict related messages.
6869
6870 * src/complain.h, src/complain.c (warn, complain): New.
6871 * src/conflicts.c (conflicts_print): Use them.
6872 (conflict_report_yacc): New, extracted from...
6873 (conflicts_print): here.
6874 * tests/conflicts.at, tests/existing.at: Adjust.
6875
68762002-07-30 Akim Demaille <akim@epita.fr>
6877
6878 Report rules which are never reduced by the parser: those hidden
6879 by conflicts.
6880
6881 * src/LR0.c (save_reductions): Don't make the final state too
6882 different: save its reduction (accept) instead of having a state
6883 without any action (no shift or goto, no reduce).
6884 Note: the final state is now a ``regular'' state, i.e., the
6885 parsers now contain `reduce 0' as default reduction.
6886 Nevertheless, since they decide to `accept' when yystate =
6887 final_state, they still will not reduce rule 0.
6888 * src/print.c (print_actions, print_reduction): Adjust.
6889 * src/output.c (action_row): Track reduced rules.
6890 (token_actions): Report rules never reduced.
6891 * tests/conflicts.at, tests/regression.at: Adjust.
6892
68932002-07-30 Akim Demaille <akim@epita.fr>
6894
6895 `stage' was accidently included in a previous patch.
6896 Initiate its autoconfiscation.
6897
6898 * configure.in: Look for malloc.h and sys/times.h.
6899 * src/main.c (stage): Adjust.
6900 Report only when trace_flag.
6901
69022002-07-29 Akim Demaille <akim@epita.fr>
6903
6904 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
6905 state_number_t.
6906 (errs_t): symbol_t*, not symbol_number_t.
6907 (reductions_t): rule_t*, not rule_number_t.
6908 (FOR_EACH_SHIFT): New.
6909 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
6910 * src/print.c, src/print_graph.c: Adjust.
6911
69122002-07-29 Akim Demaille <akim@epita.fr>
6913
6914 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
6915
6916 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
6917 (endtoken, accept): these.
6918 * src/reader.c (reader): Set endtoken's default tag to "$end".
6919 Set undeftoken's tag to "$undefined" instead of "$undefined.".
6920 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
6921 Adjust.
6922
69232002-07-29 Akim Demaille <akim@epita.fr>
6924
6925 * src/reduce.c (reduce_grammar): When the language is empty,
6926 complain about the start symbol, not the axiom.
6927 Use its location.
6928 * tests/reduce.at (Empty Language): New.
6929
69302002-07-26 Akim Demaille <akim@epita.fr>
6931
6932 * src/reader.h, src/reader.c (gram_error): ... can't get
6933 yycontrol without making too strong assumptions on the parser
6934 itself.
6935 * src/output.c (prepare_tokens): Use the real 0th value of
6936 token_translations instead of `0'.
6937 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
6938 visible here.
6939 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
6940 for the time being: %locations ought to provide it to yyerror.
6941
69422002-07-25 Akim Demaille <akim@epita.fr>
6943
6944 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
6945 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
6946 * tests/regression.at (Web2c Actions): Adjust.
6947
69482002-07-25 Akim Demaille <akim@epita.fr>
6949
6950 Stop storing rules from 1 to nrules + 1.
6951
6952 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
6953 * src/nullable.c, src/output.c, src/print.c, src/reader.c
6954 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
6955 Iterate from 0 to nrules.
6956 Use rule_number_as_item_number and item_number_as_rule_number.
6957 Adjust to `derive' now containing possibly 0.
6958 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
6959 Handle the `- 1' part in rule numbers from/to item numbers.
6960 * src/conflicts.c (log_resolution): Fix the message which reversed
6961 shift and reduce.
6962 * src/output.c (action_row): Initialize default_rule to -1.
6963 (token_actions): Adjust.
6964 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
6965 expected output.
6966 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
6967
69682002-07-25 Akim Demaille <akim@epita.fr>
6969
6970 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
6971 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
6972 (b4_c_knr_arg_decl): New.
6973 * data/yacc.c: Use it to define yysymprint, yydestruct, and
6974 yyreport_parse_error.
6975
69762002-07-25 Akim Demaille <akim@epita.fr>
6977
6978 * data/yacc.c (yyreport_parse_error): New, extracted from...
6979 (yyparse): here.
6980 (yydestruct, yysymprint): Move above yyparse.
6981 Be K&R compliant.
6982
69832002-07-25 Akim Demaille <akim@epita.fr>
6984
6985 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
6986 replace...
6987 (b4_sint_type, b4_uint_type): these.
6988 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
6989 * tests/regression.at (Web2c Actions): Adjust.
6990
69912002-07-25 Akim Demaille <akim@epita.fr>
6992
6993 * src/gram.h (TIEM_NUMBER_MAX): New.
6994 (item_number_of_rule_number, rule_number_of_item_number): Rename
6995 as...
6996 (rule_number_as_item_number, item_number_as_rule_number): these.
6997 Adjust dependencies.
6998 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
6999 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
7000 (symbol_number_to_vector_number): New.
7001 (order): Of vector_number_t* type.
7002 (base_t, BASE_MAX, BASE_MIN): New.
7003 (froms, tos, width, pos, check): Of base_t type.
7004 (action_number_t, ACTION_MIN, ACTION_MAX): New.
7005 (actrow): Of action_number_t type.
7006 (conflrow): Of unsigned int type.
7007 (table_ninf, base_ninf): New.
7008 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
7009 (muscle_insert_int_table, muscle_insert_base_table)
7010 (muscle_insert_rule_number_table): New.
7011 (prepare_tokens): Output `toknum' as int_table.
7012 (action_row): Returns a rule_number_t.
7013 Use ACTION_MIN, not SHRT_MIN.
7014 (token_actions): yydefact is rule_number_t*.
7015 (table_ninf_remap): New.
7016 (pack_table): Use it for `base' and `table'.
7017 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
7018 replaced with...
7019 (YYPACT_NINF, YYTABLE_NINF): these.
7020 (yypact, yytable): Compute their types instead of hard-coded
7021 `short'.
7022 * tests/regression.at (Web2c Actions): Adjust.
7023
70242002-07-19 Akim Demaille <akim@epita.fr>
7025
7026 * src/scan-gram.l (id): Can start with an underscore.
7027
70282002-07-16 Akim Demaille <akim@epita.fr>
7029
7030 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
7031 Adjust all former `associativity' dependencies.
7032 * src/symtab.c (symbol_new): Default associativity is `undef', not
7033 `right'.
7034 (symbol_check_alias_consistence): Adjust.
7035
70362002-07-09 Akim Demaille <akim@epita.fr>
7037
7038 * doc/bison.texinfo: Properly set the ``header'' part.
7039 Use @dircategory ``GNU programming tools'' as per Texinfo's
7040 documentation.
7041 Use @copying.
7042
70432002-07-09 Akim Demaille <akim@epita.fr>
7044
7045 * lib/quotearg.h: Protect against multiple inclusions.
7046 * src/location.h (location_t): Add a `file' member.
7047 (LOCATION_RESET, LOCATION_PRINT): Adjust.
7048 * src/complain.c (warn_at, complain_at, fatal_at): Drop
7049 `error_one_per_line' support.
7050
70512002-07-09 Akim Demaille <akim@epita.fr>
7052
7053 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
7054 * src/reader.c (lineno): Remove.
7055 Adjust all dependencies.
7056 (get_merge_function): Take a location and use complain_at.
7057 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
7058 * tests/regression.at (Invalid inputs, Mixing %token styles):
7059 Adjust.
7060
70612002-07-09 Akim Demaille <akim@epita.fr>
7062
7063 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
7064 recovery rule, and forbid extensions when --yacc.
7065 (gram_error): Use complain_at.
7066 * src/reader.c (reader): Exit if there were parse errors.
7067
70682002-07-09 Akim Demaille <akim@epita.fr>
7069
7070 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
7071 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
7072 Reported by R Blake <blakers@mac.com>.
7073
70742002-07-09 Akim Demaille <akim@epita.fr>
7075
7076 * data/yacc.c: Output the copyright notive in the header.
7077
70782002-07-03 Akim Demaille <akim@epita.fr>
7079
7080 * src/output.c (froms, tos): Are state_number_t.
7081 (save_column): sp, sp1, and sp2 are state_number_t.
7082 (prepare): Rename `final' as `final_state_number', `nnts' as
7083 `nterms_number', `nrules' as `rules_number', `nstates' as
7084 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
7085 unused.
7086 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
7087 * data/lalr1.cc (nsym_): Remove, unused.
7088
70892002-07-03 Akim Demaille <akim@epita.fr>
7090
7091 * src/lalr.h, src/lalr.c (goto_number_t): New.
7092 * src/lalr.c (goto_list_t): New.
7093 Propagate them.
7094 * src/nullable.c (rule_list_t): New.
7095 Propagate.
7096 * src/types.h: Remove.
7097
70982002-07-03 Akim Demaille <akim@epita.fr>
7099
7100 * src/closure.c (print_fderives): Use rule_rhs_print.
7101 * src/derives.c (print_derives): Use rule_rhs_print.
7102 (rule_list_t): New, replaces `shorts'.
7103 (set_derives): Add comments.
7104 * tests/sets.at (Nullable, Firsts): Adjust.
7105
71062002-07-03 Akim Demaille <akim@epita.fr>
7107
7108 * src/output.c (prepare_actions): Free `tally' and `width'.
7109 (prepare_actions): Allocate and free `order'.
7110 * src/symtab.c (symbols_free): Free `symbols'.
7111 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
7112 * src/output.c (m4_invoke): Move to...
7113 * src/scan-skel.l: here.
7114 (<<EOF>>): Close yyout, and free its name.
7115
71162002-07-03 Akim Demaille <akim@epita.fr>
7117
7118 Fix some memory leaks, and fix a bug: state 0 was examined twice.
7119
7120 * src/LR0.c (new_state): Merge into...
7121 (state_list_append): this.
7122 (new_states): Merge into...
7123 (generate_states): here.
7124 (set_states): Don't ensure a proper `errs' state member here, do it...
7125 * src/conflicts.c (conflicts_solve): here.
7126 * src/state.h, src/state.c: Comment changes.
7127 (state_t): Rename member `shifts' as `transitions'.
7128 Adjust all dependencies.
7129 (errs_new): For consistency, also take the values as argument.
7130 (errs_dup): Remove.
7131 (state_errs_set): New.
7132 (state_reductions_set, state_transitions_set): Assert that no
7133 previous value was assigned.
7134 (state_free): New.
7135 (states_free): Use it.
7136 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
7137 temporary storage: use `errs' and `nerrs' as elsewhere.
7138 (set_conflicts): Allocate and free this `errs'.
7139
71402002-07-02 Akim Demaille <akim@epita.fr>
7141
7142 * lib/libiberty.h: New.
7143 * lib: Update the bitset implementation from upstream.
7144 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
7145 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
7146 * src/main.c: Adjust bitset stats calls.
7147
71482002-07-01 Paul Eggert <eggert@twinsun.com>
7149
7150 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
7151 char, so that negative chars don't collide with $.
7152
71532002-06-30 Akim Demaille <akim@epita.fr>
7154
7155 Have the GLR tests be `warning' checked, and fix the warnings.
7156
7157 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
7158 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
7159 (yyremoveDeletes): `yyi' and `yyj' are size_t.
7160 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
7161 (yyaddDeferredAction): static.
7162 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
7163 (yyreportParseError): yyprefix is const.
7164 yytokenp is used only when verbose.
7165 (yy__GNUC__): Replace with __GNUC__.
7166 (yypdumpstack): yyi is size_t.
7167 (yypreference): Un-yy local variables and arguments, to avoid
7168 clashes with `yyr1'. Anyway, we are not in the user name space.
7169 (yytname_size): be an int, as is compared with ints.
7170 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
7171 Use them.
7172 * tests/cxx-gram.at: Use quotation to protect $1.
7173 Use AT_COMPILE to enable warnings hunts.
7174 Prototype yylex and yyerror.
7175 `Use' argc.
7176 Include `string.h', not `strings.h'.
7177 Produce and prototype stmtMerge only when used.
7178 yylex takes a location.
7179
71802002-06-30 Akim Demaille <akim@epita.fr>
7181
7182 We spend a lot of time in quotearg, in particular when --verbose.
7183
7184 * src/symtab.c (symbol_get): Store a quoted version of the key.
7185 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
7186 Adjust all callers.
7187
71882002-06-30 Akim Demaille <akim@epita.fr>
7189
7190 * src/state.h (reductions_t): Rename member `nreds' as num.
7191 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
7192 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
7193
71942002-06-30 Akim Demaille <akim@epita.fr>
7195
7196 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
7197 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
7198 (shifts_to): Rename as...
7199 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
7200 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
7201 (TRANSITION_IS_DISABLED, transitions_to): these.
7202
72032002-06-30 Akim Demaille <akim@epita.fr>
7204
7205 * src/print.c (print_shifts, print_gotos): Merge into...
7206 (print_transitions): this.
7207 (print_transitions, print_errs, print_reductions): Align the
7208 lookaheads columns.
7209 (print_core, print_transitions, print_errs, print_state,
7210 print_grammar): Output empty lines separator before, not after.
7211 (state_default_rule_compute): Rename as...
7212 (state_default_rule): this.
7213 * tests/conflicts.at (Defaulted Conflicted Reduction),
7214 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
7215 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
7216
72172002-06-30 Akim Demaille <akim@epita.fr>
7218
7219 Display items as we display rules.
7220
7221 * src/gram.h, src/gram.c (rule_lhs_print): New.
7222 * src/gram.c (grammar_rules_partial_print): Use it.
7223 * src/print.c (print_core): Likewise.
7224 * tests/conflicts.at (Defaulted Conflicted Reduction),
7225 (Unresolved SR Conflicts): Adjust.
7226 (Unresolved SR Conflicts): Adjust and rename as...
7227 (Resolved SR Conflicts): this, as was meant.
7228 * tests/regression.at (Web2c Report): Adjust.
7229
72302002-06-30 Akim Demaille <akim@epita.fr>
7231
7232 * src/print.c (state_default_rule_compute): New, extracted from...
7233 (print_reductions): here.
7234 Pessimize, but clarify the code.
7235 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
7236
72372002-06-30 Akim Demaille <akim@epita.fr>
7238
7239 * src/output.c (action_row): Let default_rule be always a rule
7240 number.
7241
72422002-06-30 Akim Demaille <akim@epita.fr>
7243
7244 * src/closure.c (print_firsts, print_fderives, closure):
7245 Use BITSET_EXECUTE.
7246 * src/lalr.c (lookaheads_print): Likewise.
7247 * src/state.c (state_rule_lookaheads_print): Likewise.
7248 * src/print_graph.c (print_core): Likewise.
7249 * src/print.c (print_reductions): Likewise.
7250 * src/output.c (action_row): Likewise.
7251 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
7252
72532002-06-30 Akim Demaille <akim@epita.fr>
7254
7255 * src/print_graph.c: Use report_flag.
7256
72572002-06-30 Akim Demaille <akim@epita.fr>
7258
7259 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
7260 to...
7261 * src/relation.h, src/relation.c (traverse, relation_digraph)
7262 (relation_print, relation_transpose): New.
7263
72642002-06-30 Akim Demaille <akim@epita.fr>
7265
7266 * src/state.h, src/state.c (shifts_to): New.
7267 * src/lalr.c (build_relations): Use it.
7268
72692002-06-30 Akim Demaille <akim@epita.fr>
7270
7271 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
7272 (item_number_of_rule_number, rule_number_of_item_number): New.
7273 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
7274 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
7275 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
7276 Propagate their use.
7277 Much remains to be done, in particular wrt `shorts' from types.h.
7278
72792002-06-30 Akim Demaille <akim@epita.fr>
7280
7281 * src/symtab.c (symbol_new): Initialize the `printer' member.
7282
72832002-06-30 Akim Demaille <akim@epita.fr>
7284
7285 * src/LR0.c (save_reductions): Remove, replaced by...
7286 * src/state.h, src/state.c (state_reductions_set): New.
7287 (reductions, errs): Rename as...
7288 (reductions_t, errs_t): these.
7289 Adjust all dependencies.
7290
72912002-06-30 Akim Demaille <akim@epita.fr>
7292
7293 * src/LR0.c (state_list_t, state_list_append): New.
7294 (first_state, last_state): Now symbol_list_t.
7295 (this_state): Remove.
7296 (new_itemsets, append_states, save_reductions): Take a state_t as
7297 argument.
7298 (set_states, generate_states): Adjust.
7299 (save_shifts): Remove, replaced by...
7300 * src/state.h, src/state.c (state_shifts_set): New.
7301 (shifts): Rename as...
7302 (shifts_t): this.
7303 Adjust all dependencies.
7304 * src/state.h (state_t): Remove the `next' member.
7305
73062002-06-30 Akim Demaille <akim@epita.fr>
7307
7308 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
7309 escaped in slot 0.
7310
73112002-06-30 Akim Demaille <akim@epita.fr>
7312
7313 Use hash.h for the state hash table.
7314
7315 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
7316 (allocate_storage): Use state_hash_new.
7317 (free_storage): Use state_hash_free.
7318 (new_state, get_state): Adjust.
7319 * src/lalr.h, src/lalr.c (states): Move to...
7320 * src/states.h (state_t): Remove the `link' member, no longer
7321 used.
7322 * src/states.h, src/states.c: here.
7323 (state_hash_new, state_hash_free, state_hash_lookup)
7324 (state_hash_insert, states_free): New.
7325 * src/states.c (state_table, state_compare, state_hash): New.
7326 * src/output.c (output_actions): Do not free states now, since we
7327 still need to know the final_state number in `prepare', called
7328 afterwards. Do it...
7329 * src/main.c (main): here: call states_free after `output'.
7330
73312002-06-30 Akim Demaille <akim@epita.fr>
7332
7333 * src/state.h, src/state.c (state_new): New, extracted from...
7334 * src/LR0.c (new_state): here.
7335 * src/state.h (STATE_ALLOC): Move to...
7336 * src/state.c: here.
7337 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
7338 * src/state.h, src/state.c: here.
7339
73402002-06-30 Akim Demaille <akim@epita.fr>
7341
7342 * src/reader.c (gensym): Rename as...
7343 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
7344 (getsym): Rename as...
7345 (symbol_get): this.
7346
73472002-06-30 Akim Demaille <akim@epita.fr>
7348
7349 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
7350 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
7351 * src/output.c, src/print.c, src/print_graph.c: Propagate.
7352 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
7353
73542002-06-30 Akim Demaille <akim@epita.fr>
7355
7356 Make the test suite pass with warnings checked.
7357
7358 * tests/actions.at (Printers and Destructors): Improve.
7359 Avoid unsigned vs. signed issues.
7360 * tests/calc.at: Don't exercise the scanner here, do it...
7361 * tests/input.at (Torturing the Scanner): here.
7362
73632002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7364
7365 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
7366 reorganize first lines parallel to yacc.c.
7367
73682002-06-28 Akim Demaille <akim@epita.fr>
7369
7370 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
7371 (b4_token_enum, b4_token_defines): New, factored from...
7372 * data/lalr1.cc, data/yacc.c, glr.c: here.
7373
73742002-06-28 Akim Demaille <akim@epita.fr>
7375
7376 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
7377 unused variables.
7378 * src/output.c (merger_output): static.
7379
73802002-06-28 Akim Demaille <akim@epita.fr>
7381
7382 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
7383 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
7384 pacify GCC.
7385 * src/output.c (save_row): Initialize all the variables to pacify GCC.
7386
73872002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7388
7389 Accumulated changelog for new GLR parsing features.
7390
7391 * src/conflicts.c (count_total_conflicts): Change name to
7392 conflicts_total_count.
7393 * src/conflicts.h: Ditto.
7394 * src/output.c (token_actions): Use the new name.
7395 (output_conflicts): Change conflp => conflict_list_heads, and
7396 confl => conflict_list for better readability.
7397 * data/glr.c: Use the new names.
7398 * NEWS: Add self to GLR announcement.
7399
7400 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
7401
7402 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
7403 Akim Demaille.
7404
7405 * data/bison.glr: Change name to glr.c
7406 * data/glr.c: Renamed from bison.glr.
7407 * data/Makefile.am: Add glr.c
7408
7409 * src/getargs.c:
7410
7411 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
7412 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
7413
7414 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7415
7416 * data/bison.glr: Be sure to restore the
7417 current #line when returning to the skeleton contents after having
7418 exposed the input file's #line.
7419
7420 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7421
7422 * data/bison.glr: Bring up to date with changes to bison.simple.
7423
7424 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7425
7426 * data/bison.glr: Correct definitions that use b4_prefix.
7427 Various reformatting.
7428 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
7429 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
7430 yytokenp argument; now part of stack.
7431 (yychar): Define to behave as documented.
7432 (yyclearin): Ditto.
7433
7434 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7435
7436 * src/reader.h: Add declaration for free_merger_functions.
7437
7438 * src/reader.c (merge_functions): New variable.
7439 (get_merge_function): New function.
7440 (free_merger_functions): New function.
7441 (readgram): Check for %prec that is not followed by a symbol.
7442 Handle %dprec and %merge declarations.
7443 (packgram): Initialize dprec and merger fields in rules array.
7444
7445 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
7446 conflict_list_cnt, conflict_list_free): New variables.
7447 (table_grow): Also grow conflict_table.
7448 (prepare_rules): Output dprec and merger tables.
7449 (conflict_row): New function.
7450 (action_row): Output conflict lists for GLR parser. Don't use
7451 default reduction in conflicted states for GLR parser so that there
7452 are spaces for the conflict lists.
7453 (save_row): Also save conflict information.
7454 (token_actions): Allocate conflict list.
7455 (merger_output): New function.
7456 (pack_vector): Pack conflict table, too.
7457 (output_conflicts): New function to output yyconflp and yyconfl.
7458 (output_check): Allocate conflict_tos.
7459 (output_actions): Output conflict tables, also.
7460 (output_skeleton): Output b4_mergers definition.
7461 (prepare): Output b4_max_rhs_length definition.
7462 Use 'bison.glr' as default skeleton for GLR parsers.
7463
7464 * src/gram.c (glr_parser): New flag.
7465 (grammar_free): Call free_merger_functions.
7466
7467 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
7468 all pairs of conflicting reductions, rather than just all tokens
7469 causing conflicts. Needed to size conflict tables.
7470 (conflicts_output): Modify call to count_rr_conflicts for new
7471 interface.
7472 (conflicts_print): Ditto.
7473 (count_total_conflicts): New function.
7474
7475 * src/reader.h (merger_list): New type.
7476 (merge_functions): New variable.
7477
7478 * src/lex.h (tok_dprec, tok_merge): New token types.
7479
7480 * src/gram.h (rule_s): Add dprec and merger fields.
7481 (glr_parser): New flag.
7482
7483 * src/conflicts.h (count_total_conflicts): New function.
7484
7485 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
7486
7487 * doc/bison.texinfo (Generalized LR Parsing): New section.
7488 (GLR Parsers): New section.
7489 (Language and Grammar): Mention GLR parsing.
7490 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
7491 Correct typo ("tge" -> "the").
7492
7493 * data/bison.glr: New skeleton for GLR parsing.
7494
7495 * tests/cxx-gram.at: New tests for GLR parsing.
7496
7497 * tests/testsuite.at: Include cxx-gram.at.
7498
7499 * tests/Makefile.am: Add cxx-gram.at.
7500
7501 * src/parse-gram.y:
7502
7503 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
7504
7505 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
7506
75072002-06-27 Akim Demaille <akim@epita.fr>
7508
7509 * src/options.h, src/options.c: Remove.
7510 * src/getargs.c (short_options, long_options): New.
7511
75122002-06-27 Akim Demaille <akim@epita.fr>
7513
7514 * data/bison.simple, data/bison.c++: Rename as...
7515 * data/yacc.c, data/lalr1.cc: these.
7516 * doc/bison.texinfo (Environment Variables): Remove.
7517
75182002-06-25 Raja R Harinath <harinath@cs.umn.edu>
7519
7520 * src/getargs.c (report_argmatch): Initialize strtok().
7521
75222002-06-20 Akim Demaille <akim@epita.fr>
7523
7524 * data/bison.simple (b4_symbol_actions): New, replaces...
7525 (b4_symbol_destructor, b4_symbol_printer): these.
7526 (yysymprint): Be sure to call YYPRINT only for tokens, and using
7527 user token numbers.
7528
75292002-06-20 Akim Demaille <akim@epita.fr>
7530
7531 * data/bison.simple (yydestructor): Rename as...
7532 (yydestruct): this.
7533
75342002-06-20 Akim Demaille <akim@epita.fr>
7535
7536 * src/symtab.h, src/symtab.c (symbol_type_set)
7537 (symbol_destructor_set, symbol_precedence_set): The location is
7538 the last argument.
7539 Adjust all callers.
7540
75412002-06-20 Akim Demaille <akim@epita.fr>
7542
7543 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
7544 internals.
7545 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
7546 Takes a location.
7547 * src/symtab.h, src/symtab.c (symbol_class_set)
7548 (symbol_user_token_number_set): Likewise.
7549 Adjust all callers.
7550 Promote complain_at.
7551 * tests/input.at (Type Clashes): Adjust.
7552
75532002-06-20 Akim Demaille <akim@epita.fr>
7554
7555 * data/bison.simple (YYLEX): Fix the declaration when
7556 %pure-parser.
7557
75582002-06-20 Akim Demaille <akim@epita.fr>
7559
7560 * data/bison.simple (yysymprint): Don't print the token number,
7561 just its name.
7562 * tests/actions.at (Destructors): Rename as...
7563 (Printers and Destructors): this.
7564 Also exercise %printer.
7565
75662002-06-20 Akim Demaille <akim@epita.fr>
7567
7568 * data/bison.simple (YYDSYMPRINT): New.
7569 Use it to remove many of the #if YYDEBUG/if (yydebug).
7570
75712002-06-20 Akim Demaille <akim@epita.fr>
7572
7573 * src/symtab.h, src/symtab.c (symbol_t): printer and
7574 printer_location are new members.
7575 (symbol_printer_set): New.
7576 * src/parse-gram.y (PERCENT_PRINTER): New token.
7577 Handle its associated rule.
7578 * src/scan-gram.l: Adjust.
7579 (handle_destructor_at, handle_destructor_dollar): Rename as...
7580 (handle_symbol_code_at, handle_symbol_code_dollar): these.
7581 * src/output.c (symbol_printers_output): New.
7582 (output_skeleton): Call it.
7583 * data/bison.simple (yysymprint): New. Cannot be named yyprint
7584 since there are already many grammar files with a user `yyprint'.
7585 Replace the calls to YYPRINT to calls to yysymprint.
7586 * tests/calc.at: Adjust.
7587 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
7588 taking advantage of parser very internal details (stack size!).
7589
75902002-06-20 Akim Demaille <akim@epita.fr>
7591
7592 * src/scan-gram.l: Complete the scanner with the missing patterns
7593 to pacify Flex.
7594 Use `quote' and `symbol_tag_get' where appropriate.
7595
75962002-06-19 Akim Demaille <akim@epita.fr>
7597
7598 * tests/actions.at (Destructors): Augment to test locations.
7599 * data/bison.simple (yydestructor): Pass it the current location
7600 if locations are enabled.
7601 Prototype only when __STDC__ or C++.
7602 Change the argument names to move into the yy name space: there is
7603 user code here.
7604
76052002-06-19 Akim Demaille <akim@epita.fr>
7606
7607 * data/bison.simple (b4_pure_if): New.
7608 Use it instead of #ifdef YYPURE.
7609
76102002-06-19 Akim Demaille <akim@epita.fr>
7611
7612 * data/bison.simple (b4_location_if): New.
7613 Use it instead of #ifdef YYLSP_NEEDED.
7614
76152002-06-19 Akim Demaille <akim@epita.fr>
7616
7617 Prepare @$ in %destructor, but currently don't bind it in the
7618 skeleton, as %location use is not cleaned up yet.
7619
7620 * src/scan-gram.l (handle_dollar, handle_destructor_at)
7621 (handle_action_at): New.
7622 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
7623 a braced_code_t and a location as additional arguments.
7624 (handle_destructor_dollar): Instead of requiring `b4_eval', just
7625 unquote one when outputting `b4_dollar_dollar'.
7626 Adjust callers.
7627 * data/bison.simple (b4_eval): Remove.
7628 (b4_symbol_destructor): Adjust.
7629 * tests/input.at (Invalid @n): Adjust.
7630
76312002-06-19 Zack Weinberg <zack@codesourcery.com>
7632
7633 * doc/bison.texinfo: Document ability to have multiple
7634 prologue sections.
7635
76362002-06-18 Akim Demaille <akim@epita.fr>
7637
7638 * src/files.c (compute_base_names): When computing the output file
7639 names from the input file name, strip the directory part.
7640
76412002-06-18 Akim Demaille <akim@epita.fr>
7642
7643 * data/bison.simple.new: Comment changes.
7644 Reported by Andreas Schwab.
7645
76462002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
7647
7648 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
7649 there are no `label `yyoverflowlab' defined but not used' warnings
7650 when yyoverflow is defined.
7651
76522002-06-18 Akim Demaille <akim@epita.fr>
7653
7654 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
7655 new member.
7656 (symbol_destructor_set): Adjust.
7657 * src/output.c (symbol_destructors_output): Output the destructor
7658 locations.
7659 Output the symbol name.
7660 * data/bison.simple (b4_symbol_destructor): Adjust.
7661
76622002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
7663 and Akim Demaille <akim@epita.fr>
7664
7665 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
7666 what's left on the stack when the error recovery hits EOF.
7667 * tests/actions.at (Destructors): Complete to exercise this case.
7668
76692002-06-17 Akim Demaille <akim@epita.fr>
7670
7671 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
7672 arguments is really empty, not only equal to `[]'.
7673 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
7674 member.
7675 (symbol_destructor_set): New.
7676 * src/output.c (symbol_destructors_output): New.
7677 * src/reader.h (brace_code_t, current_braced_code): New.
7678 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
7679 (handle_dollar): Rename as...
7680 (handle_action_dollar): this.
7681 (handle_destructor_dollar): New.
7682 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
7683 (grammar_declaration): Use it.
7684 * data/bison.simple (yystos): Is always defined.
7685 (yydestructor): New.
7686 * tests/actions.at (Destructors): New.
7687 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
7688
76892002-06-17 Akim Demaille <akim@epita.fr>
7690
7691 * src/symlist.h, src/symlist.c (symbol_list_length): New.
7692 * src/scan-gram.l (handle_dollar, handle_at): Compute the
7693 rule_length only when needed.
7694 * src/output.c (actions_output, token_definitions_output): Output
7695 the full M4 block.
7696 * src/symtab.c: Don't access directly to the symbol tag, use
7697 symbol_tag_get.
7698 * src/parse-gram.y: Use symbol_list_free.
7699
77002002-06-17 Akim Demaille <akim@epita.fr>
7701
7702 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
7703 (symbol_list_prepend, get_type_name): Move to...
7704 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
7705 (symbol_list_prepend, symbol_list_n_type_name_get): here.
7706 Adjust all callers.
7707 (symbol_list_free): New.
7708 * src/scan-gram.l (handle_dollar): Takes a location.
7709 * tests/input.at (Invalid $n): Adjust.
7710
77112002-06-17 Akim Demaille <akim@epita.fr>
7712
7713 * src/reader.h, src/reader.c (symbol_list_new): Export it.
7714 (symbol_list_prepend): New.
7715 * src/parse-gram.y (%union): `list' is a new member.
7716 (symbols.1): New, replaces...
7717 (terms_to_prec.1, nterms_to_type.1): these.
7718 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
7719 Take a location as additional argument.
7720 Adjust all callers.
7721
77222002-06-15 Akim Demaille <akim@epita.fr>
7723
7724 * src/parse-gram.y: Move %token in the declaration section so that
7725 we don't depend upon CVS Bison.
7726
77272002-06-15 Akim Demaille <akim@epita.fr>
7728
7729 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
7730 * src/print.c (print_core): Use it.
7731
77322002-06-15 Akim Demaille <akim@epita.fr>
7733
7734 * src/conflicts.c (log_resolution): Accept the rule involved in
7735 the sr conflicts instead of the lookahead number that points to
7736 that rule.
7737 (flush_reduce): Accept the current lookahead vector as argument,
7738 instead of the index in LA.
7739 (resolve_sr_conflict): Accept the current number of lookahead
7740 bitset to consider for the STATE, instead of the index in LA.
7741 (set_conflicts): Adjust.
7742 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
7743
77442002-06-15 Akim Demaille <akim@epita.fr>
7745
7746 * src/state.h (state_t): Replace the `lookaheadsp' member, a
7747 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
7748 Adjust all dependencies.
7749 * src/lalr.c (initialize_lookaheads): Split into...
7750 (states_lookaheads_count, states_lookaheads_initialize): these.
7751 (lalr): Adjust.
7752
77532002-06-15 Akim Demaille <akim@epita.fr>
7754
7755 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
7756 out of...
7757 (grammar_rules_print): here.
7758 * src/reduce.c (reduce_output): Use it.
7759 * tests/reduce.at (Useless Rules, Reduced Automaton)
7760 (Underivable Rules): Adjust.
7761
77622002-06-15 Akim Demaille <akim@epita.fr>
7763
7764 Copy BYacc's nice way to report the grammar.
7765
7766 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
7767 New.
7768 Don't print the rules' location, it is confusing and useless.
7769 (rule_print): Use grammar_rhs_print.
7770 * src/print.c (print_grammar): Use grammar_rules_print.
7771
77722002-06-15 Akim Demaille <akim@epita.fr>
7773
7774 Complete and rationalize `useless thing' warnings.
7775
7776 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
7777 (symbol_tag_print): New.
7778 Use them everywhere in place of accessing directly the tag member.
7779 * src/gram.h, src/gram.c (rule_print): New.
7780 Use it where a rule used to be printed `by hand'.
7781 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
7782 (reduce_grammar_tables): Report the useless rules.
7783 (reduce_print): Useless things are a warning, not an error.
7784 Report it as such.
7785 * tests/reduce.at (Useless Nonterminals, Useless Rules):
7786 (Reduced Automaton, Underivable Rules): Adjust.
7787 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
7788 * tests/conflicts.at (Unresolved SR Conflicts)
7789 (Solved SR Conflicts): Adjust.
7790
77912002-06-15 Akim Demaille <akim@epita.fr>
7792
7793 Let symbols have a location.
7794
7795 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
7796 (getsym): Adjust.
7797 Adjust all callers.
7798 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
7799 Use location_t, not int.
7800 * src/symtab.c (symbol_check_defined): Take advantage of the
7801 location.
7802 * tests/regression.at (Invalid inputs): Adjust.
7803
78042002-06-15 Akim Demaille <akim@epita.fr>
7805
7806 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
7807 (input): Don't try to initialize yylloc here, do it in the
7808 scanner.
7809 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
7810 * src/gram.h (rule_t): Change line and action_line into location
7811 and action_location, of location_t type.
7812 Adjust all dependencies.
7813 * src/location.h, src/location.c (empty_location): New.
7814 * src/reader.h, src/reader.c (grammar_start_symbol_set)
7815 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
7816 (grammar_current_rule_symbol_append)
7817 (grammar_current_rule_action_append): Expect a location as argument.
7818 * src/reader.c (grammar_midrule_action): Adjust to attach an
7819 action's location as dummy symbol location.
7820 * src/symtab.h, src/symtab.c (startsymbol_location): New.
7821 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
7822 the line numbers.
7823
78242002-06-14 Akim Demaille <akim@epita.fr>
7825
7826 Grammar declarations may be found in the grammar section.
7827
7828 * src/parse-gram.y (rules_or_grammar_declaration): New.
7829 (declarations): Each declaration may end with a semicolon, not
7830 just...
7831 (grammar_declaration): `"%union"'.
7832 (grammar): Branch to rules_or_grammar_declaration.
7833
78342002-06-14 Akim Demaille <akim@epita.fr>
7835
7836 * src/main.c (main): Invoke scanner_free.
7837
78382002-06-14 Akim Demaille <akim@epita.fr>
7839
7840 * src/output.c (m4_invoke): Extracted from...
7841 (output_skeleton): here.
7842 Free tempfile.
7843
78442002-06-14 Akim Demaille <akim@epita.fr>
7845
7846 * src/parse-gram.y (directives, directive, gram)
7847 (grammar_directives, precedence_directives, precedence_directive):
7848 Rename as...
7849 (declarations, declaration, grammar, grammar_declaration)
7850 (precedence_declaration, precedence_declarator): these.
7851 (symbol_declaration): New.
7852
78532002-06-14 Akim Demaille <akim@epita.fr>
7854
7855 * src/files.c (action_obstack): Remove, unused.
7856 (output_obstack): Remove it, and all its dependencies, as it is no
7857 longer needed.
7858 * src/reader.c (epilogue_set): Build the epilogue in the
7859 muscle_obstack.
7860 * src/output.h, src/output.c (muscle_obstack): Move to...
7861 * src/muscle_tab.h, src/muscle_tab.h: here.
7862 (muscle_init): Initialize muscle_obstack.
7863 (muscle_free): New.
7864 * src/main.c (main): Call it.
7865
78662002-06-14 Akim Demaille <akim@epita.fr>
7867
7868 * src/location.h: New, extracted from...
7869 * src/reader.h: here.
7870 * src/Makefile.am (noinst_HEADERS): Merge into
7871 (bison_SOURCES): this.
7872 Add location.h.
7873 * src/parse-gram.y: Use location_t instead of Bison's.
7874 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
7875 Use location_t instead of ints.
7876
78772002-06-14 Akim Demaille <akim@epita.fr>
7878
7879 * data/bison.simple, data/bison.c++: Be sure to restore the
7880 current #line when returning to the skeleton contents after having
7881 exposed the input file's #line.
7882
78832002-06-12 Akim Demaille <akim@epita.fr>
7884
7885 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
7886 eager.
7887 * tests/actions.at (Exotic Dollars): New.
7888
78892002-06-12 Akim Demaille <akim@epita.fr>
7890
7891 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
7892 ['"/] too eagerly.
7893 * tests/input.at (Torturing the Scanner): New.
7894
78952002-06-11 Akim Demaille <akim@epita.fr>
7896
7897 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
7898 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
7899 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
7900 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
7901 * src/reader.c (reader): Use it.
7902
79032002-06-11 Akim Demaille <akim@epita.fr>
7904
7905 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
7906 Adjust all callers.
7907 (scanner_last_string_free): New.
7908
79092002-06-11 Akim Demaille <akim@epita.fr>
7910
7911 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
7912 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
7913 (last_string, YY_OBS_FREE): New.
7914 Use them when returning an ID.
7915
79162002-06-11 Akim Demaille <akim@epita.fr>
7917
7918 Have Bison grammars parsed by a Bison grammar.
7919
7920 * src/reader.c, src/reader.h (prologue_augment): New.
7921 * src/reader.c (copy_definition): Remove.
7922
7923 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
7924 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
7925 (grammar_current_rule_prec_set, grammar_current_rule_check)
7926 (grammar_current_rule_symbol_append)
7927 (grammar_current_rule_action_append): Export.
7928 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
7929 (symbol_list_action_append): Remove.
7930 Hook the routines from reader.
7931 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
7932 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
7933
7934 * src/reader.c (read_declarations): Remove, unused.
7935
7936 * src/parse-gram.y: Handle the epilogue.
7937 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
7938 (grammar_start_symbol_set): this.
7939 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
7940 * src/reader.c (readgram): Remove, unused.
7941 (reader): Adjust to insert eoftoken and axiom where appropriate.
7942
7943 * src/reader.c (copy_dollar): Replace with...
7944 * src/scan-gram.h (handle_dollar): this.
7945 * src/parse-gram.y: Remove `%thong'.
7946
7947 * src/reader.c (copy_at): Replace with...
7948 * src/scan-gram.h (handle_at): this.
7949
7950 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
7951 New.
7952
7953 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
7954 time being.
7955
7956 * src/reader.h, src/reader.c (grammar_rule_end): New.
7957
7958 * src/parse.y (current_type, current_class): New.
7959 Implement `%nterm', `%token' support.
7960 Merge `%term' into `%token'.
7961 (string_as_id): New.
7962 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
7963 type name.
7964
7965 * src/parse-gram.y: Be sure to handle properly the beginning of
7966 rules.
7967
7968 * src/parse-gram.y: Handle %type.
7969 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
7970
7971 * src/parse-gram.y: More directives support.
7972 * src/options.c: No longer handle source directives.
7973
7974 * src/parse-gram.y: Fix %output.
7975
7976 * src/parse-gram.y: Handle %union.
7977 Use the prologue locations.
7978 * src/reader.c (parse_union_decl): Remove.
7979
7980 * src/reader.h, src/reader.c (epilogue_set): New.
7981 * src/parse-gram.y: Use it.
7982
7983 * data/bison.simple, data/bison.c++: b4_stype is now either not
7984 defined, then default to int, or to the contents of %union,
7985 without `union' itself.
7986 Adjust.
7987 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
7988
7989 * src/output.c (actions_output): Don't output braces, as they are
7990 already handled by the scanner.
7991
7992 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
7993 characters to themselves.
7994
7995 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
7996 that the epilogue has a proper #line.
7997
7998 * src/parse-gram.y: Handle precedence/associativity.
7999
8000 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
8001 a terminal.
8002 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
8003 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
8004 at all to define terminals that cannot be emitted.
8005
8006 * src/scan-gram.l: Escape M4 characters.
8007
8008 * src/scan-gram.l: Working properly with escapes in user
8009 strings/characters.
8010
8011 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
8012 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
8013 grammar.
8014 Use more modest sizes, as for the time being the parser does not
8015 release memory, and therefore the process swallows a huge amount
8016 of memory.
8017
8018 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
8019 stricter %token grammar.
8020
8021 * src/symtab.h (associativity): Add `undef_assoc'.
8022 (symbol_precedence_set): Do nothing when passed an undef_assoc.
8023 * src/symtab.c (symbol_check_alias_consistence): Adjust.
8024
8025 * tests/regression.at (Invalid %directive): Remove, as it is now
8026 meaningless.
8027 (Invalid inputs): Adjust to the new error messages.
8028 (Token definitions): The new grammar doesn't allow too many
8029 eccentricities.
8030
8031 * src/lex.h, src/lex.c: Remove.
8032 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
8033 (copy_character, copy_string2, copy_string, copy_identifier)
8034 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
8035 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
8036 (parse_action): Remove.
8037 * po/POTFILES.in: Adjust.
8038
80392002-06-11 Akim Demaille <akim@epita.fr>
8040
8041 * src/reader.c (parse_action): Don't store directly into the
8042 rule's action member: return the action as a string.
8043 Don't require `rule_length' as an argument: compute it.
8044 (grammar_current_rule_symbol_append)
8045 (grammar_current_rule_action_append): New, eved out from
8046 (readgram): here.
8047 Remove `action_flag', `rulelength', unused now.
8048
80492002-06-11 Akim Demaille <akim@epita.fr>
8050
8051 * src/reader.c (grammar_current_rule_prec_set).
8052 (grammar_current_rule_check): New, eved out from...
8053 (readgram): here.
8054 Remove `xaction', `first_rhs': useless.
8055 * tests/input.at (Type clashes): New.
8056 * tests/existing.at (GNU Cim Grammar): Adjust.
8057
80582002-06-11 Akim Demaille <akim@epita.fr>
8059
8060 * src/reader.c (grammar_midrule_action): New, Eved out from
8061 (readgram): here.
8062
80632002-06-11 Akim Demaille <akim@epita.fr>
8064
8065 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
8066 New.
8067 (readgram): Use them as replacement of inlined code, crule and
8068 crule1.
8069
80702002-06-11 Akim Demaille <akim@epita.fr>
8071
8072 * src/reader.c (grammar_end, grammar_symbol_append): New.
8073 (readgram): Use them.
8074 Make the use of `p' as local as possible.
8075
80762002-06-10 Akim Demaille <akim@epita.fr>
8077
8078 GCJ's parser requires the tokens to be defined before the prologue.
8079
8080 * data/bison.simple: Output the token definition before the user's
8081 prologue.
8082 * tests/regression.at (Braces parsing, Duplicate string)
8083 (Mixing %token styles): Check the output from bison.
8084 (Early token definitions): New.
8085
80862002-06-10 Akim Demaille <akim@epita.fr>
8087
8088 * src/symtab.c (symbol_user_token_number_set): Don't complain when
8089 assigning twice the same user number to a token, so that we can
8090 use it in...
8091 * src/lex.c (lex): here.
8092 Also use `symbol_class_set' instead of hand written code.
8093 * src/reader.c (parse_assoc_decl): Likewise.
8094
80952002-06-10 Akim Demaille <akim@epita.fr>
8096
8097 * src/symtab.c, src/symtab.c (symbol_class_set)
8098 (symbol_user_token_number_set): New.
8099 * src/reader.c (parse_token_decl): Use them.
8100 Use a switch instead of ifs.
8101 Use a single argument.
8102
81032002-06-10 Akim Demaille <akim@epita.fr>
8104
8105 Remove `%thong' support as it is undocumented, unused, duplicates
8106 `%token's job, and creates useless e-mail traffic with people who
8107 want to know what it is, why it is undocumented, unused, and
8108 duplicates `%token's job.
8109
8110 * src/reader.c (parse_thong_decl): Remove.
8111 * src/options.c (option_table): Remove "thong".
8112 * src/lex.h (tok_thong): Remove.
8113
81142002-06-10 Akim Demaille <akim@epita.fr>
8115
8116 * src/symtab.c, src/symtab.c (symbol_type_set)
8117 (symbol_precedence_set): New.
8118 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
8119 (value_components_used): Remove, unused.
8120
81212002-06-09 Akim Demaille <akim@epita.fr>
8122
8123 Move symbols handling code out of the reader.
8124
8125 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
8126 (axiom): Move to...
8127 * src/symtab.h, src/symtab.c: here.
8128
8129 * src/gram.c (start_symbol): Remove: use startsymbol->number.
8130 * src/reader.c (startval): Rename as...
8131 * src/symtab.h, src/symtab.c (startsymbol): this.
8132 * src/reader.c: Adjust.
8133
8134 * src/reader.c (symbol_check_defined, symbol_make_alias)
8135 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
8136 (token_translations_init)
8137 Move to...
8138 * src/symtab.c: here.
8139 * src/reader.c (packsymbols): Move to...
8140 * src/symtab.h, src/symtab.c (symbols_pack): here.
8141 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
8142 argument.
8143
81442002-06-03 Akim Demaille <akim@epita.fr>
8145
8146 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
8147 then statements.
8148
81492002-06-03 Akim Demaille <akim@epita.fr>
8150
8151 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
8152 structs with non literals.
8153 * src/scan-skel.l: never-interactive.
8154 * src/conflicts.c (enum conflict_resolution_e): No trailing
8155 comma.
8156 * src/getargs.c (usage): Split long literal strings.
8157 Reported by Hans Aberg.
8158
81592002-05-28 Akim Demaille <akim@epita.fr>
8160
8161 * data/bison.c++: Use C++ ostreams.
8162 (cdebug_): New member.
8163
81642002-05-28 Akim Demaille <akim@epita.fr>
8165
8166 * src/output.c (output_skeleton): Be sure to allocate enough room
8167 for `/' _and_ for `\0' in full_skeleton.
8168
81692002-05-28 Akim Demaille <akim@epita.fr>
8170
8171 * data/bison.c++: Catch up with bison.simple:
8172 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8173 and Paul Eggert <eggert@twinsun.com>: `error' handing.
8174 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
8175 and popping traces.
8176
81772002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8178
8179 * src/output.c (output_skeleton): Put an explicit path in front of
8180 the skeleton file name, rather than relying on the -I directory,
8181 to partially alleviate effects of having a skeleton file lying around
8182 in the current directory.
8183
81842002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8185
8186 * src/conflicts.c (log_resolution): Correct typo:
8187 obstack_printf should be obstack_fgrow1.
8188
81892002-05-26 Akim Demaille <akim@epita.fr>
8190
8191 * src/state.h (state_t): `solved_conflicts' is a new member.
8192 * src/LR0.c (new_state): Set it to 0.
8193 * src/conflicts.h, src/conflicts.c (print_conflicts)
8194 (free_conflicts, solve_conflicts): Rename as...
8195 (conflicts_print, conflicts_free, conflicts_solve): these.
8196 Adjust callers.
8197 * src/conflicts.c (enum conflict_resolution_e)
8198 (solved_conflicts_obstack): New, used by...
8199 (log_resolution): this.
8200 Adjust to attach the conflict resolution to each state.
8201 Complete the description with the precedence/associativity
8202 information.
8203 (resolve_sr_conflict): Adjust.
8204 * src/print.c (print_state): Output its solved_conflicts.
8205 * tests/conflicts.at (Unresolved SR Conflicts)
8206 (Solved SR Conflicts): Exercise --report=all.
8207
82082002-05-26 Akim Demaille <akim@epita.fr>
8209
8210 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
8211 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
8212 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
8213 (token_number_t, item_number_as_token_number)
8214 (token_number_as_item_number, muscle_insert_token_number_table):
8215 Rename as...
8216 (symbol_number_t, item_number_as_symbol_number)
8217 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
8218 these, since it is more appropriate.
8219
82202002-05-26 Akim Demaille <akim@epita.fr>
8221
8222 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
8223 `Error:' lines.
8224 * data/bison.simple (yystos) [YYDEBUG]: New.
8225 (yyparse) [YYDEBUG]: Display the symbols which are popped during
8226 error recovery.
8227 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
8228
82292002-05-25 Akim Demaille <akim@epita.fr>
8230
8231 * doc/bison.texinfo (Debugging): Split into...
8232 (Tracing): this new section, its former contents, and...
8233 (Understanding): this new section.
8234 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
8235 by...
8236 (report_flag): this.
8237 Adjust all dependencies.
8238 (report_args, report_types, report_argmatch): New.
8239 (usage, getargs): Report/support -r, --report.
8240 * src/options.h
8241 (struct option_table_struct): Rename as..,
8242 (struct option_table_s): this.
8243 Rename the `set_flag' member to `flag' to match with getopt_long's
8244 struct.
8245 * src/options.c (option_table): Split verbose into an entry for
8246 %verbose, and another for --verbose.
8247 Support --report/-r, so remove -r from the obsolete --raw.
8248 * src/print.c: Attach full item sets and lookaheads reports to
8249 report_flag instead of trace_flag.
8250 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
8251
82522002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8253 and Paul Eggert <eggert@twinsun.com>
8254
8255 * data/bison.simple (yyparse): Correct error handling to conform to
8256 POSIX and yacc. Specifically, after syntax error is discovered,
8257 do not reduce further before shifting the error token.
8258 Clean up the code a bit by removing the labels yyerrdefault,
8259 yyerrhandle, yyerrpop.
8260 * NEWS: Document the above.
8261
82622002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8263
8264 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
8265 type; it isn't always big enough, since it doesn't necessarily
8266 include non-terminals.
8267 (yytranslate): Expand definition of yy_token_number_type, so that
8268 the latter can be removed.
8269 (yy_token_number_type): Remove, only one use.
8270 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
8271 don't use TokenNumberType as element type.
8272
8273 * tests/regression.at: Modify expected output to agree with change
8274 to yyr1 and yytranslate.
8275
82762002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
8277
8278 * src/reader.c (parse_action): Use copy_character instead of
8279 obstack_1grow.
8280
82812002-05-13 Akim Demaille <akim@epita.fr>
8282
8283 * tests/regression.at (Token definitions): Prototype yylex and
8284 yyerror.
8285
82862002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8287
8288 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
8289 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
8290 32-bit arithmetic.
8291 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
8292
82932002-05-07 Akim Demaille <akim@epita.fr>
8294
8295 * tests/synclines.at: Be sure to prototype yylex and yyerror to
8296 avoid GCC warnings.
8297
82982002-05-07 Akim Demaille <akim@epita.fr>
8299
8300 Kill GCC warnings.
8301
8302 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
8303 over the RHS of each rule.
8304 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
8305 * src/state.h (state_t): Member `nitems' is unsigned short.
8306 * src/LR0.c (get_state): Adjust.
8307 * src/reader.c (packgram): Likewise.
8308 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
8309 `Type'.
8310 (muscle_insert_int_table): Remove, unused.
8311 (prepare_rules): Remove `max'.
8312
83132002-05-06 Akim Demaille <akim@epita.fr>
8314
8315 * src/closure.c (print_firsts): Display of the symbol tags.
8316 (bitmatrix_print): Move to...
8317 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
8318 here.
8319 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
8320
83212002-05-06 Akim Demaille <akim@epita.fr>
8322
8323 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
8324 hash_do_for_each.
8325
83262002-05-06 Akim Demaille <akim@epita.fr>
8327
8328 * src/LR0.c (new_state, get_state): Instead of using the global
8329 `kernel_size' and `kernel_base', have two new arguments:
8330 `core_size' and `core'.
8331 Adjust callers.
8332
83332002-05-06 Akim Demaille <akim@epita.fr>
8334
8335 * src/reader.c (packgram): No longer end `ritem' with a 0
8336 sentinel: it is not used.
8337
83382002-05-05 Akim Demaille <akim@epita.fr>
8339
8340 New experimental feature: display the lookaheads in the report and
8341 graph.
8342
8343 * src/print (print_core): When --trace-flag, display the rules
8344 lookaheads.
8345 * src/print_graph.c (print_core): Likewise.
8346 Swap the arguments.
8347 Adjust caller.
8348
83492002-05-05 Akim Demaille <akim@epita.fr>
8350
8351 * tests/torture.at (Many lookaheads): New test.
8352
83532002-05-05 Akim Demaille <akim@epita.fr>
8354
8355 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
8356 (GENERATE_MUSCLE_INSERT_TABLE): this.
8357 (output_int_table, output_unsigned_int_table, output_short_table)
8358 (output_token_number_table, output_item_number_table): Replace with...
8359 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
8360 (muscle_insert_short_table, muscle_insert_token_number_table)
8361 (muscle_insert_item_number_table): these.
8362 Adjust all callers.
8363 (prepare_tokens): Don't free `translations', since...
8364 * src/reader.h, src/reader.c (grammar_free): do it.
8365 Move to...
8366 * src/gram.h, src/gram.c (grammar_free): here.
8367 * data/bison.simple, data/bison.c++: b4_token_number_max is now
8368 b4_translate_max.
8369
83702002-05-05 Akim Demaille <akim@epita.fr>
8371
8372 * src/output.c (output_unsigned_int_table): New.
8373 (prepare_rules): `i' is unsigned.
8374 `prhs', `rline', `r2' are unsigned int.
8375 Rename muscle `rhs_number_max' as `rhs_max'.
8376 Output muscles `prhs_max', `rline_max', and `r2_max'.
8377 Free rline and r1.
8378 * data/bison.simple, data/bison.c++: Adjust to use these muscles
8379 to compute types instead of constant types.
8380 * tests/regression.at (Web2c Actions): Adjust.
8381
83822002-05-04 Akim Demaille <akim@epita.fr>
8383
8384 * src/symtab.h (SALIAS, SUNDEF): Rename as...
8385 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
8386 Adjust dependencies.
8387 * src/output.c (token_definitions_output): Be sure not to output a
8388 `#define 'a'' when fed with `%token 'a' "a"'.
8389 * tests/regression.at (Token definitions): New.
8390
83912002-05-03 Paul Eggert <eggert@twinsun.com>
8392
8393 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
8394 for K&R C.
8395
83962002-05-03 gettextize <bug-gnu-gettext@gnu.org>
8397
8398 * Makefile.am (SUBDIRS): Remove intl.
8399 (EXTRA_DIST): Add config/config.rpath.
8400
84012002-05-03 Akim Demaille <akim@epita.fr>
8402
8403 * data/bison.simple (m4_if): Don't output empty enums.
8404 And actually, output valid enum definitions :(.
8405
84062002-05-03 Akim Demaille <akim@epita.fr>
8407
8408 * configure.bat: Remove, completely obsolete.
8409 * Makefile.am (EXTRA_DIST): Adjust.
8410 Don't distribute config.rpath...
8411 * config/Makefile.am (EXTRA_DIST): Do it.
8412
84132002-05-03 Akim Demaille <akim@epita.fr>
8414
8415 * configure.in (GETTEXT_VERSION): New.
8416 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
8417
84182002-05-03 Akim Demaille <akim@epita.fr>
8419
8420 * data/bison.simple (b4_token_enum): New.
8421 (b4_token_defines): Use it to output tokens both as #define and
8422 enums.
8423 Suggested by Paul Eggert.
8424 * src/output.c (token_definitions_output): Don't output spurious
8425 white spaces.
8426
84272002-05-03 Akim Demaille <akim@epita.fr>
8428
8429 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
8430
84312002-05-02 Robert Anisko <robert@lrde.epita.fr>
8432
8433 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
8434 Update the stack class, give a try to deque as the default container.
8435
84362002-05-02 Akim Demaille <akim@epita.fr>
8437
8438 * data/bison.simple (yyparse): Do not implement @$ = @1.
8439 (YYLLOC_DEFAULT): Adjust to do it.
8440 * doc/bison.texinfo (Location Default Action): Fix.
8441
84422002-05-02 Akim Demaille <akim@epita.fr>
8443
8444 * src/reader.c (parse_braces): Merge into...
8445 (parse_action): this.
8446
84472002-05-02 Akim Demaille <akim@epita.fr>
8448
8449 * configure.in (ALL_LINGUAS): Remove.
8450 * po/LINGUAS, hr.po: New.
8451
84522002-05-02 Akim Demaille <akim@epita.fr>
8453
8454 Remove the so called hairy (semantic) parsers.
8455
8456 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
8457 * src/gram.h, src/gram.c (semantic_parser): Remove.
8458 (rule_t): Remove the guard and guard_line members.
8459 * src/lex.h (token_t): remove tok_guard.
8460 * src/options.c (option_table): Remove %guard and %semantic_parser
8461 support.
8462 * src/output.c, src/output.h (guards_output): Remove.
8463 (prepare): Adjust.
8464 (token_definitions_output): Don't output the `T'
8465 tokens (???).
8466 (output_skeleton): Don't output the guards.
8467 * src/files.c, src/files.c (attrsfile): Remove.
8468 * src/reader.c (symbol_list): Remove the guard and guard_line
8469 members.
8470 Adjust dependencies.
8471 (parse_guard): Remove.
8472 * data/bison.hairy: Remove.
8473 * doc/bison.texinfo (Environment Variables): Remove occurrences of
8474 BISON_HAIRY.
8475
84762002-05-02 Akim Demaille <akim@epita.fr>
8477
8478 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
8479 (parse_guard): Rename the formal argument `stack_offset' as
8480 `rule_length', which is more readable.
8481 Adjust callers.
8482 (copy_at, copy_dollar): Instead of outputting the hard coded
8483 values of $$, $n and so forth, output invocation to b4_lhs_value,
8484 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
8485 Note: this patch partially drops `semantic-parser' support: it
8486 always does `rule_length - n', where semantic parsers ought to
8487 always use `-n'.
8488 * data/bison.simple, data/bison.c++ (b4_lhs_value)
8489 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
8490
84912002-05-02 Akim Demaille <akim@epita.fr>
8492
8493 * configure.in (AC_INIT): Bump to 1.49b.
8494 (AM_INIT_AUTOMAKE): Short invocation.
8495
84962002-05-02 Akim Demaille <akim@epita.fr>
8497
8498 Version 1.49a.
8499
85002002-05-01 Akim Demaille <akim@epita.fr>
8501
8502 * src/skeleton.h: Remove.
8503
85042002-05-01 Akim Demaille <akim@epita.fr>
8505
8506 * src/skeleton.h: Fix the #endif.
8507 Reported by Magnus Fromreide.
8508
85092002-04-26 Paul Eggert <eggert@twinsun.com>
8510
8511 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
8512 Define if we define YYSTYPE and YYLTYPE, respectively.
8513 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8514
85152002-04-25 Robert Anisko <robert@lrde.epita.fr>
8516
8517 * src/scan-skel.l: Postprocess quadrigraphs.
8518
8519 * src/reader.c (copy_character): New function, used to output
8520 single characters while replacing `[' and `]' with quadrigraphs, to
8521 avoid troubles with M4 quotes.
8522 (copy_comment): Output characters with copy_character.
8523 (read_additionnal_code): Likewise.
8524 (copy_string2): Likewise.
8525 (copy_definition): Likewise.
8526
8527 * tests/calc.at: Exercise M4 quoting.
8528
85292002-04-25 Akim Demaille <akim@epita.fr>
8530
8531 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
8532 between `!' and the command.
8533 Reported by Paul Eggert.
8534
85352002-04-24 Robert Anisko <robert@lrde.epita.fr>
8536
8537 * tests/calc.at: Exercise prologue splitting.
8538
8539 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
8540 `b4_post_prologue' instead of `b4_prologue'.
8541
8542 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
8543 muscles.
8544 (output): Free pre_prologue_obstack and post_prologue_obstack.
8545 * src/files.h, src/files.c (attrs_obstack): Remove.
8546 (pre_prologue_obstack, post_prologue_obstack): New.
8547 * src/reader.c (copy_definition): Add a parameter to specify the
8548 obstack to fill, instead of using attrs_obstack unconditionally.
8549 (read_declarations): Pass pre_prologue_obstack to copy_definition if
8550 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
8551
85522002-04-23 Paul Eggert <eggert@twinsun.com>
8553
8554 * data/bison.simple: Remove unnecessary commentary and white
8555 space differences from 1_29-branch.
8556 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
8557
8558 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
8559 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
8560 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
8561 constructors or destructors.
8562
8563 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
8564
85652002-04-23 Akim Demaille <akim@epita.fr>
8566
8567 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
8568 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
8569 location with columns.
8570 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
8571 All reported by Paul Eggert.
8572
85732002-04-22 Akim Demaille <akim@epita.fr>
8574
8575 * src/reduce.c (dump_grammar): Move to...
8576 * src/gram.h, src/gram.c (grammar_dump): here.
8577 Be sure to separate long item numbers.
8578 Don't read the members of a rule's prec if its nil.
8579
85802002-04-22 Akim Demaille <akim@epita.fr>
8581
8582 * src/output.c (table_size, table_grow): New.
8583 (MAXTABLE): Remove, replace uses with table_size.
8584 (pack_vector): Instead of dying when the table is too big, grow it.
8585
85862002-04-22 Akim Demaille <akim@epita.fr>
8587
8588 * data/bison.simple (yyr1): Its type is that of a token number.
8589 * data/bison.c++ (r1_): Likewise.
8590 * tests/regression.at (Web2c Actions): Adjust.
8591
85922002-04-22 Akim Demaille <akim@epita.fr>
8593
8594 * src/reader.c (token_translations_init): 256 is now the default
8595 value for the error token, i.e., it will be assigned another
8596 number if the user assigned 256 to one of her tokens.
8597 (reader): Don't force 256 to error.
8598 * doc/bison.texinfo (Symbols): Adjust.
8599 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
8600 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
8601 etc. instead of 10, 20, 30 (which was used to `jump' over error
8602 (256) and undefined (2)).
8603
86042002-04-22 Akim Demaille <akim@epita.fr>
8605
8606 Propagate more token_number_t.
8607
8608 * src/gram.h (token_number_as_item_number)
8609 (item_number_as_token_number): New.
8610 * src/output.c (GENERATE_OUTPUT_TABLE): New.
8611 Use it to create output_item_number_table and
8612 output_token_number_table.
8613 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
8614 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
8615 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
8616 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
8617
86182002-04-22 Akim Demaille <akim@epita.fr>
8619
8620 * src/output.h, src/output.c (get_lines_number): Remove.
8621
86222002-04-19 Akim Demaille <akim@epita.fr>
8623
8624 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
8625 as Lex/Flex'.
8626 (Debugging): More details about enabling the debugging features.
8627 (Table of Symbols): Describe $$, $n, @$, and @n.
8628 Suggested by Tim Josling.
8629
86302002-04-19 Akim Demaille <akim@epita.fr>
8631
8632 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
8633
86342002-04-10 Akim Demaille <akim@epita.fr>
8635
8636 * src/system.h: Rely on HAVE_LIMITS_H.
8637 Suggested by Paul Eggert.
8638
86392002-04-09 Akim Demaille <akim@epita.fr>
8640
8641 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
8642 full stderr, and strip it according to the bison options, instead
8643 of composing the error message from different bits.
8644 This makes it easier to check for several error messages.
8645 Adjust all the invocations.
8646 Add an invocation exercising the error token.
8647 Add an invocation demonstrating a stupid error message.
8648 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
8649 Adjust the tests.
8650 Error message are for stderr, not stdout.
8651
86522002-04-09 Akim Demaille <akim@epita.fr>
8653
8654 * src/gram.h, src/gram.c (error_token_number): Remove, use
8655 errtoken->number.
8656 * src/reader.c (reader): Don't specify the user token number (2)
8657 for $undefined, as it uselessly prevents using it.
8658 * src/gram.h (token_number_t): Move to...
8659 * src/symtab.h: here.
8660 (state_t.number): Is a token_number_t.
8661 * src/print.c, src/reader.c: Use undeftoken->number instead of
8662 hard coded 2.
8663 (Even though this 2 is not the same as above: the number of the
8664 undeftoken remains being 2, it is its user token number which
8665 might not be 2).
8666 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
8667 `user_token_number_max'.
8668 Output `undef_token_number'.
8669 * data/bison.simple, data/bison.c++: Use them.
8670 Be sure to map invalid yylex return values to
8671 `undef_token_number'. This saves us from gratuitous SEGV.
8672
8673 * tests/conflicts.at (Solved SR Conflicts)
8674 (Unresolved SR Conflicts): Adjust.
8675 * tests/regression.at (Web2c Actions): Adjust.
8676
86772002-04-08 Akim Demaille <akim@epita.fr>
8678
8679 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
8680 Adding #line.
8681 Remove the duplicate `typedefs'.
8682 (RhsNumberType): Fix the declaration and various other typos.
8683 Use __ofile__.
8684 * data/bison.simple: Use __ofile__.
8685 * src/scan-skel.l: Handle __ofile__.
8686
86872002-04-08 Akim Demaille <akim@epita.fr>
8688
8689 * src/gram.h (item_number_t): New, the type of item numbers in
8690 RITEM. Note that it must be able to code symbol numbers as
8691 positive number, and the negation of rule numbers as negative
8692 numbers.
8693 Adjust all dependencies (pretty many).
8694 * src/reduce.c (rule): Remove this `short *' pointer: use
8695 item_number_t.
8696 * src/system.h (MINSHORT, MAXSHORT): Remove.
8697 Include `limits.h'.
8698 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
8699 (shortcpy): Remove.
8700 (MAXTABLE): Move to...
8701 * src/output.c (MAXTABLE): here.
8702 (prepare_rules): Use output_int_table to output rhs.
8703 * data/bison.simple, data/bison.c++: Adjust.
8704 * tests/torture.at (Big triangle): Move the limit from 254 to
8705 500.
8706 * tests/regression.at (Web2c Actions): Ajust.
8707
8708 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
8709 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
8710 passes, but produces negative #line number, once fixed, GCC is
8711 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
8712 C), it passes.
8713 * src/state.h (state_h): Code input lines on ints, not shorts.
8714
87152002-04-08 Akim Demaille <akim@epita.fr>
8716
8717 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
8718 and then the grammar.
8719
87202002-04-08 Akim Demaille <akim@epita.fr>
8721
8722 * src/system.h: No longer using strndup.
8723
87242002-04-07 Akim Demaille <akim@epita.fr>
8725
8726 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
8727 * src/output.c (output_table_data): Return the longest number.
8728 (prepare_tokens): Output `token_number_max').
8729 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
8730 New.
8731 Use them to define yy_token_number_type/TokenNumberType.
8732 Use this type for yytranslate.
8733 * tests/torture.at (Big triangle): Push the limit from 124 to
8734 253.
8735 * tests/regression.at (Web2c Actions): Adjust.
8736
87372002-04-07 Akim Demaille <akim@epita.fr>
8738
8739 * tests/torture.at (Big triangle): New.
8740 (GNU AWK Grammar, GNU Cim Grammar): Move to...
8741 * tests/existing.at: here.
8742
87432002-04-07 Akim Demaille <akim@epita.fr>
8744
8745 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
8746 nritems.
8747 Adjust dependencies.
8748
87492002-04-07 Akim Demaille <akim@epita.fr>
8750
8751 * src/reader.c: Normalize increments to prefix form.
8752
87532002-04-07 Akim Demaille <akim@epita.fr>
8754
8755 * src/reader.c, symtab.c: Remove debugging code.
8756
87572002-04-07 Akim Demaille <akim@epita.fr>
8758
8759 Rename all the `bucket's as `symbol_t'.
8760
8761 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
8762 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
8763 * src/symtab.c, src/symtab.h (bucket): Rename as...
8764 (symbol_t): this.
8765 (symbol_list_new, bucket_check_defined, bucket_make_alias)
8766 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
8767 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
8768 (buckets_new, buckets_free, buckets_do): Rename as...
8769 (symbol_list_new, symbol_check_defined, symbol_make_alias)
8770 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
8771 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
8772 (symbols_new, symbols_free, symbols_do): these.
8773
87742002-04-07 Akim Demaille <akim@epita.fr>
8775
8776 Use lib/hash for the symbol table.
8777
8778 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
8779 EOF.
8780 * src/lex.c (lex): Set the `number' member of new terminals.
8781 * src/reader.c (bucket_check_defined, bucket_make_alias)
8782 (bucket_check_alias_consistence, bucket_translation): New.
8783 (reader, grammar_free, readgram, token_translations_init)
8784 (packsymbols): Adjust.
8785 (reader): Number the predefined tokens.
8786 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
8787 for predefined tokens.
8788 * src/symtab.h (bucket): Remove all the hash table related
8789 members.
8790 * src/symtab.c (symtab): Replace by...
8791 (bucket_table): this.
8792 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
8793 (buckets_new, buckets_do): New.
8794
87952002-04-07 Akim Demaille <akim@epita.fr>
8796
8797 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
8798 (start_symbol, max_user_token_number, semantic_parser)
8799 (error_token_number): Initialize.
8800 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
8801 Initialize.
8802 (reader): Don't.
8803 (errtoken, eoftoken, undeftoken, axiom): Extern.
8804
88052002-04-07 Akim Demaille <akim@epita.fr>
8806
8807 * src/gram.h (rule_s): prec and precsym are now pointers
8808 to the bucket giving the priority/associativity.
8809 Member `associativity' removed: useless.
8810 * src/reduce.c, src/conflicts.c: Adjust.
8811
88122002-04-07 Akim Demaille <akim@epita.fr>
8813
8814 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
8815 Properly escape the symbols' TAG when outputting them.
8816
88172002-04-07 Akim Demaille <akim@epita.fr>
8818
8819 * src/lalr.h (LA): Is a bitsetv, not bitset*.
8820
88212002-04-07 Akim Demaille <akim@epita.fr>
8822
8823 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
8824 (LArule): this, which is an array to rule_t*.
8825 * src/print.c, src/conflicts.c: Adjust.
8826
88272002-04-07 Akim Demaille <akim@epita.fr>
8828
8829 * src/gram.h (rule_t): Rename `number' as `user_number'.
8830 `number' is a new member.
8831 Adjust dependencies.
8832 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
8833
88342002-04-07 Akim Demaille <akim@epita.fr>
8835
8836 As a result of the previous patch, it is no longer needed
8837 to reorder ritem itself.
8838
8839 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
8840
88412002-04-07 Akim Demaille <akim@epita.fr>
8842
8843 Be sure never to walk through RITEMS, but use only data related to
8844 the rules themselves. RITEMS should be banished.
8845
8846 * src/output.c (output_token_translations): Rename as...
8847 (prepare_tokens): this.
8848 In addition to `translate', prepare the muscles `tname' and
8849 `toknum', which were handled by...
8850 (output_rule_data): this.
8851 Remove, and move the remainder of its outputs into...
8852 (prepare_rules): this new routines, which also merges content from
8853 (output_gram): this.
8854 (prepare_rules): Be sure never to walk through RITEMS.
8855 (output_stos): Rename as...
8856 (prepare_stos): this.
8857 (output): Always invoke prepare_states, after all, just don't use it
8858 in the output if you don't need it.
8859
88602002-04-07 Akim Demaille <akim@epita.fr>
8861
8862 * src/LR0.c (new_state): Display `nstates' as the name of the
8863 newly created state.
8864 Adjust to initialize first_state and last_state if needed.
8865 Be sure to distinguish the initial from the final state.
8866 (new_states): Create the itemset of the initial state, and use
8867 new_state.
8868 * src/closure.c (closure): Now that the initial state has its
8869 items properly set, there is no need for a special case when
8870 creating `ruleset'.
8871
8872 As a result, now the rule 0, reducing to $axiom, is visible in the
8873 outputs. Adjust the test suite.
8874
8875 * tests/conflicts.at (Solved SR Conflicts)
8876 (Unresolved SR Conflicts): Adjust.
8877 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
8878 * tests/conflicts.at (S/R in initial): New.
8879
88802002-04-07 Akim Demaille <akim@epita.fr>
8881
8882 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
8883 the RHS of the rules.
8884 * src/output.c (output_gram): Likewise.
8885
88862002-04-07 Akim Demaille <akim@epita.fr>
8887
8888 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
8889 bucket.
8890 Adjust all dependencies.
8891 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
8892 `number' of the buckets too.
8893 * src/gram.h: Include `symtab.h'.
8894 (associativity): Move to...
8895 * src/symtab.h: here.
8896 No longer include `gram.h'.
8897
88982002-04-07 Akim Demaille <akim@epita.fr>
8899
8900 * src/gram.h, src/gram.c (rules_rhs_length): New.
8901 (ritem_longest_rhs): Use it.
8902 * src/gram.h (rule_t): `number' is a new member.
8903 * src/reader.c (packgram): Set it.
8904 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
8905 the end of `rules', and count them out of `nrules'.
8906 (reduce_output, dump_grammar): Adjust.
8907 * src/print.c (print_grammar): It is no longer needed to check for
8908 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
8909 * tests/reduce.at (Reduced Automaton): New test.
8910
89112002-04-07 Akim Demaille <akim@epita.fr>
8912
8913 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
8914 lacking `+ 1' to nrules, Bison reported as useless a token if it
8915 was used solely to set the precedence of the last rule...
8916
89172002-04-07 Akim Demaille <akim@epita.fr>
8918
8919 * data/bison.c++, data/bison.simple: Don't output the current file
8920 name in #line, to avoid useless diffs between two identical
8921 outputs under different names.
8922
89232002-04-07 Akim Demaille <akim@epita.fr>
8924
8925 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
8926 Normalize loops to using `< nrules + 1', not `<= nrules'.
8927
89282002-04-07 Akim Demaille <akim@epita.fr>
8929
8930 * TODO: Update.
8931
89322002-04-07 Akim Demaille <akim@epita.fr>
8933
8934 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
8935 bucket.value as bucket.number.
8936
89372002-04-07 Akim Demaille <akim@epita.fr>
8938
8939 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
8940 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
8941 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
8942 RHS, instead of being an index in RITEMS.
8943
89442002-04-04 Paul Eggert <eggert@twinsun.com>
8945
8946 * doc/bison.texinfo: Update copyright date.
8947 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
8948 (Symbols): Warn about running Bison in one character set,
8949 but compiling and/or running in an incompatible one.
8950 Warn about character code 256, too.
8951
89522002-04-03 Paul Eggert <eggert@twinsun.com>
8953
8954 * src/bison.data (YYSTACK_ALLOC): Depend on whether
8955 YYERROR_VERBOSE is nonzero, not whether it is defined.
8956
8957 Merge changes from bison-1_29-branch.
8958
89592002-03-20 Paul Eggert <eggert@twinsun.com>
8960
8961 Merge fixes from Debian bison_1.34-1.diff.
8962
8963 * configure.in (AC_PREREQ): 2.53.
8964
89652002-03-20 Akim Demaille <akim@epita.fr>
8966
8967 * src/conflicts.c (log_resolution): Argument `resolution' is const.
8968
89692002-03-19 Paul Eggert <eggert@twinsun.com>
8970
8971 * src/bison.simple (YYCOPY): New macro.
8972 (YYSTACK_RELOCATE): Use it.
8973 Remove Type arg; no longer needed. All callers changed.
8974 (yymemcpy): Remove; no longer needed.
8975
8976 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
8977 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
8978
89792002-03-19 Akim Demaille <akim@epita.fr>
8980
8981 Test and fix the #line outputs.
8982
8983 * tests/atlocal.at (GCC): New.
8984 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
8985 (Prologue synch line, %union synch line, Postprologue synch line)
8986 (Action synch line, Epilogue synch line): New tests.
8987 * src/reader.c (parse_union_decl): Define the muscle stype_line.
8988 * data/bison.simple, data/bison.c++: Use it.
8989
89902002-03-19 Akim Demaille <akim@epita.fr>
8991
8992 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
8993 (Solved SR Conflicts, %expect not enough, %expect right)
8994 (%expect too much): Move to...
8995 * tests/conflicts.at: this new file.
8996
89972002-03-19 Akim Demaille <akim@epita.fr>
8998
8999 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
9000 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
9001 that we can move to enums for instance.
9002 * src/output.c (token_definitions_output): Output a list of
9003 `token-name, token-number' instead of the #define.
9004 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
9005
90062002-03-14 Akim Demaille <akim@epita.fr>
9007
9008 Use Gettext 0.11.1.
9009
90102002-03-09 Robert Anisko <robert@lrde.epita.fr>
9011
9012 * data/bison.c++: Make the user able to add members to the generated
9013 parser by subclassing.
9014
90152002-03-05 Robert Anisko <robert@lrde.epita.fr>
9016
9017 * src/reader.c (read_additionnal_code): `c' should be an integer, not
9018 a character.
9019 Reported by Nicolas Tisserand and Nicolas Burrus.
9020
90212002-03-04 Robert Anisko <robert@lrde.epita.fr>
9022
9023 * src/reader.c: Warn about lacking semi-colons, do not complain.
9024
90252002-03-04 Robert Anisko <robert@lrde.epita.fr>
9026
9027 * data/bison.c++: Remove a debug line.
9028
90292002-03-04 Robert Anisko <robert@lrde.epita.fr>
9030
9031 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
9032 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
9033 provide a default implementation.
9034
90352002-03-04 Akim Demaille <akim@epita.fr>
9036
9037 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
9038 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
9039 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
9040 * tests/semantic.at (Parsing Guards): Similarly.
9041 * src/reader.at (readgram): Complain if the last rule is not ended
9042 with a semi-colon.
9043
90442002-03-04 Akim Demaille <akim@epita.fr>
9045
9046 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
9047 * src/closure.c: here.
9048 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
9049 RTC.
9050 * src/warshall.h, src/warshall.c: Remove.
9051 * tests/sets.at (Broken Closure): Adjust.
9052
90532002-03-04 Akim Demaille <akim@epita.fr>
9054
9055 * src/output.c (output_skeleton): tempdir is const.
9056 bytes_read is unused.
9057
90582002-03-04 Akim Demaille <akim@epita.fr>
9059
9060 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
9061 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
9062 Update.
9063 From Michael Hayes.
9064
90652002-03-04 Akim Demaille <akim@epita.fr>
9066
9067 * src/closure.c (closure): `r' is unused.
9068
90692002-03-04 Akim Demaille <akim@epita.fr>
9070
9071 * tests/sets.at (Broken Closure): Add the ending `;'.
9072 * src/reader.at (readgram): Complain if a rule is not ended with a
9073 semi-colon.
9074
90752002-03-04 Akim Demaille <akim@epita.fr>
9076
9077 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
9078 (count_sr_conflicts): Use bitset_count.
9079 * src/reduce.c (inaccessable_symbols): Ditto.
9080 (bits_size): Remove.
9081 * src/warshall.h, src/warshall.c: Convert to bitsetv.
9082
90832002-03-04 Akim Demaille <akim@epita.fr>
9084
9085 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
9086 * src/reduce.c: Remove the `bitset_zero's following the
9087 `bitset_create's, as now it is performed by the latter.
9088
90892002-03-04 Akim Demaille <akim@epita.fr>
9090
9091 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
9092 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
9093 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
9094 latest sources from Michael.
9095
90962002-03-04 Akim Demaille <akim@epita.fr>
9097
9098 * src/output.c (output): Don't free the grammar.
9099 * src/reader.c (grammar_free): New.
9100 * src/main.c (main): Call it and don't free symtab here.
9101
91022002-03-04 Akim Demaille <akim@epita.fr>
9103
9104 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
9105 before returning.
9106 Reported by Benoit Perrot.
9107
91082002-03-04 Akim Demaille <akim@epita.fr>
9109
9110 Use bitset operations when possible, not loops over bits.
9111
9112 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
9113 bitset_or.
9114 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
9115 * src/reduce.c (useless_nonterminals): Formatting changes.
9116 * src/warshall.c (TC): Use bitset_or.
9117
91182002-03-04 Akim Demaille <akim@epita.fr>
9119
9120 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
9121 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
9122 Ditto.
9123
91242002-03-04 Akim Demaille <akim@epita.fr>
9125
9126 * src/lalr.c (F): Now a bitset*.
9127 Adjust all dependencies.
9128
91292002-03-04 Akim Demaille <akim@epita.fr>
9130
9131 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
9132 Adjust all dependencies.
9133
91342002-03-04 Akim Demaille <akim@epita.fr>
9135
9136 * src/L0.c, src/LR0.h (nstates): Be size_t.
9137 Adjust comparisons (signed vs unsigned).
9138 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
9139 bitset*.
9140 Adjust all dependencies.
9141
91422002-03-04 Akim Demaille <akim@epita.fr>
9143
9144 * src/closure.c (firsts): Now, also a bitset.
9145 Adjust all dependencies.
9146 (varsetsize): Remove, now unused.
9147 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
9148
91492002-03-04 Akim Demaille <akim@epita.fr>
9150
9151 * src/print.c: Convert to use bitset.h, not hand coded iterations
9152 over ints.
9153
91542002-03-04 Akim Demaille <akim@epita.fr>
9155
9156 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
9157
91582002-03-04 Akim Demaille <akim@epita.fr>
9159
9160 * src/closure.c (ruleset): Be a bitset.
9161 (rulesetsize): Remove.
9162
91632002-03-04 Akim Demaille <akim@epita.fr>
9164
9165 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
9166 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
9167 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
9168 * src/closure.c (fderives): Be an array of bitsets.
9169
91702002-02-28 Robert Anisko <robert@lrde.epita.fr>
9171
9172 * data/bison.c++: Merge the two generated headers. Insert a copyright
9173 notice in each output file.
9174
91752002-02-28 Akim Demaille <akim@epita.fr>
9176
9177 * data/bison.c++: Copy the prologue of bison.simple to fetch
9178 useful M4 definitions, such as b4_header_guard.
9179
91802002-02-25 Akim Demaille <akim@epita.fr>
9181
9182 * src/getargs.c (version): Give the name of the authors, and use a
9183 translator friendly scheme for the bgr
9184 copyright notice.
9185
91862002-02-25 Akim Demaille <akim@epita.fr>
9187
9188 * src/output.c (header_output): Remove, now handled completely via
9189 M4.
9190
91912002-02-25 Akim Demaille <akim@epita.fr>
9192
9193 * m4/m4.m4: New, from CVS Autoconf.
9194 * configure.in: Invoke it.
9195 * src/output.c (output_skeleton): Use its result instead of the
9196 hard coded name.
9197
91982002-02-25 Akim Demaille <akim@epita.fr>
9199
9200 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
9201 Fileutils 4.1.5.
9202 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
9203 * src/output.c (output_skeleton): Use mkstemp to create a real
9204 temporary file.
9205 Move the filling of `skeleton' and its muscle to...
9206 (prepare): here.
9207 (output): Move the definition of the prologue muscle to...
9208 (prepare): here.
9209 * src/system.h (DEFAULT_TMPDIR): New.
9210
92112002-02-14 Paul Eggert <eggert@twinsun.com>
9212
9213 Remove the support for C++ namespace cleanliness; it was
9214 causing more problems than it was curing, since it didn't work
9215 properly on some nonstandard C++ compilers. This can wait
9216 for a proper C++ parser.
9217
9218 * NEWS: Document this.
9219 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
9220 of C++, as it's treated like C now.
9221 * src/bison.simple (YYSTD): Remove.
9222 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
9223 Treat C++ just like Standard C instead of trying to support
9224 namespace cleanliness.
9225
92262002-02-14 Akim Demaille <akim@epita.fr>
9227
9228 * tests/regression.at (else): Adjust to Andreas' change.
9229
92302002-02-14 Akim Demaille <akim@epita.fr>
9231
9232 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
9233
92342002-02-13 Andreas Schwab <schwab@suse.de>
9235
9236 * src/output.c (output_rule_data): Don't output NULL, it might
9237 not be defined yet.
9238
92392002-02-11 Robert Anisko <robert@lrde.epita.fr>
9240
9241 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
9242 (Copyright notice): Update.
9243
92442002-02-11 Akim Demaille <akim@epita.fr>
9245
9246 * tests/regression.at (%nonassoc and eof): Don't include
9247 nonportable headers.
9248
92492002-02-08 Robert Anisko <robert@lrde.epita.fr>
9250
9251 * data/bison.c++: Correct error recovery. Make the user able to
9252 initialize the starting location.
9253
92542002-02-07 Akim Demaille <akim@epita.fr>
9255
9256 * tests/input.at: New.
9257
92582002-02-07 Robert Anisko <robert@lrde.epita.fr>
9259
9260 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9261 more consistent when naming methods and variables. Put preprocessor
9262 directives around tables only needed for debugging.
9263
92642002-02-07 Robert Anisko <robert@lrde.epita.fr>
9265
9266 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
9267 C++ parsers.
9268 (yy::b4_name::parse): Use print_.
9269
92702002-02-07 Robert Anisko <robert@lrde.epita.fr>
9271
9272 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
9273
92742002-02-07 Robert Anisko <robert@lrde.epita.fr>
9275
9276 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
9277 C++ parsers.
9278 (yy::b4_name::parse): Build verbose error messages, and use error_.
9279
92802002-02-06 Robert Anisko <robert@lrde.epita.fr>
9281
9282 * data/bison.c++: Fix m4 quoting in comments.
9283
92842002-02-06 Robert Anisko <robert@lrde.epita.fr>
9285
9286 * data/bison.c++: Adjust the parser code. Fix some muscles that were
9287 not expanded by m4.
9288
92892002-02-05 Akim Demaille <akim@epita.fr>
9290
9291 * data/bison.c++: Adjust to the M4 back end.
9292 More is certainly needed.
9293
92942002-02-05 Akim Demaille <akim@epita.fr>
9295
9296 Give a try to M4 as a back end.
9297
9298 * lib/readpipe.c: New, from wdiff.
9299 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
9300 BISON_HAIRY.
9301 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
9302 specific values. Now it is m4 that performs the lookup.
9303 * src/parse-skel.y: Remove.
9304 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
9305 * src/output.c (actions_output, guards_output)
9306 (token_definitions_output): No longer keeps track of the output
9307 line number, hence remove the second argument.
9308 (guards_output): Check against the guard member of a rule, not the
9309 action member.
9310 Adjust callers.
9311 (output_skeleton): Don't look for the skeleton location, let m4 do
9312 that.
9313 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
9314 file will be used.
9315 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
9316 (prepare): Given that for the time being changesyntax is not
9317 usable in M4, rename the muscles using `-' to `_'.
9318 Define `defines_flag', `output_parser_name' and `output_header_name'.
9319 * src/output.h (actions_output, guards_output)
9320 (token_definitions_output): Adjust prototypes.
9321 * src/scan-skel.l: Instead of scanning the skeletons, it now
9322 processes the output of m4: `__oline__' and `#output'.
9323 * data/bison.simple: Adjust to be used by M4(sugar).
9324 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
9325 to date.
9326 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
9327 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
9328 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
9329 shamelessly stolen from CVS Autoconf.
9330
93312002-02-05 Akim Demaille <akim@epita.fr>
9332
9333 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
9334 * configure.in: Check for the declarations of free and malloc.
9335 * src/muscle_tab.c: Adjust.
9336
93372002-02-05 Akim Demaille <akim@epita.fr>
9338
9339 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
9340 which have no values.
9341
93422002-02-05 Akim Demaille <akim@epita.fr>
9343
9344 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
9345 * data/: here.
9346
93472002-01-29 Paul Eggert <eggert@twinsun.com>
9348
9349 * src/bison.simple (YYSIZE_T): Do not define merely because
9350 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
9351 On some platforms, <alloca.h> does not declare YYSTD (size_t).
9352
93532002-01-27 Akim Demaille <akim@epita.fr>
9354
9355 Fix `%nonassoc and eof'.
9356
9357 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
9358 which were not properly copied! Replace
9359 memcpy (res->errs, src->errs, src->nerrs);
9360 with
9361 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
9362 !!!
9363 * tests/regression.at (%nonassoc and eof): Adjust to newest
9364 Autotest: `.' is not in the PATH.
9365
93662002-01-27 Akim Demaille <akim@epita.fr>
9367
9368 * tests/sets.at (AT_EXTRACT_SETS): New.
9369 (Nullable): Use it.
9370 (Firsts): New.
9371
93722002-01-26 Akim Demaille <akim@epita.fr>
9373
9374 * tests/actions.at, tests/calc.at, tests/headers.at,
9375 * tests/torture.at: Adjust to the newest Autotest which no longer
9376 forces `.' in the PATH.
9377
93782002-01-25 Akim Demaille <akim@epita.fr>
9379
9380 * tests/regression.at (%nonassoc and eof): New.
9381 Suggested by Robert Anisko.
9382
93832002-01-24 Akim Demaille <akim@epita.fr>
9384
9385 Bison dumps core when trying to complain about broken input files.
9386 Reported by Cris van Pelt.
9387
9388 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
9389 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
9390 into...
9391 (Invalid inputs): Strengthen: exercise parse_percent_token.
9392
93932002-01-24 Robert Anisko <robert.anisko@epita.fr>
9394
9395 * src/Makefile.am: Add bison.c++.
9396 * src/bison.c++: New skeleton.
9397
93982002-01-21 Paolo Bonzini <bonzini@gnu.org>
9399
9400 * po/it.po: New.
9401
94022002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
9403
9404 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
9405
94062002-01-20 Marc Autret <marc@gnu.org>
9407
9408 * src/files.c (compute_output_file_names): Fix
9409
94102002-01-20 Marc Autret <marc@gnu.org>
9411
9412 * tests/output.at: New test.
9413 * src/files.c (compute_base_names): Don't map extensions when
9414 the YACC flag is set, use defaults.
9415 Reported by Evgeny Stambulchik.
9416
94172002-01-20 Marc Autret <marc@gnu.org>
9418
9419 * src/system.h: Need to define __attribute__ away for non-GCC
9420 compilers as well (i.e., the vendor C compiler).
9421 Suggested by Albert Chin-A-Young.
9422
94232002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
9424
9425 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
9426 canonical definition.
9427 * src/system.h: Use the canonical definition for PARAMS (avoids
9428 a conflict with the macro from lib/hash.h).
9429
94302002-01-11 Akim Demaille <akim@epita.fr>
9431
9432 * configure.in: Use AC_FUNC_STRNLEN.
9433 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
9434
94352002-01-09 Akim Demaille <akim@epita.fr>
9436
9437 * src/files.c, src/files.h (output_infix): New.
9438 (tab_extension): Remove.
9439 (compute_base_names): Compute the former, drop the latter.
9440 * src/output.c (prepare): Insert the muscles `output-infix', and
9441 `output-suffix'.
9442 * src/parse-skel.y (string, string.1): New.
9443 (section.header): Use it.
9444 (section.yacc): Remove.
9445 (prefix): Remove too.
9446 * src/scan-skel.l: Adjust.
9447 * src/bison.simple, src/bison.hairy: Adjust.
9448
94492002-01-09 Akim Demaille <akim@epita.fr>
9450
9451 * configure.in (WERROR_CFLAGS): Compute it.
9452 * src/Makefile.am (CFLAGS): Pass it.
9453 * tests/atlocal.in (CFLAGS): Idem.
9454 * src/files.c: Fix a few warnings.
9455 (get_extension_index): Remove, unused.
9456
94572002-01-08 Akim Demaille <akim@epita.fr>
9458
9459 * src/getargs.c (AS_FILE_NAME): New.
9460 (getargs): Use it to convert DOSish file names.
9461 * src/files.c (base_name): Rename as full_base_name to avoid
9462 clashes with `base_name ()'.
9463 (filename_split): New.
9464 (compute_base_names): N-th rewrite, using filename_split.
9465
94662002-01-08 Akim Demaille <akim@epita.fr>
9467
9468 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
9469 New, stolen from the Fileutils 4.1.
9470 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
9471 * configure.in: Check for the presence of memrchr, and of its
9472 prototype.
9473
94742002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
9475
9476 * lib/hash.h (__P): Added definition for this macro.
9477 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
9478 BUILT_SOURCES, to ensure they are generated first.
9479 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
9480 %error-verbose to allow bootstrapping with bison 1.30x.
9481
94822002-01-06 Akim Demaille <akim@epita.fr>
9483
9484 * src/reader.c (parse_braces): Don't fetch the next char, the
9485 convention is to fetch on entry.
9486 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
9487 'switch' without a following semicolon.
9488 * tests/regression.at (braces parsing): New.
9489
94902002-01-06 Akim Demaille <akim@epita.fr>
9491
9492 Bison is dead wrong in its RR conflict reports.
9493
9494 * tests/torture.at (GNU Cim Grammar): New.
9495 * src/conflicts.c (count_rr_conflicts): Fix.
9496
94972002-01-06 Akim Demaille <akim@epita.fr>
9498
9499 Creating package.m4 from configure.ac causes too many problems.
9500
9501 * tests/Makefile.am (package.m4): Create it by hand,
9502 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
9503
95042002-01-06 Akim Demaille <akim@epita.fr>
9505
9506 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
9507 skeleton.h.
9508
95092002-01-04 Paul Eggert <eggert@twinsun.com>
9510
9511 * doc/bison.texinfo (Debugging):
9512 Remove YYSTDERR; it's no longer defined or used.
9513 Also, s/cstdio.h/cstdio/.
9514
95152002-01-03 Akim Demaille <akim@epita.fr>
9516
9517 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
9518
95192002-01-03 Akim Demaille <akim@epita.fr>
9520
9521 * src/parse-skel.y (process_skeleton): Don't bind the parser's
9522 tracing code to --trace, wait for a better --trace option, with
9523 args.
9524
95252002-01-03 Akim Demaille <akim@epita.fr>
9526
9527 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
9528 The ISO C++ standard is extremely clear about it: stderr is
9529 considered a macro, not a regular symbol (see table 94 `Header
9530 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
9531 Therefore std:: does not apply to it. It still does with fprintf.
9532 Also, s/cstdio.h/cstdio/.
9533
95342002-01-03 Akim Demaille <akim@epita.fr>
9535
9536 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
9537 for non system headers.
9538
95392002-01-02 Akim Demaille <akim@epita.fr>
9540
9541 Equip the skeleton chain with location tracking, runtime trace,
9542 pure parser and scanner.
9543
9544 * src/parse-skel.y: Request a pure parser, locations, and prefix
9545 renaming.
9546 (%union): Having several members with the same type does not help
9547 type mismatches, simplify.
9548 (YYPRINT, yyprint): New.
9549 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
9550 (skel_error): this.
9551 Handle locations.
9552 * src/scan-skel.l: Adjust to these changes.
9553 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
9554 (LOCATION_PRINT, skel_control_t): New.
9555
95562001-12-30 Akim Demaille <akim@epita.fr>
9557
9558 * src/parse-skel.y: Get rid of the shift/reduce conflict:
9559 replace `gb' with BLANKS.
9560 * src/scan-skel.l: Adjust.
9561
95622001-12-30 Akim Demaille <akim@epita.fr>
9563
9564 * src/system.h: We don't need nor want bcopy.
9565 Throw away MS-DOS crap: we don't need getpid.
9566 * configure.in: We don't need strndup. It was even causing
9567 problems: because Flex includes the headers *before* us,
9568 _GNU_SOURCE is not defined by config.h, and therefore strndup was
9569 not visible.
9570 * lib/xstrndup.c: New.
9571 * src/scan-skel.l: Use it.
9572 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
9573 * src/parse-skel.y: Use %directives instead of #defines.
9574
95752001-12-30 Akim Demaille <akim@epita.fr>
9576
9577 * src/skeleton.h: New.
9578 * src/output.c (output_parser, output_master_parser): Remove, dead
9579 code.
9580 * src/output.h (get_lines_number, actions_output, guards_output)
9581 (token_definitions_output): Prototype them.
9582 * src/parse-skel.y: Add the license notice.
9583 Include output.h and skeleton.h.
9584 (process_skeleton): Returns void, and takes a single parameter.
9585 * src/scan-skel.l: Add the license notice.
9586 Include skeleton.h.
9587 Don't use %option yylineno: it seems that then Flex imagines
9588 REJECT has been used, and therefore it won't reallocate its
9589 buffers (which makes no other sense to me than a bug). It results
9590 in warnings for `unused: yy_flex_realloc'.
9591
95922001-12-30 Robert Anisko <robert.anisko@epita.fr>
9593
9594 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
9595 (MUSCLE_INSERT_PREFIX): ...to there.
9596 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
9597 (MUSCLE_INSERT_PREFIX): Move from here...
9598
9599 * src/bison.hairy: Add a section directive. Put braces around muscle
9600 names. This parser skeleton is still broken, but Bison should not
9601 choke on a bad muscle 'syntax'.
9602 * src/bison.simple: Add a section directive. Put braces around muscle
9603 names.
9604
9605 * src/files.h (strsuffix, stringappend): Add declarations.
9606 (tab_extension): Add declaration.
9607 (short_base_name): Add declaration.
9608
9609 * src/files.c (strsuffix, stringappend): No longer static. These
9610 functions are used in the skeleton parser.
9611 (tab_extension): New.
9612 (compute_base_names): Use the computations done in this function
9613 to guess if the generated parsers should have '.tab' in their
9614 names.
9615 (short_base_name): No longer static.
9616
9617 * src/output.c (output_skeleton): New.
9618 (output): Disable call to output_master_parser, and give a try to
9619 a new skeleton handling system.
9620 (guards_output, actions_output): No longer static.
9621 (token_definitions_output, get_lines_number): No longer static.
9622
9623 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
9624
9625 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9626 parse-skel.y.
9627
9628 * src/parse-skel.y: New file.
9629 * src/scan-skel.l: New file.
9630
96312001-12-29 Akim Demaille <akim@epita.fr>
9632
9633 %name-prefix is broken.
9634
9635 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
9636 Adjust all dependencies.
9637 * tests/headers.at (export YYLTYPE): Strengthen this test: use
9638 %name-prefix.
9639
9640 Renaming yylval but not yylloc is not consistent. Now we do.
9641
9642 * src/bison.simple: Prefix yylloc if used.
9643 * doc/bison.texinfo (Decl Summary): Document that.
9644
96452001-12-29 Akim Demaille <akim@epita.fr>
9646
9647 * doc/bison.texinfo: Promote `%long-directive' over
9648 `%long_directive'.
9649 Remove all references to fixed-output-files, yacc is enough.
9650
96512001-12-29 Akim Demaille <akim@epita.fr>
9652
9653 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
9654 user prologue. These are defaults.
9655 * tests/actions.at (Mid-rule actions): Make sure the user can
9656 define YYDEBUG and YYERROR_VERBOSE.
9657
96582001-12-29 Akim Demaille <akim@epita.fr>
9659
9660 * src/output.c (header_output): Don't forget to export YYLTYPE and
9661 yylloc.
9662 * tests/headers.at (export YYLTYPE): New, make sure it does.
9663 * tests/regression.at (%union and --defines, Invalid CPP headers):
9664 Move to...
9665 * tests/headers.at: here.
9666
96672001-12-29 Akim Demaille <akim@epita.fr>
9668
9669 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
9670
96712001-12-29 Akim Demaille <akim@epita.fr>
9672
9673 * tests/actions.at (Mid-rule actions): Output on a single line
9674 instead of several.
9675
96762001-12-29 Akim Demaille <akim@epita.fr>
9677
9678 * doc/bison.texinfo: Formatting changes.
9679
96802001-12-29 Akim Demaille <akim@epita.fr>
9681
9682 Don't store the token defs in a muscle, just be ready to output it
9683 on command. Now possible via `symbols'. Fixes a memory leak.
9684
9685 * src/output.c (token_definitions_output): New.
9686 (output_parser, header_output): Use it.
9687 * src/reader.c (symbols_save): Remove.
9688
96892001-12-29 Akim Demaille <akim@epita.fr>
9690
9691 * src/bison.simple: Do not provide a default for YYSTYPE and
9692 YYLTYPE before the user's prologue. Otherwise it's hardly... a
9693 default.
9694
96952001-12-29 Akim Demaille <akim@epita.fr>
9696
9697 Mid-rule actions are simply... ignored!
9698
9699 * src/reader.c (readgram): Be sure to attach mid-rule actions to
9700 the empty-rule associated to the dummy symbol, not to the host
9701 rule.
9702 * tests/actions.at (Mid-rule actions): New.
9703
97042001-12-29 Akim Demaille <akim@epita.fr>
9705
9706 Memory leak.
9707
9708 * src/reader.c (reader): Free grammar.
9709
97102001-12-29 Akim Demaille <akim@epita.fr>
9711
9712 Memory leak.
9713
9714 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
9715 since it allocates it for each state, although only one is needed.
9716 (allocate_storage): Do it here.
9717
97182001-12-29 Akim Demaille <akim@epita.fr>
9719
9720 * src/options.h, src/options.c (create_long_option_table): Rename
9721 as...
9722 (long_option_table_new): this, with a clearer prototype.
9723 (percent_table): Remove, unused,
9724 * src/getargs.c (getargs): Adjust.
9725
97262001-12-29 Akim Demaille <akim@epita.fr>
9727
9728 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
9729 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
9730 as states.
9731
97322001-12-29 Akim Demaille <akim@epita.fr>
9733
9734 * src/lalr.c (build_relations): Rename `states' as `states1'.
9735 Sorry, I don't understand exactly what it is, no better name...
9736
97372001-12-29 Akim Demaille <akim@epita.fr>
9738
9739 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
9740 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
9741 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
9742 as rules.
9743
97442001-12-29 Akim Demaille <akim@epita.fr>
9745
9746 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
9747 ago.
9748
97492001-12-29 Akim Demaille <akim@epita.fr>
9750
9751 * src/reader.c, src/reader.h (user_toknums): Remove.
9752 Adjust all users to use symbols[i]->user_token_number.
9753
97542001-12-29 Akim Demaille <akim@epita.fr>
9755
9756 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
9757 Adjust all users to use symbols[i]->prec or ->assoc.
9758
97592001-12-29 Akim Demaille <akim@epita.fr>
9760
9761 * src/reader.c, src/reader.h (tags): Remove.
9762 Adjust all users to use symbols[i]->tag.
9763
97642001-12-29 Akim Demaille <akim@epita.fr>
9765
9766 * src/gram.h, src/gram.c (symbols): New, similar to state_table
9767 and rule_table.
9768 * src/reader.c (packsymbols): Fill this table.
9769 Drop sprec.
9770 * src/conflicts.c (resolve_sr_conflict): Adjust.
9771 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
9772 single table.
9773 Use symbols[i]->tag instead of tags[i].
9774
97752001-12-29 Akim Demaille <akim@epita.fr>
9776
9777 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
9778 In addition, put a comment in there, to replace...
9779 * tests/regression.at (%union and C comments): Remove.
9780
97812001-12-29 Akim Demaille <akim@epita.fr>
9782
9783 * tests/regression.at (Web2c Actions): Blindly move the actual
9784 output as expected output. The contents *seem* right to me, but I
9785 can't pretend reading perfectly parser tables... Nonetheless, all
9786 the other tests pass correctly, the table look OK, even though the
9787 presence of `$axiom' is to be noted: AFAICS it is useless (but
9788 harmless).
9789
97902001-12-29 Akim Demaille <akim@epita.fr>
9791
9792 * src/reader.c (readgram): Don't add the rule 0 if there were no
9793 rules read. In other words, add it _after_ having performed
9794 grammar sanity checks.
9795 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
9796
97972001-12-29 Akim Demaille <akim@epita.fr>
9798
9799 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
9800 visible, and some states have now a different number.
9801
98022001-12-29 Akim Demaille <akim@epita.fr>
9803
9804 * src/reader.c (readgram): Bind the initial rule's lineno to that
9805 of the first rule.
9806 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
9807 (Solved SR Conflicts): Adjust rule 0's line number.
9808
98092001-12-29 Akim Demaille <akim@epita.fr>
9810
9811 Fix the `GAWK Grammar' failure.
9812
9813 * src/LR0.c (final_state): Initialize to -1 so that we do compute
9814 the reductions of the first state which was mistakenly confused
9815 with the final state because precisely final_state was initialized
9816 to 0.
9817 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
9818 now noticed by Bison.
9819 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
9820 have a reduction on $default.
9821
98222001-12-29 Akim Demaille <akim@epita.fr>
9823
9824 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
9825 rule line numbers.
9826 * src/closure.c (print_closure): Likewise.
9827 * src/derives.c (print_derives): Likewise.
9828 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
9829 now.
9830
98312001-12-29 Akim Demaille <akim@epita.fr>
9832
9833 * src/lalr.c (lookaheads_print): New.
9834 (lalr): Call it when --trace-flag.
9835 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
9836 are dumped.
9837
98382001-12-29 Akim Demaille <akim@epita.fr>
9839
9840 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
9841 when walking through ritem, even via rule->rhs.
9842 * src/reduce.c (dump_grammar, useful_production, reduce_output)
9843 (useful_production, useless_nonterminals): Likewise.
9844 (reduce_grammar_tables): Likewise, plus update nritems.
9845 * src/nullable.c (set_nullable): Likewise.
9846 * src/lalr.c (build_relations): Likewise.
9847 * tests/sets.at (Nullable): Adjust.
9848 Fortunately, now, the $axiom is no longer nullable.
9849
98502001-12-29 Akim Demaille <akim@epita.fr>
9851
9852 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
9853 the 0-sentinel.
9854 * src/gram.c (ritem_longest_rhs): Likewise.
9855 * src/reduce.c (nonterminals_reduce): Likewise.
9856 * src/print_graph.c (print_graph): Likewise.
9857 * src/output.c (output_rule_data): Likewise.
9858 * src/nullable.c (set_nullable): Likewise.
9859
98602001-12-29 Akim Demaille <akim@epita.fr>
9861
9862 * src/output.c: Comment changes.
9863
98642001-12-27 Paul Eggert <eggert@twinsun.com>
9865
9866 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
9867 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
9868 Sparc, as they were causing more porting problems than the
9869 (minor) performance improvement was worth.
9870
9871 Also, catch up with 1.31's YYSTD.
9872
98732001-12-27 Akim Demaille <akim@epita.fr>
9874
9875 * src/output.c (output_gram): Rely on nritems, not the
9876 0-sentinel. See below.
9877 Use -1 as separator, not 0.
9878 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
9879 Rely on -1 as separator in yyrhs, instead of 0.
9880 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
9881 twice `Now at end of input', therefore there are two lines less to
9882 expect.
9883
98842001-12-27 Akim Demaille <akim@epita.fr>
9885
9886 * tests/regression.at (Unresolved SR Conflicts):
9887 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
9888 below.
9889
98902001-12-27 Akim Demaille <akim@epita.fr>
9891
9892 * src/LR0.c (new_state): Recognize the final state by the fact it
9893 is reached by eoftoken.
9894 (insert_start_shifting_state, insert_eof_shifting_state)
9895 (insert_accepting_state, augment_automaton): Remove, since now
9896 these states are automatically computed from the initial state.
9897 (generate_states): Adjust.
9898 * src/print.c: When reporting a rule number to the user, substract
9899 1, so that the axiom rule is rule 0, and the first user rule is 1.
9900 * src/reduce.c: Likewise.
9901 * src/print_graph.c (print_core): For the time being, just as for
9902 the report, depend upon --trace-flags to dump the full set of
9903 items.
9904 * src/reader.c (readgram): Once the grammar read, insert the rule
9905 0: `$axiom: START-SYMBOL $'.
9906 * tests/set.at: Adjust: rule 0 is now displayed, and since the
9907 number of the states has changed (the final state is no longer
9908 necessarily the last), catch up.
9909
99102001-12-27 Akim Demaille <akim@epita.fr>
9911
9912 Try to make the use of the eoftoken valid. Given that its value
9913 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
9914 is used instead of > 0 where appropriate, (ii), depend upon nritems
9915 instead of the 0-sentinel.
9916
9917 * src/gram.h, src/gram.c (nritems): New.
9918 Expected to be duplication of nitems, but for the time being...
9919 * src/reader.c (packgram): Assert nritems and nitems are equal.
9920 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
9921 * src/closure.c (print_closure, print_fderives): Likewise.
9922 * src/gram.c (ritem_print): Likewise.
9923 * src/print.c (print_core, print_grammar): Likewise.
9924 * src/print_graph.c: Likewise.
9925
99262001-12-27 Akim Demaille <akim@epita.fr>
9927
9928 * src/main.c (main): If there are complains after grammar
9929 reductions, then output the report anyway if requested, then die.
9930 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
9931 * src/reader.c (eoftoken): New.
9932 (parse_token_decl): If the token being defined has value `0', it
9933 is the eoftoken.
9934 (packsymbols): No longer hack `tags' to insert `$' by hand.
9935 Be sure to preserve the value of the eoftoken.
9936 (reader): Make sure eoftoken is defined.
9937 Initialize nsyms to 0: now eoftoken is created just like the others.
9938 * src/print.c (print_grammar): Don't special case the eof token.
9939 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
9940 lie anyway, albeit pleasant.
9941 * tests/calc.at: Exercise error messages with eoftoken.
9942 Change the grammar so that empty input is invalid.
9943 Adjust expectations.
9944 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
9945
99462001-12-27 Akim Demaille <akim@epita.fr>
9947
9948 * configure.in: Check the protos of strchr ans strspn.
9949 Replace strchr if needed.
9950 * src/system.h: Provide the protos of strchr, strspn and memchr if
9951 missing.
9952 * lib/strchr.c: New.
9953 * src/reader.c (symbols_save): Use strchr.
9954
99552001-12-27 Akim Demaille <akim@epita.fr>
9956
9957 * src/print.c, src/print_graph.c (escape): New.
9958 Use it to quote the TAGS outputs.
9959 * src/print_graph.c (print_state): Now errors are in red, and
9960 reductions in green.
9961 Prefer high to wide: output the state number on a line of its own.
9962
99632001-12-27 Akim Demaille <akim@epita.fr>
9964
9965 * src/state.h, src/state.c (reductions_new): New.
9966 * src/LR0.c (set_state_table): Let all the states have a
9967 `reductions', even if reduced to 0.
9968 (save_reductions): Adjust.
9969 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
9970 * src/print.c (print_reductions, print_actions): Adjust.
9971 * src/output.c (action_row): Adjust.
9972
99732001-12-27 Akim Demaille <akim@epita.fr>
9974
9975 * src/state.h, src/state.c (errs_new, errs_dup): New.
9976 * src/LR0.c (set_state_table): Let all the states have an errs,
9977 even if reduced to 0.
9978 * src/print.c (print_errs, print_reductions): Adjust.
9979 * src/output.c (output_actions, action_row): Adjust.
9980 * src/conflicts.c (resolve_sr_conflict): Adjust.
9981
99822001-12-27 Akim Demaille <akim@epita.fr>
9983
9984 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
9985
99862001-12-27 Akim Demaille <akim@epita.fr>
9987
9988 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
9989 * src/print.c: here.
9990 (lookaheadset, shiftset): New, used as additional storage by
9991 print_reductions.
9992 (print_results): Adjust.
9993 (print_shifts, print_gotos, print_errs): New, extracted from...
9994 (print_actions): here.
9995 * src/print_graph.c (print_actions): Remove dead code.
9996
99972001-12-27 Akim Demaille <akim@epita.fr>
9998
9999 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
10000 `$n' and `@n'.
10001
100022001-12-27 Akim Demaille <akim@epita.fr>
10003
10004 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
10005 (build_relations): Adjust.
10006
100072001-12-27 Akim Demaille <akim@epita.fr>
10008
10009 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
10010 duplication.
10011
100122001-12-27 Akim Demaille <akim@epita.fr>
10013
10014 * src/reader.c (packgram): Catch nitems overflows.
10015
100162001-12-27 Akim Demaille <akim@epita.fr>
10017
10018 * src/files.c, src/files.h (guard_obstack): Remove.
10019 * src/output.c (output): Adjust.
10020 * src/reader.c (parse_braces): New, factoring...
10021 (copy_action, copy_guard): these two which are renamed as...
10022 (parse_action, parse_guard): these.
10023 As a voluntary consequence, using braces around guards is now
10024 mandatory.
10025
100262001-12-27 Akim Demaille <akim@epita.fr>
10027
10028 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
10029 * src/reader.c (symbol_list): `guard' and `guard_line' are new
10030 members.
10031 (symbol_list_new): Adjust.
10032 (copy_action): action_line is the first line, not the last.
10033 (copy_guard): Just as for actions, store the `action' only, not
10034 the switch/case/break flesh.
10035 Don't parse the user action that might follow the guard, let...
10036 (readgram): do it, i.e., now, there can be an action after a
10037 guard.
10038 In other words the guard is just explicitly optional.
10039 (packgram): Adjust.
10040 * src/output.c (guards_output): New.
10041 (output_parser): Call it when needed.
10042 (output): Also free the guard and attrs obstacks.
10043 * src/files.c, src/files.h (obstack_save): Remove.
10044 (output_files): Remove.
10045 As a result, if one needs the former `.act' file, using an
10046 appropriate skeleton which requires actions and guards is now
10047 required.
10048 * src/main.c (main): Adjust.
10049 * tests/semantic.at: New.
10050 * tests/regression.at: Use `input.y' as input file name.
10051 Avoid 8+3 problems by requiring input.c when the test needs the
10052 parser.
10053
100542001-12-27 Akim Demaille <akim@epita.fr>
10055
10056 * src/reader.c (symbol_list_new): Be sure to initialize all the
10057 fields.
10058
100592001-12-27 Akim Demaille <akim@epita.fr>
10060
10061 All the hacks using a final pseudo state are now useless.
10062
10063 * src/LR0.c (set_state_table): state_table holds exactly nstates.
10064 * src/lalr.c (nLA): New.
10065 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
10066 instead of lookaheadsp from the pseudo state (nstate + 1).
10067
100682001-12-27 Akim Demaille <akim@epita.fr>
10069
10070 * src/output.c (action_row, token_actions): Use a state_t instead
10071 of a integer, and nlookaheads instead of the following state's
10072 lookaheadsp.
10073
100742001-12-27 Akim Demaille <akim@epita.fr>
10075
10076 * src/conflicts.c (log_resolution, flush_shift)
10077 (resolve_sr_conflict, set_conflicts, solve_conflicts)
10078 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
10079 (conflicts_print, print_reductions): Use a state_t instead of an
10080 integer when referring to a state.
10081 As much as possible, depend upon nlookaheads, instead of the
10082 `lookaheadsp' member of the following state (since lookaheads of
10083 successive states are successive, the difference between state n + 1
10084 and n served as the number of lookaheads for state n).
10085 * src/lalr.c (add_lookback_edge): Likewise.
10086 * src/print.c (print_core, print_actions, print_state)
10087 (print_results): Likewise.
10088 * src/print_graph.c (print_core, print_actions, print_state)
10089 (print_graph): Likewise.
10090 * src/conflicts.h: Adjust.
10091
100922001-12-27 Akim Demaille <akim@epita.fr>
10093
10094 * src/bison.hairy: Formatting/comment changes.
10095 ANSIfy.
10096 Remove `register' indications.
10097 Add plenty of `static'.
10098
100992001-12-27 Akim Demaille <akim@epita.fr>
10100
10101 * src/output.c (prepare): Drop the muscle `ntbase' which
10102 duplicates ntokens.
10103 * src/bison.simple: Formatting/comment changes.
10104 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
10105 is an undocumented synonym.
10106
101072001-12-22 Akim Demaille <akim@epita.fr>
10108
10109 * src/output.c (output_table_data): Change the prototype to use
10110 `int' for array ranges: some invocations do pass an int, not a
10111 short.
10112 Reported by Wayne Green.
10113
101142001-12-22 Akim Demaille <akim@epita.fr>
10115
10116 Some actions of web2c.y are improperly triggered.
10117 Reported by Mike Castle.
10118
10119 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
10120 * tests/regression.at (Web2c): Rename as...
10121 (Web2c Report): this.
10122 (Web2c Actions): New.
10123
101242001-12-22 Akim Demaille <akim@epita.fr>
10125
10126 Reductions in web2c.y are improperly reported.
10127 Reported by Mike Castle.
10128
10129 * src/conflicts.c (print_reductions): Fix.
10130 * tests/regression.at (Web2c): New.
10131
101322001-12-18 Akim Demaille <akim@epita.fr>
10133
10134 Some host fail on `assert (!"foo")', which expands to
10135 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
10136 Reported by Nelson Beebee.
10137
10138 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
10139 `#define it_succeeded 0' and `assert (it_succeeded)'.
10140
101412001-12-17 Marc Autret <autret_m@epita.fr>
10142
10143 * src/bison.simple: Don't hard code the skeleton line and filename.
10144 * src/output.c (output_parser): Rename 'line' as 'output_line'.
10145 New line counter 'skeleton_line' (skeleton-line muscle).
10146
101472001-12-17 Paul Eggert <eggert@twinsun.com>
10148
10149 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
10150 YYDEBUG must be defined to a nonzero value.
10151
10152 * src/bison.simple (yytname): Do not assume that the user defines
10153 YYDEBUG to a properly parenthesized expression.
10154
101552001-12-17 Akim Demaille <akim@epita.fr>
10156
10157 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
10158 nlookaheads is a new member.
10159 Adjust all users.
10160 * src/lalr.h (nlookaheads): Remove this orphan declaration.
10161 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
10162 state.
10163
101642001-12-17 Akim Demaille <akim@epita.fr>
10165
10166 * src/files.h, src/files.c (open_files, close_files): Remove.
10167 * src/main.c (main): Don't open/close files, nor invoke lex_free,
10168 let...
10169 * src/reader.c (reader): Do it.
10170
101712001-12-17 Akim Demaille <akim@epita.fr>
10172
10173 * src/conflicts.c (print_reductions): Formatting changes.
10174
101752001-12-17 Akim Demaille <akim@epita.fr>
10176
10177 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
10178 (flush_reduce): New.
10179 (resolve_sr_conflict): Adjust.
10180
101812001-12-17 Akim Demaille <akim@epita.fr>
10182
10183 * src/output.c (output_obstack): Be static and rename as...
10184 (format_obstack): this, to avoid any confusion with files.c's
10185 output_obstack.
10186 * src/reader.h (muscle_obstack): Move to...
10187 * src/output.h: here, since it's defined in output.c.
10188
101892001-12-17 Akim Demaille <akim@epita.fr>
10190
10191 * src/output.c (action_row, save_column, default_goto)
10192 (sort_actions, matching_state, pack_vector): Better variable
10193 locality.
10194
101952001-12-17 Akim Demaille <akim@epita.fr>
10196
10197 * src/output.c: Various formatting changes.
10198
101992001-12-17 Akim Demaille <akim@epita.fr>
10200
10201 * src/files.c (output_files): Free the output_obstack.
10202 * src/main.c (main): Call print and print_graph conditionally.
10203 * src/print.c (print): Work unconditionally.
10204 * src/print_graph.c (print_graph): Work unconditionally.
10205 * src/conflicts.c (log_resolution): Output only if verbose_flag.
10206
102072001-12-16 Marc Autret <autret_m@epita.fr>
10208
10209 * src/output.c (actions_output): Fix. When we use %no-lines,
10210 there is one less line per action.
10211
102122001-12-16 Marc Autret <autret_m@epita.fr>
10213
10214 * src/bison.simple: Remove a useless #line directive.
10215 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
10216 * src/output.c (get_lines_number): New.
10217 (output_parser): Adjust, now takes care about the lines of a
10218 output muscles.
10219 Fix line numbering.
10220 (actions_output): Computes the number of lines taken by actions.
10221 (output_master_parser): Insert new skeleton which is the name of
10222 the output parser file name.
10223
102242001-12-15 Marc Autret <autret_m@epita.fr>
10225
10226 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
10227
102282001-12-15 Marc Autret <autret_m@epita.fr>
10229
10230 * src/output.c (output_gram): Keep track of the hairy one.
10231
102322001-12-15 Akim Demaille <akim@epita.fr>
10233
10234 Make `make distcheck' work.
10235
10236 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
10237 system.h which uses libgettext.h.
10238
102392001-12-15 Akim Demaille <akim@epita.fr>
10240
10241 * src/nullable.c (set_nullable): Useless rules must be skipped,
10242 otherwise, since we range over their symbols, we might look at a
10243 nonterminal which no longer ``exists'', i.e., it is not counted in
10244 `nvars', hence we overflow our arrays.
10245
102462001-12-15 Akim Demaille <akim@epita.fr>
10247
10248 The header can also be produced directly, without any obstack!
10249 Yahoo!
10250
10251 * src/files.c, src/files.h (defines_obstack): Remove.
10252 (compute_header_macro): Global.
10253 (defines_obstack_save): Remove.
10254 * src/reader.c (parse_union_decl): No longer output to
10255 defines_obstack: its content can be found in the `stype' muscle
10256 anyway.
10257 (output_token_translations): Merge into...
10258 (symbols_output): this.
10259 Rename as...
10260 (symbols_save): this.
10261 (reader): Adjust.
10262 * src/output.c (header_output): New.
10263 (output): Call it.
10264
102652001-12-15 Akim Demaille <akim@epita.fr>
10266
10267 * src/reader.c (parse_union_decl): Instead of handling two obstack
10268 simultaneously, use one to define the `stype' muscle, and use the
10269 value of the latter to fill defines_obstack.
10270 (copy_comment): Remove.
10271 (copy_comment2): Work for a single obstack.
10272 Rename as...
10273 (copy_comment): this.
10274
102752001-12-15 Akim Demaille <akim@epita.fr>
10276
10277 * src/lex.c, src/lex.h (xgetc): No longer static.
10278 * src/reader.c (parse_union_decl): Revamp.
10279
102802001-12-15 Akim Demaille <akim@epita.fr>
10281
10282 Still making progress in separating Bison into (i) input, (ii)
10283 process, (iii) output: now we can directly output the parser file
10284 without using table_obstack at all.
10285
10286 * src/files.c, src/files.h (table_obstack): Bye bye.
10287 (parser_file_name): New.
10288 * src/files.c (compute_output_file_names): Compute it.
10289 * src/output.c (actions_output, output_parser)
10290 (output_master_parser): To a file instead of an obstack.
10291
102922001-12-15 Akim Demaille <akim@epita.fr>
10293
10294 Attach actions to rules, instead of pre-outputting them to
10295 actions_obstack.
10296
10297 * src/gram.h (rule_t): action and action_line are new members.
10298 * src/reader.c (symbol_list): Likewise.
10299 (copy_action): Save the actions within the rule.
10300 (packgram): Save them in rule_table.
10301 * src/output.c (actions_output): New.
10302 (output_parser): Use it on `%%actions'.
10303 (output_rule_data): Don't free rule_table.
10304 (output): Do it.
10305 (prepare): Don't save the `action' muscle.
10306 * src/bison.simple: s/%%action/%%actions/.
10307
103082001-12-15 Akim Demaille <akim@epita.fr>
10309
10310 * src/reader.c (copy_action): When --yacc, don't append a `;'
10311 to the user action: let it fail if lacking.
10312 Suggested by Arnold Robbins and Tom Tromey.
10313
103142001-12-14 Akim Demaille <akim@epita.fr>
10315
10316 * src/lex.c (literalchar): Simply return the char you decoded, non
10317 longer mess around with obstacks and int pointers.
10318 Adjust all callers.
10319
103202001-12-14 Akim Demaille <akim@epita.fr>
10321
10322 * src/lex.c (literalchar): Don't escape the special characters,
10323 just decode them, and keep them as char (before, eol was output as
10324 the 2 char string `\n' etc.).
10325 * src/output.c (output_rule_data): Use quotearg to output the
10326 token strings.
10327
103282001-12-13 Paul Eggert <eggert@twinsun.com>
10329
10330 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
10331 Do not infringe on the global user namespace when using C++.
10332 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
10333 All uses of `fprintf' and `stderr' changed.
10334
10335 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
10336
103372001-12-13 Akim Demaille <akim@epita.fr>
10338
10339 The computation of nullable is broken: it doesn't handle empty
10340 RHS's properly.
10341
10342 * tests/torture.at (GNU AWK Grammar): New.
10343 * tests/sets.at (Nullable): New.
10344 * src/nullable.c (set_nullable): Instead of blindly looping over
10345 `ritems', loop over the rules, and then over their rhs's.
10346
10347 Work around Autotest bugs.
10348
10349 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
10350 frame, because Autotest understand lines starting with a `+' as
10351 traces from the shell. Then, they are not processed properly.
10352 Admittedly an Autotest bug, but we don't have time to wait for
10353 Autotest to catch up.
10354 * tests/regression.at (Broken Closure): Adjust to the new table
10355 frames.
10356 Move to...
10357 * tests/sets.at: here.
10358
103592001-12-13 Akim Demaille <akim@epita.fr>
10360
10361 * src/closure.c (closure): Use nrules instead of playing tricks
10362 with BITS_PER_WORD.
10363
103642001-12-13 Akim Demaille <akim@epita.fr>
10365
10366 * src/print.c (print_actions): Output the handling of `$' as the
10367 traces do: shifting the token EOF. Before EOF was treated as a
10368 nonterminal.
10369 * tests/regression.at: Adjust some tests.
10370 * src/print_graph.c (print_core): Complete the set of items via
10371 closure. The next-to-final and final states are still unsatisfying,
10372 but that's to be addressed elsewhere.
10373 No longer output the rule numbers, but do output the state number.
10374 A single loop for the shifts + gotos is enough, but picked a
10375 distinct color for each.
10376 (print_graph): Initialize and finalize closure.
10377
103782001-12-13 Akim Demaille <akim@epita.fr>
10379
10380 * src/reader.c (readgram): Remove dead code, an strip useless
10381 braces.
10382 (get_type): Remove, unused.
10383
103842001-12-12 Akim Demaille <akim@epita.fr>
10385
10386 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
10387 on that of lib/error.c.
10388
103892001-12-12 Akim Demaille <akim@epita.fr>
10390
10391 Some hosts don't like `/' in includes.
10392
10393 * src/system.h: Include libgettext.h without qualifying the path.
10394 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
10395 $(top_srcdir).
10396
103972001-12-11 Marc Autret <autret_m@epita.fr>
10398
10399 * src/output.c (output_parser): Remove useless muscle.
10400
104012001-12-11 Marc Autret <autret_m@epita.fr>
10402
10403 * src/bison.simple: Remove #line just before %%epilogue. It
10404 is now handled in ...
10405 * src/reader.c (read_additionnal_code): Add the output of a
10406 #line for the epilogue.
10407
104082001-12-10 Marc Autret <autret_m@epita.fr>
10409
10410 * src/reader.c (copy_definition): Re-use CPP-outed code which
10411 replace precedent remove.
10412 * src/bison.simple: Remove #line before %%prologue because
10413 %%input-line is wrong at this time.
10414
104152001-12-10 Marc Autret <autret_m@epita.fr>
10416
10417 * src/reader.c (symbols_output): Clean up.
10418 * src/output.c (output_gram, output): Clean up.
10419
104202001-12-10 Akim Demaille <akim@epita.fr>
10421
10422 * src/lalr.c (initialize_lookaheads): New. Extracted from...
10423 * src/LR0.c (set_state_table): here.
10424 * src/lalr.c (lalr): Call it.
10425
104262001-12-10 Akim Demaille <akim@epita.fr>
10427
10428 * src/state.h (shifts): Remove the `number' member: shifts are
10429 attached to state, hence no longer need to be labelled with a
10430 state number.
10431
104322001-12-10 Akim Demaille <akim@epita.fr>
10433
10434 Now that states have a complete set of members, the linked list of
10435 shifts is useless: just fill directly the state's shifts member.
10436
10437 * src/state.h (shifts): Remove the `next' member.
10438 * src/LR0.c (first_state, last_state): Remove.
10439 Adjust the callers.
10440 (augment_automaton): Don't look for the shifts that must be added
10441 a shift on EOF: it is those of the state we looked for! But now,
10442 since shifts are attached, it is no longer needed to looking
10443 merely by its id: its number.
10444
104452001-12-10 Akim Demaille <akim@epita.fr>
10446
10447 * src/LR0.c (augment_automaton): Better variable locality.
10448 Remove an impossible branch: if there is a state corresponding to
10449 the start symbol being shifted, then there is shift for the start
10450 symbol from the initial state.
10451
104522001-12-10 Akim Demaille <akim@epita.fr>
10453
10454 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
10455 only when appropriate: when insert_start_shifting_state' is not
10456 invoked.
10457 * tests/regression.at (Rule Line Numbers): Adjust.
10458
104592001-12-10 Akim Demaille <akim@epita.fr>
10460
10461 * src/LR0.c (augment_automaton): Now that all states have shifts,
10462 merge the two cases addition shifts to the initial state.
10463
104642001-12-10 Akim Demaille <akim@epita.fr>
10465
10466 * src/lalr.c (set_state_table): Move to...
10467 * src/LR0.c: here.
10468 * src/lalr.c (lalr): Don't call it...
10469 * src/LR0.c (generate_states): do it.
10470 * src/LR0.h (first_state): Remove, only the table is used.
10471
104722001-12-10 Akim Demaille <akim@epita.fr>
10473
10474 * src/LR0.h (first_shift, first_reduction): Remove.
10475 * src/lalr.c: Don't use first_shift: find shifts through the
10476 states.
10477
104782001-12-10 Akim Demaille <akim@epita.fr>
10479
10480 * src/LR0.c: Attach shifts to states as soon as they are
10481 computed.
10482 * src/lalr.c (set_state_table): Instead of assigning shifts to
10483 state, just assert that the mapping was properly done.
10484
104852001-12-10 Akim Demaille <akim@epita.fr>
10486
10487 * src/LR0.c (insert_start_shift): Rename as...
10488 (insert_start_shifting_state): this.
10489 (insert_eof_shifting_state, insert_accepting_state): New.
10490 (augment_automaton): Adjust.
10491 Better locality of the variables.
10492 When looking if the start_symbol is shifted from the initial
10493 state, using `while (... symbol != start_symbol ...)' sounds
10494 better than `while (... symbol < start_symbol ...)': If fail
10495 to see how the order between symbols could be relevant!
10496
104972001-12-10 Akim Demaille <akim@epita.fr>
10498
10499 * src/getargs.h: Don't declare `spec_name_prefix' and
10500 `spec_file_prefix', declared by src/files.h.
10501 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
10502 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
10503 * src/output.c (prepare): Adjust.
10504 * src/reader.c (symbols_output): Likewise.
10505 * src/vmsgetargs.c: Vaguely adjust, but who cares?
10506
105072001-12-10 Akim Demaille <akim@epita.fr>
10508
10509 * src/muscle_tab.c (muscle_init): NULL is a better default than
10510 `"0"'.
10511
105122001-12-10 Akim Demaille <akim@epita.fr>
10513
10514 * src/reader.c (reader): Calling symbols_output once is enough.
10515
105162001-12-10 Akim Demaille <akim@epita.fr>
10517
10518 Now that states have a complete set of members, the linked list of
10519 reductions is useless: just fill directly the state's reductions
10520 member.
10521
10522 * src/state.h (struct reductions): Remove member `number' and
10523 `next'.
10524 * src/LR0.c (first_reduction, last_reduction): Remove.
10525 (save_reductions): Don't link the new reductions, store them in
10526 this_state.
10527 * src/lalr.c (set_state_table): No need to attach reductions to
10528 states, it's already done.
10529 * src/output.c (output_actions): No longer free the shifts, then
10530 the reductions, then the states: free all the states and their
10531 members.
10532
105332001-12-10 Akim Demaille <akim@epita.fr>
10534
10535 * src/options.c (OPTN, DRTV, BOTH): New.
10536 (option_table): Use them.
10537
10538 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
10539 the job of system.h.
10540 * src/options.c: Don't include stdio.h and xalloc.h for the same
10541 reasons.
10542
105432001-12-10 Akim Demaille <akim@epita.fr>
10544
10545 * src/output.c (output, prepare): Make sure the values of the
10546 muscles `action' and `prologue' are 0-terminated.
10547
105482001-12-10 Akim Demaille <akim@epita.fr>
10549
10550 Clean up GCC warnings.
10551
10552 * src/reader.c (copy_action): `buf' is not used.
10553 (parse_skel_decl): Be static.
10554 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
10555 * src/options.h (create_long_option_table): Have a real prototype.
10556 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
10557 (hash_delete_at): Return const void *.
10558 Adjust casts to preserve the const.
10559
105602001-12-10 Akim Demaille <akim@epita.fr>
10561
10562 * configure.in: Require 2.52g.
10563 M4 is not needed, but AUTOM4TE is.
10564 * m4/m4.m4: Remove.
10565 * tests/Makefile.am: Adjust.
10566
105672001-12-10 Akim Demaille <akim@epita.fr>
10568
10569 One structure for states is enough, even though theoretically
10570 there are LR(0) states and LALR(1) states.
10571
10572 * src/lalr.h (state_t): Remove.
10573 (state_table): Be state_t **, not state_t *.
10574 * src/state.h (core, CORE_ALLOC): Rename as...
10575 (state_t, STATE_ALLOC): this.
10576 Add the LALR(1) members: shifts, reductions, errs.
10577 * src/LR0.c (state_table): Rename as...
10578 (state_hash): this, to avoid name clashes with the global
10579 `state_table'.
10580 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
10581 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
10582
105832001-12-10 Akim Demaille <akim@epita.fr>
10584
10585 Bison dumps core on bash.y.
10586 Reported by Pascal Bart.
10587
10588 * src/warshall.c (bitmatrix_print): New.
10589 (TC): Use it.
10590 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
10591 j must be the outer loop.
10592 * tests/regression.at (Broken Closure): New.
10593
105942001-12-05 Akim Demaille <akim@epita.fr>
10595
10596 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
10597 its argument.
10598 Reported by Peter Hamorsky.
10599
106002001-12-05 Akim Demaille <akim@epita.fr>
10601
10602 * src/conflicts.c (err_table): Remove.
10603 (resolve_sr_conflict): Adjust.
10604 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
10605 Rename as...
10606 (state_t.reductions, state_t.shifts): this.
10607
106082001-12-05 Akim Demaille <akim@epita.fr>
10609
10610 * src/reduce.c (reduce_grammar_tables): No longer disable the
10611 removal of useless rules via CPP but via `if (0)', so that the
10612 compiler still check the code is valid.
10613 For instance, it should have noticed `rline' no longer exists: use
10614 the `line' member of rule_t.
10615 * src/gram.c (dummy, rline): Remove, unused.
10616
106172001-12-05 Akim Demaille <akim@epita.fr>
10618
10619 * src/output.c (pack_vector): Use assert, not berror.
10620 * src/main.c (berror): Remove, unused.
10621
106222001-12-05 Akim Demaille <akim@epita.fr>
10623
10624 New experimental feature: if --verbose --trace output all the
10625 items of a state, not only its kernel.
10626
10627 * src/print.c (print_core): If `trace_flag', then invoke closure
10628 before outputting the items of the state (print_core is no longer
10629 a correct name them).
10630 (print_results): Invoke new_closure/free_closure if needed.
10631
106322001-12-05 Akim Demaille <akim@epita.fr>
10633
10634 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
10635 * src/closure.c, src/closure.h (itemsetsize): Rename as...
10636 (nitemset): for consistency with the rest of the project.
10637
106382001-12-05 Akim Demaille <akim@epita.fr>
10639
10640 * src/closure.c (print_closure): Improve.
10641 (closure): Use it for printing input and output.
10642
106432001-12-05 Akim Demaille <akim@epita.fr>
10644
10645 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
10646 indexed by nonterminals.
10647
106482001-12-05 Akim Demaille <akim@epita.fr>
10649
10650 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
10651 what it was!).
10652 * src/warshall.h: Remove accidental duplication of the content.
10653
106542001-12-05 Akim Demaille <akim@epita.fr>
10655
10656 * src/closure.c (set_fderives): De-obfuscate.
10657
106582001-12-05 Akim Demaille <akim@epita.fr>
10659
10660 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
10661
106622001-12-05 Akim Demaille <akim@epita.fr>
10663
10664 * src/closure.c (set_firsts): De-obfuscate.
10665
106662001-12-05 Akim Demaille <akim@epita.fr>
10667
10668 * src/output.c (action_row): De-obfuscate
10669 using the good o' techniques: arrays not pointers, variable
10670 locality, BITISSET, RESETBIT etc.
10671
106722001-12-05 Akim Demaille <akim@epita.fr>
10673
10674 Pessimize the code to simplify it: from now on, all the states
10675 have a valid SHIFTS, which NSHIFTS is possibly 0.
10676
10677 * src/LR0.c (shifts_new): Be global and move to..
10678 * src/state.c, src/state.h: here.
10679 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
10680 * src/print_graph: Adjust.
10681
106822001-12-05 Akim Demaille <akim@epita.fr>
10683
10684 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
10685 * src/conflicts.c: Use it.
10686 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
10687 incorrectly ``simplified''.
10688
106892001-12-05 Akim Demaille <akim@epita.fr>
10690
10691 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
10692 using the good o' techniques: arrays not pointers, variable
10693 locality, BITISSET, RESETBIT etc.
10694
106952001-12-05 Akim Demaille <akim@epita.fr>
10696
10697 * src/state.h (SHIFT_SYMBOL): New.
10698 * src/conflicts.c: Use it to deobfuscate.
10699
107002001-12-05 Akim Demaille <akim@epita.fr>
10701
10702 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
10703 (print_reductions): De-obfuscate using the good o' techniques:
10704 arrays not pointers, variable locality, BITISSET.
10705
107062001-12-05 Akim Demaille <akim@epita.fr>
10707
10708 * src/conflicts.c (print_reductions): Arrays, not pointers.
10709 Use BITISSET.
10710
107112001-12-05 Akim Demaille <akim@epita.fr>
10712
10713 * src/conflicts.c (print_reductions): Pessimize, but clarify.
10714
107152001-12-05 Akim Demaille <akim@epita.fr>
10716
10717 * src/conflicts.c (print_reductions): Improve variable locality.
10718
107192001-12-05 Akim Demaille <akim@epita.fr>
10720
10721 * src/conflicts.c (print_reductions): Pessimize, but clarify.
10722
107232001-12-05 Akim Demaille <akim@epita.fr>
10724
10725 * src/conflicts.c (print_reductions): Improve variable locality.
10726
107272001-12-05 Akim Demaille <akim@epita.fr>
10728
10729 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
10730 * src/lalr.c: Use them.
10731
107322001-12-05 Akim Demaille <akim@epita.fr>
10733
10734 * src/LR0.c (augment_automaton): Formatting changes.
10735 Better variable locality.
10736
107372001-12-05 Akim Demaille <akim@epita.fr>
10738
10739 * src/lalr.c (matrix_print): New.
10740 (transpose): Use it.
10741 Use arrays instead of pointers.
10742
107432001-12-05 Akim Demaille <akim@epita.fr>
10744
10745 * src/lalr.c (maxrhs): Move to...
10746 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
10747 * src/lalr.c (build_relations): Adjust.
10748
107492001-12-05 Akim Demaille <akim@epita.fr>
10750
10751 * src/lalr.c (transpose): Free the memory allocated to the
10752 argument, as it is replaced by the results by the unique caller.
10753 (build_relations): Merely invoke transpose: it handles the memory
10754 deallocation.
10755 Improve variable locality.
10756 Avoid variables used as mere abbreviations.
10757 (compute_lookaheads): Use arrays instead of pointers.
10758
107592001-12-05 Akim Demaille <akim@epita.fr>
10760
10761 * src/lalr.c (initialize_F): Improve variable locality.
10762 Avoid variables used as mere abbreviations.
10763
107642001-12-05 Akim Demaille <akim@epita.fr>
10765
10766 * src/derives.c (print_derives): Display the ruleno.
10767 * src/lalr.c (initialize_F, transpose): Better variable locality
10768 to improve readability.
10769 Avoid variables used as mere abbreviations.
10770
107712001-12-05 Akim Demaille <akim@epita.fr>
10772
10773 * src/lalr.c (traverse): Use arrays instead of pointers.
10774
107752001-12-05 Akim Demaille <akim@epita.fr>
10776
10777 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
10778 the handling of squeue.
10779 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
10780
107812001-12-05 Akim Demaille <akim@epita.fr>
10782
10783 Because useless nonterminals are now kept alive (instead of being
10784 `destroyed'), we now sometimes examine them, and store information
10785 related to them. Hence we need to know their number, and adjust
10786 memory allocations.
10787
10788 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
10789 static.
10790 * src/LR0.c (allocate_itemsets): The memory allocated to
10791 `symbol_count' was used for two different purpose: once to count
10792 the number of occurrences of each symbol, and later reassigned to
10793 `shift_symbol', containing the symbol that can be shifted from a
10794 given state.
10795 Deobfuscate, i.e., allocate, use and free `symbol_count' here
10796 only, and...
10797 (new_itemsets): Allocate `shift_symbol' here.
10798 (allocate_itemsets): symbol_count includes useless nonterminals.
10799 Make room for them.
10800 (free_storage): Use `free', not `XFREE', for pointers that cannot
10801 be null.
10802
108032001-12-05 Akim Demaille <akim@epita.fr>
10804
10805 * src/nullable.c (set_nullable): Deobfuscate the handling of
10806 ritem.
10807 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
10808
108092001-12-05 Akim Demaille <akim@epita.fr>
10810
10811 * src/gram.c, src/gram.h (ritem_print): New.
10812 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
10813 (This useless function was defined only to work around VMS linkers
10814 that can't handle compilation units with variables only).
10815 * src/reduce.c (dump_grammar): Use it to trace the construction of
10816 ritem.
10817
108182001-12-04 Paul Eggert <eggert@twinsun.com>
10819
10820 * src/bison.simple (union yyalloc): Change member names
10821 to be the same as the stack names.
10822 (yyparse): yyptr is now union yyalloc *, not char *.
10823 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
10824 and may generate better code on some machines.
10825 (yystpcpy): Use prototype if __STDC__ is defined, not just
10826 if __cplusplus is defined.
10827
108282001-11-30 Akim Demaille <akim@epita.fr>
10829
10830 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
10831 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
10832 Gettext doesn't compile cleanly, and dies with -Werror.
10833 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
10834 Include WARNING_CFLAGS here.
10835 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
10836 before being defined.
10837
108382001-11-27 Paul Eggert <eggert@twinsun.com>
10839
10840 * lib/quotearg.h (quotearg_n, quotearg_n_style):
10841 First arg is int, not unsigned.
10842 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
10843 (SIZE_MAX, UINT_MAX): New macros.
10844 (quotearg_n_options): Abort if N is negative.
10845 Avoid overflow check on hosts where size_t is 64 bits and int
10846 is 32 bits, as overflow is impossible there.
10847 Fix off-by-one typo that caused unnecessary reallocation.
10848
108492001-11-29 Paul Eggert <eggert@twinsun.com>
10850
10851 Name space cleanup in generated parser.
10852
10853 * doc/bison.texinfo (Bison Parser): Discuss system headers
10854 and their effect on the user name space.
10855
10856 * src/bison.simple:
10857 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
10858 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
10859 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
10860
10861 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
10862 on user names when possible.
10863
10864 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
10865 Simplify test for whather <alloca.h> exists.
10866
10867 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
10868
10869 (<stdio.h>): Include if YYDEBUG.
10870
10871 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
10872 ! defined (yyoverflow) && ! defined (yymemcpy).
10873
10874 (yymemcpy, yyparse): Rename local variables as needed so that
10875 they all begin with 'yy'.
10876
10877 (yystrlen, yystpcpy): New functions.
10878
10879 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
10880 All uses changed.
10881
10882 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
10883 instead of relying on string.h functions. Use YYSTACK_ALLOC
10884 and YYSTACK_FREE instead of malloc and free.
10885
108862001-11-30 Akim Demaille <akim@epita.fr>
10887
10888 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
10889 before their first uses.
10890 (YYBISON, YYPURE): Move to the top of the output.
10891
108922001-11-30 Akim Demaille <akim@epita.fr>
10893
10894 * tests/reduce.at (Useless Nonterminals): Fix.
10895
108962001-11-30 Akim Demaille <akim@epita.fr>
10897
10898 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
10899 if body instead of `;' to pacify GCC's warnings.
10900
109012001-11-30 Akim Demaille <akim@epita.fr>
10902
10903 Instead of mapping the LHS of unused rules to -1, keep the LHS
10904 valid, but flag the rules as invalid.
10905
10906 * src/gram.h (rule_t): `useful' is a new member.
10907 * src/print.c (print_grammar): Adjust.
10908 * src/derives.c (set_derives): Likewise.
10909 * src/reader.c (packgram, reduce_output): Likewise.
10910 * src/reduce.c (reduce_grammar_tables): Likewise.
10911 * tests/reduce.at (Underivable Rules, Useless Rules): New.
10912
109132001-11-30 Akim Demaille <akim@epita.fr>
10914
10915 * src/reduce.c (reduce_output): Formatting changes.
10916 * src/print.c (print_results, print_grammar): Likewise.
10917 * tests/regression.at (Rule Line Numbers)
10918 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
10919
109202001-11-30 Akim Demaille <akim@epita.fr>
10921
10922 * src/reduce.c (nonterminals_reduce): Instead of throwing away
10923 useless nonterminals, move them at the end of the symbol arrays.
10924 (reduce_output): Adjust.
10925 * tests/reduce.at (Useless Nonterminals): Adjust.
10926
109272001-11-30 Akim Demaille <akim@epita.fr>
10928
10929 * src/reduce.c: Various comment/formatting changes.
10930 (nonterminals_reduce): New, extracted from...
10931 (reduce_grammar_tables): here.
10932 (reduce_grammar): Call nonterminals_reduce.
10933
109342001-11-29 Paul Eggert <eggert@twinsun.com>
10935
10936 * src/bison.simple (YYSTACK_REALLOC): Remove.
10937 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
10938 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
10939 New macros.
10940 (union yyalloc): New type.
10941 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
10942 an arbitrary restriction on hosts where size_t is wider than int.
10943
10944 (yyparse): Don't dump core if alloca or malloc fails; instead, report
10945 a parser stack overflow. Allocate just one block of memory for all
10946 three stacks, instead of allocating three blocks; this typically is
10947 faster and reduces fragmentation.
10948
10949 Do not limit the number of items in the stack to a value that fits
10950 in 'int', as this is an arbitrary limit on hosts with 64-bit
10951 size_t and 32-bit int.
10952
109532001-11-29 Marc Autret <autret_m@epita.fr>
10954
10955 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
10956 of defining YYERROR_VERBOSE.
10957 [AT_DATA]: $4 is now out of C declarations in the prologue.
10958
109592001-11-28 Marc Autret <autret_m@epita.fr>
10960
10961 * src/reader.c (parse_dquoted_param): New.
10962 (parse_skel_decl): Use it.
10963 * src/lex.h: Add its prototype.
10964 * src/lex.c (literalchar): Become not static.
10965
109662001-11-28 Marc Autret <autret_m@epita.fr>
10967
10968 * src/output.h: And put its extern declaration here.
10969 * src/output.c (error_verbose): Define here.
10970 (prepare): Echo name modification.
10971 * src/getargs.h: Clean its extern declaration.
10972 * src/getargs.c (error_verbose_flag): Remove.
10973 (getargs): Remove case 'e'.
10974 * src/options.c (option_table): 'error-verbose' is now seen as simple
10975 percent option.
10976 Include output.h.
10977
10978 * src/reader.c (read_declarations): Remove case tok_include.
10979 (parse_include_decl): Remove.
10980 * src/lex.h (token_t): Remove tok_include.
10981 * src/options.c (option_table): 'include' is now a simple command line
10982 option.
10983
109842001-11-28 Marc Autret <autret_m@epita.fr>
10985
10986 * src/bison.simple: Adjust muscle names.
10987 * src/muscle_tab.c (muscle_init): Also rename the muscles.
10988 * src/output.c (prepare): s/_/-/ for the muscles names.
10989 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
10990
109912001-11-28 Marc Autret <autret_m@epita.fr>
10992
10993 * src/bison.simple: Fix debug.
10994 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
10995
109962001-11-28 Akim Demaille <akim@epita.fr>
10997
10998 * src/LR0.c (shifts_new): New.
10999 (save_shifts, insert_start_shift, augment_automaton): Use it.
11000
110012001-11-28 Akim Demaille <akim@epita.fr>
11002
11003 * src/closure.c (closure): `b' and `ruleno' denote the same value:
11004 keep ruleno only.
11005
110062001-11-28 Akim Demaille <akim@epita.fr>
11007
11008 * src/closure.c (closure): Instead of looping over word in array
11009 then bits in words, loop over bits in array.
11010
110112001-11-28 Akim Demaille <akim@epita.fr>
11012
11013 * src/closure.c (closure): No longer optimize the special case
11014 where all the bits of `ruleset[r]' are set to 0, to make the code
11015 clearer.
11016
110172001-11-28 Akim Demaille <akim@epita.fr>
11018
11019 * src/closure.c (closure): `r' and `c' are new variables, used to
11020 de-obfuscate accesses to RULESET and CORE.
11021
110222001-11-28 Akim Demaille <akim@epita.fr>
11023
11024 * src/reduce.c (reduce_print): Use ngettext.
11025 (dump_grammar): Improve the trace accuracy.
11026
110272001-11-28 Akim Demaille <akim@epita.fr>
11028
11029 * src/reduce.c (dump_grammar): Don't translate trace messages.
11030
110312001-11-28 Akim Demaille <akim@epita.fr>
11032
11033 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
11034 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
11035 as all tags are free'ed afterwards.
11036 From Enrico Scholz.
11037
110382001-11-27 Paul Eggert <eggert@twinsun.com>
11039
11040 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
11041 use alloca when we didn't want to, and vice versa.
11042
110432001-11-27 Marc Autret <autret_m@epita.fr>
11044
11045 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
11046 initialization.
11047 * src/output.c (prepare): Remove its update.
11048
110492001-11-27 Marc Autret <autret_m@epita.fr>
11050
11051 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
11052 Use %error-verbose.
11053
110542001-11-27 Marc Autret <autret_m@epita.fr>
11055
11056 * src/bison.simple: Remove YYERROR_VERBOSE using.
11057 Use %%error_verbose.
11058 (yyparse): Likewise.
11059 * src/output.c (prepare): Give its final value.
11060 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
11061 * src/getargs.h: Add its extern declaration.
11062 * src/getargs.c (error_verbose_flag): New int.
11063 (getargs): Update to catch new case.
11064 * src/options.c (option_table): 'error-verbose' is a new option.
11065 (shortopts): Update.
11066
110672001-11-27 Akim Demaille <akim@epita.fr>
11068
11069 * src/system.h: Use intl/libgettext.h.
11070 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
11071
110722001-11-27 Akim Demaille <akim@epita.fr>
11073
11074 * tests/torture.at (Exploding the Stack Size with Malloc):
11075 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
11076
110772001-11-27 Akim Demaille <akim@epita.fr>
11078
11079 * src/files.c: Include error.h.
11080 Reported by Hans Aberg.
11081
110822001-11-26 Marc Autret <autret_m@epita.fr>
11083
11084 * src/reader.c (parse_include_decl): New, not yet implemented.
11085 (read_declarations): Add case tok_include.
11086 * src/getargs.h (include): Add its extern definition.
11087 * src/getargs.c (include): New const char *.
11088 (getargs): Add case '-I'.
11089 * src/options.c (option_table): Add include as command line and
11090 percent option.
11091 * src/lex.h (token_t): Add tok_include.
11092
110932001-11-26 Akim Demaille <akim@epita.fr>
11094
11095 * src/reader.c (readgram): Make sure rules for mid-rule actions
11096 have a lineno equal to that of their host rule.
11097 Reported by Hans Aberg.
11098 * tests/regression.at (Rule Line Numbers): New.
11099
111002001-11-26 Akim Demaille <akim@epita.fr>
11101
11102 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
11103 size_ts.
11104
111052001-11-26 Akim Demaille <akim@epita.fr>
11106
11107 * src/complain.c, src/complain.h (error): Remove, provided by
11108 lib/error.[ch].
11109
111102001-11-26 Akim Demaille <akim@epita.fr>
11111
11112 * src/reader.c (read_declarations): Don't abort on tok_illegal,
11113 issue an error message.
11114 * tests/regression.at (Invalid %directive): New.
11115 Reported by Hans Aberg.
11116
111172001-11-26 Akim Demaille <akim@epita.fr>
11118
11119 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
11120 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
11121
111222001-11-26 Akim Demaille <akim@epita.fr>
11123
11124 * src/conflicts.c (conflicts_print): Don't complain at all when
11125 there are no reduce/reduce conflicts, and as many shift/reduce
11126 conflicts as expected.
11127 * tests/regression.at (%expect right): Adjust.
11128
111292001-11-23 Akim Demaille <akim@epita.fr>
11130
11131 * lib/alloca.c: Update, from fileutils.
11132
111332001-11-23 Akim Demaille <akim@epita.fr>
11134
11135 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
11136
111372001-11-23 Akim Demaille <akim@epita.fr>
11138
11139 * src/system.h: Include alloca.h.
11140 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
11141
111422001-11-23 Akim Demaille <akim@epita.fr>
11143
11144 * src/print_graph.c (print_actions): Remove `rule', unused.
11145 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
11146 pacify GCC's signed < unsigned warnings.
11147 * src/closure.c (itemsetsize): Likewise.
11148 * src/reader.c (symbol_list_new): Static.
11149
111502001-11-23 Akim Demaille <akim@epita.fr>
11151
11152 Attaching lineno to buckets is stupid, since only one copy of each
11153 symbol is kept, only the line of the first occurrence is kept too.
11154
11155 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
11156 * src/reader.c (rline_allocated): Remove, unused.
11157 (symbol_list): Have a `line' member.
11158 (symbol_list_new): New.
11159 (readgram): Use it.
11160 * src/print.c (print_grammar): Output the rule line numbers.
11161 * tests/regression.at (Solved SR Conflicts)
11162 (Unresolved SR Conflicts): Adjust.
11163 Reported by Hans Aberg.
11164
111652001-11-22 Marc Autret <autret_m@epita.fr>
11166
11167 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
11168
111692001-11-22 Marc Autret <autret_m@epita.fr>
11170
11171 * src/muscle_tab.c (muscle_init): Remove initialization of
11172 skeleton muscle.
11173 * src/output.c (output_master_parser): Do it here.
11174
111752001-11-20 Akim Demaille <akim@epita.fr>
11176
11177 * po/sv.po: New.
11178 * configure.in (ALL_LINGUAS): Adjust.
11179 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
11180 longer contains strings to translate.
11181
111822001-11-19 Akim Demaille <akim@epita.fr>
11183
11184 * src/conflicts.c (conflicts_print): Add a missing \n.
11185
111862001-11-19 Akim Demaille <akim@epita.fr>
11187
11188 * src/nullable.c (nullable_print): New.
11189 (set_nullable): Call it when tracing.
11190 Better locality of variables.
11191
111922001-11-19 Akim Demaille <akim@epita.fr>
11193
11194 * src/print.c (print_actions): Better locality of variables.
11195
111962001-11-19 Akim Demaille <akim@epita.fr>
11197
11198 * src/derives.c (print_derives): Fix and enrich.
11199 * src/closure.c (print_fderives): Likewise.
11200
112012001-11-19 Akim Demaille <akim@epita.fr>
11202
11203 * src/closure.c (itemsetend): Remove, replaced with...
11204 (itemsetsize): new.
11205
112062001-11-19 Akim Demaille <akim@epita.fr>
11207
11208 * src/LR0.c (kernel_end): Remove, replaced with...
11209 (kernel_size): new.
11210
112112001-11-19 Akim Demaille <akim@epita.fr>
11212
11213 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
11214 to clarify.
11215
112162001-11-19 Akim Demaille <akim@epita.fr>
11217
11218 * src/closure.c (closure): Use arrays instead of pointers to clarify.
11219
112202001-11-19 Akim Demaille <akim@epita.fr>
11221
11222 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
11223 trace messages.
11224 * src/LR0.c: Likewise.
11225 (allocate_itemsets): Use arrays instead of pointers to clarify.
11226
112272001-11-19 Akim Demaille <akim@epita.fr>
11228
11229 * src/getargs.c (statistics_flag): Replace with...
11230 (trace_flag): New.
11231 (longopts): Accept --trace instead of --statistics.
11232 * src/getargs.h, src/options.c: Adjust.
11233 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
11234 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
11235
112362001-11-19 Akim Demaille <akim@epita.fr>
11237
11238 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
11239 pointers to clarify the code.
11240 (save_reductions, save_shifts): Factor common parts of alternatives.
11241
112422001-11-19 Akim Demaille <akim@epita.fr>
11243
11244 * src/LR0.c (new_state, get_state): Complete TRACE code.
11245 * src/closure.c: Include `reader.h' to get `tags', needed by the
11246 trace code.
11247 Rename the conditional DEBUG as TRACE.
11248 Output consistently TRACEs to stderr, not stdout.
11249 * src/derives.c: Likewise.
11250 * src/reduce.c: (inaccessable_symbols): Using if is better style
11251 than goto.
11252 Use `#if TRACE' instead of `#if 0' for tracing code.
11253
112542001-11-19 Akim Demaille <akim@epita.fr>
11255
11256 * src/system.h (LIST_FREE, shortcpy): New.
11257 * src/LR0.c: Use them.
11258 * src/output.c (free_itemsets, free_reductions, free_shifts):
11259 Remove, replaced by LIST_FREE.
11260
112612001-11-19 Akim Demaille <akim@epita.fr>
11262
11263 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
11264 (REDUCTIONS_ALLOC): New.
11265 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
11266 allocation.
11267
112682001-11-19 Akim Demaille <akim@epita.fr>
11269
11270 * src/LR0.c (new_state): Complete trace code.
11271 * src/nullable.c (set_nullable): Don't translate traces.
11272
112732001-11-19 Akim Demaille <akim@epita.fr>
11274
11275 * src/print_graph.c (print_core): Better locality of variables.
11276 * src/print.c (print_core): Likewise.
11277
112782001-11-19 Akim Demaille <akim@epita.fr>
11279
11280 * src/vcg.c: You do the output, so you are responsible of the
11281 handling of VCG syntax, in particular: use quotearg.
11282 * src/print_graph.c: Don't.
11283 (print_actions): Don't output the actions as part of the nodes,
11284 since that's the job of the edges.
11285 (print_state): Don't output by hand: fill the node description,
11286 and ask for its output.
11287
112882001-11-19 Akim Demaille <akim@epita.fr>
11289
11290 * src/bison.simple (yyparse): When verbosely reporting an error,
11291 no longer put additional quotes around token names.
11292 * tests/calc.at: Adjust.
11293
112942001-11-19 Akim Demaille <akim@epita.fr>
11295
11296 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
11297 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
11298 * src/output.c: Adjust.
11299
113002001-11-19 Akim Demaille <akim@epita.fr>
11301
11302 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
11303 (rule_t): this.
11304 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
11305
113062001-11-19 Akim Demaille <akim@epita.fr>
11307
11308 * src/gram.h (rule_t): New.
11309 (rule_table): New.
11310 (rrhs, rlhs): Remove, part of state_t.
11311 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
11312 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
11313 * src/reader.c, src/reduce.c: Adjust.
11314
113152001-11-19 Akim Demaille <akim@epita.fr>
11316
11317 * src/reader.c (symbols_output): New, extracted from...
11318 (packsymbols): Here.
11319 (reader): Call it.
11320
113212001-11-19 Akim Demaille <akim@epita.fr>
11322
11323 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
11324 (maxrhs): this new function.
11325
113262001-11-19 Akim Demaille <akim@epita.fr>
11327
11328 * src/lalr.c (F): New macro to access the variable F.
11329 Adjust.
11330
113312001-11-19 Akim Demaille <akim@epita.fr>
11332
11333 * src/lalr.h (LA): New macro to access the variable LA.
11334 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
11335 * src/lalr.c: Adjust.
11336
113372001-11-19 Akim Demaille <akim@epita.fr>
11338
11339 * src/lalr.c (initialize_LA): Only initialize LA. Let...
11340 (set_state_table): handle the `lookaheads' members.
11341
113422001-11-19 Akim Demaille <akim@epita.fr>
11343
11344 * src/lalr.h (lookaheads): Removed array, whose contents is now
11345 a member of...
11346 (state_t): this structure.
11347 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
11348 Adjust.
11349
113502001-11-19 Akim Demaille <akim@epita.fr>
11351
11352 * src/lalr.h (consistent): Removed array, whose contents is now
11353 a member of...
11354 (state_t): this structure.
11355 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
11356 Adjust.
11357
113582001-11-19 Akim Demaille <akim@epita.fr>
11359
11360 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
11361 contents are now members of...
11362 (state_t): this structure.
11363 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
11364 Adjust.
11365
113662001-11-19 Akim Demaille <akim@epita.fr>
11367
11368 * src/lalr.h (state_t): New.
11369 (state_table): Be a state_t * instead of a core **.
11370 (accessing_symbol): Remove, part of state_t.
11371 * src/lalr.c: Adjust.
11372 (set_accessing_symbol): Merge into...
11373 (set_state_table): this.
11374 * src/print_graph.c, src/conflicts.c: Adjust.
11375
113762001-11-14 Akim Demaille <akim@epita.fr>
11377
11378 * tests/calc.at, tests/output.at, tests/regression.at,
11379 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
11380 now the tests are run in private dirs, therefore AC_CLEANUP and
11381 family can be simplified to 0-ary.
11382 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
11383 use abs. path to find config.h.
11384 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
11385 stderr, there can be way too much random noise.
11386 Instead pass -Werror to GCC and rely on the exit status.
11387 Reported by Wolfram Wagner.
11388
113892001-11-14 Akim Demaille <akim@epita.fr>
11390
11391 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
11392 defined only if yyoverflow is defined, to avoid `warning: unused
11393 variable `yyvs1''.
11394 Reported by The Test Suite.
11395
113962001-11-14 Akim Demaille <akim@epita.fr>
11397
11398 * src/print.c: Include reduce.h.
11399 Reported by Hans Aberg.
11400
114012001-11-14 Akim Demaille <akim@epita.fr>
11402
11403 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
11404 Revert a previous patch: these are really const.
11405 * src/conflicts.c (conflict_report): Additional useless pair of
11406 braces to pacify GCC's warnings for `if () if () {} else {}'.
11407 * src/lex.c (parse_percent_token): Replace equal_offset with
11408 arg_offset.
11409 arg is const.
11410 Be sure to strdup `arg' when used, since there is no reason for
11411 token_buffer not to change.
11412
114132001-11-14 Akim Demaille <akim@epita.fr>
11414
11415 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
11416 definition.
11417 * src/main.c (main): Use them.
11418 Suggested by Hans Aberg.
11419
114202001-11-12 Akim Demaille <akim@epita.fr>
11421
11422 * src/system.h (ngettext): Now that we use ngettext, be sure to
11423 provide a default definition when NLS are not used.
11424
114252001-11-12 Akim Demaille <akim@epita.fr>
11426
11427 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
11428 Use @kbd to denote user input.
11429 (Language and Grammar): ANSIfy the example.
11430 Adjust its layout for info/notinfo.
11431 (Location Tracking Calc): Output error messages to stderr.
11432 Output locations in a more GNUtically correct way.
11433 Fix a couple of Englishos.
11434 Adjust @group/@end group pairs.
11435
114362001-11-12 Akim Demaille <akim@epita.fr>
11437
11438 %expect was not functioning at all.
11439
11440 * src/conflicts.c (expected_conflicts): Set to -1.
11441 (conflict_report): Use ngettext.
11442 (conflicts_print): Check %expect and make its violation an error.
11443 * doc/bison.texinfo (Expect Decl): Adjust.
11444 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
11445 * tests/regression.at (%expect not enough, %expect right)
11446 (%expect too much): New.
11447
114482001-11-12 Akim Demaille <akim@epita.fr>
11449
11450 * tests/regression.at (Conflicts): Rename as...
11451 (Unresolved SR Conflicts): this.
11452 (Solved SR Conflicts): New.
11453
114542001-11-12 Akim Demaille <akim@epita.fr>
11455
11456 * src/reduce.c (print_results): Rename as...
11457 (reduce_output): This.
11458 Output to OUT, passed as argument, instead of output_obstack.
11459 (dump_grammar): Likewise.
11460 (reduce_free): New.
11461 Also free V1.
11462 (reduce_grammar): No longer call reduce_output, since...
11463 * src/print.c (print_results): do it.
11464 * src/main.c (main): Call reduce_free;
11465
114662001-11-12 Akim Demaille <akim@epita.fr>
11467
11468 * src/conflicts.c (print_reductions): Accept OUT as argument.
11469 Output to it, not to output_obstack.
11470 * src/print.c (print_actions): Adjust.
11471
114722001-11-12 Akim Demaille <akim@epita.fr>
11473
11474 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
11475 the result instead of using...
11476 (src_total, rrc_total, src_count, rrc_count): Remove.
11477 (any_conflicts): Remove.
11478 (print_conflicts): Split into...
11479 (conflicts_print, conflicts_output): New.
11480 * src/conflicts.h: Adjust.
11481 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
11482 * src/print.c (print_grammar): Issue `\n' between two rules.
11483 * tests/regression.at (Conflicts): New.
11484 Reported by Tom Lane.
11485
114862001-11-12 Akim Demaille <akim@epita.fr>
11487
11488 * tests/regression.at (Invalid input): Remove, duplicate with
11489 ``Invalid input: 1''.
11490
114912001-11-12 Akim Demaille <akim@epita.fr>
11492
11493 * tests/torture.at (AT_DATA_STACK_TORTURE)
11494 (Exploding the Stack Size with Alloca)
11495 (Exploding the Stack Size with Malloc): New.
11496
114972001-11-12 Akim Demaille <akim@epita.fr>
11498
11499 * src/bison.simple (YYSTACK_REALLOC): New.
11500 (yyparse) [!yyoverflow]: Use it and free the old stack.
11501 Reported by Per Allansson.
11502
115032001-11-12 Pascal Bart <pascal.bart@epita.fr>
11504
11505 * src/bison.simple: Define type yystype instead of YYSTYPE, and
11506 define CPP macro, which substitute YYSTYPE by yystype.
11507 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
11508 with yyltype/YYLTYPE. This allows inclusion of the generated
11509 header within the parser if the compiler, such as GGC, accepts
11510 multiple equivalent #defines.
11511 From Akim.
11512
115132001-11-05 Akim Demaille <akim@epita.fr>
11514
11515 * src/reader.c (symbols_output): New, extracted from...
11516 (packsymbols): here.
11517 (reader): Adjust.
11518
115192001-11-05 Akim Demaille <akim@epita.fr>
11520
11521 * src/lex.c (parse_percent_token): s/quotearg/quote/.
11522
115232001-11-05 Akim Demaille <akim@epita.fr>
11524
11525 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
11526 pattern.
11527
115282001-11-05 Akim Demaille <akim@epita.fr>
11529
11530 * src/options.h (struct option_table_struct): set_flags is void*.
11531 * src/options.c (longopts): Support `--output' and `%output'.
11532 (usage): Adjust.
11533 * src/lex.h (tok_setopt): Remove, replaced with...
11534 (tok_intopt, tok_stropt): these new guys.
11535 * src/lex.c (getopt.h): Not needed.
11536 (token_buffer, unlexed_token_buffer): Not const.
11537 (percent_table): Promote `-' over `_' in directive names.
11538 Active `%name-prefix', `file-prefix', and `output'.
11539 (parse_percent_token): Accept possible arguments to directives.
11540 Promote `-' over `_' in directive names.
11541
115422001-11-04 Akim Demaille <akim@epita.fr>
11543
11544 * doc/bison.texinfo (Decl Summary): Split the list into
11545 `directives for grammars' and `directives for bison'.
11546 Sort'em.
11547 Add description of `%name-prefix', `file-prefix', and `output'.
11548 Promote `-' over `_' in directive names.
11549 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
11550 Simplify the description of `--name-prefix'.
11551 Promote `-' over `_' in directive names.
11552 Promote `--output' over `--output-file'.
11553 Fix the description of `--defines'.
11554 * tests/output.at: Exercise %file-prefix and %output.
11555
115562001-11-02 Akim Demaille <akim@epita.fr>
11557
11558 * doc/refcard.tex: Update.
11559
115602001-11-02 Akim Demaille <akim@epita.fr>
11561
11562 * src/symtab.h (SUNDEF): New.
11563 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
11564 stand for `uninitialized', instead of 0.
11565 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
11566 * src/lex.c (lex): Adjust.
11567
11568 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
11569 Number it 0.
11570 Let yylex return it instead of a plain 0.
11571 Reported by Dick Streefland.
11572
115732001-11-02 Akim Demaille <akim@epita.fr>
11574
11575 * tests/regression.at (Mixing %token styles): New test.
11576
115772001-11-02 Akim Demaille <akim@epita.fr>
11578
11579 * src/reader.c (parse_thong_decl): Formatting changes.
11580 (token_translations_init): New, extracted from...
11581 (packsymbols): Here.
11582 Adjust.
11583
115842001-11-01 Akim Demaille <akim@epita.fr>
11585
11586 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
11587 Check that `9foo.y' produces correct cpp guards.
11588 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
11589 guards.
11590 Reported by Wwp.
11591
115922001-11-01 Akim Demaille <akim@epita.fr>
11593
11594 * tests/regression.at (Invalid input: 2): New.
11595 * src/lex.c (unlexed_token_buffer): New.
11596 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
11597 too.
11598 Reported by Wwp.
11599
116002001-11-01 Akim Demaille <akim@epita.fr>
11601
11602 * tests/calc.at: Catch up with 1.30.
11603 * configure.in: Bump to 1.49a.
11604 Adjust to newer Autotest.
11605
116062001-10-19 Pascal Bart <pascal.bart@epita.fr>
11607
11608 * src/conflicts.c: Move global variables rrc_total and src_total ...
11609 (print_conflicts): here.
11610 * src/output.c (output): Free global variable user_toknums.
11611 * src/lex.c (token_obstack): Become static.
11612
116132001-10-18 Akim Demaille <akim@epita.fr>
11614
11615 * tests/atlocal.in (GCC): Add.
11616 * tests/calc.at: s/m4_match/m4_bmatch/.
11617 s/m4_patsubst/m4_bpatsubst/.
11618 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
11619 * configure.in: AC_SUBST(GCC).
11620
116212001-10-14 Marc Autret <autret_m@epita.fr>
11622
11623 * src/options.c (create_long_option_table): Fix.
11624
116252001-10-10 Akim Demaille <akim@epita.fr>
11626
11627 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
11628
116292001-10-04 Akim Demaille <akim@epita.fr>
11630
11631 * src/reader.c (parse_union_decl): Push the caracters in
11632 union_obstack, not attrs_obstack.
11633
116342001-10-04 Akim Demaille <akim@epita.fr>
11635
11636 Merge in the branch 1.29.
11637
11638 * src/reader.c (packsymbols): Use a temporary obstack for
11639 `%%tokendef', since output_stack is already used elsewhere.
11640
11641 2001-10-02 Akim Demaille <akim@epita.fr>
11642
11643 Bump 1.29d.
11644
11645 2001-10-02 Akim Demaille <akim@epita.fr>
11646
11647 Version 1.29c.
11648
11649 2001-10-02 Akim Demaille <akim@epita.fr>
11650
11651 * tests/regression.at (Invalid CPP headers): New.
11652 From Alexander Belopolsky.
11653 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
11654
11655 2001-10-02 Akim Demaille <akim@epita.fr>
11656
11657 * tests/regression.at (Invalid input): New.
11658 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
11659 Reported by Shura.
11660
11661 2001-10-02 Akim Demaille <akim@epita.fr>
11662
11663 * tests/calc.at: Now that --debug works, the tests must be adjusted.
11664
11665 2001-10-02 Akim Demaille <akim@epita.fr>
11666
11667 * src/output.c (output_parser): Assert `skeleton'.
11668 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
11669 systems.
11670 From Shura.
11671
11672 2001-10-01 Marc Autret <autret_m@epita.fr>
11673
11674 * src/lex.h: Echo modifications.
11675 * src/lex.c (unlex): Parameter is now token_t.
11676 From Hans Aberg.
11677
11678 2001-10-01 Marc Autret <autret_m@epita.fr>
11679
11680 * src/main.c: Include lex.h.
11681 From Hans Aberg.
11682
11683 2001-09-29 Akim Demaille <akim@epita.fr>
11684
11685 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
11686
11687 2001-09-28 Akim Demaille <akim@epita.fr>
11688
11689 * tests/testsuite.at: Update to newer Autotest.
11690 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
11691
11692 2001-09-27 Akim Demaille <akim@epita.fr>
11693
11694 Position independent wrapper.
11695
11696 * tests/bison: Remove.
11697 * tests/bison.in: New.
11698 * configure.in: Adjust.
11699
11700 2001-09-27 Paul Eggert <eggert@twinsun.com>
11701
11702 Port quotearg fixes from tar 1.13.24.
11703
11704 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
11705 tm to be declared.
11706 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
11707 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
11708
11709 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
11710 * m4/mbrtowc.m4: New file.
11711 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
11712 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
11713
11714 2001-09-27 Akim Demaille <akim@epita.fr>
11715
11716 Bump to 1.29c.
11717
11718 2001-09-27 Akim Demaille <akim@epita.fr>
11719
11720 Version 1.29b.
11721
11722 2001-09-25 Akim Demaille <akim@epita.fr>
11723
11724 * src/system.h: Include `xalloc.h'.
11725 Remove it from the C files.
11726 * src/files.c (output_files): Free the obstacks.
11727 * src/lex.c (init_lex): Rename as...
11728 (lex_init): this.
11729 (lex_free): New.
11730 * src/main.c (main): Use it.
11731
11732 2001-09-24 Marc Autret <autret_m@epita.fr>
11733
11734 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
11735 to output informations in fout (FILE*).
11736 (open_graph, close_graph): Likewise.
11737 (output_graph, output_edge, output_node): Likewise.
11738 * src/vcg.h: Update function prototypes.
11739 * src/print_graph.c (print_graph): Open output graph file.
11740 (print_actions): Adjust.
11741 * src/files.h: Remove extern declaration.
11742 * src/files.c: Remove graph_obstack declaration.
11743 (open_files): Remove graph_obstack initialization.
11744 (output_files): Remove graph_obstack saving.
11745
11746 2001-09-24 Marc Autret <autret_m@epita.fr>
11747
11748 * src/files.c (compute_output_file_names): Fix.
11749
11750 2001-09-24 Marc Autret <autret_m@epita.fr>,
11751 Akim Demaille <akim@epita.fr>
11752
11753 * src/reader.c (reader): Remove call to free_symtab ().
11754 * src/main.c (main): Call it here.
11755 Include symtab.h.
11756 * src/conflicts.c (initialize_conflicts): Rename as...
11757 (solve_conflicts): this.
11758 * src/print.c (print_core, print_actions, print_state)
11759 (print_grammar): Dump to a file instead a `output_obstack'.
11760 (print_results): Dump `output_obstack', and then proceed with the
11761 FILE *.
11762 * src/files.c (compute_output_file_names, close_files): New.
11763 (output_files): Adjust.
11764 * src/main.c (main): Adjust.
11765
11766 2001-09-23 Marc Autret <autret_m@epita.fr>
11767
11768 * src/files.c (compute_header_macro): Computes header macro name
11769 from spec_defines_file when given.
11770
11771 2001-09-23 Marc Autret <autret_m@epita.fr>
11772
11773 * src/files.c (output_files): Add default extensions.
11774
11775 2001-09-22 Akim Demaille <akim@epita.fr>
11776
11777 * src/conflicts.c (finalize_conflicts): Rename as...
11778 (free_conflicts): this.
11779
11780 2001-09-22 Akim Demaille <akim@epita.fr>
11781
11782 * src/gram.c (gram_free): Rename back as...
11783 (dummy): this.
11784 (output_token_translations): Free `token_translations'.
11785 * src/symtab.c (free_symtab): Free the tag field.
11786
11787 2001-09-22 Akim Demaille <akim@epita.fr>
11788
11789 Remove `translations' as it is always set to true.
11790
11791 * src/gram.h: Adjust.
11792 * src/reader.c (packsymbols, parse_token_decl): Adjust
11793 * src/print.c (print_grammar): Adjust.
11794 * src/output.c (output_token_translations): Adjust.
11795 * src/lex.c (lex): Adjust.
11796 * src/gram.c: Be sure the set pointers to NULL.
11797 (dummy): Rename as...
11798 (gram_free): this.
11799
11800 2001-09-22 Akim Demaille <akim@epita.fr>
11801
11802 * configure.in: Invoke AM_LIB_DMALLOC.
11803 * src/system.h: Use dmalloc.
11804 * src/LR0.c: Be sure to have pointers initialized to NULL.
11805 (allocate_itemsets): Allocate kernel_items only if needed.
11806
11807 2001-09-22 Akim Demaille <akim@epita.fr>
11808
11809 * configure.in: Bump to 1.29b.
11810 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
11811 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
11812 need xmalloc.c in calc.y.
11813 From Pascal Bart.
11814
11815 2001-09-21 Akim Demaille <akim@epita.fr>
11816
11817 Version 1.29a.
11818 * Makefile.maint, config/config.guess, config/config.sub,
11819 * config/missing: Update from masters.
11820 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
11821 upon package.m4.
11822 * configure.in (ALL_LINGUAS): Add `tr'.
11823
11824 2001-09-21 Akim Demaille <akim@epita.fr>
11825
11826 * tests/Makefile.am (package.m4): Move to...
11827 ($(srcdir)/$(TESTSUITE)): here.
11828
11829 2001-09-20 Akim Demaille <akim@epita.fr>
11830
11831 * src/complain.c: No longer try to be standalone: use system.h.
11832 Don't assume __STDC__ is defined to 1. Just test if it is defined.
11833 * src/complain.h: Likewise.
11834 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
11835 Remove the unused variable `n'.
11836 From Albert Chin-A-Young.
11837
11838 2001-09-18 Marc Autret <autret_m@epita.fr>
11839
11840 * doc/bison.1: Update.
11841 * doc/bison.texinfo (Bison Options): Update --defines and --graph
11842 descriptions.
11843 (Option Cross Key): Update.
11844 Add --graph.
11845
11846 2001-09-18 Marc Autret <autret_m@epita.fr>
11847
11848 * tests/regression.at: New test (comment in %union).
11849
11850 2001-09-18 Marc Autret <autret_m@epita.fr>
11851
11852 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
11853 do that.
11854 Reported by Keith Browne.
11855
11856 2001-09-18 Marc Autret <autret_m@epita.fr>
11857
11858 * tests/output.at: Add tests for --defines and --graph.
11859
11860 2001-09-18 Marc Autret <autret_m@epita.fr>
11861
11862 * tests/output.at: Removes tests of %{header,src}_extension features.
11863
11864 2001-09-18 Akim Demaille <akim@epita.fr>
11865
11866 * tests/Makefile.am (package.m4): New.
11867 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
11868 (_AT_CHECK_CALC_ERROR): Likewise.
11869 Factor the `, ' part of verbose error messages.
11870
11871 2001-09-18 Marc Autret <autret_m@epita.fr>
11872
11873 * src/getargs.c (longopts): Declare --defines and --graph as options
11874 with optional arguments.
11875 * src/files.h: Add extern declarations.
11876 * src/files.c (spec_graph_file, spec_defines_file): New.
11877 (output_files): Update.
11878 Remove CPP-outed code.
11879
11880 2001-09-18 Marc Autret <autret_m@epita.fr>
11881
11882 Turn off %{source,header}_extension feature.
11883
11884 * src/files.c (compute_exts_from_gf): Update.
11885 (compute_exts_from_src): Update.
11886 (output_files): CPP-out useless code.
11887 * src/files.h: Remove {header,source}_extension extern declarations.
11888 * src/reader.c (parse_dquoted_param): CPP-out.
11889 (parse_header_extension_decl): Remove.
11890 (parse_source_extension_decl): Remove.
11891 (read_declarations): Remove cases tok_{hdrext,srcext}.
11892 * src/lex.c (percent_table): Remove {header,source}_extension entries.
11893 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
11894
11895 2001-09-10 Akim Demaille <akim@epita.fr>
11896
11897 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
11898 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
11899 (AT_CHECK_OUTPUT): this.
11900 Merely check ls' exit status, its output is useless.
11901
11902 2001-09-10 Akim Demaille <akim@epita.fr>
11903
11904 * tests/calc.at: Use m4_match.
11905 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
11906
11907 2001-09-10 Marc Autret <autret_m@epita.fr>,
11908 Akim Demaille <akim@epita.fr>
11909
11910 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
11911 enum color_e.
11912 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
11913 to `normal'.
11914 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
11915 * src/lex.h: Adjust prototype.
11916 (token_t): Add `tok_undef'.
11917 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
11918 (parse_percent_token): Now returns token_t.
11919 Add default statement in switch.
11920 (lex): Separate `c' as an input variable, from the token_t result
11921 part.
11922 (unlexed): Is a token_t.
11923
11924 2001-09-10 Akim Demaille <akim@epita.fr>
11925
11926 * configure.in: Bump to 1.29a.
11927
11928 2001-09-07 Akim Demaille <akim@epita.fr>
11929
11930 Version 1.29.
11931
11932 2001-08-30 Akim Demaille <akim@epita.fr>
11933
11934 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
11935 * m4/atconfig.m4: Remove.
11936 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
11937 * tests/bison: New.
11938 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
11939 m4_if, m4_patsubst, and m4_regexp.
11940 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
11941 `input' file instead of echo.
11942
11943 2001-08-29 Akim Demaille <akim@epita.fr>
11944
11945 Bump to 1.28e.
11946
11947 2001-08-29 Akim Demaille <akim@epita.fr>
11948
11949 Version 1.28d.
11950
11951 2001-08-29 Paul Eggert <eggert@twinsun.com>
11952
11953 * src/bison.simple (yyparse): Don't take the address of an
11954 item before the start of an array, as that doesn't conform to
11955 the C Standard.
11956
11957 2001-08-29 Robert Anisko <anisko_r@epita.fr>
11958
11959 * doc/bison.texinfo (Location Tracking Calc): New node.
11960
11961 2001-08-29 Paul Eggert <eggert@twinsun.com>
11962
11963 * src/output.c (output): Do not define const, as this now
11964 causes more problems than it cures.
11965
11966 2001-08-29 Akim Demaille <akim@epita.fr>
11967
11968 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
11969 the nodes.
11970 Be sure to tag the `detailmenu'.
11971
11972 2001-08-29 Akim Demaille <akim@epita.fr>
11973
11974 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
11975 download in a tmp dir.
11976
11977 2001-08-28 Marc Autret <autret_m@epita.fr>
11978
11979 * config/depcomp: New file.
11980
11981 2001-08-28 Marc Autret <autret_m@epita.fr>
11982
11983 * doc/bison.1 (mandoc): Adjust.
11984 From Juan Manuel Guerrero.
11985
11986 2001-08-28 Marc Autret <autret_m@epita.fr>
11987
11988 * src/print_graph.c (print_state): Fix.
11989
11990 2001-08-27 Marc Autret <autret_m@epita.fr>
11991
11992 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
11993 char * members.
11994 Echo modifications to the functions prototypes.
11995 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
11996
11997 2001-08-27 Marc Autret <autret_m@epita.fr>
11998
11999 * src/vcg.c: Include `xalloc.h'.
12000 (add_colorentry): New.
12001 (add_classname): New.
12002 (add_infoname): New.
12003 * src/vcg.h: Add new prototypes.
12004
12005 2001-08-27 Akim Demaille <akim@epita.fr>
12006
12007 * Makefile.maint: Sync. again with CVS Autoconf.
12008
12009 2001-08-27 Akim Demaille <akim@epita.fr>
12010
12011 * Makefile.maint: Formatting changes.
12012 (po-update, cvs-update, update): New targets.
12013 (AMTAR): Remove.
12014
12015 2001-08-27 Akim Demaille <akim@epita.fr>
12016
12017 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
12018 * Makefile.maint: Sync. with CVS Autoconf.
12019
12020 2001-08-27 Marc Autret <autret_m@epita.fr>
12021
12022 * src/vcg.h (struct infoname_s): New.
12023 (struct colorentry_s): New.
12024 (graph_s): New fields {vertical,horizontal}_order in structure.
12025 Add `infoname' field.
12026 Add `colorentry' field;
12027 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
12028 (G_HORIZONTAL_ORDER): New.
12029 (G_INFONAME): New.
12030 (G_COLORENTRY): New.
12031 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
12032 Add output of `infoname'.
12033 Add output of `colorentry'.
12034
12035 2001-08-27 Marc Autret <autret_m@epita.fr>
12036
12037 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
12038 This one shadowed a global parameter.
12039
12040 2001-08-24 Marc Autret <autret_m@epita.fr>
12041
12042 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
12043 instead of `unsigned'.
12044 (print_state): Do not call obstack_object_size () in obstack_grow ()
12045 to avoid macro variables shadowing.
12046
12047 2001-08-23 Marc Autret <autret_m@epita.fr>
12048
12049 * src/lex.c (percent_table): Typo: s/naem/name/.
12050 Add graph option.
12051 Normalize new options declarations.
12052
12053 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
12054
12055 * tests/suite.at: Exercise %header_extension and %source_extension.
12056
12057 2001-08-16 Marc Autret <autret_m@epita.fr>
12058
12059 * src/reader.c (parse_dquoted_param): New.
12060 (parse_header_extension_decl): Use it.
12061 (parse_source_extension_decl): Likewise.
12062
12063 2001-08-16 Marc Autret <autret_m@epita.fr>
12064
12065 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
12066 (get_xxxx_str): Use assert () instead of complain ().
12067 Remove return invokations in default cases.
12068 (get_decision_str): Modify default behaviour. Remove second argument.
12069 Echo modifications on calls.
12070 (output_graph): Fix.
12071
12072 2001-08-16 Marc Autret <autret_m@epita.fr>
12073
12074 * src/getargs.c (usage): Update with ``-g, --graph''.
12075
12076 2001-08-16 Marc Autret <autret_m@epita.fr>
12077
12078 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
12079 (Option Cross Key): Likewise.
12080 * doc/bison.1: Update.
12081
120822001-09-25 Pascal Bart <pascal.bart@epita.fr>
12083
12084 * src/output.c (output_master_parser): Don't finish action_obstack.
12085 (output_parser): Don't care about the muscle action, here.
12086 (prepare): Copy the action_obstack in the action muscle.
12087 (output): Free action_obstack.
12088
120892001-09-23 Pascal Bart <pascal.bart@epita.fr>
12090
12091 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
12092 will contain `%union' declaration.
12093 (parse_union_decl): Delete #line directive output.
12094 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
12095 informations about %union.
12096 (parse_union_decl): Copy the union_obstack in the muscle stype.
12097 * src/bison.simple: Add new #line directive.
12098 Add typdef %%stype YYSTYPE.
12099
121002001-09-23 Pascal Bart <pascal.bart@epita.fr>
12101
12102 * src/bison.simple: Add new `#line' directive.
12103
121042001-09-22 Pascal Bart <pascal.bart@epita.fr>
12105
12106 * src/bison.simple: New `#line' directive.
12107 * src/output.c (output_parser): Support new dynamic muscle input_line.
12108
121092001-09-22 Marc Autret <autret_m@epita.fr>
12110
12111 * src/output.c (output_master_parser): New.
12112 (output_parser): Be more re-entrant.
12113
121142001-09-21 Marc Autret <autret_m@epita.fr>
12115
12116 * src/reader.c (copy_definition, parse_union_decl): Update and use
12117 `linef' muscle.
12118 (copy_action): Likewise.
12119 Use obstack_1grow ().
12120 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
12121
121222001-09-21 Marc Autret <autret_m@epita.fr>
12123
12124 * src/options.c (option_table): Adjust.
12125 * src/lex.c (parse_percent_token): Fix.
12126
121272001-09-20 Pascal Bart <pascal.bart@epita.fr>
12128
12129 * src/options.c (symtab.h): Include it, need by lex.h.
12130
121312001-09-20 Pascal Bart <pascal.bart@epita.fr>
12132
12133 * src/lex.c (parse_percent_token): Change type of variable `tx', which
12134 is now an option_table_struct*.
12135 (option_strcmp): New function option_strcmp.
12136 (parse_percent_token): Call option_strcmp.
12137 * src/getargs.c (xalloc.h, options.h): Include it.
12138 (getargs): Call create_long_option_table.
12139 (getargs): Free longopts at the end of the function.
12140 (shortopts): Move in options.c.
12141 * src/options.c (create_long_option_table): New function. Convert
12142 information from option_table to option structure.
12143 * src/reader.c (options.h): Include it.
12144
12145 * src/Makefile.am: Adjust.
12146 * src/options.c (option_table): Create from longopts and percent_table.
12147 * src/getargs.c (longopts): Delete.
12148 * src/lex.c (struct percent_table_struct): Delete.
12149 (percent_table): Delete.
12150 (options.h): Include it.
12151 * src/options.c: Create.
12152 * src/options.h: Create.
12153 Declare enum opt_access_e.
12154 Define struct option_table_struct.
12155
121562001-09-20 Marc Autret <autret_m@epita.fr>
12157
12158 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
12159 sections of Bison.
12160
121612001-09-19 Pascal Bart <pascal.bart@epita.fr>
12162
12163 * src/bison.simple: s/%%filename/%%skeleton.
12164 * src/muscle_tab.c (getargs.h): Include it.
12165 (muscle_init): Insert new muscle skeleton.
12166
121672001-09-18 Pascal Bart <pascal.bart@epita.fr>
12168
12169 * src/output.c (output_parser): Delete unused variable actions_dumped.
12170
121712001-09-07 Pascal Bart <pascal.bart@epita.fr>
12172
12173 * src/output.c (output): Delete call to reader_output_yylsp.
12174 * src/reader.c (reader): Likewise.
12175 * src/reader.h: Delete declaration of reader_output_yylsp.
12176
121772001-09-02 Marc Autret <autret_m@epita.fr>
12178
12179 * src/reader.c: Include muscle_tab.h.
12180 (parse_union_decl): Update.
12181 (parse_macro_decl): Rename parse_muscle_decl.
12182 Update to use renamed functions and variable.
12183 (read_declarations, copy_action, read_additionnal_code, : Updated
12184 with correct variables and functions names.
12185 (packsymbols, reader): Likewise.
12186
12187 * src/reader.h (muscle_obstack): Extern declaration update.
12188
12189 * src/output.c: Include muscle_tab.h
12190 In all functions using macro_insert, change by using muscle_insert ().
12191 (macro_obstack): Rename muscle_obstack.
12192 Echo modifications in the whole file.
12193 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
12194 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
12195 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
12196
12197 * src/muscle_tab.h: Update double inclusion macros.
12198 (macro_entry_s): Rename muscle_entry_s.
12199 Update prototypes.
12200
12201 * src/muscle_tab.c: Include muscle_tab.h.
12202 Rename macro_tabble to muscle_table.
12203 (mhash1, mhash2, mcmp): Use muscle_entry.
12204 (macro_init): Rename muscle_init. Update.
12205 (macro_insert): Rename muscle_insert. Update.
12206 (macro_find): Rename muscle_find. Update.
12207
12208 * src/main.c: Include muscle_tab.h.
12209 (main): Call muscle_init ().
12210 * src/Makefile.am (bison_SOURCES): Echo modifications.
12211
122122001-09-02 Marc Autret <autret_m@epita.fr>
12213
12214 Now the files macro_tab.[ch] are named muscle_tab.[ch].
12215
12216 * src/muscle_tab.c, src/muscle_tab.h: Add files.
12217
122182001-09-02 Marc Autret <autret_m@epita.fr>
12219
12220 * src/macrotab.c, src/macrotab.h: Remove.
12221
122222001-09-01 Pascal Bart <pascal.bart@epita.fr>
12223
12224 * src/reader.c (copy_guard): Use muscle to specify the `#line'
12225 filename.
12226
122272001-09-01 Marc Autret <autret_m@epita.fr>
12228
12229 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
12230 to an explicit value to activate the feature. We do it here.
12231
122322001-08-31 Pascal Bart <pascal.bart@epita.fr>
12233
12234 * src/output.c (prepare): Delete the `filename' muscule insertion.
12235 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
12236 (parse_union_decl): Likewise.
12237 * src/macrotab.c (macro_init): Initialize filename by infile.
12238
122392001-08-31 Marc Autret <autret_m@epita.fr>
12240
12241 * src/bison.simple (YYLSP_NEEDED): New definition.
12242 * src/output.c (prepare): Add macro insertion of `locations_flag'
12243
122442001-08-31 Pascal Bart <pascal.bart@epita.fr>
12245
12246 * src/output.c (prepare): Delete insertion of previous muscles,
12247 and insert the `prefix' muscles.
12248 * src/macrotab.c (macro_init): Likewise.
12249 (macro_init): Initialization prefix directive by `yy'.
12250 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
12251 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
12252 yylval, yydebug, yyerror, yynerrs and yyparse.
12253 New directive `#define' to substitute yydebug, ... with option
12254 name_prefix.
12255
122562001-08-31 Pascal Bart <pascal.bart@epita.fr>
12257
12258 * src/main.c (main): Standardize.
12259 * src/output.c (output_table_data, output_parser): Likewise.
12260 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
12261
122622001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
12263
12264 * src/reader.c (read_additionnal_code): Rename %%user_code to
12265 %%epilogue.
12266 * src/output.c (output): Rename %%declarations to %%prologue.
12267 * src/bison.simple: Echo modifications.
12268
122692001-08-31 Marc Autret <autret_m@epita.fr>
12270
12271 * src/reader.c (readgram): CleanUp.
12272 (output_token_defines): Likewise.
12273 (packsymbols): Likewise.
12274 (reader): Likewise.
12275 * src/output.c (output): CPP-out useless code.
12276
122772001-08-31 Pascal Bart <pascal.bart@epita.fr>
12278
12279 * src/reader.c (reader): Delete obsolete call to function
12280 output_trailers and output_headers.
12281 * src/output.h: Remove obsolete functions prototypes of output_headers
12282 and output_trailers.
12283
122842001-08-30 Pascal Bart <pascal.bart@epita.fr>
12285
12286 * src/main.c: Include macrotab.h.
12287 * src/macrotab.h (macro_entry_s): Constify fields.
12288 Adjust functions prototypes.
12289 * src/macrotab.c (macro_insert): Constify key and value.
12290 (macro_find): Constify key.
12291 (macro_insert): Include 'xalloc.h'
12292 (macro_insert): Use XMALLOC.
12293 (macro_find): Constify return value.
12294 * src/output.c (output_table_data): Rename table to table_data.
12295 (output_parser): Constify macro_key, macro_value.
12296
122972001-08-30 Marc Autret <autret_m@epita.fr>
12298
12299 * src/reader.c (parse_skel_decl): New.
12300 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
12301 * src/lex.h (token_t): New token `tok_skel'.
12302 * src/lex.c (percent_table): Add skeleton option entry.
12303 Standardize.
12304
123052001-08-29 Marc Autret <autret_m@epita.fr>
12306
12307 * src/bison.simple: Add %%user_code directive at the end.
12308 * src/reader.c (read_additionnal_code): New.
12309 (reader): Use it.
12310 * src/output.c (output_program): Remove.
12311 (output): Update.
12312
123132001-08-28 Marc Autret <autret_m@epita.fr>
12314
12315 * src/output.c (output_actions): Clean up.
12316 (output_gram): CPP-out useless code.
12317 * src/reader.c (reader): Clean up, CPP-out useless code.
12318
123192001-08-28 Pascal Bart <pascal.bart@epita.fr>
12320
12321 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
12322 directive.
12323 * src/bison.simple: Add `%%definitions'.
12324
123252001-08-28 Marc Autret <autret_m@epita.fr>
12326
12327 * config/depcomp: New file.
12328
123292001-08-27 Paul Eggert <eggert@twinsun.com>
12330
12331 * src/bison.simple (yyparse): Don't take the address of an
12332 item before the start of an array, as that doesn't conform to
12333 the C Standard.
12334
123352001-08-27 Robert Anisko <robert.anisko@epita.fr>
12336
12337 * src/output.c (output): Remove the initialization of the macro
12338 obstack. It was done too late here.
12339
12340 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
12341 completely wrong.
12342 (reader): Initialize the macro obstack here, since we need it to grow
12343 '%define' directives.
12344
12345 * src/reader.h: Declare the macro obstack as extern.
12346
123472001-08-27 Robert Anisko <robert.anisko@epita.fr>
12348
12349 * src/output.c (output_parser): Fix. Store single '%' characters in
12350 the output obstack instead of throwing them away.
12351
123522001-08-27 Akim Demaille <akim@epita.fr>
12353
12354 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
12355
123562001-08-25 Robert Anisko <robert.anisko@epita.fr>
12357
12358 * lib/Makefile.am: Adjust.
12359
123602001-08-25 Robert Anisko <robert.anisko@epita.fr>
12361
12362 * src/bison.simple: Update and add '%%' directives.
12363
123642001-08-25 Robert Anisko <robert.anisko@epita.fr>
12365
12366 * src/reader.c (reader): Remove calls to 'output_headers' and
12367 'output_trailers'. Remove some C output.
12368 (readgram): Disable a piece of code that was writing a default
12369 definition for 'YYSTYPE'.
12370 (reader_output_yylsp): Remove.
12371 (packsymbols): Output token defintions to a macro.
12372 (copy_definition): Disable C output.
12373
12374 * src/reader.c (parse_macro_decl): New function used to parse macro
12375 declarations.
12376 (copy_string2): Put the body of copy_string into this new function.
12377 Add a parameter to let the caller choose whether he wants to copy the
12378 string delimiters or not.
12379 (copy_string): Be a simple call to copy_string2 with the last argument
12380 bound to true.
12381 (read_declarations): Add case for macro definition.
12382 (copy_identifier): New.
12383 (parse_macro_decl): Read macro identifiers using copy_identifier
12384 rather than lex.
12385
123862001-08-25 Robert Anisko <robert.anisko@epita.fr>
12387
12388 * src/output.c (prepare): Add prefixed names.
12389 (output_parser): Output semantic actions.
12390 (output_parser): Fix bug on '%%line' directives.
12391
12392 * src/output.c (output_headers): Remove. The C code printed by this
12393 function should now be in the skeletons.
12394 (output_trailers): Remove.
12395 (output): Disable call to 'reader_output_yylsp'.
12396 (output_rule_data): Do not output tables to the table obstack.
12397
12398 * src/output.c: Remove some C dedicated output.
12399 Improve the use of macro and output obstacks.
12400 (output_defines): Remove.
12401
12402 * src/output.c (output_token_translations): Associate 'translate'
12403 table with a macro. No output to the table obstack.
12404 (output_gram): Same for 'rhs' and 'prhs'.
12405 (output_stos): Same for 'stos'.
12406 (output_rule_data): Same for 'r1' and 'r2'.
12407 (token_actions): Same for 'defact'.
12408 (goto_actions): Same for 'defgoto'.
12409 (output_base): Same for 'pact' and 'pgoto'.
12410 (output_table): Same for 'table'.
12411 (output_check): Same for 'check'.
12412
12413 * src/output.c (output_table_data): New function.
12414 (output_short_table): Remove.
12415 (output_short_or_char_table): Remove.
12416
12417 * src/output.c (output_parser): Replace most of the skeleton copy code
12418 with something new. Skeletons are now processed character by character
12419 rather than line by line, and Bison looks for '%%' macros. This is the
12420 first step in making Bison's output process (a lot) more flexible.
12421 (output_parser): Use the macro table.
12422
124232001-08-25 Robert Anisko <robert.anisko@epita.fr>
12424
12425 * src/main.c (main): Initialize the macro table.
12426
124272001-08-25 Robert Anisko <robert.anisko@epita.fr>
12428
12429 * src/lex.c (percent_table): Add tok_define.
12430 * src/lex.h: Add tok_define.
12431
124322001-08-25 Robert Anisko <robert.anisko@epita.fr>
12433
12434 * src/macrotab.c: New file.
12435 * src/macrotab.h: New file.
12436 * src/Makefile.am: Update.
12437
124382001-08-25 Robert Anisko <robert.anisko@epita.fr>
12439
12440 * lib/hash.c: New file.
12441 * lib/hash.h: New file.
12442 * lib/Makefile.am: Update.
12443
124442001-08-15 Akim Demaille <akim@epita.fr>
12445
12446 Version 1.28c.
12447
124482001-08-15 Marc Autret <autret_m@epita.fr>
12449
12450 * src/reader.c (readgram): Indent output macro YYSTYPE.
12451 (packsymbols): Likewise.
12452 (output_token_defines): Likewise.
12453 * src/files.c: Standardize.
12454 (compute_header_macro): New.
12455 (defines_obstack_save): New. Use compute_header_macro.
12456 (output_files): Update. Use defines_obstack_save.
12457
124582001-08-15 Akim Demaille <akim@epita.fr>
12459
12460 * doc/bison.texinfo (Table of Symbols): Document
12461 YYSTACK_USE_ALLOCA.
12462
124632001-08-15 Akim Demaille <akim@epita.fr>
12464
12465 * missing: Update from CVS Automake.
12466 * config/config.guess, config/config.sub, config/texinfo.tex:
12467 Update from gnu.org.
12468
124692001-08-15 Akim Demaille <akim@epita.fr>
12470
12471 * Makefile.maint: Sync with CVS Autoconf.
12472
124732001-08-14 Pascal Bart <pascal.bart@epita.fr>
12474
12475 * doc/bison.texinfo: Include GNU Free Documentation License from
12476 `fdl.texi'.
12477 * doc/fdl.texi: Add to package.
12478
124792001-08-14 Marc Autret <autret_m@epita.fr>
12480
12481 Turn on %{source,header}_extension features.
12482
12483 * src/lex.c (percent_table): Un-CPP out header_extension and
12484 source_extension.
12485 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
12486 (compute_exts_from_src): Remove conditions. It restores priorities
12487 between options.
12488
124892001-08-14 Marc Autret <autret_m@epita.fr>
12490
12491 * src/files.c (compute_base_names): Add extensions computing when
12492 `--file-prefix' used.
12493 Standardize function calls.
12494
124952001-08-13 Marc Autret <autret_m@epita.fr>
12496
12497 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
12498 defining it (defined but null disables alloca).
12499
125002001-08-13 Marc Autret <autret_m@epita.fr>
12501
12502 * src/bison.simple (_yy_memcpy): CPP reformat.
12503
125042001-08-13 Pascal Bart <pascal.bart@epita.fr>
12505
12506 * tests/atconfig.in (CPPFLAGS): Fix.
12507
125082001-08-10 Pascal Bart <pascal.bart@epita.fr>
12509
12510 * doc/bison.texinfo: Include GNU General Public License from
12511 `gpl.texi'.
12512 * doc/gpl.texi: Add to package.
12513
125142001-08-10 Marc Autret <autret_m@epita.fr>
12515
12516 * src/print_graph.h: Fix.
12517 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
12518
125192001-08-10 Akim Demaille <akim@epita.fr>
12520
12521 * src/system.h: Provide default declarations for stpcpy, strndup,
12522 and strnlen.
12523
125242001-08-10 Robert Anisko <anisko_r@epita.fr>
12525
12526 * doc/bison.texinfo (Locations): Update @$ stuff.
12527
125282001-08-09 Robert Anisko <anisko_r@epita.fr>
12529
12530 * src/bison.simple (YYLLOC_DEFAULT): Update.
12531 (yyparse): Adjust.
12532
125332001-08-08 Marc Autret <autret_m@epita.fr>
12534
12535 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
12536 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
12537 Reported by Fabrice Bauzac.
12538
125392001-08-08 Marc Autret <autret_m@epita.fr>
12540
12541 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
12542 * src/vcg.c (output_node): Fix.
12543 * src/vcg.h: Cleanup.
12544 * src/print_graph.c: Add comments.
12545 (node_output_size): New global variable. Simplify the formatting of
12546 the VCG graph output.
12547 (print_actions): Unused code is now used. It notifies the final state
12548 and no action states in the VCG graph. It also give the reduce actions.
12549 The `shift and goto' edges are red and the `go to state' edges are
12550 blue.
12551 Get the current node name and node_obstack by argument.
12552 (node_obstack): New variable.
12553 (print_state): Manage node_obstack.
12554 (print_core): Use node_obstack given by argument.
12555 A node is not only computed here but in print_actions also.
12556 (print_graph): CPP out useless code instead of commenting it.
12557
125582001-08-07 Pascal Bart <pascal.bart@epita.fr>
12559
12560 * tests/atconfig.in (CPPFLAGS): Fix.
12561
125622001-08-07 Akim Demaille <akim@epita.fr>
12563
12564 * src/print_graph.c (quote): New.
12565 (print_core): Use it.
12566
125672001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
12568
12569 * src/vcg.c (complain.h): Include it.
12570 Unepitaize `return' invocations.
12571 [NDEBUG] (main): Remove.
12572 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
12573 * src/files.c (open_files): Initialize graph_obstack.
12574 * src/print_graph.c (print_actions): CPP out useless code.
12575 (print_core): Don't output the last `\n' in labels.
12576 Use `quote'.
12577 * src/files.c (output_files): Output the VCG file.
12578 * src/main.c (main): Invoke print_graph ();
12579
125802001-08-06 Marc Autret <autret_m@epita.fr>
12581
12582 Automaton VCG graph output.
12583 Using option ``-g'' or long option ``--graph'', you can generate
12584 a gram_filename.vcg file containing a VCG description of the LALR (1)
12585 automaton of your grammar.
12586
12587 * src/main.c: Call to print_graph() function.
12588 * src/getargs.h: Update.
12589 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
12590 (graph_flag): New flag.
12591 (longopts): Update.
12592 (getargs): Add case `g'.
12593 * src/files.c (graph_obstack): New obstack struct.
12594 (open_files): Initialize new obstack.
12595 (output_files): Saves graph_obstack if required.
12596 * src/files.h (graph_obstack): New extern declaration.
12597 * src/Makefile.am: Add new source files.
12598
125992001-08-06 Marc Autret <autret_m@epita.fr>
12600
12601 * src/print_graph.c, src/print_graph.h (graph): New.
12602 * src/vcg.h: New file.
12603 * src/vcg.c: New file, VCG graph handling.
12604
126052001-08-06 Marc Autret <autret_m@epita.fr>
12606
12607 Add of %source_extension and %header_extension which specify
12608 the source or/and the header output file extension.
12609
12610 * src/files.c (compute_base_names): Remove initialisation of
12611 src_extension and header_extension.
12612 (compute_exts_from_gf): Update.
12613 (compute_exts_from_src): Update.
12614 (output_files): Update.
12615 * src/reader.c (parse_header_extension_decl): New.
12616 (parse_source_extension_decl): New.
12617 (read_declarations): New case statements for the new tokens.
12618 * src/lex.c (percent_table): Add entries for %source_extension
12619 and %header_extension.
12620 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
12621
126222001-08-06 Marc Autret <autret_m@epita.fr>
12623
12624 * configure.in: Bump to 1.28c.
12625 * doc/bison.texinfo: Texinfo thingies.
12626
126272001-08-04 Pascal Bart <pascal.bart@epita.fr>
12628
12629 * tests/atconfig.in (CPPFLAGS): Add.
12630 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
12631
126322001-08-03 Akim Demaille <akim@epita.fr>
12633
12634 Version 1.28b.
12635
126362001-08-03 Akim Demaille <akim@epita.fr>
12637
12638 * tests/Makefile.am (check-local): Ship testsuite.
12639 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
12640 Include `string.h'.
12641
126422001-08-03 Akim Demaille <akim@epita.fr>
12643
12644 * configure.in: Try using -Wformat when compiling.
12645
126462001-08-03 Akim Demaille <akim@epita.fr>
12647
12648 * configure.in: Bump to 1.28b.
12649
126502001-08-03 Akim Demaille <akim@epita.fr>
12651
12652 * src/complain.c: Adjust strerror_r portability issues.
12653
126542001-08-03 Akim Demaille <akim@epita.fr>
12655
12656 Version 1.28a.
12657
126582001-08-03 Akim Demaille <akim@epita.fr>
12659
12660 * src/getargs.c, src/getarg.h (skeleton)): Constify.
12661 * src/lex.c (literalchar): Avoid name clashes on `buf'.
12662 * src/getargs.c: Include complain.h.
12663 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
12664 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
12665
126662001-08-03 Akim Demaille <akim@epita.fr>
12667
12668 * src/reader.c (readgram): Display hidden chars in error messages.
12669
126702001-08-03 Akim Demaille <akim@epita.fr>
12671
12672 Update to gettext 0.10.39.
12673
126742001-08-03 Akim Demaille <akim@epita.fr>
12675
12676 * lib/strspn.c: New.
12677
126782001-08-01 Marc Autret <autret_m@epita.fr>
12679
12680 * doc/bison.texinfo: Update.
12681 * doc/bison.1 (mandoc): Update.
12682 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
12683 * src/files.c: Support output files extensions computing.
12684 (src_extension): New static variable.
12685 (header_extension): New static variable.
12686 (tr): New function.
12687 (get_extension_index): New function, gets the index of an extension
12688 filename in a string.
12689 (compute_exts_from_gf): New function, computes extensions from the
12690 grammar file extension.
12691 (compute_exts_from_src): New functions, computes extensions from the
12692 C source file extension, file given by ``-o'' option.
12693 (compute_base_names): Update.
12694 (output_files): Update.
12695
126962001-08-01 Robert Anisko <anisko_r@epita.fr>
12697
12698 * doc/bison.texi: Document @$.
12699 (Locations): New section.
12700
127012001-07-18 Akim Demaille <akim@epita.fr>
12702
12703 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
12704 * config/prev-version.txt, config/move-if-change: New.
12705 * Makefile.am: Adjust.
12706
127072001-07-08 Pascal Bart <pascal.bart@epita.fr>
12708
12709 * src/bison.simple (yyparse): Suppress warning `comparaison
12710 between signed and unsigned'.
12711
127122001-07-05 Pascal Bart <pascal.bart@epita.fr>
12713
12714 * src/getargs.h (raw_flag): Remove.
12715 * src/getargs.c: Die on `-r'/`--raw'.
12716 * src/lex.c (parse_percent_token): Die on `%raw'.
12717 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
12718 * tests/calc.at: Suppress test with option `--raw'.
12719
127202001-07-14 Akim Demaille <akim@epita.fr>
12721
12722 * config/: New.
12723 * configure.in: Require Autoconf 2.50.
12724 Update to gettext 0.10.38.
12725
127262001-03-16 Akim Demaille <akim@epita.fr>
12727
12728 * doc/bison.texinfo: ANSIfy the examples.
12729
127302001-03-16 Akim Demaille <akim@epita.fr>
12731
12732 * getargs.c (skeleton): New variable.
12733 (longopts): --skeleton is a new option.
12734 (shortopts, getargs): -S is a new option.
12735 * getargs.h: Declare skeleton.
12736 * output.c (output_parser): Use it.
12737
127382001-03-16 Akim Demaille <akim@epita.fr>
12739
12740 * m4/strerror_r.m4: New.
12741 * m4/error.m4: Run AC_FUNC_STRERROR_R.
12742 * lib/error.h, lib/error.c: Update.
12743
127442001-03-16 Akim Demaille <akim@epita.fr>
12745
12746 * src/getargs.c (longopts): Clean up.
12747
127482001-02-21 Akim Demaille <akim@epita.fr>
12749
12750 * src/reader.c (gensym): `gensym_count' is your own.
12751 Use a static buf to create the symbol name, as token_buffer is no
12752 longer a buffer.
12753
127542001-02-08 Akim Demaille <akim@epita.fr>
12755
12756 * src/conflicts.c (conflict_report): Be sure not to append to res
12757 between two calls, which could happen if both first sprintf were
12758 skipped, but not the first cp += strlen.
12759
127602001-02-08 Akim Demaille <akim@epita.fr>
12761
12762 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
12763 New, from fileutils 4.0.37.
12764 * configure.in: Require Autoconf 2.49c. I took some time before
12765 making this decision. This is the only way out for portability
12766 issues in Bison, it would mean way too much duplicate effort to
12767 import in Bison features implemented in 2.49c since 2.13.
12768 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
12769
127702001-02-02 Akim Demaille <akim@epita.fr>
12771
12772 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
12773 * lib/xalloc.h, lib/xmalloc.c: Update.
12774
127752001-01-19 Akim Demaille <akim@epita.fr>
12776
12777 Get rid of the ad hoc handling of token_buffer in the scanner: use
12778 the obstacks.
12779
12780 * src/lex.c (token_obstack): New.
12781 (init_lex): Initialize it. No longer call...
12782 (grow_token_buffer): this. Remove it.
12783 Adjust all the places which used it to use the obstack.
12784
127852001-01-19 Akim Demaille <akim@epita.fr>
12786
12787 * src/lex.h: Rename all the tokens:
12788 s/\bENDFILE\b/tok_eof/g;
12789 s/\bIDENTIFIER\b/tok_identifier/g;
12790 etc.
12791 Let them be enums, not #define, to ease debugging.
12792 Adjust all the code.
12793
127942001-01-18 Akim Demaille <akim@epita.fr>
12795
12796 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
12797 * src/lex.c (maxtoken, grow_token_buffer): Static.
12798
127992001-01-18 Akim Demaille <akim@epita.fr>
12800
12801 Since we now use obstacks, more % directives can be enabled.
12802
12803 * src/lex.c (percent_table): Also accept `%yacc',
12804 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
12805 `%debug'.
12806 Handle the actions for `%semantic_parser' and `%pure_parser' here,
12807 instead of returning a token.
12808 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
12809 * src/reader.c (read_declarations): Adjust.
12810 * src/files.c (open_files): Don't call `compute_base_names', don't
12811 compute `attrsfile' since they depend upon data which might be
12812 *in* the input file now.
12813 (output_files): Do it here.
12814 * src/output.c (output_headers): Document the fact that this patch
12815 introduces a guaranteed SEGV for semantic parsers.
12816 * doc/bison.texinfo: Document them.
12817 * tests/suite.at: Exercise these %options.
12818
128192000-12-20 Akim Demaille <akim@epita.fr>
12820
12821 Also handle the output file (--verbose) with obstacks.
12822
12823 * files.c (foutput): Remove.
12824 (output_obstack): New.
12825 Adjust all dependencies.
12826 * src/conflicts.c: Return a string.
12827 * src/system.h (obstack_grow_string): Rename as...
12828 (obstack_sgrow): this. Be ready to work with non literals.
12829 (obstack_fgrow4): New.
12830
128312000-12-20 Akim Demaille <akim@epita.fr>
12832
12833 * src/files.c (open_files): Fix the computation of short_base_name
12834 in the case of `-o foo.tab.c'.
12835
128362000-12-20 Akim Demaille <akim@epita.fr>
12837
12838 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
12839 (copy_dollar): Now that everything uses obstacks, get rid of the
12840 FILE * parameters.
12841
128422000-12-20 Akim Demaille <akim@epita.fr>
12843
12844 * src/files.c (open_files): Actually the `.output' file is based
12845 on the short_base_name, not base_name.
12846 * tests/suite.at (Checking output file names): Adjust.
12847
128482000-12-20 Akim Demaille <akim@epita.fr>
12849
12850 * src/bison.s1: Remove, we now use directly...
12851 * src/bison.simple: this.
12852 * src/Makefile.am: Use pkgdata instead of data.
12853
128542000-12-20 Akim Demaille <akim@epita.fr>
12855
12856 * src/files.c (guard_obstack): New.
12857 (open_files): Initialize it.
12858 (output_files): Dump it...
12859 * src/files.h: Export it.
12860 * src/reader.c (copy_guard): Use it.
12861
128622000-12-19 Akim Demaille <akim@epita.fr>
12863
12864 * src/files.c (outfile, defsfile, actfile): Removed as global
12865 vars.
12866 (open_files): Don't compute them.
12867 (output_files): Adjust.
12868 (base_name, short_base_name): Be global.
12869 Adjust dependencies.
12870
128712000-12-19 Akim Demaille <akim@epita.fr>
12872
12873 * src/files.c (strsuffix): New.
12874 (stringappend): Be just like strcat but allocate.
12875 (base_names): Eve out from open_files.
12876 Try to simplify the rather hairy computation of base_name and
12877 short_base_name.
12878 (open_files): Use it.
12879 * tests/suite.at (Checking output file names): New test.
12880
128812000-12-19 Akim Demaille <akim@epita.fr>
12882
12883 * src/system.h (obstack_grow_literal_string): Rename as...
12884 (obstack_grow_string): this.
12885 * src/output.c (output_parser): Recognize `%% actions' instead of
12886 `$'.
12887 * src/bison.s1: s/$/%% actions/.
12888 * src/bison.hairy: Likewise.
12889
128902000-12-19 Akim Demaille <akim@epita.fr>
12891
12892 * src/output.c (output_parser): Compute the `#line' lines when
12893 there are.
12894 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
12895 Suggested by Hans Aberg.
12896
128972000-12-19 Akim Demaille <akim@epita.fr>
12898
12899 Let the handling of the skeleton files be local to the procedures
12900 that use it.
12901
12902 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
12903 longer static.
12904 (fparser, open_extra_files): Remove.
12905 (open_files, output_files): Don't take care of fparser.
12906 * src/files.h: Adjust.
12907 * src/output.c (output_parser): Open and close the file to the
12908 skeleton.
12909 * src/reader.c (read_declarations): When %semantic_parser, open
12910 fguard.
12911
129122000-12-19 Akim Demaille <akim@epita.fr>
12913
12914 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
12915 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
12916
129172000-12-19 Akim Demaille <akim@epita.fr>
12918
12919 * src/files.c (open_files): Yipee! We no longer need all the code
12920 looking for `/tmp' since we have no tmp file.
12921
129222000-12-19 Akim Demaille <akim@epita.fr>
12923
12924 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
12925 New macros.
12926 * src/files.c (open_files): Less dependency on MSDOS etc.
12927
129282000-12-14 Akim Demaille <akim@epita.fr>
12929
12930 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
12931 Provide a default definition.
12932 Use it when executing the default @ action.
12933 * src/reader.c (reader_output_yylsp): No longer include
12934 `timestamp' and `text' in the default YYLTYPE.
12935
129362000-12-12 Akim Demaille <akim@epita.fr>
12937
12938 * src/reader.c (copy_definition, parse_union_decl, copy_action)
12939 (copy_guard): Quote the file names.
12940 Reported by Laurent Mascherpa.
12941
129422000-12-12 Akim Demaille <akim@epita.fr>
12943
12944 * src/output.c (output_headers, output_program, output): Be sure
12945 to escape special characters when outputting filenames.
12946 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
12947 (output_headers): Don't depend on them, Use ACTSTR.
12948
129492000-11-17 Akim Demaille <akim@epita.fr>
12950
12951 * lib/obstack.h: Formatting changes.
12952 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
12953 prevents type checking.
12954 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
12955 cast the value to (void *): assigning a `foo *' to a `void *'
12956 variable is valid.
12957 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
12958 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
12959 append characters.
12960
129612000-11-17 Akim Demaille <akim@epita.fr>
12962
12963 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
12964 as...
12965 (suite.m4, regression.m4, calc.m4): these.
12966 * tests/atgeneral.m4: Update from CVS Autoconf.
12967
129682000-11-17 Akim Demaille <akim@epita.fr>
12969
12970 * tests/regression.m4 (%union and --defines): New test,
12971 demonstrating a current bug in the obstack implementation.
12972
129732000-11-17 Akim Demaille <akim@epita.fr>
12974
12975 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
12976 macros.
12977 Use them to declare the variables which are global or local to
12978 `yyparse'.
12979
129802000-11-17 Akim Demaille <akim@epita.fr>
12981
12982 * acconfig.h: Remove, no longer used.
12983
129842000-11-07 Akim Demaille <akim@epita.fr>
12985
12986 * src: s/Copyright (C)/Copyright/g.
12987
129882000-11-07 Akim Demaille <akim@epita.fr>
12989
12990 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
12991 defining.
12992 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
12993
129942000-11-07 Akim Demaille <akim@epita.fr>
12995
12996 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
12997 Merge in a single CPP if/else.
12998
129992000-11-07 Akim Demaille <akim@epita.fr>
13000
13001 * src/output.c (output): Remove useless variables.
13002 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
13003 argument `data' for consistency with the prototypes.
13004 Qualify it `const'.
13005 (obstack_copy, obstack_copy0): Rename the second argument as
13006 `address' for consistency. Qualify it `const'.
13007 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
13008 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
13009 `const' their input argument (`data' or `address').
13010 Adjust the corresponding macros to include `const' in casts.
13011
130122000-11-03 Akim Demaille <akim@epita.fr>
13013
13014 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
13015 s/PFILE1/BISON_HAIRY/.
13016 Adjust dependencies.
13017
130182000-11-03 Akim Demaille <akim@epita.fr>
13019
13020 For some reason, this was not applied.
13021
13022 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
13023 `unlink': it's no longer used.
13024
130252000-11-03 Akim Demaille <akim@epita.fr>
13026
13027 * src/files.c (skeleton_find): New function, eved out of...
13028 (open_files, open_extra_files): here.
13029
130302000-11-03 Akim Demaille <akim@epita.fr>
13031
13032 Don't use `atexit'.
13033
13034 * src/files.c (obstack_save): New function.
13035 (done): Rename as...
13036 (output_files): this.
13037 Use `obstack_save'.
13038 * src/main.c (main): Don't use `atexit' to register `done', since
13039 it no longer has to remove tmp files, just call `output_files'
13040 when there are no errors.
13041
130422000-11-02 Akim Demaille <akim@epita.fr>
13043
13044 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
13045 `unlink': it's no longer used.
13046 * src/files.h: Formatting changes.
13047
130482000-11-02 Akim Demaille <akim@epita.fr>
13049
13050 Remove the last uses of mktemp and unlink/delete.
13051
13052 * src/files.c (fdefines, ftable): Removed.
13053 (defines_ostack, table_obstack): New.
13054 Adjust dependencies of the former into uses of the latter.
13055 * src/output.c (output_short_or_char_table, output_short_table):
13056 Convert to using obstacks.
13057 * src/reader.c (copy_comment2): Accept one FILE * and two
13058 obstacks.
13059 (output_token_defines, reader_output_yylsp): Use obstacks.
13060 * src/system.h (obstack_fgrow3): New.
13061 * po/POTFILES.in: Adjust.
13062
130632000-11-01 Akim Demaille <akim@epita.fr>
13064
13065 Change each use of `fattrs' into a use of `attrs_obstack'.
13066
13067 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
13068 * src/files.c (fattrs): Remove.
13069 (attrs_obstack): New.
13070 Adjust all dependencies.
13071 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
13072
130732000-11-01 Akim Demaille <akim@epita.fr>
13074
13075 Introduce obstacks.
13076 Change each use of `faction' into a use of `action_obstack'.
13077
13078 * lib/obstack.h, lib/obstack.c: New files.
13079 * src/files.c (faction): Remove.
13080 (action_obstack): New.
13081 Adjust all dependencies.
13082
130832000-10-20 Akim Demaille <akim@epita.fr>
13084
13085 * lib/quote.h (PARAMS): New macro. Use it.
13086
130872000-10-16 Akim Demaille <akim@epita.fr>
13088
13089 * src/output.c (output_short_or_char_table): New function.
13090 (output_short_table, output_token_translations): Use it.
13091 (goto_actions): Use output_short_table.
13092
130932000-10-16 Akim Demaille <akim@epita.fr>
13094
13095 * src/symtab.c (bucket_new): New function.
13096 (getsym): Use it.
13097
13098 * src/output.c (output_short_table): New argument to display the
13099 comment associated with the table.
13100 Adjust dependencies.
13101 (output_gram): Use it.
13102 (output_rule_data): Nicer output layout for YYTNAME.
13103
131042000-10-16 Akim Demaille <akim@epita.fr>
13105
13106 * src/lex.c (read_typename): New function.
13107 (lex): Use it.
13108 * src/reader.c (copy_dollar): Likewise.
13109
131102000-10-16 Akim Demaille <akim@epita.fr>
13111
13112 * src/reader.c (copy_comment2): Expect the input stream to be on
13113 the `/' which is suspected to open a comment, instead of being
13114 called after `//' or `/*' was read.
13115 (copy_comment, copy_definition, parse_union_decl, copy_action)
13116 (copy_guard): Adjust.
13117
131182000-10-16 Akim Demaille <akim@epita.fr>
13119
13120 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
13121 `read_signed_integer'.
13122
131232000-10-16 Akim Demaille <akim@epita.fr>
13124
13125 * src/reader.c (copy_dollar): New function.
13126 (copy_guard, copy_action): Use it.
13127
131282000-10-16 Akim Demaille <akim@epita.fr>
13129
13130 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
13131 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
13132 New files, from Fileutils 4.0.27.
13133 * src/main.c (printable_version): Remove.
13134 * src/lex.c, src/reader.c: Use `quote'.
13135
131362000-10-04 Akim Demaille <akim@epita.fr>
13137
13138 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
13139
131402000-10-04 Akim Demaille <akim@epita.fr>
13141
13142 * doc/bison.texinfo: Various typos spotted by Neil Booth.
13143
131442000-10-04 Akim Demaille <akim@epita.fr>
13145
13146 When a literal string is used to define two different tokens,
13147 `bison -v' segfaults.
13148 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
13149
13150 * tests/regression.m4: New file.
13151 Include the core of the sample provided by Piotr Gackiewicz.
13152 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
13153 properly.
13154
131552000-10-04 Akim Demaille <akim@epita.fr>
13156
13157 * src/reader.c (parse_expect_decl): Keep `count' within the size
13158 of `buffer'.
13159 From Neil Booth.
13160
131612000-10-02 Paul Eggert <eggert@twinsun.com>
13162
13163 * bison.s1 (yyparse): Assign the default value
13164 unconditionally, to avoid a GCC warning and make the parser a
13165 tad smaller.
13166
131672000-10-02 Akim Demaille <akim@epita.fr>
13168
13169 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
13170 options.
13171
131722000-10-02 Akim Demaille <akim@epita.fr>
13173
13174 * src/derives.c, src/print.c, src/reduce.c: To ease the
13175 translation, move some `\n' out of the translated strings.
13176
131772000-10-02 Akim Demaille <akim@epita.fr>
13178
13179 The location tracking mechanism is precious for parse error
13180 messages. Nevertheless, it is enabled only when `@n' is used in
13181 the grammar, which is a different issue (you can use it in error
13182 message, but not in the grammar per se). Therefore, there should
13183 be another means to enable it.
13184
13185 * src/getargs.c (getargs): Support `--locations'.
13186 (usage): Report it.
13187 * src/getargs.h (locationsflag): Export it.
13188 * src/lex.c (percent_table): Support `%locations'.
13189 * src/reader.c (yylsp_needed): Remove this variable, now replaced
13190 with `locationsflag'.
13191 * doc/bison.texinfo: Document `--locations' and `%locations'.
13192 Sort the options.
13193 * tests/calc.m4: Test it.
13194
13195 For regularity of the names, replace each
13196 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
13197 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
13198 In addition replace each `flag' with `_flag'.
13199
132002000-10-02 Akim Demaille <akim@epita.fr>
13201
13202 Also test parse error messages, including with YYERROR_VERBOSE.
13203
13204 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
13205 associative).
13206 Use it to check the computations.
13207 Use it to check `nonassoc' is honored.
13208 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
13209 `--yyerror-verbose'.
13210 (_AT_CHECK_CALC): Adjust to this option.
13211 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
13212
132132000-10-02 Akim Demaille <akim@epita.fr>
13214
13215 Test also `--verbose', `--defines' and `--name-prefix'. Testing
13216 the latter demonstrates a flaw in the handling of non debugging
13217 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
13218 was used in order to simplify:
13219
13220 #if YYDEBUG
13221 if (yydebug)
13222 {
13223 ...
13224 }
13225 #endif
13226
13227 into
13228
13229 if (yydebug)
13230 {
13231 ...
13232 }
13233
13234 unfortunately this leads to a CPP conflict when
13235 `--name-prefix=foo' is used since it produces `#define yydebug
13236 foodebug'.
13237
13238 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
13239 (YYDPRINTF): New macro.
13240 Spread its use.
13241 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
13242 the bison options.
13243 Also test `--verbose', `--defines' and `--name-prefix'.
13244
132452000-10-02 Akim Demaille <akim@epita.fr>
13246
13247 Improve the readability of the produced parsers.
13248
13249 * src/bison.s1: Formatting changes.
13250 Improve the comment related to the `$' mark.
13251 (yydefault): Don't fall through to `yyresume': `goto' there.
13252 * src/output.c (output_parser): When the `$' is met, skip the end
13253 of its line.
13254 New variable, `number_of_dollar_signs', to check there's exactly
13255 one `$' in the parser skeleton.
13256
132572000-10-02 Akim Demaille <akim@epita.fr>
13258
13259 * lib/xstrdup.c: New file, from the fileutils.
13260 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
13261 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
13262 instead of strlen + xmalloc + strcpy.
13263 * src/symtab.c (copys): Remove, use xstrdup instead.
13264
132652000-10-02 Akim Demaille <akim@epita.fr>
13266
13267 * src/gram.h (associativity): New enum type which replaces the
13268 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
13269 `right_assoc', `left_assoc' and `non_assoc'.
13270 Adjust all dependencies.
13271 * src/reader.c: Formatting changes.
13272 (LTYPESTR): Don't define it, use it as a literal in
13273 `reader_output_yylsp'.
13274 * src/symtab.h (symbol_class): New enum type which replaces the
13275 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
13276 `sunknown', `stoken and `snterm'.
13277
132782000-10-02 Akim Demaille <akim@epita.fr>
13279
13280 * src/getargs.c (fixed_outfiles): Rename as...
13281 (yaccflag): for consistency and accuracy.
13282 Adjust dependencies.
13283
132842000-10-02 Akim Demaille <akim@epita.fr>
13285
13286 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
13287 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
13288 difficult and introduced a lot of core dump. It turns out that
13289 Bison used an implementation of `xmalloc' based on `calloc', and
13290 at various places it does depend upon the initialization to 0. I
13291 have not tried to isolate the pertinent places, and all the former
13292 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
13293 someone should address this issue.
13294
13295 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
13296 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
13297 files.
13298 Adjust dependencies.
13299 * src/warshall.h: New file.
13300 Propagate.
13301
133022000-10-02 Akim Demaille <akim@epita.fr>
13303
13304 Various anti-`extern in *.c' changes.
13305
13306 * src/system.h: Include `assert.h'.
13307
133082000-10-02 Akim Demaille <akim@epita.fr>
13309
13310 * src/state.h (nstates, final_state, first_state, first_shift)
13311 (first_reduction): Move their exportation from here...
13312 * src/LR0.h: to here.
13313 Adjust dependencies.
13314 * src/getargs.c (statisticsflag): New variable.
13315 Add support for `--statistics'.
13316 Adjust dependencies.
13317
13318 Remove a lot of now useless `extern' statements in most files.
13319
133202000-10-02 Akim Demaille <akim@epita.fr>
13321
13322 * src/LR0.h: New file.
13323 Propagate its use.
13324
133252000-10-02 Akim Demaille <akim@epita.fr>
13326
13327 * src/print.h: New file.
13328 Propagate its use.
13329 * src/print.c: Formatting and ordering changes.
13330 (verbose, terse): Replace with...
13331 (print_results): this new function.
13332 Adjust dependencies.
13333
133342000-10-02 Akim Demaille <akim@epita.fr>
13335
13336 * src/conflicts.c (conflict_report): New function.
13337 (conflict_log, verbose_conflict_log): Replace with...
13338 (print_conflicts): this function.
13339 Adjust dependencies.
13340 * src/conflicts.h: New file.
13341 Propagate its inclusion.
13342
133432000-10-02 Akim Demaille <akim@epita.fr>
13344
13345 * src/nullable.h: New file.
13346 Propagate its inclusion.
13347 * src/nullable.c: Formatting changes.
13348
133492000-10-02 Akim Demaille <akim@epita.fr>
13350
13351 * src/reduce.h: New file.
13352 Propagate its inclusion.
13353 * src/reduce.c: Topological sort and other formatting changes.
13354 (bool, TRUE, FALSE): Move their definition to...
13355 * src/system.h: here.
13356
133572000-10-02 Akim Demaille <akim@epita.fr>
13358
13359 * src/files.c: Formatting changes.
13360 (tryopen, tryclose, openfiles): Rename as...
13361 (xfopen, xfclose, open_files): this.
13362 (stringappend): static.
13363 * src/files.h: Complete the list of exported symbols.
13364 Propagate its use.
13365
133662000-10-02 Akim Demaille <akim@epita.fr>
13367
13368 * src/reader.h: New file.
13369 Propagate its use instead of tedious list of `extern' and
13370 prototypes.
13371 * src/reader.c: Formatting changes, topological sort,
13372 s/register//.
13373
133742000-10-02 Akim Demaille <akim@epita.fr>
13375
13376 * src/lex.h: Prototype `lex.c' exported functions.
13377 * src/reader.c: Adjust.
13378 * src/lex.c: Formatting changes.
13379 (safegetc): Rename as...
13380 (xgetc): this.
13381
133822000-10-02 Akim Demaille <akim@epita.fr>
13383
13384 * src/lalr.h: New file.
13385 Propagate its inclusion instead of prototypes and `extern'.
13386 * src/lalr.c: Formatting changes, topological sorting etc.
13387
133882000-10-02 Akim Demaille <akim@epita.fr>
13389
13390 * src/output.c (token_actions): Introduce a temporary array,
13391 YYDEFACT, that makes it possible for this function to use
13392 output_short_table.
13393
133942000-10-02 Akim Demaille <akim@epita.fr>
13395
13396 `user_toknums' is output as a `short[]' in `output.c', while it is
13397 defined as a `int[]' in `reader.c'. For consistency with the
13398 other output tables, `user_toknums' is now defined as a table of
13399 shorts.
13400
13401 * src/reader.c (user_toknums): Be a short table instead of an int
13402 table.
13403 Adjust dependencies.
13404
13405 Factor the short table outputs.
13406
13407 * src/output.c (output_short_table): New function.
13408 * src/output.c (output_gram, output_stos, output_rule_data)
13409 (output_base, output_table, output_check): Use it.
13410
134112000-10-02 Akim Demaille <akim@epita.fr>
13412
13413 * src/output.c (output): Topological sort of the functions, in
13414 order to get rid of the `static' prototypes.
13415 No longer use `register'.
13416 * src/output.h: New file.
13417 Propagate its inclusion in files explicitly prototyping functions
13418 from output.c.
13419
134202000-09-21 Akim Demaille <akim@epita.fr>
13421
13422 * src/atgeneral.m4: Update from Autoconf.
13423
134242000-09-21 Akim Demaille <akim@epita.fr>
13425
13426 * src/closure.h: New file.
13427 * src/closure.c: Formatting changes, topological sort over the
13428 functions, use of closure.h.
13429 (initialize_closure, finalize_closure): Rename as...
13430 (new_closure, free_closure): these. Adjust dependencies.
13431 * src/LR0.c: Formatting changes, topological sort, use of
13432 cloture.h.
13433 (initialize_states): Rename as...
13434 (new_states): this.
13435 * src/Makefile.am (noinst_HEADERS): Adjust.
13436
134372000-09-20 Akim Demaille <akim@epita.fr>
13438
13439 * src/acconfig.h: Don't protect config.h against multiple
13440 inclusion.
13441 Don't define PARAMS.
13442 * src/system.h: Define PARAMS.
13443 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
13444 purpose of config.h. system.h must not try to fix wrong
13445 definitions in config.h.
13446
134472000-09-20 Akim Demaille <akim@epita.fr>
13448
13449 * src/derives.h: New file.
13450 * src/main.c, src/derives.h: Use it.
13451 Formatting changes.
13452 * src/Makefile.am (noinst_HEADERS): Adjust.
13453
134542000-09-20 Akim Demaille <akim@epita.fr>
13455
13456 * tests/atgeneral.m4: Update from Autoconf.
13457 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
13458 (AT_CHECK_CALC): New macros.
13459 Use these macros to test bison with options `', `--raw',
13460 `--debug', `--yacc', `--yacc --debug'.
13461
134622000-09-19 Akim Demaille <akim@epita.fr>
13463
13464 * src/output.c: Formatting changes.
13465 * src/machine.h: Remove, leaving its contents in...
13466 * src/system.h: here.
13467 Include stdio.h.
13468 Adjust all dependencies on stdio.h and machine.h.
13469 * src/getargs.h: New file.
13470 Let all `extern' declarations about getargs.c be replaced with
13471 inclusion of `getargs.h'.
13472 * src/Makefile.am (noinst_HEADERS): Adjust.
13473
13474 * tests/calc.m4 (yyin): Be initialized in main, not on the global
13475 scope.
13476 (yyerror): Returns void, not int.
13477 * doc/bison.texinfo: Formatting changes.
13478
134792000-09-19 Akim Demaille <akim@epita.fr>
13480
13481 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
13482 portable.
13483
134842000-09-18 Akim Demaille <akim@epita.fr>
13485
13486 * configure.in: Append WARNING_CFLAGS to CFLAGS.
13487 * src/Makefile.am (INCLUDES): Don't.
13488 Be ready to fetch headers in lib/.
13489
134902000-09-18 Akim Demaille <akim@epita.fr>
13491
13492 * doc/bison.texinfo: Update the copyright.
13493 ANSIfy and GNUify the examples.
13494 Remove the old menu.
13495
134962000-09-18 Akim Demaille <akim@epita.fr>
13497
13498 First set of tests: use the `calc' example from the documentation.
13499
13500 * src/bison.s1 (yyparse): Condition the code using `yytname' which
13501 is defined only when YYDEBUG is.
13502 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
13503 * src/files.c (tryopen, tryclose): Formatting changes.
13504 Move to the top and be static.
13505 * src/reader.c (read_signed_integer): Likewise.
13506 * tests/calc.m4: New file.
13507 * Makefile.am, suite.m4: Adjust.
13508 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
13509
135102000-09-18 Akim Demaille <akim@epita.fr>
13511
13512 Add support for an Autotest test suite for Bison.
13513
13514 * m4/m4.m4, m4/atconfig.m4: New files.
13515 * m4/Makefile.am (EXTRA_DIST): Adjust.
13516 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
13517 files.
13518 * src/getargs.c: Display a more standard --version message.
13519 * src/reader.c (reader): Formatting changes.
13520 No longer depend upon VERSION_STRING.
13521 * configure.in: No longer use `dnl'.
13522 Set up the test suite and the new directory `tests/.
13523 (VERSION_STRING): Remove.
13524
135252000-04-14 Akim Demaille <akim@epita.fr>
13526
13527 * src/reader.c (copy_comment2): New function, same as former
13528 `copy_comment', but outputs into two FILE *.
13529 (copy_comment): Use it.
13530 (parse_union_decl): Use it.
13531 (get_type, parse_start_decl): Use the same `invalid' message.
13532 (parse_start_decl, parse_union_decl): Use the same `multiple'
13533 message.
13534 (parse_union_decl, copy_guard, copy_action): Use the same
13535 `unmatched' message.
13536 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
13537
135382000-03-31 Akim Demaille <akim@epita.fr>
13539
13540 * src/files.c (tryopen, tryclose): Move to the top.
13541 Be static.
13542
135432000-03-31 Akim Demaille <akim@epita.fr>
13544
13545 * src/main.c (main): Don't call `done', exit does it.
13546
135472000-03-31 Akim Demaille <akim@epita.fr>
13548
13549 * allocate.c: s/return (foo)/return foo/.
13550 * lalr.c: Likewise.
13551 * LR0.c: Likewise.
13552 * output.c: Likewise.
13553 * reader.c: Likewise.
13554 * symtab.c: Likewise.
13555 * vmsgetargs.c: Likewise.
13556
135572000-03-31 Akim Demaille <akim@epita.fr>
13558
13559 Clean up the error reporting functions.
13560
13561 * src/report.c: New file.
13562 * src/report.h: Likewise.
13563 * src/Makefile.am: Adjust.
13564 * m4/error.m4: New file.
13565 * m4/Makefile.am: Adjust.
13566 * configure.in (jm_PREREQ_ERROR): Call it.
13567 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
13568 Remove.
13569 (fatal, fatals): Remove. All callers use complain.c::fatal.
13570 (warn, warni, warns, warnss, warnss): Remove. All callers use
13571 complain.c::complain.
13572 (toomany): Remove, use fatal instead.
13573 * src/files.c (done): No argument, use complain_message_count.
13574 * src/main.c (main): Register `done' to `atexit'.
13575
13576 * src/getargs.c (usage): More `fputs', less `fprintf'.
13577
135782000-03-28 Akim Demaille <akim@epita.fr>
13579
13580 * lib/: New directory.
13581 * Makefile.am (SUBDIRS): Adjust.
13582 * configure.in: Adjust.
13583 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
13584 useless.
13585 * src/alloca.c: Moved to lib/.
13586 * src/getopt.c: Likewise.
13587 * src/getopt1.c: Likewise.
13588 * src/getopt.h: Likewise.
13589 * src/ansi2knr.c: Likewise.
13590 * src/ansi2knr.1: Likewise.
13591 * src/Makefile.am: Adjust.
13592 * lib/Makefile.am: New file.
13593
135942000-03-28 Akim Demaille <akim@epita.fr>
13595
13596 * src/getargs.c (usage): Refresh the help message.
13597
135982000-03-17 Akim Demaille <akim@epita.fr>
13599
13600 * src/getopt1.c: Updated from textutils 2.0e
13601 * src/getopt.c: Likewise.
13602 * src/getopt.h: Likewise.
13603
136042000-03-17 Akim Demaille <akim@epita.fr>
13605
13606 * src/Makefile.am (bison.simple): Fix the awk program: quote only
13607 the file name, not the whole `#line LINE FILE'.
13608
136092000-03-17 Akim Demaille <akim@epita.fr>
13610
13611 On syntax errors, report the token on which we choked.
13612
13613 * src/bison.s1 (yyparse): In the label yyerrlab, when
13614 YYERROR_VERBOSE, add yychar in msg.
13615
136162000-03-17 Akim Demaille <akim@epita.fr>
13617
13618 * src/reader.c (copy_at): New function.
13619 (copy_guard): Use it.
13620 (copy_action): Use it.
13621
136222000-03-17 Akim Demaille <akim@epita.fr>
13623
13624 Be kind to translators, save some useless translations.
13625
13626 * src/main.c (banner): New function.
13627 (fatal_banner): Use it.
13628 (warn_banner): Use it.
13629
136302000-03-17 Akim Demaille <akim@epita.fr>
13631
13632 * src/reader.c (copy_definition): Use copy_string and
13633 copy_comment. Removed now unused `match', `ended',
13634 `cplus_comment'.
13635 (copy_comment, copy_string): Moved, to be visible from
13636 copy_definition.
13637
136382000-03-17 Akim Demaille <akim@epita.fr>
13639
13640 * src/reader.c (copy_string): Declare `static inline'. No
13641 problems with inline, since it is checked by configure.
13642 (copy_comment): Likewise.
13643
136442000-03-17 Akim Demaille <akim@epita.fr>
13645
13646 * src/reader.c (packsymbols): Formatting changes.
13647
136482000-03-17 Akim Demaille <akim@epita.fr>
13649
13650 * src/reader.c (copy_comment): New function, factored out from:
13651 (copy_action): Use it. Removed now unused `match', `ended',
13652 `cplus_comment'.
13653 (copy_guard): Likewise.
13654
136552000-03-17 Akim Demaille <akim@epita.fr>
13656
13657 * src/reader.c (copy_string): New function, factored out from:
13658 (copy_action): Use it.
13659 (copy_guard): Likewise.
13660
136612000-03-17 Akim Demaille <akim@epita.fr>
13662
13663 Change the handling of @s so that they behave exactly like $s.
13664 There is now a pseudo variable @$ (readble and writable), location
13665 of the lhs of the rule (by default ranging from the location of
13666 the first symbol of the rhs, to the location of the last symbol,
13667 or, if the rhs is empty, YYLLOC).
13668
13669 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
13670 yyval.
13671 (yyparse): When providing a default semantic action, provide a
13672 default location action.
13673 (after the $): No longer change `*YYLSP', just stack YYLOC the
13674 same way you stack YYVAL.
13675 * src/reader.c (read_declarations): Use warns.
13676 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
13677 (copy_action, case '@'): Likewise.
13678 Use a standard error message, to save useless work from
13679 translators.
13680
136812000-03-17 Akim Demaille <akim@epita.fr>
13682
13683 * src/bison.s1: Formatting and cosmetics changes.
13684 * src/reader.c: Likewise.
13685 Update the Copyright notice.
13686
136872000-03-17 Akim Demaille <akim@epita.fr>
13688
13689 * src/bison.s1 (#line): All set to `#line' only, since the
13690 Makefile now handles them.
13691
136922000-03-16 Akim Demaille <akim@epita.fr>
13693
13694 * src/output.c (output_rule_data): Output the documentation of
13695 some of the tables.
13696 (Copyright notice): Update.
13697 Formatting changes.
13698
136992000-03-16 Akim Demaille <akim@epita.fr>
13700
13701 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
13702 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
13703 One `#if YYDEBUG' remains, since it uses variables which are
13704 defined only if `YYDEBUG != 0'.
13705
137062000-03-16 Akim Demaille <akim@epita.fr>
13707
13708 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
13709 and related variables so that the similarities are highlighted.
13710
137112000-03-16 Akim Demaille <akim@epita.fr>
13712
13713 * src/bison.s1: Properly indent CPP directives.
13714
137152000-03-16 Akim Demaille <akim@epita.fr>
13716
13717 * src/bison.s1: Properly indent the `alloca' CPP section.
13718
137192000-03-16 Akim Demaille <akim@epita.fr>
13720
13721 Do not hard code values of directories in `configure.in'.
13722 Update the `configure' tool chain.
13723
13724 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
13725 src/makefile.am.
13726 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
13727 (AC_OUTPUT): Add m4/Makefile.
13728 Bump to bison 1.28a, 1.29 has never been released.
13729 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
13730 handled via src/Makefile.am.
13731 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
13732 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
13733 autoheader.
13734 * Makefile.am (SUBDIRS): Add m4.
13735 (ACLOCAL_AM_FLAGS): New variable.
13736 (AUTOMAKE_OPTIONS): Add check-news.
13737 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
13738 the proper line number and file name.
13739 (DEFS): Propagate the location of bison library files and of the
13740 locale files.
13741 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
13742 builddir.
13743 * acinclude.m4: Remove, replaced by the directory m4.
13744 * m4/Makefile.am (EXTRA_DIST): New variable.
13745 * m4/gettext.m4: New file, from the fileutils.
13746 * m4/lcmessage.m4: Likewise
13747 * m4/progtest.m4: Likewise.
13748 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
13749
137502000-03-10 Akim Demaille <akim@epita.fr>
13751
13752 * src/closure.c:
13753 Formatting changes of various comments.
13754 Respect the GNU coding standards at various places.
13755 Don't use `_()' when no translation is needed.
13756
137571999-12-13 Jesse Thilo <jthilo@gnu.org>
13758
13759 * src/files.c:
13760 OS/2 honors TMPDIR environment variable.
13761
137621999-12-13 Jesse Thilo <jthilo@gnu.org>
13763
13764 * doc/bison.texinfo: Tweaked spelling and grammar.
13765 Updated ISBN.
13766 Removed reference to price of printed copy.
13767 Mention BISON_SIMPLE and BISON_HAIRY.
13768
137691999-12-13 Jesse Thilo <jthilo@gnu.org>
13770
13771 * configure.in, NEWS:
13772 Bison 1.29 released.
13773
137741999-10-27 Jesse Thilo <jthilo@gnu.org>
13775
13776 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
13777 Added reference card.
13778
137791999-07-26 Jesse Thilo <jthilo@gnu.org>
13780
13781 * po/ru.po: Added Russian translation.
13782
137831999-07-26 Jesse Thilo <jthilo@gnu.org>
13784
13785 * configure.in: Added Russian translation.
13786
137871999-07-06 Jesse Thilo <jthilo@gnu.org>
13788
13789 * configure.in, NEWS, README:
13790 Released version 1.28.
13791
137921999-06-14 Jesse Thilo <jthilo@gnu.org>
13793
13794 * src/system.h:
13795 Squashed redefinition warning on some systems.
13796
13797 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
13798 Have configure build version string instead of relying on ANSI string
13799 concatentation.
13800
138011999-06-14 Jesse Thilo <jthilo@gnu.org>
13802
13803 * po/POTFILES.in: Got rid of version.c.
13804
138051999-06-14 Jesse Thilo <jthilo@gnu.org>
13806
13807 * acconfig.h, configure.in:
13808 Have configure build version string instead of relying on ANSI string
13809 concatentation.
13810
138111999-06-08 Jesse Thilo <jthilo@gnu.org>
13812
13813 * doc/bison.1:
13814 Dropped mention of `+' for long-named options.
13815
138161999-05-30 Jesse Thilo <jthilo@gnu.org>
13817
13818 * src/files.c: Added <unistd.h> for unlink().
13819
13820 * src/Makefile.am, src/system.h:
13821 I18n fixes.
13822
138231999-05-30 Jesse Thilo <jthilo@gnu.org>
13824
13825 * README: Added a FAQ list.
13826
13827 * configure.in, acconfig.h:
13828 I18n fixes.
13829
138301999-05-30 Jesse Thilo <jthilo@gnu.org>
13831
13832 * doc/FAQ, doc/Makefile.am:
13833 Added a FAQ list.
13834
138351999-05-19 Jesse Thilo <jthilo@gnu.org>
13836
13837 * src/alloc.h, src/symtab.h, src/version.c:
13838 Protected inclusion of "config.h" with HAVE_CONFIG_H.
13839
138401999-04-18 Jesse Thilo <jthilo@gnu.org>
13841
13842 * src/.cvsignore, src/Makefile.am:
13843 Reorganized: sources in `src', documentation in `doc'.
13844
13845 * src/lex.c (literalchar):
13846 fixed the code for escaping double quotes (thanks
13847 Jonathan Czisny.)
13848
138491999-04-18 Jesse Thilo <jthilo@gnu.org>
13850
13851 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
13852 Adjusted paths to reflect directory reorganization.
13853
138541999-04-18 Jesse Thilo <jthilo@gnu.org>
13855
13856 * doc/.cvsignore, doc/Makefile.am:
13857 Reorganized: sources in `src', documentation in `doc'.
13858
138591999-04-18 Jesse Thilo <jthilo@gnu.org>
13860
13861 * configure.in:
13862 Updated AC_INIT file to reflect directory reorganization.
13863
13864 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
13865 Reorganized: sources in `src', documentation in `doc'.
13866
138671999-04-13 Jesse Thilo <jthilo@gnu.org>
13868
13869 * src/allocate.c:
13870 Don't declare calloc() and realloc() if not necessary.
13871
138721999-04-13 Jesse Thilo <jthilo@gnu.org>
13873
13874 * configure.in, acconfig.h, acinclude.m4:
13875 Don't declare calloc() and realloc() if not necessary.
13876
138771999-03-23 Jesse Thilo <jthilo@gnu.org>
13878
13879 * po/.cvsignore: Added i18n support.
13880
138811999-03-23 Jesse Thilo <jthilo@gnu.org>
13882
13883 * acconfig.h, configure.in, Makefile.am:
13884 Added i18n support.
13885
138861999-03-22 Jesse Thilo <jthilo@gnu.org>
13887
13888 * src/bison.s1: Fixed #line numbers.
13889
138901999-03-15 Jesse Thilo <jthilo@gnu.org>
13891
13892 * po/es.po, po/fr.po, po/nl.po, po/de.po:
13893 Added PO files from Translation Project.
13894
138951999-03-03 Jesse Thilo <jthilo@gnu.org>
13896
13897 * Makefile.am:
13898 Added support for non-ANSI compilers (ansi2knr).
13899
139001999-02-16 Jesse Thilo <jthilo@gnu.org>
13901
13902 * configure.in: Bumped version number to 1.27.
13903
13904 * Makefile.am:
13905 Added `bison.simple' to list of files removed by `make distclean'.
13906
139071999-02-12 Jesse Thilo <jthilo@gnu.org>
13908
13909 * src/files.c, src/files.h:
13910 Defined locations of parser files in config.h instead of Makefile.
13911
139121999-02-12 Jesse Thilo <jthilo@gnu.org>
13913
13914 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
13915 Defined locations of parser files in config.h instead of Makefile.
13916
139171999-02-09 Jesse Thilo <jthilo@gnu.org>
13918
13919 * Makefile.am:
13920 Removed inappropriate use of $< macro.
13921
139221999-02-05 Jesse Thilo <jthilo@gnu.org>
13923
13924 * po/Makefile.in.in, po/POTFILES.in:
13925 Add `po' directory skeleton.
13926
139271999-01-27 Jesse Thilo <jthilo@gnu.org>
13928
13929 * README: Document help-bison list.
13930
13931 * configure.in: Add check for mkstemp().
13932
139331999-01-20 Jesse Thilo <jthilo@gnu.org>
13934
13935 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
13936 Hush a few compiler warnings.
13937
13938 * src/files.c:
13939 Add tryclose(), which verifies that fclose was successful.
13940 Hush a couple of compiler warnings.
13941
139421999-01-20 Jesse Thilo <jthilo@gnu.org>
13943
13944 * Makefile.am, OChangeLog:
13945 ChangeLog is now automatically generated. Include the old version as
13946 OChangeLog.
13947
139481999-01-14 Jesse Thilo <jthilo@gnu.org>
13949
13950 * 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:
13951 Update FSF address.
13952
139531999-01-14 Jesse Thilo <jthilo@gnu.org>
13954
13955 * doc/bison.texinfo: Fix formatting glitch.
13956
13957 * doc/bison.texinfo: Update FSF address.
13958
139591999-01-14 Jesse Thilo <jthilo@gnu.org>
13960
13961 * acconfig.h: Update FSF address.
13962
139631999-01-08 Jesse Thilo <jthilo@gnu.org>
13964
13965 * src/system.h:
13966 Don't define PACKAGE here, since config.h defines it.
13967
139681998-12-30 Jesse Thilo <jthilo@gnu.org>
13969
13970 * src/reader.c: Update copyright date.
13971
13972 * src/main.c:
13973 Ditch sprintf to statically-sized buffers in fatal/warn functions in
13974 favor of output directly to stderr (avoids buffer overruns).
13975
13976 * src/reader.c: Some checks for premature EOF.
13977
13978 * 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:
13979 Use prototypes if the compiler understands them.
13980
13981 * src/files.c: Honor TMPDIR on Unix hosts.
13982 Use prototypes if the compiler understands them.
13983
13984 * src/reader.c:
13985 Fix a couple of buffer overrun bugs.
13986 Use prototypes if the compiler understands them.
13987
13988 * src/system.h: Include unistd.h and ctype.h.
13989 Use #ifdef instead of #if for NLS symbols.
13990
139911998-12-30 Jesse Thilo <jthilo@gnu.org>
13992
13993 * doc/bison.texinfo:
13994 Delete comment "consider using @set for edition number, etc..." since
13995 we now are doing so.
13996
139971998-12-30 Jesse Thilo <jthilo@gnu.org>
13998
13999 * configure.in:
14000 Use prototypes if the compiler understands them.
14001
14002 * NEWS: Document 1.26 highlights.
14003
14004 * Makefile.am: Require Automake 1.3 or later.
14005
14006 * acconfig.h:
14007 Use prototypes if the compiler understands them.
14008
140091998-12-29 Jesse Thilo <jthilo@gnu.org>
14010
14011 * src/version.c:
14012 Use VERSION symbol from automake for version number.
14013
140141998-12-29 Jesse Thilo <jthilo@gnu.org>
14015
14016 * acconfig.h, configure.in, version.cin:
14017 Use VERSION symbol from automake for version number.
14018
140191998-11-28 Jesse Thilo <jthilo@gnu.org>
14020
14021 * Makefile.am:
14022 Distribute original version of simple parser (bison.s1), not built
14023 version (bison.simple).
14024
140251998-11-28 Jesse Thilo <jthilo@gnu.org>
14026
14027 * doc/bison.texinfo: Add info dir entry.
14028
14029 * doc/bison.texinfo:
14030 Let automake put version number into documentation.
14031
140321998-11-26 Jesse Thilo <jthilo@gnu.org>
14033
14034 * src/bison.cld, src/build.com, src/vmshlp.mar:
14035 Add non-RCS files from /gd/gnu/bison.
14036
140371998-11-26 Jesse Thilo <jthilo@gnu.org>
14038
14039 * doc/bison.1:
14040 Document the BISON_HAIRY and BISON_SIMPLE variables.
14041
140421998-11-25 Jesse Thilo <jthilo@gnu.org>
14043
14044 * src/version.c: Build version.c automatically.
14045
14046 * src/reader.c:
14047 Fix token numbering (used to start at 258, not 257).
14048
14049 * src/system.h: Include config.h.
14050
14051 * src/getargs.c: Update bug report address.
14052
14053 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
14054 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
14055
140561998-11-25 Jesse Thilo <jthilo@gnu.org>
14057
14058 * Makefile.am:
14059 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
14060
14061 * configure.in, version.cin:
14062 Build version.c automatically.
14063
14064 * AUTHORS: Add AUTHORS file.
14065
14066 * README: Update bug report address.
14067
14068 * bison.simple:
14069 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
14070
14071 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
14072 Add automake stuff.
14073
140741998-11-25 Jesse Thilo <jthilo@gnu.org>
14075
14076 * doc/bison.texinfo: Clean up some formatting.
14077
140781998-05-05 Richard Stallman <rms@gnu.org>
14079
14080 * doc/bison.texinfo:
14081 Explain better why to make a pure parser.
14082
140831998-01-05 Richard Stallman <rms@gnu.org>
14084
14085 * src/files.c (openfiles):
14086 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
14087 find a temporary directory, if possible. Do not unlink files while
14088 they are open.
14089
140901997-08-25 Richard Stallman <rms@gnu.org>
14091
14092 * src/reader.c (stack_offset;):
14093 Change some warni to warns.
14094
14095 * src/lex.c (literalchar): Use warns, not warni.
14096
140971997-06-28 Richard Stallman <rms@gnu.org>
14098
14099 * src/bison.s1: Add a Bison version comment.
14100
14101 * src/main.c (fatal, warn, berror):
14102 Use program_name.
14103
141041997-06-28 Richard Stallman <rms@gnu.org>
14105
14106 * Makefile.in (bison_version): New variable.
14107 (dist): Use that variable.
14108 (bison.s1): Substitute the Bison version into bison.simple.
14109
14110 * bison.simple: Add a Bison version comment.
14111
141121997-06-18 Richard Stallman <rms@gnu.org>
14113
14114 * src/main.c (fatal, warn, berror):
14115 Make error messages standard.
14116 (toomany): Improve error message text.
14117
14118 * 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:
14119 new.h renamed to alloc.h.
14120
141211997-06-18 Richard Stallman <rms@gnu.org>
14122
14123 * Makefile.in: new.h renamed to alloc.h.
14124
141251997-05-24 Richard Stallman <rms@gnu.org>
14126
14127 * src/lex.c (literalchar):
14128 Fix the code for escaping \, " and '.
14129
14130 (lex): Avoid trouble when there are many chars
14131 to discard in a char literal with just several chars in it.
14132
141331997-05-17 Richard Stallman <rms@gnu.org>
14134
14135 * src/bison.s1:
14136 Use malloc, if using alloca is troublesome.
14137 (YYSTACK_USE_ALLOCA): New flag macro.
14138 Define it for some systems and compilers.
14139 (YYSTACK_ALLOC): New macro.
14140 (yyparse): Use YYSTACK_ALLOC to allocate stack.
14141 If it was malloc'd, free it.
14142
141431997-05-17 Richard Stallman <rms@gnu.org>
14144
14145 * bison.simple:
14146 Use malloc, if using alloca is troublesome.
14147 (YYSTACK_USE_ALLOCA): New flag macro.
14148 Define it for some systems and compilers.
14149 (YYSTACK_ALLOC): New macro.
14150 (yyparse): Use YYSTACK_ALLOC to allocate stack.
14151 If it was malloc'd, free it.
14152
141531997-04-23 Richard Stallman <rms@gnu.org>
14154
14155 * src/bison.s1:
14156 (alloca) [__hpux]: Always define as __builtin_alloca.
14157
141581997-04-23 Richard Stallman <rms@gnu.org>
14159
14160 * bison.simple:
14161 (alloca) [__hpux]: Always define as __builtin_alloca.
14162
141631997-04-22 Richard Stallman <rms@gnu.org>
14164
14165 * src/bison.s1:
14166 [__hpux]: Include alloca.h (right for HPUX 10)
14167 instead of declaring alloca (right for HPUX 9).
14168
14169 * src/bison.s1 (__yy_memcpy):
14170 Declare arg `count' as unsigned int.
14171 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
14172
141731997-04-22 Richard Stallman <rms@gnu.org>
14174
14175 * bison.simple:
14176 [__hpux]: Include alloca.h (right for HPUX 10)
14177 instead of declaring alloca (right for HPUX 9).
14178
14179 * bison.simple (__yy_memcpy):
14180 Declare arg `count' as unsigned int.
14181 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
14182
141831997-01-03 Richard Stallman <rms@gnu.org>
14184
14185 * src/allocate.c: [__STDC__ or _MSC_VER]:
14186 Declare calloc and realloc to return void *.
14187
141881997-01-02 Richard Stallman <rms@gnu.org>
14189
14190 * src/system.h:
14191 [_MSC_VER]: Include stdlib.h and process.h.
14192 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
14193
14194 * src/main.c (main): Return FAILURE as a value.
14195 (printable_version): Declare arg as int, not char.
14196
141971997-01-02 Richard Stallman <rms@gnu.org>
14198
14199 * Makefile.in (dist):
14200 Explicitly check for symlinks, and copy them.
14201
142021996-12-19 Richard Stallman <rms@gnu.org>
14203
14204 * src/files.c:
14205 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
14206
142071996-12-18 Paul Eggert <eggert@gnu.org>
14208
14209 * src/bison.s1 (yyparse):
14210 If __GNUC__ and YYPARSE_PARAM are both defined,
14211 declare yyparse to have a void * argument.
14212
142131996-12-18 Paul Eggert <eggert@gnu.org>
14214
14215 * bison.simple (yyparse):
14216 If __GNUC__ and YYPARSE_PARAM are both defined,
14217 declare yyparse to have a void * argument.
14218
142191996-12-17 Richard Stallman <rms@gnu.org>
14220
14221 * src/reduce.c (nbits): Add some casts.
14222
142231996-08-12 Richard Stallman <rms@gnu.org>
14224
14225 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
14226
142271996-08-12 Richard Stallman <rms@gnu.org>
14228
14229 * bison.simple: Test _MSDOS as well as _MSDOS_.
14230
142311996-07-31 Richard Stallman <rms@gnu.org>
14232
14233 * src/bison.s1:
14234 [__sun && __i386]: Include alloca.h.
14235
142361996-07-31 Richard Stallman <rms@gnu.org>
14237
14238 * bison.simple:
14239 [__sun && __i386]: Include alloca.h.
14240
142411996-07-30 Richard Stallman <rms@gnu.org>
14242
14243 * src/bison.s1: Comment change.
14244
14245 * src/bison.s1: Test _MSDOS_, not MSDOS.
14246
142471996-07-30 Richard Stallman <rms@gnu.org>
14248
14249 * bison.simple: Comment change.
14250
14251 * bison.simple: Test _MSDOS_, not MSDOS.
14252
142531996-06-01 Richard Stallman <rms@gnu.org>
14254
14255 * 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:
14256 Insert `_' macro around many string constants.
14257
14258 * src/main.c:
14259 Insert `_' macro around many string constants.
14260
14261 (main): Call setlocale, bindtextdomain and textdomain.
14262
14263 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
14264 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
14265 [ENABLE_NLS]: Include libintl.h.
14266 [ENABLE_NLS] (gettext): Define.
14267 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
14268 (N_, PACKAGE, LOCALEDIR): New macros.
14269
142701996-06-01 Richard Stallman <rms@gnu.org>
14271
14272 * POTFILES.in: New file.
14273
14274 * Makefile.in (allocate.o):
14275 Define target explicitly.
14276
14277 * Makefile.in (CFLAGS): Set to @CFLAGS@.
14278 (LDFLAGS): Set to @LDFLAGS@.
14279 (configure): Run autoconf only if preceding `cd' succeeds.
14280 (bison.s1): Redirect output to temporary file then move the
14281 temporary to the target, rather than redirecting directly to bison.s1.
14282 (clean): Remove config.status and config.log.
14283 (distclean): Don't remove config.status here.
14284
142851996-05-12 Richard Stallman <rms@gnu.org>
14286
14287 * src/bison.s1:
14288 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
14289
142901996-05-12 Richard Stallman <rms@gnu.org>
14291
14292 * bison.simple:
14293 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
14294
142951996-05-11 Richard Stallman <rms@gnu.org>
14296
14297 * src/bison.s1 (__yy_memcpy):
14298 Really reorder the args, as was supposedly done on Feb 14 1995.
14299 (yyparse): Calls changed accordingly.
14300
143011996-05-11 Richard Stallman <rms@gnu.org>
14302
14303 * Makefile.in (dist): Don't use $(srcdir).
14304
14305 * bison.simple (__yy_memcpy):
14306 Really reorder the args, as was supposedly done on Feb 14 1995.
14307 (yyparse): Calls changed accordingly.
14308
143091996-01-27 Richard Stallman <rms@gnu.org>
14310
14311 * src/output.c (output_rule_data):
14312 Test YYERROR_VERBOSE in the conditional
14313 around the definition of ttyname.
14314
143151995-12-29 Richard Stallman <rms@gnu.org>
14316
14317 * src/bison.s1:
14318 Fix line numbers in #line commands.
14319
143201995-12-29 Richard Stallman <rms@gnu.org>
14321
14322 * bison.simple:
14323 Fix line numbers in #line commands.
14324
143251995-12-27 Richard Stallman <rms@gnu.org>
14326
14327 * src/bison.s1 (YYPARSE_PARAM_DECL):
14328 In C++, make it always null.
14329 (YYPARSE_PARAM_ARG): New macro.
14330 (yyparse): Use YYPARSE_PARAM_ARG.
14331
143321995-12-27 Richard Stallman <rms@gnu.org>
14333
14334 * bison.simple (YYPARSE_PARAM_DECL):
14335 In C++, make it always null.
14336 (YYPARSE_PARAM_ARG): New macro.
14337 (yyparse): Use YYPARSE_PARAM_ARG.
14338
143391995-11-29 Richard Stallman <rms@gnu.org>
14340
14341 * doc/bison.texinfo:
14342 Describe literal string tokens, %raw, %no_lines, %token_table.
14343
143441995-11-29 Daniel Hagerty <hag@gnu.org>
14345
14346 * doc/bison.texinfo: Fixed update date
14347
143481995-10-16 Richard Stallman <rms@gnu.org>
14349
14350 * src/version.c: Version 1.25.
14351
143521995-10-16 Richard Stallman <rms@gnu.org>
14353
14354 * NEWS: *** empty log message ***
14355
143561995-10-16 Richard Stallman <rms@gnu.org>
14357
14358 * doc/bison.1, doc/bison.rnh:
14359 Add new options.
14360
143611995-10-15 Richard Stallman <rms@gnu.org>
14362
14363 * src/vmsgetargs.c, src/getargs.c:
14364 Added -n, -k, and -raw switches.
14365 (noparserflag, toknumflag, rawtoknumflag): New variables.
14366
14367 * src/symtab.h (SALIAS):
14368 New #define for adding aliases to %token.
14369 (struct bucket): Added `alias' field.
14370
14371 * src/reduce.c (reduce_grammar):
14372 Revise error message.
14373 (print_notices): Remove final `.' from error message.
14374
14375 * src/reader.c (reader_output_yylsp):
14376 New function.
14377 (readgram): Use `#if 0' around code that accepted %command
14378 inside grammar rules: The documentation doesn't allow it,
14379 and it will fail since the %command processors scan for the next %.
14380 (parse_token_decl): Extended the %token
14381 declaration to allow a multi-character symbol as an alias.
14382 (parse_thong_decl): New function.
14383 (read_declarations): Added %thong declarations.
14384 (read_declarations): Handle NOOP to deal with allowing
14385 % declarations as another means to specify the flags.
14386 (readgram): Allow %prec prior to semantics embedded in a rule.
14387 (skip_to_char, read_declarations, copy_definition)
14388 (parse_token_decl, parse_start_decl, parse_type_decl)
14389 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
14390 (get_type_name, copy_guard, copy_action, readgram)
14391 (get_type, packsymbols): Revised most error messages.
14392 Changed `fatal' to `warnxxx' to avoid aborting for error.
14393 Revised and use multiple warnxxx functions to avoid using VARARGS1.
14394 (read_declarations): Improve the error message for
14395 an invalid character. Do not abort.
14396 (read_declarations, copy_guard, copy_action): Use
14397 printable_version to avoid unprintable characters in printed output.
14398 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
14399 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
14400 Allow the type of a non-terminal can be given
14401 more than once, as long as all specifications give the same type.
14402
14403 * src/output.c:
14404 (output_headers, output_trailers, output, output_gram)
14405 (output_rule_data): Implement noparserflag variable.
14406 Implement toknumflag variable.
14407 (output): Call reader_output_yylsp to output LTYPESTR.
14408
14409 * src/main.c (main):
14410 If reader sees an error, don't process the grammar.
14411 (fatals): Updated to not use VARARGS1.
14412 (printable_version, int_to_string, warn, warni, warns, warnss)
14413 (warnsss): New error reporting functions. Avoid abort for error.
14414
14415 * src/lex.h:
14416 Added THONG and NOOP for alias processing.
14417 Added SETOPT for the new code that allows setting options with %flags.
14418
14419 * src/lex.c:
14420 Include getopt.h. Add some extern decls.
14421 (safegetc): New function to deal with EOF gracefully.
14422 (literalchar); new function to deal with reading \ escapes.
14423 (lex): Use literalchar.
14424 (lex): Implemented "..." tokens.
14425 (literalchar, lex, parse_percent_token): Made tokenbuffer
14426 always contain the token. This includes growing the token
14427 buffer while reading an integer.
14428 (parse_percent_token): Replaced if-else statement with percent_table.
14429 (parse_percent_token): Added % declarations as another
14430 way to specify the flags -n, -l, and -r. Also added hooks for
14431 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
14432 major changes to files.c.
14433 (lex) Retain in the incoming stream a character following
14434 an incorrect '/'.
14435 (skip_white_space, lex): Revised most error messages
14436 and changed fatal to warn to avoid aborting.
14437 (percent_table): Added %thong declarations.
14438
14439 * src/gram.h: Comment changes.
14440
14441 * src/files.c (openfiles, open_extra_files, done):
14442 Add faction flag
14443 and actfile file. Handle noparserflag. Both for -n switch.
14444
14445 * src/conflicts.c (resolve_sr_conflict):
14446 Remove use of alloca.
14447
144481995-06-01 Jim Meyering <meyering@gnu.org>
14449
14450 * doc/bison.texinfo: *** empty log message ***
14451
144521995-05-06 Richard Stallman <rms@gnu.org>
14453
14454 * src/bison.s1: Comment change.
14455
144561995-05-06 Richard Stallman <rms@gnu.org>
14457
14458 * bison.simple: Comment change.
14459
144601995-05-03 Richard Stallman <rms@gnu.org>
14461
14462 * src/version.c: Version now 1.24.
14463
14464 * src/bison.s1: Change distribution terms.
14465
14466 * src/version.c: Version now 1.23.
14467
144681995-05-03 Richard Stallman <rms@gnu.org>
14469
14470 * doc/bison.texinfo:
14471 Rewrite "Conditions for Using Bison".
14472 Update version to 1.24.
14473
144741995-05-03 Richard Stallman <rms@gnu.org>
14475
14476 * bison.simple: Change distribution terms.
14477
144781995-02-23 Richard Stallman <rms@gnu.org>
14479
14480 * src/files.c: Test __VMS_POSIX as well as VMS.
14481
144821995-02-14 Jim Meyering <meyering@gnu.org>
14483
14484 * src/bison.s1 (__yy_memcpy):
14485 Renamed from __yy_bcopy to avoid
14486 confusion. Reverse FROM and TO arguments to be consistent with
14487 those of memcpy.
14488
144891995-02-14 Jim Meyering <meyering@gnu.org>
14490
14491 * bison.simple (__yy_memcpy):
14492 Renamed from __yy_bcopy to avoid
14493 confusion. Reverse FROM and TO arguments to be consistent with
14494 those of memcpy.
14495
144961994-11-10 David J. MacKenzie <djm@gnu.org>
14497
14498 * NEWS: reformat
14499
14500 * NEWS: New file.
14501
14502 * Makefile.in (DISTFILES): Include NEWS.
14503
14504 * Makefile.in (DISTFILES):
14505 Include install-sh, not install.sh.
14506
14507 * configure.in: Update to Autoconf v2 macro names.
14508
145091994-10-05 David J. MacKenzie <djm@gnu.org>
14510
14511 * Makefile.in: fix typo
14512
14513 * Makefile.in (prefix, exec_prefix):
14514 Let configure set them.
14515
145161994-09-28 David J. MacKenzie <djm@gnu.org>
14517
14518 * Makefile.in: Set datadir to $(prefix)/share.
14519
145201994-09-15 Richard Stallman <rms@gnu.org>
14521
14522 * src/bison.s1:
14523 Update copyright notice and GPL version.
14524
145251994-09-15 Richard Stallman <rms@gnu.org>
14526
14527 * bison.simple:
14528 Update copyright notice and GPL version.
14529
145301994-07-12 Richard Stallman <rms@gnu.org>
14531
14532 * src/reduce.c, src/reader.c:
14533 entered into RCS
14534
145351994-05-05 David J. MacKenzie <djm@gnu.org>
14536
14537 * Makefile.in: entered into RCS
14538
145391994-03-26 Richard Stallman <rms@gnu.org>
14540
14541 * src/bison.s1: entered into RCS
14542
145431994-03-26 Richard Stallman <rms@gnu.org>
14544
14545 * bison.simple: entered into RCS
14546
145471994-03-25 Richard Stallman <rms@gnu.org>
14548
14549 * src/main.c: entered into RCS
14550
145511994-03-24 Richard Stallman <rms@gnu.org>
14552
14553 * src/conflicts.c: entered into RCS
14554
145551994-01-02 Richard Stallman <rms@gnu.org>
14556
14557 * Makefile.in: *** empty log message ***
14558
145591993-11-21 Richard Stallman <rms@gnu.org>
14560
14561 * src/bison.s1: *** empty log message ***
14562
145631993-11-21 Richard Stallman <rms@gnu.org>
14564
14565 * doc/bison.texinfo: entered into RCS
14566
14567 * doc/bison.texinfo: *** empty log message ***
14568
145691993-11-21 Richard Stallman <rms@gnu.org>
14570
14571 * bison.simple: *** empty log message ***
14572
145731993-10-25 David J. MacKenzie <djm@gnu.org>
14574
14575 * doc/bison.texinfo: *** empty log message ***
14576
145771993-10-19 Richard Stallman <rms@gnu.org>
14578
14579 * src/bison.s1: *** empty log message ***
14580
145811993-10-19 Richard Stallman <rms@gnu.org>
14582
14583 * bison.simple: *** empty log message ***
14584
145851993-10-14 Richard Stallman <rms@gnu.org>
14586
14587 * src/bison.s1: *** empty log message ***
14588
145891993-10-14 Richard Stallman <rms@gnu.org>
14590
14591 * bison.simple: *** empty log message ***
14592
145931993-09-14 David J. MacKenzie <djm@gnu.org>
14594
14595 * doc/bison.texinfo: *** empty log message ***
14596
145971993-09-13 Noah Friedman <friedman@gnu.org>
14598
14599 * Makefile.in: *** empty log message ***
14600
146011993-09-10 Richard Stallman <rms@gnu.org>
14602
14603 * src/conflicts.c: *** empty log message ***
14604
14605 * src/system.h: entered into RCS
14606
146071993-09-10 Richard Stallman <rms@gnu.org>
14608
14609 * doc/bison.1: entered into RCS
14610
146111993-09-06 Noah Friedman <friedman@gnu.org>
14612
14613 * src/version.c: entered into RCS
14614
146151993-09-06 Noah Friedman <friedman@gnu.org>
14616
14617 * Makefile.in: *** empty log message ***
14618
146191993-07-30 David J. MacKenzie <djm@gnu.org>
14620
14621 * Makefile.in: *** empty log message ***
14622
146231993-07-24 Richard Stallman <rms@gnu.org>
14624
14625 * src/bison.s1: *** empty log message ***
14626
146271993-07-24 Richard Stallman <rms@gnu.org>
14628
14629 * bison.simple: *** empty log message ***
14630
146311993-07-08 David J. MacKenzie <djm@gnu.org>
14632
14633 * Makefile.in: *** empty log message ***
14634
146351993-07-04 Richard Stallman <rms@gnu.org>
14636
14637 * src/bison.s1: *** empty log message ***
14638
146391993-07-04 Richard Stallman <rms@gnu.org>
14640
14641 * bison.simple: *** empty log message ***
14642
146431993-06-26 David J. MacKenzie <djm@gnu.org>
14644
14645 * src/getargs.c: entered into RCS
14646
146471993-06-26 David J. MacKenzie <djm@gnu.org>
14648
14649 * doc/bison.texinfo: *** empty log message ***
14650
14651 * doc/bison.1: New file.
14652
146531993-06-25 Richard Stallman <rms@gnu.org>
14654
14655 * src/getargs.c: New file.
14656
146571993-06-16 Richard Stallman <rms@gnu.org>
14658
14659 * src/bison.s1: *** empty log message ***
14660
146611993-06-16 Richard Stallman <rms@gnu.org>
14662
14663 * bison.simple: *** empty log message ***
14664
146651993-06-03 Richard Stallman <rms@gnu.org>
14666
14667 * src/bison.s1: New file.
14668
146691993-06-03 Richard Stallman <rms@gnu.org>
14670
14671 * doc/bison.texinfo: *** empty log message ***
14672
146731993-06-03 Richard Stallman <rms@gnu.org>
14674
14675 * bison.simple: New file.
14676
146771993-05-19 Richard Stallman <rms@gnu.org>
14678
14679 * doc/bison.texinfo: New file.
14680
146811993-05-07 Noah Friedman <friedman@gnu.org>
14682
14683 * Makefile.in: *** empty log message ***
14684
146851993-04-28 Noah Friedman <friedman@gnu.org>
14686
14687 * src/reader.c: *** empty log message ***
14688
146891993-04-23 Noah Friedman <friedman@gnu.org>
14690
14691 * src/alloc.h: entered into RCS
14692
146931993-04-20 David J. MacKenzie <djm@gnu.org>
14694
14695 * src/version.c: *** empty log message ***
14696
14697 * src/files.c, src/allocate.c:
14698 entered into RCS
14699
14700 * src/reader.c: *** empty log message ***
14701
14702 * src/lex.c: entered into RCS
14703
14704 * src/conflicts.c: New file.
14705
14706 * src/symtab.c: entered into RCS
14707
14708 * src/alloc.h: New file.
14709
14710 * src/LR0.c: entered into RCS
14711
147121993-04-18 Noah Friedman <friedman@gnu.org>
14713
14714 * src/reader.c: New file.
14715
14716 * src/version.c: *** empty log message ***
14717
147181993-04-18 Noah Friedman <friedman@gnu.org>
14719
14720 * Makefile.in: *** empty log message ***
14721
147221993-04-17 Noah Friedman <friedman@gnu.org>
14723
14724 * Makefile.in: *** empty log message ***
14725
147261993-04-15 Richard Stallman <rms@gnu.org>
14727
14728 * src/main.c, src/files.c:
14729 New file.
14730
147311993-04-15 Noah Friedman <friedman@gnu.org>
14732
14733 * configure.in: entered into RCS
14734
14735 * configure.in: *** empty log message ***
14736
14737 * configure.in: New file.
14738
147391993-04-14 Richard Stallman <rms@gnu.org>
14740
14741 * Makefile.in: New file.
14742
147431993-04-13 Richard Stallman <rms@gnu.org>
14744
14745 * src/version.c: New file.
14746
147471993-03-25 Richard Stallman <rms@gnu.org>
14748
14749 * src/output.c: entered into RCS
14750
147511992-09-25 Richard Stallman <rms@gnu.org>
14752
14753 * configure.bat: entered into RCS
14754
147551992-06-22 Richard Stallman <rms@gnu.org>
14756
14757 * src/vmsgetargs.c: entered into RCS
14758
147591992-06-22 Richard Stallman <rms@gnu.org>
14760
14761 * doc/bison.rnh: entered into RCS
14762
147631992-04-20 David J. MacKenzie <djm@gnu.org>
14764
14765 * README: entered into RCS
14766
147671992-01-22 Richard Stallman <rms@gnu.org>
14768
14769 * src/machine.h: entered into RCS
14770
147711991-12-21 Richard Stallman <rms@gnu.org>
14772
14773 * src/lalr.c, src/closure.c:
14774 entered into RCS
14775
147761991-12-20 Richard Stallman <rms@gnu.org>
14777
14778 * src/state.h: entered into RCS
14779
147801991-12-18 Richard Stallman <rms@gnu.org>
14781
14782 * src/print.c, src/nullable.c, src/derives.c:
14783 entered into RCS
14784
147851991-11-03 David J. MacKenzie <djm@gnu.org>
14786
14787 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
14788 entered into RCS
14789
147901988-09-09 Richard Stallman <rms@gnu.org>
14791
14792 * src/bison.hairy: entered into RCS
14793
147941987-12-16 Richard Stallman <rms@gnu.org>
14795
14796 * REFERENCES: entered into RCS
14797
14798
14799 -----
14800
14801 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
14802 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software
14803 Foundation, Inc.
14804
14805 Copying and distribution of this file, with or without
14806 modification, are permitted provided the copyright notice and this
14807 notice are preserved.