]> git.saurik.com Git - bison.git/blame - ChangeLog
* src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
[bison.git] / ChangeLog
CommitLineData
9e668899
JD
12006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
4 and yytext if they're already #define'd.
5 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
6 * src/scan-code-c.c: ... here.
7 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
8 <config.h>.
9
0c8e079f
JD
102006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
11
12 Get Bison to build again when configured with --enable-gcc-warnings.
13 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
14 missing #include's.
15 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
16 loc argument as it shadows a global.
17 * src/scan-gram.l: Remove stray comma that prevents boundary_set
18 invocation.
19
20 * src/.cvsignore: Add scan-code.c.
21
2346344a
AD
222006-06-07 Akim Demaille <akim@epita.fr>
23
24 * src/scan-gram.l: Move the "add a trailing ; to actions" code
25 to...
26 * src/scan-code.l: here.
27 * tests/input.at (Torturing the Scanner): Fix another location
28 error.
29
4862bdfd
AD
302006-06-07 Akim Demaille <akim@epita.fr>
31
32 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
33
e9071366
AD
342006-06-06 Akim Demaille <akim@epita.fr>
35
36 Extract the parsing of user actions from the grammar scanner.
37 As a consequence, the relation between the grammar scanner and
38 parser is much simpler. We can also split "composite tokens" back
39 into simple tokens.
40 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
41 * src/scan-gram.l (add_column_width, adjust_location): Move to and
42 rename as...
43 * src/location.h, src/location.c (add_column_width)
44 (location_compute): these.
45 Fix the column count: the initial column is 0.
46 (location_print): Be robust to ending column being 0.
47 * src/location.h (boundary_set): New.
48 * src/main.c: Adjust to scanner_free being renamed as
49 gram_scanner_free.
50 * src/output.c: Include scan-code.h.
51 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
52 Use boundary_set.
53 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
54 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
55 which is now, again, a separate token.
56 Adjust all dependencies.
57 Whereever actions with $ and @ are used, use translate_code.
58 (action): Remove this nonterminal which is now useless.
59 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
60 (grammar_current_rule_action_append): Use translate_code.
61 (packgram): Bound check ruleno, itemno, and rule_length.
62 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
63 (last_string, last_braced_code_loc, max_left_semantic_context)
64 (scanner_initialize, scanner_free, scanner_last_string_free)
65 (gram_out, gram_lineno, YY_DECL_): Move to...
66 * src/scan-gram.h: this new file.
67 (YY_DECL): Rename as...
68 (GRAM_DECL): this.
69 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
70 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
71 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
72 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
73 Move these declarations, and...
74 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
75 these to...
76 * src/flex-scanner.h: this new file.
77 * src/scan-gram.l (rule_length, rule_length_overflow)
78 (increment_rule_length): Remove.
79 (last_braced_code_loc): Rename as...
80 (gram_last_braced_code_loc): this.
81 Adjust to the changes of the parser.
82 Move all the handling of $ and @ into...
83 * src/scan-code.l: here.
84 * src/scan-gram.l (handle_dollar, handle_at): Remove.
85 (handle_action_dollar, handle_action_at): Move to...
86 * src/scan-code.l: here.
87 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
88 scan-code.h, scan-code-c.c, scan-gram.h.
89 (EXTRA_bison_SOURCES): Add scan-code.l.
90 (BUILT_SOURCES): Add scan-code.c.
91 (yacc): Be robust to white spaces.
92
93 * tests/conflicts.at, tests/input.at, tests/reduce.at,
94 * tests/regression.at: Adjust the column numbers.
95 * tests/regression.at: Adjust the error message.
7891a7c4 96
184e42f0
JD
972006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
98
99 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
100 Use Akim's wording from
101 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
102
7891a7c4
JD
1032006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
104
105 Between Bison releases, manually append `+' to the previous Bison
106 release number, and use that as a signal to automatically print the
107 ChangeLog's CVS Id keyword from --version. Discussed starting at
108 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
109 * ChangeLog: Add Id header.
110 * configure.ac (AC_INIT): Append `+' to `2.3'.
111 * src/.cvsignore: Add revision.c.
112 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
113 (BUILT_SOURCES): Add revision.c.
114 (revision.c): New target rule. This file defines a new global variable
115 named revision. It initializes it with either the Id from ChangeLog
116 or, if VERSION doesn't contain `+', with the empty string.
117 * src/getargs.c (version): Print the value of revision.
118 * src/revision.h: Extern revision.
119
4ad3ed84
PE
1202006-06-05 Paul Eggert <eggert@cs.ucla.edu>
121
122 * NEWS: Version 2.3.
123 * configure.ac (AC_INIT): Likewise.
124
02103984
PE
1252006-05-30 Paul Eggert <eggert@cs.ucla.edu>
126
127 * data/glr.c (YYRECOVERING): Define to be a function-like macro
128 with no arguments, not as an object-like macro. This is for
129 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
130 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
131 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
132 Document this.
133
2c08afa5
JD
1342006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
135
136 * src/getargs.c (usage): Back out yesterday's modification of the
137 --help output so that we don't have to wait for translation before
138 releasing 2.3.
139
6077da58
PE
1402006-05-29 Paul Eggert <eggert@cs.ucla.edu>
141
142 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
143 Problem reported by Akim Demaille.
144
2a26b6c2
JD
1452006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
146
147 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
148
aefef0d6
PE
1492006-05-26 Paul Eggert <eggert@cs.ucla.edu>
150
151 * data/yacc.c (yy_reduce_print): Omit trailing white space in
152 generated source code. Problem reported by Frans Englich in
153 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
154
fcd8e201
PE
1552006-05-22 Paul Eggert <eggert@cs.ucla.edu>
156
157 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
158 shell, not within 'make', so that 'make' by an ordinary builder
159 (using GNU make) does not worry about configuring gzip. This also
160 works around a bug reported independently by Keith Thompson and by
161 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
162 stderr rather than stdout, messing up the build logs.
163
7b5cdcbd
JD
1642006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
165
166 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
167 to make sure that YYID will never be unused. This fixes a 'make
168 maintainer-check' failure caused by the recent changes to the 'Trivial
169 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
170 not used.
171 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
172
5ad0a449
JD
1732006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
174
175 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
176 state before an empty RHS is always resolved here. Only the location
177 of that state is guaranteed to be resolved, and that's enough. This
178 fixes the remaining bug reported by Derek M. Jones in
179 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
180 * tests/glr-regression.at (Uninitialized location when reporting
181 ambiguity): Test the above case.
182 Also, the embedded comments in this test case claim it checks the case
183 of an empty RHS that has inherited the initial location. However, the
184 corresponding LHS was already resolved, so yyresolveLocations didn't
185 actually have reason to modify it. Fix this by forcing
186 nondeterministic operation at the beginning of the parse.
187
50cce58e
PE
1882006-05-20 Paul Eggert <eggert@cs.ucla.edu>
189
190 * data/c.m4 (b4_yy_symbol_print_generate):
191 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
192 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
193 of the bugs reported today by Derek M Jones in
194 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
195 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
196 defined to be a type name without parens or brackets.
197 (Location Type): Similarly for YYLTYPE.
198 * tests/regression.at (Trivial grammars): Put in a test for this
199 bug that will be caught by 'make maintainer-check' (though not,
200 alas, by 'make check' unless your compiler is picky).
201
ab8d9dc5
PE
2022006-05-19 Paul Eggert <eggert@cs.ucla.edu>
203
0d2c8934 204 * NEWS: Version 2.2.
ab8d9dc5
PE
205 * configure.ac (AC_INIT): Likewise.
206
9138c575
JD
2072006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
208
209 * data/glr.c (yyreportTree): Make room in yystates for the state
210 preceding the RHS. This fixes the segmentation fault reported by Derek
211 M. Jones in
212 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
213 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
214 to the user. Reported for yyreportTree by Derek M. Jones later in the
215 same thread.
216 * THANKS: Add Derek M. Jones.
217 Update my email address.
218 Fix typo in Steve Murphy's name.
219
276f48df
PE
2202006-05-14 Paul Eggert <eggert@cs.ucla.edu>
221
d6645148
PE
222 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
223 checking against YYLAST that caused the parser to miss a potential
224 alternative in its diagnostic.
225 Problem reported by Maria Jose Moron Fernandez in
226 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
227 * data/lalr1.cc (yysyntax_error_): Likewise.
228 * data/yacc.c (yysyntax_error): Likewise.
229 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
230 tokens, in case we run into an older C compiler.
231 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
232 Use them to check for the off-by-one error fixed above.
233
276f48df
PE
234 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
235 YYSIZE_T, not size_t.
236 * tests/regression.at (Trivial grammars): New test, to catch
237 the error fixed by the above patch.
238
cd8b5791
AD
2392006-05-14 Akim Demaille <akim@lrde.epita.fr>
240
241 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
242 scheme.
243 Reported by Steve Murphy.
244
34376418
AD
2452006-05-14 Akim Demaille <akim@lrde.epita.fr>
246
247 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
248 * data/glr.cc: b4_location_flag is now b4_locations_flag.
249
327afc7c
AD
2502006-05-14 Akim Demaille <akim@lrde.epita.fr>
251
252 Implement --trace=m4.
253 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
254 * src/output.c (output_skeleton): When set, pass -dV to m4.
255
256 Factor the handling of flags in m4.
257 * src/output.c (prepare): Rename the muscle names debug, defines,
258 error_verbose to debug_flag, defines_flag, error_verbose_flag.
259 * data/c.m4: Adjust.
260 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
261 Use b4_define_flag_if to define other b4_FLAG_if macros.
262 (b4_location_if): As a consequence, rename as...
263 (b4_locations_if): this, for consistency.
264 Adjust all the skeletons.
265
ba9ecd19
AD
2662006-05-14 Akim Demaille <akim@lrde.epita.fr>
267
268 * etc/bench.pm: Shorten bench names.
269
4e83ea15
AD
2702006-05-14 Akim Demaille <akim@lrde.epita.fr>
271
272 * src/output.h, src/output.c (error_verbose): Move to...
273 * src/getargs.h, src/getargs.c: here.
274 Sort the flags.
275 Adjust dependencies.
276
6e93d810
PE
2772006-05-13 Paul Eggert <eggert@cs.ucla.edu>
278
279 * data/c.m4 (b4_copyright): Put the special exception for Bison
280 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
281 uses changed. Suggested by Akim Demaille. Also, wrap the
282 copyright notice, in case it is longer than 80 columns. Replace
283 comma by newline after title.
6e93d810 284
eaea13f5
PE
2852006-05-11 Paul Eggert <eggert@cs.ucla.edu>
286
287 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
288 incompatibility, not a bug. Mention that it wasn't fixed as of
289 flex 2.5.33.
290
3cf084ec
AD
2912006-05-11 Akim Demaille <akim@lrde.epita.fr>
292
293 * examples/extexi: Enforce the precedence of concatenation over
294 >>.
0a9f1c7d 295 Reported by Tommy Nordgren.
3cf084ec 296
32c96bd7
AD
2972006-05-11 Akim Demaille <akim@lrde.epita.fr>
298
299 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
300 with the member "token".
f94705b2 301 Reported by Martin Nylin.
32c96bd7 302
eaea13f5
PE
3032006-05-08 Paul Eggert <eggert@cs.ucla.edu>
304
305 * data/glr.c: Switch to Bison 2.2 special-exception language in
306 the copyright notice. Use more-regular format for titles and
307 copyright notices.
308 * data/glr.cc: Likewise.
309 * data/location.cc: Likewise.
310 * data/yacc.cc: Likewise.
311 * doc/bison.texinfo (Conditions): Document this.
312 * NEWS: likewise. Upgrade version to 2.2.
313
6e2d1146
AD
3142006-04-27 Akim Demaille <akim@lrde.epita.fr>
315
316 * data/glr.cc: Remove dead code.
317
47671055
PE
3182006-04-25 Paul Eggert <eggert@cs.ucla.edu>
319
320 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
321 that variable and the line breaks the bootstrap. Problem reported
322 by Juan M. Guerrero.
323
ed2e6384
AD
3242006-04-24 Akim Demaille <akim@lrde.epita.fr>
325
326 * doc/bison.texinfo (Multiple start-symbols): New.
327
3cedc2dc
AD
3282006-04-24 Akim Demaille <akim@lrde.epita.fr>
329
330 * etc/README, etc/bench.pl: New.
331
b2ddc3f3
AD
3322006-04-03 Akim Demaille <akim@lrde.epita.fr>
333
334 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
335 rule.
336 Reported by Mickael Labau.
337 * tests/input.at (Torturing the Scanner): Test it.
338
91e3ac9a
PE
3392006-03-16 Paul Eggert <eggert@cs.ucla.edu>
340
341 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
342 Problem reported by Bob Rossi.
343
3442006-03-13 Paul Eggert <eggert@cs.ucla.edu>
345
346 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
347 and didn't really work.
348 For the index, use @ifnotinfo, not @iftex.
349 Minor cleanups of spacing and terminology.
350
5cf61e93
AD
3512006-03-12 Akim Demaille <akim@lrde.epita.fr>
352
353 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
354 of AT_NAME_PREFIX when %name-prefix is not used.
355
aa08666d
AD
3562006-03-12 Akim Demaille <akim@lrde.epita.fr>
357
358 Apply --prefix to C++ skeletons too: they change the namespace.
359 The test suite already exercize these cases.
360 * data/c++.m4 (b4_namespace): New.
361 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
362 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
363 * data/yacc.c, data/glr.c: Remove a useless `[]'.
364 * doc/bison.texinfo: Document it.
365 (Option Cross Key): Use @multitable in all formats. It looks
366 nicer, even in TeX outputs.
367 (Rules): Use the same code whatever the output type is.
368 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
369 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
370 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 371
45567173
AD
3722006-03-10 Akim Demaille <akim@lrde.epita.fr>
373
374 * TODO: Remove dead items.
375
e9d8f881 3762006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
377
378 * doc/FAQ: Remove, merged into...
379 * doc/bison.texinfo (FAQ): this.
380 * doc/Makefile.am (EXTRA_DIST): Adjust.
381
c095d689
AD
3822006-03-10 Akim Demaille <akim@lrde.epita.fr>
383
384 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
385 even if empty.
386 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
387 * doc/bison.texinfo (Calc++ Scanner): Use it.
388
6e0f8287
PE
3892006-03-09 Paul Eggert <eggert@cs.ucla.edu>
390
391 Fix two nits reported by twlevo, plus one more that I discovered.
392
393 * src/assoc.h (assoc_to_string): Give a name to the arg, as
394 this is the usual Bison style.
395 * src/location.h (location_print): Likewise.
396
397 * src/reader.h (token_name): Likewise.
398
d6b771c3
PE
3992006-03-08 Paul Eggert <eggert@cs.ucla.edu>
400
401 Fix some nits reported by twlevo.
402 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
403 and "POSIX". Use more-modern syntax for URLs. Mention C++
404 and ask for Java. Don't hardwire OS version numbers. Add
405 copyright notice.
406 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
407 * src/conflicts.c (solved_conflicts_obstack): Now static.
408
1e137b71
JD
4092006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
410
411 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
412 page. Say "you can use it" not "you may use it" as on the web page;
413 we're describing capabilities not granting permission.
414
73f2e47e
PE
4152006-03-06 Paul Eggert <eggert@cs.ucla.edu>
416
6d05403d
PE
417 * data/glr.c (yyresolveLocations): Rename local variables to avoid
418 shadowing warnings. Use usual patter for iterating through RHS.
419 * tests/glr-regression.at
420 (Uninitialized location when reporting ambiguity):
421 Modify yylex so that it uses its argument, rather than trying
422 to rely on ARGSUSED (which doesn't work for gcc with warnings).
423 const char -> char const.
424
73f2e47e
PE
425 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
426 Don't use tabs inside commands; it messes up 'ps'.
427 Problem reported by twlevo.
428
8710fc41
JD
4292006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
430
431 * tests/glr-regression.at (Uninitialized location when reporting
432 ambiguity): New test case.
433 * data/glr.c (yyresolveLocations): New function, which uses
434 YYLLOC_DEFAULT.
435 (yyresolveValue): Invoke yyresolveLocations before reporting an
436 ambiguity.
437 * doc/bison.texinfo (Default Action for Locations): Note
438 YYLLOC_DEFAULT's usage for ambiguity locations.
439 (GLR Semantic Actions): Cross-reference those notes.
440
ae952af2
JD
4412006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
442
443 * tests/glr-regression.at (Leaked semantic values when reporting
444 ambiguity): Remove unnecessary union and type declarations.
445 (Leaked lookahead after nondeterministic parse syntax error): New test
446 case.
447 * data/glr.c (yyparse): Check for zero stacks remaining before
448 attempting to shift the lookahead so that you don't lose it.
449
35ee866a
JD
4502006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
451
452 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
453 * tests/glr-regression.at (Leaked semantic values when reporting
454 ambiguity): New test case.
455 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
456 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
457 now unnecessary yystackp parameter.
458 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
459 destructors can be called.
460
461 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
462 in existing testcases.
463
520181ab
JD
4642006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
465
466 Don't leak semantic values for parent RHS when a user action cuts the
467 parser, and clean up related code a bit.
468 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
469 cuts parse): Rename to...
470 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
471 for leaked parent RHS values.
472 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
473 between an unresolved state (non-empty chain of semantic options) and
474 an incomplete one (signaled by an empty chain).
ae952af2 475 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
476 successfully or unsuccessfully resolved yyGLRState to...
477 (yyresolveValue): ... here so that yyresolveValue always leaves a
478 yyGLRState with consistent data and thus is easier to understand.
479 Remove the yyvalp and yylocp parameters since they are always just
480 taken from the yys parameter. When reporting a discarded merged value
481 in debugging output, note that it is incompletely merged. Document the
482 interface.
483 (yyresolveAction): If resolving any of the RHS states fails, destroy
484 them all rather than leaking them. Thus, as long as user actions are
485 written to clean up the RHS correctly, yyresolveAction always cleans up
486 the RHS of a semantic option. Document the interface.
487
18d9185c
PE
4882006-02-27 Paul Eggert <eggert@cs.ucla.edu>
489
490 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
491 led to a segmentation fault in GNU Pascal. Problem reported
492 by Waldek Hebisch.
493
841a7737
JD
4942006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
495
496 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
497 mid-rule action inside a nonterminal symbol in order to declare a
498 destructor for its semantic value.
499
fc3f467f
PE
5002006-02-16 Paul Eggert <eggert@cs.ucla.edu>
501
502 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
503 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
504 __cplusplus && ! defined _STDLIB_H && !
505 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
506 defined free))]: Include <stdlib.h> rather than rolling our own
507 declarations of malloc and free, to avoid problems with
508 incompatible declarations (using 'throw') C++'s stdlib.h. This
509 should fix Debian bug 340012
510 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
511 reported by Guillaume Melquiond.
512
a3af26dd
PE
5132006-02-13 Paul Eggert <eggert@cs.ucla.edu>
514
4d7bc38c
PE
515 * NEWS: Clarify symbols versus types in unused-value warnings.
516
a3af26dd
PE
517 * configure.ac (AC_INIT): Bump version number.
518
4e26c69e
PE
5192006-02-13 Paul Eggert <eggert@cs.ucla.edu>
520
521 * NEWS: Version 2.1a.
522 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
523 since C99 requires this.
524
498e897c
PE
5252006-02-11 Paul Eggert <eggert@cs.ucla.edu>
526
527 * m4/c-working.m4: New file.
528 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
529
57bb17ca
PE
5302006-02-10 Paul Eggert <eggert@cs.ucla.edu>
531
532 * Makefile.maint: Merge from coreutils.
533
0be105dc
PE
5342006-02-09 Paul Eggert <eggert@cs.ucla.edu>
535
536 More portability fixes for problems summarized by Nelson H. F. Beebe.
537
538 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
539 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
540 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
541 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
542 messes up because C++ code is compiled in 32-bit mode but linked
543 in 64-bit mode.
544
6fc0c024
PE
5452006-02-08 Paul Eggert <eggert@cs.ucla.edu>
546
547 More portability fixes for problems summarized by Nelson H. F. Beebe.
548
7870f699
PE
549 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
550 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
551
6fc0c024
PE
552 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
553 nodist_PROGRAMS, since we don't need to actually compile the
554 example if we're just doing a plain 'make'. This avoids bothering
555 the installer unnecessarily about problems due to weird C++
556 compilers.
557
fe6c2fde
PE
5582006-02-06 Paul Eggert <eggert@cs.ucla.edu>
559
560 More portability fixes for problems summarized by Nelson H. F. Beebe.
561
562 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
563 than #include "...", and compile with -I'.'. The old method was
564 not portable, according to Posix and the C standard, and it does
565 not work with Sun C 5.7, where previous #line directives affect
566 the working directory used in later #include "..." directives.
567
927b425b
JMG
5682006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
569
570 Various DJGGP specific issues in /djgpp
571
d9735e9e
PE
5722006-02-02 Paul Eggert <eggert@cs.ucla.edu>
573
574 More portability fixes for problems summarized by Nelson H. F. Beebe.
575
576 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
577 '#include <map>' works and that you can apply ++ to iterators.
578
5a6755af
PE
5792006-02-01 Paul Eggert <eggert@cs.ucla.edu>
580
67a0dc4f
PE
581 Work around portability problems summarized by Nelson H. F. Beebe in
582 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
583
8c86f0ef
PE
584 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
585 that '#include <string>' works.
586
de35dd59
PE
587 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
588 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
589 "warning: sorry: semantics of inline function static data `const
590 unsigned char translate_table[262]' are wrong (you'll wind up with
591 multiple copies)".
592
67a0dc4f
PE
593 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
594 or, xor to not_, and_, or_, and xor_, respectively. This works
595 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
596 random system header somewhere that includes the equivalent of
597 <iso646.h>.
598
5a6755af
PE
599 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
600 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 601 Suite Version 2.0.
5a6755af 602
3f001415
JD
6032006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
604
605 During deterministic GLR operation, user actions should be able to
606 influence the parse by changing yychar. To make this easier to fix and
607 to make glr.c easier to evolve in general, don't maintain yytoken in
608 parallel with yychar; just compute yytoken when needed.
609 * tests/glr-regression.at (Incorrect lookahead during deterministic
610 GLR): Check that setting yychar in a user action has the intended
611 effect.
612 * data/glr.c (yyGLRStack): Remove yytokenp member.
613 (yyclearin): Don't set *yytokenp.
614 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
615 yychar rather than *yytokenp to determine the current lookahead.
616 Compute yytoken locally when needed.
617 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
618 point to.
619
620 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
621 after `--report' documentation.
622
e2a8c0f5
PE
6232006-01-30 Paul Eggert <eggert@cs.ucla.edu>
624
625 * src/parse-gram.y (grammar_declaration): Location of printer
626 symbol is @1, not list->location. Bug reported by twlevo.
627 * tests/input.at (Incompatible Aliases): Adjust to above change.
628
6b702268
PE
6292006-01-29 Paul Eggert <eggert@cs.ucla.edu>
630
27622431
PE
631 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
632 all the test at once. This makes the output easier to read in the
633 normal case.
634
6b702268
PE
635 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
636 got from <http://bro-ids.org/download.html>. The bug is that
637 when two actions appeared in succession, the second one was
638 scanned before the first one was added to the grammar rule
639 as a midrule action. Bison then output the incorrect warning
640 "parse.y:905.17-906.36: warning: unused value: $3".
641 * src/parse-gram.y (BRACED_CODE, action): These are no longer
642 associated with a value.
643 (rhs): Don't invoke grammar_current_rule_action_append.
644 (action): Invoke it here instead.
645 * src/reader.c (grammar_midrule_action): Now extern.
646 (grammar_current_rule_action_append): Don't invoke
647 grammar_midrule_action; that is now the scanner's job.
648 * src/reader.h (last_string, last_braced_code_loc):
649 (grammar_midrule_action): New decls.
650 * src/scan-gram.l (last_string): Now extern, sigh.
651 (last_braced_code_loc): New extern variable.
652 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
653 rule already has an action.
654 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
655 * tests/input.at (AT_CHECK_UNUSED_VALUES):
656 Add some tests to check that the above changes fixed the bug.
657
d40ba6c2
PE
6582006-01-27 Paul Eggert <eggert@cs.ucla.edu>
659
660 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
661 All used changed. Check whether the symbol has a destructor,
662 not whether it is typed.
663 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
664 that the values are still reported as unused. All line numbers
665 adjusted.
666
401aace6
PE
6672006-01-23 Paul Eggert <eggert@cs.ucla.edu>
668
669 Work around a bug in bro 0.8, which underparenthesizes its
670 definition of YYLLOC_DEFAULT.
671 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
672 their arguments.
673 * data/lalr1.cc: Likewise.
674 * data/yacc.cc: Likewise.
675
06f01bc4
PE
6762006-01-22 Paul Eggert <eggert@cs.ucla.edu>
677
401aace6
PE
678 Work around a bug in Pike 7.0, and give the Pike folks a
679 better way to override the usual int widths.
680 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
681 user can override the types.
682 (short): #undef, to work around a bug in Pike 7.0.
683 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
684 (union yyalloc.yyss): Use yytype_int16 rather than short.
685 All uses changed.
686 (yysigned_char): Remove.
687 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
688 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
689 * tests/regression.at (Web2c Actions): Adjust to above changes.
690
691 * src/reader.c (check_and_convert_grammar): New function.
692 (reader): Close the input file even if something went wrong during
693 parsing. Minor file descriptor leak reported by twlevo.
694
06f01bc4
PE
695 * src/assoc.c (assoc_to_string): Use a default: abort (); case
696 to pacify gcc -Wswitch-default.
697 * src/scan-gram.l (adjust_location): Use a default: break; case
698 to pacify gcc -Wswitch-default.
699 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
700 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
701 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
702 Move these decls to scan-skel.l, since they don't need to be
703 visible elsewhere.
704 * src/scan-skel.l: Accept the above decls.
705 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
706 is used.
707
02650b7f
PE
7082006-01-21 Paul Eggert <eggert@cs.ucla.edu>
709
710 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
711 since we don't want to insist on a version number at the start
712 of the changelog every time.
713 * Makefile.maint: Sync from coreutils a bit better.
714 (sc_trailing_blank): Renamed from sc_trailing_space.
715 All uses changed.
716 (sc_no_if_have_config_h, sc_require_config_h):
717 (sc_prohibit_assert_without_use): New rules.
718 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
719 (sc_dd_max_sym_length): Fix leading spaces in rule.
720 (sc_system_h_headers): Prefix with @.
721 (sc_useless_cpp_parens, m4-check): Output line numbers.
722 (changelog-check): Allow version only in head.
723 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
724 satisfy new Makefile.maint rule.
725 * data/glr.c: Likewise.
726 * data/glr.cc: Likewise.
727 * data/lalr1.cc: Likewise.
728 * data/yacc.c: Likewise.
729 * lib/ebitsetv.c: Likewise.
730 * lib/lbitset.c: Likewise.
731 * lib/subpipe.c: Likewise.
732 * lib/timevar.c: Likewise.
733 * src/system.h: Likewise.
734 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
735 * djgpp/Makefile.maint: Add copyright notice.
736 * djgpp/README.in: Likewise.
737 * djgpp/config.bat: Likewise.
738 * djgpp/config.site: Likewise.
739 * djgpp/config_h.sed: Likewise.
740 * djgpp/djunpack.bat: Likewise.
741 * djgpp/config.sed: Fix copyright notice to match standard format.
742 * djgpp/subpipe.h: Likewise.
743 * lib/bitsetv-print.c: Likewise.
744 * lib/bitsetv.c: Likewise.
745 * lib/subpipe.h: Likewise.
746 * lib/timevar.c: Likewise.
747 * lib/timevar.h: Likewise.
748 * djgpp/subpipe.c: Use standard recipe for config.h.
749 * lib/abitset.c: Likewise.
750 * lib/bitset.c: Likewise.
751 * lib/bitset_stats.c: Likewise.
752 * lib/bitsetv-print.c: Likewise.
753 * lib/bitsetv.c: Likewise.
754 * lib/ebitsetv.c: Likewise.
755 * lib/get-errno.c: Likewise.
756 * lib/lbitset.c: Likewise.
757 * lib/subpipe.c: Likewise.
758 * lib/timevar.c: Likewise.
759 * lib/vbitset.c: Likewise.
760 * tests/local.at: Likewise.
761 * src/scan-gram.l: Don't include verify.h, since system.h does
762 that for us.
763 * .x-sc_require_config_h: New file.
764 * .x-sc_unmarked_diagnostics: New file.
765
287c78f6
PE
7662006-01-20 Paul Eggert <eggert@cs.ucla.edu>
767
287c78f6
PE
768 Be a bit more systematic about using 'abort'.
769 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
770 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
771 Put 'default: abort ();' before some other case, to satisfy older
772 pedantic compilers.
773 * lib/bitset_stats.c (bitset_stats_init): Likewise.
774 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
775 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
776 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
777 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
778 (get_decision_str, get_orientation_str, get_node_alignment_str):
779 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
780 (get_linestyle_str, get_arrowstyle_str): Likewise.
781 * src/conflicts.c (resolve_sr_conflict):
782 Use a default case rather than one for the one remaining enum
783 value, to catch invalid enum values as well.
784 * src/lalr.c (set_goto_map, map_goto):
785 Prefer "assert (FOO);" to "if (!FOO) abort ();".
786 * src/nullable.c (nullable_compute, token_definitions_output):
787 Likewise.
788 * src/reader.c (packgram, reader): Likewise.
789 * src/state.c (transitions_to, state_new, state_reduction_find):
790 Likewise.
791 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
792 (symbol_pack): Likewise.
793 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
794 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
795 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
796 * src/system.h: Don't include <assert.h>.
797 (assert): New macro.
798
799 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
800 (Destructor Decl, Parser Function, Pure Calling):
801 Describe rules for braces inside C code more carefully.
287c78f6 802
c66dfadd
PE
8032006-01-19 Paul Eggert <eggert@cs.ucla.edu>
804
c21493b8
PE
805 Fix some porting glitches found by Nelson H. F. Beebe.
806 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
807 compilers that don't understand that abort () does not return.
808 * src/state.c (transitions_to): Likewise.
809 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
810 that '#include <cstdlib>' works.
811 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
812 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
813 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
814 for the benefit of some pre-C99 compilers.
815
b6e3facf
PE
816 * bootstrap: Undo changes to gnulib files that autoreconf made.
817
c66dfadd
PE
818 Minor fixups to get 'make maintainer-check' to work.
819 * configure.ac: Don't use -Wnested-externs, as it's incompatible
820 with the new verify.h implementation.
821 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
822 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
823 * data/yacc.c (YYUSE): Likewise.
824 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
825 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
826 * src/parse-gram.y (declaration): Don't pass a string constant
827 to a function that expects char *, since GCC might complain
828 about the constant value.
829 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
830 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
831 before #defining them.
832 * tests/glr-regression.at
833 (Incorrectly initialized location for empty right-hand side in GLR):
834 In yyerror, use the msg arg.
835 (Corrupted semantic options if user action cuts parse):
836 (Incorrect lookahead during deterministic GLR):
837 (Incorrect lookahead during nondeterministic GLR):
838 Don't name a local var 'index'; it shadows string.h's 'index'.
839
ed94ef2a
AD
8402006-01-19 Akim Demaille <akim@epita.fr>
841
842 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
843 location, not just parts of it.
844
e9ad4aec
PE
8452006-01-18 Paul Eggert <eggert@cs.ucla.edu>
846
d6ca7905
PE
847 * NEWS: Document the fact that multiple %unions are now allowed.
848 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
849 * TODO: This feature is now implemented, so remove it from
850 the wishlist.
d6ca7905 851
ef1b70e0
PE
852 * Makefile.maint: Merge with coreutils Makefile.maint.
853 (CVS_LIST): Use build-aux version if available.
854 (VERSION_REGEXP): New macro.
855 (syntax-check-rules): Add sc_no_if_have_config_h,
856 sc_prohibit_assert_without_use, sc_require_config_h,
857 sc_useless_cpp_parens.
858 (sc_obsolete_symbols): Check for O_NDELAY.
859 (sc_dd_max_sym_length): Track coreutils.
860 (sc_unmarked_diagnostics): Look in all files, not just *.c.
861 (sc_useless_cpp_parens): New rule.
862 (news-date-check): Look for version or today's date.
863 (changelog-check): Don't require version number near head.
864 (copyright-check): Use current year instead of hardwiring 2005.
865 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
866 (announcement): Add --gpg-key-ID.
867
868 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
869 with "file system".
870
2073ce56 871 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
872 array. Problem reported by twlevo.
873 * src/reader.c (packgram): Prepend a new sentinel before ritem.
874 * src/lalr.c (build_relations): Rely on new sentinel.
875 * src/gram.c (gram_free): Adjust to new sentinel.
876
b7691f15
JD
8772006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
878
879 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
880 yylookaheadNeeds. All uses updated.
881 (yysplitStack): Rename local yynewLookaheadStatuses to
882 yynewLookaheadNeeds.
883 * data/glr-regression.at (Incorrect lookahead during nondeterministic
884 GLR): In comments, change `lookahead status' to `lookahead need'.
885
ddee1b06
PH
8862006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
887
888 * data/glr.c (yysplitStack): A little stylistic rewrite.
889
12f4614d
PH
8902006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
891
892 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
893
32c29292
JD
8942006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
895
896 * doc/bison.texinfo: Fix some typos.
897 (GLR Semantic Actions): New subsection discussing special
898 considerations because GLR semantic actions might be deferred.
899 (Actions): Mention look-ahead usage of yylval.
900 (Actions and Locations): Mention look-ahead usage of yylloc.
901 (Special Features for Use in Actions): Add YYEOF entry and mention it
902 in the yychar entry.
903 In the yychar entry, remove mention of the local yychar case (pure
904 parser) since this is irrelevant information when writing semantic
905 actions and since it's already discussed in `Bison Symbols' where
906 yychar is otherwise described as an external variable.
907 In the yychar entry, don't call it the `current' look-ahead since it
908 isn't when semantic actions are deferred.
909 In the yychar and yyclearin entries, add note about deferred semantic
910 actions.
911 Add yylloc and yylval entries discussing look-ahead usage.
912 (Look-Ahead Tokens): When discussing yychar, don't call it the
913 `current' look-ahead, and do mention yylval and yylloc.
914 (Error Recovery): Cross-reference `Action Features' when mentioning
915 yyclearin.
916 (Bison Symbols): In the yychar entry, don't call it the `current'
917 look-ahead.
918 In the yylloc and yylval entries, mention look-ahead usage.
919
de366a2f 9202006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
921
922 * tests/glr-regression.at: Update copyright year to 2006.
923
bf70fa87
JD
9242006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
925
926 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
927 use during nondeterministic operation to track which stacks have
928 actually needed the current lookahead.
929 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
930 Allocate, deallocate, resize, and otherwise shuffle space for
931 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
932 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
933 appropriately during nondeterministic operation.
934 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
935 members to store the current lookahead to be used by the deferred
936 user action.
937 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
938 from which the RHS is taken. Set the lookahead members of the new
939 yySemanticOption according to the lookahead status for stack yyk.
940 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
941 yyaddDeferredAction.
942 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
943 members of yySemanticOption before invoking yyuserAction, and then set
944 them back to their current values afterward.
945 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
946 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
947 * tests/glr-regression.at: Remove `.' from the ends of recent test case
948 titles for consistency.
949 (Leaked merged semantic value if user action cuts parse): In order to
950 suppress lint warnings, use arguments in merge function, and assign
951 char value < 128 in main.
952 (Incorrect lookahead during deterministic GLR): New test case.
953 (Incorrect lookahead during nondeterministic GLR): New test case.
954
05449a2c
JD
9552006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
956
de366a2f 957 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
958 !yyvaluep as signal that no semantic value is available to print.
959 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
960 to print a semantic value.
961
4158e0a1 9622006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 963
4158e0a1
JD
964 * tests/glr-regression.at: For consistency with my newer test cases,
965 don't thank myself.
966
d659304d
JD
9672006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
968
969 * data/glr.c (yyresolveValue): When merging semantic options, if at
970 least one user action succeeds but a later one cuts the parse, then
971 destroy the semantic value before returning rather than leaking it.
972 (yyresolveStates): If a user action cuts the parse and thus
973 yyresolveValue fails, ignore the (unset) semantic value rather than
974 corrupting the yyGLRState, and empty the semantic options list since
975 the user actions should have called all necessary destructors.
976 Simplify code with YYCHK.
977 * tests/glr-regression.at (Corrupted semantic options if user action
978 cuts parse): New test case.
979 (Undesirable destructors if user action cuts parse): New test case.
980 Before applying any of this patch, this test case never actually failed
981 for me... but only because the corrupted semantic options usually
982 masked this bug.
983 (Leaked merged semantic value if user action cuts parse): New test
984 case.
985
6ec2c0f2
AD
9862006-01-05 Akim Demaille <akim@epita.fr>
987
988 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
989
1b9c21fb
PE
9902006-01-04 Paul Eggert <eggert@cs.ucla.edu>
991
992 * data/c.m4 (b4_c_modern): New macro, with a new provision for
993 _MSC_VER. Problem reported by Cenzato Marco.
994 (b4_c_function_def): Use it.
995 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
996 b4_c_modern.
997 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
998 than rolling our own.
999
84866159
AD
10002006-01-04 Akim Demaille <akim@epita.fr>
1001
1002 Also warn about non-used mid-rule values.
1003 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
1004 member.
1005 (symbol_list_new): Adjust.
1006 * src/reader.c (symbol_typed_p): New.
1007 (grammar_rule_check): Use it.
1008 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
1009 Check its rule.
1010 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
1011 Use it.
1012 * tests/actions.at (Exotic Dollars): Adjust.
1013
378f4bd8
AD
10142006-01-04 Akim Demaille <akim@epita.fr>
1015
1016 * src/reader.c (grammar_midrule_action): If $$ is set in a
1017 mid-rule, move the `used' bit to its lhs.
1018 * tests/input.at (Unused values): New.
1019 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
1020
e2a21b6f
PE
10212006-01-03 Paul Eggert <eggert@cs.ucla.edu>
1022
54662697
PE
1023 * doc/bison.texinfo (Bison Options): Say more accurately what
1024 --yacc does.
1025 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
1026 about declarations in the grammar when in Yacc mode, as POSIX does
1027 not require a diagnostic when the grammar uses extensions.
1028
1029 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
1030
073f9288
PE
1031 Warn about dubious constructions like "%token T T".
1032 Reported by twlevo.
1033 * src/symtab.h (struct symbol.declared): New member.
1034 * src/symtab.c (symbol_new): Initialize it to false.
1035 (symbol_class_set): New arg DECLARING, specifying whether
1036 this is a declaration that we want to warn about, if there
1037 is more than one of them. All uses changed.
1038
1221b78a
PE
1039 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
1040 Allow multiple %union directives, whose contents concatenate.
1041 * src/parse-gram.y (grammar_declaration): Likewise.
1042 Use muscle_code_grow, so that we don't need stype_line any more.
1043 All uses changed.
1044
1045 * src/muscle_tab.c (muscle_grow): Fix comment.
1046
e2a21b6f
PE
1047 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
1048 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
1049 Update copyright year to 2006.
1050
8f7e3cf9
AD
10512006-01-03 Akim Demaille <akim@epita.fr>
1052
1053 Have glr.cc pass (some of) the calc.at tests.
1054 * data/glr.cc (b4_parse_param_orig): New.
1055 (b4_parse_param): Improve its definition, and bound it more
1056 clearly in the skeleton.
1057 (b4_epilogue): Append, instead of prepending, in order to keep
1058 #line consistency.
1059 Simplify the generation of auxiliary functions: locations and
1060 purity are mandated.
1061 (b4_global_tokens_and_yystype): Honor it.
1062 * data/location.cc (c++.m4): Don't include it.
1063 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
1064 and AT_SKEL_CC_IF.
1065 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
1066 AT_LALR1_CC_IF.
1067 Be sure to initialize the first position's filename.
1068 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
1069 mandated anyway.
1070 (AT_CHECK_CALC_GLR_CC): New.
1071 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
1072
3953ed88
AD
10732006-01-02 Akim Demaille <akim@epita.fr>
1074
1075 * src/output.c (output_skeleton): Don't hard wire the inclusion of
1076 c.m4.
0a96ba81 1077 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
1078 * data/glr.cc: Do not include stack.hh.
1079
9ecafbbf
AD
10802006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
1081
1082 * data/glr.c: Reformat whitespace with tabs.
1083 (b4_lpure_formals): Remove this unused m4 macro.
1084 * tests/cxx-type.at: Reformat whitespace with tabs.
1085 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
1086 since it's a member. Rename type to isNterm for clarity.
1087
c4d497a0
AD
10882005-12-29 Akim <akim@sulaco.local>
1089
1090 Let glr.cc catch up with symbol_value_print.
1091 * data/glr.cc (b4_yysymprint_generate): Replace by...
1092 (b4_yy_symbol_print_generate): this.
1093 (yy_symbol_print, yy_symbol_value_print): Declare them.
1094
4517da37
PE
10952005-12-28 Paul Eggert <eggert@cs.ucla.edu>
1096
1097 * src/location.h (boundary): Note that a line or column equal
1098 to INT_MAX indicates an overflow.
1099 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
1100 (rule_length_overflow, increment_rule_length, add_column_width):
1101 New functions.
1102 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
1103 (<SC_BRACED_CODE>"}"):
1104 Use increment_rule_length rather than incrementing it by hand.
1105 (adjust_location, handle_syncline): Diagnose overflow.
1106 (handle_action_dollar, handle_action_at):
1107 Fix bug with monstrosities like $-2147483648.
1108 Remove now-unnecessary checks.
1109 (scan_integer): Verify assumptions and remove now-unnecessary checks.
1110 (convert_ucn_to_byte): Verify assumptions.
1111 (handle_syncline): New arg LOC. All callers changed.
1112 Don't store through a value derived from char const * pointer.
1113
1114 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
1115 GCC warnings.
1116
e3233bf6
PE
11172005-12-27 Paul Eggert <eggert@cs.ucla.edu>
1118
1119 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
1120 Remove unnecessary forward static decls.
1121
8f3596a6
AD
11222005-12-27 Akim Demaille <akim@epita.fr>
1123
1124 * src/reader.c (grammar_current_rule_check): Also check that $$
1125 is used.
1126 Take the rule to check as argument, hence rename as...
1127 (grammar_rule_check): this.
1128 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
1129 Rename as...
1130 (grammar_rule_begin, grammar_rule_end): these, for consistency.
1131 (grammar_midrule_action, grammar_symbol_append): Now static.
1132 * tests/torture.at (input): Don't rely on the default action
1133 being always performed.
1134 * tests/calc.at: "Set" $$ even when the action is "cut" with
1135 YYERROR or other.
1136 * tests/actions.at (Exotic Dollars): Instead of using unused
1137 values, check that the warning is issued.
1138
721be13c
PE
11392005-12-22 Paul Eggert <eggert@cs.ucla.edu>
1140
1141 * NEWS: Improve wording for unused-value warnings.
1142
a0af42fc
AD
11432005-12-22 Akim Demaille <akim@epita.fr>
1144
1145 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
1146 (b4_yysymprint_generate): Rename as...
1147 (b4_yy_symbol_print_generate): this.
1148 Generate yy_symbol_print instead of yysymprint.
1149 Generate also yy_symbol_value_print, and use it.
1150
affac613
AD
11512005-12-22 Akim Demaille <akim@epita.fr>
1152
721be13c 1153 * NEWS: Warn about unused values.
affac613
AD
1154 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
1155 a `used' member.
1156 (symbol_list_n_get, symbol_list_n_used_set): New.
1157 (symbol_list_n_type_name_get): Use symbol_list_n_get.
1158 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
1159 * src/reader.c (grammar_current_rule_check): Check that values are
1160 used.
1161 * src/symtab.c (symbol_print): Accept 0.
1162 * tests/existing.at: Remove the type information.
1163 Empty the actions.
1164 Remove useless actions (beware of mid-rule actions: perl -000
1165 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
1166 * tests/actions.at (Exotic Dollars): Use unused values.
1167 * tests/calc.at: Likewise.
1168 * tests/glr-regression.at (No users destructors if stack 0 deleted):
1169 Likewise.
1170
1171 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
1172 rule_useful_p.
1173
9d9b8b70
PE
11742005-12-21 Paul Eggert <eggert@cs.ucla.edu>
1175
8bb4c753
PE
1176 Undo 2005-12-01 tentative license wording change. The wording is
1177 still being reviewed by the lawyers, and we don't want to wait for
1178 them before publishing a test release. For now, revert to the
1179 previous wording.
1180 * NEWS: Undo 2005-12-01 change.
1181 * data/glr.c: Revert to previous license wording.
1182 * data/glr.cc: Likewise.
1183 * data/lalr1.cc: Likewise.
1184 * data/location.cc: Likewise.
1185 * data/yacc.c: Likewise.
1186
9d9b8b70
PE
1187 * NEWS: Reword %destructor vs YYABORT etc.
1188 * data/glr.c: Use American spacing, for consistency.
1189 * data/glr.cc: Likewise.
1190 * data/lalr1.cc: Likewise.
1191 * data/yacc.c: Likewise.
1192 * data/yacc.c: Reformat comments slightly.
1193 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
1194 for consistency. Fix some spelling errors and reword recently-included
1195 text slightly.
1196 * tests/cxx-type.at: Cast results of malloc, for C++.
1197
2c3b392a
AD
11982005-12-21 Joel E. Denny <address@hidden>
1199
1200 * tests/cxx-type.at: Construct a tree, count the parents of shared
1201 nodes, and free each node once and only once. Previously, the memory
1202 for semantic values was leaked instead.
1203
d6cff4dc
AD
12042005-12-21 Joel E. Denny <address@hidden>
1205
1206 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
1207 (yylval, yylloc): If pure, #define to yystackp->yyval and
1208 yystackp->yyloc similar to yychar and yynerrs.
1209 (yyparse): If pure, remove local yylval and yylloc. Add local
1210 yystackp to accommodate pure definitions of yylval and yylloc.
1211 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
1212 yylvalp and yyllocp to &yylval and &yylloc.
1213 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
1214 namespace. Previously, nerrs and char were missing, but lval and lloc
1215 weren't necessary.
1216 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
1217 yylvalp and yyllocp parameters since, if pure, these are now always
1218 accessible through yystackp. If not pure, they are still accessible
1219 globally.
1220 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
1221 `if (YYID (N))' to pacify lint.
1222
a85284cf
AD
12232005-12-21 Akim Demaille <akim@epita.fr>
1224
1225 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
1226 destroy the RHS symbols of a rule.
1227 * data/yacc.c (yylen): Initialize to 0.
1228 Keep its value to the number of items to possibly shift.
1229 In particular, a regular successful parse that ends on YYFINAL by
1230 a (internal) YYACCEPT must not have yylen != 0.
1231 (yyerrorlab, yyreturn): Pop the RHS.
1232 Reorder a bit to emphasize the `shifting' bits of code.
1233 (YYPOPSTACK): Now accept a number of items to pop.
1234 * data/lalr1.cc: Likewise.
1235 * data/glr.c: Formatting changes.
1236 Use goto instead of fall through.
1237 * doc/bison.texinfo (Destructor Decl): Complete.
1238
d508c281
JMG
12392005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1240
1241 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
1242 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
1243 * djgpp/config.bat: Replace every occurence of the file name
1244 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
1245 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
1246 * djgpp/config.sed: Replace every occurence of the file name
1247 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
1248 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
1249 * djgpp/djunpack.bat: DJGPP specific file.
1250 * djgpp/fnchange.lst: DJGPP specific file.
1251 * djgpp/README.in: Add new information about how to unpack the bison
1252 source on MSDOS and other systems which have 8.3 file name restrictions
1253 using djunpack.bat and fnchange.lst.
1254
3e7a2cd9
PE
12552005-12-12 Paul Eggert <eggert@cs.ucla.edu>
1256
1257 * bootstrap (build_cvs_prefix): Remove; unused.
1258 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
1259 when getting gnulib.
1260
12612005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
1262
1263 * data/glr.c: Reorder typedef declarations for structs to match order
1264 of struct declarations.
1265 Rename yystack everywhere to yystackp except in yyparse where it's not
1266 a pointer.
1267 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
1268 consistency.
1269 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
1270 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
1271 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
1272 lint.
1273
877519f8
PE
12742005-12-09 Paul Eggert <eggert@cs.ucla.edu>
1275
0eca5a39
PE
1276 * tests/sets.at (Accept): Fix typos in regular expression used to
1277 sed out the final state number.
1278
2cec9080
PE
1279 Work around portability problem on Solaris 10: flex-generated
1280 files include <stdio.h> before <config.h>, which messes up
1281 because the latter defines __EXTENSIONS__. Address the problem
1282 by creating two new little files that include <config.h> first,
1283 then include the flex-generated files. Rewrite everyone else
1284 to include <config.h> first, as well.
1285 * lib/timevar.c: Always include "config.h".
1286 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
1287 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
1288 (EXTRA_bison_SOURCES): New macro.
1289 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
1290 * src/system.h: Don't include config.h.
1291 * src/LR0.c: Include <config.h> first.
1292 * src/assoc.c: Likewise.
1293 * src/closure.c: Likewise.
1294 * src/complain.c: Likewise.
1295 * src/conflicts.c: Likewise.
1296 * src/derives.c: Likewise.
1297 * src/files.c: Likewise.
1298 * src/getargs.c: Likewise.
1299 * src/gram.c: Likewise.
1300 * src/lalr.c: Likewise.
1301 * src/location.c: Likewise.
1302 * src/main.c: Likewise.
1303 * src/muscle_tab.c: Likewise.
1304 * src/nullable.c: Likewise.
1305 * src/output.c: Likewise.
1306 * src/parse-gram.y: Likewise.
1307 * src/print.c: Likewise.
1308 * src/print_graph.c: Likewise.
1309 * src/reader.c: Likewise.
1310 * src/reduce.c: Likewise.
1311 * src/relation.c: Likewise.
1312 * src/state.c: Likewise.
1313 * src/symlist.c: Likewise.
1314 * src/symtab.c: Likewise.
1315 * src/tables.c: Likewise.
1316 * src/uniqstr.c: Likewise.
1317 * src/vcg.c: Likewise.
1318
877519f8
PE
1319 * src/parse-gram.y: Fix minor problems uncovered by lint.
1320 (current_lhs, current_lhs_location): Now static.
1321 (current_assoc): Remove unused variable.
1322
1323 Cleanups so that Bison-generated parsers have less lint.
1324 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
1325 Prepend /*ARGSUSED*/, for lint's sake.
1326 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
1327 definition if 'lint' is defined.
1328 (YYID): New macro (or function, if lint).
1329 All uses of /*CONSTCOND*/0 replaced by YYID(0).
1330 * data/yacc.c: Likewise.
1331 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
1332 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
1333 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
1334 is C++ only.
1335 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
1336 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
1337 Use YYID(0) rather than 0, for lint.
1338 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
1339 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
1340
f5228370
PE
13412005-12-07 Paul Eggert <eggert@cs.ucla.edu>
1342
1343 * tests/glr-regression.at
1344 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
1345 Close memory leak reported by twlevo.
1346
69ce078b
PE
13472005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
1348
6ff99711
PE
1349 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
1350 all stacks.
1351 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
1352 * tests/glr-regression.at (No users destructors if stack 0 deleted):
1353 New test case.
1354 (Duplicated user destructor for lookahead): This test now is expected
1355 to succeed.
1356
af3412cd
PE
13572005-12-01 Paul Eggert <eggert@cs.ucla.edu>
1358
32b5b719 1359 * NEWS: Document the following change.
af3412cd
PE
1360 * data/yacc.c: Say "parser skeleton" rather than "file", since
1361 it's no longer just a file.
1362 * data/glr.c: Grant a special exception for C GLR parsers, that
1363 reads like the already-existing exception for C LALR(1) parsers.
1364 * data/glr.cc: Likewise.
1365 * data/lalr1.cc: Likewise.
1366 * data/location.cc: Likewise.
1367 * data/yacc.c: Reword the "written by" statement to clarify that
1368 it was the parser skeleton, not the entire output file.
1369 * data/glr.c: Written by Paul Hilfinger.
1370 * data/glr.cc: Written by Akim Demaille.
1371 * data/lalr1.cc: Likewise.
1372
035aa4a0
PE
13732005-11-18 Paul Eggert <eggert@cs.ucla.edu>
1374
d9963c85
PE
1375 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
1376 Fix typos in previous change that broke 'make check'.
1377 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
1378 supported in C.
1379 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
1380 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
1381 We can revert this once things settle down.
1382
035aa4a0
PE
1383 * src/conflicts.c (conflicts_print): Don't print file name twice
1384 when %expect fails because there were no conflicts.
1385 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
1386 change.
1387 * tests/conflicts.at (%expect not enough, %expect too much):
1388 (%expect with reduce conflicts): Adjust to new behavior.
1389
13902005-11-18 Akim Demaille <akim@epita.fr>
1391
1392 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
1393 errors.
1394 * NEWS: Document this.
1395 * doc/bison.texinfo (Expect Decl): Likewise.
1396
d1ff7a7c
AD
13972005-11-16 Akim Demaille <akim@epita.fr>
1398
1399 Generalize the display of semantic values and locations in traces.
1400 * data/glr.c (yy_reduce_print): Fix indices (again).
1401 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
1402 literal integers.
1403 * data/lalr1.cc (yyreduce_print): Rename as...
1404 (yy_reduce_print): this.
1405 Display values and locations.
1406 * data/yacc.c (yy_reduce_print): Likewise.
1407 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
1408 (yysymprint): Move higher to be visible from yy_reduce_print).
1409 (yyparse): Adjust.
1410 * tests/calc.at: Adjust the expected length of the traces.
1411
6de5398d
AD
14122005-11-14 Akim Demaille <akim@epita.fr>
1413
1414 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
1415 from 1 to N, while values and location start at 0.
1416 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
1417
a1373f55
AD
14182005-11-14 Akim Demaille <akim@epita.fr>
1419
1420 * data/glr.c (yy_reduce_print): Fix the $ number.
1421
613d8952
AD
14222005-11-14 Akim Demaille <akim@epita.fr>
1423
1424 "Use" parse parameters.
1425 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
1426 * data/glr.c, data/glr.cc: Use them.
1427 * data/glr.c (YYUSE): Have a C++ definition that supports
1428 non-pointer types.
1429
b2741627
AD
14302005-11-14 Akim Demaille <akim@epita.fr>
1431
1432 * data/glr.c (yyexpandGLRStack): Declare only if defined.
1433
5059b5c8
AD
14342005-11-14 Akim Demaille <akim@epita.fr>
1435
42249483
AD
1436 * data/glr.cc: New.
1437 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 1438
4626a15d
AD
14392005-11-12 Akim Demaille <akim@epita.fr>
1440
1441 Let position and location be PODs.
1442 * data/location.cc (position::initialize, location::initialize): New.
1443 (position::position, location::location): Define only if
1444 b4_location_constructors is defined.
1445 * data/lalr1.cc (b4_location_constructors): Define it for backward
1446 compatibility.
1447 * doc/bison.texinfo (Initial Action Decl): Use initialize.
1448
14492005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
1450
1451 * data/lalr1.cc: Move the body of the ctor and dtor into the
1452 parser file (instead of the header).
1453 Wrap the implementations in a "namespace yy".
1454
14552005-11-12 Akim Demaille <akim@epita.fr>
1456
1457 Have glr.c include its header file when created.
1458 * data/glr.c (b4_shared_declarations): New.
1459 Output them verbatim in the parser if !%defines, otherwise
1460 output then in the header file, and include it instead.
1461
1989d947
AD
14622005-11-11 Akim Demaille <akim@epita.fr>
1463
1464 * data/glr.c: Comment changes.
1465
14662005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
1467
1468 When yydebug, report semantic and location values for reductions.
1469 * data/glr.c (yy_reduce_print): Report the semantic values and the
1470 locations.
1471 (YY_REDUCE_PRINT): Adjust.
1472 (yyglrReduce): Use them.
1473 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
1474 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
1475 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
1476 traces.
1477
02998094
AD
14782005-11-10 Akim Demaille <akim@epita.fr>
1479
1480 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
1481 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
1482 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
1483
5210672f
PE
14842005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
1485
1486 * m4/cxx.m4, examples/Makefile.am: Don't build
1487 examples/calc++ if no C++ compiler is available. (trivial change)
1488
a8991a1d
AD
14892005-11-09 Akim Demaille <akim@epita.fr>
1490
1491 * src/scan-skel.l: Use a couple of asserts.
1492
36b5e963
AD
14932005-11-03 Akim Demaille <akim@epita.fr>
1494
1495 In some (weird) cases, the final state number is incorrect.
1496 Reported by Alexandre Duret-Lutz.
1497 * src/LR0.c (state_list_append): Remove the computation of
1498 final_state.
1499 (save_reductions): Do it here.
1500 (get_state): Alpha conversion.
1501 (generate_states): Use a for loop.
1502 * src/gram.h (item_number_is_rule_number)
1503 (item_number_is_symbol_number): New.
1504 * src/state.c: Use assert.
1505 * src/system.h: Include assert.h.
1506 * tests/sets.at (Accept): New.
1507
44e7ead1
PH
15082005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
1509
1510 * data/glr.c (yyfill): Adjust comment.
36b5e963 1511 (yyresolveAction): Initialize default location properly
44e7ead1
PH
1512 for empty right-hand sides.
1513 (yydoAction): Ditto.
1514 Add comment explaining apparently dead code.
36b5e963
AD
1515 * tests/glr-regression.at
1516 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 1517 New test.
36b5e963 1518
e10a80ee
PE
15192005-10-30 Paul Eggert <eggert@cs.ucla.edu>
1520
1521 * bootstrap (cleanup_gnulib): New function. Use it to clean up
1522 gnulib when interrupted. This fixes some race conditions and
1523 works around some portability problems (one noted by Paul
1524 Hilfinger).
1525
067b32ee
AD
15262005-10-22 Akim <akim@epita.fr>
1527
1528 * Makefile.cfg: Adjust to config -> build-aux.
1529 Reported by twledo.
1530
4b367315
AD
15312005-10-21 Akim Demaille <akim@epita.fr>
1532
1533 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
1534 the %parse-params.
1535 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
1536 * data/yacc.c (b4_Pure_if): Rename as...
1537 (b4_yacc_pure_if): this.
1538 (YY_SYMBOL_PRINT, yyparse): Adjust.
1539 * doc/bison.texinfo: Formatting changes.
1540
24cc23d9
AD
15412005-10-21 Akim Demaille <akim@epita.fr>
1542
1543 Finish the transition config -> build-aux.
1544 * configure.ac, Makefile.am: Use build-aux.
1545 * config/prev-version, config/announce-gen, config/Makefile.am:
1546 Move to...
1547 * build-aux/prev-version, build-aux/announce-gen,
1548 * build-aux/Makefile.am: here.
1549
d4476375
AD
15502005-10-14 Akim Demaille <akim@epita.fr>
1551
1552 * examples/calc++/test: Use set -x only when VERBOSE.
1553
302c0aee
PE
15542005-10-13 Paul Eggert <eggert@cs.ucla.edu>
1555
1556 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
1557 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
1558
7625ec2c
AD
15592005-10-13 Akim Demaille <akim@epita.fr>
1560
1561 * src/scan-skel.l: Output the base name parts of the parser and
1562 header file names.
302c0aee 1563 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
1564 additional checks.
1565 Use this to exercise C++ outputs in subdirs.
1566 Reported by Oleg Smolsky.
1567
ba0fe3c7
PE
15682005-10-12 Paul Eggert <eggert@cs.ucla.edu>
1569
1570 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
1571 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
1572 Problem reported by John P. Hartmann.
1573 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
1574 already defined it.
1575
9b8a5ce0
AD
15762005-10-12 Akim Demaille <akim@epita.fr>
1577
1578 * src/parse-gram.y (version_check): Exit 63 to please missing
1579 (stands for "version mismatch).
1580 * tests/input.at, doc/bison.texinfo: Adjust.
1581
4f6e011e
PE
15822005-10-10 Paul Eggert <eggert@cs.ucla.edu>
1583
1584 Work around portability problems with Visual Age C compiler
1585 (xlc and xlC_r) reported by John P. Hartmann.
1586 * data/location.cc (initial_column, initial_line): Remove.
1587 All uses replaced by 0 and 1.
1588 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
1589 that xlc complains about.
1590 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 1591 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 1592 as __STDC__.
4d7aa45e
PE
1593 * data/yacc.c (YYMODERN_C): New macro, which also looks at
1594 __STDC_VERSION__. Use it everywhere instead of looking at
1595 __STDC__ and __cplusplus.
4f6e011e 1596
a1b3bf8c
AD
15972005-10-10 Akim Demaille <akim@epita.fr>
1598
1599 * examples/calc++/test: Be quiet unless VERBOSE.
1600
412e44aa
PE
16012005-10-05 Paul Eggert <eggert@cs.ucla.edu>
1602
2a4647a3
PE
1603 * data/c.m4 (yydestruct, yysymprint):
1604 Use YYUSE instead of casting to void.
1605 * data/glr.c (YYUSE): New macro.
1606 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
1607 Use it instead of rolling our own.
1608 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
1609 (YYCHK1):
1610 Use /*CONSTCOND*/ to suppress lint warnings.
1611 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
1612 (YY_STACK_PRINT): Use 'false' not '0'.
1613 (YYUSE): New macro.
1614 (yysymprint_, yydestruct_): Use it instead of rolling our own.
1615 * data/yacc.c (YYUSE): New macro.
1616 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
1617 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
1618 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
1619
1620
412e44aa
PE
1621 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
1622 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
1623
88c6637f
PE
16242005-10-04 Paul Eggert <eggert@cs.ucla.edu>
1625
2f4f028d
PE
1626 Undo the parts of the unlocked-I/O change that substituted
1627 putc or puts for printf. This might hurt performance a bit,
1628 but some people prefer the printf style.
1629 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
1630 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
1631 All uses replaced by YYFPRINTF and YYDPRINTF.
1632 * data/yacc.c: Likewise.
1633 * lib/bitset.c (bitset_print): Likewise.
1634 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
1635 putc and puts.
1636 * lib/lbitset.c (debug_lbitset): Likewise.
1637 * src/closure.c (print_firsts, print_fderives): Likewise.
1638 * src/gram.c (grammar_dump): Likewise.
1639 * src/lalr.c (look_ahead_tokens_print): Likewise.
1640 * src/output.c (escaped_output): Likewise.
1641 (user_actions_output): Break apart two printfs.
1642 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
1643 * src/reduce.c (reduce_print): Likewise.
1644 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
1645 * src/system.h: Include unlocked-io.h rathe than stdio.h.
1646
88c6637f
PE
1647 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
1648 Use assignments rather than casts-to-void to suppress
1649 unused-variable warnings. This pacifies 'lint'.
1650 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
1651 unused-variable warnings.
1652
fb32e373
JMG
16532005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1654
1655 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
1656
edb8f44f
PE
16572005-10-02 Paul Eggert <eggert@cs.ucla.edu>
1658
fb9c0b33
PE
1659 Use unlocked I/O for a minor performance improvement on hosts like
1660 GNU/Linux and Solaris that support unlocked I/O. The basic idea
1661 is to use the gnlib unlocked-io module, and to prefer putc and
1662 puts to printf when either will work (since the latter doesn't
1663 come in an unlocked flavor).
1664 * bootstrap (gnulib_modules): Add unlocked-io.
1665 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
1666 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
1667 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
1668 and similarly for puts and putc and printf.
1669 * data/yacc.c: Likewise.
1670 * lib/bitset.c (bitset_print): Likewise.
1671 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
1672 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
1673 to printf.
1674 * lib/lbitset.c (debug_lbitset): Likewise.
1675 * src/closure.c (print_firsts, print_fderives): Likewise.
1676 * src/gram.c (grammar_dump): Likewise.
1677 * src/lalr.c (look_ahead_tokens_print): Likewise.
1678 * src/output.c (escaped_output): Likewise.
1679 (user_actions_output): Coalesce two printfs.
2f4f028d 1680 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
1681 * src/reduce.c (reduce_print): Likewise.
1682 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 1683 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 1684
edb8f44f
PE
1685 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
1686 this confuses xgettext.
1687
b50d2359
AD
16882005-10-02 Akim Demaille <akim@epita.fr>
1689
1690 * bootstrap (gnulib_modules): Add strverscmp.
1691 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
1692 * m4/.cvsignore: Add strverscmp.m4.
1693 * src/parse-gram.y (%require): New token, new rule.
1694 (version_check): New.
1695 * src/scan-gram.l (%require): Adjust.
1696 * tests/input.at (AT_REQUIRE): New.
1697 Use it.
1698 * doc/bison.texinfo (Require Decl): New.
1699 (Calc++ Parser): Use %require.
1700
21667f64
AD
17012005-10-02 Akim Demaille <akim@epita.fr>
1702
1703 * data/location.cc: New.
1704
2b81e969
AD
17052005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
1706 Akim Demaille <akim@epita.fr>
1707
1708 Make sure -odir/foo.cc creates dir/location.hh etc.
1709 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
1710 (spec_file_prefix, spec_verbose_file, spec_graph_file)
1711 (spec_defines_file): Now const.
1712 (dir_prefix): New.
1713 (short_base_name): Remove.
1714 * src/files.c: Adjust.
1715 (dirname.h): Include.
1716 (base_name): Don't prototype it.
1717 (finput): Remove, duplicates gram_in.
1718 (full_base_name, short_base_name): Replace by...
1719 (all_but_ext, all_but_tab_ext): these.
1720 (compute_base_names): Rename as...
1721 (compute_file_name_parts): this.
1722 Update to compute the new variables, including dir_prefix.
1723 Adjust dependencies.
1724 * src/output.c (prepare): Output them.
1725 * src/reader.c: Adjust to use gram_in, not finput.
1726 * src/scan-skel.l (@dir_prefix@): New.
1727
ad6a9b97
JMG
17282005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1729
1730 * lib/subpipe.c: New function end_of_output_subpipe() added
1731 to allow support for non-posix systems. This is a no-op function
1732 for posix systems.
1733
1734 * lib/subpipe.h: New function end_of_output_subpipe() added
1735 to allow support for non-posix systems. This is a no-op function
1736 for posix systems.
1737
1738 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
1739 handle the lack of pipe/fork functionality on non-posix systems.
1740
1741 * djgpp/Makefile.maint: DJGPP specific file.
1742
1743 * djgpp/README.in: DJGPP specific file.
1744
1745 * djgpp/config.bat: DJGPP specific configuration file.
1746
1747 * djgpp/config.sed: DJGPP specific configuration file.
1748
1749 * djgpp/config.site: DJGPP specific configuration file.
1750
1751 * djgpp/config_h.sed: DJGPP specific configuration file.
1752
1753 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
1754
1755 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
1756
fc695704
AD
17572005-10-02 Akim Demaille <akim@epita.fr>
1758
1759 * data/location.cc: New, extract from...
1760 * data/lalr1.cc: here.
1761 (location.hh): Include it after the user prologue, in case the
1762 filename type is defined by the user.
1763 Forward declation location and position before the pre-prologue.
1764 (yyresult_): Rename as...
1765 (yyresult): this, it's a local variable, not an attribute.
1766 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
1767
17682005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
1769
1770 * examples/extexi: Restore the #line generation.
1771
fb9712a9
AD
17722005-09-30 Akim Demaille <akim@epita.fr>,
1773 Alexandre Duret-Lutz <adl@gnu.org>
1774
1775 Move the token type and YYSTYPE in the parser class.
1776 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
1777 (parser::token): New, from the moved free definition of tokens.
1778 (parser::semantic_value): Now a full definition instead of an
1779 indirection to YYSTYPE.
1780 (b4_post_prologue): No longer included in the header file, but
1781 in the implementation file.
1782 * doc/bison.texi (C+ Language Interface): Update.
1783 * src/parse-gram.y: Support unary %define.
1784 * tests/actions.at: Define global_tokens_and_yystype for backward
1785 compatibility until we update the tests.
1786 * tests/calc.at: Idem.
1787 (first_line, first_column, last_line, last_column): Define for lalr1.cc
1788 to simplify the code.
1789
55f0c7b1
PE
17902005-09-29 Paul Eggert <eggert@cs.ucla.edu>
1791
1792 Port to SunOS 4.1.4, which lacks strtoul and strerror.
1793 Ah, the good old days! Problem reported by Peter Klein.
1794 * bootstrap (gnulib_modules): Add strerror, strtoul.
1795 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
1796 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
1797
fb9712a9 17982005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
1799
1800 * data/c.m4 (b4_error_verbose_if): New.
1801 * data/lalr1.cc: Use it.
1802 (YYERROR_VERBOSE_IF): Remove.
1803 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
1804 parser members, replaced by...
1805 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
1806 local variables.
1807 (yysyntax_error_): Takes the state number as argument.
1808 (yyreduce_print_): Use the argument yyrule, not the former
1809 attribute yyn_.
1810
8a6f72f3
PE
18112005-09-26 Paul Eggert <eggert@cs.ucla.edu>
1812
1813 * bootstrap (gnulib_modules): Add verify.
1814 * lib/.cvsignore: Add verify.h.
1815 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
1816 * src/system.h (verify): Remove.
1817 Include verify.h instead.
1818 * src/tables.c (tables_generate): Use new API for 'verify'.
1819
0d50976f
PE
18202005-09-21 Paul Eggert <eggert@cs.ucla.edu>
1821
ebc3737e
PE
1822 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
1823 local variables whose names begin with 'yy'.
1824 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
1825 Trivial changes from Joel E. Denny.
1826
0d50976f
PE
1827 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
1828 it itself.
1829 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
1830 don't use alloca any more.
1831
1832 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
1833 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 1834 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
1835 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
1836 to match yacc.c, to test more hosts.
1837
a05b79df
PE
18382005-09-20 Paul Eggert <eggert@cs.ucla.edu>
1839
55289366
PE
1840 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
1841 doesn't affect behavior.
1842 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
1843 Solaris, AIX, MSC.
1844 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
1845 This works a bit better with glibc, if user code has already included
1846 stdlib.h.
1847 * doc/bison.texinfo (Bison Parser): Document that users can't
1848 arbitrarily use malloc and free for other purposes. Document
1849 that <alloca.h> and <malloc.h> might be included.
1850 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
1851 user must declare alloca.
1852
a05b79df
PE
1853 * HACKING (release): Forwarn the Translation Project about
1854 stable releses.
1855
3ab2ca22
AD
18562005-09-20 Akim Demaille <akim@epita.fr>
1857
1858 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
1859
a9739e7c
PE
18602005-09-19 Paul Eggert <eggert@cs.ucla.edu>
1861
a702593e
PE
1862 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
1863 (YYSTACK_ALLOC_MAXIMUM): Use it.
1864 (yysyntax_error): New function.
1865 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
1866 multiple syntax errors are reported, and alloca is being used.
1867 Instead, reallocate buffers twice as big each time, so that
1868 we waste at most half the allocated memory. Start with a small
1869 (128-byte) buffer that will suffice in most cases anyway.
1870 Use yysyntax_error to do most of the work.
1871
1872 * doc/bison.texinfo (Error Reporting, Table of Symbols):
1873 yynerrs is the number of errors reported, not the number of
1874 errors encountered.
1875
a9739e7c
PE
1876 * tests/glr-regression.at (Duplicated user destructor for lookahead):
1877 Mark it as expected to fail.
1878 Cast result of malloc; problem reported by twlevo@xs4all.nl.
1879 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
1880 Don't start user-code symbols with "yy", to avoid name space problems.
1881
f479c6c6
AD
18822005-09-19 Akim Demaille <akim@epita.fr>
1883
1884 Remove the traits, failed experiment.
1885 It never proved useful, and anyway because of the current
1886 definition, it was not possible to have several specialization of
1887 this traits, making it useless.
1888 * data/lalr1.cc (yy:traits): Remove.
1889 Inline its definitions in the parser class.
1890
e2586f82
AD
18912005-09-19 Akim Demaille <akim@epita.fr>
1892
1893 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
1894 least Mac OSX with a /usr/local install of gettext.
1895
2e8cf949
AD
18962005-09-19 Akim Demaille <akim@epita.fr>
1897
1898 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
1899 and yytoken for similarity with the other skeletons.
1900
c7fb0b90
AD
19012005-09-19 Akim Demaille <akim@epita.fr>
1902
4e26c69e 1903 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 1904
1bd0deda
PE
19052005-09-16 Paul Eggert <eggert@cs.ucla.edu>
1906
1907 * NEWS: Version 2.1.
1908
1909 * NEWS: Remove notice of yytname change, since it was never in an
1910 official release.
1911 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
1912 diagnostic.
1913 * src/output.c (prepare): Likewise.
1914 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
1915 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
1916 is not defined. This is an awful hack, but it's enough for now.
1917 All callers changed.
1918 * tests/glr-regression-at (make_value): Args are const pointers now,
1919 to avoid GCC warning.
1920 (Duplicated user destructor for lookahead): New test. Currently
1921 skipped. It fails on my host but I'm not sure it'll always fail.
1922
19232005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
1924
1925 * src/symtab.h (struct symbol): Declare the printer and destructor
1926 as const, to avoid accidental calls to free.
1927 (symbol_destructor_set, symbol_printer_set): Adjust.
1928 * src/symtab.c: Adjust.
1929
1bd0deda 19302005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
1931
1932 * data/c.m4 (b4_token_enums): New.
1933 (b4_token_defines): Rename as...
1934 (b4_token_enums_defines): this.
1935 (b4_token_defines): New, output only the #defines.
1936 * data/yacc.c, data/glr.c: Adjust.
1937 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
1938 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
1939 as default values.
1940
dbcdae2d
AD
19412005-09-16 Akim Demaille <akim@epita.fr>
1942
1943 * data/lalr1.cc (yylex_): Remove, inline its code.
1944 (yyreport_syntax_error_): Remove, replaced by...
1945 (yysyntax_error_): this which returns a string and leaves to the
1946 caller the call to the users' error function.
1947 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
1948 Move from members of the parser object...
1949 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
1950 to local variables of the parse function.
1951
70d8f291
AD
19522005-09-16 Akim Demaille <akim@epita.fr>
1953
1954 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
1955 since it's in Bison's name space.
1956
b47dbebe
PE
19572005-09-15 Paul Eggert <eggert@cs.ucla.edu>
1958
ae199bf1
PE
1959 * data/glr.c (yyresolveValue): Add default case to pacify
1960 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
1961
b47dbebe
PE
1962 * NEWS: Document when yyparse started to return 2.
1963 * doc/bison.texinfo (Parser Function): Document when yyparse
1964 returns 2.
1965
1966 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
1967 (b4_filename_type): Renamed back from b4_file_name_type. All uses
1968 changed.
1969 (class position): file_name -> filename (reverting). All uses changed.
1970
19712005-09-14 Paul Eggert <eggert@cs.ucla.edu>
1972
1973 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
1974 do anything if $@ exists. This reverts part of the 2005-07-07
1975 patch.
1976
00292f66
PE
19772005-09-11 Paul Eggert <eggert@cs.ucla.edu>
1978
1979 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
1980 contains obsolete information and isn't worth distributing as a
1981 separate file anyway.
1982 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
1983 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
1984 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
1985 (yyparse): Abort if user code uses longjmp to throw an unexpected
1986 value.
1987
a420f962
PE
19882005-09-09 Paul Eggert <eggert@cs.ucla.edu>
1989
00292f66
PE
1990 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
1991 Suggested by twlevo@xs4all.nl.
1992
127287e9
PE
1993 * data/glr.c (YYCHK1): Do not assume YYE is in range.
1994 This avoids a diagnostic from gcc -Wswitch-enum.
1995 Problem reported by twlevo@xs4all.nl.
1996
a420f962
PE
1997 * doc/bison.texinfo: Don't use "filename", as per GNU coding
1998 standards. Use "file name" or "file" or "name", depending on
1999 the context.
2000 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
2001 not to hack/foo.tab.c.
2002 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
2003 * data/glr.c: b4_filename -> b4_file_name.
2004 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
2005 All uses changed.
2006 (class position): filename -> file_name. All uses changed.
2007 * data/yacc.c: b4_filename -> b4_file_name.
2008 * lib/bitset.h: filename -> file_name in local vars.
2009 * lib/bitset_stats.c: Likewise.
2010 * src/files.c: Likewise.
2011 * src/scan-skel.l ("@output ".*\n): Likewise.
2012 * src/files.c (file_name_split): Renamed from filename_split.
2013 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
2014
20152005-09-08 Paul Eggert <eggert@cs.ucla.edu>
2016
2017 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
2018 to accommodate latest gnulib.
2019
2020 * tests/glr-regression.at (Duplicate representation of merged trees):
2021 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
2022
2023 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
2024 needed.
2025
42a6501d
PE
20262005-08-26 Paul Eggert <eggert@cs.ucla.edu>
2027
2028 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
2029 All uses changed. Invoke user destructor after an error during a
2030 split parse (trivial change from Joel E. Denny).
2031
2032 * tests/glr-regression.at
2033 (User destructor after an error during a split parse): New test case.
2034 Problem reported by Joel E. Denny in:
2035 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
2036
ef9a1faf
PE
20372005-08-25 Paul Eggert <eggert@cs.ucla.edu>
2038
5b4aaf78
PE
2039 * README-cvs: Give URLs for recommended tools.
2040 Mention Gzip version problem, and bootstrapping issues.
2041 Remove troubleshooting section, as it's somewhat obsolete.
2042
b5240ba5
PE
2043 * bootstrap (no_cache): New var, to accommodate different wget
2044 variants. Use it instead of '-C off'. Problem reported by
2045 twlevo@xs4all.nl.
2046
ef9a1faf
PE
2047 * data/glr.c (yydestroyStackItem): New function.
2048 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
2049 debugging information. Problem reported by Joel E. Denny.
2050
e6efa9da
AD
20512005-08-25 Akim Demaille <akim@epita.fr>
2052
2053 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
2054
adc90f13
PE
20552005-08-24 Paul Eggert <eggert@cs.ucla.edu>
2056
2057 * data/glr.c (yyrecoverSyntaxError, yyreturn):
2058 Don't invoke destructor on unresolved entries.
2059 * tests/glr-regression.at
2060 (User destructor for unresolved GLR semantic value): New test case.
2061 Problem reported by Joel E. Denny in:
2062 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
2063
f9315de5
PE
20642005-08-21 Paul Eggert <eggert@cs.ucla.edu>
2065
15d29c1f
PE
2066 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
2067 Add strnlen.c.
2068 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
2069 lib-prefix.m4, po.m4.
2070
dd5f2af2
PE
2071 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
2072 in yydestruct diagnostic, since it might not be an error.
2073 Problem reported by Joel Denny near end of
2074 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 2075 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
2076 * data/yacc.c (yyreturn): Likewise.
2077 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
2078
2079 * src/files.c: Remove obsolete FIXME comment.
2080
2081 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
2082 with the other templates, and to fix bogus run-on messages such
2083 as the one reported at the end of
2084 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
2085 All callers changed to avoid the newline.
2086 (yyprocessOneStack): Output two lines rather than one, to accommodate
2087 the above change. This changes the debug output format slightly.
2088
f9315de5
PE
2089 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
2090 reported by Joel E. Denny in
2091 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
2092 (trivial change).
2093 * tests/glr-regression.at (Duplicate representation of merged trees):
2094 New test, from Joel E. Denny in:
2095 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
2096 * THANKS: Add Joel E. Denny.
2097
2098 * configure.ac (AC_INIT): Bump to 2.0c.
2099
04098407
PE
21002005-07-24 Paul Eggert <eggert@cs.ucla.edu>
2101
2102 * NEWS: Version 2.0b.
2103
ca5d2013
PE
2104 * Makefile.am (SUBDIRS): Put examples before tests, so that
2105 "make check" doesn't finish with "All 1 tests passed".
2106
3d54b576
PE
2107 * tests/regression.at (Token definitions): Don't rely on
2108 AT_PARSER_CHECK for data that contains backslashes. It currently
2109 uses 'echo', and 'echo' isn't portable if its argument contains
2110 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
2111 that the byte '\0xff' is not printable in the C locale; it is,
2112 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
2113 not printable, so use '\0x81' to test.
2114
d53ae497
PE
2115 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
2116 version of GCC, since the macro is used with non-GCC compilers.
2117
fc01665e
PE
2118 Fix core dump reported by Pablo De Napoli in
2119 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
2120 * tests/regression.at (Invalid inputs with {}): New test.
2121 * src/parse-gram.y (token_name): Translate type before using
2122 it as an index.
2123
04098407
PE
2124 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
2125 the user's name space. All uses changed to __attribute__
2126 ((__unused__)).
2127 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
2128 Add __attribute__ ((__noreturn__)).
2129
2130 * etc/clcommit: Remove. We weren't using it, and it failed
2131 "make maintainer-distcheck".
2132 * Makefile.maint: Merge from coreutils.
2133 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
2134 (syntax-check-rules): Change list of rules as described below.
2135 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
2136 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
2137 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
2138 (sc_trailing_space): New rules.
2139 (sc_xalloc_h_in_src): Remove.
2140 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
2141 (sc_space_tab, sc_error_exit_success, sc_changelog):
2142 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
2143 (makefile-check, po-check, author_mark_check):
2144 (makefile_path_separator_check, copyright-check):
2145 Use grep -n, to make it easier to find violations.
2146 Use CVS_LIST and CVS_LIST_EXCEPT.
2147 (header_regexp, h_re): Remove.
2148 (dd_c): New macro.
2149 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
2150 (my-distcheck): Use more-modern GCC flags.
2151 (signatures, %.asc): Remove.
2152 (rel-files, announcement): Remove signatures.
2153 Restore old updating code, even though we don't use it, so
2154 that we're the same as coreutils.
2155 (alpha, beta, major): Depend on news-date-check.
2156 Make the upload commands.
2157
2158 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
2159 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
2160 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
2161 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
2162 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
2163 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
2164 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
2165 * tests/sets.at: Likewise.
2166
2167 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
2168 we comment out the Autoconf version number.
2169 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
2170 it's error-prone and "make maintainer-distcheck" rejects it.
2171
2172 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
2173 Indent calls to "error" to pacify "make maintainer-distcheck",
2174 when the calls are not intended to be translated.
2175 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
2176
2177 * src/Makefile.am (DEFS): Use +=, to pacify
2178 "make maintainer-distcheck".
2179 (bison_SOURCES): Add scan-skel.h.
2180 (sc_tight_scope): New rule, from coreutils.
2181
2182 * src/files.c (src_extension, header_extension):
2183 Now static, not extern.
2184 * src/getargs.c (short_options): Likewise.
2185 * src/muscle_tab.c (muscle_table): Likewise.
2186 * src/parse-gram.y (current_class, current_type, current_prec):
2187 Likewise.
2188 * src/reader.c (grammar_end, previous_rule_end): Likewise.
2189 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
2190 * src/main.c (main): Cast bindtextdomain and textdomain calls to
2191 void, to avoid warning when NLS is disabled.
2192 * src/output.c: Include scan-skel.h.
2193 (scan_skel): Remove decl, since scan-skel.h does this.
2194 (output_skeleton):
2195 Indent calls to "error" to pacify "make maintainer-distcheck".
2196 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
2197 * src/reader.h (gram_end, gram_lineno): New decls to pacify
2198 "make maintainer-distcheck".
2199 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
2200 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
2201 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
2202 (skel_lex_destroy, scan_skel): Move these decls to...
2203 * src/scan-skel.h: New file.
2204 * src/uniqstr.c (uniqstr_assert):
2205 Indent calls to "error" to pacify "make maintainer-distcheck".
2206
2207 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
2208 not @VAR@.
2209
2210 * tests/torture.at: Revamp to avoid misuse of atoi that
2211 "make maintainer-distcheck" complained about.
2212
2213 * examples/extexi (message): Don't print a message more than once,
2214 and omit line-number decoration that makes Emacs compile think
2215 that informative messages are worth worrying about.
2216
22172005-07-22 Paul Eggert <eggert@cs.ucla.edu>
2218
2219 * configure.ac: Update version number.
2220
2221 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
2222 accidentally.
2223 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
2224 autogenerated by the maintainer.
2225 * examples/calc++/.cvsignore: Add *.yy.
2226
2227 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
2228 * lib/bitset_stats.c (bitset_stats_init): Likewise.
2229 * lib/bitsetv.c (bitsetv_alloc): Likewise.
2230
2231 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
2232
2233 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
2234 from maintainer-distcheck about casting the argument of 'free'.
2235
2236 * NEWS: Mention recent yytname changes.
2237 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
2238
2239 * bootstrap: For translations that have not yet been upgraded to
2240 the new runtime-po domain, prime the pump by extracting the
2241 relevant strings from the obsolete translations. This code can be
2242 removed once the bison-runtime domain has been translated by each
2243 team.
2244
2245 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
2246 now that token names are already quoted.
2247
2248 Fix problem reported by Anthony Heading.
2249 * data/glr.c (YYTOKEN_TABLE): New macro.
2250 (yytname): Define if YYTOKEN_TABLE.
2251 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
2252 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
2253 (YYERROR_VERBOSE): Define the same way the other skeletons do.
2254 * src/output.c (prepare_symbols): Output token_table_flag.
2255
0ffda363
PE
22562005-07-21 Paul Eggert <eggert@cs.ucla.edu>
2257
2258 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
2259 again if the first call fails.
2260
2261 * data/glr.c (yytnamerr): New function.
2262 (yyreportSyntaxError): Use it to dequote most string literals.
2263 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
2264 with other skeletons. All uses changed.
2265 (yytnameerr_): New function.
2266 (yyreport_syntax_error): Use it to dequote most string literals.
2267 * data/yacc.c (yytnamerr): New function.
2268 (yyerrlab): Use it to decode most string literals.
2269 * doc/bison.texinfo (Decl Summary, Calling Convention):
2270 Clarify quoting convention of yytname.
2271 * src/output.c (prepare_symbols): Quote all names. This undoes
2272 the 2005-04-17 change, which is now accomplished (mostly) via
2273 changes in the parsers as described above.
2274 * tests/regression.at (Token definitions, Web2c Actions):
2275 Undo most 2005-04-17 change here, too.
2276
22772005-07-20 Paul Eggert <eggert@cs.ucla.edu>
2278
2279 Fix more problems reported by twlevo@xs4all.nl.
2280 * tests/cxx-type.at: Don't pipe output of ./types through sed to
2281 remove trailing spaces. This loses the exit status of ./types,
2282 and isn't needed since ./types shouldn't be emitting trailing
2283 spaces.
2284 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
2285 as the stack isn't valid in that case.
2286
2287 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
2288 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
2289 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
2290 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
2291 is used.
2292 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
2293 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
2294 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
2295 Likewise.
2296
2297 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
2298 overly-picky compilers that reject 'char *foo = "bar";'.
2299
2300 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
2301 to FILE * parameter, not to stderr. This fixes a typo introduced
2302 in the 2005-07-12 change.
2303
2304 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
2305 warnings from GCC 4.
2306
2307 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
2308 (yyglrShiftDefer, yysplitStack):
2309 Remove unused parameters b4_pure_formals. All uses changed.
2310 (yyglrShift): Remove unused parameters b4_user_formals.
2311 All uses changed.
2312 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
2313
6100a9aa
PE
23142005-07-18 Paul Eggert <eggert@cs.ucla.edu>
2315
258b75ca
PE
2316 Destructor cleanups and regularization among the three skeletons.
2317 * NEWS: Document the behavior changes.
2318 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
2319 stack before failing, as the cleanup code will do it for us now.
2320 * data/lalr1.cc (yyerrlab): Likewise.
2321 * data/glr.c (yyparse): Pop everything off the stack before
2322 freeing it, so that destructors get called properly.
2323 * data/lalr1.cc (yyreturn): Likewise.
2324 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
2325 This is more consistent.
2326 * doc/bison.texinfo (Destructor Decl): Mention more reasons
2327 why destructors might be called. 1.875 -> 2.1.
2328 (Destructor Decl, Decl Summary, Table of Symbols):
2329 Some English-language cleanups for %destructor.
2330 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
2331 Add output line for destructor of start symbol.
2332 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
2333 because of that same extra output line.
2334
1a059451
PE
2335 * NEWS: Document minor wording changes in diagnostics of
2336 Bison-generated parsers.
2337 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
2338 Remove unused formals. All uses changed.
2339 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
2340 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
2341 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
2342 Rename yyoverflowab to yyexhaustedlab.
2343 When memory exhaustion occurs during syntax-error reporting,
2344 report it separately rather than in a single diagnostic; this
2345 eases translation.
2346 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
2347 (Memory Exhausted): Renamed from Parser Stack Overflow.
2348 Revamp wording slightly to prefer "memory exhaustion".
2349 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
2350
97460c78
PE
2351 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
2352
30757c8c
PE
2353 Add i18n support to the GLR skeleton. Partially fix the C++
2354 skeleton; a C++ expert needs to finish this. Remove debugging
2355 msgids; there's little point to having them translated, since they
2356 can be understood only by someone who can read the
2357 (English-language) source code.
2358
2359 Generate runtime-po/bison-runtime.pot automatically, so that we
2360 don't have to worry about garbage getting in that file. We'll
2361 make sure after the next official release that old msgids don't
2362 get lost. See
2363 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
2364
2365 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
2366 Now auto-generated.
2367 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
2368 Fix typos in explanations of the runtime file.
2369 * bootstrap: Change gettext keyword from YYI18N to YY_.
2370 Use standard Makefile.in.in in runtime-po, since we'll arrange
2371 for backward-compatible bison-runtime.po files in a different way.
2372 * data/glr.c (YY_): New macro, from yacc.c.
2373 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
2374 Translate messages intended for users.
2375 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
2376 the wording in the other skeletons. We don't know that the memory
2377 is virtual.
2378 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
2379 Use same method that yacc.c uses.
2380 Don't translate debugging messages.
2381 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
2382 it doesn't work (yet), and requires C++ expertise to fix.
2383 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
2384 Move defn to a more logical place, to be consistent with other
2385 skeletons.
2386 Don't translate debugging messages.
2387 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
2388 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
2389 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
2390 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
2391
ac8c5689
PE
2392 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
2393 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
2394 void, not int.
2395 * tests/glr-regression.at (Badly Collapsed GLR States):
2396 Likewise.
2397 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
2398 yylex should return 0 at EOF rather than aborting.
2399
6100a9aa
PE
2400 Improve tests for stack overflow in GLR parser.
2401 Problem reported by twlevo@xs4all.nl.
2402 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
2403 All uses removed.
2404 (yyStackOverflow): Just longjmp, but with value 2 so that caller
2405 can handle the problem.
2406 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
2407 (yyparse): New local variable yyresult to record the result.
2408 Use result of setjmp to set it, rather than storing itinto
2409 struct.
2410 (yyDone): Remove label.
2411 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
2412 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
2413 if YYABORT is used).
2414 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
2415 yyparse status; put status > 1 into diagnostic.
2416 Check that status==2 works.
2417 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
2418 Use exit status 3 for failure to open (which shouldn't happen).
2419
15f40952
PE
24202005-07-17 Paul Eggert <eggert@cs.ucla.edu>
2421
67fd79c4
PE
2422 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
2423 1 on syntax error; just let yyparse do its thing.
2424 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
2425 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
2426 (Exploding the Stack Size with Alloca):
2427 (Exploding the Stack Size with Malloc):
2428 Expect exit status 2, not 1, since the parser is supposed to blow
2429 its stack. Problem reported by twlevo@xs4all.nl.
2430
15f40952
PE
2431 * data/glr.c (yyparse): Don't assume that the initial calls
2432 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
2433 Print a stack-overflow message and fail instead.
2434 Initialize the line-number information before creating the stack,
2435 so that the stack-overflow message can report line zero safely.
2436
f32c66b5
PE
24372005-07-14 Paul Eggert <eggert@cs.ucla.edu>
2438
a22ff96f 2439 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
2440 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
2441 (yyuserMerge): Provide a default case if b4_mergers is empty.
2442 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
2443 * tests/glr-regression.at
2444 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 2445 Add casts to pacify C++ compilers.
1beb0b24
PE
2446 * tests/glr-regression.at (Improper merging of GLR delayed action
2447 sets): Declare yylex before using it.
f32c66b5 2448 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
2449 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
2450 test for valgrind; valgrind is independent of g++.
2451 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
2452 for compatibility with POSIX 1003.1-2001 (if running coreutils).
2453 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
2454 Use a destructor, so that we can expand the stack. Change
2455 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 2456
d741bd1b
PE
24572005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
2458
2459 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
2460 a valgrind failure. Problem reported by twlevo@xs4all.nl.
2461
0410a6e0
PE
24622005-07-13 Paul Eggert <eggert@cs.ucla.edu>
2463
2464 * PACKAGING: New file, suggested by Bruno Haible and taken from
2465 similar wording in gettext's PACKAGING file.
2466 * NEWS: Mention PACKAGING.
2467 * Makefile.am (EXTRA_DIST): Add PACKAGING.
2468
f7ab6a50
PE
24692005-07-12 Paul Eggert <eggert@cs.ucla.edu>
2470
baf785db 2471 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
2472 * bootstrap: Get runtime translations into runtime-po.
2473 Create runtime-po files automatically, if possible.
2474 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
2475 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
2476 does not infringe on the user's name space.
2477 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
2478 * doc/bison.texinfo (Internationalization): Revamp the English
2479 and Texinfo syntax a bit, to try to make it clearer.
2480 (Bison Options, Option Cross Key): Mention --print-localedir.
2481 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
2482 YYENABLE_NLS. Quote a bit more.
2483 * runtime-po/.cvsignore: New file.
2484 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
2485 * runtime-po/Rules-quot: Remove; now created by bootstrap.
2486 * runtime-po/quot.sed: Likewise.
2487 * runtime-po/boldquot.sed: Likewise.
2488 * runtime-po/en@quot.header: Likewise.
2489 * runtime-po/en@boldquot.header: Likewise.
2490 * runtime-po/insert-header.sin: Likewise.
2491 * runtime-po/remove-potcdate.sin: Likewise.
2492 * runtime-po/Makevars: Likewise.
2493 * runtime-po/LINGUAS: Likewise.
2494 * runtime-po/de.po: Likewise; we will rely on the translation project
2495 to maintain this, so "bootstrap" should get it.
0410a6e0 2496 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
2497 its value.
2498 * src/main.c (main): Bind the bison-runtime domain, too.
2499
25002005-07-12 Bruno Haible <bruno@clisp.org>
2501
2502 * data/yacc.c: Include <libintl.h> when NLS is enabled.
2503 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
2504 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
2505 * runtime-po: New directory.
2506 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
2507 $(DOMAIN).pot-update rule, so that old messages are never dropped.
2508 * runtime-po/Rules-quot: New file, copied from po/.
2509 * runtime-po/quot.sed: Likewise.
2510 * runtime-po/boldquot.sed: Likewise.
2511 * runtime-po/en@quot.header: Likewise.
2512 * runtime-po/en@boldquot.header: Likewise.
2513 * runtime-po/insert-header.sin: Likewise.
2514 * runtime-po/remove-potcdate.sin: Likewise.
2515 * runtime-po/Makevars: New file.
2516 * runtime-po/POTFILES.in: New file.
2517 * runtime-po/LINGUAS: New file.
2518 * runtime-po/bison-runtime.pot: New file.
2519 * runtime-po/de.po: New file.
2520 * m4/bison.m4: New file.
2521 * Makefile.am (SUBDIRS): Add runtime-po.
2522 (aclocaldir, aclocal_DATA): New variables.
2523 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
2524 Define aclocaldir.
2525 * src/getargs.c (usage): Document --print-localedir option.
2526 (PRINT_LOCALEDIR_OPTION): New enum item.
2527 (long_options): Add --print-localedir option.
2528 (getargs): Handle --print-localedir option.
2529 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
2530 (Internationalization): New section.
2531
22dda0f0
AD
25322005-07-12 Akim Demaille <akim@epita.fr>
2533
2534 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
2535 for consistency with the rest of the code.
2536 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
2537 Add separators.
2538
82b248ad
AD
25392005-07-12 Akim Demaille <akim@epita.fr>
2540
2541 * src/parse-gram.y: Use %printer instead of YYPRINT.
2542
fa0e9314
AD
25432005-07-12 Akim Demaille <akim@epita.fr>
2544
867a3e00
AD
2545 * src/symtab.h, src/symtab.c (symbol_print): New.
2546 * src/symlist.h, src/symlist.c (symbol_list_print): New.
2547 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
2548
25492005-07-12 Akim Demaille <akim@epita.fr>
2550
2551 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
2552 b4_at_dollar and b4_dollar_dollar.
2553
e054b190
PE
25542005-07-11 Paul Eggert <eggert@cs.ucla.edu>
2555
2556 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
2557 and Pennello's paper.
2558
34160ec4
PE
25592005-07-09 Paul Eggert <eggert@cs.ucla.edu>
2560
407d4a75
PE
2561 * data/yacc.c (yyparse): Undo previous patch. Instead,
2562 set yylsp[0] and yyvsp[0] only if the initial action
2563 sets yylloc and yylval, respectively.
2564
34160ec4
PE
2565 * data/yacc.c (yyparse): In the initial action, set
2566 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
2567 This avoids the use of undefined variables if the initial
2568 action does not set yylloc and/or yylval.
2569
c3d5a4a7
PE
25702005-07-07 Paul Eggert <eggert@cs.ucla.edu>
2571
b34d96c1
PE
2572 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
2573 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
2574 Remove from CVS. These files are automatically generated.
2575 * examples/extexi: Clarify that this file is now part of Bison,
2576 not GNU M4, and that it works with any POSIX-compatible Awk.
2577 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
2578 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
2579 so that we also get calc++-parser.yy. Geneate it.
2580 Use $(AWK), not gawk, since any conforming Awk will do.
2581 Put comment before action, since older 'make' can't handle comment
2582 in action.
2583 $(BUILT_SOURCES): List all built sources, not just some of them.
2584 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
2585 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
2586 $($(calc_sources_generated)): Remove unnecessary test for existence
2587 of target. (This had a shell syntax error anyway; a stray "x".)
2588 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
2589 calc++-parser.yy.
2590 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
2591
c3d5a4a7
PE
2592 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
2593 implied by the other modules.
2594
828c373b
AD
25952005-07-06 Akim Demaille <akim@epita.fr>
2596
2597 Bind examples/calc++ to the package.
2598 * examples/calc++/Makefile: Remove, replaced by...
2599 * examples/calc++/Makefile.am: ... this new file.
2600 * examples/calc++/test: Remove input.
2601 * examples/calc++/compile: Remove.
2602 * examples/Makefile.am: New.
2603 * configure.ac, Makefile.am: Adjust.
2604 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
2605
63cb01d6
PE
26062005-07-05 Paul Eggert <eggert@cs.ucla.edu>
2607
fd2df2ed
PE
2608 * data/glr.c (yyFail): Drastically simplify; since the format argument
2609 never had any % directives, we can simply pass it to yyerror.
2610 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
2611 be modified later, as that is the usual style in glr.c.
2612 Problems reported by Paul Hilfinger.
2613
63cb01d6
PE
2614 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
2615 and size overflow errors.
2616 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
2617 in case the user prolog sets feature-test macros like _GNU_SOURCE.
2618 (YYSIZEMAX): New macro.
2619 (yystpcpy): New function, taken from yacc.c.
2620 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
2621 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
2622 so that we don't have to maintain their signatures.
2623 (yyFail): Check for buffer overflow, by using vsnprintf rather
2624 than vsprintf. Allocate a bigger buffer if possible.
2625 Report an error if buffer allocation fails.
2626 (yyStackOverflow): New function.
2627 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
2628 the initialization was successful. It might fail if storage was
2629 exhausted.
2630 (yyexpandGLRStack): Add more checks for storage allocation failure.
2631 Use yyStackOverflow to report failures.
2632 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
2633 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
2634 Don't assume stack number fits in int.
2635 (yysplitStack): Check for storage allocation failure.
2636 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
2637 can print diagnostics on storage allocation failure. All callers
2638 changed.
2639 (yyresolveValue): Use yybool for boolean.
2640 (yyreportSyntaxError): Check for size-calculation overflow.
2641 This code is taken from yacc.c.
2642 (yyparse): Check for storage allocation errors when allocating
2643 the initial stack.
2644
1c59e0a1
AD
26452005-07-05 Akim Demaille <akim@epita.fr>
2646
2647 Extract calc++ from the documentation.
2648 * doc/bison.texinfo (Calc++): Add the extraction marks.
2649 * examples/extexi: New, from the aborted GNU Programming 2E.
2650 Separate the different paragraph of a file with empty lines.
2651 * examples/Makefile: Use it to extract the whole calc++ example.
2652
8a0adb01
AD
26532005-06-24 Akim Demaille <akim@epita.fr>
2654
2655 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
2656 class typedefs.
2657
12545799
AD
26582005-06-22 Akim Demaille <akim@epita.fr>
2659
2660 * doc/bison.texinfo (C++ Language Interface): First stab.
2661 (C++ Parsers): Remove.
2662
99be0235
AD
26632005-06-22 Akim Demaille <akim@epita.fr>
2664
2665 * data/lalr1.cc (yylex_): Honor %lex-param.
2666
0ffd4fd1
AD
26672005-06-22 Akim Demaille <akim@epita.fr>
2668
2669 Start a set of simple examples.
2670 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
2671 * examples/calc++/calc++-driver.hh,
2672 * examples/calc++/calc++-parser.yy,
2673 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
2674 * examples/calc++/compile, examples/calc++/test: New.
2675
0925ebb4
PE
26762005-06-09 Paul Eggert <eggert@cs.ucla.edu>
2677
2678 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
2679 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
2680 which stems from the 2005-05-27 patch.
2681
43d3b664
PH
26822005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2683
2684 * data/glr.c: Modify treatment of unused parameters to permit use
2685 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
2686
3062864d
PE
26872005-05-30 Paul Eggert <eggert@cs.ucla.edu>
2688
2689 Fix infringement on user name space reported by Janos Zoltan Szabo.
2690 * data/yacc.c (yyparse): strlen -> yystrlen.
2691
989b5b8e
AD
26922005-05-30 Akim Demaille <akim@epita.fr>
2693
2694 * data/lalr1.cc (_): New.
2695 Translate the various messages.
2696
bedf57f5
PE
26972005-05-27 Paul Eggert <eggert@cs.ucla.edu>
2698
2699 Fix infringement on user name space reported by Bruno Haible.
2700 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
2701 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
2702 the user's name space.
2703 (alloca): Include <stdlib.h> to get it, if it's not built in.
2704 (YYMALLOC, YYFREE): Define only if needed.
2705 (malloc, free): Declare, but only if needed, as this infringes on
2706 the user name space.
2707
4d1801f1
PE
27082005-05-25 Paul Eggert <eggert@cs.ucla.edu>
2709
2710 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
2711 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
2712 with %d format.
2713 * lib/ebitset.c (min, max): Undef before defining.
2714 * lib/vbitset.c (min, max): Likewise.
2715 * lib/subpipe.c (create_subpipe): Save local variables in case
2716 vfork clobbers them.
2717
27182005-05-24 Bruno Haible <bruno@clisp.org>
2719
2720 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
2721 error message syntax used by gcc-4.0.
2722
b94a9e1e
PE
27232005-05-23 Paul Eggert <eggert@cs.ucla.edu>
2724
85ac3861
PE
2725 * README: Mention m4 1.4.3. Remove obsolete advice about
2726 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
2727
b94a9e1e
PE
2728 * bootstrap: Remove workaround for problem I encountered with
2729 gettext 0.14.1; it seems to be fixed now.
2730
51c30d21
PE
27312005-05-22 Paul Eggert <eggert@cs.ucla.edu>
2732
009ce67d
PE
2733 * NEWS: Version 2.0a.
2734
f2a97c62
PE
2735 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
2736 the previous change.
2737
c8775f93
PE
2738 Various maintainer cleanups.
2739 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
2740 conftest*, for benefit of CVS commands run at the same time as
2741 "configure". Add build-aux, since "bootstrap" now creates it and
2742 its subfiles.
2743 * Makefile.cfg (move_if_change): Remove.
2744 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
2745 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
2746 (po_repo, do-po-update, po-update, wget_files, get-targets):
2747 (config.guess-url_prefix, config.sub-url_prefix):
2748 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
2749 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
2750 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
2751 Remove.
2752 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
2753 this is now the recommended name.
2754 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
2755 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
2756 ylwrap. These files now go into build-aux.
2757 * config/move-if-change: Remove.
2758 * config/prev-version.txt: Bump from 1.75 to 2.0.
2759
3ea5f0ec
PE
2760 * bootstrap: Add stdio-safer, unistd-safer modules.
2761 Remove m4/glibc2.m4 (introduced by latest gnulib, but
2762 we don't need it).
2763 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
2764 fopen-safer.c, stdio-safer.h, unistd-safer.h.
2765 * lib/subpipe.c: Include "unistd-safer.h".
2766 (create_subpipe): Make sure all the newly-created
2767 file descriptors are > 2, so that diagnostics don't
2768 get sent down them (which might cause Bison to hang, in theory).
2769 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
2770 * src/files.c (xfopen): Use fopen_safer, not fopen.
2771
51c30d21
PE
2772 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
2773 yesterday's yacc.c fix.
2774
cea1469d
PE
27752005-05-21 Paul Eggert <eggert@cs.ucla.edu>
2776
3ea5f0ec
PE
2777 * data/glr.c, data/lalr1.cc: Update copyright date.
2778
cea1469d
PE
2779 Fix a destructor bug reported by Wolfgang Spraul in
2780 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
2781 * data/yacc.c (yyabortlab): Don't call destructor, and
2782 don't set yychar to EMPTY.
2783 (yyoverflowlab): Don't call destructor.
2784 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
2785 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
2786 since we no longer output the message "discarding lookahead token
2787 end of input ()".
2788
5e6f62f2
PH
27892005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
2790
2791 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
2792 fix a small glitch in debugging output.
2793 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
2794 after YY_SYMBOL_PRINT where needed.
2795
2796 (struct yyGLRState): Add some comments.
2797 (struct yySemanticOption): Add some comments.
2798 (union yyGLRStackItem): Add comment.
2799
2800 (yymergeOptionSets): Correct this to properly perform the union,
2801 avoiding infinite reported by Michael Rosien.
2802 Update comment.
2803
2804 * tests/glr-regression.at: Add test for GLR merging error reported
2805 by M. Rosien.
cea1469d 2806
0fb669f9
PE
28072005-05-13 Paul Eggert <eggert@cs.ucla.edu>
2808
2809 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
2810 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
2811 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
2812 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
2813 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
2814 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
2815 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
2816 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
2817 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
2818 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
2819 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
2820 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
2821 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
2822 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
2823 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
2824 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
2825 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
2826 src/derives.h, src/files.c, src/files.h, src/getargs.c,
2827 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
2828 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
2829 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
2830 src/output.h, src/parse-gram.c, src/parse-gram.h,
2831 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
2832 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
2833 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
2834 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
2835 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
2836 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
2837 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
2838 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
2839 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
2840 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
2841 tests/reduce.at, tests/regression.at, tests/sets.at,
2842 tests/synclines.at, tests/testsuite.at, tests/torture.at:
2843 Update FSF postal mail address.
2844
51f4735e
PE
28452005-05-11 Paul Eggert <eggert@cs.ucla.edu>
2846
2847 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
2848 Problem reported by Ralf Menzel.
2849
80ce3401
PE
28502005-05-01 Paul Eggert <eggert@cs.ucla.edu>
2851
2852 * tests/actions.at: Test that stack overflow invokes destructors.
2853 From Marcus Holland-Moritz.
2854 * data/yacc.c (yyerrlab): Move the code that destroys the stack
2855 from here....
2856 (yyreturn): to here. That way, destructors are called properly
2857 even if the stack overflows, or the user calls YYACCEPT or
2858 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
2859 (yyoverflowlab): Destroy the lookahead.
2860
28612005-04-24 Paul Eggert <eggert@cs.ucla.edu>
2862
2863 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
2864
72f000b0
PE
28652005-04-17 Paul Eggert <eggert@cs.ucla.edu>
2866
2867 * NEWS: Bison-generated C parsers no longer quote literal strings
2868 associated with tokens.
2869 * src/output.c (prepare_symbols): Don't escape strings,
2870 since users don't want to see C escapes.
2871 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
2872 in diagnostics.
c19683bb 2873 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
2874 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
2875
1094323f
PE
28762005-04-16 Paul Eggert <eggert@cs.ucla.edu>
2877
2878 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
2879 the data size is known to be too small and we can't increase it.
2880 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
2881
ca407bdf
PE
28822005-04-15 Paul Eggert <eggert@cs.ucla.edu>
2883
2884 * src/parse-gram.y: Include quotearg.h.
2885 (string_as_id): Quote $1 before using it as a key, since the
2886 lexer no longer quotes it for us.
2887 (string_content): Don't strip quotes, since lexer no longer
2888 quotes it for us.
2889 * src/scan-gram.l: Include quotearg.h.
2890 ("\""): Omit quote.
2891 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
2892 a key, since the rest of the lexer doesn't quote it.
2893 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
2894 * tests/regression.at (Token definitions): Check for backslashes
2895 in token strings.
2896
2897 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
2898 (YYSIZE_T): Define to unsigned long int when using an older compiler.
2899 (yyparse): Revamp code to generate long syntax error message, to
2900 make it easier to translate, and to avoid problems with arithmetic
2901 overflow. Change "virtual memory" to "memory" in diagnostic, since
2902 we don't know whether the memory is virtual.
2903
1ce59070
PE
29042005-04-13 Paul Eggert <eggert@cs.ucla.edu>
2905
2906 * NEWS: Bison-generated C parsers now use the _ macro to
2907 translate strings.
2908 * data/yacc.c (_) [!defined _]: New macro.
2909 All English strings wrapped inside this macro.
2910 * doc/bison.texinfo (Bison Parser): Document _.
2911 * po/POTFILES.in: Include src/parse-gram.c, since it now
2912 includes translateable strings that parse-gram.y doesn't.
2913
a749a695
PE
29142005-04-12 Paul Eggert <eggert@cs.ucla.edu>
2915
2916 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
2917 reverting the 2004-10-11 change to this function.
2918 (symbol_check_alias_consistency): Don't call symbol_type_set
2919 if the type name is already correct.
2920 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
2921
8fb1053b
PE
29222005-03-25 Paul Eggert <eggert@cs.ucla.edu>
2923
2924 * tests/regression.at (Token definitions): Don't use a token named
2925 c, as that generates a "#define c ..." that runs afoul of buggy
2926 stdlib.h that uses the identifier c as a member of struct
2927 drand48_data. Problem reported by Horst Wente.
2928
ff498c4a
PE
29292005-03-21 Paul Eggert <eggert@cs.ucla.edu>
2930
2931 * bootstrap: Change translation URL from
2932 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
2933 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
2934 redirection glitches. Problem reported by twlevo@xs4all.nl.
2935
65211d70
PE
29362005-03-20 Paul Eggert <eggert@cs.ucla.edu>
2937
2938 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
2939 after operands; POSIX says this isn't portable for the c99 command.
2940
9577fb1f
PE
29412005-03-18 Paul Eggert <eggert@cs.ucla.edu>
2942
2943 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
2944 immediately if a data overrun has occurred; this may help us track
2945 down what may be a spurious failure on MacOS.
2946
78b178f7
PE
29472005-03-17 Paul Eggert <eggert@cs.ucla.edu>
2948
a2599d0f
PE
2949 Respond to problems reported by twlevo@xs4all.nl.
2950
2951 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
2952
78b178f7
PE
2953 * src/vcg.h: Comment fix.
2954 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
2955 (G_CMAX): Change to -1 instead of INT_MAX.
2956
2957 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 2958
7296e729
PE
29592005-03-15 Paul Eggert <eggert@cs.ucla.edu>
2960
2961 * src/tables.c (state_number_to_vector_number): Put it inside an
2962 "#if 0", since it's not currently used. Problem reported by
2963 Roland McGrath.
2964
05ac60f3
PE
29652005-03-06 Paul Eggert <eggert@cs.ucla.edu>
2966
2967 * src/output.c (escaped_output): Renamed from
2968 escaped_file_name_output, since we now use it for symbol tags as
2969 well. All uses changed.
2970 (symbol_destructors_output, symbol_printers_output):
2971 Escape symbol tags too.
2972 Problem reported by Matyas Forstner in
2973 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
2974
2975 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
2976 not needed.
2977 * src/output.c (user_actions_output, token_definitions_output,
2978 symbol_destructors_output, symbol_printers_output): Likewise.
2979 * src/reader.c (prologue_augment): Likewise.
2980 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
2981
2982 * src/vcg.c (output_edge): Don't quote linestyle arg.
2983 Problem reported by twlevo@xs4all.nl.
2984
7eb453ac
PE
29852005-02-28 Paul Eggert <eggert@cs.ucla.edu>
2986
2987 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
2988 example, reported by Derek M Jones. Also, make the example even
2989 more outrageous, to better illustrate how bad the problem is.
2990
4c04c52a
PE
29912005-02-24 Paul Eggert <eggert@cs.ucla.edu>
2992
2993 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
2994 putsym. Typo reported by Sebastian Piping.
2995
a61e1620
PE
29962005-02-23 Paul Eggert <eggert@cs.ucla.edu>
2997
2998 * doc/bison.texinfo (Language and Grammar): some -> same
2999 (Epilogue): int he -> in the
3000 Typos reported by Sebastian Piping via Justin Pence.
3001
9ec93868
PE
30022005-02-07 Paul Eggert <eggert@cs.ucla.edu>
3003
3004 * tests/glr-regression.at (Improper handling of embedded actions
3005 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
3006 embedded actions and $-N in GLR parsers", work around an Autoconf bug
3007 with dollar signs in test names.
3008 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
3009 for a similar reason.
3010
73ce7e7e
PE
30112005-01-28 Paul Eggert <eggert@cs.ucla.edu>
3012
3013 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
3014 wants to redefine G_VIEW.
3015
2e72b98e
PE
30162005-01-27 Paul Eggert <eggert@cs.ucla.edu>
3017
3018 * src/vcg.c (get_view_str): Remove case for normal_view.
3019 Problem reported by twlevo@xs4all.nl.
3020
e0d634e5
PE
30212005-01-24 Paul Eggert <eggert@cs.ucla.edu>
3022
ccf830a4
PE
3023 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
3024 Problem reported by twlevo@xs4all.nl.
3025
e0d634e5
PE
3026 * doc/bison.texinfo: Change @dircategory from "GNU programming
3027 tools" to "Software development". Requested by Richard Stallman
3028 via Karl Berry.
3029
7bbc8cb0
PE
30302005-01-23 Paul Eggert <eggert@cs.ucla.edu>
3031
3032 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
3033 Problem reported by twlevo@xs4all.nl.
3034
08b770bc
PE
30352005-01-21 Paul Eggert <eggert@cs.ucla.edu>
3036
3037 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
3038 keyword; it's not needed with modern compilers, and it doesn't
3039 affect correctness with older compilers. Suggested by
3040 twlevo@xs4all.nl.
3041
95f22ad2
PE
30422005-01-17 Paul Eggert <eggert@cs.ucla.edu>
3043
3044 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
3045 gcc -Wswitch-default.
3046 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
3047 * data/yacc.c (yyparse): Likewise.
3048
d229d15c
PE
30492005-01-12 Paul Eggert <eggert@cs.ucla.edu>
3050
3051 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
3052 already. Let config.h define any nonstandard values.
3053
ecadd90f
PE
30542005-01-10 Paul Eggert <eggert@cs.ucla.edu>
3055
3056 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
3057 for the benefit of slower hosts. Problem reported by
3058 Nelson H. F. Beebe.
3059
213744b5
PE
30602005-01-07 Paul Eggert <eggert@cs.ucla.edu>
3061
3062 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
3063 being defined and not used.
3064 * data/lalr1.cc (yyparse): Likewise.
3065 Use "if (false)" rather than "if (0)".
3066
249d3236
PE
30672005-01-05 Paul Eggert <eggert@cs.ucla.edu>
3068
3069 * TODO: Mention that we should allow NUL bytes in tokens.
3070
987cc1fb
PE
30712005-01-02 Paul Eggert <eggert@cs.ucla.edu>
3072
3073 * src/scan-skel.l (<<EOF>>): Don't close standard output.
3074 Problem reported by Hans Aberg.
3075
08fe02d9
PE
30762005-01-01 Paul Eggert <eggert@cs.ucla.edu>
3077
3078 * src/getargs.c (version): Happy new year; update overall
3079 program copyright date from 2004 to 2005.
3080
3081 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
3082 Problem reported by Hans Aberg.
3083 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
3084 (Output file names.): Add a test for the case when standard output
3085 is closed.
3086
010c0266
PE
30872004-12-26 Paul Eggert <eggert@cs.ucla.edu>
3088
3089 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
3090 to fix an oversight in the Bison 2.0 manual.
3091
da12206a
PE
30922004-12-25 Paul Eggert <eggert@cs.ucla.edu>
3093
3094 * NEWS: Version 2.0. Reformat the existing news items since
3095 1.875, so that related items are grouped together.
3a4734aa 3096 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
3097 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
3098
c935d934
PE
3099 * tests/torture.at (Exploding the Stack Size with Alloca): Set
3100 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
3101 otherwise, we're not testing alloca. Unfortunately there's no
3102 simple way to consult HAVE_ALLOCA here.
3103
da12206a
PE
3104 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
3105 for yymsg, too.
3106
3107 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
3108 hand. This avoids a warning about comparing int to size_t when
3109 GCC warnings are enabled.
3110
0a2c5137
PE
31112004-12-22 Paul Eggert <eggert@cs.ucla.edu>
3112
d7e14fc0
PE
3113 * NEWS: Bison-generated parsers no longer default to using the
3114 alloca function (when available) to extend the parser stack, due
3115 to widespread problems in unchecked stack-overflow detection.
3116 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
3117 responsibility to set it to a positive value. This lets the user
3118 specify a value that is not a preprocessor constant.
3119 * data/yacc.c (YYMAXDEPTH): Likewise.
3120 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
3121 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
3122 to be a compile-time constant. However, explain the constraints on it.
3123 Also, explain the constraints on YYINITDEPTH.
3124 (Table of Symbols): Explain that alloca is no longer the default.
3125 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
3126 to 1.
3127
0a2c5137
PE
3128 * doc/bison.texinfo (Location Default Action): Mention that n must
3129 be zero when k is zero. Suggested by Frank Heckenbach.
3130
e019c247
AD
31312004-12-22 Akim Demaille <akim@epita.fr>
3132
3133 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
3134 (parser::state_type, parser::semantic_type, parser::location_type):
3135 Private, not public.
3136 (parser::parse): Return ints, not bool.
3137 Returning a bool introduces a problem: 0 corresponds to false, and
3138 it seems weird to return false on success. Returning true changes
3139 the conventions for yyparse.
3140 Alternatively we could return void and send an exception.
3141 There is no clear consensus (yet?).
3142 (state_stack, semantic_stack, location_stack): Rename as...
3143 (state_stack_type, semantic_stack_type, location_stack_type): these.
3144 Private, not public.
3145 * tests/c++.at: New.
3146 * tests/testsuite.at, tests/Makefile.am: Adjust.
3147
72731bb7
AD
31482004-12-21 Akim Demaille <akim@epita.fr>
3149
3150 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
3151
9a0d8bec
AD
31522004-12-21 Akim Demaille <akim@epita.fr>
3153
3154 Don't impose std::string for filenames.
3155
3156 * data/lalr1.cc (b4_filename_type): New.
3157 (position::filename): Use it.
3158 (parser.hh): Move the inclusion of stack.hh and location.hh below
3159 the user code, so that needed headers for the filename type can be
3160 included first.
72731bb7
AD
3161 Forward declare them before the user code.
3162 * tests/Makefile.am (check-local, installcheck-local): Pass
3163 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 3164
99880de5
AD
31652004-12-20 Akim Demaille <akim@epita.fr>
3166
3167 Use more STL like names: my_class instead of MyClass.
3168
3169 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
3170 (SemanticStack, SemanticType, StateStack, StateType)
3171 (TokenNumberType, Stack, Slice, Traits, Parser::location)
3172 (Parser::value): Rename as...
3173 (location_stack, location_type, rhs_number_type, semantic_stack)
3174 (semantic_type, state_stack, state_type, token_number_type, stack)
3175 (slice, traits, parser::yylloc, parser::yylval): these.
3176
3177 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
3178
9bec482e
PE
31792004-12-19 Paul Eggert <eggert@cs.ucla.edu>
3180
3181 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
3182 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
3183
f6fbd3da
PE
31842004-12-17 Paul Eggert <eggert@cs.ucla.edu>
3185
3186 Remove uses of 'short int' and 'unsigned short int'. This raises
3187 some arbitrary limits. It uses more memory but nowadays that's
3188 not much of an issue.
3189
3190 This change does not affect the generated parsers; that's a different
3191 task, as some users will want to conserve memory there.
3192
3193 Ideally we should use size_t to represent all object counts, and
3194 something like ptrdiff_t to represent signed differences of object
3195 counts; but that will require more code-cleanup than I have the
3196 time to do right now.
3197
3198 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
3199 Use size_t, not int or short int, to count objects.
3200 * src/closure.c (nritemset, closure): Likewise.
3201 * src/closure.h (nritemset, closure): Likewise.
3202 * src/nullable.c (nullable_compute): Likewise.
3203 * src/print.c (print_core): Likewise.
3204 * src/print_graph.c (print_core): Likewise.
3205 * src/state.c (state_compare, state_hash): Likewise.
3206 * src/state.h (struct state): Likewise.
3207 * src/tables.c (default_goto, goto_actions): Likewise.
3208
3209 * src/gram.h (rule_number, rule): Use int, not short int.
3210 * src/output.c (prepare_rules): Likewise.
3211 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
3212 errs, reductions): Likewise.
3213 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
3214 Likewise.
3215 * src/tables.c (vector_number, tally, action_number,
3216 ACTION_NUMBER_MINIMUM): Likewise.
3217 * src/output.c (muscle_insert_short_int_table): Remove.
3218
efeed023
AD
32192004-12-17 Akim Demaille <akim@epita.fr>
3220
3221 * data/lalr1.cc: Extensive Doxygenation.
3222 (error_): Rename as...
3223 (error): this, since it is visible to the user.
3224 Adjust callers.
3225 (Parser::message): Now an automatic variable from...
3226 (Parser::yyreport_syntax_error_): here.
3227 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
3228 Parser::error.
3229 * tests/input.at: Escape $.
3230
bc82c5a5
PE
32312004-12-16 Paul Eggert <eggert@cs.ucla.edu>
3232
3233 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
3234 Parenthesize rhs to avoid obscure problems with mistakes like
3235 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
3236 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
3237 b4_rhs_location): Likewise.
3238 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
3239 b4_rhs_location): Likewise.
3240
fd19f271
AD
32412004-12-16 Akim Demaille <akim@epita.fr>
3242
3243 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
3244 yacc.c: be sure to stay within yycheck_.
3245 * tests/actions.at: Re-enable C++ tests.
3246
10454ea4
AD
32472004-12-16 Akim Demaille <akim@epita.fr>
3248
3249 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
3250 real.
3251
c5b95ccf
AD
32522004-12-16 Akim Demaille <akim@epita.fr>
3253
3254 Use #define to handle the %name-prefix.
3255
3256 * data/glr.c, data/yacc.c: Comment changes.
3257 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
3258 so that one can refer to yylex in the parser file, and have it
3259 renamed, as is the case with other skeletons.
3260
617a8f12
AD
32612004-12-16 Akim Demaille <akim@epita.fr>
3262
3263 Move lalr1.cc internals into yy*.
3264
3265 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
3266 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
3267 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
3268 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
3269 (empty_, final_, terror_, errcode_, ntokens_)
3270 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
3271 (looka_, ilooka_, error_range_, nerrs_):
3272 Rename as...
3273 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
3274 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
3275 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
3276 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
3277 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
3278 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
3279 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
3280 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
3281 these.
3282
1e547e6e
PE
32832004-12-15 Paul Eggert <eggert@cs.ucla.edu>
3284
3285 Fix some problems reported by twlevo at xs4all.
3286 * src/symtab.c (symbol_new): Report an error if the input grammar
3287 contains too many symbols. This is better than calling abort() later.
3288 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
3289 (struct node, struct graph):
3290 Rename member expand to stretch. All uses changed.
3291 (struct graph): Remove member layoutalgorithm. All uses removed.
3292 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
3293 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
3294 All uses changed.
3295 (N_STRETCH): Rename from N_EXPAND. All uses changed.
3296
735d6bd4
AD
32972004-12-15 Akim Demaille <akim@epita.fr>
3298
3299 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
3300 Add more Doxygen comments.
3301 (symprint_, stack_print_, reduce_print_, destruct_, pop)
3302 (report_syntax_error_, translate_): Rename as...
3303 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
3304 (yypop_, yyreport_syntax_error_, yytranslate_): this.
3305
2e1f5829
AD
33062004-12-15 Akim Demaille <akim@epita.fr>
3307
3308 * data/lalr1.cc (lex_): Rename as...
3309 (yylex_): this.
3310 Move the trace here.
3311 Take the %name-prefix into account.
3312 Reported by Alexandre Duret-Lutz.
3313
a3cb6248
AD
33142004-12-15 Akim Demaille <akim@epita.fr>
3315
3316 Simplify the C++ parser constructor.
3317
3318 * data/lalr1.cc (debug_): Rename as...
3319 (yydebug_): so that the parser's internals are always in the yy*
3320 pseudo namespace.
3321 Adjust uses.
3322 (b4_parse_param_decl): Remove the leading comma as it is now only
3323 called as unique argument list.
3324 (Parser::Parser): Remove the constructor accepting a location and
3325 an initial debugging level.
3326 Remove from the other ctor the argument for the debugging level.
3327 (debug_level_type, debug_level, set_debug_level): New.
3328
3329 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
3330 constructor calls.
3331
07fed891
AD
33322004-12-15 Akim Demaille <akim@epita.fr>
3333
3334 Remove b4_root related material: failure experiment
a3cb6248 3335 (which goal was to allow to derive from a class).
07fed891
AD
3336
3337 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
3338 definitions and uses.
3339
e603eaa5
PE
33402004-12-14 Paul Eggert <eggert@cs.ucla.edu>
3341
3342 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
3343 not 2, since it's not portable to subtract 1 from the start of an
3344 array. The new item 0 is never set or used. All uses changed.
3345
3346 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
3347 the default definition of YYLLOC_DEFAULT. Problem reported
3348 by Frank Heckenbach.
3349
fafb007d
PE
33502004-12-12 Paul Eggert <eggert@cs.ucla.edu>
3351
3352 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
3353 the normal case and one for the error case. Just use the
3354 first one uniformly. Problem reported by Frank Heckenbach.
3355 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
3356 use exactly the same macro in both places.
3357 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
3358 so that the normal-case YYRHSLOC works for the error case too.
3359 All uses changed.
3360 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
3361 (YYLLOC_DEFAULT): Use the same macro as glr.c.
3362 * doc/bison.texinfo (Location Default Action): Don't claim that
3363 we have an array of locations. Use the same macro for both glr
3364 and lalr parsers. Mention YYRHSLOC. Mention what happens when
3365 the index is 0.
3366
48814dcd
PE
33672004-12-10 Paul Eggert <eggert@cs.ucla.edu>
3368
a4e1a53b
PE
3369 * HACKING: Update email addresses to send announcements to.
3370
48814dcd
PE
3371 * configure.ac (AC_INIT): Bump version to 1.875f.
3372
337116ba
PE
33732004-12-10 Paul Eggert <eggert@cs.ucla.edu>
3374
3375 * NEWS: Version 1.875e.
3376 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
3377
3378 * src/scan-skel.l: Include "complain.h", for "fatal".
3379
3380 * src/relation.h (relation_print, relation_digraph):
3381 Relation sizes are of type relation_node, not size_t (this is
3382 merely a doc fix, since the two types are equivalent).
3383 (relation_transpose): Relation sizes are of type relation_node,
3384 not int.
3385 * src/relation.c: Likewise.
3386 (top, infinity): Now of type relation_node, not int.
3387 (traverse, relation_transpose): Use relation_node, not int.
3388
3389 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
3390 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
3391 (yyparse): Remove unused local introduced in 2004-10-25 patch.
3392
3393 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 3394 specifying whether the test should be skipped. Use it tp
337116ba 3395 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 3396 fail on some hosts, and should be skipped.
337116ba 3397
da2a7671
PE
33982004-12-08 Paul Eggert <eggert@cs.ucla.edu>
3399
3400 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
3401 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
3402 unless otherwise specified below.
3403
3404 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
3405 to allocate kernel_base, kernel_items, kernel_size, since
3406 they needn't be initialized to 0.
3407 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
3408 * src/closure.c (new_closure): Likewise, for itemset.
3409 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
3410 * src/lalr.c (set_goto_map): Likewise, for temp_map.
3411 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
3412 (build_relations): Likewise for edge, states1, includes.
3413 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
3414 * src/reader.c (packgram): Likewise, for ritem, rules.
3415 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
3416 * src/relation.c (relation_digraph): Likewise for VERTICES.
3417 (relation_transpose): Likewise for new_R, end_R.
3418 * src/symtab.c (symbols_token_translations_init): Likewise for
3419 token_translations.
3420 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
3421 (token_actions): Likewise for yydefact, actrow, conflrow,
3422 conflict_list.
3423 (save_column): Likewise for froms[symno], tos[symno].
3424 (goto_actions): Likewise for state_count.
3425 (pack_table): Likewise for base, pos, check.
3426 (tables_generate): Likewise for width.
3427
3428 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
3429 for initial core. Just have a separate core, so we needn't worry
3430 about whether kernel_size and kernel_base are initialized.
3431
3432 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
3433 kernel_size, kernel_items): Remove unnecessary initialization.
3434 * src/conflicts.c (conflicts): Likewise.
3435 * src/derives.c (derives): Likewise.
3436 * src/muscle_tablc (muscle_insert): Likewise.
3437 * src/relation.c (relation_digraph): Likewise.
3438 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
3439 conflrow, conflict_table, conflict_list, table, check):
3440 Likewise.
3441
3442 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
3443 This is because all callers pass unsigned int.
3444 * src/closure.h (new_closure): Likewise.
3445
3446 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
3447 (build_relations): Initialize includes[i] in all cases.
3448 * src/reader.c (packgram): Always initialize rules[ruleno].prec
3449 and rules[ruleno].precsym. Initialize members in order.
3450 * src/relation.c (relation_transpose): Always initialize new_R[i]
3451 and end_R[i].
3452 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
3453
3454 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
3455 conflict_list[0] was always 0, but now it isn't initialized.
3456
3457 * src/table.c (table_grow): When conflict_table grew, the grown
3458 area wasn't cleared. Fix this.
3459
3460 * lib/.cvsignore: Add strdup.c, strdup.h.
3461 * m4/.cvsignore: Add strdup.m4.
3462
00baeeac
PE
34632004-12-07 Paul Eggert <eggert@cs.ucla.edu>
3464
3465 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
3466 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
3467 GOTO_NUMBER_MAXIMUM, since we occasionally compute
3468 ngotos + 1 without checking for overflow.
3469 (build_relations): Use END_NODE, not -1, to denote end of edges.
3470 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
3471 build_relations): Use goto_number, not int, for goto numbers.
3472 * src/tables.c (save_column, default_goto): Likewise.
3473
be3d9d42
AD
34742004-11-23 Akim Demaille <akim@epita.fr>
3475
3476 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
3477 of #defining from yystype.
3478 Don't typedef yystype, C++ does not need it.
3479 This lets it possible to forward declare it as union.
3480
78e526d5
PE
34812004-11-23 Paul Eggert <eggert@cs.ucla.edu>
3482
3483 * bootstrap (gnulib_modules): Add extensions.
3484 Problem reported by Jim Meyering.
3485
afbb696d
PE
34862004-11-22 Paul Eggert <eggert@cs.ucla.edu>
3487
3488 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
3489 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
3490 src/system.h, src/tables.c: XFREE -> free, to accommodate
3491 recent change to gnulib xalloc.h.
78e526d5 3492 Problem reported by Jim Meyering.
afbb696d 3493
c1f8f16a
AD
34942004-11-17 Akim Demaille <akim@epita.fr>
3495
3496 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
3497
34982004-10-28 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
3499 Alexandre Duret-Lutz <adl@gnu.org>
3500
3501 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
3502 changes.
3503 (YYCDEBUG): Adjust.
3504 Use it instead of cdebug_.
3505 (Parser::debug_stream, Parser::set_debug_stream): New.
3506 (Parser::symprint_): Define cdebug_ for temporary backward
3507 compatibility.
3508 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
3509 debug_stream ().
3510
68e11668
AD
35112004-11-17 Akim Demaille <akim@epita.fr>
3512
3513 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
3514 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
3515 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
3516 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
3517
97cbc73e
PE
35182004-10-27 Paul Eggert <eggert@cs.ucla.edu>
3519
3520 * data/glr.c (yyloc_default): Remove; not used.
3521 Problem reported by Frank Heckenbach.
3522
e342c3be
AD
35232004-10-25 Akim Demaille <akim@epita.fr>
3524
3525 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
3526 Introduce another definition to address simple location arrays.
3527 (yyGLRStack): New member: yyerror_range.
3528 (yyrecoverSyntaxError, yyparse): Update it.
3529 (yyrecoverSyntaxError): Use it when shifting the error token to
3530 have an accurate range, equivalent to the one computed by both
3531 yacc.c and lalr1.cc.
3532 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
3533 that column numbers start at column 0, as per GNU Coding
3534 Standards, the others tests, and the doc.
3535 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
3536 Adjust to the above change (first column is 0).
3537 And adjust the location of the "<error>", now covering the whole
3538 line.
3539
93602feb 35402004-10-22 Akim Demaille <akim@epita.fr>
04098407 3541 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
3542
3543 Remove some arbitrary limits on goto numbers and relations.
3544 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
3545 initial values, since they're never used.
3546 (set_goto_map): ngotos is now unsigned, so test for overflow
3547 by seeing whether it wraps around to zero.
3548 * src/lalr.h (goto_number): Now size_t, not short int.
3549 (GOTO_NUMBER_MAXIMUM): Remove.
3550 * src/relation.c (relation_print, traverse, relation_transpose):
3551 Check for END_NODE rather than looking at sign.
3552 * src/relation.h (END_NODE): New macro.
3553 (relation_node): Now size_t, not short int.
3554
dba08b04
PE
35552004-10-22 Paul Eggert <eggert@cs.ucla.edu>
3556
3557 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
3558 keyword, not an identifier. Problem reported by Baron Schwartz in
3559 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
3560
df09ef2e
AD
35612004-10-11 Akim Demaille <akim@epita.fr>
3562
3563 * src/symtab.c (symbol_check_alias_consistency): Also check
3564 type names, destructors, and printers.
3565 Reported by Alexandre Duret-Lutz.
3566 Recode the handling of associativity and precedence in terms
3567 of symbol_precedence_set.
3568 Accept no redeclaration at all, not even equal to the previous
3569 value.
3570 (redeclaration): New.
3571 Use it to factor redeclaration complaints.
3572 (symbol_make_alias): Don't set the type of the alias, let
3573 symbol_check_alias_consistency do it as for other features.
3574 * src/symtab.h (symbol): Add new member prec_location, and
3575 type_location.
3576 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
3577 * tests/input.at (Incompatible Aliases): New.
3578
146bc99d
PE
35792004-10-09 Paul Eggert <eggert@cs.ucla.edu>
3580
3581 .cvsignore fixes to accommodate gnulib changes,
3582 and the practice of naming build directories "_build".
3583 * .cvsignore: Add "_*". Sort.
3584 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
3585 * m4/.cvsignore: Add "*_gl.m4".
3586
e503aa60
AD
35872004-10-06 Akim Demaille <akim@epita.fr>
3588
3589 * src/parse-gram.y (add_param): Fix the truncation of trailing
3590 spaces.
3591
b4a20338
AD
35922004-10-05 Akim Demaille <akim@epita.fr>
3593
3594 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
3595 whether the reducion was empty or not. This leaves room to
3596 improve the use of YYLLOC_DEFAULT in such a case.
3597 lalr1.cc is still experimental, so changing this is acceptable.
3598 And finally, there are probably not many users who changed the
3599 handling of locations in GLR, so changing is admissible too.
3600
3601 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
3602 empty reduction, set @$ to an empty location ending the previously
3603 stacked symbol.
3604 Adjust uses to make sure the code is triggered on empty
3605 reductions.
3606 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
3607 expected output: empty reductions have empty locations.
3608
f85a5e6f
AD
36092004-09-29 Akim Demaille <akim@epita.fr>
3610
3611 * data/lalr1.cc: Move towards a more standard C++ coding style
3612 for templates: Class < T > -> Class<T>.
3613
b203fc2c
AD
36142004-09-29 Akim Demaille <akim@epita.fr>
3615
3616 * data/lalr1.cc: Reinstall the former ctor, for sake of
3617 compatibility, but warn it will be removed.
3618 Move towards a more standard C++ coding style (i.e., type *var ->
3619 type* var).
3620
5b7e1e73
PE
36212004-09-27 Paul Eggert <eggert@cs.ucla.edu>
3622
3fee967f
PE
3623 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
3624 since it's less likely to work if NULs are involved in the future.
5b7e1e73 3625
0dcca5c2
AD
36262004-09-27 Akim Demaille <akim@epita.fr>
3627
3628 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
3629
6dde1c82
AD
36302004-09-27 Akim Demaille <akim@epita.fr>
3631
3632 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 3633 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
3634 and argument names.
3635 (b4_cc_constructor_call): Likewise.
3636
b233d555
AD
36372004-09-24 Akim Demaille <akim@epita.fr>
3638
3639 * src/parse-gram.y (add_param): Strip the leading and trailing
3640 blanks from a formal argument declaration.
3641 (YY_LOCATION_PRINT): New.
3642
619404e3
AD
36432004-09-24 Akim Demaille <akim@epita.fr>
3644
3645 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
3646 after the location.
3647
dd8d9022
AD
36482004-09-24 Akim Demaille <akim@epita.fr>
3649
3650 * doc/bison.texinfo (Table of Symbols): Sort.
3651
0092f063
AD
36522004-09-21 Akim Demaille <akim@epita.fr>
3653
3654 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
3655 the useless parentheses.
3656 Suggested by Paul Eggert.
3657
451364ed
AD
36582004-09-20 Akim Demaille <akim@epita.fr>
3659
3660 Let the initial-action act on the look-ahead, and use it for the
3661 "initial push" (corresponding to an hypothetical beginning-of-file).
3662 And let lalr1.cc honor %initial-action.
3663
3664 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
3665 example.
3666 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
3667 (Parser::Parser): Remove the ctor that used to initialize it.
3668 (Parser::parse): Like in the other skeletons, issue the "starting
3669 parse" message before any action.
3670 Honor %initial-action.
3671 Initialize the stacks with the lookahead.
3672 * data/yacc.c: Let $$ and @$ in %initial-action designate the
3673 look-ahead.
3674 Push them in the stacks.
3675 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
3676
18d192f0
AD
36772004-09-20 Akim Demaille <akim@epita.fr>
3678
3679 * doc/bison.texinfo (Initial Action Decl): New.
3680
b8458aa5
AD
36812004-09-20 Akim Demaille <akim@epita.fr>
3682
3683 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
3684 clearer criterion to define it.
3685 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
3686 When reducing on an empty RHS, use the latest stacked location as
3687 location.
3688 yylloc is not always available.
3689 * data/glr.c: Likewise.
3690 Also, honor initial-actions.
3691
3fc16193
AD
36922004-09-20 Akim Demaille <akim@epita.fr>
3693
3694 * data/yacc.c (YY_LOCATION_PRINT): New.
3695 Define when we know YYLTYPE's structure, i.e., when the default
3696 YYLLOC_DEFAULT is used.
3697 * data/c.m4 (b4_yysymprint_generate): Use it.
3698 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
3699 value of the result.
3700 (error_start_): Replace with...
3701 (error_range_): this location array.
3702 This allows to replace code relying on the implementation of
3703 locations by portable code.
3704 * data/yacc.c (yylerrsp): Replace with...
3705 (yyerror_range): this.
3706 Every time a token is popped, update yyerror_range[0], to have an
3707 accurate location for the error token.
3708 * data/glr.c (YY_LOCATION_PRINT): New.
3709 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
3710 deference a pointer.
3711 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
3712 report the location in %printers.
3713
3714 * src/scan-skel.l: Instead of abort, report error messages to ease
3715 understanding skeleton scanning failures.
3716
ecfe33e7
AD
37172004-09-16 Akim Demaille <akim@epita.fr>
3718
3719 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
3720 (iterator, const_iterator): these, to be more in the C++ spirit.
3721 Also, return reverse iterators so that when displaying the stack
3722 we display its bottom first.
3723 (Parser::stack_print_, Parser::reduce_print_): Match the messages
3724 from yacc.c.
3725 We should probably use vector here though.
3726
1576d44d
AD
37272004-09-16 Akim Demaille <akim@epita.fr>
3728
3729 Have more complete shift traces.
3730
3731 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
3732 to report Shifts instead of ad hoc YYDPRINTF invocations,
3733 including for the error token.
3734 * data/lalr1.cc (symprint_): Output the location.
3735 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
3736 output the location within the %printer.
3737 Activate GLR tests, at least to make sure they compile properly.
3738 They still don't pass though.
3739 * tests/calc.at: Adjust expect verbose output, since now "Entering
3740 state..." is on a different line than the "Shifting" message.
3741
9c66f418
AD
37422004-09-08 Akim Demaille <akim@epita.fr>
3743
3744 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
3745 Bison directive from the Bison file to the invocation of this
3746 macro, so that these directives are passed to
3747 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
3748 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
3749 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
3750 the extra Bison directives instead of the whole series.
3751 Change the grammar so that there are recoverable errors, and
3752 unrecoverable errors. Now we can have the parser give up before
3753 consuming the whole input. As a result we now can observe that
3754 the lookahead is freed when needed.
3755 Change the parser source to parse argv[1] instead of a hard coded
3756 string.
3757 Simplify yylex, and give a value and location to EOF.
3758 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
3759 passed directives already coded in the file.
3760 Add some tests to check the location of "error".
3761 For some tests, the C++ parser is correct, and not yacc.c.
3762 For other tests, they provide different, but unsatisfying, values,
3763 so keep the C++ value so that at least one parser is "correct"
3764 according to the test suite.
3765 (Actions after errors): Remove, this is subsumed by the
3766 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
3767
52d5733f
AD
37682004-09-06 Akim Demaille <akim@epita.fr>
3769
3770 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 3771 (Parser::pop): New.
52d5733f
AD
3772 Use it.
3773
a0e68930
AD
37742004-09-06 Akim Demaille <akim@epita.fr>
3775
3776 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
3777 argument, an informative message.
3778 Call YY_SYMBOL_PRINT.
3779 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
3780 * data/lalr1.cc (destruct_): Likewise.
3781 In addition, no longer depend on b4_yysymprint_generate and
3782 b4_yydestruct_generate to generate these functions, do it "by
3783 hand".
3784
e757bb10
AD
37852004-09-03 Akim Demaille <akim@epita.fr>
3786
3787 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
3788 invoked, yydestruct the lookahead.
3789 * tests/calc.at (Calculator $1): Update the expected lengths of
3790 traces: there is an added line for the discarded lookahead.
3791 * doc/bison.texinfo (Destructor Decl): Some rewording.
3792 Define "discarded" symbols.
3793
0fe1f06d
AD
37942004-09-02 Akim Demaille <akim@epita.fr>
3795
3796 * data/lalr1.cc (translate_, destruct_): No reason to be static.
3797
284acc8b
AD
37982004-09-02 Akim Demaille <akim@epita.fr>
3799
3800 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
3801 (YYDSYMPRINTF): Rename as...
3802 (YY_SYMBOL_PRINT): this.
3803 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
3804 two.
3805 Use it instead of direct symprint_ calls.
3806 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
3807 one.
3808
a5eb1ed2
AD
38092004-09-02 Akim Demaille <akim@epita.fr>
3810
b7c72fe1
AD
3811 * data/lalr1.cc (b4_yysymprint_generate): New.
3812 (symprint_): New member function, defined when YYDEBUG.
3813 Use it consistently instead of token/nterm debugging output by
3814 hand.
a5eb1ed2
AD
3815 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
3816 %printer calls to use cdebug_ when using lalr1.cc.
3817
417141dd
AD
38182004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
3819
3820 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
3821 with #ifdef YYDEBUG.
3822
2fa09258
AD
38232004-08-26 Akim Demaille <akim@epita.fr>
3824
3825 * doc/bison.texinfo (Implementing Loops): Rename as...
3826 (Implementing Gotos/Loops): this.
3827
9378b508
PE
38282004-08-13 Paul Eggert <eggert@cs.ucla.edu>
3829
3830 Adjust to latest gnulib.
3831 * bootstrap (gnulib_modules): Add xalloc-die.
3832 Set LC_ALL=C so that file names sort consistently.
3833 Prefer the gnulib copies of gettext.m4, glibc21.m4,
3834 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
3835 uintmax_t.m4, ulonglong.m4.
3836 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
3837 po.m4 since we are now using _gl.m4 instead.
3838
87a8ad5c
PE
38392004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
3840
3841 * src/scan-action.l: Remove. Scanning of semantic actions is
3842 handled in scan-gram.l.
3843
dca81a78
PE
38442004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
3845
3846 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
3847
3848 * src/location.h (struct): The file member is a uniqstr.
3849 (equal_boundaries): Use UNIQSTR_EQ for comparison.
3850
c9cbf7c5
PE
38512004-07-22 Paul Eggert <eggert@cs.ucla.edu>
3852
3853 Fix bug with non-%union parsers that have printers or destructors,
3854 which led to a Bison core dump. Reported by Peter Fales in
3855 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 3856
c9cbf7c5
PE
3857 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
3858 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
3859 not to our own type.
3860 * src/output.c (symbol_destructors_output, symbol_printers_output):
3861 Don't assume %union.
3862 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
3863 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
3864 UNION-FLAG. All callers changed.
3865 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
3866 Use type char, not unsigned int, when declaring an array of char;
3867 this lets us remove a cast.
3868 (Printers and Destructors): Add non-%union test cases.
3869
fa7e68c3
PE
38702004-06-21 Paul Eggert <eggert@cs.ucla.edu>
3871
3872 * doc/bison.texinfo: Minor editorial changes, mostly to the new
3873 GLR writeups. E.g., avoid frenchspacing and the future tense,
3874 change "lookahead" to "look-ahead", and change "wrt" to "with
3875 respect to".
2fa09258 3876
fa7e68c3
PE
38772004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
3878
3879 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
3880 New sections, split off from the GLR Parsers section. Put the new
3881 Simple GLR Parser near the start of the GLR section, for clarity.
3882 Rewrite connective text.
3883
99a9344e
PE
38842004-06-21 Frank Heckenbach <frank@g-n-u.de>
3885
3886 * doc/bison.texinfo (Simple GLR Parsers): New section.
3887
8dd162d3
PE
38882004-06-21 Paul Eggert <eggert@cs.ucla.edu>
3889
3890 * NEWS, TODO, doc/bison.texinfo:
3891 Use "look-ahead" instead of "lookahead", to be consistent.
3892 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
3893 while we're fixing "look-ahead".
3894 * src/conflicts.c (shift_set): Renamed from shiftset.
3895 (look_ahead_set): Renamed from lookaheadset.
3896 * src/print.c: Likewise.
3897 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
3898 name for "lookahead".
3899 (report_types, usage): Likewise.
3900 * src/getargs.h (report_look_ahead_tokens): Renamed from
3901 report_lookaheads.
3902 * src/lalr.c (compute_look_ahead_tokens): Renamed from
3903 compute_lookaheads.
3904 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
3905 (look_ahead_tokens_print): Renamed from lookaheads_print.
3906 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
3907 state_rule_lookaheads_print.
3908 * src/state.h: Likewise.
3909 (reductions.look_ahead_tokens): Renamed from lookaheads.
3910 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
3911 AT_DATA_LOOKAHEADS_GRAMMAR.
3912
57a90331
PE
39132004-06-03 Paul Eggert <eggert@cs.ucla.edu>
3914
3915 * README: Update location of patched M4 distribution.
3916
8ed3234a
PE
39172004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
3918
3919 Don't assume the C++ compiler takes the same arguments as the C compiler
3920 (trivial change).
3921 * configure.ac (O0CXXFLAGS): New var.
3922 * tests/atlocal.in (CXXFLAGS): Use it.
3923
07971983
PE
39242004-05-29 Paul Eggert <eggert@cs.ucla.edu>
3925
3926 Fix some "make check" problems with C++ reported by
3927 Albert Chin-A-Young for Tru64 C++ in this thread:
3928 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
3929
3930 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
3931 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
3932 Output to a .cc file for C++, not to a .c file.
3933 * tests/calc.at (AT_CHECK_CALC): Likewise.
3934 * tests/regression.at (AT_CHECK_DANCER): Likewise.
3935 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
3936
29058652
PE
39372004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
3938
3939 * tests/calc.at, tests/actions.at: Workaround for SGI
3940 C++ compiler. (trivial change)
3941
62cb8a99
PE
39422004-05-27 Paul Eggert <eggert@cs.ucla.edu>
3943
fd418816
PE
3944 Spent a few hours checking out which prerequisite versions the
3945 current sources actually require. I went all the way back to
3946 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
3947 a seemingly endless set of combinations of versions more recent
3948 than that. The bottom line is that the current sources require
3949 fairly recent versions of the build tools, and it'll be some work
3950 to change this.
3951 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
3952 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
3953 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
3954 Add comments explaining why those particular versions are
3955 currently needed.
2fa09258 3956
62cb8a99
PE
3957 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
3958 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 3959 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
3960
3961 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
3962 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
3963
caa52c10
PE
39642004-05-26 Paul Eggert <eggert@cs.ucla.edu>
3965
3966 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
3967 0.11.5. Suggested by Bruno Haible.
3968 * bootstrap: Remove gettext version checking.
3969
3970 * doc/bison.texinfo (Decl Summary): Also mention that %union
3971 can depend on prerequisite types. Problem reported by Tim
3972 Van Holder.
3973
4bfd5e4e
PE
39742004-05-25 Paul Eggert <eggert@cs.ucla.edu>
3975
2cef3017
PE
3976 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
3977 * README-alpha: Don't tell people not to package this.
3978
b9c85d5c
PE
3979 * bootstrap: Don't assume $(...) works; use `...` instead.
3980 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
3981 gettext better.
3982
4bfd5e4e
PE
3983 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
3984 put into the -d output file, and mention what to do if YYSTYPE is
3985 defined as a macro.
3986
6a36ff94
PE
39872004-05-24 Paul Eggert <eggert@cs.ucla.edu>
3988
6712933e
PE
3989 Undo change made earlier today: it caused autopoint to not bring
3990 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
3991 autopoint's.
3992
3993 * bootstrap: Check that gettext version matches what's in
3994 configure.ac. Warn users to ignore robots.txt ERROR 404.
3995 * bootstrap: Undo today's earlier change (logged below).
3996 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 3997
6a36ff94
PE
3998 The gettext version checking is causing more trouble than it's
3999 curing; remove it. Problem reported by Paul Hilfinger.
4000
4001 * bootstrap: Issue a warning that one can expect a message
4002 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
4003 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
4004
209ea708
PE
40052004-05-23 Paul Eggert <eggert@cs.ucla.edu>
4006
4007 Ensure that the C++ compiler used for testing actually works on a
4008 simple test program; if not, skip the C++-related tests. Problem
4009 reported by Vin Shelton in:
161a71f3 4010 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
4011
4012 * m4/cxx.m4: New file.
4013 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
4014 * tests/atlocal.in (BISON_CXX_WORKS): Add.
4015 * tests/local.at (AT_COMPILE_CXX): Use it.
4016
41ca2549
PE
40172004-05-21 Paul Eggert <eggert@cs.ucla.edu>
4018
383e69dc
PE
4019 * data/glr.c (yylloc): Output this macro even if locations are not
4020 being generated, as the GLR parser needs it even in that case.
4021 Problem reported by Troy A. Johnson
4022 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
4023
41ca2549
PE
4024 * configure.ac (AC_INIT): Update to 1.875e.
4025
e476c87d
PE
40262004-05-21 Paul Eggert <eggert@cs.ucla.edu>
4027
4028 * NEWS: Version 1.875d.
4029 * configure.ac (AC_INIT): Likewise.
4030 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
4031
4032 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
4033 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
4034 lalr1.cc runs afoul of the first, and the last two are no longer
4035 supported by GCC 3.4.0.
4036 * README: Mention GNU m4 1.4 or later; mention m4 patches.
4037 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
4038
233a88ad
PE
40392004-05-06 Paul Eggert <eggert@cs.ucla.edu>
4040
4041 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
4042 unsigned int, for compatibility with latest gnulib hash module.
4043 * src/state.c (state_hash, state_hasher): Likewise.
4044 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
4045 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 4046
12ffdd28
PE
40472004-05-03 Paul Eggert <eggert@cs.ucla.edu>
4048
4049 * NEWS: Unescaped newlines are no longer allowed in char & strings.
4050
4051 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
4052 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
4053 character and string literals.
4054 (unexpected_end): New function.
4055 (unexpected_eof): Use it.
4056 (unexpected_newline): New function.
4057 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
4058 actions.
e476c87d 4059
12ffdd28
PE
4060 * NEWS: Document %expect-rr.
4061
4062 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
4063 Fix typo by replacing $1 with $option.
4064 Remove more 'intl'-related files.
9668e2be 4065 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
4066
4067 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
4068 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
4069 strtoul.c.
4070 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
4071 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
4072 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
4073 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
4074 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
4075 * src/.cvsignore: Add *.output.
4076
4077 * src/parse-gram.y: Put copyright notice inside %{ %} so it
4078 gets copied to the output file.
e476c87d 4079
1f65350a
PE
40802004-04-28 Paul Eggert <eggert@twinsun.com>
4081
4082 Get files from the gnulib and po repositories, instead of relying
4083 on them being in our CVS. Upgrade to latest versions of gnulib
4084 and Automake.
4085
4086 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
4087 * bootstrap: Bootstrap from gnulib and po repositories.
4088 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
4089 * README-cvs: Document these changes. Remove version numbers from
4090 mentions of build tools, since they change so often. Mention Flex.
4091
4092 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
4093 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
4094 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
4095 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 4096 does this for us.
12ffdd28
PE
4097 (AC_ISC_POSIX): Remove; we no longer support this
4098 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
4099 (AC_HEADER_STDC): Remove: we now assume C89 or better.
4100 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
4101 Do not check for C89 headers, except for locale.h which is used
4102 by the Yacc library and must port to K&R hosts.
4103 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
4104 Do not check for C89 functions, except for setlocale which is
4105 used by the Yacc library.
4106 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
4107 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
4108 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
4109 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
4110 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
4111 AM_GNU_GETTEXT): Remove; now done by:
4112 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
4113 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
4114 for us.
4115
4116 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
4117 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
4118 Define to empty, as gnulib.mk will do the rest for us.
4119 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
4120 for us.
4121 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
4122 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
4123
4124 * src/files.c: Include gnulib's xstrndup.h.
4125
4126 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
4127 (REALLOC): Use xnrealloc, for likewise.
4128 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
4129 (strnlen, memrchr): Remove decls; functions no longer used.
4130 Include <stpcpy.h>.
4131
4132 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
4133 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
4134 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
4135 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
4136 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
4137 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
4138 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
4139 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
4140 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
4141 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
4142 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
4143 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
4144 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
4145 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
4146 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
4147 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
4148 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
4149 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
4150 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
4151 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
4152 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
4153 Remove, as these files are now generated automatically
4154 by bootstrap or automake.
4155
4156 * po/ChangeLog: Remove: all but one entry was a duplicate
4157 of this file, and I moved that 2000-11-02 entry here.
4158
4159 * config/.cvsignore: Add Makefile, depcomp, install-sh.
4160 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
4161 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
4162 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
4163 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
4164 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
4165 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
4166 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
4167 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
4168 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
4169 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
4170 xstrndup.h.
4171 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
4172 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
4173 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
4174 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
4175 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
4176 * src/.cvsignore: Remove *_.c.
4177
4178
4179 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
4180 support it. (The latest stable gzip doesn't.)
4181
41822004-04-27 Paul Eggert <eggert@twinsun.com>
4183
4184 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
4185 case, as stos_ is now used by destructors due to the 2004-02-09
4186 change.
4187
4188 Remove more K&R C support.
4189 * lib/libiberty.y (PARAMS): Remove. All uses removed.
4190 * lib/subpipe.c (errno): Remove decl.
4191 Include <stdlib.h> unconditionally.
4192 (EXIT_FAILURE): Remove macro.
4193 * src/complain.c (vfprintf, strerror): Remove.
4194 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
4195 unconditionally.
4196 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
4197 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
4198 (strchr, strspn, memchr): Remove decls.
4199 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
4200 unconditionally. Do not declare perror.
4201 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
4202 unconditionally.
4203
4204 * src/complain.c (_): Remove useless defn, as system.h defines this.
4205
4206 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
4207 with latest obstack.h.
4208 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
4209 to procedure types, as obstack.h now does that for us.
4210 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
4211
4212 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
4213 so that this include file can stand alone.
4214 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
4215 does this now. Include subpipe.h first after config.h, to
4216 test whether it can stand alone.
4217
4218 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
4219 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
4220 unused declaration.
4221
4222 * tests/synclines.at (%union synch line): Put a dummy member in
4223 the union, because empty unions aren't allowed in C. Caught
4224 by GCC 3.4.0.
4225
4f16766c
PE
42262004-04-13 Jim Meyering <jim@meyering.net>
4227
4228 * src/conflicts.c (conflicts_print): Correct format string typo:
4229 use `%%' to produce literal `%'. (trivial change)
4230
779e7ceb
PE
42312004-03-30 Paul Eggert <eggert@twinsun.com>
4232
4233 * src/getargs.c (version): Update copyright year to 2004.
4234
4235 * data/c.m4 (b4_int_type): Use 'short int' rather than
4236 'short', and similarly for 'long', 'unsigned', etc.
4237 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
4238 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
4239 yy_yypstack, yydumpstack): Likewise.
4240 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
4241 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
4242 Likewise.
4243 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
4244 yy_stack_print, yyparse): Likewise.
4245 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
4246 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
4247 * lib/bitset.c (bitset_print): Likewise.
4248 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
4249 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
4250 * lib/bitsetv.c (bitsetv_dump): Likewise.
4251 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
4252 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
4253 Likewise.
4254 * src/LR0.c (allocate_itemsets): Likewise.
4255 * src/gram.h (rule_number, rule): Likewise.
4256 * src/lalr.h (goto_number): Likewise.
4257 * src/nullable.c (nullable_compute): Likewise.
4258 * src/output.c (prepare_rules): Likewise.
4259 * src/relation.c (relation_print, relation_digraph): Likewise.
4260 * src/relation.h (relation_node): Likewise.
4261 * src/state.h (state_number, transitions, errs, reductions,
4262 struct state): Likewise.
4263 * src/symtab.h (symbol_number, struct symbol): Likewise.
4264 * src/tables.c (vector_number, tally, action_number,
4265 default_goto, goto_actions): Likewise.
4266 * tests/existing.at (GNU Cim Grammar): Likewise.
4267 * tests/regression.at (Web2c Actions): Likewise.
4268
4269 * src/output.c (muscle_insert_short_int_table): Renamed from
4270 muscle_insert_short_table. All uses changed.
4271
d6328241
PH
42722004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4273
4274 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
4275 (declaration): Replace expected_conflicts with expected_sr_conflicts.
4276 Add %expect-rr rule.
4f16766c 4277
d6328241
PH
4278 * src/scan-gram.l: Recognize %expect-rr.
4279
4f16766c 4280 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 4281 expected_conflicts.
4f16766c 4282 (expected_rr_conflicts): Declare.
d6328241
PH
4283
4284 * src/conflicts.c (expected_sr_conflicts): Rename from
4285 expected_conflicts.
4286 (expected_rr_conflicts): Define.
4287 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
4288 for GLR parsers.
4289 Use expected_sr_conflicts in place of expected_conflicts.
4290 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 4291
d6328241 4292 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 4293
1452af69
PE
42942004-03-08 Paul Eggert <eggert@gnu.org>
4295
4296 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 4297 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
4298
4299 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
4300 in lalr1.cc.
4301 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
4302 * src/scan-gram.l (scan_integer): New function.
4303 ({int}): Use it.
4304 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
4305 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
4306 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
4307 Say "long int", not "long", for uniformity with GNU style.
4308
006d217d
PE
43092004-02-25 Paul Eggert <eggert@twinsun.com>
4310
4311 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
4312 compilers. This fixes a problem with Intel's C++ compiler being
4313 chatty, reported by Guido Trentalancia in
161a71f3 4314 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 4315
c2729758
ADL
43162004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
4317
4318 Support %destructor and merge error locations in lalr1.cc.
4319
4320 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
4321 (Parser::stos_): Define unconditionally.
4322 (Parser::destruct_): New method. Generate its body with
4323 b4_yydestruct_generate.
4324 (Parser::error_start_): New attribute.
4325 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
4326 token which are discarded.
4327 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
4328 error_start_ when erroneous token are discarded.
4329 (Parser::parse) <yyerrlab1>: Compute the location of the error
4330 token so that it covers all the discarded tokens.
4331 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
4332 it can be called with `%skeleton "lalr1.cc"', and do that.
4333
dd0e0635
PE
43342004-02-02 Paul Eggert <eggert@twinsun.com>
4335
4336 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
4337 $(top_srcdir)/lib and ../lib. This fixes a bug reported
4338 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
4339 There's no need to mention top_builddir since Automake does that
4340 for us.
4341 (INCLUDES): Remove, as Automake says it's obsolescent.
4342 Contents migrated into AM_CPPFLAGS as described above.
4343 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
4344
43452004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4346
4347 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
4348 (yyreportSyntaxError): Handle case where lookahead token is
4349 YYEMPTY.
4350
be16239b
PH
43512004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4352
4353 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
4354 resulting parsers are compilable with C++.
4355
5fa90832
PE
43562003-12-23 Paul Eggert <eggert@twinsun.com>
4357
4358 * config/depcomp, config/install-sh: Sync with Automake 1.8.
4359 * src/output.c (output_skeleton): Rename local var.
4360 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
4361 Bison tokens, as this runs afoul of the 2003-10-07 change that
4362 disallowed NUL bytes in character constants or string literals.
4363
4364 * tests/local.at: Require Autoconf 2.59's Autotest.
4365 * tests/testsuite.at: Don't include local.at, since we now assume
4366 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
4367 including it.
4368 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
4369 multiple inclusion warnings.
dd0e0635 4370
b165c324
AD
43712003-12-02 Akim Demaille <akim@epita.fr>
4372
4373 * doc/bison.texinfo (How Can I Reset the Parser): More about start
4374 conditions.
4375 From Bruno Haible.
4376
26e06a21
ADL
43772003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
4378
4379 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
4380
92ac3705
PE
43812003-10-07 Paul Eggert <eggert@twinsun.com>
4382
6a5ecb38
PE
4383 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
4384 if testsuite doesn't exist.
4385
92ac3705
PE
4386 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
4387 literals, unfortunately.
4388 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
4389 Complain about NUL bytes in character constants or string literals.
4390
91d2c560
PE
43912003-10-05 Paul Eggert <eggert@twinsun.com>
4392
4393 * NEWS: Don't document %no-default-prec, as it's still
4394 too experimental.
4395 * doc/bison.texinfo: Document %no-default-prec only if
4396 the defaultprec flag is set. Normally it's not.
4397
0cc3da3a
PE
43982003-10-04 Paul Eggert <eggert@twinsun.com>
4399
4400 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
4401 non-modifiable lvalue, instead of a modifiable one.
4402 * doc/bison.texinfo (Actions): Document that $$ can
4403 be assigned to. Do not claim that $$ and $N are
4404 array element references: user code should not rely on this.
4405
22fccf95
PE
44062003-10-01 Paul Eggert <eggert@twinsun.com>
4407
4408 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
4409 (grammar_declaration): Use it.
4410 * src/scan-gram.l: New token %no-default-prec.
4411 * tests/conflicts.at: Revamp tests to use %no-default-prec.
4412 * NEWS, doc/bison.texinfo: Document the above.
4413
fc8f2965
AD
44142003-10-01 Akim Demaille <akim@epita.fr>
4415
4416 VCG no longer supports long_straight_phase.
4417
4418 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
4419 * src/print_graph.c (print_graph): Adjust.
4420
39a06c25
PE
44212003-09-30 Frank Heckenbach <frank@g-n-u.de>
4422 and Paul Eggert <eggert@twinsun.com>
4423
4424 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
4425 Table of Symbols): Document %default-prec.
4426 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
4427 (grammar_declaration): Set default_prec on %default-prec.
4428 * src/scan-gram.l (%default-prec): New token.
4429 * src/reader.h (default_prec): New flag.
4430 * src/reader.c: Likewise.
4431 (packgram): Handle it.
4432 * tests/conflicts.at (%default-prec without %prec,
4433 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 4434
39a06c25
PE
44352003-09-30 Paul Eggert <eggert@twinsun.com>
4436
4437 * tests/testsuite.at: Include local.at, not input.at, fixing
4438 a typo in the 2003-08-25 patch.
4439
62b6aef9
AD
44402003-08-27 Akim Demaille <akim@epita.fr>
4441
4442 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
4443 GCC warnings.
4444
89e1cc61
AD
44452003-08-26 Akim Demaille <akim@epita.fr>
4446
4447 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
4448 "<\#" to avoid magic from Gnus when posting parts of this script.
4449
a08460b0
AD
44502003-08-26 Akim Demaille <akim@epita.fr>
4451
4452 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
4453 (Parser::parse): here.
4454 Adjust: nerrs and errstatus is now replaced by...
4455 (Parser::nerrs_, Parser::errstatus_): New.
4456
603f1cfd
AD
44572003-08-25 Akim Demaille <akim@epita.fr>
4458
4459 * config/announce-gen, Makefile.cfg: New.
4460 * Makefile.am: Adjust.
4461 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
4462 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
4463
cd3684cf
AD
44642003-08-25 Akim Demaille <akim@epita.fr>
4465
4466 When reducing initial empty rules, Bison parser read an initial
4467 location that is not defined. This results in garbage, and that
4468 affects Bison's own parser. Therefore we need (i) to extend Bison
4469 to support a means to initialize this location, and (ii) to use
4470 this CVS Bison to fix CVS Bison's parser.
4471
4472 * src/reader.h, reader.c (epilogue_augment): Remove, replace
4473 with...
4474 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
4475 * src/parse-gram.y: Adjust.
4476 (%initial-action): New.
4477 (%error-verbose): Since we require CVS Bison, there is no reason
4478 not to use it.
4479 * src/scan-gram.l: Adjust.
4480 * src/Makefile.am (YACC): New, to make sure we use our own parser.
4481 * data/yacc.c (yyparse): Use b4_initial_action.
4482
4e03e201
AD
44832003-08-25 Akim Demaille <akim@epita.fr>
4484
4485 * doc/bison.texinfo: Don't promote stdout for error messages.
4486
8c182d05
AD
44872003-08-25 Akim Demaille <akim@epita.fr>
4488
4489 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
4490 From Alexandre Duret-Lutz.
4491
6a60c4cf
PE
44922003-08-25 Akim Demaille <akim@epita.fr>
4493
4494 Version 1.875c.
4495
25f66e1a
AD
44962003-08-25 Akim Demaille <akim@epita.fr>
4497
4498 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
4499 Use them.
4500
5348bfbe
AD
45012003-08-25 Akim Demaille <akim@epita.fr>
4502
4503 * data/lalr1.cc (Parser::reduce_print_): New.
4504 Use it.
4505
47301314
AD
45062003-08-25 Akim Demaille <akim@epita.fr>
4507
4508 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
4509 error recovery loops. This patch is based on
161a71f3 4510 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
4511 Also, augment the similarity between lalr1.cc and yacc.c.
4512 Note: the locations of error recovery rules are not correct yet.
4513
4514 * data/lalr1.cc: Comment changes to augment the similarity between
4515 lalr1.cc and yacc.c.
4516 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
4517 (yyerrlab1): Remove, but where it used to be (now the bottom part of
4518 yyerrlab), when hitting EOF, pop the whole stack here instead of
4519 merely falling thru the default error handling mechanism.
4520 (yyerrorlab): New label, with the old contents of YYERROR,
4521 plus the following change: pop the stack of rhs corresponding
4522 to the production that invoked YYERROR. That is how Yacc
4523 behaves (required by POSIX).
4524 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
4525 fail.
4526
1f7a61ff
AD
45272003-08-25 Akim Demaille <akim@epita.fr>
4528
4529 Tune local.at so that people can "autom4te -l autotest calc.at -o
4530 calc" for instance, to extract a sub test suite.
4531
4532 * tests/testsuite.at: Move the initialization, Autotest version
4533 requirement, and AT_TESTED invocation into...
4534 * tests/local.at: here.
4535 * tests/testsuite.at: Include it for compatibility with Autoconf
4536 2.57.
4537 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
4538 be ignore.
4539
327b5b56
PE
45402003-08-04 Paul Eggert <eggert@twinsun.com>
4541
4542 Rework code slightly to avoid gcc -Wtraditional warnings.
4543 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
4544 The returned value is now stored in *YY0. All callers changed.
4545 * src/output.c (merge_output): Adjust to the above change.
4546
0051e3ed
PE
45472003-07-26 Paul Eggert <eggert@twinsun.com>
4548
4549 * data/glr.c (YYASSERT): New macro.
4550 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
4551 yyresolveStates, yyprocessOneStack):
4552 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
4553 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 4554
137437c6
PE
45552003-07-25 Paul Eggert <eggert@twinsun.com>
4556
5b620e06
PE
4557 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
4558 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 4559 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
4560 by Frank Heckenbach, though I have omitted the structure-initialization
4561 part of his glr-knr.diff patch since I recall that the Portable
4562 C Compiler didn't require that change.
4563
137437c6
PE
4564 Let the user specify how to allocate and free memory.
4565 Derived from a suggestion by Frank Heckenbach in
161a71f3 4566 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
4567 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
4568 All uses of free, malloc, realloc changed to use these macros,
4569 and unnecessary casts removed.
4570 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
4571
ddb85ca5
PE
45722003-07-06 Matthias Mann <MatthiasMann@gmx.de>
4573
4574 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
4575 use s.empty() rather than s == "" to test for empty string; see
161a71f3 4576 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
4577 (trivial change)
4578
39910e09
AD
45792003-06-25 Akim Demaille <akim@epita.fr>
4580
4581 * config/depcomp, config/install-sh: Update from masters.
4582
0ae99356
PE
45832003-06-20 Paul Eggert <eggert@twinsun.com>
4584
4585 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
4586 and return properly parenthesized result.
4587 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
4588 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
4589 Remove unnecessary parentheses from uses.
4590 * doc/bison.texinfo (Location Default Action): Describe the
4591 conventions for parentheses.
4592
cd05d13c
PE
45932003-06-19 Paul Eggert <eggert@twinsun.com>
4594
81fd08ca
PE
4595 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
4596 yyreportTree): Do not assume that size_t is the same width as int,
4597 when printing sizes. Print sizes using an unsigned format.
4598 Problem reported by Frank Heckenbach in
161a71f3 4599 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 4600
cd05d13c
PE
4601 Port to Forte Developer 7 C compiler.
4602 * data/glr.c (struct YYLTYPE): If locations are not being used,
4603 declare a single dummy member, as empty structs do not conform
4604 to the C standard.
4605 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
4606 the Forte Developer 7 C compiler complains that end-of-loop
4607 code is not reached.
4608
4dcf140b
PE
46092003-06-17 Paul Eggert <eggert@twinsun.com>
4610
4611 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
4612 avoid warnings from picky compilers about redefinition of PARAMS.
4613
8dd76bee
PE
46142003-06-17 Paul Eggert <eggert@twinsun.com>
4615
4616 Version 1.875b.
4617
4618 * NEWS: Document 1.875b.
4619
4620 * lib/bbitset.h: Do not include config.h; that's the includer's job.
4621 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
4622 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
4623 Don't use 'index' in comments, as it's a builtin fn on some hosts.
4624 * lib/bitset_stats.c: Include gettext.h unconditionally, as
4625 per recent gettext manual's suggestion.
4626 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
4627 Use prototypes, not old-style definitions.
4628 * lib/lbitset.c (lbitset_unused_clear): Likewise.
4629 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
4630 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
4631 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
4632 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
4633 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
4634 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
4635 vbitset_or_and_cmp, vbitset_copy): Likewise.
4636
4637 * lib/libiberty.h: Do not include config.h; that's the includer's job.
4638 Do not include <stdlib.h>.
4639 (PARAMS): Define unconditionally for C89.
4640 (ATTRIBUTE_NORETURN): Remove.
4641 (ATTRIBUTE_UNUSED): Define unconditionally.
4642
4643 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 4644 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
4645 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
4646 * lib/vbitset.c, lib/vbitset.h: New files.
4647 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
4648 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
4649 from libbitset.
4650
4651 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
4652 `How Can I Reset @code{yyparse}', since texinfo does not allow
4653 arbitrary @ in node names.
4654
4655 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
4656 shouldn't be needed according to the gettext 0.12.1 documentation
4657 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 4658 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 4659 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 4660 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 4661
8dd76bee
PE
4662 * lib/.cvsignore: Add stdbool.h.
4663 * m4/.cvsignore: Add nls.m4, po.m4.
4664
4665 Upgrade to CVS gnulib.
4666 * stdbool_.h: File renamed from stdbool.h.in.
4667 * configure.ac (AM_STDBOOL_H): Invoke this instead of
4668 AC_HEADER_STDBOOL.
4669 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
4670 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
4671 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
4672 (MOSTLYCLEANFILES): New var.
4673 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
4674 (stdbool.h): New rule.
4675 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
4676 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
4677 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
4678 m4/quote.m4: Upgrade to today's gnulib.
4679
4680 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
4681 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
4682 the tests right now.
4683 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
4684 yyerror are declared before use; C99 requires this.
4685
25005f6a
PH
46862003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4687
4688 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
4689 first.
4690 (yyrecoverSyntaxError): Correct the logic for setting and testing
4691 yyerrState.
4692 Correct comment on handling EOF.
4693 Allow states with only a default reduction, rather than failing
8dd76bee 4694 (I can't quite reconstruct why these were not allowed before).
25005f6a 4695
137437c6 4696 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 4697 buffer overruns, corrupting state.
8dd76bee
PE
4698
4699 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
4700 definition.
4701 * src/reader.h (max_left_semantic_context): New variable declaration.
4702 * src/scan-gram.l (max_left_semantic_context): Define.
4703 (handle_action_dollar): Update max_left_semantic_context.
4704 * data/glr.c (YYMAXLEFT): New definition.
4705 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
4706 (yyresolveAction): Ditto.
4707
4708 Fixes to problems with location handling in GLR parsers reported by
4709 Frank Heckenbach (2003/06/05).
4710
4711 * data/glr.c (YYLTYPE): Make trivial if locations not used.
4712 (YYRHSLOC): Add parentheses, and define only if locations used.
4713 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
4714 locations not used.
4715 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
4716 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 4717
25005f6a
PH
4718 * tests/cxx-type.at: Exercise location information; update tests
4719 to differentiate output with and without locations.
8dd76bee 4720 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
4721 because default YYLTYPE not yet defined.
4722 Change semantic actions to compute strings, rather than printing
4723 them directly (to test proper passing of semantics values). Change
4724 output to prefix notation and update test data and expected results.
4725 (yylex): Track locations.
4726 (stmtMerge): Return value rather than printing, and include arguments
4727 in value.
8dd76bee 4728
711f40b7
PE
47292003-06-03 Paul Eggert <eggert@twinsun.com>
4730
4731 Avoid warnings generated by GCC 2.95.4 when Bison is
4732 configured with --enable-gcc-warnings.
4733 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
4734 yy::]b4_parser_class_name[::translate_,
4735 yy::Stack::operator[] (unsigned),
4736 yy::Stack::operator[] (unsigned) const,
4737 yy::Slice::operator[] (unsigned),
4738 yy::Slice::operator[] (unsigned) const):
4739 Rename local vars to avoid warnings.
4740 * tests/glr-regression.at (Improper handling of embedded actions
4741 and $-N in GLR parsers): Remove unused local variable from yylex.
4742 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
4743 (void) as arg when not pure, since we now assume C89 when building
4744 Bison. Pacify GCC by using parameter.
4745
ac695f7d
PE
47462003-06-02 Paul Eggert <eggert@twinsun.com>
4747
4748 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
4749 yy::Location::lines, yy::Location::columns): Rename arguments
4750 to avoid shadowing; this removes a warning generated by GCC 3.3.
4751
26ec81e0
PE
47522003-06-01 Paul Eggert <eggert@twinsun.com>
4753
4754 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
4755 to g++, as GCC 3.3 complains if you do it.
4756 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
4757 everything that WARNING_CFLAGS has, except omit warnings
4758 not suitable for C++.
4759 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
4760 * tests/atlocal.in (CXXFLAGS): New var.
4761 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
4762
4763 Fix a GLR parser bug I reported in February; see
161a71f3 4764 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
4765 The problem was that GLR parsers did not conform to the C standard,
4766 because actions like { $1 = $2 + $3; } expanded to expressions
4767 that invoked YYFILL in separate subexpressions, and YYFILL assigned
4768 to a local variable. The C standard says that expressions
4769 like (var = f ()) + (var = f ()) have undefined behavior.
4770 Another problem was that GCC sometimes issues warnings that
4771 yyfill and its parameters are unused.
4772
4773 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
4774 as possibly unused.
4775 (yyfill): New function.
4776 (YYFILL): Use it.
4777 (yyuserAction): Change type of yynormal to bool, so that it matches
4778 the new yyfill signature. Mark it as possibly unused.
4779
4780
4781 Follow up on a bug I reported in February, where a Bison-generated
4782 parser can loop. Provide a test case and a fix for yacc.c. I
4783 don't have a fix for lalr1.cc or for glr.c, unfortunately.
4784 The original bug report is in:
161a71f3 4785 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
4786
4787 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
4788 macro's size was becoming unwieldy.
4789 (yyerrlab): Do not discard an empty lookahead symbol, as this
4790 might destroy garbage.
4791 (yyerrorlab): New label, with the old contents of YYERROR,
4792 plus the following change: pop the stack of rhs corresponding
4793 to the production that invoked YYERROR. That is how Yacc
4794 behaves, and POSIX requires this behavior.
4795 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
4796 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
4797 Define 'alarm' to do nothing if unistd.h is not available.
4798 Add a new rule "exp: '-' error;" to test the above change to
4799 data/yacc.c. Use 'alarm' to abort any test taking longer than
4800 10 seconds, as it's probably looping.
4801 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
4802 Also, the new yacc.c generates two fewer diagnostics for an
4803 existing test.
4804
d0829076
PE
48052003-05-24 Paul Eggert <eggert@twinsun.com>
4806
c6ae27df
PE
4807 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
4808 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
4809 This fixes a problem reported by John Bowman when the Compaq/HP
4810 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
4811 -ansi -Wall -gall).
4812 * data/yacc.c (union yyalloc): Likewise.
4813 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 4814
d0829076
PE
4815 Switch from 'int' to 'bool' where that makes sense.
4816
4817 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
4818 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
4819 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
4820 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
4821 Return or accept bool, not int. All callers changed.
4822 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
4823 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
4824 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
4825 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
4826 bitset_or_and_cmp_): Likewise.
4827 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
4828 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
4829 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
4830 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
4831 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
4832 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
4833 bitset_stats_or_and_cmp): Likewise.
4834 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
4835 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
4836 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
4837 ebitset_xor_cmp): Likewise.
4838 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
4839 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
4840 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
4841 lbitset_xor_cmp): Likewise.
4842 * lib/bbitset.h: Include <stdbool.h>.
4843 (struct bitset_vtable): The following members now return bool, not
4844 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
4845 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
4846 or_and_cmp).
4847 * src/conflicts.c (count_rr_conflicts): Likewise.
4848 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
4849 All uses changed.
4850 * lib/ebitset.c (ebitset_obstack_init): Likewise.
4851 * lib/lbitset.c (lbitset_obstack_init): Likewise.
4852 * src/getargs.c (debug_flag, defines_flag, locations_flag,
4853 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
4854 graph_flag): Likewise.
4855 * src/getargs.h (debug_flag, defines_flag, locations_flag,
4856 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
4857 graph_flag): Likewise.
4858 * src/output.c (error_verbose): Likewise.
4859 * src/output.h (error_verbose): Likewise.
4860 * src/reader.c (start_flag, typed): Likewise.
4861 * src/reader.h (typed): Likewise.
4862 * src/getargs.c (LOCATIONS_OPTION): New constant.
4863 (long_options, getargs): Use it.
4864 * src/lalr.c (build_relations): Use bool, not int.
4865 * src/nullable.c (nullable_compute): Likewise.
4866 * src/print.c (print_reductions): Likewise.
4867 * src/tables.c (action_row, pack_vector): Likewise.
4868 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
4869 * src/output.c (prepare): Use it.
4870 * src/output.c (token_definitions_output,
4871 symbol_destructors_output, symbol_destructors_output): Use string,
4872 not boolean integer, to keep track of whether to output separator.
4873 * src/print_graph.c (print_core): Likewise.
4874 * src/state.c (state_rule_lookaheads_print): Likewise.
4875
4876 * config/install-sh: Sync from automake 1.7.5.
4877
6b2584b7
PE
48782003-05-14 Paul Eggert <eggert@twinsun.com>
4879
4880 * src/parse-gram.y (rules_or_grammar_declaration): Require a
4881 semicolon after a grammar declaration, in the interest of possible
4882 future changes to the Bison input language.
4883 Do not allow a stray semicolon at the start of the grammar.
4884 (rhses.1): Allow one or more semicolons after any rule, including
4885 just before "|" as required by POSIX.
4886 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
4887 grammar.
4888
caf37a36
ADL
48892003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
4890
4891 %parse-param support for lalr1.cc.
4892
4893 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
4894 b4_cc_constructor_calls, b4_cc_constructor_call,
4895 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
4896 definitions.
4897 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
4898 parse-param arguments.
4899 (yy::b4_parser_class_name): Declare instance variables to
4900 hold parse-param arguments.
4901 * tests/calc.at: s/value/semantic_value/ because value clashes
4902 with a member of yy::b4_parser_class_name. Adjust C++ code
4903 to handle %parse-param. Enable %parse-param test in C++.
4904
3ab37077
PE
49052003-05-12 Paul Eggert <eggert@twinsun.com>
4906
4907 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
4908 English a bit. Fix fclose typo. Change "const char" to "char
4909 const", and use ANSI C rather than K&R for "main". Suggest
4910 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
4911 and suggest yy_switch_to_buffer.
4912
49132003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
4914
4915 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
4916 C89. This avoids a diagnostic on compilers that define __STDC__
4917 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 4918 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 4919
e743727f
PE
49202003-05-03 Paul Eggert <eggert@twinsun.com>
4921
4922 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
4923 Do not overrun array bounds.
4924 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 4925 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 4926
916708d5
AD
49272003-04-29 Akim Demaille <akim@epita.fr>
4928
4929 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
4930 * src/getargs.c, src/getargs.h: here, as bool, not int.
4931 (nondeterministic_parser): New.
4932 * src/parse-gram.y, src/scan-gram.l: Support
4933 %nondeterministic-parser.
4934 * src/output.c (prepare): Use nondeterministic_parser instead
4935 of glr_parser where appropriate.
4936 * src/tables.c (conflict_row, action_row, save_row)
4937 (token_actions, token_actions, pack_vector): Ditto.
4938
a06ea4aa
AD
49392003-04-29 Akim Demaille <akim@epita.fr>
4940
4941 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
4942
211074ca
AD
49432003-04-29 Akim Demaille <akim@epita.fr>
4944
4945 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
4946 with %pure-parser and %locations to exercise the patch from Yakov
4947 Markovitch below.
4948
6175ffe3
PE
49492003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
4950
4951 * data/yacc.c: (b4_lex_param): Corrected for the case where
4952 %lex-param is provided and %pure-parser isn't.
4953
b1e95857
PE
49542003-04-27 Paul Eggert <eggert@twinsun.com>
4955
4956 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 4957 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
4958 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
4959 if it is not defined.
4960 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
4961
acda9df6
PE
49622003-04-26 Paul Eggert <eggert@twinsun.com>
4963
3470c57b
PE
4964 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
4965 Declare to be of type suitable for the ninf value itself, not of
4966 type suitable for the corresponding table, since the latter might
4967 be unsigned but the ninf value might be negative. This fixes a
4968 bug reported by Alexandre Duret-Lutz in
161a71f3 4969 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 4970
acda9df6
PE
4971 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
4972 invokes it. We shouldn't invoke it twice because it will attempt
4973 to put error.o in the archive twice. This fixes a glitch reported
4974 by Martin Mokrejs in
161a71f3 4975 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 4976
b5250f26
PE
49772003-04-21 Paul Eggert <eggert@twinsun.com>
4978
4979 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
4980 to gnulib.
4981
089ac0f1
PE
49822003-04-21 Yakov Markovitch <Markovitch@iso.ru>
4983
4984 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
4985 Fix obvious typo that results in uncompilable GLR parsers
4986 when both %pure-parser and %locations are used. (trivial change)
4987
5ededac6
PE
49882003-04-17 Paul Eggert <eggert@twinsun.com>
4989
1b8f2fff
PE
4990 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
4991 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
4992 Do not insert the expected token via unput, as this runs afoul
4993 of a POSIX-compatibility bug in flex 2.5.31.
4994 All uses changed to BEGIN the parent state,
4995 since we no longer insert the expected token via unput.
4996 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
4997 that is no longer emitted after the above change.
4998
5ededac6
PE
4999 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
5000 the first one. This change is from Paul Hilfinger, and it fixes
5001 regression reported by Werner Lemberg in
161a71f3 5002 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
5003
5004 (resolve_sr_conflict): Don't invoke state_errs_set
5005 unless one or more tokens have been explicitly made errors.
5006 Otherwise, the above change causes Bison to abort.
5007
5008 * tests/existing.at (GNU pic Grammar): New test case, taken from
5009 Lemberg's email.
5010
b8be9132
AD
50112003-03-31 Akim Demaille <akim@epita.fr>
5012
5013 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
5014
d423d460
AD
50152003-03-31 Akim Demaille <akim@epita.fr>
5016
5017 * src/output.c (prepare_symbols): Avoid trailing spaces in the
5018 output.
5019
c7e441b4
AD
50202003-03-31 Akim Demaille <akim@epita.fr>
5021
5022 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
5023 From Paul Hilfinger.
5024
231897ad
AD
50252003-03-29 Akim Demaille <akim@epita.fr>
5026
5027 * m4/error.m4: Do not put under dynamic conditions some code which
5028 expansion is under static control.
5029
5b066063
AD
50302003-03-29 Akim Demaille <akim@epita.fr>
5031
5032 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
5033
22a74fec
AD
50342003-03-29 Akim Demaille <akim@epita.fr>
5035
5036 * doc/bison.texinfo (Strings are Destroyed): New.
5037
0eee27e7
PE
50382003-03-13 Paul Eggert <eggert@twinsun.com>
5039
5040 * .cvsignore: Add configure.lineno.
5041 * src/.cvsignore: Add yacc.
5042 * tests/.cvsignore: Add testsuite.log.
5043 * doc/fdl.texi: Sync with latest FSF version.
5044
f61aad93
PE
50452003-03-12 Paul Eggert <eggert@twinsun.com>
5046
537636c7
PE
5047 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
5048 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
5049 cursor, instead of leaving it undefined. This fixes a bug
5050 reported by Tim Van Holder in
161a71f3 5051 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
5052 * tests/input.at (Torturing the Scanner): Test the scanner on
5053 an empty input file, which was Tim Van Holder's test case.
5054
5055 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
5056 <sys/resource.h> can be included, include sys/time.h and
5057 sys/times.h first, if available. This works around the SunOS
5058 4.1.4 porting bug reported by Bruce Becker in
161a71f3 5059 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
5060
5061 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
5062 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
5063 AC_HEADER_SYS_WAIT.
5064
f61aad93
PE
5065 Merge changes from gnulib. This was prompted because the CVS
5066 snapshot didn't build on Solaris 7 due to strnlen problems.
5067
5068 These changes need to be merged back into gnulib:
5069 * lib/hash.c: Include <stdbool.h> unconditionally.
5070 * m4/onceonly.m4 (m4_quote): New macro.
5071 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
5072 Quote AC_FOREACH variable-expansions properly.
5073 The 2003-01-03 obstack.h change also needs merging.
5074 {end of changes requiring merging}
5b066063 5075
f61aad93
PE
5076 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
5077 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
5078 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
5079 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
5080 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
5081 New files, imported from gnulib.
5082 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
5083 above.
5084
5085 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
5086 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
5087 gnulib sources.
5088
5089 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
5090 Add.
5091 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
5092 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
5093 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
5094 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
5095 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
5096 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
5097 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
5098 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
5099 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
5100 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
5101 (jm_PREREQ_ARGMATCH): Remove.
5102 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
5103 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
5104
5105 * src/system.h: Include <stdbool.h> unconditionally.
5106
5107 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
5108 assuming at least C89 in the bitset code for some time now.
5109
d2ffe116
AD
51102003-03-03 Akim Demaille <akim@epita.fr>
5111
5112 * ro.po: New.
5113
052826fd
AD
51142003-03-02 Akim Demaille <akim@epita.fr>
5115
5116 * doc/bison.texinfo (Table of Symbols): Reactivate the
5117 documentation for %lex-param, and %parse-param.
5118
c4749565
AD
51192003-03-02 Akim Demaille <akim@epita.fr>
5120
5121 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
5122 generate verbose error messages.
5123 Use the number of tokens as an upper bound in yytname, as it
5124 cannot be a non terminal.
5125
d5286af1
AD
51262003-03-02 Akim Demaille <akim@epita.fr>
5127
5128 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
5129 message.
5130
22e304a6
AD
51312003-03-02 Akim Demaille <akim@epita.fr>
5132
22e304a6
AD
5133 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
5134 Use them to exercise yycheck overrun.
5135 Based on Andrew Suffield's grammar.
5136
67a25fed
AD
51372003-03-02 Akim Demaille <akim@epita.fr>
5138
5139 Create tests/local.at for Bison generic testing macros.
5140
5141 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
5142 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
5143 This new file.
5144 * tests/calc.at (AT_CHECK_CALC): Adjust.
5145 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
5146 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
5147 * tests/local.at: here.
5148 (AT_COMPILE_CXX): Tags the tests using it as c++.
5149 Ignore the test if CXX is not functional.
5150
9c2b381f
PE
51512003-03-01 Paul Eggert <eggert@twinsun.com>
5152
5153 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
5154 not loc->end, since loc->end might contain garbage and this leads
5155 to undefined behavior on some platforms.
5156 (id_loc, token_start): Use (IF_LINTed) initial values that do not
5157 depend on *loc, so that the reader doesn't give the the false
5158 impression that *loc is initialized.
5159 (<INITIAL>"%%"): Do not bother setting code_start, since its value
5160 does not survive the return.
5161
0433ba88
AD
51622003-03-01 Akim Demaille <akim@epita.fr>
5163
5164 * src/scan-gram.l (code_start): Always initialize it when entering
5165 into yylex, as SC_EPILOGUE is activated *before* the corresponding
5166 yylex invocation. An alternative would be making it static, but
5167 then it starts with the second %%'s beginning, instead of its end.
5168
b305ea69
PE
51692003-02-28 Paul Eggert <eggert@twinsun.com>
5170
5171 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
5172 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 5173 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 5174
c3d25e01
PE
51752003-02-26 Paul Eggert <eggert@twinsun.com>
5176
5177 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
5178 Remove Sequent/Pyramid discussion (nobody uses them any more).
5179 Merge VMS and MS-DOS discussion; these ports may well be dead
5180 but let's keep mentioning them for now. Put <> around email
5181 addresses. Add copyright notice.
5182
c267ffbc
PE
51832003-02-24 Paul Eggert <eggert@twinsun.com>
5184
5185 * data/glr.c (yy_reduce_print): yylineno -> yylno,
5186 to avoid collision with flex use of yylineno.
5187 Problem reported by Bruce Lilly in
161a71f3 5188 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
5189 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
5190 * data/yacc.c (yy_reduce_print): Likewise.
5191
5192 * config/depcomp: Sync with Automake 1.7.3.
5193
f939fc12
AD
51942003-02-21 Akim Demaille <akim@epita.fr>
5195
5196 * data/lalr1.cc: Use temporary variables instead of casts to
5197 change integer types.
5198 Suggested by Paul Eggert.
5199
95923bd6
AD
52002003-02-21 Akim Demaille <akim@epita.fr>
5201
5202 * doc/bison.texinfo: Use "location" consistently to refer to @n,
5203 to avoid confusions with lalr1.cc's notion of Position.
5204 Suggested by Paul Eggert.
5205
2cdc240e
AD
52062003-02-20 Akim Demaille <akim@epita.fr>
5207
5208 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
5209 before initial_columns.
5210 (location.hh): Use consistent variable names when defining the
5211 operator<<.
5212 Use "last" so that we subtract from Positions, not from unsigned.
5213
5d003116
AD
52142003-02-20 Akim Demaille <akim@epita.fr>
5215
5216 * data/lalr1.cc (position.hh): New subfile, including the extended
5217 and Doxygen'ed documentation of class Position.
5218 (location.hh): Use it.
5219 Document a` la Doxygen.
ba1ecc07 5220 With the help of Benoit Perrot.
5d003116 5221
d02b25f9
AD
52222003-02-20 Akim Demaille <akim@epita.fr>
5223
5224 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
5225 AT_YACC_IF.
5226 Redefine AT_YYERROR_SEES_LOC_IF using it.
5227 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
5228 not defined.
5229 Don't use the location in yy::Parser::error_ and
5230 yy::Parser::print_ when not %locations.
5231 Activate more lalr1.cc tests.
5232
0d1c3a04
AD
52332003-02-19 Akim Demaille <akim@epita.fr>
5234
5235 * data/lalr1.cc: When displaying a line number, be sure to make it
5236 an int.
5237
60a777aa
AD
52382003-02-19 Akim Demaille <akim@epita.fr>
5239
5240 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
5241 Remove, useless.
5242 (YYABORT, YYACCEPT, YYERROR): New.
5243 * tests/calc.at: Renable the lalr1.cc test.
5244
0b86fc41
AD
52452003-02-19 Akim Demaille <akim@epita.fr>
5246
5247 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
5248 error recovery, mixing with/without pops and discarding of the
5249 lookahead.
5250 Exercise YYERROR.
5251 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
5252
da99a5dc
PE
52532003-02-17 Paul Eggert <eggert@twinsun.com>
5254
5255 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
5256 * tests/testsuite.at (AT_COMPILE): Use them.
5257 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 5258 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 5259
93b8c255
PE
52602003-02-12 Paul Eggert <eggert@twinsun.com>
5261
5262 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
5263 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 5264 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
5265 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
5266 Check for malloc failure, for consistency with yacc.c.
5267 (yytname_size): Remove, for consistency with yacc.c.
5268
5269 The bug still remains in data/lalr1.cc, as I didn't have time
5270 to fix it there.
5271
7548fed2
AD
52722003-02-06 Akim Demaille <akim@epita.fr>
5273
5274 * configure.ac (GXX): Rename as...
5275 (CXX): this, to keep the original Autoconf semantics.
5276 Require 2.57.
5277 * data/lalr1.cc: Fix b4_copyright invocations.
5278 If YYDEBUG is not defined, don't depend upon name_ being defined.
5279 (location.hh): Include string and iostream.
5280 (Position::filename): New member.
5281 (Position::Position ()): New.
5282 (operator<< (Position)): New.
5283 (operator- (Position, int)): New.
5284 (Location::first, Location::last): Rename as...
5285 (Location::begin, Location::end): these, to mock the conventional
5286 iterator names.
5287 (operator<< (Location)): New.
5288 * tests/atlocal.in (CXX): New.
5289 * tests/testsuite.at (AT_COMPILE_CXX): New.
5290 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
5291 locations in a more synthetic way.
5292 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
5293 lalr1.cc is used.
5294 Adjust the C locations to match those from Emacs: first column is
5295 column 0.
5296 Change all the expected results.
5297 Conform to the GCS: simplify the locations when applicable.
5298 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
5299 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
5300 these CPP macros with the m4 macros new defined by...
5301 (AT_CHECK_PUSHDEFS): this, i.e.:
5302 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 5303 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
5304 New macros.
5305 (AT_CHECK_POPDEFS): Undefine them.
5306 (AT_CHECK_CALC_LALR1_CC): New.
5307 Use it for the first lalr1.cc test.
5308
43a176ef
AD
53092003-02-04 Akim Demaille <akim@epita.fr>
5310
5311 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
5312 Location as is defined.
5313
fc049e9c
AD
53142003-02-04 Akim Demaille <akim@epita.fr>
5315
5316 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
5317 name_ being defined.
5318
a737b216
PE
53192003-02-03 Paul Eggert <eggert@twinsun.com>
5320
5321 * src/gram.h (start_symbol): Remove unused decl.
5322
5323 Use more-consistent naming conventions for local vars.
5324
5325 * src/derives.c (derives_compute): Change type of local var from
5326 int to rule_number.
5327 * src/gram.c (grammar_rules_partial_print): Likewise.
5328 * src/print.c (print_core): Likewise.
5329 * src/reduce.c (reduce_grammar_tables): Likewise.
5330
5331 * src/gram.c (grammar_dump): Change name of item_number *
5332 local var from r to rp.
5333 * src/nullable.c (nullable_compute): Likewise.
5334
5335 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
5336
5337 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
5338 for symbol or symbol_number var.
5339 * src/reader.c (grammar_start_symbol_set): Likewise.
5340 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
5341 Likewise.
5342 * src/state.c (transitions_to): Likewise.
5343 * src/state.h: Likewise.
5344 * src/tables.c (symbol_number_to_vector_number): Likewise.
5345
5346 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
5347 char * var.
5348
5349 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
5350 var.
5351
5352 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
5353 var.
5354
5355 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
5356 Use str, not s, for char * var. Use ch, not c, for character var.
5357 Use size for size var.
5358
5359 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
5360 char * var.
5361 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
5362 uniqstr var.
5363 * src/uniqstr.h: Likewise.
5364
5365 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
5366 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
5367 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
5368 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
5369 param to have same name as that of enum, so that we don't use
5370 "s" to stand for a non-state.
5371
68e93ad5
AD
53722003-02-02 Akim Demaille <akim@epita.fr>
5373
5374 * src/scan-skel.l: Scan more than one inert character per yylex
5375 invocation.
5376
92898986
PE
53772003-02-01 Paul Eggert <eggert@twinsun.com>
5378
5379 Version 1.875a.
5380
1d9d5d71
PE
5381 * po/LINGUAS: Add ms.
5382
0435d061
AD
53832003-01-30 Akim Demaille <akim@epita.fr>
5384
5385 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
5386
6029a57f
PH
53872003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5388
5389 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
5390 of $1.
0435d061
AD
5391
5392 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 5393 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 5394 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 5395
6029a57f
PH
5396 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
5397 (b4_rhs_location): Ditto.
0435d061 5398 (yyfill): New function to copy from stack tree into array
6029a57f 5399 incrementally.
0435d061
AD
5400 (yyuserAction): Modify to allow incremental move of semantic values
5401 to rhs array when in GLR mode.
5402 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
5403 as needed.
5404 Remove dummy use of yystack, as there is now a guaranteed use.
5405 (yydoAction): Modify to allow incremental move of semantic values
5406 to rhs array when in GLR mode.
5407 (yyresolveAction): Ditto.
5408 (yyglrShiftDefer): Update comment.
0435d061 5409 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
5410 (yyglrReduce): Ditto.
5411 (yydoAction): Ditto
0435d061 5412
6029a57f
PH
5413 * tests/glr-regr1.at: Rename to ...
5414 * tests/glr-regression.at: Add new regression test for the problems
5415 described above (adapted from S. Eken).
5416 Update copyright notice.
5417 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
5418 * tests/Makefile.am: Ditto.
5419
6cee6297
PE
54202003-01-28 Paul Eggert <eggert@twinsun.com>
5421
5422 * data/lalr1.cc: Do not use @output_header_name@ unless
5423 b4_defines_flag is set. This fixes two bugs reported by
5424 Tim Van Holder in
161a71f3
PE
5425 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
5426 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 5427
b2a836b5
PE
54282003-01-21 Paul Eggert <eggert@twinsun.com>
5429
5430 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
5431 we don't need to worry about yyerrlab1 being reported as an
5432 "unused label" by non-GCC C compilers. The downside is that if
5433 locations are used then a couple of statements are duplicated each
5434 time YYERROR is invoked, but the upside is that the warnings
5435 should vanish.
5436 (yyerrlab1): Move code to YERROR.
5437 (yyerrlab2): Remove. Change uses back to yyerrlab1.
5438 This reverts some of the 2002-12-27 change.
5439
4196b931
PE
54402003-01-17 Paul Eggert <eggert@twinsun.com>
5441
5442 * src/output.c (symbol_printers_output): Fix typo that led
5443 to core dump. Problem reported by Antonio Rus in
161a71f3 5444 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 5445
3ae831b4
AD
54462003-01-13 Akim Demaille <akim@epita.fr>,
5447 Quoc Peyrot <chojin@lrde.epita.fr>,
5448 Robert Anisko <anisko_r@lrde.epita.fr>
5449
5450 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
5451 when the stacks contain one element, as the loop would otherwise
5452 free the last state, and then use the top state (the one we just
5453 popped). This means that the initial elements will not be freed
5454 explicitly, as is the case in yacc.c; it is not a problem, as
5455 these elements have fake values.
5456
e3aa65c5
PE
54572003-01-11 Paul Eggert <eggert@twinsun.com>
5458
5459 * NEWS: %expect-violations are now just warnings, reverting
5460 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
5461 bootstrapping problem reported by Matthias Klose; see
161a71f3 5462 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
5463 * src/conflicts.c (conflicts_print): Likewise.
5464 * tests/conflicts.at (%expect not enough, %expect too much,
5465 %expect with reduce conflicts): Likewise.
5466 * doc/bison.texinfo (Expect Decl): Document this. Also mention
5467 that the warning is enabled if the number of conflicts changes
5468 (not necessarily increases).
5469
5470 * src/getargs.c (version): Update copyright year.
5471
f0057011
AD
54722003-01-09 Akim Demaille <akim@epita.fr>
5473
5474 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
5475
1ee6d2a0
PE
54762003-01-08 Paul Eggert <eggert@twinsun.com>
5477
5478 * Makefile.maint (WGETFLAGS):
5479 New macro, containing "-C off" to disable proxy caches.
5480 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
5481 (rel-check): Use $(WGET) instead of wget.
5482
d4fd77c4
PE
54832003-01-06 Paul Eggert <eggert@twinsun.com>
5484
5485 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
5486 the GLR paper of Scott, Johnstone and Hussain.
5487
464c6927
PE
54882003-01-04 Paul Eggert <eggert@twinsun.com>
5489
d600ee67
PE
5490 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
5491 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
5492 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
5493 (EXTRA_LIBRARIES): New var, for liby.a.
5494 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
5495 (EXTRA_SCRIPTS): New var, for yacc.
5496
464c6927
PE
5497 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
5498 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
5499 Problem reported by Nelson H. F. Beebe.
5500
55012003-01-03 Paul Eggert <eggert@twinsun.com>
5502
5503 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
5504 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
5505 when compiling Bison 1.875's `bitset bset = obstack_alloc
5506 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
5507
5508 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
5509 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
5510 grow to a huge size with typical invocation.
d600ee67 5511
464c6927
PE
5512 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
5513 Use the pattern recommended by Autoconf 2.57, except also protect
5514 against double-definition.
5515 * src/system.h: Likewise.
5516 Portability issues reported by Nelson H. F. Beebe.
d600ee67 5517
464c6927
PE
5518 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
5519 All uses changed. Provide a definition in both C and C++.
5520 (yytrue, yyfalse): Define even if defined (__cplusplus).
5521
5522 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
5523 Reported by Nelson H. F. Beebe.
d600ee67 5524
464c6927
PE
5525 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
5526
0f42c7d5
PE
55272003-01-02 Paul Eggert <eggert@twinsun.com>
5528
5529 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
5530 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
5531 Bug reported by Nelson H. F. Beebe.
5532
dc546b0f
PE
55332003-01-01 Paul Eggert <eggert@twinsun.com>
5534
5535 * Version 1.875.
5536
2c09b6a7
PE
55372002-12-30 Paul Eggert <eggert@twinsun.com>
5538
5539 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
5540 Moved here from...
5541 (<INITIAL>","): Here. This causes stray "," to be treated
5542 more uniformly.
5543
dc546b0f 5544 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
5545 last brace in braced code when not in Yacc mode, for compatibility
5546 with Bison 1.35. This resurrects the 2001-12-15 patch to
5547 src/reader.c.
5548
5549 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
5550 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
5551
535c0f63
PE
55522002-12-28 Paul Eggert <eggert@twinsun.com>
5553
5554 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
5555 that of SYM's type. This fixes Debian bug 168069, reported by
5556 Thomas Olsson.
d600ee67 5557
963fcc17
PE
55582002-12-28 Paul Eggert <eggert@twinsun.com>
5559
5560 Version 1.75f.
5561
5562 Switch back to the Yacc style of conflict reports, undoing some
5563 of the 2002-07-30 change.
5564 * doc/bison.texinfo (Understanding): Use Yacc style for
5565 conflict reports. Also, use new way of locating rules.
5566 * src/conflicts.c (conflict_report):
5567 Renamed from conflict_report_yacc, removing the old
5568 'conflict_report'. Translate the entire conflict report at once,
5569 so that we don't assume that "," has the same interpretation in
5570 all languages.
5571 (conflicts_output): Use Yacc-style conflict report for each state,
5572 instead of our more-complicated style.
5573 (conflicts_print): Use Yacc-style conflict report, except print
5574 the input file name when not emulating Yacc.
5575 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
5576 Conflicted Reduction, %expect not enough, %expect too much,
5577 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
5578 * tests/existing.at (GNU Cim Grammar): Likewise.
5579 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
5580
5581 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
5582 fatal): Don't invoke fflush; it's not needed and it might even be
5583 harmful for stdout, as stdout might not be open.
5584 * src/reduce.c (reduce_print): Likewise.
5585
b1efe548
PE
55862002-12-27 Paul Eggert <eggert@twinsun.com>
5587
5588 Fix a bug where error locations were not being recorded correctly.
5589 This problem was originally reported by Paul Hilfinger in
161a71f3 5590 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
5591
5592 * data/yacc.c (yyparse): New local var yylerrsp, to record the
5593 top of the location stack's error locations.
5594 (yyerrlab): Set it. When discarding a token, push its location
5595 onto yylerrsp so that we don't lose track of the error's end.
5596 (yyerrlab1): Now is only the target of YYERROR, so that we can
5597 properly record the location of the action that failed. For GCC
5598 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
5599 GCC warning about yyerrlab1 being unused if YYERROR is unused.
5600 (yyerrlab2): New label, which yyerrlab now falls through to.
5601 Compute the error's location by applying YYLLOC_DEFAULT to
5602 the locations of all the symbols that went into the error.
5603 * doc/bison.texinfo (Location Default Action): Mention that
5604 YYLLOC_DEFAULT is also invoked for syntax errors.
5605 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
5606 Error locations include the locations of all the tokens that were
5607 discarded, not just the last token.
d600ee67 5608
983c5c2c
PE
56092002-12-26 Paul Eggert <eggert@twinsun.com>
5610
b1efe548
PE
5611 * src/files.c: Include quote.h.
5612 (compute_output_file_names): Warn if we detect conflicting
5613 outputs to the same file. This should catch the misunderstanding
5614 exemplified by Debian Bug 165349, reported by Bruce Stephens..
5615
5616 * src/conflicts.c (conflicts_print): If the user specifies
5617 "%expect N", report an error if there are any reduce/reduce
5618 conflicts. This is what the manual says should happen.
5619 This fixes Debian bug 130890, reported by Anthony DeRobertis.
5620 * tests/conflicts.at (%expect with reduce conflicts): New test.
5621
983c5c2c
PE
5622 Don't use m4_include on relative file names, as it doesn't work as
5623 desired if there happens to be a file with that name under ".".
d600ee67 5624
983c5c2c
PE
5625 * m4sugar/version.m4: Remove; it was included but it wasn't used.
5626 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
5627 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
5628 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
5629 * src/output.c (output_skeleton): Use full path names when
5630 specifying a file to include; don't rely on include path, as
5631 it's unreliable when the working file contains a file with
5632 that name.
d600ee67 5633
983c5c2c
PE
56342002-12-25 Paul Eggert <eggert@twinsun.com>
5635
5636 Remove obsolete references to bison.simple and bison.hairy.
5637 Problem mentioned by Aubin Mahe in
161a71f3 5638 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
5639 * data/glr.c: Comment fix.
5640 * doc/bison.1: Remove references. Also, mention "yacc".
5641
5642 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
5643 with -g option.
5644
5645 * src/parse-gram.y (declaration): Use enum "report_states" rather
5646 than its numeric value 1.
5647
5648 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
5649 opening a new one. This fixes Debian bug 165349, reported by
5650 Bruce Stephens.
5651
23f2d9dc
PE
56522002-12-24 Paul Eggert <eggert@twinsun.com>
5653
5654 Version 1.75e.
5655
5656 * Makefile.maint (cvs-update): Don't assume that the shell
5657 supports $(...), as Solaris sh doesn't.
5658
5659 * src/parse-gram.y (lloc_default): Remove test for empty
5660 nonterminals at the end, since it didn't change the result.
5661
56622002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
5663
5664 If the user does not define YYSTYPE as a macro, Bison now declares it
5665 using typedef instead of defining it as a macro. POSIX requires this.
5666 For consistency, YYLTYPE is also declared instead of defined.
5667
5668 %union directives can now have a tag before the `{', e.g., the
5669 directive `%union foo {...}' now generates the C code
5670 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
5671 The default union tag is `YYSTYPE', for compatibility with Solaris 9
5672 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
5673 instead of `yyltype'.
5674
5675 `yystype' and `yyltype' are now obsolescent macros instead of being
5676 typedefs or tags; they are no longer documented and will be
5677 withdrawn in a future release.
5678
5679 * data/glr.c (b4_location_type): Remove.
5680 (YYSTYPE): Renamed from yystype.
5681 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
5682 (struct YYLTYPE): Renamed from struct yyltype.
5683 (YYLTYPE): Renamed from yyltype.
5684 (yyltype, yystype): New (and obsolescent) macros,
5685 for backward compatibility.
5686 * data/yacc.c: Likewise.
5687
5688 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
5689 does not specify a union tag. This is for compatibility with
5690 Solaris 9 yacc.
5691
5692 * src/parse-gram.y (add_param): 2nd arg is now char * not char
5693 const *, since it is now modified by stripping surrounding { }.
5694 (current_braced_code): Remove.
5695 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
5696 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
5697 trailing " {...}". Now of type <chars>.
5698 (grammar_declaration): Adjust to bundled tokens.
5699 (code_content): Remove; stripping is now done by add_param.
5700 (print_token_value): Print contents of bundled tokens.
5701 (token_name): New function.
5702
5703 * src/reader.h (braced_code, current_braced_code): Remove.
5704 (token_name): New decl.
5705
5706 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
5707 token_type, not braced_code code_kind. All uses changed.
5708 (SC_PRE_CODE): New state, for scanning after a keyword that
5709 has (or usually has) an immediately-following braced code.
5710 (token_type): New local var, to keep track of which token type
5711 to return when scanning braced code.
5712 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 5713 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
5714 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
5715 instead of returning a token type immediately.
5716 (<INITIAL>"{"): Set token type.
5717 (<SC_BRACED_CODE>"}"): Use it.
5718 (handle_action_dollar, handle_action_at): Now returns bool
5719 indicating success. Fail if ! current_rule; this prevents a core dump.
5720 (handle_symbol_code_dollar, handle_symbol_code_at):
5721 Remove; merge body into caller.
5722 (handle_dollar, handle_at): Complain in invalid contexts.
5723
5724 * NEWS, doc/bison.texinfo: Document the above.
5725 * NEWS: Fix years and program names in copyright notice.
5726
879ca4f8
PE
57272002-12-17 Paul Eggert <eggert@twinsun.com>
5728
5729 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
5730 Reporting, Table of Symbols): Omit mentions of %lex-param and
5731 %parse-param from the documentation for now.
5732
1c5fe69d
PE
57332002-12-15 Paul Eggert <eggert@twinsun.com>
5734
5735 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
5736 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
5737 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
5738 disagreed with the Bison documentation. Bug
5739 reported by Andrew Walrond.
d600ee67 5740
1c5fe69d
PE
5741 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
5742 as the caller now does that.
5743 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
5744 (YYEMPTY): Parenthesize right hand side, since others use it.
5745 (yyparse): Don't assume that our generated code is the only code
5746 that sets yychar.
5747
d1de5372
PE
57482002-12-13 Paul Eggert <eggert@twinsun.com>
5749
5750 Version 1.75d.
5751
5752 POSIX requires a "yacc" command.
5753 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
5754 (MOSTLYCLEANFILES): Add yacc.
5755 (yacc): New rule.
1c5fe69d 5756 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
5757 as an alias for bison y.
5758
5759 * po/LINGUAS: Add da.
d600ee67 5760
d1de5372
PE
5761 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
5762 problem with latest <getopt.h>.
5763 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
5764
5765 * doc/fdl.texi: Upgrade to 1.2.
5766 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
5767 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
5768 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
5769 gnulib.
5770 * config/install-sh: Sync with autotools.
5771
5772 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 5773 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
5774 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
5775 locations are requested.
5776 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
5777 locations are requested.
5778
d0f3fe23
PE
57792002-12-12 Paul Eggert <eggert@twinsun.com>
5780
5781 Remove unportable casts and storage allocation tricks.
5782 While we're at it, remove almost all casts, since they
5783 usually aren't needed and are a sign of trouble.
5784
5785 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
5786
5787 * src/derives.c (derives_compute): Do not subtract NTOKENS from
5788 the pointer DSET returned by malloc; this isn't portable.
5789 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
5790 Similarly for DERIVES.
5791 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
5792 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
5793 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
5794
5795 * src/derives.c (derives_compute): Do not bother invoking
5796 int_of_rule_number, since rule numbers are integers.
5797
5798 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
5799 rather than XMALLOC (char, N).
5800
5801 * src/files.c (filename_split): Rewrite to avoid cast.
5802
5803 * src/gram.h (symbol_number_as_item_number,
5804 item_number_as_symbol_number, rule_number_as_item_number,
5805 item_number_as_rule_number):
5806 Now inline functions rather than macros, to avoid casts.
5807 * src/state.h (state_number_as_int): Likewise.
5808 * src/tables.c (state_number_to_vector_number,
5809 symbol_number_to_vector_number): Likewise.
5810
5811 * src/gram.h (int_of_rule_number): Remove; no longer used.
5812
5813 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
5814 since the resulting storage is always stored into.
5815
5816 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
5817 where it's needed.
5818
5819 * src/muscle_tab.c (muscle_m4_output):
5820 Now inline. Return bool, not int.
5821 * src/state.c (state_compare): Likewise.
5822 * src/symtab.c (symbol_check_defined,
5823 symbol_check_alias_consistency, symbol_pack, symbol_translation,
5824 hash_compare_symbol, hash_symbol):
5825 Likewise.
5826 * src/uniqstr.c (uniqstr_print): Likewise.
5827 * src/muscle_tab.c (muscle_m4_output_processor):
5828 New function, to avoid casts.
5829 * src/state.c (state_comparator, stage_hasher): Likewise.
5830 * src/symtab.c (symbol_check_defined_processor,
5831 symbol_check_alias_consistency_processor, symbol_pack_processor,
5832 symbol_translation_processor, hash_symbol_comparator,
5833 hash_symbol_hasher): Likewise.
5834 * src/uniqstr.c (uniqstr_print_processor): Likewise.
5835 * src/muscle_tab.c (muscles_m4_output):
5836 Use new functions instead of casting old functions unportably.
5837 * src/state.c (state_hash_new): Likewise.
5838 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
5839 symbols_token_translations_init):
5840 Likewise.
5841 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
5842
5843 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
5844 var instead of casting to long, to avoid casts.
5845 (prepare_states): Use MALLOC rather than alloca, so that we don't
5846 have to worry about alloca.
5847 * src/state.c (state_hash_lookup): Likewise.
5848
5849 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
5850 local var instead of casting to unsigned char, to avoid casts.
5851
5852 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
5853 STATE_ALLOC): Remove.
5854 (transitions_new, errs_new, reductions_new, state_new): Use malloc
5855 rather than calloc, and use offsetof to avoid allocating slightly
5856 too much storage.
5857 (state_new): Initialize all members.
5858
5859 * src/state.c (state_hash): Use unsigned accumulator, not signed.
5860
5861 * src/symtab.c (symbol_free): Remove; unused.
5862 (symbol_get): Remove cast in lhs of assignment.
5863 (symbols_do): Now static. Accept generic arguments, not
5864 hashing-related ones.
5865
5866 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
5867 (symbol_processor): Remove.
5868 (symbols_do): Remove decl; now static.
5869
5870 * src/system.h (alloca): Remove; decl no longer needed.
5871 (<stddef.h>): Include, for offsetof.
5872 (<inttypes.>, <stdint.h>): Include if available.
5873 (uintptr_t): New type, if system lacks it.
5874 (CALLOC, MALLOC, REALLOC): New macros.
5875 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
5876 new macros.
5877
5878 * src/tables.c (table_size): Now int, to pacify GCC.
5879 (table_grow, table_ninf_remap): Use signed table size.
5880 (save_row): Don't bother initializing locals when not needed.
5881 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
5882 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
5883
5884 * src/vcg.h: Correct misspellings.
5885
5886 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
5887
5888
5889 * src/getargs.c (getargs): Don't assume EOF == -1.
5890
26b4a969
PE
58912002-12-09 Paul Eggert <eggert@twinsun.com>
5892
5893 Change identifier spellings to avoid collisions with names
5894 that are reserved by POSIX.
5895
5896 Don't use names ending in _t, since POSIX reserves them.
5897 For consistency, remove _e and _s endings -- they're weren't
5898 needed to remove ambiguity. All uses changed.
5899 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
5900 turn was just renamed from struniq_t.
5901 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
5902 which in turn was just renamed from struniq_processor_t.
5903 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
5904 in turn was renamed from hash_compare_struniq_t.
5905 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
5906 (state_list): Renamed from state_list_t.
5907 * src/assoc.h (assoc): Renamed from assoc_t.
5908 * src/conflicts.c (enum conflict_resolution): Renamed from
5909 enum conflict_resolution_e.
5910 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
5911 (rule_list): Renamed from rule_list_t.
5912 * src/getargs.h (enum trace): Renamed from enum trace_e.
5913 (enum report): Renamed from enum report_e.
5914 * src/gram.h (item_number): Renamed from item_number_t.
5915 (rule_number): Renamed from rule_number_t.
5916 (struct rule_s): Remove the "rule_s" part; not used.
5917 (rule): Renamed from rule_t.
5918 (rule_filter): Renamed from rule_filter_t.
5919 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
5920 (goto_list): Renamed from goto_list_t.
5921 * src/lalr.h (goto_number): Renamed from goto_number_t.
5922 * src/location.h (location): Renamed from location_t.
5923 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
5924 and moved here from:
5925 * src/muscle_tab.h (muscle_entry_t): here.
5926 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
5927 (rule_list): Renamed from rule_list_t.
5928 * src/print_graph.c (static_graph): Renamed from graph.
5929 * src/reader.h (braced_code): Renamed from braced_code_t.
5930 Remove brace_code_e tag.
5931 * src/relation.h (relation_node): Renamed from relation_node_t.
5932 (relation_nodes): Renamed from relation_nodes_t.
5933 (relation): Renamed from relation_t.
5934 * src/state.h (state_number): Renamed from state_number_t.
5935 (struct state): Renamed from struct state_s.
5936 (state): Renamed from state_t.
5937 (transitions): Renamed from transitions_t. Unused (and
5938 misspelled) transtion_s tag removed.
5939 (errs): Renamed from errs_t. Unused errs_s tag removed.
5940 (reductions): Renamed from reductions_t. Unused tag
5941 reductions_s removed.
5942 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
5943 (struct symbol_list): Renamed from struct symbol_list_s.
5944 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
5945 (struct symbol): Renamed from struct symbol_s.
5946 (symbol): Renamed from symbol_t.
5947 * src/tables.c (vector_number): Renamed from vector_number_t.
5948 (action_number): Renamed from action_t.
5949 * src/tables.h (base_number): Renamed from base_t.
5950 * src/vcg.h (enum color): Renamed from enum color_e.
5951 (enum textmode): Renamed from enum textmode_e.
5952 (enum shape): Renamed from enum shape_e.
5953 (struct colorentry): Renamed from struct colorentry_s.
5954 (struct classname): Renamed from struct classname_s.
5955 (struct infoname): Renamed from struct infoname_s.
5956 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
5957 (enum decision): Renamed from enum decision_e.
5958 (enum orientation): Renamed from enum orientation_e.
5959 (enum alignment): Renamed from enum alignment_e.
5960 (enum arrow_mode): Renamed from enum arrow_mode_e.
5961 (enum crossing_type): Renamed from enum crossing_type_e.
5962 (enum view): Renamed from enum view_e.
5963 (struct node): Renamed from struct node_s.
5964 (node): Renamed from node_t.
5965 (enum linestyle): Renamed from enum linestyle_e.
5966 (enum arrowstyle): Renamed from enum arrowstyle_e.
5967 (struct edge): Renamed from struct edge.
5968 (edge): Renamed from edge_t.
5969 (struct graph): Renamed from struct graph_s.
5970 (graph): Renamed from graph_t.
5971 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
5972 Rename value_t -> value.
5973 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
5974 value_t_as_yystype -> value_as_yystype.
5975
5976 Don't include <errno.h> in the mainstream code, since it
5977 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
5978 * lib/get-errno.c, lib/get-errno.h: New files.
5979 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
5980 get-errno.c.
5981 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
5982 * src/output.c (output_skeleton): Likewise.
5983 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
5984 instead of errno.
5985 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
5986 Likewise.
5987 (handle_action_dollar, handle_action_at): Likewise.
5988 * src/system.h: Do not include <errno.h>.
5989 (TAB_EXT): Renamed from EXT_TAB.
5990 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
5991
5992 Avoid str[a-z]*, since <string.h> reserves that name space.
5993 Change all instances of "struniq" in names to "uniqstr", and
5994 likewise for "STRUNIQ" and "UNIQSTR".
5995 * src/uniqstr.c: Renamed from src/struniq.c.
5996 * src/uniqstr.h: Renamed from src/struniq.h.
5997 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
5998 * src/files.c (strsuffix): Remove; unused.
5999 (concat2): Renamed from stringappend. Now static.
6000 * src/files.h (strsuffix, stringappend): Remove; unused.
6001 * src/parse-gram.y (<chars>): Renamed from <string>.
6002 (<uniqstr>): Renamed from <struniq>.
6003 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
6004 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
6005 (struct graph_s.expand): Renamed from struct graph_s.stretch.
6006 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
6007 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
6008 (N_EXPAND): Renamed from N_STRETCH.
6009
6010 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
6011 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
6012 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
6013 Remove; unused.
6014 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
6015 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
6016 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
6017 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
6018 (BASE_MAXIMUM): Renamed from BASE_MAX.
6019 (BASE_MINIMUM): Renamed from BASE_MIN.
6020 (ACTION_MAX): Remove; unused.
6021 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
6022 Unnecessary casts removed from above defines.
6023
6024
6025 Fix misspelling in names.
6026 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
6027 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
6028 G_NODE_ALIGNEMENT.
6029
6030
6031 * lib/timevar.c (timevar_report): Renamed from time_report,
6032 for consistency with other names.
6033 * lib/timevar.h (timevar_report): New decl.
6034 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
6035
6036
6037 Sort include-file uses.
6038
6039 Reorder all include files under src to be in the order "system.h".
6040 then the ../lib include files in angle brackets (alphabetized),
6041 then the . include files in double-quotes (alphabetized). Fix
6042 dependency breakages encountered in this process, as follows:
6043 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
6044 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
6045 * src/state.h: Include "symtab.h".
6046
996b1c7e
PE
60472002-12-08 Paul Eggert <eggert@twinsun.com>
6048
6049 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
6050 since this causes problems when __file__ contains character
6051 sequences like "@" that are treated specially by src/scan-skel.l.
6052 Instead, just use the file's basename. This fixes the bug
6053 reported by Martin Mokrejs in
161a71f3 6054 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 6055
e19c4e5d
PE
60562002-12-06 Paul Eggert <eggert@twinsun.com>
6057
6058 Add support for rules that do not have trailing semicolons, as
6059 POSIX requires. Improve the quality of locations in Bison
6060 diagnostics.
26b4a969 6061
e19c4e5d
PE
6062 * src/location.c: Include <quotearg.h>.
6063 (empty_location): Now const.
6064 (location_print): New function. Follow the recommendation of the
6065 GNU Coding Standards for locations that span file boundaries.
6066 * src/location.h: Do not include <quotearg.h>; no longer needed.
6067 (boundary): New type.
6068 (location_t): Use it. This allows locations to span file boundaries.
6069 All member uses changed: file -> start.file or end.file (as needed),
6070 first_line -> start.line, first_column -> start.column,
6071 last_line -> end.line, last_column -> end.column.
6072 (equal_boundaries): New function.
6073 (LOCATION_RESET, LOCATION_STEP): Remove.
6074 (LOCATION_PRINT): Remove. All callers changed to use location_print.
6075 (empty_location): Now const.
6076 (location_print): New decl.
6077 * src/parse-gram.y (lloc_default): New function, which handles
6078 empty locations more accurately.
6079 (YYLLOC_DEFAULT): Use it.
6080 (%token COLON): Remove.
6081 (%token ID_COLON): New token.
26b4a969 6082 (rules): Use it.
e19c4e5d
PE
6083 (declarations, rules): Remove trailing semicolon.
6084 (declaration, rules_or_grammar_declaration):
6085 Allow empty (";") declaration.
6086 (symbol_def): Remove empty actions; no longer needed.
6087 (rules_or_grammar_declaration): Remove trailing semicolon.
6088 (semi_colon.opt): Remove.
6089 * src/reader.h: Include location.h.
6090 (scanner_cursor): New decl.
6091 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
6092 rolling our own.
6093 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
6094 of *loc.
6095 (STEP): Remove. No longer needed, now that adjust_location does
6096 the work. All uses removed.
6097 (scanner_cursor): New var.
6098 (adjust_location): Renamed from extend_location. It now sets
6099 *loc and adjusts the scanner cursor. All uses changed.
6100 Don't bother testing for CR.
6101 (handle_syncline): Remove location arg; now updates scanner cursor.
6102 All callers changed.
6103 (unexpected_end_of_file): Now accepts start boundary of token or
6104 comment, not location. All callers changed. Update scanner cursor,
6105 not the location.
6106 (SC_AFTER_IDENTIFIER): New state.
6107 (context_state): Renamed from c_context. All uses changed.
6108 (id_loc, code_start, token_start): New local vars.
6109 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
6110 processing of Yacc white space and equivalents here.
6111 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
6112 instead of returning ID immediately, since we need to search for
6113 a subsequent colon.
6114 (<INITIAL>"'", "\""): Save token_start.
6115 (<INITIAL>"%{", "{", "%%"): Save code_start.
6116 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
6117 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
6118 BEGIN context_state at end, not INITIAL.
6119 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
6120 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
6121 Return correct token start.
6122 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
6123 the start of a character, string or multiline comment is found.
6124 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
6125 Reduction): Adjust reported locations to match the more-precise
6126 results now expected.
6127 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
6128 * tests/reduce.at (Useless Rules, Reduced Automaton,
6129 Underivable Rules): Likewise.
6130 * tests/regression.at (Invalid inputs): No longer `expecting ";"
6131 or "|"' now that so many other tokens are allowed by the new grammar.
6132
6133 * src/complain.h (current_file): Remove duplicate decl;
6134 current_file is now owned by files.h.
6135 * src/complain.c, src/scan-gram.l: Include files.h.
6136
61372002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 6138
e19c4e5d
PE
6139 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
6140 promotes to int; it might be unsigned int.
6141 * data/yacc.c (yy_reduce_print): Likewise.
6142
6143 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
6144 be #defined in the prologue, not in the Bison declarations.
6145 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 6146
b64755e3
PE
61472002-12-02 Paul Eggert <eggert@twinsun.com>
6148
6149 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
6150 * lib/strtoul.c: New file, from gnulib.
6151 This fixes a porting bug reported by Peter Klein in
161a71f3 6152 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 6153
6e746484
PE
61542002-11-30 Paul Eggert <eggert@twinsun.com>
6155
b64755e3
PE
6156 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
6157 and put only a forward declaration in the prologue. This is for
6158 consistency with the other scanner helper functions.
6159
6ba55592
PE
6160 Type clashes now generate warnings, not errors, since it
6161 appears that POSIX may allow some grammars with type clashes.
6162 * src/reader.c (grammar_current_rule_check): Warn about
6163 type clashes instead of complaining.
6164 * tests/input.at (Type Clashes): Expect warnings, not complaints.
6165
6e746484
PE
6166 Add Yacc library, since POSIX requires it.
6167 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
6168 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
6169 * lib/main.c, lib/yyerror.c: New files.
6170
6171 gram_error can be static; it need not be extern.
6172 * src/reader.h (gram_error): Remove decl.
6173 * src/parse-gram.y (gram_error): Now static. Add static decl.
6174 (print_token_value): Omit parameter names from forward decl,
6175 for consistency.
6176
88510f9c
PE
61772002-11-29 Paul Eggert <eggert@twinsun.com>
6178
6e746484
PE
6179 * doc/bison.texinfo: Emphasize that yylex and yyerror must
6180 be declared before being used. E.g., one should typically
6181 declare them in the prologue. Use GNU coding style in examples.
6182 Put "const" consistently after the type it modifies. Mention
6183 that C99 supports "inline". Mention that yyerror traditionally
6184 returns "int".
6185
88510f9c
PE
6186 %parse-param and %lex-param now take just one argument, the
6187 declaration; the argument name is deduced from the declaration.
6188
6189 * doc/bison.texinfo (Parser Function, Pure Calling, Error
6190 Reporting, Table of Symbols): Document this.
6191 * src/parse-gram.y (add_param): New function.
6192 (COMMA): Remove.
6193 (declaration): Implement new rule for %parse-param and %lex-param.
6194 * src/scan-gram.l: "," now elicits a warning, rather than being
6195 a token; this is more compatible with byacc.
6196 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
6197
bb92250c
PE
61982002-11-27 Paul Eggert <eggert@twinsun.com>
6199
6200 Rename identifiers to avoid real and potential collisions.
6201
6202 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
6203 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 6204 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
6205 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
6206 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
6207 * src/parse-gram.y (print_token_value): Renamed from yyprint.
6208 All uses changed.
6209 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
6210 The name "yycontrol" violates the name space rules, and this stuff
6211 wasn't being used anyway.
6212 (input): Remove action; this stuff wasn't being used.
6213 (gram_error): Rename local variable yylloc -> loc.
6214 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
6215 (YY_DECL): Don't use "yy" at start of local variables.
6216 All uses changed, e.g., yylloc -> loc.
6217 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
6218 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
6219 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
6220 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
6221
6222 * src/parse-gram.y (gram_error): loc is now const *.
6223 * src/reader.h (gram_error): Likewise.
6224
3af4feb2
PE
62252002-11-24 Paul Eggert <eggert@twinsun.com>
6226
6227 Version 1.75c.
6228
6229 * tests/actions.at (Actions after errors): Use an output format
6230 more similar to that of the Printers and Destructors test.
6231 Test the position of the ';' token too.
6232 (Printers and Destructors): Likewise.
6233 (Printers and Destructors: %glr-parser): Remove for now, to avoid
6234 unnecessarily alarming people when the test fails.
6235
6236 * data/yacc.c (yyerrlab1): Move this label down, so that the
6237 parser does not discard the lookahead token if the user code
6238 invokes YYERROR. This change is required for POSIX conformance.
6239
6240 * lib/error.c: Sync with gnulib.
6241
62422002-11-22 Paul Eggert <eggert@twinsun.com>
6243
6244 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
6245 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
6246 * lib/xmalloc.c: Likewise.
26b4a969 6247
58004308
PE
62482002-11-20 Paul Eggert <eggert@twinsun.com>
6249
6250 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
6251
62522002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 6253
58004308
PE
6254 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
6255 should use `if (! x) abort ();' rather than `assert (x);', and
6256 anyway it's one less thing to worry about configuring.
6257
6258 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
6259 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
6260 and replace all instances of assert with abort.
6261 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
6262 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
6263
6264 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
6265 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
6266 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
6267 hash_find_entry, hash_rehash, hash_insert): Likewise.
6268 * src/conflicts.c (resolve_sr_conflict): Likewise.
6269 * src/lalr.c (set_goto_map, map_goto): Likewise.
6270 * src/nullable.c (nullable_compute): Likewise.
6271 * src/output.c (prepare_rules, token_definitions_output): Likewise.
6272 * src/reader.c (packgram, reader): Likewise.
6273 * src/state.c (state_new, state_free, state_transitions_set,
6274 state_reduction_find): Likewise.
6275 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
6276 symbol_pack): Likewise.
6277 * src/tables.c (conflict_row, pack_vector): Likewise.
6278 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
6279 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
6280 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
6281 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
6282
6283 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
6284 (ARGMATCH_CONSTRAINT): New macro.
6285 (ARGMATCH_ASSERT): Use it.
6286
6287 * src/system.h (verify): New macro.
6288 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
6289 rather than assert.
6290 * src/tables.c (tables_generate): Likewise.
6291
6292 * src/struniq.c (struniq_assert): Now returns void, and aborts
6293 if the assertion is false.
6294 (struniq_assert_p): Remove.
6295 * src/struniq.h: Likewise.
6296
76ae8198
PE
62972002-11-18 Paul Eggert <eggert@twinsun.com>
6298
6299 * data/glr.c (yygetLRActions): Replace `yyindex' with
6300 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
6301 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 6302 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 6303
d3c4e709
AD
63042002-11-18 Akim Demaille <akim@epita.fr>
6305
6306 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
6307 space.
6308 From Tim Van Holder.
6309
8d8a7238
PE
63102002-11-17 Paul Eggert <eggert@twinsun.com>
6311
6312 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
6313 to "SyntaxError" for consistency with my 2002-11-15 change.
6314
6315 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
6316 not define to {}, since this breaks the common use of `YYDPRINTF
6317 ((...));' if a single statement is desired (e.g. before `else').
6318 Work around GCC warnings by surrounding corresponding calls with
6319 {} if needed.
6320 (yyhasResolvedValue): Remove unused function.
6321 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
6322 loop body.
6323 (yyreportSyntaxError): Renamed from yyreportParseError.
6324 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
6325 All uses changed.
6326 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
6327 extern when possible. Remove unused initializations.
6328
b0937b22
AD
63292002-11-16 Akim Demaille <akim@epita.fr>
6330
6331 Augment the similarity between GLR and LALR traces.
6332
6333 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
6334 (YY_REDUCE_PRINT): New.
6335 (yyparse): Use them.
6336 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
6337 YYDPRINT here.
6338 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
6339 state reached after the reduction/recovery, since...
6340 (yyparse, yyprocessOneStack): Report the state we are entering in.
6341
c5e3e510
AD
63422002-11-16 Akim Demaille <akim@epita.fr>
6343
6344 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
6345 Add support for --trace=skeleton.
6346 * src/scan-skel.l: %option debug.
6347 Scan strings of non-@ or \n instead of character by character.
6348 (scan_skel): Handle trace_skeleton.
6349 (QPUTS): New.
6350 (@output_parser_name@, @output_header_name@): ``Restore'' their
6351 support (used to be M4 macros).
6352 * data/yacc.c: Quote larger chunks, a la glr.c.
6353 * data/lalr1.cc: Likewise.
6354 The header guards are no longer available, so use some other
6355 string than `YYLSP_NEEDED'.
6356
4c6cc1db
AD
63572002-11-16 Akim Demaille <akim@epita.fr>
6358
6359 Make the ``Printers and Destructors'' test more verbose, taking
6360 `yacc.c''s behavior as (possibly wrong) reference.
6361
6362 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
6363 instead of fprint on stdout.
6364 Set and report the last_line of the symbols.
6365 Consistently display values and locations.
6366
6d9e8019
PE
63672002-11-16 Paul Eggert <eggert@twinsun.com>
6368
6369 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
6370
6e649e65
PE
63712002-11-15 Paul Eggert <eggert@twinsun.com>
6372
b25d88f6
PE
6373 * tests/actions.at (Actions after errors): New test case.
6374
6e649e65
PE
6375 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
6376 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
6377 tests/action.at, tests/calc.at, tests/conflicts.at,
6378 tests/cxx-type.at, tests/regression.at:
6379 "parse error" -> "syntax error" for POSIX compatibility.
6380 "parsing stack overflow..." -> "parser stack overflow" so
6381 that code matches Bison documentation.
6382
0f39aab9
AD
63832002-11-15 Akim Demaille <akim@epita.fr>
6384
6385 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
6386 take two BRACED_CODE, not two string_content.
6387 Free the scanner's obstack when we are done.
6388 (code_content): New.
6389 * tests/calc.at: Adjust.
6390 * doc/bison.texinfo: Adjust.
6391 Also, make sure to include the `,' for these declarations.
6392
761c1926
AD
63932002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
6394
6395 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
6396 definition; avoids potential autoreconf problems.
6397
b0f98b10
AD
63982002-11-15 Akim Demaille <akim@epita.fr>
6399
6400 Always check the value returned by yyparse.
6401
6402 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
6403 returned by yyparse.
6404 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
6405 Adjust calls.
6406 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
6407 returned by yyparse.
6408
970785f1
PH
64092002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6410
6411 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
6412 on input.at test.
6413
8fcc7db1
PE
64142002-11-14 Paul Eggert <eggert@twinsun.com>
6415
7ec1b48e
PE
6416 * src/output.c (output_skeleton): Call xfopen instead of
6417 duplicating xfopen's body.
6418
cfff7583 6419 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 6420 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 6421
8fcc7db1
PE
6422 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
6423 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
6424 Group compiler. Instead, use "$CC -E bar.c". Include the .h
6425 file twice in the grammar, as an extra check.
6426
6427 * tests/input.at (Torturing the Scanner): Surround the
6428 backslash-newline tests with "#if 0", to make it less likely that
6429 we'll run into compiler bugs. Bring back solitary \ inside
6430 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 6431 test backslash-newline in C character constant.
8fcc7db1 6432
4e8d992c
AD
64332002-11-14 Akim Demaille <akim@epita.fr>
6434
6435 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
6436 status of the compiler.
f32b346d 6437 Calling `exit 1' is no longer needed.
4e8d992c
AD
6438 Reported by Nelson H. F. Beebe.
6439
9501dc6e
AD
64402002-11-14 Akim Demaille <akim@epita.fr>
6441
6442 * tests/atlocal.in (CPPFLAGS): We have config.h.
6443 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
6444 New.
6445 * tests/actions.at, tests/calc.at, tests/conflicts.at,
6446 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
6447 * tests/regression.at, tests/torture.at: Use them for all the
6448 grammars that are to be compiled.
6449 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
6450 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
6451 * doc/bison.texinfo (GLR Parsers): Document `inline'.
6452
18b519c0
AD
64532002-11-14 Akim Demaille <akim@epita.fr>
6454
6455 * doc/bison.texinfo: Various formatting changes (alignments in
6456 samples, additional @group/@end group, GCS in samples.
6457 Use @deffn instead of simple @table to define the directives,
6458 macros, variables etc.
6459
9a86cdb9
PE
64602002-11-13 Paul Eggert <eggert@twinsun.com>
6461
daa33def 6462 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 6463 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 6464
daa33def 6465 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 6466 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
6467 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
6468 * tests/headers.at (export YYLTYPE): Likewise.
6469
6470 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 6471 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 6472
9a86cdb9
PE
6473 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
6474 comments, since they're not portable. Use GNU coding style.
6475
9c1e26bd
AD
64762002-11-13 Akim Demaille <akim@epita.fr>
6477
6478 * data/yacc.c: Leave bigger chunks of quoted text.
6479 (YYDSYMPRINTF): New.
6480 Use it to report symbol activities.
6481 * data/glr.c (YYDSYMPRINTF): New.
6482 Use it.
6483
87f721cc
PE
64842002-11-12 Paul Eggert <eggert@twinsun.com>
6485
6486 Version 1.75b.
6487
6488 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
6489 (yyglrReduce): Return yyok, not 0.
6490 This should avoid the enumerated-type warnings reported
464c6927 6491 by Nelson H. F. Beebe in
161a71f3 6492 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
6493
6494 * lib/bbitset.h (BITSET_INLINE): Remove.
6495 * lib/bitset.h [! BITSET_INLINE]: Remove.
6496 (bitset_set, bitset_reset, bitset_test): Rename local vars
6497 to avoid shadowing warnings by GCC.
6498
6499 * data/glr.c (inline): Remove #define. It's the user's
6500 responsibility to #define it away, just like 'const'.
464c6927 6501 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 6502 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 6503
87f721cc
PE
6504 * Makefile.maint (po-check): Scan .l and .y files instead of the
6505 .c and the .h files that they generate. This fixes the bug
6506 reported by Tim Van Holder in:
161a71f3 6507 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
6508 Look for N_ as well as for _. Try to avoid matching #define for
6509 N_ and _.
6510 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
6511 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
6512 * src/scan-gram.l: Revamp regular expressions so that " and '
6513 do not confuse xgettext.
6514
6515 * src/struniq.h (struniq_new): Do not declare the return type
6516 to be 'const'; this violates the C standard.
6517 * src/struniq.c (struniq_new): Likewise.
6518
be14ade5
AD
65192002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
6520
6521 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
6522 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
6523 linker.
6524
05291fbc
AD
65252002-11-12 Akim Demaille <akim@epita.fr>
6526
6527 * Makefile.maint: Sync with Autoconf:
6528 (local_updates): New.
6529
1f5fd52e
AD
65302002-11-12 Akim Demaille <akim@epita.fr>
6531
6532 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
6533
283f1e64
AD
65342002-11-12 Akim Demaille <akim@epita.fr>
6535
6536 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
6537 locations.
6538
886b69d1
AD
65392002-11-12 Akim Demaille <akim@epita.fr>
6540
6541 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
6542 not yyvalue.
6543
3df37415
AD
65442002-11-12 Akim Demaille <akim@epita.fr>
6545
6546 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
6547 Use it to test the GLR parser.
6548
7bd6c77e
AD
65492002-11-12 Akim Demaille <akim@epita.fr>
6550
6551 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
6552 defines it.
6553 * data/glr.c (yystos): New.
6554 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
6555 (YYDSYMPRINT): New.
6556 (yyval): Don't define it, it is handled via M4.
6557 (yyrecoverParseError): Free verbosely the discarded symbols.
6558 * data/yacc.c (yysymprint): Remove, rather...
6559 (b4_yysymprint_generate): invoke.
6560 * data/c.m4 (b4_yysymprint_generate): New.
6561 Accept pointers as arguments, as opposed to the version from
6562 yacc.c.
6563 (b4_yydestruct_generate): Likewise.
6564 * tests/cations.at (Printers and Destructors): Use Bison directives
6565 instead of CPP macros.
6566 Don't rely on internal details.
6567
b0400cc6
AD
65682002-11-12 Akim Demaille <akim@epita.fr>
6569
6570 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
6571 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
6572 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
6573 it against YYEMPTY and so forth), work on yytoken (i.e., set
6574 it to YYEMPTY etc.).
6575 (yydestruct): Replace with a b4_yydestruct_generate invocation.
6576 (b4_symbol_actions): Remove.
6577 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
6578 for 0, end-of-input.
6579
72f889cc
AD
65802002-11-12 Akim Demaille <akim@epita.fr>
6581
6582 * doc/bison.texinfo (Destructor Decl): New.
6583
b1ae9233
AD
65842002-11-12 Akim Demaille <akim@epita.fr>
6585
6586 * src/tables.c (tables_generate): Use free for pointers that
6587 cannot be NULL, not XFREE.
6588 (pack_vector): Use assert, not fatal, for bound violations.
6589 * src/state.c (state_new): Likewise.
6590 * src/reader.c (reader): Likewise.
6591 * src/lalr.c (set_goto_map): Likewise.
72f889cc 6592 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
6593 the file name.
6594
7ec2d4cd
AD
65952002-11-12 Akim Demaille <akim@epita.fr>
6596
6597 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
6598 Restore.
6599 * src/scan-gram.l (last_string): Is global to the file, not to
6600 yylex.
6601 * src/parse-gram.y (input): Don't append the epilogue here,
6602 (epilogue.opt): do it here, and free the scanner's obstack.
6603 * src/reader.c (epilogue_set): Rename as...
6604 (epilogue_augment): this.
6605 * data/c.m4 (b4_epilogue): Defaults to empty.
6606
573a6cd3
AD
66072002-11-12 Akim Demaille <akim@epita.fr>
6608
6609 * src/getargs.c (long_options): Remove duplicates.
6610 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
6611 Remove.
6612 * doc/bison.rnh: Remove.
6613 * doc/bison.texinfo (VMS Invocation): Remove.
6614
95612cfa
AD
66152002-11-12 Akim Demaille <akim@epita.fr>
6616
6617 * src/struniq.h, src/struniq.c (struniq_t): Is const.
6618 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
6619
6620 Use struniq for symbols.
6621
6622 * src/symtab.h (symbol_t): The tag member is a struniq.
6623 (symbol_type_set): Adjust.
6624 * src/symtab.c (symbol_new): Takes a struniq.
6625 (symbol_free): Don't free the tag member.
6626 (hash_compare_symbol_t, hash_symbol_t): Rename as...
6627 (hash_compare_symbol, hash_symbol): these.
6628 Use the fact that tags as struniqs.
6629 (symbol_get): Use struniq_new.
6630 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
6631 Returns a strniq.
6632 * src/reader.h (merger_list, grammar_currentmerge_set): The name
6633 and type members are struniqs.
6634 * src/reader.c (get_merge_function)
6635 (grammar_current_rule_merge_set): Adjust.
6636 (TYPE, current_type): Are struniq.
6637
6638 Use struniq for file names.
6639
6640 * src/files.h, src/files.c (infile): Split into...
6641 (grammar_file, current_file): these.
6642 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
6643 * src/reduce.c (reduce_print): Likewise.
6644 * src/getargs.c (getargs): Likewise.
6645 * src/complain.h, src/complain.c: Likewise.
6646 * src/main.c (main): Call struniqs_new early enough to use it for
6647 file names.
6648 Don't free the input file name.
6649
3e6656f9
AD
66502002-11-12 Akim Demaille <akim@epita.fr>
6651
6652 * src/symtab.c (symbol_free): Remove dead deactivated code:
6653 type_name are properly removed.
6654 Don't use XFREE to free items that cannot be NULL.
6655 * src/struniq.h, src/struniq.c: New.
6656 * src/main.c (main): Initialize/free struniqs.
6657 * src/parse-gram.y (%union): Add astruniq member.
6658 (yyprint): Adjust.
6659 * src/scan-gram.l (<{tag}>): Return a struniq.
6660 Free the obstack bit that used to store it.
6661 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
6662
7672019c
PE
66632002-11-11 Paul Eggert <eggert@twinsun.com>
6664
6665 Revamp to fix many (but not all) of the C- and M4-related quoting
6666 problems. Among other things, this fixes the Bison bug reported
6667 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 6668 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
6669
6670 Use new @ escapes consistently. Represent brackets with @{ and @}
6671 rather than @<:@ and @:>@, since this works a bit better with dumb
6672 editors like vi. Represent @ with @@, since @ is now consistently
6673 an escape. Use @oline@ and @ofile@ rather than __oline__ and
6674 __ofile__, to avoid unexpected expansions. Similarly, use @output
6675 rather than #output.
6676
6677 * data/c.m4 (b4_copyright): Omit file name from comment, since
6678 the file name could contain "*/".
6679 (b4_synclines_flag): Don't quote the 2nd argument; it should already
6680 be quoted. All uses changed.
6681
6682 * data/glr.c: Use new @ escapes consistently.
6683 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
6684 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
6685 Remove, since they couldn't handle arbitrary characters in file
6686 names.
6687 * data/lalr1.cc: Likewise.
6688 * data/yacc.c: Likewise.
6689
6690 * src/files.c (output_infix): Remove; all uses removed.
6691 * src/files.h: Likewise.
6692
6693 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
6694 mishandled funny characters in file names, and anyway it isn't
6695 needed any more.
6696 * data/yacc.c: Likewise.
6697 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
6698
6699 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
6700 * data/yacc.c: Likewise.
6701
6702 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
6703 strings now.
6704 (muscle_init): Quote filename as a C string.
6705 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
6706 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
6707 * src/output.c (escaped_file_name_output): New function.
6708 (prepare_symbols): Quote tokens for M4.
6709 (prepare): Don't insert output_infix, output_prefix,
6710 output_parser_name, output_header_name; this is now down by scan-skel.
6711 Insert skeleton as a C string.
6712
6713 * src/output.c (user_actions_output, symbol_destructors_output,
6714 symbol_printers_output): Quote filenames for C and M4.
6715 * src/reader.c (prologue_augment, epilogue_set): Likewise.
6716
6717 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
6718 escapes other than \\ and \'; this simplifies the code.
6719 (<SC_STRING>): Likewise, for \\ and \".
6720 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
6721 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
6722 Use new escapes @{ and @} for [ and ].
6723
6724 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
6725 them with auto vars.
6726 Switch to new escape scheme, where @ is the escape character uniformly.
6727 Abort if a stray escape character is found. Avoid unbounded input
6728 buffer when parsing non-escaped text.
6729
6730 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
6731 __oline__, #output, $@, and @{ do not have unintended meanings.
6732
acea4f3b
PE
67332002-11-09 Paul Eggert <eggert@twinsun.com>
6734
6735 Fix the test failure due to GCC warnings described in
161a71f3 6736 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
6737 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
6738 evaluate to 0 if it's impossible for NINF to be in the respective
6739 table.
6740 (yygetLRActions, yyrecoverParseError): Use them.
6741
6742 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
6743 counted in the token inserted at end of file. Now takes
6744 location_t *, not location_t, so that the location can be
6745 adjusted. All uses changed.
6746
6747 * tests/regression.at (Invalid inputs): Adjust wording in
6748 diagnostic to match the new behavior.
6749
6750 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
6751 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
6752 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
6753 abort ();'. This reduces the runtime of the "Many lookaheads"
6754 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
6755 GCC 3.2.
6756
20ef1ad5
PE
67572002-11-07 Paul Eggert <eggert@twinsun.com>
6758
6759 * src/parse-gram.y (CHARACTER): Remove unused token.
6760 All uses removed.
6761
6762 * src/scan-gram.l: Remove stack option. We no longer use the
6763 stack, since the stack was never deeper than 1; instead, use the
6764 new auto var c_context to record the stacked value.
6765
6766 Remove nounput option. At an unexpected end of file, we now unput
6767 the minimal input necessary to end cleanly; this simplifies the
6768 code.
6769
6770 Avoid unbounded token sizes where this is easy.
6771
6772 (unexpected_end_of_file): New function.
6773 Use it to systematize the error message on unexpected EOF.
6774 (last-string): Now auto, not static.
6775 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
6776 (scanner_last_string_free): Remove; not used.
6777 (percent_percent_count): Move decl to just before use.
6778 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
6779 not the (never otherwised-used) CHARACTER.
6780
93724f13
AD
67812002-11-07 Akim Demaille <akim@epita.fr>
6782
6783 Let yyerror always receive the msg as last argument, so that
6784 yyerror can be variadic.
6785
6786 * data/yacc.c (b4_yyerror_args): New.
6787 Use it when calling yyerror.
6788 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
6789 Use it when calling yyerror.
6790 * doc/bison.texinfo (Error Reporting): Adjust.
6791 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
6792 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
6793
6e40b4eb
AD
67942002-11-06 Akim Demaille <akim@epita.fr>
6795
6796 #line should have quoted strings.
6797 Ideally, this should be done by m4_quotearg.
6798
6799 * src/scan-skel.l: Include quotearg.h.
6800 Quote __ofile__.
6801 * src/output.c (symbol_printers_output)
6802 (symbol_destructors_output): Quote the file name.
6803
2dfbfc12
AD
68042002-11-06 Akim Demaille <akim@epita.fr>
6805
6806 * tests/regression.at (Invalid inputs): Adjust to the recent
6807 messages.
6808
437c2d80
AD
68092002-11-06 Akim Demaille <akim@epita.fr>
6810
6811 Restore --no-lines.
6812 Reported by Jim Kent.
6813
6814 * data/c.m4 (b4_syncline): New.
6815 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
6816 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
6817 * src/output.c (user_actions_output): Likewise.
6818 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 6819 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 6820
900c5db5
AD
68212002-11-06 Akim Demaille <akim@epita.fr>
6822
6823 * src/main.c (main): Free `infile'.
6824 * src/scan-gram.l (handle_syncline): New.
6825 Recognize `#line'.
6826 * src/output.c (user_actions_output, symbol_destructors_output)
6827 (symbol_printers_output): Use the location's file name, not
6828 infile.
6829 * src/reader.c (prologue_augment, epilogue_set): Likewise.
6830
e183b123 68312002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 6832
e183b123 6833 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 6834 either has GLR conflict entries.
e183b123 6835
193eb6b7
PE
68362002-11-05 Paul Eggert <eggert@twinsun.com>
6837
e183b123
PE
6838 * src/scan-gram.l: Use more accurate diagnostics, e.g.
6839 "integer out of range" rather than "invalid value".
6840 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
6841 accordingly.
6842
193eb6b7
PE
6843 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
6844 Also, remove one static variable in the scanner.
6845
6846 * src/scan-gram.l (braces_level): Now auto, not static.
6847 Initialize to zero if the compiler is being picky.
6848 (INITIAL): Clear braces_level instead of incrementing it.
6849 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
6850 as POSIX 1003.1-2001 requires.
6851 * src/system.h (IF_LINT): New macro, taken from coreutils.
6852 * configure.ac: Define "lint" if --enable-gcc-warnings.
6853
29c01725
AD
68542002-11-05 Akim Demaille <akim@epita.fr>
6855
6856 * src/scan-gram.l: When it starts with `%', complain about the
6857 whole directive, not just that `invalid character: %'.
6858
8aeac3ca
AD
68592002-11-04 Akim Demaille <akim@epita.fr>
6860
6861 * Makefile.maint: Update from Autoconf.
6862 (update, cvs-update, po-update, do-po-update): New.
6863
793a58bb
AD
68642002-11-04 Akim Demaille <akim@epita.fr>
6865
6866 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
6867 and yyerror.
6868 Have yyerror `use' its arguments.
6869 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
6870 returns true when location & yacc & pure & parse-param.
6871 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
6872
c4d720cd
AD
68732002-11-04 Akim Demaille <akim@epita.fr>
6874
6875 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
6876 clashes.
6877 * src/scan-gram.l: Use [\'] instead of ['] to pacify
6878 font-lock-mode.
6879 Use complain_at.
6880 Use quote, not quote_n since LOCATION_PRINT no longer uses the
6881 slot 0.
6882
613a0dc5
PE
68832002-11-03 Paul Eggert <eggert@twinsun.com>
6884
6885 * src/reader.c (get_merge_function, grammar_current_rule_check):
6886 Use consistent diagnostics for reporting type name clashes.
6887 Quote the types with <>, for consistency with Yacc.
6888 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
6889
2a8d363a
AD
68902002-11-03 Akim Demaille <akim@epita.fr>
6891
6892 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
6893 New.
6894 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
6895 (b4_parse_param): Remove.
6896 Use b4_identification.
6897 Propagate b4_pure_args where needed to pass them to yyerror.
6898 * data/glr.m4 (b4_parse_param): Remove.
6899 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
6900 (b4_lpure_formals): New.
6901 Use b4_identification.
6902 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
6903 b4_user_formals and b4_user_args.
6904 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
6905 (yyreportAmbiguity): When using a pure parser, also need
6906 the location, and the parse-params.
6907 Adjust callers.
6908 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
6909 When using a pure parser, also need the parse-params.
6910 Adjust callers.
6911 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
6912 (%pure-parser + %parse-param) LALR and GLR parsers.
6913 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
6914 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
6915 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
6916 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
6917 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
6918 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
6919 * doc/bison.texinfo: Untabify the whole file.
6920 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
6921 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
6922 (Error Reporting): Adjust to these new directives.
6923 Document %error-verbose, deprecate YYERROR_VERBOSE.
6924
9e32add8
AD
69252002-11-03 Akim Demaille <akim@epita.fr>
6926
6927 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
6928 AT_CHECK_CALC_GLR invocations to use % directives, instead of
6929 command line options.
6930 * tests/cxx-type.at: Formatting changes.
6931
b02d90a5
PE
69322002-11-03 Paul Eggert <eggert@twinsun.com>
6933
6934 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
6935 to count columns correctly, and to check for invalid inputs.
9e32add8 6936
b02d90a5
PE
6937 Use mbsnwidth to count columns correctly. Account for tabs, too.
6938 Include mbswidth.h.
6939 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
6940 (extend_location): New function.
6941 (YY_LINES): Remove.
6942
6943 Handle CRLF in C code rather than in Lex code.
6944 (YY_INPUT): New macro.
6945 (no_cr_read): New function.
6946
6947 Scan UCNs, even though we don't fully handle them yet.
6948 (convert_ucn_to_byte): New function.
6949
6950 Handle backslash-newline correctly in C code.
6951 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
6952 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
6953 all uses changed.
6954 (tag, splice): New EREs. Do not allow NUL or newline in tags.
6955 Use {splice} wherever C allows backslash-newline.
6956 YY_STEP after space, newline, vertical-tab.
6957 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 6958
b02d90a5
PE
6959 (letter, id): Don't assume ASCII; e.g., spell out a-z.
6960
6961 ({int}, handle_action_dollar, handle_action_at): Check for integer
6962 overflow.
9e32add8 6963
b02d90a5
PE
6964 (YY_STEP): Omit trailing semicolon, so that it's more like C.
6965
6966 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
6967 as well as \000. Check for UCHAR_MAX, not 255.
6968 Allow \x with an arbitrary positive number of digits, as in C.
6969 Check for overflow here.
6970 Allow \? and UCNs, for compatibility with C.
6971
6972 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
6973 with quote slot used by complain_at.
6974
6975 * tests/input.at: Add tests for backslash-newline, m4 quotes
6976 in symbols, long literals, and funny escapes in strings.
6977
6978 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
6979 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
6980 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
6981 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
6982 * m4/mbswidth.m4: New file, from GNU coreutils.
6983
6984 * doc/bison.texinfo (Grammar Outline): Document // comments.
6985 (Symbols): Document that trigraphs have no special meaning in Bison,
6986 nor is backslash-newline allowed.
6987 (Actions): Document that trigraphs have no special meaning.
6988
6989 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
6990 no longer used.
6991
69922002-11-02 Paul Eggert <eggert@twinsun.com>
6993
6994 * src/reader.c: Don't include quote.h; not needed.
6995 (get_merge_function): Reword warning to be consistent with
6996 type clash diagnostic in grammar_current_rule_check.
6997
6998 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
6999 bug in trigraph handling.
7000
7001 * src/output.c (prepare_symbols): When printing token names,
7002 escape "[" as "@<:@" and likewise for "]".
7003
7004 * src/system.h (errno): Remove declaration, as we are now
7005 assuming C89 or better, and C89 guarantees errno.
7006
762b212b
PE
70072002-10-30 Paul Eggert <eggert@twinsun.com>
7008
7009 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
7010 Check for close failures.
7011 * src/files.h (xfclose): Return void, not int, since it always
7012 returned zero.
7013 * src/files.c (xfclose): Likewise. Report I/O error if ferror
7014 indicates one.
7015 * src/output.c (output_skeleton): Use xfclose rather than fclose
7016 and ferror. xfclose now checks ferror.
7017
7018 * data/glr.c (YYLEFTMOST_STATE): Remove.
7019 (yyreportTree): Use a stack-based leftmost state. This avoids
7020 our continuing battles with bogus warnings about initializers.
7021
56100c60
AD
70222002-10-30 Akim Demaille <akim@epita.fr>
7023
7024 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
7025 #if.
7026
51b4a04c
PH
70272002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7028
7029 * tests/glr-regr1.at: New test for reported regressions.
7030 * tests/testsuite.at: Add glr-regr1.at test.
7031 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 7032
bf1ebda2
PE
70332002-10-24 Paul Eggert <eggert@twinsun.com>
7034
5c16c6b1
PE
7035 Version 1.75a.
7036
bf1ebda2
PE
7037 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
7038 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
7039 we use malloc. Don't assume 'A' through 'Z' are contiguous.
7040 Don't assume strdup exists; POSIX says its an XSI extension.
7041 Check for buffer overflow on input.
7042
b526ee61
AD
70432002-10-24 Akim Demaille <akim@epita.fr>
7044
7045 * src/output.c (output_skeleton): Don't disable M4sugar comments
7046 too soon: it results in comments being expanded.
7047 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
7048 first output.
7049
f1886bb2
AD
70502002-10-24 Akim Demaille <akim@epita.fr>
7051
7052 * data/yacc.c (m4_int_type): New.
7053 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
7054 char' as only yacc.c wants K&R portability.
7055 * data/glr.c (yysigned_char): Remove.
7056 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
7057 Reported by Quoc Peyrot.
7058
c5576256
PE
70592002-10-23 Paul Eggert <eggert@twinsun.com>
7060
7061 * src/main.c (main): With --trace=time, report times even if a
7062 non-fatal error occurs. Formerly, the times were reported in some
7063 such cases but not in others.
7064 * src/reader.c (reader): Just return if a complaint has been issued,
7065 instead of exiting, so that 'main' can report times.
7066
27b0ffea
AD
70672002-10-22 Akim Demaille <akim@epita.fr>
7068
7069 * src/system.h: Include sys/types.
7070 Reported by Bert Deknuydt.
7071
223a7883
PE
70722002-10-23 Paul Eggert <eggert@twinsun.com>
7073
7074 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
7075 Suggested by Art Haas.
7076
70772002-10-22 Paul Eggert <eggert@twinsun.com>
7078
7079 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
7080 decl; not needed any more.
7081 * src/main.c (main): Use return to exit, undoing yesterday's change.
7082 The last OS that we could find where this wouldn't work is
7083 SunOS 3.5, and that's too old to worry about now.
7084
7085 * data/glr.c (struct yyltype): Define members even when not
7086 doing locations. This is more consistent with yacc.c, and it
7087 works around the following bug reports:
161a71f3
PE
7088 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
7089 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 7090
223a7883
PE
7091 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
7092 @acronym consistently. Standardize on "Yacc" instead of "YACC",
7093 "Algol" instead of "ALGOL". Give a bit more history about BNF.
7094
8b76775a
AD
70952002-10-22 Akim Demaille <akim@epita.fr>
7096
7097 * data/README: New.
7098
6db10d14
PE
70992002-10-21 Paul Eggert <eggert@twinsun.com>
7100
7101 Be consistent about 'bool'; the old code used an enum in one
7102 module and an int in another, and this violates the C standard.
7103 * m4/stdbool.m4: New file, from coreutils 4.5.3.
7104 * configure.ac (AC_HEADER_STDBOOL): Add.
7105 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
7106 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
7107 * src/symtab.c (hash_compare_symbol_t): Likewise.
7108 * src/system.h (bool, false, true): Use a definition consistent
7109 with ../lib/hash.c. All uses changed.
7110
7111 * src/complain.c (warning_issued): Renamed from warn_message_count,
7112 so that we needn't worry about integer overflow (!).
7113 Now of type bool. All uses changed.
7114 (complaint_issued): Renamed from complain_message_count; likewise.
7115
7116 * src/main.c (main): Use exit to exit with failure.
27b0ffea 7117
6db10d14
PE
7118 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
7119 rather than 1 and 0.
7120 * src/main.c (main): Likewise.
7121 * src/getargs.c (getargs): Likewise.
7122 * src/reader.c (reader): Likewise.
7123
7124 * src/getarg.c (getargs): Remove duplicate code for
7125 "Try `bison --help'".
7126
7127 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
7128 What was that "2" for?
7129
7130 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
7131 * src/getargs.c (usage): Likewise.
7132
7133 * src/getargs.c (getargs): When there are too few operands, report
7134 the last one. When there are too many, report the first extra
7135 one. This is how diffutils does it.
7136
92a060fd
PE
71372002-10-20 Paul Eggert <eggert@twinsun.com>
7138
7139 Remove K&R vestiges.
7140 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
7141 * src/complain.c (VA_START): Remove. Assume prototypes.
7142 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
7143 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
7144 fatal): Assume prototypes.
7145 * src/complain.h: Assume prototypes.
7146 * src/system.h (PARAMS): Remove.
7147 Include <limits.h> unconditionally, since it's guaranteeed even
7148 for a freestanding C89 compiler.
7149 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
7150 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 7151
e7cb57c0
AD
71522002-10-20 Akim Demaille <akim@epita.fr>
7153
7154 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
7155 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
7156 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
7157 (yyresolveStates, yyresolveAction, yyresolveStack)
7158 (yyprocessOneStack): Use them.
7159 (yy_reduce_print): New.
7160 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
7161
0245f82d
AD
71622002-10-20 Akim Demaille <akim@epita.fr>
7163
7164 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
7165 arguments and output `void'.
7166 (b4_c_function): Rename as...
7167 (b4_c_function_def): this.
7168 (b4_c_function_decl, b4_c_ansi_function_def)
7169 (b4_c_ansi_function_decl): New.
7170 Change the interpretation of the arguments: before `int, foo', now
7171 `int foo, foo'.
7172 * data/yacc.c (yyparse): Prototype and define thanks to these.
7173 Adjust b4_c_function_def uses.
7174 * data/glr.c (yyparse): Likewise, but ANSI only.
7175
39912f52
AD
71762002-10-20 Akim Demaille <akim@epita.fr>
7177
7178 * src/output.c (prepare): Move the definition of `tokens_number',
7179 `nterms_number', `undef_token_number', `user_token_number_max'
7180 to...
7181 (prepare_tokens): Here.
7182 (prepare_tokens): Rename as...
7183 (prepare_symbols): this.
7184 (prepare): Move the definition of `rules_number' to...
7185 (prepare_rules): here.
7186 (prepare): Move the definition of `last', `final_state_number',
7187 `states_number' to...
7188 (prepare_states): here.
7189 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
7190
20c1e2ad
AD
71912002-10-20 Akim Demaille <akim@epita.fr>
7192
7193 * src/tables.h, src/tables.c, src/output.c: Comment changes.
7194
21964f43
AD
71952002-10-20 Akim Demaille <akim@epita.fr>
7196
7197 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
7198 * data/c.m4: here.
7199
66d30cd4
AD
72002002-10-20 Akim Demaille <akim@epita.fr>
7201
7202 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
7203 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
7204 `pair'.
7205 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
7206 `name' to...
7207 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
7208 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
7209 These.
7210
95f2c9fe
PE
72112002-10-19 Paul Eggert <eggert@twinsun.com>
7212
7213 Do not create a temporary file, as that involves security and
7214 cleanup headaches. Instead, use a pair of pipes.
7215 Derived from a suggestion by Florian Krohm.
7216 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
7217 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
7218 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
7219 (BISON_PREREQ_SUBPIPE): Add.
7220 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
7221 Add subpipe.h, subpipe.c.
7222 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
7223 * po/POTFILES.in: Add lib/subpipe.c.
7224 * src/output.c: Include "subpipe.h".
7225 (m4_invoke): Remove decl.
7226 (scan_skel): New decl.
7227 (output_skeleton): Use pipe rather than temporary file for m4 input.
7228 Check that m4sugar.m4 is readable, to avoid deadlock.
7229 Check for pipe I/O error.
7230 * src/scan-skel.l (readpipe): Remove decl.
7231 (scan_skel): New function, to be used in place of m4_invoke.
7232 Read from stream rather than file.
66d30cd4 7233
95f2c9fe
PE
7234 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
7235 float, as this generates a warning on Solaris 8 + GCC 3.2 with
7236 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
7237 this generates a more-accurate value anyway.
7238
7239 * lib/timevar.c (timervar_accumulate): Rename locals to
7240 avoid confusion with similarly-named more-global.
7241 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
7242
7243 * src/output.c (prepare): Use xstrdup to convert char const *
7244 to char *, to avoid GCC warning.
7245
c19988b7
AD
72462002-10-19 Akim Demaille <akim@epita.fr>
7247
7248 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
7249 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
7250 Use them to have `calc.y' ready for %pure-parser.
7251 * data/yacc.c (YYLEX): Pass a yylex return type to
7252 b4_c_function_call.
7253
ae7453f2
AD
72542002-10-19 Akim Demaille <akim@epita.fr>
7255
7256 Prototype support of %lex-param and %parse-param.
7257
7258 * src/parse-gram.y: Add the definition of the %lex-param and
7259 %parse-param tokens, plus their rules.
7260 Drop the `_' version of %glr-parser.
7261 Add the "," token.
7262 * src/scan-gram.l (INITIAL): Scan them.
7263 * src/muscle_tab.c: Comment changes.
7264 (muscle_insert, muscle_find): Rename `pair' as `probe'.
7265 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
7266 (muscle_entry_s): The `value' member is no longer const.
7267 Adjust all dependencies.
7268 * src/muscle_tab.c (muscle_init): Adjust: use
7269 MUSCLE_INSERT_STRING.
7270 Initialize the obstack earlier.
7271 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
7272 (muscle_pair_list_grow): New.
7273 * data/c.m4 (b4_c_function_call, b4_c_args): New.
7274 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
7275 * tests/calc.at: Use %locations, not --locations.
7276 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
7277
0e575721
AD
72782002-10-19 Akim Demaille <akim@epita.fr>
7279
7280 * src/getargs.c (usage): Take status as argument and exit
7281 accordingly.
7282 Report the traditional `Try ... --help' message when status != 0.
7283 (usage, version): Don't take a FILE * as arg, it is pointless.
7284 (getargs): When there is an incorrect number of arguments, make it
7285 an error, and report it GNUlically thanks to `usage ()'.
7286
724ce7f5
PE
72872002-10-18 Paul Eggert <eggert@twinsun.com>
7288
3a781eb2
PE
7289 * data/glr.c (yyreportParseError): Don't assume that sprintf
7290 yields the length of the printed string, as this is not true
7291 on SunOS 4.1.4. Reported by Peter Klein.
7292
724ce7f5
PE
7293 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
7294 * tests/conflicts.at (%nonassoc and eof): Likewise.
7295 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
7296
473d0a75
AD
72972002-10-17 Akim Demaille <akim@epita.fr>
7298
7299 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
7300 * src/getargs.c (trace_types, trace_args): Adjust.
7301 * src/reader.c (grammar_current_rule_prec_set)
7302 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
7303 Standardize error messages.
7304 And s/@prec/%prec/!
7305 (reader): Use trace_flag to enable scanner/parser debugging,
7306 instead of an adhoc scheme.
7307 * src/scan-gram.l: Remove trailing debugging code.
7308
e76d2469
PE
73092002-10-16 Paul Eggert <eggert@twinsun.com>
7310
93e2236a
PE
7311 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
7312 MUSCLE_TAB_H.
7313
e76d2469
PE
7314 * NEWS: Officially drop support for building Bison with K&R C,
7315 since it didn't work anyway and it's not worth worrying about.
7316 * Makefile.maint (wget_files): Remove ansi2knr.c.
7317 (ansi2knr.c-url_prefix): Remove.
7318 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
7319 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
7320 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
7321
5bd1c419
PE
73222002-10-15 Paul Eggert <eggert@twinsun.com>
7323
7324 Stop using the "enum_" trick for K&R-style function definitions;
7325 it confused me, and I was the author! Instead, assume that people
7326 who want to use K&R C compilers (when using these modules in GCC,
7327 perhaps?) will run ansi2knr.
7328
7329 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
7330 All uses of "enum_" changed to "enum ".
7331 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
7332 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 7333
5bd1c419
PE
7334 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
7335 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
7336 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
7337 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
7338 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
7339 abitset_not, abitset_ones, abitset_or, abitset_or_and,
7340 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
7341 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
7342 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
7343 Use function prototypes; this removes the need for declaring
7344 static functions simply to provide their prototypes.
7345 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
7346 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
7347 bitset_count_, bitset_create, bitset_dump, bitset_first,
7348 bitset_free, bitset_init, bitset_last, bitset_next,
7349 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
7350 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
7351 bitset_print, bitset_release_memory, bitset_toggle_,
7352 bitset_type_choose, bitset_type_get, bitset_type_name_get,
7353 debug_bitset): Likewise.
7354 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
7355 * lib/bitset_stats.c (bitset_log_histogram_print,
7356 bitset_percent_histogram_print, bitset_stats_and,
7357 bitset_stats_and_cmp, bitset_stats_and_or,
7358 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
7359 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
7360 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
7361 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
7362 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
7363 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
7364 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
7365 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
7366 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
7367 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
7368 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
7369 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
7370 bitset_stats_zero): Likewise.
7371 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
7372 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
7373 bitsetv_dump, debug_bitsetv): Likewise.
7374 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
7375 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
7376 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
7377 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
7378 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
7379 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
7380 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
7381 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
7382 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
7383 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
7384 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
7385 Likewise.
7386 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
7387 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
7388 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
7389 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
7390 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
7391 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
7392 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
7393 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
7394 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
7395 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
7396 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 7397
ae26e1f0
AD
73982002-10-14 Akim Demaille <akim@epita.fr>
7399
7400 Version 1.75.
7401
d43baf71
AD
74022002-10-14 Akim Demaille <akim@epita.fr>
7403
7404 * tests/Makefile.am (maintainer-check-posix): New.
7405
7ebc83e3
AD
74062002-10-14 Akim Demaille <akim@epita.fr>
7407
7408 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
7409 member.
7410
05846dae
AD
74112002-10-14 Akim Demaille <akim@epita.fr>
7412
7413 * src/tables.c (table_ninf_remap): base -> tab.
7414 Reported by Matt Rosing.
7415
1318e37d
PE
74162002-10-14 Paul Eggert <eggert@twinsun.com>
7417
447fbb17
PE
7418 * tests/action.at, tests/calc.at, tests/conflicts.at,
7419 tests/cxx-type.at, tests/headers.at, tests/input.at,
7420 tests/regression.at, tests/synclines.at, tests/torture.at:
7421 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
7422 so that the tests still work even if POSIXLY_CORRECT is set.
7423 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 7424
1318e37d
PE
7425 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
7426 for portability to K&R hosts. Fix typo: signed char is guaranteed
7427 only to 127, not to 128.
7428 * data/glr.c (yysigned_char): New type.
7429 * data/yacc.c (yysigned_char): Likewise.
7430 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
7431
cc0f0794
PE
74322002-10-13 Paul Eggert <eggert@twinsun.com>
7433
5038f418
PE
7434 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
7435 true due to limited range of data type" warning from GCC.
7436
cc0f0794
PE
7437 * data/c.m4 (b4_token_defines): Protect against double-inclusion
7438 by wrapping enum yytokentype's definition inside #ifndef
7439 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
7440
6fed0802
AD
74412002-10-13 Akim Demaille <akim@epita.fr>
7442
7443 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
7444 Un yy- yyrhs to avoid the name clash with the global YYRHS.
7445
32f0598d
AD
74462002-10-13 Akim Demaille <akim@epita.fr>
7447
7448 * Makefile.maint: Update from Autoconf 2.54.
7449 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
7450
7ea9a33f
AD
74512002-10-13 Akim Demaille <akim@epita.fr>
7452
7453 * src/print.c (print_state): Separate the list of solved conflicts
7454 from the other items.
7455 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
7456
ea99527d
AD
74572002-10-13 Akim Demaille <akim@epita.fr>
7458
7459 Let nondeterministic skeletons be usable with deterministic
7460 tables.
7461
7462 With the patch, GAWK compiled by GCC without -O2 passes its test
7463 suite using a GLR parser driven by LALR tables. It fails with -O2
7464 because `struct stat' gives two different answers on my machine:
7465 88 (definition of an auto var) and later 96 (memset on this var).
7466 Hence the stack is badly corrumpted. The headers inclusion is to
7467 blame: if I move the awk.h inclusion before GLR's system header
7468 inclusion, the two struct stat have the same size.
7469
7470 * src/tables.c (pack_table): Always create conflict_table.
7471 (token_actions): Always create conflict_list.
7472 * data/glr.c (YYFLAG): Remove, unused.
7473
f377f69f
AD
74742002-10-13 Akim Demaille <akim@epita.fr>
7475
7476 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
7477 (O0FLAGS): New.
7478 (VALGRIND, GXX): New.
7479 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
7480 * tests/bison.in: Run $PREBISON a pre-command.
7481 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
7482 (maintainer-check-g++): New.
7483 * Makefile.am (maintainer-check): New.
7484
2a1fe6ed
AD
74852002-10-13 Akim Demaille <akim@epita.fr>
7486
7487 * data/glr.c: Formatting changes.
7488 Tweak some trace messages to match yacc.c's.
7489
f50adbbd
AD
74902002-10-13 Akim Demaille <akim@epita.fr>
7491
7492 GLR parsers sometimes raise parse errors instead of performing the
7493 default reduction.
7494 Reported by Charles-Henry de Boysson.
7495
7496 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 7497 check the length of the traces when %glr.
f50adbbd
AD
7498 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
7499 GLR's traces.
7500 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
7501 Test GLR parsers.
7502 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
7503 (yyltype): Remove the yy prefix from the member names.
7504 (yytable): Complete its comment.
7505 (yygetLRActions): Map error action number from YYTABLE from
7506 YYTABLE_NINF to 0.
7507 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
7508 (which was a bug: it should have been YYTABEL_NINF, and yet it was
7509 not satisfying as we could compare an YYACTION computed from
7510 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
7511 only value for error actions.
7512 (yyreportParseError): In verbose parse error messages, don't issue
7513 `error' in the list of expected tokens.
7514 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
7515 next action to perform to match glr.c's decoding.
7516 (yytable): Complete its comment.
7517
bcbad5b9
PE
75182002-10-13 Paul Eggert <eggert@twinsun.com>
7519
7520 Fix problem reported by Henrik Grubbstroem in
161a71f3 7521 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
7522 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
7523 because the Bison parser reads the second action before reducing
7524 the first one.
7525 * src/scan-gram.l (rule_length): New static var.
7526 Use it to keep track of the rule length in the scanner, since
7527 we can't expect the parser to be in lock-step sync with the scanner.
7528 (handle_action_dollar, handle_action_at): Use this var.
7529 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 7530
14904b89
PE
75312002-10-12 Paul Eggert <eggert@twinsun.com>
7532
1fe611e5
PE
7533 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
7534 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
7535 Include <sys/time.h> when checking for clock_t and struct tms.
7536 Use same include order as source.
7537 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 7538 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 7539
1fe611e5
PE
7540 * lib/timevar.c: Update copyright date and clarify comments.
7541 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 7542
1fe611e5
PE
7543 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
7544 GCC version as of today, then merge Bison's changes.
7545 Change "GCC" to "Bison" in copyright notice. timevar.def's
7546 author is Akim, so change that too.
7547
98194095
PE
7548 * src/reader.c (grammar_current_rule_check):
7549 Don't worry about the default action if $$ is untyped.
7550 Prevents bogus warnings reported by Jim Gifford in
161a71f3 7551 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 7552
14904b89
PE
7553 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
7554 * data/glr.c, data/lalr1.cc, data/yacc.c:
7555 Output token definitions before the first part of user declarations.
7556 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 7557 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 7558
ff6dca18
PE
75592002-10-11 Paul Eggert <eggert@twinsun.com>
7560
7561 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
7562 (yyparse): here. This undoes some of the 2002-07-25 change.
7563 Compatibility problem reported by Ralf S. Engelschall with
7564 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
7565
eb714592
AD
75662002-10-11 Akim Demaille <akim@epita.fr>
7567
7568 * tests/regression.at Characters Escapes): New.
7569 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
7570 characters.
7571 Reported by Jan Nieuwenhuizen.
7572
b7195100
AD
75732002-10-11 Akim Demaille <akim@epita.fr>
7574
7575 * po/id.po: New.
7576
f28a0f2d
PE
75772002-10-10 Paul Eggert <eggert@twinsun.com>
7578
7579 Portability fixes for bitsets; this also avoids several GCC
7580 warnings.
7581
7582 * lib/abitset.c: Include <stddef.h>, for offsetof.
7583 * lib/lbitset.c: Likewise.
7584
7585 * lib/abitset.c (abitset_bytes): Return a size that is aligned
7586 properly for vectors of objects. Do not assume that adding a
7587 header size to a multiple of a word size yields a value that is
7588 properly aligned for the whole union.
7589 * lib/bitsetv.c (bitsetv_alloc): Likewise.
7590
7591 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
7592 unique names for structures.
7593 * lib/ebitset.c (ebitset_bytes): Likewise.
7594 * lib/lbitset.c (lbitset_bytes): Likewise.
7595
7596 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
7597 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
7598 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
7599 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
7600 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
7601 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
7602 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
7603 to improve the type-checking that GCC can do.
7604 * lib/bitset.c (bitset_op4_cmp): Likewise.
7605 * lib/bitset_stats.c (bitset_stats_count,
7606 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
7607 bitset_stats_copy, bitset_stats_disjoint_p,
7608 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
7609 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
7610 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
7611 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
7612 bitset_stats_and_or_cmp, bitset_stats_andn_or,
7613 bitset_stats_andn_or_cmp, bitset_stats_or_and,
7614 bitset_stats_or_and_cmp): Likewise.
7615 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
7616 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
7617 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
7618 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
7619
7620 * lib/abitset.h: Include bitset.h, not bbitset.h.
7621 * lib/ebitset.h: Likewise.
7622 * lib/lbitset.h: Likewise.
7623
7624 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
7625 All instances of parameters of type enum bitset_opts are now of
7626 type enum_bitset_opts, to conform to the C Standard, and similarly
7627 for enum_bitset_type.
7628 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
7629 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
7630
7631 Do not use "struct bitset_struct" to mean different things in
7632 different modules. Not only is this confusing, it violates
7633 the C Standard, which requires that structure types in different
7634 modules must be compatible if one is to be passed to the other.
7635 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
7636 All instances of "struct bitset_struct *" replaced with "bitset".
7637 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
7638 (union bitset_union, struct abitset_struct, struct ebitset_struct,
7639 struct lbitset_struct, struct bitset_stats_struct): New types.
7640 All uses of struct bitset_struct changed to union bitset_union,
7641 etc.
ba0fe3c7 7642 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
7643 struct bitset_struct): Remove.
7644 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
7645 struct bitset_struct): Remove.
7646 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
7647 bitset_struct): Remove.
7648 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
7649 Likewise.
7650
7651 Do not call a function of type T using a call that assumes the
7652 function is of a different type U. Standard C requires that a
7653 function must be called with a type that is compatible with its
7654 definition.
7655 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
7656 New decls.
7657 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
7658 New functions.
7659 * lib/ebitset.c (PFV): Remove.
7660 * lib/lbitset.c (PFV): Likewise.
7661 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
7662 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
7663 decls.
7664 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
7665 (ebitset_vtable): Use them.
7666 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
7667 lbitset_xor): New functions.
7668 (lbitset_vtable): Use them.
7669
7670 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
7671 Declare.
7672
7673 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
7674 GCC warning.
7675 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
7676 Use offsetof, for simplicity.
7677
6fbe4984
PE
76782002-10-06 Paul Eggert <eggert@twinsun.com>
7679
7680 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
7681 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 7682 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
7683 which was inadvertently undone by the 2002-09-30 patch.
7684 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
7685 the same width as int.
7686
420f93c8
PE
76872002-10-04 Paul Eggert <eggert@twinsun.com>
7688
7689 Version 1.50.
7690
7691 * configure.ac (AC_INIT), NEWS: Increment version number.
7692
7693 * doc/bison.texinfo: Minor spelling, grammar, and white space
7694 fixes.
7695 (Symbols): Mention that any negative value returned from yylex
7696 signifies end-of-input. Warn about negative chars. Mention
7697 the portable Standard C character set.
7698
7699 The GNU coding standard says CFLAGS and YFLAGS are reserved
7700 for the installer to set.
7701 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
7702 * src/Makefile.am (AM_CFLAGS): Likewise.
7703 (AM_YFLAGS): Renamed from YFLAGS.
7704
7705 Fix some MAX and MIN problems.
7706 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
7707 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
7708 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
7709 * src/reader.c (reader): Use it.
7710
7711 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
7712 POSIX 1003.1-2001 has removed fgrep.
7713
77142002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
7715
7716 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
7717 interpreted as signed.
7718 * lib/ebitset.c (ebitset_list): Fix bug.
7719
ff68026d
PE
77202002-10-01 Paul Eggert <eggert@twinsun.com>
7721
7722 More fixes for 64-bit hosts and large bitsets.
7723
7724 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
7725 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
7726 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
7727 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
7728 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
7729 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
7730 bitset_count_): Likewise.
7731 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
7732 bitset_first, bitset_last): Likewise.
7733 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
7734 bitset_stats_list_reverse, bitset_stats_size,
7735 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
7736 Likewise.
7737 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
7738 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
7739 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
7740 bitsetv_reflexive_transitive_closure): Likewise.
7741 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
7742 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
7743 Likewise.
7744 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
7745 Likewise.
420f93c8 7746
ff68026d
PE
7747 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
7748 Use size_t, not unsigned int, to count bytes.
7749 * lib/abitset.h (abitset_bytes): Likewise.
7750 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
7751 Likewise.
7752 * lib/bitset.h (bitset_bytes): Likewise.
7753 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
7754 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
7755 * lib/bitsetv.c (bitsetv_alloc): Likewise.
7756 * lib/ebitset.c (ebitset_bytes): Likewise.
7757 * lib/ebitset.h (ebitset_bytes): Likewise.
7758 * lib/lbitset.c (lbitset_bytes): Likewise.
7759 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 7760
ff68026d
PE
7761 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
7762 abitset_subset_p, abitset_disjoint_p, abitset_and,
7763 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
7764 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
7765 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
7766 abitset_or_and, abitset_or_and_cmp):
7767 Use bitset_windex instead of unsigned int.
7768 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
7769 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
7770 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
7771 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
7772 Likewise.
7773 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 7774
ff68026d
PE
7775 * lib/bitset.c (bitset_print):
7776 Use proper printf formats for widths of integer types.
7777 * lib/bitset_stats.c (bitset_percent_histogram_print,
7778 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
7779 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
7780 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
7781 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 7782
ff68026d
PE
7783 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
7784 BITSET_SIZE_MAX): New macros.
7785 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
7786 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
7787 to BITSET_WINDEX_MAX.
7788
7789 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
7790 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
7791 since we now return the bitset_bindex type (not int).
7792
7793 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
7794 when computing sizes.
7795 * lib/ebitset.c (ebitset_elts_grow): Likewise.
7796
7797 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
7798 and avoid cast to unsigned.
7799
6aa452a6
AD
78002002-09-30 Akim Demaille <akim@epita.fr>
7801
7802 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
7803 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
7804 Updates from Michael Hayes.
7805
927f7817
AD
78062002-09-30 Art Haas <ahaas@neosoft.com>
7807
7808 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
7809 invocations.
7810 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
7811 defined.
7812
9738f41e
AD
78132002-09-27 Akim Demaille <akim@epita.fr>
7814
7815 Version 1.49c.
7816
a5c75d7f
AD
78172002-09-27 Akim Demaille <akim@epita.fr>
7818
7819 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
7820 (Because of AC_LIBSOURCE).
7821
8280e179
AD
78222002-09-27 Akim Demaille <akim@epita.fr>
7823
7824 Playing with Autoscan.
7825
7826 * configure.ac: Remove the old LIBOBJ tweaks.
7827 (AC_REPLACE_FUNCS): Add strrchr and strtol.
7828 * lib/strrchr.c: New.
7829 * lib/strtol.c: New, from the Coreutils 4.5.1.
7830
ae64af35
AD
78312002-09-27 Akim Demaille <akim@epita.fr>
7832
7833 Playing with Autoscan.
7834
7835 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
7836 * lib/Makefile.am (libbison_a_SOURCES): No longer include
7837 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
7838 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
7839 Coreutils 4.5.1.
7840
d1a1114f
AD
78412002-09-24 Akim Demaille <akim@epita.fr>
7842
7843 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
7844 (Frequently Asked Questions, Parser Stack Overflow): New.
7845
b906441c
AD
78462002-09-13 Akim Demaille <akim@epita.fr>
7847
7848 Playing with autoscan.
7849
7850 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
7851 * src/files.c (skeleton_find): Remove, unused.
7852 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
7853 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
7854
bd701811
AD
78552002-09-13 Akim Demaille <akim@epita.fr>
7856
7857 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
7858 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
7859
e0a13e7b
AD
78602002-09-13 Akim Demaille <akim@epita.fr>
7861
7862 * configure.ac: Require 2.54.
7863 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
7864 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
7865 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
7866 Remove, provided by Autoconf macros.
7867
c97011bf
AD
78682002-09-12 Akim Demaille <akim@epita.fr>
7869
7870 * m4/prereq.m4: Update, from Coreutils 4.5.1.
7871
d862b1be
AD
78722002-09-12 Akim Demaille <akim@epita.fr>
7873
7874 * m4/prereq.m4: Update, from Fileutils 4.1.5.
7875 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
7876 Reported by Martin Mokrejs.
7877
3d38c03a
AD
78782002-09-10 Akim Demaille <akim@epita.fr>
7879
7880 * src/parse-gram.y: Associate a human readable string to each
7881 token type.
7882 * tests/regression.at (Invalid inputs): Adjust.
7883
b6347355
AD
78842002-09-10 Gary V. Vaughan <gary@gnu.org>
7885
7886 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
7887 with an Autoconf-2.5x style configure.ac.
7888
09ba4ab2
PE
78892002-09-06 Paul Eggert <eggert@twinsun.com>
7890
7891 * doc/bison.texinfo (Conditions): Make explicit that the GPL
7892 exception applies only to yacc.c. This is a modification of a
7893 patch originally suggested by Akim Demaille.
7894
21846f69
AD
78952002-09-06 Akim Demaille <akim@epita.fr>
7896
09ba4ab2
PE
7897 * data/c.m4 (b4_copyright): Move the GPL exception comment from
7898 here to...
7899 * data/yacc.c: here.
7900
21846f69
AD
7901 * data/lalr1.cc (struct yyltype): Don't define it, since we use
7902 LocationType.
7903 (b4_ltype): Default to yy::Location from location.hh.
7904
c0ad8bf3
AD
79052002-09-04 Jim Meyering <jim@meyering.net>
7906
7907 * data/yacc.c: Guard the declaration of yytoknum also with
7908 `#ifdef YYPRINT', so it is declared only when used.
7909
3a93251e
AD
79102002-09-04 Akim Demaille <akim@epita.fr>
7911
7912 * configure.in: Rename as...
7913 * configure.ac: this.
7914 Bump to 1.49c.
7915
427c0dda
AD
79162002-09-04 Akim Demaille <akim@epita.fr>
7917
7918 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
7919 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
7920 translate maintainer only messages.
7921
6a254321
PE
79222002-08-12 Paul Eggert <eggert@twinsun.com>
7923
645e30d1
PE
7924 Version 1.49b.
7925
6a254321
PE
7926 * Makefile.am (SUBDIRS): Remove intl.
7927 (DISTCLEANFILES): Remove.
7928 * NEWS: Mention that GNU M4 is now required. Clarify what is
7929 meant by "larger grammars". Mention the pt_BR translation.
7930 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
7931 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
7932 Bump version from 0.11.2 to 0.11.5.
7933 (BISON_PREREQ_STAGE): Remove.
7934 (AM_GNU_GETTEXT): Use external gettext.
7935 (AC_OUTPUT): Remove intl/Makefile.
7936
7937 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
7938
7939 * data/glr.c: Include string.h, for strlen.
7940 (yyreportParseError): Use size_t for yysize.
7941 (yy_yypstack): No longer nested inside yypstates, as nested
7942 functions are not portable. Do not assume size_t is the
7943 same width as int.
7944 (yypstates): Do not assume that ptrdiff_t is the same width
7945 as int, and similarly for yyposn and YYINDEX.
7946
7947 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
7948
7949 * lib/Makefile.am (INCLUDES): Do not include from the intl
7950 directory, which has been removed.
7951 * src/Makefile.am (INCLUDES): Likewise.
7952
7953 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
7954 (bitsets_sources, additional_bitsets_sources, timevars_sources):
7955 New vars.
7956
7957 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
7958 * tests/Makefile.am (EXTRA_DIST): Likewise.
7959
7960 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
7961 Do not assume that bitset_windex is the same width as unsigned.
7962
7963 * lib/abitset.c (abitset_unused_clear): Do not assume that
7964 bitset_word is the same width as int.
7965 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
7966 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
7967 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
7968 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
7969 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
7970
7971 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
7972 portability to one's complement hosts!).
7973 * lib/ebitset.c (ebitset_op1): Likewise.
7974 * lib/lbitset.c (lbitset_op1): Likewise.
7975
7976 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
7977 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
7978 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
7979 Sync with fileutils.
7980 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
7981 lib/gettext.h: Sync with diffutils.
7982
7983 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
7984 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
7985
7986 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
7987 PROTOTYPES to check for prototypes, and "defined __STDC__" to
7988 check for void *.
7989
7990 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
7991 size_t; the old version tried to do this but casted improperly.
7992 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
7993 (bitset_test): Now returns int, not unsigned long.
7994
7995 * lib/bitset_stats.c: Include "gettext.h".
7996 (_): New macro.
7997 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
7998 name locals "index", as it generates unnecessary warnings on some
7999 hosts that have an "index" function.
8000
8001 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
8002 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
8003 they need translation.
8004 * src/LR0.c (state_list_append, new_itemsets, get_state,
8005 append_states, generate_states): Likewise.
8006 * src/assoc.c (assoc_to_string): Likewise.
8007 * src/closure.c (print_closure, set_firsts, closure): Likewise.
8008 * src/gram.c (grammar_dump): Likewise.
8009 * src/injections.c (injections_compute): Likewise.
8010 * src/lalr.c (lookaheads_print): Likewise.
8011 * src/relation.c (relation_transpose): Likewise.
8012 * src/scan-gram.l: Likewise.
8013 * src/tables.c (table_grow, pack_vector): Likewise.
8014
8015 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
8016 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
8017 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
8018 * m4/mbstate_t.m4: Sync with fileutils.
8019 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
8020
8021 * po/LINGUAS: Add pt_BR.
8022 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
8023 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
8024 lib/timevar.c.
8025 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
8026 manual recommends.
8027 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
8028
8029 * src/complain.c (strerror_r): Remove decl; not needed.
8030 (strerror): Use same pattern as ../lib/error.c.
8031
8032 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
8033
8034 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
8035
8036 * src/main.c (main): Cast result of bindtextdomain and textdomain
8037 to void, to avoid a GCC warning when --disable-nls is in effect.
8038
8039 * src/scan-gram.l: Use strings rather than escapes when possible,
8040 to minimize the number of warnings from xgettext.
8041 (handle_action_dollar, handle_action_at): Don't use isdigit,
8042 as it mishandles negative chars and it may not work as expected
8043 outside the C locale.
8044
8045 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
8046 this is a GCC extension and is not portable to other compilers.
8047
8048 * src/system.h (alloca): Use same pattern as ../lib/error.c.
8049 Do not include <ctype.h>; no longer needed.
8050 Do not include <malloc.h>; no longer needed (and generates
8051 warnings on OpenBSD 3.0).
8052
8053 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
8054 it's not portable.
8055
8056 * tests/regression.at: Do not use 'cc -c input.c -o input';
8057 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
8058
8059 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
8060 exit status as failure, not just exit status 1. Sun C exits
8061 with status 2 sometimes.
8062
8063 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
8064 Use it for the two large tests.
8065
c8f002c7
AD
80662002-08-02 Akim Demaille <akim@epita.fr>
8067
8068 * src/conflicts.c (conflicts_output): Don't output rules never
8069 reduced here, since anyway that computation doesn't work.
8070 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
8071 (rule_useless_p, rule_never_reduced_p): New.
8072 (grammar_rules_partial_print): Use a filter instead of a range.
8073 Display the title only if needed.
8074 (grammar_rules_print): Adjust.
8075 (grammar_rules_never_reduced_report): New.
8076 * src/tables.c (action_row): Move the computation of rules never
8077 reduced to...
8078 (token_actions): here.
8079 * src/main.c (main): Make the parser before making the report, so
8080 that rules never reduced are computed.
8081 Call grammar_rules_never_reduced_report.
8082 * src/print.c (print_results): Report rules never reduced.
8083 * tests/conflicts.at, tests/reduce.at: Adjust.
8084
cd08e51e
AD
80852002-08-01 Akim Demaille <akim@epita.fr>
8086
8087 Instead of attaching lookaheads and duplicating the rules being
8088 reduced by a state, attach the lookaheads to the reductions.
8089
8090 * src/state.h (state_t): Remove the `lookaheads',
8091 `lookaheads_rule' member.
8092 (reductions_t): Add a `lookaheads' member.
8093 Use a regular array for the `rules'.
8094 * src/state.c (reductions_new): Initialize the lookaheads member
8095 to 0.
8096 (state_rule_lookaheads_print): Adjust.
8097 * src/state.h, src/state.c (state_reductions_find): New.
8098 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
8099 (count_rr_conflicts): Adjust.
8100 * src/lalr.c (LArule): Remove.
8101 (add_lookback_edge): Adjust.
8102 (state_lookaheads_count): New.
8103 (states_lookaheads_initialize): Merge into...
8104 (initialize_LA): this.
8105 (lalr_free): Adjust.
8106 * src/main.c (main): Don't free nullable and derives too early: it
8107 is used by --verbose.
8108 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
8109
bb0027a9
AD
81102002-08-01 Akim Demaille <akim@epita.fr>
8111
8112 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
8113 `rule_number_t**'.
8114 (set_derives, free_derives): Rename as...
8115 (derives_compute, derives_free): this.
8116 Adjust all dependencies.
8117 * src/nullable.c (set_nullable, free_nullable): Rename as...
8118 (nullable_compute, nullable_free): these.
8119 (rule_list_t): Store rule_t *, not rule_number_t.
8120 * src/state.c (state_rule_lookaheads_print): Directly compare rule
8121 pointers, instead of their numbers.
8122 * src/main.c (main): Call nullable_free, and derives_free earlier,
8123 as they were lo longer used.
8124
3325ddc4
AD
81252002-08-01 Akim Demaille <akim@epita.fr>
8126
8127 * lib/timevar.c (get_time): Include children time.
8128 * src/lalr.h (LA, LArule): Don't export them: used with the
8129 state_t.
8130 * src/lalr.c (LA, LArule): Static.
8131 * src/lalr.h, src/lalr.c (lalr_free): New.
8132 * src/main.c (main): Call it.
8133 * src/tables.c (pack_vector): Check whether loc is >= to the
8134 table_size, not >.
8135 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
8136 (tables_generate): do it, since that's also it which allocates
8137 them.
8138 Don't free LA and LArule, main does.
8139
c6f1a33c
AD
81402002-07-31 Akim Demaille <akim@epita.fr>
8141
8142 Separate parser tables computation and output.
8143
8144 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
8145 (conflict_list, conflict_list_cnt, table, check, table_ninf)
8146 (yydefgoto, yydefact, high): Move to...
8147 * src/tables.h, src/tables.c: here.
8148 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
8149 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
8150 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
8151 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
8152 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
8153 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
8154 (action_row, save_row, token_actions, save_column, default_goto)
8155 (goto_actions, sort_actions, matching_state, pack_vector)
8156 (table_ninf_remap, pack_table, prepare_actions): Move to...
8157 * src/tables.c: here.
8158 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
8159 * src/output.c (token_actions, output_base, output_conflicts)
8160 (output_check): Merge into...
8161 (prepare_actions): this.
8162 (actions_output): Rename as...
8163 (user_actions_output): this.
8164 * src/main.c (main): Call tables_generate and tables_free.
8165
1509d42f
AD
81662002-07-31 Akim Demaille <akim@epita.fr>
8167
8168 Steal GCC's --time-report support.
8169
8170 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
8171 stolen/adjusted from GCC.
8172 * m4/stage.m4: Remove time related checks.
8173 * m4/timevar.m4: New.
8174 * configure.in: Adjust.
8175 * src/system.h: Adjust to using timevar.h.
8176 * src/getargs.h, src/getargs.c: Support trace_time for
8177 --trace=time.
8178 * src/main.c (stage): Remove.
8179 (main): Replace `stage' invocations with timevar calls.
8180 * src/output.c: Insert pertinent timevar calls.
8181
273a74fa
AD
81822002-07-31 Akim Demaille <akim@epita.fr>
8183
8184 Let --trace have arguments.
8185
8186 * src/getargs.h (enum trace_e): New.
8187 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
8188 (long_options, short_options): --trace/-T takes an optional
8189 argument.
8190 Change all the uses of trace_flag to reflect the new flags.
8191 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
8192
8193 Strengthen `stage' portability.
8194
8195 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
8196 * configure.in: Use it.
8197 Don't check for malloc.h and sys/times.h.
8198 * src/system.h: Include them when appropriate.
8199 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
8200 times and struct tms are available.
8201
217598da
AD
82022002-07-30 Akim Demaille <akim@epita.fr>
8203
8204 In verbose parse error message, don't report `error' as an
8205 expected token.
8206 * tests/actions.at (Printers and Destructors): Adjust.
8207 * tests/calc.at (Calculator $1): Adjust.
8208 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
8209 error message, do not report the parser accepts the error token in
8210 that state.
8211
52489d44
AD
82122002-07-30 Akim Demaille <akim@epita.fr>
8213
8214 Normalize conflict related messages.
8215
8216 * src/complain.h, src/complain.c (warn, complain): New.
8217 * src/conflicts.c (conflicts_print): Use them.
8218 (conflict_report_yacc): New, extracted from...
8219 (conflicts_print): here.
8220 * tests/conflicts.at, tests/existing.at: Adjust.
8221
e8832397
AD
82222002-07-30 Akim Demaille <akim@epita.fr>
8223
8224 Report rules which are never reduced by the parser: those hidden
8225 by conflicts.
8226
8227 * src/LR0.c (save_reductions): Don't make the final state too
8228 different: save its reduction (accept) instead of having a state
8229 without any action (no shift or goto, no reduce).
8230 Note: the final state is now a ``regular'' state, i.e., the
8231 parsers now contain `reduce 0' as default reduction.
8232 Nevertheless, since they decide to `accept' when yystate =
8233 final_state, they still will not reduce rule 0.
8234 * src/print.c (print_actions, print_reduction): Adjust.
8235 * src/output.c (action_row): Track reduced rules.
8236 (token_actions): Report rules never reduced.
8237 * tests/conflicts.at, tests/regression.at: Adjust.
8238
caf23d24
AD
82392002-07-30 Akim Demaille <akim@epita.fr>
8240
8241 `stage' was accidently included in a previous patch.
8242 Initiate its autoconfiscation.
8243
8244 * configure.in: Look for malloc.h and sys/times.h.
8245 * src/main.c (stage): Adjust.
8246 Report only when trace_flag.
8247
640748ee
AD
82482002-07-29 Akim Demaille <akim@epita.fr>
8249
8250 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
8251 state_number_t.
8252 (errs_t): symbol_t*, not symbol_number_t.
8253 (reductions_t): rule_t*, not rule_number_t.
8254 (FOR_EACH_SHIFT): New.
8255 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
8256 * src/print.c, src/print_graph.c: Adjust.
8257
88bce5a2
AD
82582002-07-29 Akim Demaille <akim@epita.fr>
8259
8260 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
8261
8262 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
8263 (endtoken, accept): these.
8264 * src/reader.c (reader): Set endtoken's default tag to "$end".
8265 Set undeftoken's tag to "$undefined" instead of "$undefined.".
8266 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
8267 Adjust.
8268
1bfb97db
AD
82692002-07-29 Akim Demaille <akim@epita.fr>
8270
8271 * src/reduce.c (reduce_grammar): When the language is empty,
8272 complain about the start symbol, not the axiom.
8273 Use its location.
8274 * tests/reduce.at (Empty Language): New.
8275
fc5734fe
AD
82762002-07-26 Akim Demaille <akim@epita.fr>
8277
8278 * src/reader.h, src/reader.c (gram_error): ... can't get
8279 yycontrol without making too strong assumptions on the parser
8280 itself.
8281 * src/output.c (prepare_tokens): Use the real 0th value of
8282 token_translations instead of `0'.
8283 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
8284 visible here.
8285 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
8286 for the time being: %locations ought to provide it to yyerror.
8287
3650b4b8
AD
82882002-07-25 Akim Demaille <akim@epita.fr>
8289
8290 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
8291 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
8292 * tests/regression.at (Web2c Actions): Adjust.
8293
4b3d3a8e
AD
82942002-07-25 Akim Demaille <akim@epita.fr>
8295
8296 Stop storing rules from 1 to nrules + 1.
8297
8298 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
8299 * src/nullable.c, src/output.c, src/print.c, src/reader.c
8300 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
8301 Iterate from 0 to nrules.
8302 Use rule_number_as_item_number and item_number_as_rule_number.
8303 Adjust to `derive' now containing possibly 0.
8304 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
8305 Handle the `- 1' part in rule numbers from/to item numbers.
8306 * src/conflicts.c (log_resolution): Fix the message which reversed
8307 shift and reduce.
8308 * src/output.c (action_row): Initialize default_rule to -1.
8309 (token_actions): Adjust.
8310 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
8311 expected output.
8312 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
8313
4a2a22f4
AD
83142002-07-25 Akim Demaille <akim@epita.fr>
8315
8316 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
8317 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
8318 (b4_c_knr_arg_decl): New.
8319 * data/yacc.c: Use it to define yysymprint, yydestruct, and
8320 yyreport_parse_error.
8321
b8df3223
AD
83222002-07-25 Akim Demaille <akim@epita.fr>
8323
8324 * data/yacc.c (yyreport_parse_error): New, extracted from...
8325 (yyparse): here.
8326 (yydestruct, yysymprint): Move above yyparse.
8327 Be K&R compliant.
8328
a762e609
AD
83292002-07-25 Akim Demaille <akim@epita.fr>
8330
8331 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
8332 replace...
8333 (b4_sint_type, b4_uint_type): these.
8334 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
8335 * tests/regression.at (Web2c Actions): Adjust.
8336
12b0043a
AD
83372002-07-25 Akim Demaille <akim@epita.fr>
8338
8339 * src/gram.h (TIEM_NUMBER_MAX): New.
8340 (item_number_of_rule_number, rule_number_of_item_number): Rename
8341 as...
8342 (rule_number_as_item_number, item_number_as_rule_number): these.
8343 Adjust dependencies.
8344 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
8345 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
8346 (symbol_number_to_vector_number): New.
8347 (order): Of vector_number_t* type.
8348 (base_t, BASE_MAX, BASE_MIN): New.
8349 (froms, tos, width, pos, check): Of base_t type.
8350 (action_number_t, ACTION_MIN, ACTION_MAX): New.
8351 (actrow): Of action_number_t type.
8352 (conflrow): Of unsigned int type.
8353 (table_ninf, base_ninf): New.
8354 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
8355 (muscle_insert_int_table, muscle_insert_base_table)
8356 (muscle_insert_rule_number_table): New.
8357 (prepare_tokens): Output `toknum' as int_table.
8358 (action_row): Returns a rule_number_t.
8359 Use ACTION_MIN, not SHRT_MIN.
8360 (token_actions): yydefact is rule_number_t*.
8361 (table_ninf_remap): New.
8362 (pack_table): Use it for `base' and `table'.
8363 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
8364 replaced with...
8365 (YYPACT_NINF, YYTABLE_NINF): these.
8366 (yypact, yytable): Compute their types instead of hard-coded
8367 `short'.
8368 * tests/regression.at (Web2c Actions): Adjust.
8369
5dde258a
AD
83702002-07-19 Akim Demaille <akim@epita.fr>
8371
8372 * src/scan-gram.l (id): Can start with an underscore.
8373
a945ec39
AD
83742002-07-16 Akim Demaille <akim@epita.fr>
8375
8376 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
8377 Adjust all former `associativity' dependencies.
8378 * src/symtab.c (symbol_new): Default associativity is `undef', not
8379 `right'.
8380 (symbol_check_alias_consistence): Adjust.
8381
fae437e8
AD
83822002-07-09 Akim Demaille <akim@epita.fr>
8383
8384 * doc/bison.texinfo: Properly set the ``header'' part.
8385 Use @dircategory ``GNU programming tools'' as per Texinfo's
8386 documentation.
8387 Use @copying.
8388
1a715ef2
AD
83892002-07-09 Akim Demaille <akim@epita.fr>
8390
8391 * lib/quotearg.h: Protect against multiple inclusions.
8392 * src/location.h (location_t): Add a `file' member.
8393 (LOCATION_RESET, LOCATION_PRINT): Adjust.
8394 * src/complain.c (warn_at, complain_at, fatal_at): Drop
8395 `error_one_per_line' support.
8396
a5d50994
AD
83972002-07-09 Akim Demaille <akim@epita.fr>
8398
8399 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
8400 * src/reader.c (lineno): Remove.
8401 Adjust all dependencies.
8402 (get_merge_function): Take a location and use complain_at.
8403 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
8404 * tests/regression.at (Invalid inputs, Mixing %token styles):
8405 Adjust.
8406
b275314e
AD
84072002-07-09 Akim Demaille <akim@epita.fr>
8408
8409 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
8410 recovery rule, and forbid extensions when --yacc.
8411 (gram_error): Use complain_at.
8412 * src/reader.c (reader): Exit if there were parse errors.
8413
865b9df1
AD
84142002-07-09 Akim Demaille <akim@epita.fr>
8415
8416 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
8417 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
8418 Reported by R Blake <blakers@mac.com>.
8419
c76e14da
AD
84202002-07-09 Akim Demaille <akim@epita.fr>
8421
8422 * data/yacc.c: Output the copyright notive in the header.
8423
7db2ed2d
AD
84242002-07-03 Akim Demaille <akim@epita.fr>
8425
8426 * src/output.c (froms, tos): Are state_number_t.
8427 (save_column): sp, sp1, and sp2 are state_number_t.
8428 (prepare): Rename `final' as `final_state_number', `nnts' as
8429 `nterms_number', `nrules' as `rules_number', `nstates' as
8430 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
8431 unused.
8432 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
8433 * data/lalr1.cc (nsym_): Remove, unused.
8434
e68e0410
AD
84352002-07-03 Akim Demaille <akim@epita.fr>
8436
8437 * src/lalr.h, src/lalr.c (goto_number_t): New.
8438 * src/lalr.c (goto_list_t): New.
8439 Propagate them.
8440 * src/nullable.c (rule_list_t): New.
8441 Propagate.
8442 * src/types.h: Remove.
8443
e1a4f3a4
AD
84442002-07-03 Akim Demaille <akim@epita.fr>
8445
8446 * src/closure.c (print_fderives): Use rule_rhs_print.
8447 * src/derives.c (print_derives): Use rule_rhs_print.
8448 (rule_list_t): New, replaces `shorts'.
8449 (set_derives): Add comments.
8450 * tests/sets.at (Nullable, Firsts): Adjust.
8451
536545f3
AD
84522002-07-03 Akim Demaille <akim@epita.fr>
8453
8454 * src/output.c (prepare_actions): Free `tally' and `width'.
8455 (prepare_actions): Allocate and free `order'.
8456 * src/symtab.c (symbols_free): Free `symbols'.
8457 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
8458 * src/output.c (m4_invoke): Move to...
8459 * src/scan-skel.l: here.
8460 (<<EOF>>): Close yyout, and free its name.
8461
8b752b00
AD
84622002-07-03 Akim Demaille <akim@epita.fr>
8463
8464 Fix some memory leaks, and fix a bug: state 0 was examined twice.
8465
8466 * src/LR0.c (new_state): Merge into...
8467 (state_list_append): this.
8468 (new_states): Merge into...
8469 (generate_states): here.
8470 (set_states): Don't ensure a proper `errs' state member here, do it...
8471 * src/conflicts.c (conflicts_solve): here.
8472 * src/state.h, src/state.c: Comment changes.
8473 (state_t): Rename member `shifts' as `transitions'.
8474 Adjust all dependencies.
8475 (errs_new): For consistency, also take the values as argument.
8476 (errs_dup): Remove.
8477 (state_errs_set): New.
8478 (state_reductions_set, state_transitions_set): Assert that no
8479 previous value was assigned.
8480 (state_free): New.
8481 (states_free): Use it.
8482 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
8483 temporary storage: use `errs' and `nerrs' as elsewhere.
8484 (set_conflicts): Allocate and free this `errs'.
8485
613f5e1a
AD
84862002-07-02 Akim Demaille <akim@epita.fr>
8487
8488 * lib/libiberty.h: New.
8489 * lib: Update the bitset implementation from upstream.
8490 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
8491 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
8492 * src/main.c: Adjust bitset stats calls.
8493
26e0cadc
PE
84942002-07-01 Paul Eggert <eggert@twinsun.com>
8495
8496 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
8497 char, so that negative chars don't collide with $.
8498
1154cced
AD
84992002-06-30 Akim Demaille <akim@epita.fr>
8500
8501 Have the GLR tests be `warning' checked, and fix the warnings.
8502
8503 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
8504 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
8505 (yyremoveDeletes): `yyi' and `yyj' are size_t.
8506 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
8507 (yyaddDeferredAction): static.
8508 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
8509 (yyreportParseError): yyprefix is const.
8510 yytokenp is used only when verbose.
8511 (yy__GNUC__): Replace with __GNUC__.
8512 (yypdumpstack): yyi is size_t.
8513 (yypreference): Un-yy local variables and arguments, to avoid
8514 clashes with `yyr1'. Anyway, we are not in the user name space.
8515 (yytname_size): be an int, as is compared with ints.
8516 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
8517 Use them.
8518 * tests/cxx-gram.at: Use quotation to protect $1.
8519 Use AT_COMPILE to enable warnings hunts.
8520 Prototype yylex and yyerror.
8521 `Use' argc.
8522 Include `string.h', not `strings.h'.
8523 Produce and prototype stmtMerge only when used.
8524 yylex takes a location.
8525
97650f4e
AD
85262002-06-30 Akim Demaille <akim@epita.fr>
8527
8528 We spend a lot of time in quotearg, in particular when --verbose.
8529
8530 * src/symtab.c (symbol_get): Store a quoted version of the key.
8531 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
8532 Adjust all callers.
8533
d2576365
AD
85342002-06-30 Akim Demaille <akim@epita.fr>
8535
8536 * src/state.h (reductions_t): Rename member `nreds' as num.
8537 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
8538 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
8539
ccaf65bc
AD
85402002-06-30 Akim Demaille <akim@epita.fr>
8541
8542 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
8543 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
8544 (shifts_to): Rename as...
8545 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
8546 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
8547 (TRANSITION_IS_DISABLED, transitions_to): these.
8548
87675353
AD
85492002-06-30 Akim Demaille <akim@epita.fr>
8550
8551 * src/print.c (print_shifts, print_gotos): Merge into...
8552 (print_transitions): this.
8553 (print_transitions, print_errs, print_reductions): Align the
8554 lookaheads columns.
8555 (print_core, print_transitions, print_errs, print_state,
8556 print_grammar): Output empty lines separator before, not after.
8557 (state_default_rule_compute): Rename as...
8558 (state_default_rule): this.
8559 * tests/conflicts.at (Defaulted Conflicted Reduction),
8560 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
8561 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
8562
ce4ccb4b
AD
85632002-06-30 Akim Demaille <akim@epita.fr>
8564
8565 Display items as we display rules.
8566
8567 * src/gram.h, src/gram.c (rule_lhs_print): New.
8568 * src/gram.c (grammar_rules_partial_print): Use it.
8569 * src/print.c (print_core): Likewise.
8570 * tests/conflicts.at (Defaulted Conflicted Reduction),
8571 (Unresolved SR Conflicts): Adjust.
8572 (Unresolved SR Conflicts): Adjust and rename as...
8573 (Resolved SR Conflicts): this, as was meant.
8574 * tests/regression.at (Web2c Report): Adjust.
8575
bc933ef1
AD
85762002-06-30 Akim Demaille <akim@epita.fr>
8577
8578 * src/print.c (state_default_rule_compute): New, extracted from...
8579 (print_reductions): here.
8580 Pessimize, but clarify the code.
8581 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
8582
53d4308d
AD
85832002-06-30 Akim Demaille <akim@epita.fr>
8584
8585 * src/output.c (action_row): Let default_rule be always a rule
8586 number.
8587
574fb2d5
AD
85882002-06-30 Akim Demaille <akim@epita.fr>
8589
8590 * src/closure.c (print_firsts, print_fderives, closure):
8591 Use BITSET_EXECUTE.
8592 * src/lalr.c (lookaheads_print): Likewise.
8593 * src/state.c (state_rule_lookaheads_print): Likewise.
8594 * src/print_graph.c (print_core): Likewise.
8595 * src/print.c (print_reductions): Likewise.
8596 * src/output.c (action_row): Likewise.
8597 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
8598
05811fd7
AD
85992002-06-30 Akim Demaille <akim@epita.fr>
8600
8601 * src/print_graph.c: Use report_flag.
8602
0e4d5753
AD
86032002-06-30 Akim Demaille <akim@epita.fr>
8604
8605 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
8606 to...
8607 * src/relation.h, src/relation.c (traverse, relation_digraph)
8608 (relation_print, relation_transpose): New.
8609
24c7d800
AD
86102002-06-30 Akim Demaille <akim@epita.fr>
8611
8612 * src/state.h, src/state.c (shifts_to): New.
8613 * src/lalr.c (build_relations): Use it.
8614
9222837b
AD
86152002-06-30 Akim Demaille <akim@epita.fr>
8616
8617 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
8618 (item_number_of_rule_number, rule_number_of_item_number): New.
8619 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
8620 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
8621 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
8622 Propagate their use.
8623 Much remains to be done, in particular wrt `shorts' from types.h.
8624
260008e5
AD
86252002-06-30 Akim Demaille <akim@epita.fr>
8626
8627 * src/symtab.c (symbol_new): Initialize the `printer' member.
8628
8a731ca8
AD
86292002-06-30 Akim Demaille <akim@epita.fr>
8630
8631 * src/LR0.c (save_reductions): Remove, replaced by...
8632 * src/state.h, src/state.c (state_reductions_set): New.
8633 (reductions, errs): Rename as...
8634 (reductions_t, errs_t): these.
8635 Adjust all dependencies.
8636
32e1e0a4
AD
86372002-06-30 Akim Demaille <akim@epita.fr>
8638
8639 * src/LR0.c (state_list_t, state_list_append): New.
8640 (first_state, last_state): Now symbol_list_t.
8641 (this_state): Remove.
8642 (new_itemsets, append_states, save_reductions): Take a state_t as
8643 argument.
8644 (set_states, generate_states): Adjust.
8645 (save_shifts): Remove, replaced by...
8646 * src/state.h, src/state.c (state_shifts_set): New.
8647 (shifts): Rename as...
8648 (shifts_t): this.
8649 Adjust all dependencies.
8650 * src/state.h (state_t): Remove the `next' member.
8651
e5fb6710
AD
86522002-06-30 Akim Demaille <akim@epita.fr>
8653
8654 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
8655 escaped in slot 0.
8656
c7ca99d4
AD
86572002-06-30 Akim Demaille <akim@epita.fr>
8658
8659 Use hash.h for the state hash table.
8660
8661 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
8662 (allocate_storage): Use state_hash_new.
8663 (free_storage): Use state_hash_free.
8664 (new_state, get_state): Adjust.
8665 * src/lalr.h, src/lalr.c (states): Move to...
8666 * src/states.h (state_t): Remove the `link' member, no longer
8667 used.
8668 * src/states.h, src/states.c: here.
8669 (state_hash_new, state_hash_free, state_hash_lookup)
8670 (state_hash_insert, states_free): New.
8671 * src/states.c (state_table, state_compare, state_hash): New.
8672 * src/output.c (output_actions): Do not free states now, since we
8673 still need to know the final_state number in `prepare', called
8674 afterwards. Do it...
8675 * src/main.c (main): here: call states_free after `output'.
8676
df0e7316
AD
86772002-06-30 Akim Demaille <akim@epita.fr>
8678
8679 * src/state.h, src/state.c (state_new): New, extracted from...
8680 * src/LR0.c (new_state): here.
8681 * src/state.h (STATE_ALLOC): Move to...
8682 * src/state.c: here.
8683 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
8684 * src/state.h, src/state.c: here.
8685
39f41916
AD
86862002-06-30 Akim Demaille <akim@epita.fr>
8687
8688 * src/reader.c (gensym): Rename as...
8689 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
8690 (getsym): Rename as...
8691 (symbol_get): this.
8692
d57650a5
AD
86932002-06-30 Akim Demaille <akim@epita.fr>
8694
8695 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
8696 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
8697 * src/output.c, src/print.c, src/print_graph.c: Propagate.
8698 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
8699
5a08f1ce
AD
87002002-06-30 Akim Demaille <akim@epita.fr>
8701
8702 Make the test suite pass with warnings checked.
8703
8704 * tests/actions.at (Printers and Destructors): Improve.
8705 Avoid unsigned vs. signed issues.
8706 * tests/calc.at: Don't exercise the scanner here, do it...
8707 * tests/input.at (Torturing the Scanner): here.
8708
720623af
PH
87092002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8710
88e7e941 8711 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
8712 reorganize first lines parallel to yacc.c.
8713
fb8135fa
AD
87142002-06-28 Akim Demaille <akim@epita.fr>
8715
8716 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
8717 (b4_token_enum, b4_token_defines): New, factored from...
8718 * data/lalr1.cc, data/yacc.c, glr.c: here.
8719
41442480
AD
87202002-06-28 Akim Demaille <akim@epita.fr>
8721
8722 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
8723 unused variables.
8724 * src/output.c (merger_output): static.
8725
e0e5bf84
AD
87262002-06-28 Akim Demaille <akim@epita.fr>
8727
ba0fe3c7 8728 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
8729 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
8730 pacify GCC.
8731 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 8732
676385e2
PH
87332002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8734
8735 Accumulated changelog for new GLR parsing features.
8736
6a254321 8737 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
8738 conflicts_total_count.
8739 * src/conflicts.h: Ditto.
8740 * src/output.c (token_actions): Use the new name.
8741 (output_conflicts): Change conflp => conflict_list_heads, and
8742 confl => conflict_list for better readability.
8743 * data/glr.c: Use the new names.
8744 * NEWS: Add self to GLR announcement.
e0e5bf84 8745
676385e2
PH
8746 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
8747
8748 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
8749 Akim Demaille.
8750
8751 * data/bison.glr: Change name to glr.c
8752 * data/glr.c: Renamed from bison.glr.
8753 * data/Makefile.am: Add glr.c
e0e5bf84
AD
8754
8755 * src/getargs.c:
8756
676385e2 8757 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 8758 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 8759
676385e2
PH
8760 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8761
8762 * data/bison.glr: Be sure to restore the
8763 current #line when returning to the skeleton contents after having
8764 exposed the input file's #line.
8765
8766 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8767
8768 * data/bison.glr: Bring up to date with changes to bison.simple.
8769
8770 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8771
8772 * data/bison.glr: Correct definitions that use b4_prefix.
8773 Various reformatting.
8774 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
8775 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
8776 yytokenp argument; now part of stack.
8777 (yychar): Define to behave as documented.
8778 (yyclearin): Ditto.
e0e5bf84 8779
676385e2
PH
8780 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8781
8782 * src/reader.h: Add declaration for free_merger_functions.
8783
8784 * src/reader.c (merge_functions): New variable.
8785 (get_merge_function): New function.
8786 (free_merger_functions): New function.
8787 (readgram): Check for %prec that is not followed by a symbol.
8788 Handle %dprec and %merge declarations.
8789 (packgram): Initialize dprec and merger fields in rules array.
8790
8791 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
8792 conflict_list_cnt, conflict_list_free): New variables.
8793 (table_grow): Also grow conflict_table.
e0e5bf84 8794 (prepare_rules): Output dprec and merger tables.
676385e2 8795 (conflict_row): New function.
e0e5bf84 8796 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
8797 default reduction in conflicted states for GLR parser so that there
8798 are spaces for the conflict lists.
8799 (save_row): Also save conflict information.
8800 (token_actions): Allocate conflict list.
8801 (merger_output): New function.
8802 (pack_vector): Pack conflict table, too.
8803 (output_conflicts): New function to output yyconflp and yyconfl.
8804 (output_check): Allocate conflict_tos.
8805 (output_actions): Output conflict tables, also.
8806 (output_skeleton): Output b4_mergers definition.
8807 (prepare): Output b4_max_rhs_length definition.
8808 Use 'bison.glr' as default skeleton for GLR parsers.
8809
8810 * src/gram.c (glr_parser): New flag.
8811 (grammar_free): Call free_merger_functions.
8812
8813 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
8814 all pairs of conflicting reductions, rather than just all tokens
8815 causing conflicts. Needed to size conflict tables.
e0e5bf84 8816 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
8817 interface.
8818 (conflicts_print): Ditto.
8819 (count_total_conflicts): New function.
8820
8821 * src/reader.h (merger_list): New type.
8822 (merge_functions): New variable.
8823
8824 * src/lex.h (tok_dprec, tok_merge): New token types.
8825
8826 * src/gram.h (rule_s): Add dprec and merger fields.
8827 (glr_parser): New flag.
8828
8829 * src/conflicts.h (count_total_conflicts): New function.
8830
8831 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
8832
8833 * doc/bison.texinfo (Generalized LR Parsing): New section.
8834 (GLR Parsers): New section.
8835 (Language and Grammar): Mention GLR parsing.
8836 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
8837 Correct typo ("tge" -> "the").
8838
8839 * data/bison.glr: New skeleton for GLR parsing.
8840
8841 * tests/cxx-gram.at: New tests for GLR parsing.
8842
8843 * tests/testsuite.at: Include cxx-gram.at.
8844
8845 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 8846
676385e2
PH
8847 * src/parse-gram.y:
8848
8849 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
8850
8851 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 8852
b5480d74 88532002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
8854
8855 * src/options.h, src/options.c: Remove.
8856 * src/getargs.c (short_options, long_options): New.
8857
60491a94
AD
88582002-06-27 Akim Demaille <akim@epita.fr>
8859
8860 * data/bison.simple, data/bison.c++: Rename as...
8861 * data/yacc.c, data/lalr1.cc: these.
8862 * doc/bison.texinfo (Environment Variables): Remove.
8863
9be0c25b
AD
88642002-06-25 Raja R Harinath <harinath@cs.umn.edu>
8865
8866 * src/getargs.c (report_argmatch): Initialize strtok().
8867
1ae72863
AD
88682002-06-20 Akim Demaille <akim@epita.fr>
8869
8870 * data/bison.simple (b4_symbol_actions): New, replaces...
8871 (b4_symbol_destructor, b4_symbol_printer): these.
8872 (yysymprint): Be sure to call YYPRINT only for tokens, and using
8873 user token numbers.
8874
87542d29
AD
88752002-06-20 Akim Demaille <akim@epita.fr>
8876
8877 * data/bison.simple (yydestructor): Rename as...
8878 (yydestruct): this.
8879
1a31ed21
AD
88802002-06-20 Akim Demaille <akim@epita.fr>
8881
8882 * src/symtab.h, src/symtab.c (symbol_type_set)
8883 (symbol_destructor_set, symbol_precedence_set): The location is
8884 the last argument.
8885 Adjust all callers.
8886
e776192e
AD
88872002-06-20 Akim Demaille <akim@epita.fr>
8888
8889 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
8890 internals.
8891 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
8892 Takes a location.
8893 * src/symtab.h, src/symtab.c (symbol_class_set)
8894 (symbol_user_token_number_set): Likewise.
8895 Adjust all callers.
8896 Promote complain_at.
8897 * tests/input.at (Type Clashes): Adjust.
8898
5c1180b3
AD
88992002-06-20 Akim Demaille <akim@epita.fr>
8900
8901 * data/bison.simple (YYLEX): Fix the declaration when
8902 %pure-parser.
8903
e3170060
AD
89042002-06-20 Akim Demaille <akim@epita.fr>
8905
8906 * data/bison.simple (yysymprint): Don't print the token number,
8907 just its name.
8908 * tests/actions.at (Destructors): Rename as...
8909 (Printers and Destructors): this.
8910 Also exercise %printer.
8911
253862fd
AD
89122002-06-20 Akim Demaille <akim@epita.fr>
8913
8914 * data/bison.simple (YYDSYMPRINT): New.
8915 Use it to remove many of the #if YYDEBUG/if (yydebug).
8916
366eea36
AD
89172002-06-20 Akim Demaille <akim@epita.fr>
8918
8919 * src/symtab.h, src/symtab.c (symbol_t): printer and
8920 printer_location are new members.
8921 (symbol_printer_set): New.
8922 * src/parse-gram.y (PERCENT_PRINTER): New token.
8923 Handle its associated rule.
8924 * src/scan-gram.l: Adjust.
8925 (handle_destructor_at, handle_destructor_dollar): Rename as...
8926 (handle_symbol_code_at, handle_symbol_code_dollar): these.
8927 * src/output.c (symbol_printers_output): New.
8928 (output_skeleton): Call it.
8929 * data/bison.simple (yysymprint): New. Cannot be named yyprint
8930 since there are already many grammar files with a user `yyprint'.
8931 Replace the calls to YYPRINT to calls to yysymprint.
8932 * tests/calc.at: Adjust.
8933 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
8934 taking advantage of parser very internal details (stack size!).
8935
4f25ebb0
AD
89362002-06-20 Akim Demaille <akim@epita.fr>
8937
8938 * src/scan-gram.l: Complete the scanner with the missing patterns
8939 to pacify Flex.
8940 Use `quote' and `symbol_tag_get' where appropriate.
8941
93b68a0e
AD
89422002-06-19 Akim Demaille <akim@epita.fr>
8943
8944 * tests/actions.at (Destructors): Augment to test locations.
8945 * data/bison.simple (yydestructor): Pass it the current location
8946 if locations are enabled.
8947 Prototype only when __STDC__ or C++.
8948 Change the argument names to move into the yy name space: there is
8949 user code here.
8950
58612f1d
AD
89512002-06-19 Akim Demaille <akim@epita.fr>
8952
74310291
AD
8953 * data/bison.simple (b4_pure_if): New.
8954 Use it instead of #ifdef YYPURE.
8955
89562002-06-19 Akim Demaille <akim@epita.fr>
8957
8958 * data/bison.simple (b4_location_if): New.
58612f1d
AD
8959 Use it instead of #ifdef YYLSP_NEEDED.
8960
f25bfb75
AD
89612002-06-19 Akim Demaille <akim@epita.fr>
8962
8963 Prepare @$ in %destructor, but currently don't bind it in the
8964 skeleton, as %location use is not cleaned up yet.
8965
8966 * src/scan-gram.l (handle_dollar, handle_destructor_at)
8967 (handle_action_at): New.
8968 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
8969 a braced_code_t and a location as additional arguments.
8970 (handle_destructor_dollar): Instead of requiring `b4_eval', just
8971 unquote one when outputting `b4_dollar_dollar'.
8972 Adjust callers.
8973 * data/bison.simple (b4_eval): Remove.
8974 (b4_symbol_destructor): Adjust.
8975 * tests/input.at (Invalid @n): Adjust.
8976
c732d2c6
AD
89772002-06-19 Zack Weinberg <zack@codesourcery.com>
8978
8979 * doc/bison.texinfo: Document ability to have multiple
8980 prologue sections.
8981
8c165d89
AD
89822002-06-18 Akim Demaille <akim@epita.fr>
8983
8984 * src/files.c (compute_base_names): When computing the output file
8985 names from the input file name, strip the directory part.
8986
ca98bf57
AD
89872002-06-18 Akim Demaille <akim@epita.fr>
8988
8989 * data/bison.simple.new: Comment changes.
8990 Reported by Andreas Schwab.
8991
0bfb02ff
AD
89922002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
8993
8994 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
8995 there are no `label `yyoverflowlab' defined but not used' warnings
8996 when yyoverflow is defined.
8997
24c0aad7
AD
89982002-06-18 Akim Demaille <akim@epita.fr>
8999
9000 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
9001 new member.
9002 (symbol_destructor_set): Adjust.
9003 * src/output.c (symbol_destructors_output): Output the destructor
9004 locations.
9005 Output the symbol name.
9006 * data/bison.simple (b4_symbol_destructor): Adjust.
9007
5719c109
AD
90082002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
9009 and Akim Demaille <akim@epita.fr>
9010
9011 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
9012 what's left on the stack when the error recovery hits EOF.
9013 * tests/actions.at (Destructors): Complete to exercise this case.
9014
9280d3ef
AD
90152002-06-17 Akim Demaille <akim@epita.fr>
9016
9017 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
9018 arguments is really empty, not only equal to `[]'.
9019 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
9020 member.
9021 (symbol_destructor_set): New.
9022 * src/output.c (symbol_destructors_output): New.
9023 * src/reader.h (brace_code_t, current_braced_code): New.
9024 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
9025 (handle_dollar): Rename as...
9026 (handle_action_dollar): this.
9027 (handle_destructor_dollar): New.
9028 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
9029 (grammar_declaration): Use it.
9030 * data/bison.simple (yystos): Is always defined.
9031 (yydestructor): New.
9032 * tests/actions.at (Destructors): New.
9033 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
9034
dafdc66f
AD
90352002-06-17 Akim Demaille <akim@epita.fr>
9036
9037 * src/symlist.h, src/symlist.c (symbol_list_length): New.
9038 * src/scan-gram.l (handle_dollar, handle_at): Compute the
9039 rule_length only when needed.
9040 * src/output.c (actions_output, token_definitions_output): Output
9041 the full M4 block.
9042 * src/symtab.c: Don't access directly to the symbol tag, use
9043 symbol_tag_get.
9044 * src/parse-gram.y: Use symbol_list_free.
9045
56c47203
AD
90462002-06-17 Akim Demaille <akim@epita.fr>
9047
9048 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
9049 (symbol_list_prepend, get_type_name): Move to...
9050 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
9051 (symbol_list_prepend, symbol_list_n_type_name_get): here.
9052 Adjust all callers.
9053 (symbol_list_free): New.
9054 * src/scan-gram.l (handle_dollar): Takes a location.
9055 * tests/input.at (Invalid $n): Adjust.
9056
1e0bab92
AD
90572002-06-17 Akim Demaille <akim@epita.fr>
9058
9059 * src/reader.h, src/reader.c (symbol_list_new): Export it.
9060 (symbol_list_prepend): New.
9061 * src/parse-gram.y (%union): `list' is a new member.
9062 (symbols.1): New, replaces...
9063 (terms_to_prec.1, nterms_to_type.1): these.
9064 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
9065 Take a location as additional argument.
9066 Adjust all callers.
9067
04e60654
AD
90682002-06-15 Akim Demaille <akim@epita.fr>
9069
9070 * src/parse-gram.y: Move %token in the declaration section so that
9071 we don't depend upon CVS Bison.
9072
10e5b8bd
AD
90732002-06-15 Akim Demaille <akim@epita.fr>
9074
9075 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
9076 * src/print.c (print_core): Use it.
9077
9801d40c
AD
90782002-06-15 Akim Demaille <akim@epita.fr>
9079
9080 * src/conflicts.c (log_resolution): Accept the rule involved in
9081 the sr conflicts instead of the lookahead number that points to
9082 that rule.
9083 (flush_reduce): Accept the current lookahead vector as argument,
9084 instead of the index in LA.
9085 (resolve_sr_conflict): Accept the current number of lookahead
9086 bitset to consider for the STATE, instead of the index in LA.
9087 (set_conflicts): Adjust.
9088 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
9089
c0263492
AD
90902002-06-15 Akim Demaille <akim@epita.fr>
9091
9092 * src/state.h (state_t): Replace the `lookaheadsp' member, a
9093 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
9094 Adjust all dependencies.
9095 * src/lalr.c (initialize_lookaheads): Split into...
9096 (states_lookaheads_count, states_lookaheads_initialize): these.
9097 (lalr): Adjust.
9098
9757c359
AD
90992002-06-15 Akim Demaille <akim@epita.fr>
9100
9101 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
9102 out of...
9103 (grammar_rules_print): here.
9104 * src/reduce.c (reduce_output): Use it.
9105 * tests/reduce.at (Useless Rules, Reduced Automaton)
9106 (Underivable Rules): Adjust.
9107
6b98e4b5
AD
91082002-06-15 Akim Demaille <akim@epita.fr>
9109
9110 Copy BYacc's nice way to report the grammar.
9111
9112 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
9113 New.
9114 Don't print the rules' location, it is confusing and useless.
9115 (rule_print): Use grammar_rhs_print.
9116 * src/print.c (print_grammar): Use grammar_rules_print.
9117
6b98e4b5
AD
91182002-06-15 Akim Demaille <akim@epita.fr>
9119
9120 Complete and rationalize `useless thing' warnings.
9121
9122 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
9123 (symbol_tag_print): New.
9124 Use them everywhere in place of accessing directly the tag member.
9125 * src/gram.h, src/gram.c (rule_print): New.
9126 Use it where a rule used to be printed `by hand'.
9127 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
9128 (reduce_grammar_tables): Report the useless rules.
9129 (reduce_print): Useless things are a warning, not an error.
9130 Report it as such.
9131 * tests/reduce.at (Useless Nonterminals, Useless Rules):
9132 (Reduced Automaton, Underivable Rules): Adjust.
9133 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
9134 * tests/conflicts.at (Unresolved SR Conflicts)
9135 (Solved SR Conflicts): Adjust.
9136
ee000ba4
AD
91372002-06-15 Akim Demaille <akim@epita.fr>
9138
9139 Let symbols have a location.
9140
9141 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
9142 (getsym): Adjust.
9143 Adjust all callers.
9144 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
9145 Use location_t, not int.
9146 * src/symtab.c (symbol_check_defined): Take advantage of the
9147 location.
9148 * tests/regression.at (Invalid inputs): Adjust.
9149
8efe435c
AD
91502002-06-15 Akim Demaille <akim@epita.fr>
9151
9152 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
9153 (input): Don't try to initialize yylloc here, do it in the
9154 scanner.
9155 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
9156 * src/gram.h (rule_t): Change line and action_line into location
9157 and action_location, of location_t type.
9158 Adjust all dependencies.
9159 * src/location.h, src/location.c (empty_location): New.
9160 * src/reader.h, src/reader.c (grammar_start_symbol_set)
9161 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
9162 (grammar_current_rule_symbol_append)
9163 (grammar_current_rule_action_append): Expect a location as argument.
9164 * src/reader.c (grammar_midrule_action): Adjust to attach an
9165 action's location as dummy symbol location.
9166 * src/symtab.h, src/symtab.c (startsymbol_location): New.
9167 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
9168 the line numbers.
9169
1921f1d7
AD
91702002-06-14 Akim Demaille <akim@epita.fr>
9171
9172 Grammar declarations may be found in the grammar section.
9173
9174 * src/parse-gram.y (rules_or_grammar_declaration): New.
9175 (declarations): Each declaration may end with a semicolon, not
9176 just...
9177 (grammar_declaration): `"%union"'.
9178 (grammar): Branch to rules_or_grammar_declaration.
9179
4515534c
AD
91802002-06-14 Akim Demaille <akim@epita.fr>
9181
9182 * src/main.c (main): Invoke scanner_free.
9183
f958596b
AD
91842002-06-14 Akim Demaille <akim@epita.fr>
9185
9186 * src/output.c (m4_invoke): Extracted from...
9187 (output_skeleton): here.
9188 Free tempfile.
9189
2c569025
AD
91902002-06-14 Akim Demaille <akim@epita.fr>
9191
9192 * src/parse-gram.y (directives, directive, gram)
9193 (grammar_directives, precedence_directives, precedence_directive):
9194 Rename as...
9195 (declarations, declaration, grammar, grammar_declaration)
9196 (precedence_declaration, precedence_declarator): these.
9197 (symbol_declaration): New.
9198
592e8d4d
AD
91992002-06-14 Akim Demaille <akim@epita.fr>
9200
9201 * src/files.c (action_obstack): Remove, unused.
9202 (output_obstack): Remove it, and all its dependencies, as it is no
9203 longer needed.
9204 * src/reader.c (epilogue_set): Build the epilogue in the
9205 muscle_obstack.
9206 * src/output.h, src/output.c (muscle_obstack): Move to...
9207 * src/muscle_tab.h, src/muscle_tab.h: here.
9208 (muscle_init): Initialize muscle_obstack.
9209 (muscle_free): New.
9210 * src/main.c (main): Call it.
9211
0c15323d
AD
92122002-06-14 Akim Demaille <akim@epita.fr>
9213
9214 * src/location.h: New, extracted from...
9215 * src/reader.h: here.
9216 * src/Makefile.am (noinst_HEADERS): Merge into
9217 (bison_SOURCES): this.
9218 Add location.h.
9219 * src/parse-gram.y: Use location_t instead of Bison's.
9220 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
9221 Use location_t instead of ints.
9222
e96c9728
AD
92232002-06-14 Akim Demaille <akim@epita.fr>
9224
9225 * data/bison.simple, data/bison.c++: Be sure to restore the
9226 current #line when returning to the skeleton contents after having
9227 exposed the input file's #line.
9228
75d1fe16
AD
92292002-06-12 Akim Demaille <akim@epita.fr>
9230
9231 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
9232 eager.
9233 * tests/actions.at (Exotic Dollars): New.
9234
6c35d22c
AD
92352002-06-12 Akim Demaille <akim@epita.fr>
9236
9237 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
9238 ['"/] too eagerly.
9239 * tests/input.at (Torturing the Scanner): New.
9240
1d6412ad
AD
92412002-06-11 Akim Demaille <akim@epita.fr>
9242
9243 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
9244 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
9245 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
9246 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
9247 * src/reader.c (reader): Use it.
9248
4cdb01db
AD
92492002-06-11 Akim Demaille <akim@epita.fr>
9250
9251 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
9252 Adjust all callers.
9253 (scanner_last_string_free): New.
9254
44995b2e
AD
92552002-06-11 Akim Demaille <akim@epita.fr>
9256
9257 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
9258 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
9259 (last_string, YY_OBS_FREE): New.
9260 Use them when returning an ID.
9261
e9955c83
AD
92622002-06-11 Akim Demaille <akim@epita.fr>
9263
9264 Have Bison grammars parsed by a Bison grammar.
9265
9266 * src/reader.c, src/reader.h (prologue_augment): New.
9267 * src/reader.c (copy_definition): Remove.
9268
9269 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
9270 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
9271 (grammar_current_rule_prec_set, grammar_current_rule_check)
9272 (grammar_current_rule_symbol_append)
9273 (grammar_current_rule_action_append): Export.
9274 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
9275 (symbol_list_action_append): Remove.
9276 Hook the routines from reader.
9277 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
9278 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
9279
9280 * src/reader.c (read_declarations): Remove, unused.
9281
9282 * src/parse-gram.y: Handle the epilogue.
9283 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
9284 (grammar_start_symbol_set): this.
9285 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
9286 * src/reader.c (readgram): Remove, unused.
9287 (reader): Adjust to insert eoftoken and axiom where appropriate.
9288
9289 * src/reader.c (copy_dollar): Replace with...
9290 * src/scan-gram.h (handle_dollar): this.
9291 * src/parse-gram.y: Remove `%thong'.
9292
9293 * src/reader.c (copy_at): Replace with...
9294 * src/scan-gram.h (handle_at): this.
9295
9296 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
9297 New.
9298
9299 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
9300 time being.
9301
9302 * src/reader.h, src/reader.c (grammar_rule_end): New.
9303
9304 * src/parse.y (current_type, current_class): New.
9305 Implement `%nterm', `%token' support.
9306 Merge `%term' into `%token'.
9307 (string_as_id): New.
9308 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
9309 type name.
9310
9311 * src/parse-gram.y: Be sure to handle properly the beginning of
9312 rules.
9313
9314 * src/parse-gram.y: Handle %type.
9315 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
9316
9317 * src/parse-gram.y: More directives support.
9318 * src/options.c: No longer handle source directives.
9319
9320 * src/parse-gram.y: Fix %output.
9321
9322 * src/parse-gram.y: Handle %union.
9323 Use the prologue locations.
9324 * src/reader.c (parse_union_decl): Remove.
9325
9326 * src/reader.h, src/reader.c (epilogue_set): New.
9327 * src/parse-gram.y: Use it.
9328
9329 * data/bison.simple, data/bison.c++: b4_stype is now either not
9330 defined, then default to int, or to the contents of %union,
9331 without `union' itself.
9332 Adjust.
9333 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
9334
9335 * src/output.c (actions_output): Don't output braces, as they are
9336 already handled by the scanner.
9337
9338 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
9339 characters to themselves.
9340
9341 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
9342 that the epilogue has a proper #line.
9343
9344 * src/parse-gram.y: Handle precedence/associativity.
9345
9346 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
9347 a terminal.
9348 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
9349 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
9350 at all to define terminals that cannot be emitted.
9351
9352 * src/scan-gram.l: Escape M4 characters.
9353
9354 * src/scan-gram.l: Working properly with escapes in user
9355 strings/characters.
9356
9357 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
9358 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
9359 grammar.
9360 Use more modest sizes, as for the time being the parser does not
9361 release memory, and therefore the process swallows a huge amount
9362 of memory.
9363
9364 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
9365 stricter %token grammar.
9366
9367 * src/symtab.h (associativity): Add `undef_assoc'.
9368 (symbol_precedence_set): Do nothing when passed an undef_assoc.
9369 * src/symtab.c (symbol_check_alias_consistence): Adjust.
9370
9371 * tests/regression.at (Invalid %directive): Remove, as it is now
9372 meaningless.
9373 (Invalid inputs): Adjust to the new error messages.
9374 (Token definitions): The new grammar doesn't allow too many
9375 eccentricities.
9376
9377 * src/lex.h, src/lex.c: Remove.
9378 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
9379 (copy_character, copy_string2, copy_string, copy_identifier)
9380 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
9381 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
9382 (parse_action): Remove.
9383 * po/POTFILES.in: Adjust.
9384
2e047461
AD
93852002-06-11 Akim Demaille <akim@epita.fr>
9386
cd05d13c 9387 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
9388 rule's action member: return the action as a string.
9389 Don't require `rule_length' as an argument: compute it.
9390 (grammar_current_rule_symbol_append)
9391 (grammar_current_rule_action_append): New, eved out from
9392 (readgram): here.
9393 Remove `action_flag', `rulelength', unused now.
9394
9af3fbce
AD
93952002-06-11 Akim Demaille <akim@epita.fr>
9396
9397 * src/reader.c (grammar_current_rule_prec_set).
9398 (grammar_current_rule_check): New, eved out from...
9399 (readgram): here.
9400 Remove `xaction', `first_rhs': useless.
9401 * tests/input.at (Type clashes): New.
9402 * tests/existing.at (GNU Cim Grammar): Adjust.
9403
1485e106
AD
94042002-06-11 Akim Demaille <akim@epita.fr>
9405
9406 * src/reader.c (grammar_midrule_action): New, Eved out from
9407 (readgram): here.
9408
da4160c3
AD
94092002-06-11 Akim Demaille <akim@epita.fr>
9410
9411 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
9412 New.
9413 (readgram): Use them as replacement of inlined code, crule and
9414 crule1.
9415
f6d0f937
AD
94162002-06-11 Akim Demaille <akim@epita.fr>
9417
9418 * src/reader.c (grammar_end, grammar_symbol_append): New.
9419 (readgram): Use them.
9420 Make the use of `p' as local as possible.
9421
69078d4b
AD
94222002-06-10 Akim Demaille <akim@epita.fr>
9423
9424 GCJ's parser requires the tokens to be defined before the prologue.
9425
9426 * data/bison.simple: Output the token definition before the user's
9427 prologue.
9428 * tests/regression.at (Braces parsing, Duplicate string)
9429 (Mixing %token styles): Check the output from bison.
9430 (Early token definitions): New.
9431
5e424082
AD
94322002-06-10 Akim Demaille <akim@epita.fr>
9433
9434 * src/symtab.c (symbol_user_token_number_set): Don't complain when
9435 assigning twice the same user number to a token, so that we can
9436 use it in...
9437 * src/lex.c (lex): here.
9438 Also use `symbol_class_set' instead of hand written code.
9439 * src/reader.c (parse_assoc_decl): Likewise.
9440
44536b35
AD
94412002-06-10 Akim Demaille <akim@epita.fr>
9442
9443 * src/symtab.c, src/symtab.c (symbol_class_set)
9444 (symbol_user_token_number_set): New.
9445 * src/reader.c (parse_token_decl): Use them.
9446 Use a switch instead of ifs.
9447 Use a single argument.
9448
8b9f2372
AD
94492002-06-10 Akim Demaille <akim@epita.fr>
9450
9451 Remove `%thong' support as it is undocumented, unused, duplicates
9452 `%token's job, and creates useless e-mail traffic with people who
9453 want to know what it is, why it is undocumented, unused, and
9454 duplicates `%token's job.
9455
9456 * src/reader.c (parse_thong_decl): Remove.
9457 * src/options.c (option_table): Remove "thong".
9458 * src/lex.h (tok_thong): Remove.
9459
3ae2b51f
AD
94602002-06-10 Akim Demaille <akim@epita.fr>
9461
9462 * src/symtab.c, src/symtab.c (symbol_type_set)
9463 (symbol_precedence_set): New.
9464 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
9465 (value_components_used): Remove, unused.
9466
2f1afb73
AD
94672002-06-09 Akim Demaille <akim@epita.fr>
9468
9469 Move symbols handling code out of the reader.
9470
9471 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
9472 (axiom): Move to...
9473 * src/symtab.h, src/symtab.c: here.
9474
9475 * src/gram.c (start_symbol): Remove: use startsymbol->number.
9476 * src/reader.c (startval): Rename as...
9477 * src/symtab.h, src/symtab.c (startsymbol): this.
9478 * src/reader.c: Adjust.
9479
9480 * src/reader.c (symbol_check_defined, symbol_make_alias)
9481 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
9482 (token_translations_init)
9483 Move to...
9484 * src/symtab.c: here.
9485 * src/reader.c (packsymbols): Move to...
9486 * src/symtab.h, src/symtab.c (symbols_pack): here.
9487 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
9488 argument.
9489
e9bca3ad
AD
94902002-06-03 Akim Demaille <akim@epita.fr>
9491
9492 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
9493 then statements.
9494
86eff183
AD
94952002-06-03 Akim Demaille <akim@epita.fr>
9496
9497 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
9498 structs with non literals.
9499 * src/scan-skel.l: never-interactive.
9500 * src/conflicts.c (enum conflict_resolution_e): No trailing
9501 comma.
9502 * src/getargs.c (usage): Split long literal strings.
9503 Reported by Hans Aberg.
9504
717be197
AD
95052002-05-28 Akim Demaille <akim@epita.fr>
9506
9507 * data/bison.c++: Use C++ ostreams.
9508 (cdebug_): New member.
9509
670ddffd
AD
95102002-05-28 Akim Demaille <akim@epita.fr>
9511
9512 * src/output.c (output_skeleton): Be sure to allocate enough room
9513 for `/' _and_ for `\0' in full_skeleton.
9514
769b430f
AD
95152002-05-28 Akim Demaille <akim@epita.fr>
9516
9517 * data/bison.c++: Catch up with bison.simple:
9518 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9519 and Paul Eggert <eggert@twinsun.com>: `error' handing.
9520 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
9521 and popping traces.
9522
7067cb36
PH
95232002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9524
9525 * src/output.c (output_skeleton): Put an explicit path in front of
9526 the skeleton file name, rather than relying on the -I directory,
9527 to partially alleviate effects of having a skeleton file lying around
9528 in the current directory.
769b430f 9529
4a713ec2
PH
95302002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9531
769b430f 9532 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
9533 obstack_printf should be obstack_fgrow1.
9534
b408954b
AD
95352002-05-26 Akim Demaille <akim@epita.fr>
9536
9537 * src/state.h (state_t): `solved_conflicts' is a new member.
9538 * src/LR0.c (new_state): Set it to 0.
9539 * src/conflicts.h, src/conflicts.c (print_conflicts)
9540 (free_conflicts, solve_conflicts): Rename as...
9541 (conflicts_print, conflicts_free, conflicts_solve): these.
9542 Adjust callers.
9543 * src/conflicts.c (enum conflict_resolution_e)
9544 (solved_conflicts_obstack): New, used by...
9545 (log_resolution): this.
9546 Adjust to attach the conflict resolution to each state.
9547 Complete the description with the precedence/associativity
9548 information.
9549 (resolve_sr_conflict): Adjust.
9550 * src/print.c (print_state): Output its solved_conflicts.
9551 * tests/conflicts.at (Unresolved SR Conflicts)
9552 (Solved SR Conflicts): Exercise --report=all.
9553
a49aecd5
AD
95542002-05-26 Akim Demaille <akim@epita.fr>
9555
9556 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
9557 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
9558 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
9559 (token_number_t, item_number_as_token_number)
9560 (token_number_as_item_number, muscle_insert_token_number_table):
9561 Rename as...
9562 (symbol_number_t, item_number_as_symbol_number)
9563 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
9564 these, since it is more appropriate.
9565
5504898e
AD
95662002-05-26 Akim Demaille <akim@epita.fr>
9567
9568 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
9569 `Error:' lines.
9570 * data/bison.simple (yystos) [YYDEBUG]: New.
9571 (yyparse) [YYDEBUG]: Display the symbols which are popped during
9572 error recovery.
9573 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
9574
ec3bc396
AD
95752002-05-25 Akim Demaille <akim@epita.fr>
9576
9577 * doc/bison.texinfo (Debugging): Split into...
9578 (Tracing): this new section, its former contents, and...
9579 (Understanding): this new section.
9580 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
9581 by...
9582 (report_flag): this.
9583 Adjust all dependencies.
9584 (report_args, report_types, report_argmatch): New.
9585 (usage, getargs): Report/support -r, --report.
9586 * src/options.h
9587 (struct option_table_struct): Rename as..,
9588 (struct option_table_s): this.
9589 Rename the `set_flag' member to `flag' to match with getopt_long's
9590 struct.
9591 * src/options.c (option_table): Split verbose into an entry for
9592 %verbose, and another for --verbose.
9593 Support --report/-r, so remove -r from the obsolete --raw.
9594 * src/print.c: Attach full item sets and lookaheads reports to
9595 report_flag instead of trace_flag.
9596 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
9597
78df8250
PE
95982002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9599 and Paul Eggert <eggert@twinsun.com>
769b430f 9600
78df8250
PE
9601 * data/bison.simple (yyparse): Correct error handling to conform to
9602 POSIX and yacc. Specifically, after syntax error is discovered,
9603 do not reduce further before shifting the error token.
9604 Clean up the code a bit by removing the labels yyerrdefault,
9605 yyerrhandle, yyerrpop.
9606 * NEWS: Document the above.
9607
c0c9ea05
PH
96082002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9609
9610 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
9611 type; it isn't always big enough, since it doesn't necessarily
9612 include non-terminals.
769b430f 9613 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
9614 the latter can be removed.
9615 (yy_token_number_type): Remove, only one use.
9616 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
9617 don't use TokenNumberType as element type.
769b430f 9618
c0c9ea05
PH
9619 * tests/regression.at: Modify expected output to agree with change
9620 to yyr1 and yytranslate.
769b430f 9621
6390a83f
FK
96222002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
9623
9624 * src/reader.c (parse_action): Use copy_character instead of
9625 obstack_1grow.
9626
db7c8e9a
AD
96272002-05-13 Akim Demaille <akim@epita.fr>
9628
9629 * tests/regression.at (Token definitions): Prototype yylex and
9630 yyerror.
9631
fcc61800
PH
96322002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9633
158c687b 9634 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
9635 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
9636 32-bit arithmetic.
9637 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
9638
5683e9b2
AD
96392002-05-07 Akim Demaille <akim@epita.fr>
9640
9641 * tests/synclines.at: Be sure to prototype yylex and yyerror to
9642 avoid GCC warnings.
9643
0c2d3f4c
AD
96442002-05-07 Akim Demaille <akim@epita.fr>
9645
9646 Kill GCC warnings.
9647
9648 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
9649 over the RHS of each rule.
9650 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
9651 * src/state.h (state_t): Member `nitems' is unsigned short.
9652 * src/LR0.c (get_state): Adjust.
9653 * src/reader.c (packgram): Likewise.
9654 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
9655 `Type'.
9656 (muscle_insert_int_table): Remove, unused.
9657 (prepare_rules): Remove `max'.
9658
1565b720
AD
96592002-05-06 Akim Demaille <akim@epita.fr>
9660
9661 * src/closure.c (print_firsts): Display of the symbol tags.
9662 (bitmatrix_print): Move to...
9663 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
9664 here.
9665 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
9666
cfaee611
AD
96672002-05-06 Akim Demaille <akim@epita.fr>
9668
9669 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
9670 hash_do_for_each.
9671
458be8e0
AD
96722002-05-06 Akim Demaille <akim@epita.fr>
9673
9674 * src/LR0.c (new_state, get_state): Instead of using the global
9675 `kernel_size' and `kernel_base', have two new arguments:
9676 `core_size' and `core'.
9677 Adjust callers.
9678
a900a624
AD
96792002-05-06 Akim Demaille <akim@epita.fr>
9680
9681 * src/reader.c (packgram): No longer end `ritem' with a 0
9682 sentinel: it is not used.
9683
d4e7d3a1
AD
96842002-05-05 Akim Demaille <akim@epita.fr>
9685
9686 New experimental feature: display the lookaheads in the report and
9687 graph.
9688
9689 * src/print (print_core): When --trace-flag, display the rules
9690 lookaheads.
9691 * src/print_graph.c (print_core): Likewise.
9692 Swap the arguments.
9693 Adjust caller.
9694
39ceb25b
AD
96952002-05-05 Akim Demaille <akim@epita.fr>
9696
9697 * tests/torture.at (Many lookaheads): New test.
9698
5372019f
AD
96992002-05-05 Akim Demaille <akim@epita.fr>
9700
9701 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
9702 (GENERATE_MUSCLE_INSERT_TABLE): this.
9703 (output_int_table, output_unsigned_int_table, output_short_table)
9704 (output_token_number_table, output_item_number_table): Replace with...
9705 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
9706 (muscle_insert_short_table, muscle_insert_token_number_table)
9707 (muscle_insert_item_number_table): these.
9708 Adjust all callers.
9709 (prepare_tokens): Don't free `translations', since...
9710 * src/reader.h, src/reader.c (grammar_free): do it.
9711 Move to...
9712 * src/gram.h, src/gram.c (grammar_free): here.
9713 * data/bison.simple, data/bison.c++: b4_token_number_max is now
9714 b4_translate_max.
9715
5df5f6d5
AD
97162002-05-05 Akim Demaille <akim@epita.fr>
9717
9718 * src/output.c (output_unsigned_int_table): New.
9719 (prepare_rules): `i' is unsigned.
9720 `prhs', `rline', `r2' are unsigned int.
9721 Rename muscle `rhs_number_max' as `rhs_max'.
9722 Output muscles `prhs_max', `rline_max', and `r2_max'.
9723 Free rline and r1.
9724 * data/bison.simple, data/bison.c++: Adjust to use these muscles
9725 to compute types instead of constant types.
9726 * tests/regression.at (Web2c Actions): Adjust.
9727
b87f8b21
AD
97282002-05-04 Akim Demaille <akim@epita.fr>
9729
9730 * src/symtab.h (SALIAS, SUNDEF): Rename as...
9731 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
9732 Adjust dependencies.
9733 * src/output.c (token_definitions_output): Be sure not to output a
9734 `#define 'a'' when fed with `%token 'a' "a"'.
9735 * tests/regression.at (Token definitions): New.
9736
8bb936e4
PE
97372002-05-03 Paul Eggert <eggert@twinsun.com>
9738
9739 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
9740 for K&R C.
9741
97422002-05-03 gettextize <bug-gnu-gettext@gnu.org>
9743
9744 * Makefile.am (SUBDIRS): Remove intl.
9745 (EXTRA_DIST): Add config/config.rpath.
9746
53c71a12
AD
97472002-05-03 Akim Demaille <akim@epita.fr>
9748
9749 * data/bison.simple (m4_if): Don't output empty enums.
9750 And actually, output valid enum definitions :(.
9751
289dd0cf
AD
97522002-05-03 Akim Demaille <akim@epita.fr>
9753
9754 * configure.bat: Remove, completely obsolete.
9755 * Makefile.am (EXTRA_DIST): Adjust.
9756 Don't distribute config.rpath...
9757 * config/Makefile.am (EXTRA_DIST): Do it.
9758
db85e524
AD
97592002-05-03 Akim Demaille <akim@epita.fr>
9760
9761 * configure.in (GETTEXT_VERSION): New.
9762 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
9763
83ccf991
AD
97642002-05-03 Akim Demaille <akim@epita.fr>
9765
9766 * data/bison.simple (b4_token_enum): New.
9767 (b4_token_defines): Use it to output tokens both as #define and
9768 enums.
9769 Suggested by Paul Eggert.
9770 * src/output.c (token_definitions_output): Don't output spurious
9771 white spaces.
9772
1f418995
AD
97732002-05-03 Akim Demaille <akim@epita.fr>
9774
9775 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
9776
45119f04
RA
97772002-05-02 Robert Anisko <robert@lrde.epita.fr>
9778
9779 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
9780 Update the stack class, give a try to deque as the default container.
9781
b2d52318
AD
97822002-05-02 Akim Demaille <akim@epita.fr>
9783
9784 * data/bison.simple (yyparse): Do not implement @$ = @1.
9785 (YYLLOC_DEFAULT): Adjust to do it.
9786 * doc/bison.texinfo (Location Default Action): Fix.
9787
3a8b4109
AD
97882002-05-02 Akim Demaille <akim@epita.fr>
9789
9790 * src/reader.c (parse_braces): Merge into...
9791 (parse_action): this.
9792
84614e13
AD
97932002-05-02 Akim Demaille <akim@epita.fr>
9794
9795 * configure.in (ALL_LINGUAS): Remove.
9796 * po/LINGUAS, hr.po: New.
9797
fdbcd8e2
AD
97982002-05-02 Akim Demaille <akim@epita.fr>
9799
9800 Remove the so called hairy (semantic) parsers.
9801
9802 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
9803 * src/gram.h, src/gram.c (semantic_parser): Remove.
9804 (rule_t): Remove the guard and guard_line members.
9805 * src/lex.h (token_t): remove tok_guard.
9806 * src/options.c (option_table): Remove %guard and %semantic_parser
9807 support.
9808 * src/output.c, src/output.h (guards_output): Remove.
9809 (prepare): Adjust.
9810 (token_definitions_output): Don't output the `T'
9811 tokens (???).
9812 (output_skeleton): Don't output the guards.
9813 * src/files.c, src/files.c (attrsfile): Remove.
9814 * src/reader.c (symbol_list): Remove the guard and guard_line
9815 members.
9816 Adjust dependencies.
9817 (parse_guard): Remove.
9818 * data/bison.hairy: Remove.
9819 * doc/bison.texinfo (Environment Variables): Remove occurrences of
9820 BISON_HAIRY.
9821
82b6cb3f
AD
98222002-05-02 Akim Demaille <akim@epita.fr>
9823
9824 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
9825 (parse_guard): Rename the formal argument `stack_offset' as
9826 `rule_length', which is more readable.
9827 Adjust callers.
9828 (copy_at, copy_dollar): Instead of outputting the hard coded
9829 values of $$, $n and so forth, output invocation to b4_lhs_value,
9830 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
9831 Note: this patch partially drops `semantic-parser' support: it
9832 always does `rule_length - n', where semantic parsers ought to
9833 always use `-n'.
82b6cb3f
AD
9834 * data/bison.simple, data/bison.c++ (b4_lhs_value)
9835 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
9836
6cbfbcc5
AD
98372002-05-02 Akim Demaille <akim@epita.fr>
9838
9839 * configure.in (AC_INIT): Bump to 1.49b.
9840 (AM_INIT_AUTOMAKE): Short invocation.
9841
b8548114
AD
98422002-05-02 Akim Demaille <akim@epita.fr>
9843
9844 Version 1.49a.
9845
c20cd1fa
AD
98462002-05-01 Akim Demaille <akim@epita.fr>
9847
9848 * src/skeleton.h: Remove.
9849
8a9566d4
AD
98502002-05-01 Akim Demaille <akim@epita.fr>
9851
9852 * src/skeleton.h: Fix the #endif.
9853 Reported by Magnus Fromreide.
9854
8c6d399a
PE
98552002-04-26 Paul Eggert <eggert@twinsun.com>
9856
9857 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
9858 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 9859 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 9860
2b7ed18a
RA
98612002-04-25 Robert Anisko <robert@lrde.epita.fr>
9862
9863 * src/scan-skel.l: Postprocess quadrigraphs.
9864
9865 * src/reader.c (copy_character): New function, used to output
9866 single characters while replacing `[' and `]' with quadrigraphs, to
9867 avoid troubles with M4 quotes.
9868 (copy_comment): Output characters with copy_character.
9869 (read_additionnal_code): Likewise.
9870 (copy_string2): Likewise.
9871 (copy_definition): Likewise.
9872
9873 * tests/calc.at: Exercise M4 quoting.
9874
34a89c50
AD
98752002-04-25 Akim Demaille <akim@epita.fr>
9876
9877 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
9878 between `!' and the command.
9879 Reported by Paul Eggert.
9880
0dd1580a
RA
98812002-04-24 Robert Anisko <robert@lrde.epita.fr>
9882
9883 * tests/calc.at: Exercise prologue splitting.
9884
9885 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
9886 `b4_post_prologue' instead of `b4_prologue'.
9887
9888 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
9889 muscles.
9890 (output): Free pre_prologue_obstack and post_prologue_obstack.
9891 * src/files.h, src/files.c (attrs_obstack): Remove.
9892 (pre_prologue_obstack, post_prologue_obstack): New.
9893 * src/reader.c (copy_definition): Add a parameter to specify the
9894 obstack to fill, instead of using attrs_obstack unconditionally.
9895 (read_declarations): Pass pre_prologue_obstack to copy_definition if
9896 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
9897
83c1796f
PE
98982002-04-23 Paul Eggert <eggert@twinsun.com>
9899
9900 * data/bison.simple: Remove unnecessary commentary and white
9901 space differences from 1_29-branch.
9902 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
9903
9904 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
9905 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
9906 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
9907 constructors or destructors.
9908
9909 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
9910
1207eeac
AD
99112002-04-23 Akim Demaille <akim@epita.fr>
9912
9913 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
9914 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
9915 location with columns.
9916 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
9917 All reported by Paul Eggert.
9918
78ab8f67
AD
99192002-04-22 Akim Demaille <akim@epita.fr>
9920
9921 * src/reduce.c (dump_grammar): Move to...
9922 * src/gram.h, src/gram.c (grammar_dump): here.
9923 Be sure to separate long item numbers.
9924 Don't read the members of a rule's prec if its nil.
9925
133c20e2
AD
99262002-04-22 Akim Demaille <akim@epita.fr>
9927
9928 * src/output.c (table_size, table_grow): New.
9929 (MAXTABLE): Remove, replace uses with table_size.
9930 (pack_vector): Instead of dying when the table is too big, grow it.
9931
9515e8a7
AD
99322002-04-22 Akim Demaille <akim@epita.fr>
9933
9934 * data/bison.simple (yyr1): Its type is that of a token number.
9935 * data/bison.c++ (r1_): Likewise.
9936 * tests/regression.at (Web2c Actions): Adjust.
9937
23c5a174
AD
99382002-04-22 Akim Demaille <akim@epita.fr>
9939
9940 * src/reader.c (token_translations_init): 256 is now the default
9941 value for the error token, i.e., it will be assigned another
9942 number if the user assigned 256 to one of her tokens.
9943 (reader): Don't force 256 to error.
9944 * doc/bison.texinfo (Symbols): Adjust.
9945 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
9946 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
9947 etc. instead of 10, 20, 30 (which was used to `jump' over error
9948 (256) and undefined (2)).
9949
5fbb0954
AD
99502002-04-22 Akim Demaille <akim@epita.fr>
9951
9952 Propagate more token_number_t.
9953
9954 * src/gram.h (token_number_as_item_number)
9955 (item_number_as_token_number): New.
9956 * src/output.c (GENERATE_OUTPUT_TABLE): New.
9957 Use it to create output_item_number_table and
9958 output_token_number_table.
9959 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
9960 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
9961 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
9962 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
9963
4f940944
AD
99642002-04-22 Akim Demaille <akim@epita.fr>
9965
9966 * src/output.h, src/output.c (get_lines_number): Remove.
9967
3ded9a63
AD
99682002-04-19 Akim Demaille <akim@epita.fr>
9969
9970 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
9971 as Lex/Flex'.
9972 (Debugging): More details about enabling the debugging features.
9973 (Table of Symbols): Describe $$, $n, @$, and @n.
9974 Suggested by Tim Josling.
9975
e0c471a9
AD
99762002-04-19 Akim Demaille <akim@epita.fr>
9977
9978 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
9979
fecc10cd
AD
99802002-04-10 Akim Demaille <akim@epita.fr>
9981
9982 * src/system.h: Rely on HAVE_LIMITS_H.
9983 Suggested by Paul Eggert.
9984
51dec47b
AD
99852002-04-09 Akim Demaille <akim@epita.fr>
9986
9987 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
9988 full stderr, and strip it according to the bison options, instead
9989 of composing the error message from different bits.
9990 This makes it easier to check for several error messages.
9991 Adjust all the invocations.
9992 Add an invocation exercising the error token.
9993 Add an invocation demonstrating a stupid error message.
9994 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
9995 Adjust the tests.
9996 Error message are for stderr, not stdout.
9997
007a50a4
AD
99982002-04-09 Akim Demaille <akim@epita.fr>
9999
10000 * src/gram.h, src/gram.c (error_token_number): Remove, use
10001 errtoken->number.
10002 * src/reader.c (reader): Don't specify the user token number (2)
10003 for $undefined, as it uselessly prevents using it.
10004 * src/gram.h (token_number_t): Move to...
10005 * src/symtab.h: here.
10006 (state_t.number): Is a token_number_t.
10007 * src/print.c, src/reader.c: Use undeftoken->number instead of
10008 hard coded 2.
10009 (Even though this 2 is not the same as above: the number of the
10010 undeftoken remains being 2, it is its user token number which
10011 might not be 2).
10012 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
10013 `user_token_number_max'.
10014 Output `undef_token_number'.
10015 * data/bison.simple, data/bison.c++: Use them.
10016 Be sure to map invalid yylex return values to
10017 `undef_token_number'. This saves us from gratuitous SEGV.
10018
10019 * tests/conflicts.at (Solved SR Conflicts)
10020 (Unresolved SR Conflicts): Adjust.
10021 * tests/regression.at (Web2c Actions): Adjust.
10022
06446ccf
AD
100232002-04-08 Akim Demaille <akim@epita.fr>
10024
10025 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
10026 Adding #line.
10027 Remove the duplicate `typedefs'.
10028 (RhsNumberType): Fix the declaration and various other typos.
10029 Use __ofile__.
10030 * data/bison.simple: Use __ofile__.
10031 * src/scan-skel.l: Handle __ofile__.
10032
62a3e4f0
AD
100332002-04-08 Akim Demaille <akim@epita.fr>
10034
10035 * src/gram.h (item_number_t): New, the type of item numbers in
10036 RITEM. Note that it must be able to code symbol numbers as
10037 positive number, and the negation of rule numbers as negative
10038 numbers.
10039 Adjust all dependencies (pretty many).
10040 * src/reduce.c (rule): Remove this `short *' pointer: use
10041 item_number_t.
10042 * src/system.h (MINSHORT, MAXSHORT): Remove.
10043 Include `limits.h'.
10044 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
10045 (shortcpy): Remove.
10046 (MAXTABLE): Move to...
10047 * src/output.c (MAXTABLE): here.
10048 (prepare_rules): Use output_int_table to output rhs.
10049 * data/bison.simple, data/bison.c++: Adjust.
10050 * tests/torture.at (Big triangle): Move the limit from 254 to
10051 500.
10052 * tests/regression.at (Web2c Actions): Ajust.
10053
10054 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
10055 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
10056 passes, but produces negative #line number, once fixed, GCC is
10057 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
10058 C), it passes.
10059 * src/state.h (state_h): Code input lines on ints, not shorts.
10060
bb88b0fc
AD
100612002-04-08 Akim Demaille <akim@epita.fr>
10062
10063 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
10064 and then the grammar.
10065
9a636f47
AD
100662002-04-08 Akim Demaille <akim@epita.fr>
10067
10068 * src/system.h: No longer using strndup.
10069
680e8701
AD
100702002-04-07 Akim Demaille <akim@epita.fr>
10071
10072 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
10073 * src/output.c (output_table_data): Return the longest number.
10074 (prepare_tokens): Output `token_number_max').
10075 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
10076 New.
10077 Use them to define yy_token_number_type/TokenNumberType.
10078 Use this type for yytranslate.
10079 * tests/torture.at (Big triangle): Push the limit from 124 to
10080 253.
10081 * tests/regression.at (Web2c Actions): Adjust.
10082
817e9f41
AD
100832002-04-07 Akim Demaille <akim@epita.fr>
10084
10085 * tests/torture.at (Big triangle): New.
10086 (GNU AWK Grammar, GNU Cim Grammar): Move to...
10087 * tests/existing.at: here.
10088
5123689b
AD
100892002-04-07 Akim Demaille <akim@epita.fr>
10090
10091 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
10092 nritems.
10093 Adjust dependencies.
10094
f3849179
AD
100952002-04-07 Akim Demaille <akim@epita.fr>
10096
10097 * src/reader.c: Normalize increments to prefix form.
10098
bd02036a
AD
100992002-04-07 Akim Demaille <akim@epita.fr>
10100
10101 * src/reader.c, symtab.c: Remove debugging code.
10102
db8837cb
AD
101032002-04-07 Akim Demaille <akim@epita.fr>
10104
10105 Rename all the `bucket's as `symbol_t'.
10106
10107 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
10108 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
10109 * src/symtab.c, src/symtab.h (bucket): Rename as...
10110 (symbol_t): this.
10111 (symbol_list_new, bucket_check_defined, bucket_make_alias)
10112 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
10113 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
10114 (buckets_new, buckets_free, buckets_do): Rename as...
10115 (symbol_list_new, symbol_check_defined, symbol_make_alias)
10116 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
10117 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
10118 (symbols_new, symbols_free, symbols_do): these.
10119
72a23c97
AD
101202002-04-07 Akim Demaille <akim@epita.fr>
10121
10122 Use lib/hash for the symbol table.
10123
10124 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
10125 EOF.
10126 * src/lex.c (lex): Set the `number' member of new terminals.
10127 * src/reader.c (bucket_check_defined, bucket_make_alias)
10128 (bucket_check_alias_consistence, bucket_translation): New.
10129 (reader, grammar_free, readgram, token_translations_init)
10130 (packsymbols): Adjust.
10131 (reader): Number the predefined tokens.
10132 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
10133 for predefined tokens.
10134 * src/symtab.h (bucket): Remove all the hash table related
10135 members.
10136 * src/symtab.c (symtab): Replace by...
10137 (bucket_table): this.
10138 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
10139 (buckets_new, buckets_do): New.
10140
280a38c3
AD
101412002-04-07 Akim Demaille <akim@epita.fr>
10142
10143 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
10144 (start_symbol, max_user_token_number, semantic_parser)
10145 (error_token_number): Initialize.
10146 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
10147 Initialize.
10148 (reader): Don't.
10149 (errtoken, eoftoken, undeftoken, axiom): Extern.
10150
03b31c0c
AD
101512002-04-07 Akim Demaille <akim@epita.fr>
10152
10153 * src/gram.h (rule_s): prec and precsym are now pointers
10154 to the bucket giving the priority/associativity.
10155 Member `associativity' removed: useless.
10156 * src/reduce.c, src/conflicts.c: Adjust.
10157
8b3df748
AD
101582002-04-07 Akim Demaille <akim@epita.fr>
10159
10160 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
10161 Properly escape the symbols' TAG when outputting them.
10162
e601aa1d
AD
101632002-04-07 Akim Demaille <akim@epita.fr>
10164
10165 * src/lalr.h (LA): Is a bitsetv, not bitset*.
10166
b0299a2e
AD
101672002-04-07 Akim Demaille <akim@epita.fr>
10168
10169 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
10170 (LArule): this, which is an array to rule_t*.
10171 * src/print.c, src/conflicts.c: Adjust.
10172
d7e1f00c
AD
101732002-04-07 Akim Demaille <akim@epita.fr>
10174
10175 * src/gram.h (rule_t): Rename `number' as `user_number'.
10176 `number' is a new member.
10177 Adjust dependencies.
10178 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
10179
cc9305dd
AD
101802002-04-07 Akim Demaille <akim@epita.fr>
10181
10182 As a result of the previous patch, it is no longer needed
10183 to reorder ritem itself.
10184
10185 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
10186
b0940840
AD
101872002-04-07 Akim Demaille <akim@epita.fr>
10188
10189 Be sure never to walk through RITEMS, but use only data related to
10190 the rules themselves. RITEMS should be banished.
10191
10192 * src/output.c (output_token_translations): Rename as...
10193 (prepare_tokens): this.
10194 In addition to `translate', prepare the muscles `tname' and
10195 `toknum', which were handled by...
10196 (output_rule_data): this.
10197 Remove, and move the remainder of its outputs into...
10198 (prepare_rules): this new routines, which also merges content from
10199 (output_gram): this.
10200 (prepare_rules): Be sure never to walk through RITEMS.
10201 (output_stos): Rename as...
10202 (prepare_stos): this.
10203 (output): Always invoke prepare_states, after all, just don't use it
10204 in the output if you don't need it.
10205
643a5994
AD
102062002-04-07 Akim Demaille <akim@epita.fr>
10207
10208 * src/LR0.c (new_state): Display `nstates' as the name of the
10209 newly created state.
10210 Adjust to initialize first_state and last_state if needed.
10211 Be sure to distinguish the initial from the final state.
10212 (new_states): Create the itemset of the initial state, and use
10213 new_state.
10214 * src/closure.c (closure): Now that the initial state has its
10215 items properly set, there is no need for a special case when
10216 creating `ruleset'.
10217
10218 As a result, now the rule 0, reducing to $axiom, is visible in the
10219 outputs. Adjust the test suite.
10220
10221 * tests/conflicts.at (Solved SR Conflicts)
10222 (Unresolved SR Conflicts): Adjust.
10223 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
10224 * tests/conflicts.at (S/R in initial): New.
10225
b4c4ccc2
AD
102262002-04-07 Akim Demaille <akim@epita.fr>
10227
10228 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
10229 the RHS of the rules.
10230 * src/output.c (output_gram): Likewise.
10231
bba97eb2
AD
102322002-04-07 Akim Demaille <akim@epita.fr>
10233
10234 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
10235 bucket.
10236 Adjust all dependencies.
10237 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
10238 `number' of the buckets too.
10239 * src/gram.h: Include `symtab.h'.
10240 (associativity): Move to...
10241 * src/symtab.h: here.
10242 No longer include `gram.h'.
10243
c3b407f4
AD
102442002-04-07 Akim Demaille <akim@epita.fr>
10245
10246 * src/gram.h, src/gram.c (rules_rhs_length): New.
10247 (ritem_longest_rhs): Use it.
10248 * src/gram.h (rule_t): `number' is a new member.
10249 * src/reader.c (packgram): Set it.
10250 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
10251 the end of `rules', and count them out of `nrules'.
10252 (reduce_output, dump_grammar): Adjust.
10253 * src/print.c (print_grammar): It is no longer needed to check for
10254 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
10255 * tests/reduce.at (Reduced Automaton): New test.
10256
11652ab3
AD
102572002-04-07 Akim Demaille <akim@epita.fr>
10258
10259 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
10260 lacking `+ 1' to nrules, Bison reported as useless a token if it
10261 was used solely to set the precedence of the last rule...
10262
26b23c1a
AD
102632002-04-07 Akim Demaille <akim@epita.fr>
10264
10265 * data/bison.c++, data/bison.simple: Don't output the current file
10266 name in #line, to avoid useless diffs between two identical
10267 outputs under different names.
10268
18bcecb0
AD
102692002-04-07 Akim Demaille <akim@epita.fr>
10270
10271 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
10272 Normalize loops to using `< nrules + 1', not `<= nrules'.
10273
fa770c86
AD
102742002-04-07 Akim Demaille <akim@epita.fr>
10275
10276 * TODO: Update.
10277
d9b739c3
AD
102782002-04-07 Akim Demaille <akim@epita.fr>
10279
10280 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
10281 bucket.value as bucket.number.
10282
99013900
AD
102832002-04-07 Akim Demaille <akim@epita.fr>
10284
10285 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
10286 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
10287 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
10288 RHS, instead of being an index in RITEMS.
10289
e966383b
PE
102902002-04-04 Paul Eggert <eggert@twinsun.com>
10291
10292 * doc/bison.texinfo: Update copyright date.
10293 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
10294 (Symbols): Warn about running Bison in one character set,
10295 but compiling and/or running in an incompatible one.
10296 Warn about character code 256, too.
10297
102982002-04-03 Paul Eggert <eggert@twinsun.com>
10299
10300 * src/bison.data (YYSTACK_ALLOC): Depend on whether
10301 YYERROR_VERBOSE is nonzero, not whether it is defined.
10302
10303 Merge changes from bison-1_29-branch.
c307773e 10304
8d6c48b9
PE
103052002-03-20 Paul Eggert <eggert@twinsun.com>
10306
10307 Merge fixes from Debian bison_1.34-1.diff.
10308
10309 * configure.in (AC_PREREQ): 2.53.
10310
e53c6322
AD
103112002-03-20 Akim Demaille <akim@epita.fr>
10312
10313 * src/conflicts.c (log_resolution): Argument `resolution' is const.
10314
9ffbeca7
PE
103152002-03-19 Paul Eggert <eggert@twinsun.com>
10316
21db0b2a
PE
10317 * src/bison.simple (YYCOPY): New macro.
10318 (YYSTACK_RELOCATE): Use it.
10319 Remove Type arg; no longer needed. All callers changed.
10320 (yymemcpy): Remove; no longer needed.
10321
9ffbeca7
PE
10322 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
10323 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
10324
642cb8f8
AD
103252002-03-19 Akim Demaille <akim@epita.fr>
10326
10327 Test and fix the #line outputs.
10328
10329 * tests/atlocal.at (GCC): New.
10330 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 10331 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
10332 (Action synch line, Epilogue synch line): New tests.
10333 * src/reader.c (parse_union_decl): Define the muscle stype_line.
10334 * data/bison.simple, data/bison.c++: Use it.
10335
3c31a486
AD
103362002-03-19 Akim Demaille <akim@epita.fr>
10337
10338 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
10339 (Solved SR Conflicts, %expect not enough, %expect right)
10340 (%expect too much): Move to...
10341 * tests/conflicts.at: this new file.
10342
0d8bed56
AD
103432002-03-19 Akim Demaille <akim@epita.fr>
10344
10345 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
10346 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
10347 that we can move to enums for instance.
10348 * src/output.c (token_definitions_output): Output a list of
10349 `token-name, token-number' instead of the #define.
10350 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
10351
9208d17f
AD
103522002-03-14 Akim Demaille <akim@epita.fr>
10353
10354 Use Gettext 0.11.1.
10355
af27eacb
RA
103562002-03-09 Robert Anisko <robert@lrde.epita.fr>
10357
10358 * data/bison.c++: Make the user able to add members to the generated
10359 parser by subclassing.
10360
9101a310
RA
103612002-03-05 Robert Anisko <robert@lrde.epita.fr>
10362
10363 * src/reader.c (read_additionnal_code): `c' should be an integer, not
10364 a character.
10365 Reported by Nicolas Tisserand and Nicolas Burrus.
10366
fff9bf0b
RA
103672002-03-04 Robert Anisko <robert@lrde.epita.fr>
10368
10369 * src/reader.c: Warn about lacking semi-colons, do not complain.
10370
64dba31e
RA
103712002-03-04 Robert Anisko <robert@lrde.epita.fr>
10372
10373 * data/bison.c++: Remove a debug line.
10374
374f5a14
RA
103752002-03-04 Robert Anisko <robert@lrde.epita.fr>
10376
10377 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
10378 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
10379 provide a default implementation.
10380
bfcf1f3a
AD
103812002-03-04 Akim Demaille <akim@epita.fr>
10382
10383 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
10384 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
10385 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
10386 * tests/semantic.at (Parsing Guards): Similarly.
10387 * src/reader.at (readgram): Complain if the last rule is not ended
10388 with a semi-colon.
10389
65ccf9fc
AD
103902002-03-04 Akim Demaille <akim@epita.fr>
10391
10392 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
10393 * src/closure.c: here.
10394 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
10395 RTC.
10396 * src/warshall.h, src/warshall.c: Remove.
10397 * tests/sets.at (Broken Closure): Adjust.
10398
d0039cbc
AD
103992002-03-04 Akim Demaille <akim@epita.fr>
10400
10401 * src/output.c (output_skeleton): tempdir is const.
10402 bytes_read is unused.
10403
345cea78
AD
104042002-03-04 Akim Demaille <akim@epita.fr>
10405
10406 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
10407 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
10408 Update.
10409 From Michael Hayes.
10410
564801f7
AD
104112002-03-04 Akim Demaille <akim@epita.fr>
10412
10413 * src/closure.c (closure): `r' is unused.
10414
e5352bc7
AD
104152002-03-04 Akim Demaille <akim@epita.fr>
10416
10417 * tests/sets.at (Broken Closure): Add the ending `;'.
10418 * src/reader.at (readgram): Complain if a rule is not ended with a
10419 semi-colon.
10420
914feea9
AD
104212002-03-04 Akim Demaille <akim@epita.fr>
10422
10423 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
10424 (count_sr_conflicts): Use bitset_count.
10425 * src/reduce.c (inaccessable_symbols): Ditto.
10426 (bits_size): Remove.
10427 * src/warshall.h, src/warshall.c: Convert to bitsetv.
10428
f0250de6
AD
104292002-03-04 Akim Demaille <akim@epita.fr>
10430
10431 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
10432 * src/reduce.c: Remove the `bitset_zero's following the
10433 `bitset_create's, as now it is performed by the latter.
10434
ef017502
AD
104352002-03-04 Akim Demaille <akim@epita.fr>
10436
10437 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
10438 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
10439 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
10440 latest sources from Michael.
10441
76514394
AD
104422002-03-04 Akim Demaille <akim@epita.fr>
10443
10444 * src/output.c (output): Don't free the grammar.
10445 * src/reader.c (grammar_free): New.
10446 * src/main.c (main): Call it and don't free symtab here.
10447
55024580
AD
104482002-03-04 Akim Demaille <akim@epita.fr>
10449
10450 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
10451 before returning.
10452 Reported by Benoit Perrot.
10453
f9abaa2c
AD
104542002-03-04 Akim Demaille <akim@epita.fr>
10455
10456 Use bitset operations when possible, not loops over bits.
10457
10458 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
10459 bitset_or.
10460 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
10461 * src/reduce.c (useless_nonterminals): Formatting changes.
10462 * src/warshall.c (TC): Use bitset_or.
10463
0e721e75
AD
104642002-03-04 Akim Demaille <akim@epita.fr>
10465
10466 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
10467 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
10468 Ditto.
10469
0fb1ffb1
AD
104702002-03-04 Akim Demaille <akim@epita.fr>
10471
10472 * src/lalr.c (F): Now a bitset*.
10473 Adjust all dependencies.
10474
b86796bf
AD
104752002-03-04 Akim Demaille <akim@epita.fr>
10476
10477 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
10478 Adjust all dependencies.
10479
602bbf31
AD
104802002-03-04 Akim Demaille <akim@epita.fr>
10481
10482 * src/L0.c, src/LR0.h (nstates): Be size_t.
10483 Adjust comparisons (signed vs unsigned).
10484 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
10485 bitset*.
10486 Adjust all dependencies.
10487
d8a0245c
AD
104882002-03-04 Akim Demaille <akim@epita.fr>
10489
10490 * src/closure.c (firsts): Now, also a bitset.
10491 Adjust all dependencies.
10492 (varsetsize): Remove, now unused.
10493 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
10494
34ba9743
AD
104952002-03-04 Akim Demaille <akim@epita.fr>
10496
10497 * src/print.c: Convert to use bitset.h, not hand coded iterations
10498 over ints.
10499
ed86e78c
AD
105002002-03-04 Akim Demaille <akim@epita.fr>
10501
10502 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
10503
dfdb1797
AD
105042002-03-04 Akim Demaille <akim@epita.fr>
10505
10506 * src/closure.c (ruleset): Be a bitset.
10507 (rulesetsize): Remove.
10508
7086e707
AD
105092002-03-04 Akim Demaille <akim@epita.fr>
10510
10511 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
10512 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
10513 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
10514 * src/closure.c (fderives): Be an array of bitsets.
10515
98254360
RA
105162002-02-28 Robert Anisko <robert@lrde.epita.fr>
10517
10518 * data/bison.c++: Merge the two generated headers. Insert a copyright
10519 notice in each output file.
10520
a75c057f
AD
105212002-02-28 Akim Demaille <akim@epita.fr>
10522
10523 * data/bison.c++: Copy the prologue of bison.simple to fetch
10524 useful M4 definitions, such as b4_header_guard.
10525
06b00abc
AD
105262002-02-25 Akim Demaille <akim@epita.fr>
10527
10528 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
10529 translator friendly scheme for the bgr
10530 copyright notice.
06b00abc 10531
70e7d534
AD
105322002-02-25 Akim Demaille <akim@epita.fr>
10533
10534 * src/output.c (header_output): Remove, now handled completely via
10535 M4.
10536
abe017f6
AD
105372002-02-25 Akim Demaille <akim@epita.fr>
10538
10539 * m4/m4.m4: New, from CVS Autoconf.
10540 * configure.in: Invoke it.
10541 * src/output.c (output_skeleton): Use its result instead of the
10542 hard coded name.
10543
381fb12e
AD
105442002-02-25 Akim Demaille <akim@epita.fr>
10545
10546 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
10547 Fileutils 4.1.5.
10548 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
10549 * src/output.c (output_skeleton): Use mkstemp to create a real
10550 temporary file.
10551 Move the filling of `skeleton' and its muscle to...
10552 (prepare): here.
10553 (output): Move the definition of the prologue muscle to...
10554 (prepare): here.
10555 * src/system.h (DEFAULT_TMPDIR): New.
10556
6f38107f
PE
105572002-02-14 Paul Eggert <eggert@twinsun.com>
10558
10559 Remove the support for C++ namespace cleanliness; it was
10560 causing more problems than it was curing, since it didn't work
10561 properly on some nonstandard C++ compilers. This can wait
10562 for a proper C++ parser.
10563
10564 * NEWS: Document this.
10565 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
10566 of C++, as it's treated like C now.
10567 * src/bison.simple (YYSTD): Remove.
10568 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
10569 Treat C++ just like Standard C instead of trying to support
10570 namespace cleanliness.
10571
80cce3da
AD
105722002-02-14 Akim Demaille <akim@epita.fr>
10573
10574 * tests/regression.at (else): Adjust to Andreas' change.
10575
842e8679
AD
105762002-02-14 Akim Demaille <akim@epita.fr>
10577
10578 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
10579
4bda3f10
AD
105802002-02-13 Andreas Schwab <schwab@suse.de>
10581
10582 * src/output.c (output_rule_data): Don't output NULL, it might
10583 not be defined yet.
10584
4162fa07 105852002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 10586
4162fa07
RA
10587 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
10588 (Copyright notice): Update.
b418ecd8 10589
bd16a5dc
AD
105902002-02-11 Akim Demaille <akim@epita.fr>
10591
10592 * tests/regression.at (%nonassoc and eof): Don't include
10593 nonportable headers.
10594
8d69a1a3
RA
105952002-02-08 Robert Anisko <robert@lrde.epita.fr>
10596
10597 * data/bison.c++: Correct error recovery. Make the user able to
10598 initialize the starting location.
10599
9b2d0677
AD
106002002-02-07 Akim Demaille <akim@epita.fr>
10601
10602 * tests/input.at: New.
10603
69e2658b
RA
106042002-02-07 Robert Anisko <robert@lrde.epita.fr>
10605
10606 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 10607 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
10608 directives around tables only needed for debugging.
10609
4aacc3a7
RA
106102002-02-07 Robert Anisko <robert@lrde.epita.fr>
10611
10612 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
10613 C++ parsers.
10614 (yy::b4_name::parse): Use print_.
10615
762a801e
RA
106162002-02-07 Robert Anisko <robert@lrde.epita.fr>
10617
10618 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
10619
4bb2bc3f
RA
106202002-02-07 Robert Anisko <robert@lrde.epita.fr>
10621
10622 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
10623 C++ parsers.
10624 (yy::b4_name::parse): Build verbose error messages, and use error_.
10625
6b45a3ca
RA
106262002-02-06 Robert Anisko <robert@lrde.epita.fr>
10627
10628 * data/bison.c++: Fix m4 quoting in comments.
10629
50997c6e
RA
106302002-02-06 Robert Anisko <robert@lrde.epita.fr>
10631
10632 * data/bison.c++: Adjust the parser code. Fix some muscles that were
10633 not expanded by m4.
10634
3f3eed27
AD
106352002-02-05 Akim Demaille <akim@epita.fr>
10636
10637 * data/bison.c++: Adjust to the M4 back end.
10638 More is certainly needed.
10639
be2a1a68
AD
106402002-02-05 Akim Demaille <akim@epita.fr>
10641
10642 Give a try to M4 as a back end.
10643
10644 * lib/readpipe.c: New, from wdiff.
10645 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
10646 BISON_HAIRY.
10647 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
10648 specific values. Now it is m4 that performs the lookup.
10649 * src/parse-skel.y: Remove.
10650 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
10651 * src/output.c (actions_output, guards_output)
10652 (token_definitions_output): No longer keeps track of the output
10653 line number, hence remove the second argument.
10654 (guards_output): Check against the guard member of a rule, not the
10655 action member.
10656 Adjust callers.
10657 (output_skeleton): Don't look for the skeleton location, let m4 do
10658 that.
10659 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
10660 file will be used.
10661 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
10662 (prepare): Given that for the time being changesyntax is not
10663 usable in M4, rename the muscles using `-' to `_'.
10664 Define `defines_flag', `output_parser_name' and `output_header_name'.
10665 * src/output.h (actions_output, guards_output)
10666 (token_definitions_output): Adjust prototypes.
10667 * src/scan-skel.l: Instead of scanning the skeletons, it now
10668 processes the output of m4: `__oline__' and `#output'.
10669 * data/bison.simple: Adjust to be used by M4(sugar).
10670 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
10671 to date.
10672 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
10673 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
10674 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
10675 shamelessly stolen from CVS Autoconf.
10676
beda758b
AD
106772002-02-05 Akim Demaille <akim@epita.fr>
10678
10679 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
10680 * configure.in: Check for the declarations of free and malloc.
10681 * src/muscle_tab.c: Adjust.
10682
5ece6d43
AD
106832002-02-05 Akim Demaille <akim@epita.fr>
10684
10685 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
10686 which have no values.
10687
5bb18f9a
AD
106882002-02-05 Akim Demaille <akim@epita.fr>
10689
10690 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
10691 * data/: here.
10692
894dd62e
PE
106932002-01-29 Paul Eggert <eggert@twinsun.com>
10694
10695 * src/bison.simple (YYSIZE_T): Do not define merely because
10696 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
10697 On some platforms, <alloca.h> does not declare YYSTD (size_t).
10698
82841af7
AD
106992002-01-27 Akim Demaille <akim@epita.fr>
10700
10701 Fix `%nonassoc and eof'.
10702
10703 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
10704 which were not properly copied! Replace
10705 memcpy (res->errs, src->errs, src->nerrs);
10706 with
10707 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
10708 !!!
10709 * tests/regression.at (%nonassoc and eof): Adjust to newest
10710 Autotest: `.' is not in the PATH.
10711
318b76e9
AD
107122002-01-27 Akim Demaille <akim@epita.fr>
10713
10714 * tests/sets.at (AT_EXTRACT_SETS): New.
10715 (Nullable): Use it.
10716 (Firsts): New.
10717
30d2f3d5
AD
107182002-01-26 Akim Demaille <akim@epita.fr>
10719
10720 * tests/actions.at, tests/calc.at, tests/headers.at,
10721 * tests/torture.at: Adjust to the newest Autotest which no longer
10722 forces `.' in the PATH.
10723
30f8c395
AD
107242002-01-25 Akim Demaille <akim@epita.fr>
10725
10726 * tests/regression.at (%nonassoc and eof): New.
10727 Suggested by Robert Anisko.
10728
29ae55f1
AD
107292002-01-24 Akim Demaille <akim@epita.fr>
10730
10731 Bison dumps core when trying to complain about broken input files.
10732 Reported by Cris van Pelt.
10733
10734 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
10735 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
10736 into...
10737 (Invalid inputs): Strengthen: exercise parse_percent_token.
10738
2b548aa6
RA
107392002-01-24 Robert Anisko <robert.anisko@epita.fr>
10740
10741 * src/Makefile.am: Add bison.c++.
10742 * src/bison.c++: New skeleton.
10743
bb0146c2
AD
107442002-01-21 Paolo Bonzini <bonzini@gnu.org>
10745
10746 * po/it.po: New.
10747
bec30531
AD
107482002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
10749
10750 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
10751
fc6edc45
MA
107522002-01-20 Marc Autret <marc@gnu.org>
10753
10754 * src/files.c (compute_output_file_names): Fix
10755
5e5d5415
MA
107562002-01-20 Marc Autret <marc@gnu.org>
10757
10758 * tests/output.at: New test.
10759 * src/files.c (compute_base_names): Don't map extensions when
10760 the YACC flag is set, use defaults.
10761 Reported by Evgeny Stambulchik.
10762
44ea3fbd
MA
107632002-01-20 Marc Autret <marc@gnu.org>
10764
ba0fe3c7
PE
10765 * src/system.h: Need to define __attribute__ away for non-GCC
10766 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
10767 Suggested by Albert Chin-A-Young.
10768
338963d1
TVH
107692002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
10770
10771 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
10772 canonical definition.
10773 * src/system.h: Use the canonical definition for PARAMS (avoids
10774 a conflict with the macro from lib/hash.h).
10775
c57b2479
AD
107762002-01-11 Akim Demaille <akim@epita.fr>
10777
10778 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 10779 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 10780
b85810ae
AD
107812002-01-09 Akim Demaille <akim@epita.fr>
10782
10783 * src/files.c, src/files.h (output_infix): New.
10784 (tab_extension): Remove.
10785 (compute_base_names): Compute the former, drop the latter.
10786 * src/output.c (prepare): Insert the muscles `output-infix', and
10787 `output-suffix'.
10788 * src/parse-skel.y (string, string.1): New.
10789 (section.header): Use it.
10790 (section.yacc): Remove.
10791 (prefix): Remove too.
10792 * src/scan-skel.l: Adjust.
10793 * src/bison.simple, src/bison.hairy: Adjust.
10794
cae60122
AD
107952002-01-09 Akim Demaille <akim@epita.fr>
10796
10797 * configure.in (WERROR_CFLAGS): Compute it.
10798 * src/Makefile.am (CFLAGS): Pass it.
10799 * tests/atlocal.in (CFLAGS): Idem.
10800 * src/files.c: Fix a few warnings.
10801 (get_extension_index): Remove, unused.
10802
ae404801
AD
108032002-01-08 Akim Demaille <akim@epita.fr>
10804
10805 * src/getargs.c (AS_FILE_NAME): New.
10806 (getargs): Use it to convert DOSish file names.
10807 * src/files.c (base_name): Rename as full_base_name to avoid
10808 clashes with `base_name ()'.
10809 (filename_split): New.
10810 (compute_base_names): N-th rewrite, using filename_split.
10811
22312b71
AD
108122002-01-08 Akim Demaille <akim@epita.fr>
10813
10814 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
10815 New, stolen from the Fileutils 4.1.
10816 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
10817 * configure.in: Check for the presence of memrchr, and of its
10818 prototype.
10819
a67cef01
TVH
108202002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
10821
10822 * lib/hash.h (__P): Added definition for this macro.
10823 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
10824 BUILT_SOURCES, to ensure they are generated first.
10825 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
10826 %error-verbose to allow bootstrapping with bison 1.30x.
10827
2b25d624
AD
108282002-01-06 Akim Demaille <akim@epita.fr>
10829
10830 * src/reader.c (parse_braces): Don't fetch the next char, the
10831 convention is to fetch on entry.
10832 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
10833 'switch' without a following semicolon.
10834 * tests/regression.at (braces parsing): New.
10835
3460813b
AD
108362002-01-06 Akim Demaille <akim@epita.fr>
10837
10838 Bison is dead wrong in its RR conflict reports.
10839
10840 * tests/torture.at (GNU Cim Grammar): New.
10841 * src/conflicts.c (count_rr_conflicts): Fix.
10842
73784c64
AD
108432002-01-06 Akim Demaille <akim@epita.fr>
10844
10845 Creating package.m4 from configure.ac causes too many problems.
10846
10847 * tests/Makefile.am (package.m4): Create it by hand,
10848 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
10849
25d81090
AD
108502002-01-06 Akim Demaille <akim@epita.fr>
10851
10852 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
10853 skeleton.h.
10854
a9b8959e
PE
108552002-01-04 Paul Eggert <eggert@twinsun.com>
10856
10857 * doc/bison.texinfo (Debugging):
10858 Remove YYSTDERR; it's no longer defined or used.
10859 Also, s/cstdio.h/cstdio/.
10860
25d81090
AD
108612002-01-03 Akim Demaille <akim@epita.fr>
10862
10863 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
10864
1109455c
AD
108652002-01-03 Akim Demaille <akim@epita.fr>
10866
10867 * src/parse-skel.y (process_skeleton): Don't bind the parser's
10868 tracing code to --trace, wait for a better --trace option, with
10869 args.
10870
7ea5e977
AD
108712002-01-03 Akim Demaille <akim@epita.fr>
10872
10873 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
10874 The ISO C++ standard is extremely clear about it: stderr is
10875 considered a macro, not a regular symbol (see table 94 `Header
10876 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
10877 Therefore std:: does not apply to it. It still does with fprintf.
10878 Also, s/cstdio.h/cstdio/.
10879
fab5b110
AD
108802002-01-03 Akim Demaille <akim@epita.fr>
10881
10882 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
10883 for non system headers.
10884
aed7fd9b
AD
108852002-01-02 Akim Demaille <akim@epita.fr>
10886
10887 Equip the skeleton chain with location tracking, runtime trace,
10888 pure parser and scanner.
10889
10890 * src/parse-skel.y: Request a pure parser, locations, and prefix
10891 renaming.
10892 (%union): Having several members with the same type does not help
10893 type mismatches, simplify.
10894 (YYPRINT, yyprint): New.
10895 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
10896 (skel_error): this.
10897 Handle locations.
10898 * src/scan-skel.l: Adjust to these changes.
10899 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
10900 (LOCATION_PRINT, skel_control_t): New.
10901
24fad99e
AD
109022001-12-30 Akim Demaille <akim@epita.fr>
10903
10904 * src/parse-skel.y: Get rid of the shift/reduce conflict:
10905 replace `gb' with BLANKS.
10906 * src/scan-skel.l: Adjust.
10907
a4b36db4
AD
109082001-12-30 Akim Demaille <akim@epita.fr>
10909
10910 * src/system.h: We don't need nor want bcopy.
10911 Throw away MS-DOS crap: we don't need getpid.
10912 * configure.in: We don't need strndup. It was even causing
10913 problems: because Flex includes the headers *before* us,
10914 _GNU_SOURCE is not defined by config.h, and therefore strndup was
10915 not visible.
10916 * lib/xstrndup.c: New.
10917 * src/scan-skel.l: Use it.
10918 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
10919 * src/parse-skel.y: Use %directives instead of #defines.
10920
1239777d
AD
109212001-12-30 Akim Demaille <akim@epita.fr>
10922
10923 * src/skeleton.h: New.
10924 * src/output.c (output_parser, output_master_parser): Remove, dead
10925 code.
10926 * src/output.h (get_lines_number, actions_output, guards_output)
10927 (token_definitions_output): Prototype them.
10928 * src/parse-skel.y: Add the license notice.
10929 Include output.h and skeleton.h.
10930 (process_skeleton): Returns void, and takes a single parameter.
10931 * src/scan-skel.l: Add the license notice.
10932 Include skeleton.h.
10933 Don't use %option yylineno: it seems that then Flex imagines
10934 REJECT has been used, and therefore it won't reallocate its
10935 buffers (which makes no other sense to me than a bug). It results
10936 in warnings for `unused: yy_flex_realloc'.
10937
9b3add5b
RA
109382001-12-30 Robert Anisko <robert.anisko@epita.fr>
10939
10940 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
10941 (MUSCLE_INSERT_PREFIX): ...to there.
10942 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
10943 (MUSCLE_INSERT_PREFIX): Move from here...
10944
10945 * src/bison.hairy: Add a section directive. Put braces around muscle
10946 names. This parser skeleton is still broken, but Bison should not
10947 choke on a bad muscle 'syntax'.
10948 * src/bison.simple: Add a section directive. Put braces around muscle
10949 names.
10950
10951 * src/files.h (strsuffix, stringappend): Add declarations.
10952 (tab_extension): Add declaration.
10953 (short_base_name): Add declaration.
10954
10955 * src/files.c (strsuffix, stringappend): No longer static. These
10956 functions are used in the skeleton parser.
10957 (tab_extension): New.
10958 (compute_base_names): Use the computations done in this function
fab5b110 10959 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
10960 names.
10961 (short_base_name): No longer static.
10962
10963 * src/output.c (output_skeleton): New.
10964 (output): Disable call to output_master_parser, and give a try to
10965 a new skeleton handling system.
10966 (guards_output, actions_output): No longer static.
10967 (token_definitions_output, get_lines_number): No longer static.
10968
10969 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
10970
fab5b110 10971 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
10972 parse-skel.y.
10973
10974 * src/parse-skel.y: New file.
10975 * src/scan-skel.l: New file.
10976
b5b61c61
AD
109772001-12-29 Akim Demaille <akim@epita.fr>
10978
10979 %name-prefix is broken.
10980
10981 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
10982 Adjust all dependencies.
10983 * tests/headers.at (export YYLTYPE): Strengthen this test: use
10984 %name-prefix.
10985
10986 Renaming yylval but not yylloc is not consistent. Now we do.
10987
10988 * src/bison.simple: Prefix yylloc if used.
10989 * doc/bison.texinfo (Decl Summary): Document that.
10990
8c9a50be
AD
109912001-12-29 Akim Demaille <akim@epita.fr>
10992
10993 * doc/bison.texinfo: Promote `%long-directive' over
10994 `%long_directive'.
10995 Remove all references to fixed-output-files, yacc is enough.
10996
d99361e6
AD
109972001-12-29 Akim Demaille <akim@epita.fr>
10998
10999 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
11000 user prologue. These are defaults.
11001 * tests/actions.at (Mid-rule actions): Make sure the user can
11002 define YYDEBUG and YYERROR_VERBOSE.
11003
b9cecb91
AD
110042001-12-29 Akim Demaille <akim@epita.fr>
11005
11006 * src/output.c (header_output): Don't forget to export YYLTYPE and
11007 yylloc.
11008 * tests/headers.at (export YYLTYPE): New, make sure it does.
11009 * tests/regression.at (%union and --defines, Invalid CPP headers):
11010 Move to...
11011 * tests/headers.at: here.
11012
aea13e97
AD
110132001-12-29 Akim Demaille <akim@epita.fr>
11014
11015 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
11016
931394cb
AD
110172001-12-29 Akim Demaille <akim@epita.fr>
11018
11019 * tests/actions.at (Mid-rule actions): Output on a single line
11020 instead of several.
11021
704a47c4
AD
110222001-12-29 Akim Demaille <akim@epita.fr>
11023
11024 * doc/bison.texinfo: Formatting changes.
11025
091e20bb
AD
110262001-12-29 Akim Demaille <akim@epita.fr>
11027
11028 Don't store the token defs in a muscle, just be ready to output it
11029 on command. Now possible via `symbols'. Fixes a memory leak.
11030
11031 * src/output.c (token_definitions_output): New.
11032 (output_parser, header_output): Use it.
11033 * src/reader.c (symbols_save): Remove.
11034
cce71710
AD
110352001-12-29 Akim Demaille <akim@epita.fr>
11036
11037 * src/bison.simple: Do not provide a default for YYSTYPE and
11038 YYLTYPE before the user's prologue. Otherwise it's hardly... a
11039 default.
11040
82c035a8
AD
110412001-12-29 Akim Demaille <akim@epita.fr>
11042
11043 Mid-rule actions are simply... ignored!
11044
11045 * src/reader.c (readgram): Be sure to attach mid-rule actions to
11046 the empty-rule associated to the dummy symbol, not to the host
11047 rule.
11048 * tests/actions.at (Mid-rule actions): New.
11049
8419d367
AD
110502001-12-29 Akim Demaille <akim@epita.fr>
11051
11052 Memory leak.
11053
11054 * src/reader.c (reader): Free grammar.
11055
375d5806
AD
110562001-12-29 Akim Demaille <akim@epita.fr>
11057
11058 Memory leak.
11059
11060 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
11061 since it allocates it for each state, although only one is needed.
11062 (allocate_storage): Do it here.
11063
f51cb8ff
AD
110642001-12-29 Akim Demaille <akim@epita.fr>
11065
11066 * src/options.h, src/options.c (create_long_option_table): Rename
11067 as...
11068 (long_option_table_new): this, with a clearer prototype.
11069 (percent_table): Remove, unused,
11070 * src/getargs.c (getargs): Adjust.
11071
29e88316
AD
110722001-12-29 Akim Demaille <akim@epita.fr>
11073
11074 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
11075 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
11076 as states.
11077
b9f71f19
AD
110782001-12-29 Akim Demaille <akim@epita.fr>
11079
11080 * src/lalr.c (build_relations): Rename `states' as `states1'.
11081 Sorry, I don't understand exactly what it is, no better name...
11082
1a2b5d37
AD
110832001-12-29 Akim Demaille <akim@epita.fr>
11084
11085 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
11086 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
11087 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
11088 as rules.
11089
1cca533e
AD
110902001-12-29 Akim Demaille <akim@epita.fr>
11091
11092 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
11093 ago.
11094
c03ae966
AD
110952001-12-29 Akim Demaille <akim@epita.fr>
11096
11097 * src/reader.c, src/reader.h (user_toknums): Remove.
11098 Adjust all users to use symbols[i]->user_token_number.
11099
5a670b1e
AD
111002001-12-29 Akim Demaille <akim@epita.fr>
11101
11102 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
11103 Adjust all users to use symbols[i]->prec or ->assoc.
11104
ad949da9
AD
111052001-12-29 Akim Demaille <akim@epita.fr>
11106
11107 * src/reader.c, src/reader.h (tags): Remove.
11108 Adjust all users to use symbols[i]->tag.
11109
0e78e603
AD
111102001-12-29 Akim Demaille <akim@epita.fr>
11111
11112 * src/gram.h, src/gram.c (symbols): New, similar to state_table
11113 and rule_table.
11114 * src/reader.c (packsymbols): Fill this table.
11115 Drop sprec.
11116 * src/conflicts.c (resolve_sr_conflict): Adjust.
11117 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
11118 single table.
11119 Use symbols[i]->tag instead of tags[i].
11120
213e640e
AD
111212001-12-29 Akim Demaille <akim@epita.fr>
11122
11123 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
11124 In addition, put a comment in there, to replace...
11125 * tests/regression.at (%union and C comments): Remove.
11126
e7b8bef1
AD
111272001-12-29 Akim Demaille <akim@epita.fr>
11128
11129 * tests/regression.at (Web2c Actions): Blindly move the actual
11130 output as expected output. The contents *seem* right to me, but I
11131 can't pretend reading perfectly parser tables... Nonetheless, all
11132 the other tests pass correctly, the table look OK, even though the
11133 presence of `$axiom' is to be noted: AFAICS it is useless (but
11134 harmless).
11135
b68e7744
AD
111362001-12-29 Akim Demaille <akim@epita.fr>
11137
11138 * src/reader.c (readgram): Don't add the rule 0 if there were no
11139 rules read. In other words, add it _after_ having performed
11140 grammar sanity checks.
11141 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
11142
78d5bae9
AD
111432001-12-29 Akim Demaille <akim@epita.fr>
11144
11145 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
11146 visible, and some states have now a different number.
11147
ff442794
AD
111482001-12-29 Akim Demaille <akim@epita.fr>
11149
11150 * src/reader.c (readgram): Bind the initial rule's lineno to that
11151 of the first rule.
11152 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
11153 (Solved SR Conflicts): Adjust rule 0's line number.
11154
610ab194
AD
111552001-12-29 Akim Demaille <akim@epita.fr>
11156
11157 Fix the `GAWK Grammar' failure.
11158
11159 * src/LR0.c (final_state): Initialize to -1 so that we do compute
11160 the reductions of the first state which was mistakenly confused
11161 with the final state because precisely final_state was initialized
11162 to 0.
11163 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
11164 now noticed by Bison.
11165 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
11166 have a reduction on $default.
11167
29d29c8f
AD
111682001-12-29 Akim Demaille <akim@epita.fr>
11169
11170 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
11171 rule line numbers.
11172 * src/closure.c (print_closure): Likewise.
11173 * src/derives.c (print_derives): Likewise.
11174 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
11175 now.
11176
7c6b64d0
AD
111772001-12-29 Akim Demaille <akim@epita.fr>
11178
11179 * src/lalr.c (lookaheads_print): New.
11180 (lalr): Call it when --trace-flag.
11181 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
11182 are dumped.
11183
3d4daee3
AD
111842001-12-29 Akim Demaille <akim@epita.fr>
11185
11186 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
11187 when walking through ritem, even via rule->rhs.
11188 * src/reduce.c (dump_grammar, useful_production, reduce_output)
11189 (useful_production, useless_nonterminals): Likewise.
11190 (reduce_grammar_tables): Likewise, plus update nritems.
11191 * src/nullable.c (set_nullable): Likewise.
11192 * src/lalr.c (build_relations): Likewise.
11193 * tests/sets.at (Nullable): Adjust.
11194 Fortunately, now, the $axiom is no longer nullable.
11195
9e7f6bbd
AD
111962001-12-29 Akim Demaille <akim@epita.fr>
11197
11198 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
11199 the 0-sentinel.
11200 * src/gram.c (ritem_longest_rhs): Likewise.
11201 * src/reduce.c (nonterminals_reduce): Likewise.
11202 * src/print_graph.c (print_graph): Likewise.
11203 * src/output.c (output_rule_data): Likewise.
11204 * src/nullable.c (set_nullable): Likewise.
11205
255ef638
AD
112062001-12-29 Akim Demaille <akim@epita.fr>
11207
11208 * src/output.c: Comment changes.
11209
0d8a7363
AD
112102001-12-27 Paul Eggert <eggert@twinsun.com>
11211
11212 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
11213 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
11214 Sparc, as they were causing more porting problems than the
11215 (minor) performance improvement was worth.
11216
11217 Also, catch up with 1.31's YYSTD.
11218
3db472b9
AD
112192001-12-27 Akim Demaille <akim@epita.fr>
11220
11221 * src/output.c (output_gram): Rely on nritems, not the
11222 0-sentinel. See below.
11223 Use -1 as separator, not 0.
11224 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
11225 Rely on -1 as separator in yyrhs, instead of 0.
11226 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
11227 twice `Now at end of input', therefore there are two lines less to
11228 expect.
11229
b365aa05
AD
112302001-12-27 Akim Demaille <akim@epita.fr>
11231
11232 * tests/regression.at (Unresolved SR Conflicts):
11233 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
11234 below.
11235
30171f79
AD
112362001-12-27 Akim Demaille <akim@epita.fr>
11237
11238 * src/LR0.c (new_state): Recognize the final state by the fact it
11239 is reached by eoftoken.
11240 (insert_start_shifting_state, insert_eof_shifting_state)
11241 (insert_accepting_state, augment_automaton): Remove, since now
11242 these states are automatically computed from the initial state.
11243 (generate_states): Adjust.
11244 * src/print.c: When reporting a rule number to the user, substract
11245 1, so that the axiom rule is rule 0, and the first user rule is 1.
11246 * src/reduce.c: Likewise.
11247 * src/print_graph.c (print_core): For the time being, just as for
11248 the report, depend upon --trace-flags to dump the full set of
11249 items.
11250 * src/reader.c (readgram): Once the grammar read, insert the rule
11251 0: `$axiom: START-SYMBOL $'.
11252 * tests/set.at: Adjust: rule 0 is now displayed, and since the
11253 number of the states has changed (the final state is no longer
11254 necessarily the last), catch up.
11255
75142d45
AD
112562001-12-27 Akim Demaille <akim@epita.fr>
11257
11258 Try to make the use of the eoftoken valid. Given that its value
11259 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
11260 is used instead of > 0 where appropriate, (ii), depend upon nritems
11261 instead of the 0-sentinel.
11262
11263 * src/gram.h, src/gram.c (nritems): New.
11264 Expected to be duplication of nitems, but for the time being...
11265 * src/reader.c (packgram): Assert nritems and nitems are equal.
11266 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
11267 * src/closure.c (print_closure, print_fderives): Likewise.
11268 * src/gram.c (ritem_print): Likewise.
11269 * src/print.c (print_core, print_grammar): Likewise.
11270 * src/print_graph.c: Likewise.
11271
b7c49edf
AD
112722001-12-27 Akim Demaille <akim@epita.fr>
11273
11274 * src/main.c (main): If there are complains after grammar
11275 reductions, then output the report anyway if requested, then die.
11276 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
11277 * src/reader.c (eoftoken): New.
11278 (parse_token_decl): If the token being defined has value `0', it
11279 is the eoftoken.
11280 (packsymbols): No longer hack `tags' to insert `$' by hand.
11281 Be sure to preserve the value of the eoftoken.
11282 (reader): Make sure eoftoken is defined.
11283 Initialize nsyms to 0: now eoftoken is created just like the others.
11284 * src/print.c (print_grammar): Don't special case the eof token.
11285 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
11286 lie anyway, albeit pleasant.
11287 * tests/calc.at: Exercise error messages with eoftoken.
11288 Change the grammar so that empty input is invalid.
11289 Adjust expectations.
11290 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
11291
ec2da99f
AD
112922001-12-27 Akim Demaille <akim@epita.fr>
11293
11294 * configure.in: Check the protos of strchr ans strspn.
11295 Replace strchr if needed.
11296 * src/system.h: Provide the protos of strchr, strspn and memchr if
11297 missing.
11298 * lib/strchr.c: New.
11299 * src/reader.c (symbols_save): Use strchr.
11300
8adfa272
AD
113012001-12-27 Akim Demaille <akim@epita.fr>
11302
11303 * src/print.c, src/print_graph.c (escape): New.
11304 Use it to quote the TAGS outputs.
11305 * src/print_graph.c (print_state): Now errors are in red, and
11306 reductions in green.
11307 Prefer high to wide: output the state number on a line of its own.
11308
80dac38c
AD
113092001-12-27 Akim Demaille <akim@epita.fr>
11310
11311 * src/state.h, src/state.c (reductions_new): New.
11312 * src/LR0.c (set_state_table): Let all the states have a
11313 `reductions', even if reduced to 0.
11314 (save_reductions): Adjust.
11315 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
11316 * src/print.c (print_reductions, print_actions): Adjust.
11317 * src/output.c (action_row): Adjust.
11318
2cec70b9
AD
113192001-12-27 Akim Demaille <akim@epita.fr>
11320
11321 * src/state.h, src/state.c (errs_new, errs_dup): New.
11322 * src/LR0.c (set_state_table): Let all the states have an errs,
11323 even if reduced to 0.
11324 * src/print.c (print_errs, print_reductions): Adjust.
11325 * src/output.c (output_actions, action_row): Adjust.
11326 * src/conflicts.c (resolve_sr_conflict): Adjust.
11327
13ca549a
AD
113282001-12-27 Akim Demaille <akim@epita.fr>
11329
11330 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
11331
5092aba5
AD
113322001-12-27 Akim Demaille <akim@epita.fr>
11333
11334 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
11335 * src/print.c: here.
11336 (lookaheadset, shiftset): New, used as additional storage by
11337 print_reductions.
11338 (print_results): Adjust.
11339 (print_shifts, print_gotos, print_errs): New, extracted from...
11340 (print_actions): here.
11341 * src/print_graph.c (print_actions): Remove dead code.
11342
11e2beca
AD
113432001-12-27 Akim Demaille <akim@epita.fr>
11344
11345 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
11346 `$n' and `@n'.
11347
dac3c910
AD
113482001-12-27 Akim Demaille <akim@epita.fr>
11349
11350 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
11351 (build_relations): Adjust.
11352
d0b0fefa
AD
113532001-12-27 Akim Demaille <akim@epita.fr>
11354
11355 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
11356 duplication.
11357
adc8c848
AD
113582001-12-27 Akim Demaille <akim@epita.fr>
11359
11360 * src/reader.c (packgram): Catch nitems overflows.
11361
14d293ac
AD
113622001-12-27 Akim Demaille <akim@epita.fr>
11363
11364 * src/files.c, src/files.h (guard_obstack): Remove.
11365 * src/output.c (output): Adjust.
11366 * src/reader.c (parse_braces): New, factoring...
11367 (copy_action, copy_guard): these two which are renamed as...
11368 (parse_action, parse_guard): these.
11369 As a voluntary consequence, using braces around guards is now
11370 mandatory.
11371
f499b062
AD
113722001-12-27 Akim Demaille <akim@epita.fr>
11373
11374 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
11375 * src/reader.c (symbol_list): `guard' and `guard_line' are new
11376 members.
11377 (symbol_list_new): Adjust.
11378 (copy_action): action_line is the first line, not the last.
11379 (copy_guard): Just as for actions, store the `action' only, not
11380 the switch/case/break flesh.
11381 Don't parse the user action that might follow the guard, let...
11382 (readgram): do it, i.e., now, there can be an action after a
11383 guard.
11384 In other words the guard is just explicitly optional.
11385 (packgram): Adjust.
11386 * src/output.c (guards_output): New.
11387 (output_parser): Call it when needed.
11388 (output): Also free the guard and attrs obstacks.
11389 * src/files.c, src/files.h (obstack_save): Remove.
11390 (output_files): Remove.
11391 As a result, if one needs the former `.act' file, using an
11392 appropriate skeleton which requires actions and guards is now
11393 required.
11394 * src/main.c (main): Adjust.
11395 * tests/semantic.at: New.
11396 * tests/regression.at: Use `input.y' as input file name.
11397 Avoid 8+3 problems by requiring input.c when the test needs the
11398 parser.
11399
d945f5cd
AD
114002001-12-27 Akim Demaille <akim@epita.fr>
11401
11402 * src/reader.c (symbol_list_new): Be sure to initialize all the
11403 fields.
11404
d200e455
AD
114052001-12-27 Akim Demaille <akim@epita.fr>
11406
11407 All the hacks using a final pseudo state are now useless.
11408
11409 * src/LR0.c (set_state_table): state_table holds exactly nstates.
11410 * src/lalr.c (nLA): New.
11411 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
11412 instead of lookaheadsp from the pseudo state (nstate + 1).
11413
f9507c28
AD
114142001-12-27 Akim Demaille <akim@epita.fr>
11415
11416 * src/output.c (action_row, token_actions): Use a state_t instead
11417 of a integer, and nlookaheads instead of the following state's
11418 lookaheadsp.
11419
065fbd27
AD
114202001-12-27 Akim Demaille <akim@epita.fr>
11421
11422 * src/conflicts.c (log_resolution, flush_shift)
11423 (resolve_sr_conflict, set_conflicts, solve_conflicts)
11424 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
11425 (conflicts_print, print_reductions): Use a state_t instead of an
11426 integer when referring to a state.
11427 As much as possible, depend upon nlookaheads, instead of the
11428 `lookaheadsp' member of the following state (since lookaheads of
11429 successive states are successive, the difference between state n + 1
11430 and n served as the number of lookaheads for state n).
11431 * src/lalr.c (add_lookback_edge): Likewise.
11432 * src/print.c (print_core, print_actions, print_state)
11433 (print_results): Likewise.
11434 * src/print_graph.c (print_core, print_actions, print_state)
11435 (print_graph): Likewise.
11436 * src/conflicts.h: Adjust.
11437
1b177bd7
AD
114382001-12-27 Akim Demaille <akim@epita.fr>
11439
11440 * src/bison.hairy: Formatting/comment changes.
11441 ANSIfy.
11442 Remove `register' indications.
11443 Add plenty of `static'.
11444
7742ddeb
AD
114452001-12-27 Akim Demaille <akim@epita.fr>
11446
11447 * src/output.c (prepare): Drop the muscle `ntbase' which
11448 duplicates ntokens.
11449 * src/bison.simple: Formatting/comment changes.
11450 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
11451 is an undocumented synonym.
11452
1fa14068
AD
114532001-12-22 Akim Demaille <akim@epita.fr>
11454
11455 * src/output.c (output_table_data): Change the prototype to use
11456 `int' for array ranges: some invocations do pass an int, not a
11457 short.
11458 Reported by Wayne Green.
11459
b9752825
AD
114602001-12-22 Akim Demaille <akim@epita.fr>
11461
11462 Some actions of web2c.y are improperly triggered.
11463 Reported by Mike Castle.
11464
11465 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
11466 * tests/regression.at (Web2c): Rename as...
11467 (Web2c Report): this.
11468 (Web2c Actions): New.
11469
776209d6
AD
114702001-12-22 Akim Demaille <akim@epita.fr>
11471
11472 Reductions in web2c.y are improperly reported.
11473 Reported by Mike Castle.
11474
11475 * src/conflicts.c (print_reductions): Fix.
11476 * tests/regression.at (Web2c): New.
11477
275fc3ad
AD
114782001-12-18 Akim Demaille <akim@epita.fr>
11479
11480 Some host fail on `assert (!"foo")', which expands to
11481 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
11482 Reported by Nelson Beebee.
11483
11484 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
11485 `#define it_succeeded 0' and `assert (it_succeeded)'.
11486
897668ee
MA
114872001-12-17 Marc Autret <autret_m@epita.fr>
11488
11489 * src/bison.simple: Don't hard code the skeleton line and filename.
11490 * src/output.c (output_parser): Rename 'line' as 'output_line'.
11491 New line counter 'skeleton_line' (skeleton-line muscle).
11492
ab3399e0
PE
114932001-12-17 Paul Eggert <eggert@twinsun.com>
11494
11495 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
11496 YYDEBUG must be defined to a nonzero value.
11497
11498 * src/bison.simple (yytname): Do not assume that the user defines
11499 YYDEBUG to a properly parenthesized expression.
11500
3877f72b
AD
115012001-12-17 Akim Demaille <akim@epita.fr>
11502
11503 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
11504 nlookaheads is a new member.
11505 Adjust all users.
11506 * src/lalr.h (nlookaheads): Remove this orphan declaration.
11507 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
11508 state.
776209d6 11509
331dbc1b
AD
115102001-12-17 Akim Demaille <akim@epita.fr>
11511
11512 * src/files.h, src/files.c (open_files, close_files): Remove.
11513 * src/main.c (main): Don't open/close files, nor invoke lex_free,
11514 let...
11515 * src/reader.c (reader): Do it.
776209d6 11516
be750e4c
AD
115172001-12-17 Akim Demaille <akim@epita.fr>
11518
11519 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 11520
709ae8c6
AD
115212001-12-17 Akim Demaille <akim@epita.fr>
11522
11523 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
11524 (flush_reduce): New.
11525 (resolve_sr_conflict): Adjust.
776209d6 11526
f87685c3
AD
115272001-12-17 Akim Demaille <akim@epita.fr>
11528
11529 * src/output.c (output_obstack): Be static and rename as...
11530 (format_obstack): this, to avoid any confusion with files.c's
11531 output_obstack.
11532 * src/reader.h (muscle_obstack): Move to...
11533 * src/output.h: here, since it's defined in output.c.
11534
837491d8
AD
115352001-12-17 Akim Demaille <akim@epita.fr>
11536
11537 * src/output.c (action_row, save_column, default_goto)
11538 (sort_actions, matching_state, pack_vector): Better variable
11539 locality.
11540
796d61fb
AD
115412001-12-17 Akim Demaille <akim@epita.fr>
11542
11543 * src/output.c: Various formatting changes.
776209d6 11544
64d15509
AD
115452001-12-17 Akim Demaille <akim@epita.fr>
11546
11547 * src/files.c (output_files): Free the output_obstack.
11548 * src/main.c (main): Call print and print_graph conditionally.
11549 * src/print.c (print): Work unconditionally.
11550 * src/print_graph.c (print_graph): Work unconditionally.
11551 * src/conflicts.c (log_resolution): Output only if verbose_flag.
11552
fbc8ecb7
MA
115532001-12-16 Marc Autret <autret_m@epita.fr>
11554
11555 * src/output.c (actions_output): Fix. When we use %no-lines,
11556 there is one less line per action.
11557
f0440388
MA
115582001-12-16 Marc Autret <autret_m@epita.fr>
11559
11560 * src/bison.simple: Remove a useless #line directive.
11561 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
11562 * src/output.c (get_lines_number): New.
776209d6 11563 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
11564 output muscles.
11565 Fix line numbering.
11566 (actions_output): Computes the number of lines taken by actions.
11567 (output_master_parser): Insert new skeleton which is the name of
11568 the output parser file name.
11569
a79986b8
MA
115702001-12-15 Marc Autret <autret_m@epita.fr>
11571
11572 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
11573
4ec8e00f
MA
115742001-12-15 Marc Autret <autret_m@epita.fr>
11575
11576 * src/output.c (output_gram): Keep track of the hairy one.
11577
1a4648ff
AD
115782001-12-15 Akim Demaille <akim@epita.fr>
11579
11580 Make `make distcheck' work.
11581
11582 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
11583 system.h which uses libgettext.h.
11584
9c2c67e6
AD
115852001-12-15 Akim Demaille <akim@epita.fr>
11586
11587 * src/nullable.c (set_nullable): Useless rules must be skipped,
11588 otherwise, since we range over their symbols, we might look at a
11589 nonterminal which no longer ``exists'', i.e., it is not counted in
11590 `nvars', hence we overflow our arrays.
11591
93ede233
AD
115922001-12-15 Akim Demaille <akim@epita.fr>
11593
11594 The header can also be produced directly, without any obstack!
11595 Yahoo!
11596
11597 * src/files.c, src/files.h (defines_obstack): Remove.
11598 (compute_header_macro): Global.
11599 (defines_obstack_save): Remove.
11600 * src/reader.c (parse_union_decl): No longer output to
11601 defines_obstack: its content can be found in the `stype' muscle
11602 anyway.
11603 (output_token_translations): Merge into...
11604 (symbols_output): this.
11605 Rename as...
11606 (symbols_save): this.
11607 (reader): Adjust.
11608 * src/output.c (header_output): New.
11609 (output): Call it.
11610
2666f928
AD
116112001-12-15 Akim Demaille <akim@epita.fr>
11612
11613 * src/reader.c (parse_union_decl): Instead of handling two obstack
11614 simultaneously, use one to define the `stype' muscle, and use the
11615 value of the latter to fill defines_obstack.
11616 (copy_comment): Remove.
11617 (copy_comment2): Work for a single obstack.
11618 Rename as...
11619 (copy_comment): this.
11620
428046f8
AD
116212001-12-15 Akim Demaille <akim@epita.fr>
11622
11623 * src/lex.c, src/lex.h (xgetc): No longer static.
11624 * src/reader.c (parse_union_decl): Revamp.
11625
ea52d706
AD
116262001-12-15 Akim Demaille <akim@epita.fr>
11627
11628 Still making progress in separating Bison into (i) input, (ii)
11629 process, (iii) output: now we can directly output the parser file
11630 without using table_obstack at all.
11631
11632 * src/files.c, src/files.h (table_obstack): Bye bye.
11633 (parser_file_name): New.
11634 * src/files.c (compute_output_file_names): Compute it.
11635 * src/output.c (actions_output, output_parser)
11636 (output_master_parser): To a file instead of an obstack.
11637
3f96f4dc
AD
116382001-12-15 Akim Demaille <akim@epita.fr>
11639
11640 Attach actions to rules, instead of pre-outputting them to
11641 actions_obstack.
11642
11643 * src/gram.h (rule_t): action and action_line are new members.
11644 * src/reader.c (symbol_list): Likewise.
11645 (copy_action): Save the actions within the rule.
11646 (packgram): Save them in rule_table.
11647 * src/output.c (actions_output): New.
11648 (output_parser): Use it on `%%actions'.
11649 (output_rule_data): Don't free rule_table.
11650 (output): Do it.
11651 (prepare): Don't save the `action' muscle.
11652 * src/bison.simple: s/%%action/%%actions/.
11653
51576fb3
AD
116542001-12-15 Akim Demaille <akim@epita.fr>
11655
11656 * src/reader.c (copy_action): When --yacc, don't append a `;'
11657 to the user action: let it fail if lacking.
dee049eb 11658 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 11659
2648a72d
AD
116602001-12-14 Akim Demaille <akim@epita.fr>
11661
11662 * src/lex.c (literalchar): Simply return the char you decoded, non
11663 longer mess around with obstacks and int pointers.
11664 Adjust all callers.
11665
92790e5b
AD
116662001-12-14 Akim Demaille <akim@epita.fr>
11667
11668 * src/lex.c (literalchar): Don't escape the special characters,
11669 just decode them, and keep them as char (before, eol was output as
11670 the 2 char string `\n' etc.).
11671 * src/output.c (output_rule_data): Use quotearg to output the
11672 token strings.
11673
927c1557
PE
116742001-12-13 Paul Eggert <eggert@twinsun.com>
11675
11676 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
11677 Do not infringe on the global user namespace when using C++.
11678 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
11679 All uses of `fprintf' and `stderr' changed.
11680
11681 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
11682
ed8e1f68
AD
116832001-12-13 Akim Demaille <akim@epita.fr>
11684
11685 The computation of nullable is broken: it doesn't handle empty
11686 RHS's properly.
11687
11688 * tests/torture.at (GNU AWK Grammar): New.
11689 * tests/sets.at (Nullable): New.
11690 * src/nullable.c (set_nullable): Instead of blindly looping over
11691 `ritems', loop over the rules, and then over their rhs's.
11692
11693 Work around Autotest bugs.
11694
11695 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
11696 frame, because Autotest understand lines starting with a `+' as
11697 traces from the shell. Then, they are not processed properly.
11698 Admittedly an Autotest bug, but we don't have time to wait for
11699 Autotest to catch up.
11700 * tests/regression.at (Broken Closure): Adjust to the new table
11701 frames.
11702 Move to...
11703 * tests/sets.at: here.
11704
cb581495
AD
117052001-12-13 Akim Demaille <akim@epita.fr>
11706
11707 * src/closure.c (closure): Use nrules instead of playing tricks
11708 with BITS_PER_WORD.
11709
2e729273
AD
117102001-12-13 Akim Demaille <akim@epita.fr>
11711
11712 * src/print.c (print_actions): Output the handling of `$' as the
11713 traces do: shifting the token EOF. Before EOF was treated as a
11714 nonterminal.
11715 * tests/regression.at: Adjust some tests.
11716 * src/print_graph.c (print_core): Complete the set of items via
11717 closure. The next-to-final and final states are still unsatisfying,
11718 but that's to be addressed elsewhere.
11719 No longer output the rule numbers, but do output the state number.
11720 A single loop for the shifts + gotos is enough, but picked a
11721 distinct color for each.
11722 (print_graph): Initialize and finalize closure.
11723
107f7dfb
AD
117242001-12-13 Akim Demaille <akim@epita.fr>
11725
11726 * src/reader.c (readgram): Remove dead code, an strip useless
11727 braces.
11728 (get_type): Remove, unused.
11729
9b53a24f
AD
117302001-12-12 Akim Demaille <akim@epita.fr>
11731
11732 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
11733 on that of lib/error.c.
11734
dbfb6dcd
AD
117352001-12-12 Akim Demaille <akim@epita.fr>
11736
11737 Some hosts don't like `/' in includes.
11738
11739 * src/system.h: Include libgettext.h without qualifying the path.
11740 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
11741 $(top_srcdir).
11742
c25fb648
MA
117432001-12-11 Marc Autret <autret_m@epita.fr>
11744
11745 * src/output.c (output_parser): Remove useless muscle.
11746
710ddc4f
MA
117472001-12-11 Marc Autret <autret_m@epita.fr>
11748
11749 * src/bison.simple: Remove #line just before %%epilogue. It
11750 is now handled in ...
11751 * src/reader.c (read_additionnal_code): Add the output of a
11752 #line for the epilogue.
11753
e83d80b8
MA
117542001-12-10 Marc Autret <autret_m@epita.fr>
11755
927c1557 11756 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
11757 replace precedent remove.
11758 * src/bison.simple: Remove #line before %%prologue because
11759 %%input-line is wrong at this time.
11760
971d5158
MA
117612001-12-10 Marc Autret <autret_m@epita.fr>
11762
11763 * src/reader.c (symbols_output): Clean up.
927c1557 11764 * src/output.c (output_gram, output): Clean up.
971d5158 11765
5edafffd
AD
117662001-12-10 Akim Demaille <akim@epita.fr>
11767
11768 * src/lalr.c (initialize_lookaheads): New. Extracted from...
11769 * src/LR0.c (set_state_table): here.
11770 * src/lalr.c (lalr): Call it.
11771
0279f8e9
AD
117722001-12-10 Akim Demaille <akim@epita.fr>
11773
11774 * src/state.h (shifts): Remove the `number' member: shifts are
11775 attached to state, hence no longer need to be labelled with a
11776 state number.
11777
190c4f5f
AD
117782001-12-10 Akim Demaille <akim@epita.fr>
11779
11780 Now that states have a complete set of members, the linked list of
11781 shifts is useless: just fill directly the state's shifts member.
11782
11783 * src/state.h (shifts): Remove the `next' member.
11784 * src/LR0.c (first_state, last_state): Remove.
11785 Adjust the callers.
11786 (augment_automaton): Don't look for the shifts that must be added
11787 a shift on EOF: it is those of the state we looked for! But now,
11788 since shifts are attached, it is no longer needed to looking
11789 merely by its id: its number.
11790
2a73b93d
AD
117912001-12-10 Akim Demaille <akim@epita.fr>
11792
11793 * src/LR0.c (augment_automaton): Better variable locality.
11794 Remove an impossible branch: if there is a state corresponding to
11795 the start symbol being shifted, then there is shift for the start
11796 symbol from the initial state.
11797
74392f6a
AD
117982001-12-10 Akim Demaille <akim@epita.fr>
11799
11800 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
11801 only when appropriate: when insert_start_shifting_state' is not
11802 invoked.
11803 * tests/regression.at (Rule Line Numbers): Adjust.
11804
37c82725
AD
118052001-12-10 Akim Demaille <akim@epita.fr>
11806
11807 * src/LR0.c (augment_automaton): Now that all states have shifts,
11808 merge the two cases addition shifts to the initial state.
11809
6a164e0c
AD
118102001-12-10 Akim Demaille <akim@epita.fr>
11811
11812 * src/lalr.c (set_state_table): Move to...
11813 * src/LR0.c: here.
11814 * src/lalr.c (lalr): Don't call it...
11815 * src/LR0.c (generate_states): do it.
11816 * src/LR0.h (first_state): Remove, only the table is used.
11817
7215de24
AD
118182001-12-10 Akim Demaille <akim@epita.fr>
11819
11820 * src/LR0.h (first_shift, first_reduction): Remove.
11821 * src/lalr.c: Don't use first_shift: find shifts through the
11822 states.
11823
80e25d4d
AD
118242001-12-10 Akim Demaille <akim@epita.fr>
11825
11826 * src/LR0.c: Attach shifts to states as soon as they are
11827 computed.
11828 * src/lalr.c (set_state_table): Instead of assigning shifts to
11829 state, just assert that the mapping was properly done.
11830
0ab3728b
AD
118312001-12-10 Akim Demaille <akim@epita.fr>
11832
11833 * src/LR0.c (insert_start_shift): Rename as...
11834 (insert_start_shifting_state): this.
11835 (insert_eof_shifting_state, insert_accepting_state): New.
11836 (augment_automaton): Adjust.
11837 Better locality of the variables.
11838 When looking if the start_symbol is shifted from the initial
11839 state, using `while (... symbol != start_symbol ...)' sounds
11840 better than `while (... symbol < start_symbol ...)': If fail
11841 to see how the order between symbols could be relevant!
11842
78af9bbc
AD
118432001-12-10 Akim Demaille <akim@epita.fr>
11844
11845 * src/getargs.h: Don't declare `spec_name_prefix' and
11846 `spec_file_prefix', declared by src/files.h.
11847 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
11848 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
11849 * src/output.c (prepare): Adjust.
11850 * src/reader.c (symbols_output): Likewise.
11851 * src/vmsgetargs.c: Vaguely adjust, but who cares?
11852
bdef2a41
AD
118532001-12-10 Akim Demaille <akim@epita.fr>
11854
11855 * src/muscle_tab.c (muscle_init): NULL is a better default than
11856 `"0"'.
11857
3735969c
AD
118582001-12-10 Akim Demaille <akim@epita.fr>
11859
11860 * src/reader.c (reader): Calling symbols_output once is enough.
11861
49701457
AD
118622001-12-10 Akim Demaille <akim@epita.fr>
11863
11864 Now that states have a complete set of members, the linked list of
11865 reductions is useless: just fill directly the state's reductions
11866 member.
11867
11868 * src/state.h (struct reductions): Remove member `number' and
11869 `next'.
11870 * src/LR0.c (first_reduction, last_reduction): Remove.
11871 (save_reductions): Don't link the new reductions, store them in
11872 this_state.
11873 * src/lalr.c (set_state_table): No need to attach reductions to
11874 states, it's already done.
11875 * src/output.c (output_actions): No longer free the shifts, then
11876 the reductions, then the states: free all the states and their
11877 members.
11878
0edad749
AD
118792001-12-10 Akim Demaille <akim@epita.fr>
11880
11881 * src/options.c (OPTN, DRTV, BOTH): New.
11882 (option_table): Use them.
11883
0edad749
AD
11884 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
11885 the job of system.h.
11886 * src/options.c: Don't include stdio.h and xalloc.h for the same
11887 reasons.
11888
5449dd0f
AD
118892001-12-10 Akim Demaille <akim@epita.fr>
11890
11891 * src/output.c (output, prepare): Make sure the values of the
11892 muscles `action' and `prologue' are 0-terminated.
11893
a870c567
AD
118942001-12-10 Akim Demaille <akim@epita.fr>
11895
11896 Clean up GCC warnings.
11897
11898 * src/reader.c (copy_action): `buf' is not used.
11899 (parse_skel_decl): Be static.
11900 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
11901 * src/options.h (create_long_option_table): Have a real prototype.
11902 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
11903 (hash_delete_at): Return const void *.
11904 Adjust casts to preserve the const.
11905
80df8768
AD
119062001-12-10 Akim Demaille <akim@epita.fr>
11907
11908 * configure.in: Require 2.52g.
11909 M4 is not needed, but AUTOM4TE is.
11910 * m4/m4.m4: Remove.
11911 * tests/Makefile.am: Adjust.
11912
f693ad14
AD
119132001-12-10 Akim Demaille <akim@epita.fr>
11914
11915 One structure for states is enough, even though theoretically
11916 there are LR(0) states and LALR(1) states.
11917
11918 * src/lalr.h (state_t): Remove.
11919 (state_table): Be state_t **, not state_t *.
11920 * src/state.h (core, CORE_ALLOC): Rename as...
11921 (state_t, STATE_ALLOC): this.
11922 Add the LALR(1) members: shifts, reductions, errs.
11923 * src/LR0.c (state_table): Rename as...
11924 (state_hash): this, to avoid name clashes with the global
11925 `state_table'.
11926 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
11927 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
11928
74ffbcb6
AD
119292001-12-10 Akim Demaille <akim@epita.fr>
11930
11931 Bison dumps core on bash.y.
11932 Reported by Pascal Bart.
11933
11934 * src/warshall.c (bitmatrix_print): New.
11935 (TC): Use it.
ba0fe3c7 11936 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
11937 j must be the outer loop.
11938 * tests/regression.at (Broken Closure): New.
11939
07708e19
AD
119402001-12-05 Akim Demaille <akim@epita.fr>
11941
11942 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
11943 its argument.
ba1ecc07 11944 Reported by Peter Hamorsky.
07708e19 11945
92b16366
AD
119462001-12-05 Akim Demaille <akim@epita.fr>
11947
11948 * src/conflicts.c (err_table): Remove.
11949 (resolve_sr_conflict): Adjust.
11950 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
11951 Rename as...
11952 (state_t.reductions, state_t.shifts): this.
11953
076ab033
AD
119542001-12-05 Akim Demaille <akim@epita.fr>
11955
11956 * src/reduce.c (reduce_grammar_tables): No longer disable the
11957 removal of useless rules via CPP but via `if (0)', so that the
11958 compiler still check the code is valid.
11959 For instance, it should have noticed `rline' no longer exists: use
11960 the `line' member of rule_t.
11961 * src/gram.c (dummy, rline): Remove, unused.
11962
3843c413
AD
119632001-12-05 Akim Demaille <akim@epita.fr>
11964
11965 * src/output.c (pack_vector): Use assert, not berror.
11966 * src/main.c (berror): Remove, unused.
11967
43168960
AD
119682001-12-05 Akim Demaille <akim@epita.fr>
11969
11970 New experimental feature: if --verbose --trace output all the
11971 items of a state, not only its kernel.
11972
11973 * src/print.c (print_core): If `trace_flag', then invoke closure
11974 before outputting the items of the state (print_core is no longer
11975 a correct name them).
11976 (print_results): Invoke new_closure/free_closure if needed.
11977
b2872512
AD
119782001-12-05 Akim Demaille <akim@epita.fr>
11979
11980 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
11981 * src/closure.c, src/closure.h (itemsetsize): Rename as...
11982 (nitemset): for consistency with the rest of the project.
11983
23cbcc6c
AD
119842001-12-05 Akim Demaille <akim@epita.fr>
11985
11986 * src/closure.c (print_closure): Improve.
11987 (closure): Use it for printing input and output.
11988
03ec521c
AD
119892001-12-05 Akim Demaille <akim@epita.fr>
11990
11991 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
11992 indexed by nonterminals.
11993
3a7456dd
AD
119942001-12-05 Akim Demaille <akim@epita.fr>
11995
11996 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
11997 what it was!).
11998 * src/warshall.h: Remove accidental duplication of the content.
11999
1cbcf2e7
AD
120002001-12-05 Akim Demaille <akim@epita.fr>
12001
12002 * src/closure.c (set_fderives): De-obfuscate.
12003
84182270
AD
120042001-12-05 Akim Demaille <akim@epita.fr>
12005
12006 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
12007
3f6f053c
AD
120082001-12-05 Akim Demaille <akim@epita.fr>
12009
12010 * src/closure.c (set_firsts): De-obfuscate.
12011
7a5350ba
AD
120122001-12-05 Akim Demaille <akim@epita.fr>
12013
12014 * src/output.c (action_row): De-obfuscate
12015 using the good o' techniques: arrays not pointers, variable
12016 locality, BITISSET, RESETBIT etc.
12017
d954473d
AD
120182001-12-05 Akim Demaille <akim@epita.fr>
12019
12020 Pessimize the code to simplify it: from now on, all the states
12021 have a valid SHIFTS, which NSHIFTS is possibly 0.
12022
12023 * src/LR0.c (shifts_new): Be global and move to..
12024 * src/state.c, src/state.h: here.
12025 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
12026 * src/print_graph: Adjust.
12027
9839bbe5
AD
120282001-12-05 Akim Demaille <akim@epita.fr>
12029
12030 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
12031 * src/conflicts.c: Use it.
12032 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
12033 incorrectly ``simplified''.
12034
9f136c07
AD
120352001-12-05 Akim Demaille <akim@epita.fr>
12036
12037 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
12038 using the good o' techniques: arrays not pointers, variable
12039 locality, BITISSET, RESETBIT etc.
12040
b608206e
AD
120412001-12-05 Akim Demaille <akim@epita.fr>
12042
12043 * src/state.h (SHIFT_SYMBOL): New.
12044 * src/conflicts.c: Use it to deobfuscate.
12045
52afa962
AD
120462001-12-05 Akim Demaille <akim@epita.fr>
12047
12048 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
12049 (print_reductions): De-obfuscate using the good o' techniques:
12050 arrays not pointers, variable locality, BITISSET.
12051
e74dc321
AD
120522001-12-05 Akim Demaille <akim@epita.fr>
12053
12054 * src/conflicts.c (print_reductions): Arrays, not pointers.
12055 Use BITISSET.
12056
768fca83
AD
120572001-12-05 Akim Demaille <akim@epita.fr>
12058
12059 * src/conflicts.c (print_reductions): Pessimize, but clarify.
12060
a17e599f
AD
120612001-12-05 Akim Demaille <akim@epita.fr>
12062
12063 * src/conflicts.c (print_reductions): Improve variable locality.
12064
a04bc341
AD
120652001-12-05 Akim Demaille <akim@epita.fr>
12066
12067 * src/conflicts.c (print_reductions): Pessimize, but clarify.
12068
c8ea038e
AD
120692001-12-05 Akim Demaille <akim@epita.fr>
12070
12071 * src/conflicts.c (print_reductions): Improve variable locality.
12072
aa2aab3c
AD
120732001-12-05 Akim Demaille <akim@epita.fr>
12074
12075 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
12076 * src/lalr.c: Use them.
12077
b178c8cc
AD
120782001-12-05 Akim Demaille <akim@epita.fr>
12079
12080 * src/LR0.c (augment_automaton): Formatting changes.
12081 Better variable locality.
12082
f67d13aa
AD
120832001-12-05 Akim Demaille <akim@epita.fr>
12084
12085 * src/lalr.c (matrix_print): New.
12086 (transpose): Use it.
12087 Use arrays instead of pointers.
12088
c2713865
AD
120892001-12-05 Akim Demaille <akim@epita.fr>
12090
12091 * src/lalr.c (maxrhs): Move to...
12092 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
12093 * src/lalr.c (build_relations): Adjust.
12094
9887c18a
AD
120952001-12-05 Akim Demaille <akim@epita.fr>
12096
12097 * src/lalr.c (transpose): Free the memory allocated to the
12098 argument, as it is replaced by the results by the unique caller.
12099 (build_relations): Merely invoke transpose: it handles the memory
12100 deallocation.
12101 Improve variable locality.
12102 Avoid variables used as mere abbreviations.
12103 (compute_lookaheads): Use arrays instead of pointers.
12104
4d4f699c
AD
121052001-12-05 Akim Demaille <akim@epita.fr>
12106
12107 * src/lalr.c (initialize_F): Improve variable locality.
12108 Avoid variables used as mere abbreviations.
12109
80a69750
AD
121102001-12-05 Akim Demaille <akim@epita.fr>
12111
12112 * src/derives.c (print_derives): Display the ruleno.
12113 * src/lalr.c (initialize_F, transpose): Better variable locality
12114 to improve readability.
12115 Avoid variables used as mere abbreviations.
12116
fe961097
AD
121172001-12-05 Akim Demaille <akim@epita.fr>
12118
12119 * src/lalr.c (traverse): Use arrays instead of pointers.
12120
e3e4e814
AD
121212001-12-05 Akim Demaille <akim@epita.fr>
12122
12123 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
12124 the handling of squeue.
12125 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
12126
630e182b
AD
121272001-12-05 Akim Demaille <akim@epita.fr>
12128
12129 Because useless nonterminals are now kept alive (instead of being
12130 `destroyed'), we now sometimes examine them, and store information
12131 related to them. Hence we need to know their number, and adjust
12132 memory allocations.
12133
12134 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
12135 static.
12136 * src/LR0.c (allocate_itemsets): The memory allocated to
12137 `symbol_count' was used for two different purpose: once to count
12138 the number of occurrences of each symbol, and later reassigned to
12139 `shift_symbol', containing the symbol that can be shifted from a
12140 given state.
12141 Deobfuscate, i.e., allocate, use and free `symbol_count' here
12142 only, and...
12143 (new_itemsets): Allocate `shift_symbol' here.
12144 (allocate_itemsets): symbol_count includes useless nonterminals.
12145 Make room for them.
12146 (free_storage): Use `free', not `XFREE', for pointers that cannot
12147 be null.
12148
81b51460
AD
121492001-12-05 Akim Demaille <akim@epita.fr>
12150
12151 * src/nullable.c (set_nullable): Deobfuscate the handling of
12152 ritem.
12153 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
12154
3067fbef
AD
121552001-12-05 Akim Demaille <akim@epita.fr>
12156
12157 * src/gram.c, src/gram.h (ritem_print): New.
12158 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
12159 (This useless function was defined only to work around VMS linkers
12160 that can't handle compilation units with variables only).
12161 * src/reduce.c (dump_grammar): Use it to trace the construction of
12162 ritem.
12163
c2bea5f9
PE
121642001-12-04 Paul Eggert <eggert@twinsun.com>
12165
7d27c823
PE
12166 * src/bison.simple (union yyalloc): Change member names
12167 to be the same as the stack names.
12168 (yyparse): yyptr is now union yyalloc *, not char *.
12169 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
12170 and may generate better code on some machines.
c2bea5f9
PE
12171 (yystpcpy): Use prototype if __STDC__ is defined, not just
12172 if __cplusplus is defined.
35687a9d 12173
2c8a9dfa
AD
121742001-11-30 Akim Demaille <akim@epita.fr>
12175
12176 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
12177 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
12178 Gettext doesn't compile cleanly, and dies with -Werror.
12179 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
12180 Include WARNING_CFLAGS here.
12181 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
12182 before being defined.
12183
f4e421e6
AD
121842001-11-27 Paul Eggert <eggert@twinsun.com>
12185
12186 * lib/quotearg.h (quotearg_n, quotearg_n_style):
12187 First arg is int, not unsigned.
12188 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
12189 (SIZE_MAX, UINT_MAX): New macros.
12190 (quotearg_n_options): Abort if N is negative.
12191 Avoid overflow check on hosts where size_t is 64 bits and int
12192 is 32 bits, as overflow is impossible there.
12193 Fix off-by-one typo that caused unnecessary reallocation.
12194
7093d0f5
AD
121952001-11-29 Paul Eggert <eggert@twinsun.com>
12196
12197 Name space cleanup in generated parser.
12198
12199 * doc/bison.texinfo (Bison Parser): Discuss system headers
12200 and their effect on the user name space.
12201
12202 * src/bison.simple:
12203 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
12204 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
12205 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
12206
12207 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
12208 on user names when possible.
12209
12210 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
12211 Simplify test for whather <alloca.h> exists.
12212
12213 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
12214
12215 (<stdio.h>): Include if YYDEBUG.
12216
12217 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
12218 ! defined (yyoverflow) && ! defined (yymemcpy).
12219
12220 (yymemcpy, yyparse): Rename local variables as needed so that
12221 they all begin with 'yy'.
12222
12223 (yystrlen, yystpcpy): New functions.
12224
12225 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
12226 All uses changed.
12227
12228 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
12229 instead of relying on string.h functions. Use YYSTACK_ALLOC
12230 and YYSTACK_FREE instead of malloc and free.
12231
fd51e5ff
AD
122322001-11-30 Akim Demaille <akim@epita.fr>
12233
12234 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
12235 before their first uses.
12236 (YYBISON, YYPURE): Move to the top of the output.
12237
7d13ff5f
AD
122382001-11-30 Akim Demaille <akim@epita.fr>
12239
12240 * tests/reduce.at (Useless Nonterminals): Fix.
12241
892a3995
AD
122422001-11-30 Akim Demaille <akim@epita.fr>
12243
12244 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
12245 if body instead of `;' to pacify GCC's warnings.
12246
68f1e3ed
AD
122472001-11-30 Akim Demaille <akim@epita.fr>
12248
12249 Instead of mapping the LHS of unused rules to -1, keep the LHS
12250 valid, but flag the rules as invalid.
12251
12252 * src/gram.h (rule_t): `useful' is a new member.
12253 * src/print.c (print_grammar): Adjust.
12254 * src/derives.c (set_derives): Likewise.
12255 * src/reader.c (packgram, reduce_output): Likewise.
12256 * src/reduce.c (reduce_grammar_tables): Likewise.
12257 * tests/reduce.at (Underivable Rules, Useless Rules): New.
12258
d2d1b42b
AD
122592001-11-30 Akim Demaille <akim@epita.fr>
12260
12261 * src/reduce.c (reduce_output): Formatting changes.
12262 * src/print.c (print_results, print_grammar): Likewise.
12263 * tests/regression.at (Rule Line Numbers)
12264 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
12265
760b53a8
AD
122662001-11-30 Akim Demaille <akim@epita.fr>
12267
12268 * src/reduce.c (nonterminals_reduce): Instead of throwing away
12269 useless nonterminals, move them at the end of the symbol arrays.
12270 (reduce_output): Adjust.
12271 * tests/reduce.at (Useless Nonterminals): Adjust.
12272
00238958
AD
122732001-11-30 Akim Demaille <akim@epita.fr>
12274
12275 * src/reduce.c: Various comment/formatting changes.
12276 (nonterminals_reduce): New, extracted from...
12277 (reduce_grammar_tables): here.
12278 (reduce_grammar): Call nonterminals_reduce.
12279
396452de
PE
122802001-11-29 Paul Eggert <eggert@twinsun.com>
12281
12282 * src/bison.simple (YYSTACK_REALLOC): Remove.
12283 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
12284 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
12285 New macros.
12286 (union yyalloc): New type.
12287 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
12288 an arbitrary restriction on hosts where size_t is wider than int.
12289
12290 (yyparse): Don't dump core if alloca or malloc fails; instead, report
12291 a parser stack overflow. Allocate just one block of memory for all
12292 three stacks, instead of allocating three blocks; this typically is
12293 faster and reduces fragmentation.
12294
12295 Do not limit the number of items in the stack to a value that fits
12296 in 'int', as this is an arbitrary limit on hosts with 64-bit
12297 size_t and 32-bit int.
12298
147e184c
MA
122992001-11-29 Marc Autret <autret_m@epita.fr>
12300
12301 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
12302 of defining YYERROR_VERBOSE.
12303 [AT_DATA]: $4 is now out of C declarations in the prologue.
12304
426cf563
MA
123052001-11-28 Marc Autret <autret_m@epita.fr>
12306
12307 * src/reader.c (parse_dquoted_param): New.
12308 (parse_skel_decl): Use it.
12309 * src/lex.h: Add its prototype.
12310 * src/lex.c (literalchar): Become not static.
12311
c7925b99
MA
123122001-11-28 Marc Autret <autret_m@epita.fr>
12313
12314 * src/output.h: And put its extern declaration here.
12315 * src/output.c (error_verbose): Define here.
12316 (prepare): Echo name modification.
12317 * src/getargs.h: Clean its extern declaration.
12318 * src/getargs.c (error_verbose_flag): Remove.
12319 (getargs): Remove case 'e'.
12320 * src/options.c (option_table): 'error-verbose' is now seen as simple
12321 percent option.
12322 Include output.h.
12323
12324 * src/reader.c (read_declarations): Remove case tok_include.
12325 (parse_include_decl): Remove.
12326 * src/lex.h (token_t): Remove tok_include.
12327 * src/options.c (option_table): 'include' is now a simple command line
12328 option.
12329
5b5d1929
MA
123302001-11-28 Marc Autret <autret_m@epita.fr>
12331
12332 * src/bison.simple: Adjust muscle names.
12333 * src/muscle_tab.c (muscle_init): Also rename the muscles.
12334 * src/output.c (prepare): s/_/-/ for the muscles names.
12335 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
12336
8850be4b
MA
123372001-11-28 Marc Autret <autret_m@epita.fr>
12338
12339 * src/bison.simple: Fix debug.
12340 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
12341
4a38e613
AD
123422001-11-28 Akim Demaille <akim@epita.fr>
12343
12344 * src/LR0.c (shifts_new): New.
12345 (save_shifts, insert_start_shift, augment_automaton): Use it.
12346
4b35e1c1
AD
123472001-11-28 Akim Demaille <akim@epita.fr>
12348
12349 * src/closure.c (closure): `b' and `ruleno' denote the same value:
12350 keep ruleno only.
12351
d2b04478
AD
123522001-11-28 Akim Demaille <akim@epita.fr>
12353
12354 * src/closure.c (closure): Instead of looping over word in array
12355 then bits in words, loop over bits in array.
12356
2c4c30aa
AD
123572001-11-28 Akim Demaille <akim@epita.fr>
12358
12359 * src/closure.c (closure): No longer optimize the special case
12360 where all the bits of `ruleset[r]' are set to 0, to make the code
12361 clearer.
12362
576890b7
AD
123632001-11-28 Akim Demaille <akim@epita.fr>
12364
12365 * src/closure.c (closure): `r' and `c' are new variables, used to
12366 de-obfuscate accesses to RULESET and CORE.
12367
cb487d7d
AD
123682001-11-28 Akim Demaille <akim@epita.fr>
12369
12370 * src/reduce.c (reduce_print): Use ngettext.
12371 (dump_grammar): Improve the trace accuracy.
12372
6013d43f
AD
123732001-11-28 Akim Demaille <akim@epita.fr>
12374
12375 * src/reduce.c (dump_grammar): Don't translate trace messages.
12376
cb4956ee
AD
123772001-11-28 Akim Demaille <akim@epita.fr>
12378
12379 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
12380 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
12381 as all tags are free'ed afterwards.
12382 From Enrico Scholz.
12383
648185ab
PE
123842001-11-27 Paul Eggert <eggert@twinsun.com>
12385
12386 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
12387 use alloca when we didn't want to, and vice versa.
12388
68254a03
MA
123892001-11-27 Marc Autret <autret_m@epita.fr>
12390
9113b58f
AD
12391 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
12392 initialization.
68254a03
MA
12393 * src/output.c (prepare): Remove its update.
12394
04d843a2
MA
123952001-11-27 Marc Autret <autret_m@epita.fr>
12396
12397 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
12398 Use %error-verbose.
12399
d2079671 124002001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
12401
12402 * src/bison.simple: Remove YYERROR_VERBOSE using.
12403 Use %%error_verbose.
12404 (yyparse): Likewise.
12405 * src/output.c (prepare): Give its final value.
12406 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
12407 * src/getargs.h: Add its extern declaration.
12408 * src/getargs.c (error_verbose_flag): New int.
12409 (getargs): Update to catch new case.
12410 * src/options.c (option_table): 'error-verbose' is a new option.
12411 (shortopts): Update.
12412
e0327bc8
AD
124132001-11-27 Akim Demaille <akim@epita.fr>
12414
12415 * src/system.h: Use intl/libgettext.h.
12416 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
12417
000f1a3c
AD
124182001-11-27 Akim Demaille <akim@epita.fr>
12419
12420 * tests/torture.at (Exploding the Stack Size with Malloc):
12421 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
12422
26cfe0be
AD
124232001-11-27 Akim Demaille <akim@epita.fr>
12424
12425 * src/files.c: Include error.h.
12426 Reported by Hans Aberg.
12427
f6bd5427
MA
124282001-11-26 Marc Autret <autret_m@epita.fr>
12429
d2079671 12430 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
12431 (read_declarations): Add case tok_include.
12432 * src/getargs.h (include): Add its extern definition.
12433 * src/getargs.c (include): New const char *.
12434 (getargs): Add case '-I'.
12435 * src/options.c (option_table): Add include as command line and
12436 percent option.
12437 * src/lex.h (token_t): Add tok_include.
12438
2ca209c1
AD
124392001-11-26 Akim Demaille <akim@epita.fr>
12440
12441 * src/reader.c (readgram): Make sure rules for mid-rule actions
12442 have a lineno equal to that of their host rule.
12443 Reported by Hans Aberg.
12444 * tests/regression.at (Rule Line Numbers): New.
12445
0e41b407
AD
124462001-11-26 Akim Demaille <akim@epita.fr>
12447
12448 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
12449 size_ts.
12450
124512001-11-26 Akim Demaille <akim@epita.fr>
12452
12453 * src/complain.c, src/complain.h (error): Remove, provided by
12454 lib/error.[ch].
12455
e0c40012
AD
124562001-11-26 Akim Demaille <akim@epita.fr>
12457
12458 * src/reader.c (read_declarations): Don't abort on tok_illegal,
12459 issue an error message.
12460 * tests/regression.at (Invalid %directive): New.
12461 Reported by Hans Aberg.
12462
5e147124
AD
124632001-11-26 Akim Demaille <akim@epita.fr>
12464
12465 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
12466 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
12467
a034c8b8
AD
124682001-11-26 Akim Demaille <akim@epita.fr>
12469
12470 * src/conflicts.c (conflicts_print): Don't complain at all when
12471 there are no reduce/reduce conflicts, and as many shift/reduce
12472 conflicts as expected.
12473 * tests/regression.at (%expect right): Adjust.
12474
c64a20f3
AD
124752001-11-23 Akim Demaille <akim@epita.fr>
12476
12477 * lib/alloca.c: Update, from fileutils.
12478
5b0d29bb
AD
124792001-11-23 Akim Demaille <akim@epita.fr>
12480
12481 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
12482
722c4bfe
AD
124832001-11-23 Akim Demaille <akim@epita.fr>
12484
12485 * src/system.h: Include alloca.h.
12486 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
12487
6255b435
AD
124882001-11-23 Akim Demaille <akim@epita.fr>
12489
12490 * src/print_graph.c (print_actions): Remove `rule', unused.
12491 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
12492 pacify GCC's signed < unsigned warnings.
12493 * src/closure.c (itemsetsize): Likewise.
12494 * src/reader.c (symbol_list_new): Static.
12495
b29b2ed5
AD
124962001-11-23 Akim Demaille <akim@epita.fr>
12497
12498 Attaching lineno to buckets is stupid, since only one copy of each
12499 symbol is kept, only the line of the first occurrence is kept too.
12500
12501 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
12502 * src/reader.c (rline_allocated): Remove, unused.
12503 (symbol_list): Have a `line' member.
12504 (symbol_list_new): New.
12505 (readgram): Use it.
12506 * src/print.c (print_grammar): Output the rule line numbers.
12507 * tests/regression.at (Solved SR Conflicts)
12508 (Unresolved SR Conflicts): Adjust.
12509 Reported by Hans Aberg.
12510
a81b1d4a
MA
125112001-11-22 Marc Autret <autret_m@epita.fr>
12512
12513 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
12514
c1ecb3c1
MA
125152001-11-22 Marc Autret <autret_m@epita.fr>
12516
12517 * src/muscle_tab.c (muscle_init): Remove initialization of
12518 skeleton muscle.
12519 * src/output.c (output_master_parser): Do it here.
12520
fbe01355
AD
125212001-11-20 Akim Demaille <akim@epita.fr>
12522
12523 * po/sv.po: New.
12524 * configure.in (ALL_LINGUAS): Adjust.
12525 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
12526 longer contains strings to translate.
12527
81e895c0
AD
125282001-11-19 Akim Demaille <akim@epita.fr>
12529
12530 * src/conflicts.c (conflicts_print): Add a missing \n.
12531
6bb1878b
AD
125322001-11-19 Akim Demaille <akim@epita.fr>
12533
12534 * src/nullable.c (nullable_print): New.
12535 (set_nullable): Call it when tracing.
12536 Better locality of variables.
12537
d9ec2d07
AD
125382001-11-19 Akim Demaille <akim@epita.fr>
12539
12540 * src/print.c (print_actions): Better locality of variables.
12541
720e5c1b
AD
125422001-11-19 Akim Demaille <akim@epita.fr>
12543
12544 * src/derives.c (print_derives): Fix and enrich.
12545 * src/closure.c (print_fderives): Likewise.
12546
fb908786
AD
125472001-11-19 Akim Demaille <akim@epita.fr>
12548
12549 * src/closure.c (itemsetend): Remove, replaced with...
12550 (itemsetsize): new.
12551
125ecb56
AD
125522001-11-19 Akim Demaille <akim@epita.fr>
12553
12554 * src/LR0.c (kernel_end): Remove, replaced with...
12555 (kernel_size): new.
12556
d8cf039f
AD
125572001-11-19 Akim Demaille <akim@epita.fr>
12558
12559 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
12560 to clarify.
12561
7bec0760
AD
125622001-11-19 Akim Demaille <akim@epita.fr>
12563
12564 * src/closure.c (closure): Use arrays instead of pointers to clarify.
12565
c87d4863
AD
125662001-11-19 Akim Demaille <akim@epita.fr>
12567
12568 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
12569 trace messages.
12570 * src/LR0.c: Likewise.
12571 (allocate_itemsets): Use arrays instead of pointers to clarify.
12572
9bfe901c
AD
125732001-11-19 Akim Demaille <akim@epita.fr>
12574
12575 * src/getargs.c (statistics_flag): Replace with...
12576 (trace_flag): New.
12577 (longopts): Accept --trace instead of --statistics.
12578 * src/getargs.h, src/options.c: Adjust.
12579 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
12580 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
12581
97db7bd4
AD
125822001-11-19 Akim Demaille <akim@epita.fr>
12583
cc72668c 12584 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
12585 pointers to clarify the code.
12586 (save_reductions, save_shifts): Factor common parts of alternatives.
12587
2c5f66ed
AD
125882001-11-19 Akim Demaille <akim@epita.fr>
12589
12590 * src/LR0.c (new_state, get_state): Complete TRACE code.
12591 * src/closure.c: Include `reader.h' to get `tags', needed by the
12592 trace code.
12593 Rename the conditional DEBUG as TRACE.
12594 Output consistently TRACEs to stderr, not stdout.
12595 * src/derives.c: Likewise.
12596 * src/reduce.c: (inaccessable_symbols): Using if is better style
12597 than goto.
12598 Use `#if TRACE' instead of `#if 0' for tracing code.
12599
300f275f
AD
126002001-11-19 Akim Demaille <akim@epita.fr>
12601
12602 * src/system.h (LIST_FREE, shortcpy): New.
12603 * src/LR0.c: Use them.
12604 * src/output.c (free_itemsets, free_reductions, free_shifts):
12605 Remove, replaced by LIST_FREE.
12606
f59c437a
AD
126072001-11-19 Akim Demaille <akim@epita.fr>
12608
12609 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
12610 (REDUCTIONS_ALLOC): New.
12611 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
12612 allocation.
12613
6986fd9e
AD
126142001-11-19 Akim Demaille <akim@epita.fr>
12615
12616 * src/LR0.c (new_state): Complete trace code.
12617 * src/nullable.c (set_nullable): Don't translate traces.
12618
4bc30f78
AD
126192001-11-19 Akim Demaille <akim@epita.fr>
12620
12621 * src/print_graph.c (print_core): Better locality of variables.
12622 * src/print.c (print_core): Likewise.
12623
08a946e0
AD
126242001-11-19 Akim Demaille <akim@epita.fr>
12625
12626 * src/vcg.c: You do the output, so you are responsible of the
12627 handling of VCG syntax, in particular: use quotearg.
12628 * src/print_graph.c: Don't.
12629 (print_actions): Don't output the actions as part of the nodes,
12630 since that's the job of the edges.
12631 (print_state): Don't output by hand: fill the node description,
9bfe901c 12632 and ask for its output.
08a946e0 12633
f0473484
AD
126342001-11-19 Akim Demaille <akim@epita.fr>
12635
cc72668c
AD
12636 * src/bison.simple (yyparse): When verbosely reporting an error,
12637 no longer put additional quotes around token names.
f0473484
AD
12638 * tests/calc.at: Adjust.
12639
e41dc700
AD
126402001-11-19 Akim Demaille <akim@epita.fr>
12641
12642 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
12643 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
12644 * src/output.c: Adjust.
12645
652a871c
AD
126462001-11-19 Akim Demaille <akim@epita.fr>
12647
12648 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
12649 (rule_t): this.
12650 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
12651
b2ed6e58
AD
126522001-11-19 Akim Demaille <akim@epita.fr>
12653
12654 * src/gram.h (rule_t): New.
12655 (rule_table): New.
12656 (rrhs, rlhs): Remove, part of state_t.
12657 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
12658 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
12659 * src/reader.c, src/reduce.c: Adjust.
12660
edad7067
AD
126612001-11-19 Akim Demaille <akim@epita.fr>
12662
12663 * src/reader.c (symbols_output): New, extracted from...
12664 (packsymbols): Here.
12665 (reader): Call it.
12666
3feec034
AD
126672001-11-19 Akim Demaille <akim@epita.fr>
12668
12669 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
12670 (maxrhs): this new function.
12671
ddcd5fdf
AD
126722001-11-19 Akim Demaille <akim@epita.fr>
12673
cc72668c 12674 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
12675 Adjust.
12676
bb527fc2
AD
126772001-11-19 Akim Demaille <akim@epita.fr>
12678
cc72668c 12679 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
12680 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
12681 * src/lalr.c: Adjust.
12682
a845a697
AD
126832001-11-19 Akim Demaille <akim@epita.fr>
12684
12685 * src/lalr.c (initialize_LA): Only initialize LA. Let...
12686 (set_state_table): handle the `lookaheads' members.
12687
f004bf6a
AD
126882001-11-19 Akim Demaille <akim@epita.fr>
12689
cc72668c
AD
12690 * src/lalr.h (lookaheads): Removed array, whose contents is now
12691 a member of...
f004bf6a
AD
12692 (state_t): this structure.
12693 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
12694 Adjust.
12695
de326cc0
AD
126962001-11-19 Akim Demaille <akim@epita.fr>
12697
cc72668c
AD
12698 * src/lalr.h (consistent): Removed array, whose contents is now
12699 a member of...
de326cc0
AD
12700 (state_t): this structure.
12701 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
12702 Adjust.
12703
90b4416b
AD
127042001-11-19 Akim Demaille <akim@epita.fr>
12705
cc72668c
AD
12706 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
12707 contents are now members of...
90b4416b
AD
12708 (state_t): this structure.
12709 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
12710 Adjust.
12711
9703cc49
AD
127122001-11-19 Akim Demaille <akim@epita.fr>
12713
12714 * src/lalr.h (state_t): New.
12715 (state_table): Be a state_t * instead of a core **.
12716 (accessing_symbol): Remove, part of state_t.
12717 * src/lalr.c: Adjust.
12718 (set_accessing_symbol): Merge into...
12719 (set_state_table): this.
12720 * src/print_graph.c, src/conflicts.c: Adjust.
12721
d803322e
AD
127222001-11-14 Akim Demaille <akim@epita.fr>
12723
12724 * tests/calc.at, tests/output.at, tests/regression.at,
12725 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
12726 now the tests are run in private dirs, therefore AC_CLEANUP and
12727 family can be simplified to 0-ary.
12728 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
12729 use abs. path to find config.h.
12730 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
12731 stderr, there can be way too much random noise.
12732 Instead pass -Werror to GCC and rely on the exit status.
12733 Reported by Wolfram Wagner.
12734
3d76b07d
AD
127352001-11-14 Akim Demaille <akim@epita.fr>
12736
12737 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
12738 defined only if yyoverflow is defined, to avoid `warning: unused
12739 variable `yyvs1''.
12740 Reported by The Test Suite.
12741
09b503c8
AD
127422001-11-14 Akim Demaille <akim@epita.fr>
12743
12744 * src/print.c: Include reduce.h.
12745 Reported by Hans Aberg.
12746
127472001-11-14 Akim Demaille <akim@epita.fr>
12748
12749 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
12750 Revert a previous patch: these are really const.
12751 * src/conflicts.c (conflict_report): Additional useless pair of
12752 braces to pacify GCC's warnings for `if () if () {} else {}'.
12753 * src/lex.c (parse_percent_token): Replace equal_offset with
12754 arg_offset.
12755 arg is const.
12756 Be sure to strdup `arg' when used, since there is no reason for
12757 token_buffer not to change.
12758
0f37a994
AD
127592001-11-14 Akim Demaille <akim@epita.fr>
12760
12761 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
12762 definition.
12763 * src/main.c (main): Use them.
12764 Suggested by Hans Aberg.
12765
d39d93b8
AD
127662001-11-12 Akim Demaille <akim@epita.fr>
12767
12768 * src/system.h (ngettext): Now that we use ngettext, be sure to
12769 provide a default definition when NLS are not used.
12770
9edcd895
AD
127712001-11-12 Akim Demaille <akim@epita.fr>
12772
12773 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
12774 Use @kbd to denote user input.
12775 (Language and Grammar): ANSIfy the example.
12776 Adjust its layout for info/notinfo.
12777 (Location Tracking Calc): Output error messages to stderr.
12778 Output locations in a more GNUtically correct way.
12779 Fix a couple of Englishos.
12780 Adjust @group/@end group pairs.
12781
7da99ede
AD
127822001-11-12 Akim Demaille <akim@epita.fr>
12783
e3aa65c5 12784 %expect was not functioning at all.
7da99ede
AD
12785
12786 * src/conflicts.c (expected_conflicts): Set to -1.
12787 (conflict_report): Use ngettext.
12788 (conflicts_print): Check %expect and make its violation an error.
12789 * doc/bison.texinfo (Expect Decl): Adjust.
12790 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
12791 * tests/regression.at (%expect not enough, %expect right)
12792 (%expect too much): New.
12793
ba9dda1a
AD
127942001-11-12 Akim Demaille <akim@epita.fr>
12795
12796 * tests/regression.at (Conflicts): Rename as...
12797 (Unresolved SR Conflicts): this.
12798 (Solved SR Conflicts): New.
12799
337c5bd1
AD
128002001-11-12 Akim Demaille <akim@epita.fr>
12801
12802 * src/reduce.c (print_results): Rename as...
12803 (reduce_output): This.
12804 Output to OUT, passed as argument, instead of output_obstack.
12805 (dump_grammar): Likewise.
12806 (reduce_free): New.
12807 Also free V1.
12808 (reduce_grammar): No longer call reduce_output, since...
12809 * src/print.c (print_results): do it.
12810 * src/main.c (main): Call reduce_free;
12811
c73a41af
AD
128122001-11-12 Akim Demaille <akim@epita.fr>
12813
12814 * src/conflicts.c (print_reductions): Accept OUT as argument.
12815 Output to it, not to output_obstack.
12816 * src/print.c (print_actions): Adjust.
12817
0df87bb6
AD
128182001-11-12 Akim Demaille <akim@epita.fr>
12819
12820 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
12821 the result instead of using...
12822 (src_total, rrc_total, src_count, rrc_count): Remove.
12823 (any_conflicts): Remove.
12824 (print_conflicts): Split into...
12825 (conflicts_print, conflicts_output): New.
12826 * src/conflicts.h: Adjust.
12827 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 12828 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
12829 * tests/regression.at (Conflicts): New.
12830 Reported by Tom Lane.
12831
e4d3d4de
AD
128322001-11-12 Akim Demaille <akim@epita.fr>
12833
12834 * tests/regression.at (Invalid input): Remove, duplicate with
12835 ``Invalid input: 1''.
12836
6d7d248e
AD
128372001-11-12 Akim Demaille <akim@epita.fr>
12838
12839 * tests/torture.at (AT_DATA_STACK_TORTURE)
12840 (Exploding the Stack Size with Alloca)
12841 (Exploding the Stack Size with Malloc): New.
12842
e9e4c321
AD
128432001-11-12 Akim Demaille <akim@epita.fr>
12844
12845 * src/bison.simple (YYSTACK_REALLOC): New.
12846 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 12847 Reported by Per Allansson.
e9e4c321 12848
5f7e0832
AD
128492001-11-12 Pascal Bart <pascal.bart@epita.fr>
12850
12851 * src/bison.simple: Define type yystype instead of YYSTYPE, and
12852 define CPP macro, which substitute YYSTYPE by yystype.
12853 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
12854 with yyltype/YYLTYPE. This allows inclusion of the generated
12855 header within the parser if the compiler, such as GGC, accepts
12856 multiple equivalent #defines.
12857 From Akim.
12858
e3f1699f
AD
128592001-11-05 Akim Demaille <akim@epita.fr>
12860
12861 * src/reader.c (symbols_output): New, extracted from...
12862 (packsymbols): here.
12863 (reader): Adjust.
12864
65be0866
AD
128652001-11-05 Akim Demaille <akim@epita.fr>
12866
12867 * src/lex.c (parse_percent_token): s/quotearg/quote/.
12868
e4d910bf
AD
128692001-11-05 Akim Demaille <akim@epita.fr>
12870
12871 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
12872 pattern.
12873
951366c1
AD
128742001-11-05 Akim Demaille <akim@epita.fr>
12875
12876 * src/options.h (struct option_table_struct): set_flags is void*.
12877 * src/options.c (longopts): Support `--output' and `%output'.
12878 (usage): Adjust.
12879 * src/lex.h (tok_setopt): Remove, replaced with...
12880 (tok_intopt, tok_stropt): these new guys.
12881 * src/lex.c (getopt.h): Not needed.
12882 (token_buffer, unlexed_token_buffer): Not const.
12883 (percent_table): Promote `-' over `_' in directive names.
12884 Active `%name-prefix', `file-prefix', and `output'.
12885 (parse_percent_token): Accept possible arguments to directives.
12886 Promote `-' over `_' in directive names.
12887
d8988b2f
AD
128882001-11-04 Akim Demaille <akim@epita.fr>
12889
12890 * doc/bison.texinfo (Decl Summary): Split the list into
12891 `directives for grammars' and `directives for bison'.
12892 Sort'em.
12893 Add description of `%name-prefix', `file-prefix', and `output'.
12894 Promote `-' over `_' in directive names.
12895 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
12896 Simplify the description of `--name-prefix'.
12897 Promote `-' over `_' in directive names.
12898 Promote `--output' over `--output-file'.
12899 Fix the description of `--defines'.
12900 * tests/output.at: Exercise %file-prefix and %output.
12901
6468d18e
AD
129022001-11-02 Akim Demaille <akim@epita.fr>
12903
12904 * doc/refcard.tex: Update.
12905
6b7e85b9
AD
129062001-11-02 Akim Demaille <akim@epita.fr>
12907
12908 * src/symtab.h (SUNDEF): New.
12909 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
12910 stand for `uninitialized', instead of 0.
12911 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
12912 * src/lex.c (lex): Adjust.
12913
12914 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
12915 Number it 0.
12916 Let yylex return it instead of a plain 0.
12917 Reported by Dick Streefland.
12918
cd5aafcf
AD
129192001-11-02 Akim Demaille <akim@epita.fr>
12920
12921 * tests/regression.at (Mixing %token styles): New test.
12922
037ca2f1
AD
129232001-11-02 Akim Demaille <akim@epita.fr>
12924
12925 * src/reader.c (parse_thong_decl): Formatting changes.
12926 (token_translations_init): New, extracted from...
12927 (packsymbols): Here.
12928 Adjust.
12929
270a173c
AD
129302001-11-01 Akim Demaille <akim@epita.fr>
12931
12932 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
12933 Check that `9foo.y' produces correct cpp guards.
12934 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
12935 guards.
12936 Reported by Wwp.
12937
561f9a30
AD
129382001-11-01 Akim Demaille <akim@epita.fr>
12939
12940 * tests/regression.at (Invalid input: 2): New.
12941 * src/lex.c (unlexed_token_buffer): New.
12942 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
12943 too.
12944 Reported by Wwp.
12945
f987e9d2
AD
129462001-11-01 Akim Demaille <akim@epita.fr>
12947
12948 * tests/calc.at: Catch up with 1.30.
12949 * configure.in: Bump to 1.49a.
12950 Adjust to newer Autotest.
12951
0846f581
PB
129522001-10-19 Pascal Bart <pascal.bart@epita.fr>
12953
12954 * src/conflicts.c: Move global variables rrc_total and src_total ...
12955 (print_conflicts): here.
12956 * src/output.c (output): Free global variable user_toknums.
12957 * src/lex.c (token_obstack): Become static.
12958
3c1a79b3
AD
129592001-10-18 Akim Demaille <akim@epita.fr>
12960
12961 * tests/atlocal.in (GCC): Add.
12962 * tests/calc.at: s/m4_match/m4_bmatch/.
12963 s/m4_patsubst/m4_bpatsubst/.
12964 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
12965 * configure.in: AC_SUBST(GCC).
12966
5d52e7d0
MA
129672001-10-14 Marc Autret <autret_m@epita.fr>
12968
12969 * src/options.c (create_long_option_table): Fix.
12970
631aa1d3
AD
129712001-10-10 Akim Demaille <akim@epita.fr>
12972
12973 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
12974
f6ec6d13
AD
129752001-10-04 Akim Demaille <akim@epita.fr>
12976
12977 * src/reader.c (parse_union_decl): Push the caracters in
12978 union_obstack, not attrs_obstack.
12979
342b8b6e
AD
129802001-10-04 Akim Demaille <akim@epita.fr>
12981
12982 Merge in the branch 1.29.
12983
12984 * src/reader.c (packsymbols): Use a temporary obstack for
12985 `%%tokendef', since output_stack is already used elsewhere.
12986
12987 2001-10-02 Akim Demaille <akim@epita.fr>
12988
12989 Bump 1.29d.
12990
12991 2001-10-02 Akim Demaille <akim@epita.fr>
12992
12993 Version 1.29c.
12994
12995 2001-10-02 Akim Demaille <akim@epita.fr>
12996
12997 * tests/regression.at (Invalid CPP headers): New.
12998 From Alexander Belopolsky.
12999 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
13000
13001 2001-10-02 Akim Demaille <akim@epita.fr>
13002
13003 * tests/regression.at (Invalid input): New.
13004 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
13005 Reported by Shura.
13006
13007 2001-10-02 Akim Demaille <akim@epita.fr>
13008
13009 * tests/calc.at: Now that --debug works, the tests must be adjusted.
13010
13011 2001-10-02 Akim Demaille <akim@epita.fr>
13012
13013 * src/output.c (output_parser): Assert `skeleton'.
13014 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
13015 systems.
13016 From Shura.
13017
13018 2001-10-01 Marc Autret <autret_m@epita.fr>
13019
13020 * src/lex.h: Echo modifications.
13021 * src/lex.c (unlex): Parameter is now token_t.
13022 From Hans Aberg.
13023
13024 2001-10-01 Marc Autret <autret_m@epita.fr>
13025
13026 * src/main.c: Include lex.h.
13027 From Hans Aberg.
13028
13029 2001-09-29 Akim Demaille <akim@epita.fr>
13030
13031 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
13032
13033 2001-09-28 Akim Demaille <akim@epita.fr>
13034
13035 * tests/testsuite.at: Update to newer Autotest.
13036 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
13037
13038 2001-09-27 Akim Demaille <akim@epita.fr>
13039
13040 Position independent wrapper.
13041
13042 * tests/bison: Remove.
13043 * tests/bison.in: New.
13044 * configure.in: Adjust.
13045
13046 2001-09-27 Paul Eggert <eggert@twinsun.com>
13047
13048 Port quotearg fixes from tar 1.13.24.
13049
13050 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
13051 tm to be declared.
13052 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
13053 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
13054
13055 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
13056 * m4/mbrtowc.m4: New file.
13057 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
13058 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
13059
13060 2001-09-27 Akim Demaille <akim@epita.fr>
13061
13062 Bump to 1.29c.
13063
13064 2001-09-27 Akim Demaille <akim@epita.fr>
13065
13066 Version 1.29b.
13067
13068 2001-09-25 Akim Demaille <akim@epita.fr>
13069
13070 * src/system.h: Include `xalloc.h'.
13071 Remove it from the C files.
13072 * src/files.c (output_files): Free the obstacks.
13073 * src/lex.c (init_lex): Rename as...
13074 (lex_init): this.
13075 (lex_free): New.
13076 * src/main.c (main): Use it.
13077
13078 2001-09-24 Marc Autret <autret_m@epita.fr>
13079
13080 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
13081 to output informations in fout (FILE*).
13082 (open_graph, close_graph): Likewise.
13083 (output_graph, output_edge, output_node): Likewise.
13084 * src/vcg.h: Update function prototypes.
13085 * src/print_graph.c (print_graph): Open output graph file.
13086 (print_actions): Adjust.
13087 * src/files.h: Remove extern declaration.
13088 * src/files.c: Remove graph_obstack declaration.
13089 (open_files): Remove graph_obstack initialization.
13090 (output_files): Remove graph_obstack saving.
13091
13092 2001-09-24 Marc Autret <autret_m@epita.fr>
13093
13094 * src/files.c (compute_output_file_names): Fix.
13095
13096 2001-09-24 Marc Autret <autret_m@epita.fr>,
13097 Akim Demaille <akim@epita.fr>
13098
13099 * src/reader.c (reader): Remove call to free_symtab ().
13100 * src/main.c (main): Call it here.
13101 Include symtab.h.
13102 * src/conflicts.c (initialize_conflicts): Rename as...
13103 (solve_conflicts): this.
13104 * src/print.c (print_core, print_actions, print_state)
13105 (print_grammar): Dump to a file instead a `output_obstack'.
13106 (print_results): Dump `output_obstack', and then proceed with the
13107 FILE *.
13108 * src/files.c (compute_output_file_names, close_files): New.
13109 (output_files): Adjust.
13110 * src/main.c (main): Adjust.
13111
13112 2001-09-23 Marc Autret <autret_m@epita.fr>
13113
13114 * src/files.c (compute_header_macro): Computes header macro name
13115 from spec_defines_file when given.
13116
13117 2001-09-23 Marc Autret <autret_m@epita.fr>
13118
13119 * src/files.c (output_files): Add default extensions.
13120
13121 2001-09-22 Akim Demaille <akim@epita.fr>
13122
13123 * src/conflicts.c (finalize_conflicts): Rename as...
13124 (free_conflicts): this.
13125
13126 2001-09-22 Akim Demaille <akim@epita.fr>
13127
13128 * src/gram.c (gram_free): Rename back as...
13129 (dummy): this.
13130 (output_token_translations): Free `token_translations'.
13131 * src/symtab.c (free_symtab): Free the tag field.
13132
13133 2001-09-22 Akim Demaille <akim@epita.fr>
13134
13135 Remove `translations' as it is always set to true.
13136
13137 * src/gram.h: Adjust.
13138 * src/reader.c (packsymbols, parse_token_decl): Adjust
13139 * src/print.c (print_grammar): Adjust.
13140 * src/output.c (output_token_translations): Adjust.
13141 * src/lex.c (lex): Adjust.
13142 * src/gram.c: Be sure the set pointers to NULL.
13143 (dummy): Rename as...
13144 (gram_free): this.
13145
13146 2001-09-22 Akim Demaille <akim@epita.fr>
13147
13148 * configure.in: Invoke AM_LIB_DMALLOC.
13149 * src/system.h: Use dmalloc.
13150 * src/LR0.c: Be sure to have pointers initialized to NULL.
13151 (allocate_itemsets): Allocate kernel_items only if needed.
13152
13153 2001-09-22 Akim Demaille <akim@epita.fr>
13154
13155 * configure.in: Bump to 1.29b.
13156 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
13157 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
13158 need xmalloc.c in calc.y.
13159 From Pascal Bart.
13160
13161 2001-09-21 Akim Demaille <akim@epita.fr>
13162
13163 Version 1.29a.
13164 * Makefile.maint, config/config.guess, config/config.sub,
13165 * config/missing: Update from masters.
13166 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
13167 upon package.m4.
13168 * configure.in (ALL_LINGUAS): Add `tr'.
13169
13170 2001-09-21 Akim Demaille <akim@epita.fr>
13171
13172 * tests/Makefile.am (package.m4): Move to...
13173 ($(srcdir)/$(TESTSUITE)): here.
13174
13175 2001-09-20 Akim Demaille <akim@epita.fr>
13176
13177 * src/complain.c: No longer try to be standalone: use system.h.
13178 Don't assume __STDC__ is defined to 1. Just test if it is defined.
13179 * src/complain.h: Likewise.
13180 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
13181 Remove the unused variable `n'.
13182 From Albert Chin-A-Young.
13183
13184 2001-09-18 Marc Autret <autret_m@epita.fr>
13185
13186 * doc/bison.1: Update.
13187 * doc/bison.texinfo (Bison Options): Update --defines and --graph
13188 descriptions.
13189 (Option Cross Key): Update.
13190 Add --graph.
13191
13192 2001-09-18 Marc Autret <autret_m@epita.fr>
13193
13194 * tests/regression.at: New test (comment in %union).
13195
13196 2001-09-18 Marc Autret <autret_m@epita.fr>
13197
13198 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
13199 do that.
13200 Reported by Keith Browne.
13201
13202 2001-09-18 Marc Autret <autret_m@epita.fr>
13203
13204 * tests/output.at: Add tests for --defines and --graph.
13205
13206 2001-09-18 Marc Autret <autret_m@epita.fr>
13207
13208 * tests/output.at: Removes tests of %{header,src}_extension features.
13209
13210 2001-09-18 Akim Demaille <akim@epita.fr>
13211
13212 * tests/Makefile.am (package.m4): New.
13213 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
13214 (_AT_CHECK_CALC_ERROR): Likewise.
13215 Factor the `, ' part of verbose error messages.
13216
13217 2001-09-18 Marc Autret <autret_m@epita.fr>
13218
13219 * src/getargs.c (longopts): Declare --defines and --graph as options
13220 with optional arguments.
13221 * src/files.h: Add extern declarations.
13222 * src/files.c (spec_graph_file, spec_defines_file): New.
13223 (output_files): Update.
13224 Remove CPP-outed code.
13225
13226 2001-09-18 Marc Autret <autret_m@epita.fr>
13227
13228 Turn off %{source,header}_extension feature.
13229
13230 * src/files.c (compute_exts_from_gf): Update.
13231 (compute_exts_from_src): Update.
13232 (output_files): CPP-out useless code.
13233 * src/files.h: Remove {header,source}_extension extern declarations.
13234 * src/reader.c (parse_dquoted_param): CPP-out.
13235 (parse_header_extension_decl): Remove.
13236 (parse_source_extension_decl): Remove.
13237 (read_declarations): Remove cases tok_{hdrext,srcext}.
13238 * src/lex.c (percent_table): Remove {header,source}_extension entries.
13239 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
13240
13241 2001-09-10 Akim Demaille <akim@epita.fr>
13242
13243 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
13244 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
13245 (AT_CHECK_OUTPUT): this.
13246 Merely check ls' exit status, its output is useless.
13247
13248 2001-09-10 Akim Demaille <akim@epita.fr>
13249
13250 * tests/calc.at: Use m4_match.
13251 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
13252
13253 2001-09-10 Marc Autret <autret_m@epita.fr>,
13254 Akim Demaille <akim@epita.fr>
13255
13256 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
13257 enum color_e.
13258 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
13259 to `normal'.
13260 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
13261 * src/lex.h: Adjust prototype.
13262 (token_t): Add `tok_undef'.
13263 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
13264 (parse_percent_token): Now returns token_t.
13265 Add default statement in switch.
13266 (lex): Separate `c' as an input variable, from the token_t result
13267 part.
13268 (unlexed): Is a token_t.
13269
13270 2001-09-10 Akim Demaille <akim@epita.fr>
13271
13272 * configure.in: Bump to 1.29a.
13273
13274 2001-09-07 Akim Demaille <akim@epita.fr>
13275
13276 Version 1.29.
13277
13278 2001-08-30 Akim Demaille <akim@epita.fr>
13279
13280 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
13281 * m4/atconfig.m4: Remove.
13282 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
13283 * tests/bison: New.
13284 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
13285 m4_if, m4_patsubst, and m4_regexp.
13286 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
13287 `input' file instead of echo.
13288
13289 2001-08-29 Akim Demaille <akim@epita.fr>
13290
13291 Bump to 1.28e.
13292
13293 2001-08-29 Akim Demaille <akim@epita.fr>
13294
13295 Version 1.28d.
13296
13297 2001-08-29 Paul Eggert <eggert@twinsun.com>
13298
13299 * src/bison.simple (yyparse): Don't take the address of an
13300 item before the start of an array, as that doesn't conform to
13301 the C Standard.
13302
13303 2001-08-29 Robert Anisko <anisko_r@epita.fr>
13304
13305 * doc/bison.texinfo (Location Tracking Calc): New node.
13306
13307 2001-08-29 Paul Eggert <eggert@twinsun.com>
13308
13309 * src/output.c (output): Do not define const, as this now
13310 causes more problems than it cures.
13311
13312 2001-08-29 Akim Demaille <akim@epita.fr>
13313
13314 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
13315 the nodes.
13316 Be sure to tag the `detailmenu'.
13317
13318 2001-08-29 Akim Demaille <akim@epita.fr>
13319
13320 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
13321 download in a tmp dir.
13322
13323 2001-08-28 Marc Autret <autret_m@epita.fr>
13324
13325 * config/depcomp: New file.
13326
13327 2001-08-28 Marc Autret <autret_m@epita.fr>
13328
13329 * doc/bison.1 (mandoc): Adjust.
13330 From Juan Manuel Guerrero.
13331
13332 2001-08-28 Marc Autret <autret_m@epita.fr>
13333
13334 * src/print_graph.c (print_state): Fix.
13335
13336 2001-08-27 Marc Autret <autret_m@epita.fr>
13337
13338 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
13339 char * members.
13340 Echo modifications to the functions prototypes.
13341 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
13342
13343 2001-08-27 Marc Autret <autret_m@epita.fr>
13344
13345 * src/vcg.c: Include `xalloc.h'.
13346 (add_colorentry): New.
13347 (add_classname): New.
13348 (add_infoname): New.
13349 * src/vcg.h: Add new prototypes.
13350
13351 2001-08-27 Akim Demaille <akim@epita.fr>
13352
13353 * Makefile.maint: Sync. again with CVS Autoconf.
13354
13355 2001-08-27 Akim Demaille <akim@epita.fr>
13356
13357 * Makefile.maint: Formatting changes.
13358 (po-update, cvs-update, update): New targets.
13359 (AMTAR): Remove.
13360
13361 2001-08-27 Akim Demaille <akim@epita.fr>
13362
13363 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
13364 * Makefile.maint: Sync. with CVS Autoconf.
13365
13366 2001-08-27 Marc Autret <autret_m@epita.fr>
13367
13368 * src/vcg.h (struct infoname_s): New.
13369 (struct colorentry_s): New.
13370 (graph_s): New fields {vertical,horizontal}_order in structure.
13371 Add `infoname' field.
13372 Add `colorentry' field;
13373 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
13374 (G_HORIZONTAL_ORDER): New.
13375 (G_INFONAME): New.
13376 (G_COLORENTRY): New.
13377 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
13378 Add output of `infoname'.
13379 Add output of `colorentry'.
13380
13381 2001-08-27 Marc Autret <autret_m@epita.fr>
13382
13383 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
13384 This one shadowed a global parameter.
13385
13386 2001-08-24 Marc Autret <autret_m@epita.fr>
13387
13388 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
13389 instead of `unsigned'.
13390 (print_state): Do not call obstack_object_size () in obstack_grow ()
13391 to avoid macro variables shadowing.
13392
13393 2001-08-23 Marc Autret <autret_m@epita.fr>
13394
13395 * src/lex.c (percent_table): Typo: s/naem/name/.
13396 Add graph option.
13397 Normalize new options declarations.
13398
13399 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
13400
13401 * tests/suite.at: Exercise %header_extension and %source_extension.
13402
13403 2001-08-16 Marc Autret <autret_m@epita.fr>
13404
13405 * src/reader.c (parse_dquoted_param): New.
13406 (parse_header_extension_decl): Use it.
13407 (parse_source_extension_decl): Likewise.
13408
13409 2001-08-16 Marc Autret <autret_m@epita.fr>
13410
13411 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
13412 (get_xxxx_str): Use assert () instead of complain ().
13413 Remove return invokations in default cases.
13414 (get_decision_str): Modify default behaviour. Remove second argument.
13415 Echo modifications on calls.
13416 (output_graph): Fix.
13417
13418 2001-08-16 Marc Autret <autret_m@epita.fr>
13419
13420 * src/getargs.c (usage): Update with ``-g, --graph''.
13421
13422 2001-08-16 Marc Autret <autret_m@epita.fr>
13423
13424 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
13425 (Option Cross Key): Likewise.
13426 * doc/bison.1: Update.
13427
1c8c2190
PB
134282001-09-25 Pascal Bart <pascal.bart@epita.fr>
13429
13430 * src/output.c (output_master_parser): Don't finish action_obstack.
13431 (output_parser): Don't care about the muscle action, here.
13432 (prepare): Copy the action_obstack in the action muscle.
13433 (output): Free action_obstack.
13434
180d45ba
PB
134352001-09-23 Pascal Bart <pascal.bart@epita.fr>
13436
13437 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
13438 will contain `%union' declaration.
13439 (parse_union_decl): Delete #line directive output.
13440 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
13441 informations about %union.
13442 (parse_union_decl): Copy the union_obstack in the muscle stype.
13443 * src/bison.simple: Add new #line directive.
13444 Add typdef %%stype YYSTYPE.
13445
c51d1a19
PB
134462001-09-23 Pascal Bart <pascal.bart@epita.fr>
13447
13448 * src/bison.simple: Add new `#line' directive.
13449
6f9344da
PB
134502001-09-22 Pascal Bart <pascal.bart@epita.fr>
13451
13452 * src/bison.simple: New `#line' directive.
13453 * src/output.c (output_parser): Support new dynamic muscle input_line.
13454
652def80
MA
134552001-09-22 Marc Autret <autret_m@epita.fr>
13456
13457 * src/output.c (output_master_parser): New.
13458 (output_parser): Be more re-entrant.
13459
25b222fa
MA
134602001-09-21 Marc Autret <autret_m@epita.fr>
13461
13462 * src/reader.c (copy_definition, parse_union_decl): Update and use
13463 `linef' muscle.
13464 (copy_action): Likewise.
13465 Use obstack_1grow ().
13466 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
13467
6bc35ae5
MA
134682001-09-21 Marc Autret <autret_m@epita.fr>
13469
13470 * src/options.c (option_table): Adjust.
13471 * src/lex.c (parse_percent_token): Fix.
13472
c0629aa1
PB
134732001-09-20 Pascal Bart <pascal.bart@epita.fr>
13474
13475 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 13476
82b6d266
PB
134772001-09-20 Pascal Bart <pascal.bart@epita.fr>
13478
13479 * src/lex.c (parse_percent_token): Change type of variable `tx', which
13480 is now an option_table_struct*.
13481 (option_strcmp): New function option_strcmp.
13482 (parse_percent_token): Call option_strcmp.
13483 * src/getargs.c (xalloc.h, options.h): Include it.
13484 (getargs): Call create_long_option_table.
13485 (getargs): Free longopts at the end of the function.
13486 (shortopts): Move in options.c.
13487 * src/options.c (create_long_option_table): New function. Convert
13488 information from option_table to option structure.
13489 * src/reader.c (options.h): Include it.
13490
13491 * src/Makefile.am: Adjust.
13492 * src/options.c (option_table): Create from longopts and percent_table.
13493 * src/getargs.c (longopts): Delete.
13494 * src/lex.c (struct percent_table_struct): Delete.
13495 (percent_table): Delete.
13496 (options.h): Include it.
13497 * src/options.c: Create.
13498 * src/options.h: Create.
13499 Declare enum opt_access_e.
13500 Define struct option_table_struct.
13501
75f5aaea
MA
135022001-09-20 Marc Autret <autret_m@epita.fr>
13503
13504 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
13505 sections of Bison.
13506
f508cb0a
PB
135072001-09-19 Pascal Bart <pascal.bart@epita.fr>
13508
13509 * src/bison.simple: s/%%filename/%%skeleton.
13510 * src/muscle_tab.c (getargs.h): Include it.
13511 (muscle_init): Insert new muscle skeleton.
13512
13105fc1
PB
135132001-09-18 Pascal Bart <pascal.bart@epita.fr>
13514
13515 * src/output.c (output_parser): Delete unused variable actions_dumped.
13516
b0c4483e
PB
135172001-09-07 Pascal Bart <pascal.bart@epita.fr>
13518
13519 * src/output.c (output): Delete call to reader_output_yylsp.
13520 * src/reader.c (reader): Likewise.
ba0fe3c7 13521 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 13522
11d82f03
MA
135232001-09-02 Marc Autret <autret_m@epita.fr>
13524
13525 * src/reader.c: Include muscle_tab.h.
13526 (parse_union_decl): Update.
13527 (parse_macro_decl): Rename parse_muscle_decl.
13528 Update to use renamed functions and variable.
13529 (read_declarations, copy_action, read_additionnal_code, : Updated
13530 with correct variables and functions names.
13531 (packsymbols, reader): Likewise.
342b8b6e 13532
11d82f03 13533 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 13534
11d82f03
MA
13535 * src/output.c: Include muscle_tab.h
13536 In all functions using macro_insert, change by using muscle_insert ().
13537 (macro_obstack): Rename muscle_obstack.
13538 Echo modifications in the whole file.
13539 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
13540 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
13541 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
13542
13543 * src/muscle_tab.h: Update double inclusion macros.
13544 (macro_entry_s): Rename muscle_entry_s.
13545 Update prototypes.
342b8b6e 13546
11d82f03
MA
13547 * src/muscle_tab.c: Include muscle_tab.h.
13548 Rename macro_tabble to muscle_table.
13549 (mhash1, mhash2, mcmp): Use muscle_entry.
13550 (macro_init): Rename muscle_init. Update.
13551 (macro_insert): Rename muscle_insert. Update.
13552 (macro_find): Rename muscle_find. Update.
13553
13554 * src/main.c: Include muscle_tab.h.
13555 (main): Call muscle_init ().
13556 * src/Makefile.am (bison_SOURCES): Echo modifications.
13557
93a37297
MA
135582001-09-02 Marc Autret <autret_m@epita.fr>
13559
f753cd62 13560 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 13561
f753cd62
MA
13562 * src/muscle_tab.c, src/muscle_tab.h: Add files.
13563
135642001-09-02 Marc Autret <autret_m@epita.fr>
13565
13566 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 13567
682d48cd
PB
135682001-09-01 Pascal Bart <pascal.bart@epita.fr>
13569
342b8b6e 13570 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
13571 filename.
13572
087c8fda
MA
135732001-09-01 Marc Autret <autret_m@epita.fr>
13574
13575 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
13576 to an explicit value to activate the feature. We do it here.
13577
dda680cb
PB
135782001-08-31 Pascal Bart <pascal.bart@epita.fr>
13579
13580 * src/output.c (prepare): Delete the `filename' muscule insertion.
13581 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
13582 (parse_union_decl): Likewise.
13583 * src/macrotab.c (macro_init): Initialize filename by infile.
13584
9e644e64
MA
135852001-08-31 Marc Autret <autret_m@epita.fr>
13586
13587 * src/bison.simple (YYLSP_NEEDED): New definition.
13588 * src/output.c (prepare): Add macro insertion of `locations_flag'
13589
17da6427
PB
135902001-08-31 Pascal Bart <pascal.bart@epita.fr>
13591
13592 * src/output.c (prepare): Delete insertion of previous muscles,
13593 and insert the `prefix' muscles.
13594 * src/macrotab.c (macro_init): Likewise.
13595 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 13596 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
13597 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
13598 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 13599 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
13600 name_prefix.
13601
e8cb70b9
PB
136022001-08-31 Pascal Bart <pascal.bart@epita.fr>
13603
13604 * src/main.c (main): Standardize.
13605 * src/output.c (output_table_data, output_parser): Likewise.
13606 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
13607
63c2d5de
MA
136082001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
13609
342b8b6e 13610 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
13611 %%epilogue.
13612 * src/output.c (output): Rename %%declarations to %%prologue.
13613 * src/bison.simple: Echo modifications.
342b8b6e 13614
d8cb5183
MA
136152001-08-31 Marc Autret <autret_m@epita.fr>
13616
13617 * src/reader.c (readgram): CleanUp.
13618 (output_token_defines): Likewise.
13619 (packsymbols): Likewise.
13620 (reader): Likewise.
13621 * src/output.c (output): CPP-out useless code.
13622
6c686258
PB
136232001-08-31 Pascal Bart <pascal.bart@epita.fr>
13624
342b8b6e 13625 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
13626 output_trailers and output_headers.
13627 * src/output.h: Remove obsolete functions prototypes of output_headers
13628 and output_trailers.
13629
8f451ef7
PB
136302001-08-30 Pascal Bart <pascal.bart@epita.fr>
13631
13632 * src/main.c: Include macrotab.h.
342b8b6e 13633 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
13634 Adjust functions prototypes.
13635 * src/macrotab.c (macro_insert): Constify key and value.
13636 (macro_find): Constify key.
13637 (macro_insert): Include 'xalloc.h'
13638 (macro_insert): Use XMALLOC.
13639 (macro_find): Constify return value.
13640 * src/output.c (output_table_data): Rename table to table_data.
13641 (output_parser): Constify macro_key, macro_value.
13642
997b6fd0 136432001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
13644
13645 * src/reader.c (parse_skel_decl): New.
342b8b6e 13646 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
13647 * src/lex.h (token_t): New token `tok_skel'.
13648 * src/lex.c (percent_table): Add skeleton option entry.
13649 Standardize.
13650
ff48177d
MA
136512001-08-29 Marc Autret <autret_m@epita.fr>
13652
13653 * src/bison.simple: Add %%user_code directive at the end.
13654 * src/reader.c (read_additionnal_code): New.
13655 (reader): Use it.
13656 * src/output.c (output_program): Remove.
13657 (output): Update.
13658
b33160bf
MA
136592001-08-28 Marc Autret <autret_m@epita.fr>
13660
13661 * src/output.c (output_actions): Clean up.
4e5caae2 13662 (output_gram): CPP-out useless code.
b33160bf
MA
13663 * src/reader.c (reader): Clean up, CPP-out useless code.
13664
d1a2daf7
PB
136652001-08-28 Pascal Bart <pascal.bart@epita.fr>
13666
342b8b6e 13667 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 13668 directive.
d1a2daf7
PB
13669 * src/bison.simple: Add `%%definitions'.
13670
2b763dfe
MA
136712001-08-28 Marc Autret <autret_m@epita.fr>
13672
13673 * config/depcomp: New file.
13674
f1a87ef6
PE
136752001-08-27 Paul Eggert <eggert@twinsun.com>
13676
13677 * src/bison.simple (yyparse): Don't take the address of an
13678 item before the start of an array, as that doesn't conform to
13679 the C Standard.
13680
82e236e2
RA
136812001-08-27 Robert Anisko <robert.anisko@epita.fr>
13682
f1a87ef6 13683 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
13684 obstack. It was done too late here.
13685
13686 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
13687 completely wrong.
13688 (reader): Initialize the macro obstack here, since we need it to grow
13689 '%define' directives.
13690
13691 * src/reader.h: Declare the macro obstack as extern.
13692
b0cfa28a
RA
136932001-08-27 Robert Anisko <robert.anisko@epita.fr>
13694
13695 * src/output.c (output_parser): Fix. Store single '%' characters in
13696 the output obstack instead of throwing them away.
13697
6fc74234
AD
136982001-08-27 Akim Demaille <akim@epita.fr>
13699
13700 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
13701
9c76d118
RA
137022001-08-25 Robert Anisko <robert.anisko@epita.fr>
13703
13704 * lib/Makefile.am: Adjust.
13705
a8289c62
RA
137062001-08-25 Robert Anisko <robert.anisko@epita.fr>
13707
13708 * src/bison.simple: Update and add '%%' directives.
13709
b6610515
RA
137102001-08-25 Robert Anisko <robert.anisko@epita.fr>
13711
13712 * src/reader.c (reader): Remove calls to 'output_headers' and
13713 'output_trailers'. Remove some C output.
13714 (readgram): Disable a piece of code that was writing a default
13715 definition for 'YYSTYPE'.
13716 (reader_output_yylsp): Remove.
13717 (packsymbols): Output token defintions to a macro.
13718 (copy_definition): Disable C output.
6fc74234 13719
b6610515
RA
13720 * src/reader.c (parse_macro_decl): New function used to parse macro
13721 declarations.
13722 (copy_string2): Put the body of copy_string into this new function.
13723 Add a parameter to let the caller choose whether he wants to copy the
13724 string delimiters or not.
13725 (copy_string): Be a simple call to copy_string2 with the last argument
13726 bound to true.
13727 (read_declarations): Add case for macro definition.
13728 (copy_identifier): New.
6fc74234 13729 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
13730 rather than lex.
13731
26f609ff
RA
137322001-08-25 Robert Anisko <robert.anisko@epita.fr>
13733
13734 * src/output.c (prepare): Add prefixed names.
13735 (output_parser): Output semantic actions.
13736 (output_parser): Fix bug on '%%line' directives.
6fc74234 13737
26f609ff
RA
13738 * src/output.c (output_headers): Remove. The C code printed by this
13739 function should now be in the skeletons.
13740 (output_trailers): Remove.
13741 (output): Disable call to 'reader_output_yylsp'.
13742 (output_rule_data): Do not output tables to the table obstack.
13743
13744 * src/output.c: Remove some C dedicated output.
13745 Improve the use of macro and output obstacks.
13746 (output_defines): Remove.
6fc74234 13747
26f609ff
RA
13748 * src/output.c (output_token_translations): Associate 'translate'
13749 table with a macro. No output to the table obstack.
13750 (output_gram): Same for 'rhs' and 'prhs'.
13751 (output_stos): Same for 'stos'.
13752 (output_rule_data): Same for 'r1' and 'r2'.
13753 (token_actions): Same for 'defact'.
13754 (goto_actions): Same for 'defgoto'.
13755 (output_base): Same for 'pact' and 'pgoto'.
13756 (output_table): Same for 'table'.
13757 (output_check): Same for 'check'.
6fc74234 13758
26f609ff
RA
13759 * src/output.c (output_table_data): New function.
13760 (output_short_table): Remove.
13761 (output_short_or_char_table): Remove.
6fc74234 13762
26f609ff
RA
13763 * src/output.c (output_parser): Replace most of the skeleton copy code
13764 with something new. Skeletons are now processed character by character
13765 rather than line by line, and Bison looks for '%%' macros. This is the
13766 first step in making Bison's output process (a lot) more flexible.
13767 (output_parser): Use the macro table.
13768
6f43b113
RA
137692001-08-25 Robert Anisko <robert.anisko@epita.fr>
13770
13771 * src/main.c (main): Initialize the macro table.
13772
dd3127cf
RA
137732001-08-25 Robert Anisko <robert.anisko@epita.fr>
13774
13775 * src/lex.c (percent_table): Add tok_define.
13776 * src/lex.h: Add tok_define.
13777
aa321494
RA
137782001-08-25 Robert Anisko <robert.anisko@epita.fr>
13779
13780 * src/macrotab.c: New file.
13781 * src/macrotab.h: New file.
13782 * src/Makefile.am: Update.
13783
68bd3b6b
RA
137842001-08-25 Robert Anisko <robert.anisko@epita.fr>
13785
13786 * lib/hash.c: New file.
13787 * lib/hash.h: New file.
13788 * lib/Makefile.am: Update.
13789
45f8dd1e
AD
137902001-08-15 Akim Demaille <akim@epita.fr>
13791
13792 Version 1.28c.
13793
40a64a7a 137942001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
13795
13796 * src/reader.c (readgram): Indent output macro YYSTYPE.
13797 (packsymbols): Likewise.
13798 (output_token_defines): Likewise.
13799 * src/files.c: Standardize.
13800 (compute_header_macro): New.
13801 (defines_obstack_save): New. Use compute_header_macro.
13802 (output_files): Update. Use defines_obstack_save.
13803
f9a8293a
AD
138042001-08-15 Akim Demaille <akim@epita.fr>
13805
13806 * doc/bison.texinfo (Table of Symbols): Document
13807 YYSTACK_USE_ALLOCA.
13808
150ca7a7
AD
138092001-08-15 Akim Demaille <akim@epita.fr>
13810
13811 * missing: Update from CVS Automake.
13812 * config/config.guess, config/config.sub, config/texinfo.tex:
13813 Update from gnu.org.
13814
69b5cec4
AD
138152001-08-15 Akim Demaille <akim@epita.fr>
13816
13817 * Makefile.maint: Sync with CVS Autoconf.
13818
f2b5126e
PB
138192001-08-14 Pascal Bart <pascal.bart@epita.fr>
13820
69b5cec4 13821 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
13822 `fdl.texi'.
13823 * doc/fdl.texi: Add to package.
13824
4ecbf796
MA
138252001-08-14 Marc Autret <autret_m@epita.fr>
13826
13827 Turn on %{source,header}_extension features.
13828
69b5cec4 13829 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
13830 source_extension.
13831 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 13832 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
13833 between options.
13834
95fb5662
MA
138352001-08-14 Marc Autret <autret_m@epita.fr>
13836
13837 * src/files.c (compute_base_names): Add extensions computing when
13838 `--file-prefix' used.
13839 Standardize function calls.
13840
78d09da9
MA
138412001-08-13 Marc Autret <autret_m@epita.fr>
13842
69b5cec4 13843 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
13844 defining it (defined but null disables alloca).
13845
5a009f2c
MA
138462001-08-13 Marc Autret <autret_m@epita.fr>
13847
13848 * src/bison.simple (_yy_memcpy): CPP reformat.
13849
1e41465a
PB
138502001-08-13 Pascal Bart <pascal.bart@epita.fr>
13851
13852 * tests/atconfig.in (CPPFLAGS): Fix.
13853
c67a198d
PB
138542001-08-10 Pascal Bart <pascal.bart@epita.fr>
13855
79282c6c 13856 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
13857 `gpl.texi'.
13858 * doc/gpl.texi: Add to package.
13859
09a6de7e
MA
138602001-08-10 Marc Autret <autret_m@epita.fr>
13861
13862 * src/print_graph.h: Fix.
13863 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
13864
b77b9ee0
AD
138652001-08-10 Akim Demaille <akim@epita.fr>
13866
13867 * src/system.h: Provide default declarations for stpcpy, strndup,
13868 and strnlen.
13869
3e259915
MA
138702001-08-10 Robert Anisko <anisko_r@epita.fr>
13871
13872 * doc/bison.texinfo (Locations): Update @$ stuff.
13873
ca96bc2d
MA
138742001-08-09 Robert Anisko <anisko_r@epita.fr>
13875
13876 * src/bison.simple (YYLLOC_DEFAULT): Update.
13877 (yyparse): Adjust.
13878
fdc6758b
MA
138792001-08-08 Marc Autret <autret_m@epita.fr>
13880
b77b9ee0 13881 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
13882 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
13883 Reported by Fabrice Bauzac.
957d4dbf 13884
600cad3b
MA
138852001-08-08 Marc Autret <autret_m@epita.fr>
13886
13887 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
13888 * src/vcg.c (output_node): Fix.
13889 * src/vcg.h: Cleanup.
13890 * src/print_graph.c: Add comments.
b77b9ee0 13891 (node_output_size): New global variable. Simplify the formatting of
600cad3b 13892 the VCG graph output.
b77b9ee0 13893 (print_actions): Unused code is now used. It notifies the final state
600cad3b 13894 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 13895 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
13896 blue.
13897 Get the current node name and node_obstack by argument.
13898 (node_obstack): New variable.
13899 (print_state): Manage node_obstack.
13900 (print_core): Use node_obstack given by argument.
13901 A node is not only computed here but in print_actions also.
13902 (print_graph): CPP out useless code instead of commenting it.
13903
976e528f
AD
139042001-08-07 Pascal Bart <pascal.bart@epita.fr>
13905
13906 * tests/atconfig.in (CPPFLAGS): Fix.
13907
20e8e5ca
AD
139082001-08-07 Akim Demaille <akim@epita.fr>
13909
13910 * src/print_graph.c (quote): New.
13911 (print_core): Use it.
13912
957d4dbf 139132001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 13914
3e3da797
AD
13915 * src/vcg.c (complain.h): Include it.
13916 Unepitaize `return' invocations.
c4b66126 13917 [NDEBUG] (main): Remove.
79282c6c 13918 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
13919 * src/files.c (open_files): Initialize graph_obstack.
13920 * src/print_graph.c (print_actions): CPP out useless code.
13921 (print_core): Don't output the last `\n' in labels.
13922 Use `quote'.
13923 * src/files.c (output_files): Output the VCG file.
13924 * src/main.c (main): Invoke print_graph ();
3e3da797 13925
957d4dbf 139262001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
13927
13928 Automaton VCG graph output.
13929 Using option ``-g'' or long option ``--graph'', you can generate
13930 a gram_filename.vcg file containing a VCG description of the LALR (1)
13931 automaton of your grammar.
13932
13933 * src/main.c: Call to print_graph() function.
13934 * src/getargs.h: Update.
13935 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
13936 (graph_flag): New flag.
13937 (longopts): Update.
13938 (getargs): Add case `g'.
13939 * src/files.c (graph_obstack): New obstack struct.
13940 (open_files): Initialize new obstack.
13941 (output_files): Saves graph_obstack if required.
13942 * src/files.h (graph_obstack): New extern declaration.
13943 * src/Makefile.am: Add new source files.
13944
927c1557 139452001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
13946
13947 * src/print_graph.c, src/print_graph.h (graph): New.
13948 * src/vcg.h: New file.
13949 * src/vcg.c: New file, VCG graph handling.
13950
7333d403
AD
139512001-08-06 Marc Autret <autret_m@epita.fr>
13952
13953 Add of %source_extension and %header_extension which specify
13954 the source or/and the header output file extension.
13955
13956 * src/files.c (compute_base_names): Remove initialisation of
13957 src_extension and header_extension.
13958 (compute_exts_from_gf): Update.
13959 (compute_exts_from_src): Update.
13960 (output_files): Update.
13961 * src/reader.c (parse_header_extension_decl): New.
13962 (parse_source_extension_decl): New.
13963 (read_declarations): New case statements for the new tokens.
13964 * src/lex.c (percent_table): Add entries for %source_extension
13965 and %header_extension.
13966 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
13967
84163231
AD
139682001-08-06 Marc Autret <autret_m@epita.fr>
13969
13970 * configure.in: Bump to 1.28c.
13971 * doc/bison.texinfo: Texinfo thingies.
13972
8303fc42
AD
139732001-08-04 Pascal Bart <pascal.bart@epita.fr>
13974
13975 * tests/atconfig.in (CPPFLAGS): Add.
13976 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
13977
70a84437
AD
139782001-08-03 Akim Demaille <akim@epita.fr>
13979
13980 Version 1.28b.
13981
2ce10144
AD
139822001-08-03 Akim Demaille <akim@epita.fr>
13983
13984 * tests/Makefile.am (check-local): Ship testsuite.
13985 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
13986 Include `string.h'.
13987
1e3e4bc1
AD
139882001-08-03 Akim Demaille <akim@epita.fr>
13989
13990 * configure.in: Try using -Wformat when compiling.
13991
42b45b7f
AD
139922001-08-03 Akim Demaille <akim@epita.fr>
13993
13994 * configure.in: Bump to 1.28b.
13995
8f13fe33
AD
139962001-08-03 Akim Demaille <akim@epita.fr>
13997
13998 * src/complain.c: Adjust strerror_r portability issues.
13999
b37ba92c
AD
140002001-08-03 Akim Demaille <akim@epita.fr>
14001
14002 Version 1.28a.
14003
b0ce6046
AD
140042001-08-03 Akim Demaille <akim@epita.fr>
14005
14006 * src/getargs.c, src/getarg.h (skeleton)): Constify.
14007 * src/lex.c (literalchar): Avoid name clashes on `buf'.
14008 * src/getargs.c: Include complain.h.
14009 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
14010 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
14011
d01c415b
AD
140122001-08-03 Akim Demaille <akim@epita.fr>
14013
14014 * src/reader.c (readgram): Display hidden chars in error messages.
14015
459dd1a6
AD
140162001-08-03 Akim Demaille <akim@epita.fr>
14017
14018 Update to gettext 0.10.39.
14019
53b74c0c
AD
140202001-08-03 Akim Demaille <akim@epita.fr>
14021
14022 * lib/strspn.c: New.
14023
234a3be3
AD
140242001-08-01 Marc Autret <autret_m@epita.fr>
14025
14026 * doc/bison.texinfo: Update.
14027 * doc/bison.1 (mandoc): Update.
14028 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
14029 * src/files.c: Support output files extensions computing.
14030 (src_extension): New static variable.
14031 (header_extension): New static variable.
14032 (tr): New function.
14033 (get_extension_index): New function, gets the index of an extension
14034 filename in a string.
14035 (compute_exts_from_gf): New function, computes extensions from the
14036 grammar file extension.
14037 (compute_exts_from_src): New functions, computes extensions from the
14038 C source file extension, file given by ``-o'' option.
14039 (compute_base_names): Update.
14040 (output_files): Update.
14041
847bf1f5
AD
140422001-08-01 Robert Anisko <anisko_r@epita.fr>
14043
d995fee7 14044 * doc/bison.texi: Document @$.
847bf1f5
AD
14045 (Locations): New section.
14046
d074a105
AD
140472001-07-18 Akim Demaille <akim@epita.fr>
14048
14049 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
14050 * config/prev-version.txt, config/move-if-change: New.
14051 * Makefile.am: Adjust.
14052
3419715d
AD
140532001-07-08 Pascal Bart <pascal.bart@epita.fr>
14054
14055 * src/bison.simple (yyparse): Suppress warning `comparaison
14056 between signed and unsigned'.
14057
62ab6972
AD
140582001-07-05 Pascal Bart <pascal.bart@epita.fr>
14059
14060 * src/getargs.h (raw_flag): Remove.
14061 * src/getargs.c: Die on `-r'/`--raw'.
14062 * src/lex.c (parse_percent_token): Die on `%raw'.
14063 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
14064 * tests/calc.at: Suppress test with option `--raw'.
14065
1e24cc5b
AD
140662001-07-14 Akim Demaille <akim@epita.fr>
14067
14068 * config/: New.
14069 * configure.in: Require Autoconf 2.50.
14070 Update to gettext 0.10.38.
14071
32dfccf8
AD
140722001-03-16 Akim Demaille <akim@epita.fr>
14073
14074 * doc/bison.texinfo: ANSIfy the examples.
14075
cd5bd6ac
AD
140762001-03-16 Akim Demaille <akim@epita.fr>
14077
14078 * getargs.c (skeleton): New variable.
14079 (longopts): --skeleton is a new option.
14080 (shortopts, getargs): -S is a new option.
14081 * getargs.h: Declare skeleton.
14082 * output.c (output_parser): Use it.
14083
5141b016
AD
140842001-03-16 Akim Demaille <akim@epita.fr>
14085
14086 * m4/strerror_r.m4: New.
14087 * m4/error.m4: Run AC_FUNC_STRERROR_R.
14088 * lib/error.h, lib/error.c: Update.
14089
447992b9
AD
140902001-03-16 Akim Demaille <akim@epita.fr>
14091
14092 * src/getargs.c (longopts): Clean up.
14093
274d42ce
AD
140942001-02-21 Akim Demaille <akim@epita.fr>
14095
14096 * src/reader.c (gensym): `gensym_count' is your own.
14097 Use a static buf to create the symbol name, as token_buffer is no
14098 longer a buffer.
14099
22c821f3
AD
141002001-02-08 Akim Demaille <akim@epita.fr>
14101
14102 * src/conflicts.c (conflict_report): Be sure not to append to res
14103 between two calls, which could happen if both first sprintf were
14104 skipped, but not the first cp += strlen.
14105
18569462
AD
141062001-02-08 Akim Demaille <akim@epita.fr>
14107
14108 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
14109 New, from fileutils 4.0.37.
14110 * configure.in: Require Autoconf 2.49c. I took some time before
14111 making this decision. This is the only way out for portability
14112 issues in Bison, it would mean way too much duplicate effort to
14113 import in Bison features implemented in 2.49c since 2.13.
14114 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
14115
0d8f3c8a
AD
141162001-02-02 Akim Demaille <akim@epita.fr>
14117
14118 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 14119 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 14120
f17bcd1f
AD
141212001-01-19 Akim Demaille <akim@epita.fr>
14122
14123 Get rid of the ad hoc handling of token_buffer in the scanner: use
14124 the obstacks.
14125
14126 * src/lex.c (token_obstack): New.
14127 (init_lex): Initialize it. No longer call...
14128 (grow_token_buffer): this. Remove it.
14129 Adjust all the places which used it to use the obstack.
14130
511e79b3
AD
141312001-01-19 Akim Demaille <akim@epita.fr>
14132
14133 * src/lex.h: Rename all the tokens:
14134 s/\bENDFILE\b/tok_eof/g;
14135 s/\bIDENTIFIER\b/tok_identifier/g;
14136 etc.
14137 Let them be enums, not #define, to ease debugging.
14138 Adjust all the code.
14139
0d6508ef
AD
141402001-01-18 Akim Demaille <akim@epita.fr>
14141
14142 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
14143 * src/lex.c (maxtoken, grow_token_buffer): Static.
14144
6deb4447
AD
141452001-01-18 Akim Demaille <akim@epita.fr>
14146
14147 Since we now use obstacks, more % directives can be enabled.
14148
14149 * src/lex.c (percent_table): Also accept `%yacc',
14150 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
14151 `%debug'.
14152 Handle the actions for `%semantic_parser' and `%pure_parser' here,
14153 instead of returning a token.
14154 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
14155 * src/reader.c (read_declarations): Adjust.
14156 * src/files.c (open_files): Don't call `compute_base_names', don't
14157 compute `attrsfile' since they depend upon data which might be
14158 *in* the input file now.
14159 (output_files): Do it here.
14160 * src/output.c (output_headers): Document the fact that this patch
14161 introduces a guaranteed SEGV for semantic parsers.
14162 * doc/bison.texinfo: Document them.
14163 * tests/suite.at: Exercise these %options.
14164
ff4423cc
AD
141652000-12-20 Akim Demaille <akim@epita.fr>
14166
14167 Also handle the output file (--verbose) with obstacks.
14168
14169 * files.c (foutput): Remove.
14170 (output_obstack): New.
14171 Adjust all dependencies.
14172 * src/conflicts.c: Return a string.
14173 * src/system.h (obstack_grow_string): Rename as...
14174 (obstack_sgrow): this. Be ready to work with non literals.
14175 (obstack_fgrow4): New.
14176
956dba3a
AD
141772000-12-20 Akim Demaille <akim@epita.fr>
14178
14179 * src/files.c (open_files): Fix the computation of short_base_name
14180 in the case of `-o foo.tab.c'.
14181
337bab46
AD
141822000-12-20 Akim Demaille <akim@epita.fr>
14183
14184 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
14185 (copy_dollar): Now that everything uses obstacks, get rid of the
14186 FILE * parameters.
14187
5d3214b8
AD
141882000-12-20 Akim Demaille <akim@epita.fr>
14189
14190 * src/files.c (open_files): Actually the `.output' file is based
14191 on the short_base_name, not base_name.
14192 * tests/suite.at (Checking output file names): Adjust.
14193
29092a57
AD
141942000-12-20 Akim Demaille <akim@epita.fr>
14195
14196 * src/bison.s1: Remove, we now use directly...
14197 * src/bison.simple: this.
14198 * src/Makefile.am: Use pkgdata instead of data.
14199
ea5607fd
AD
142002000-12-20 Akim Demaille <akim@epita.fr>
14201
14202 * src/files.c (guard_obstack): New.
14203 (open_files): Initialize it.
14204 (output_files): Dump it...
14205 * src/files.h: Export it.
14206 * src/reader.c (copy_guard): Use it.
14207
27110317
AD
142082000-12-19 Akim Demaille <akim@epita.fr>
14209
14210 * src/files.c (outfile, defsfile, actfile): Removed as global
14211 vars.
14212 (open_files): Don't compute them.
14213 (output_files): Adjust.
14214 (base_name, short_base_name): Be global.
14215 Adjust dependencies.
14216
19c50364
AD
142172000-12-19 Akim Demaille <akim@epita.fr>
14218
14219 * src/files.c (strsuffix): New.
14220 (stringappend): Be just like strcat but allocate.
14221 (base_names): Eve out from open_files.
14222 Try to simplify the rather hairy computation of base_name and
14223 short_base_name.
14224 (open_files): Use it.
14225 * tests/suite.at (Checking output file names): New test.
14226
573c1d9f
AD
142272000-12-19 Akim Demaille <akim@epita.fr>
14228
14229 * src/system.h (obstack_grow_literal_string): Rename as...
14230 (obstack_grow_string): this.
14231 * src/output.c (output_parser): Recognize `%% actions' instead of
14232 `$'.
14233 * src/bison.s1: s/$/%% actions/.
14234 * src/bison.hairy: Likewise.
14235
ef7ddedd
AD
142362000-12-19 Akim Demaille <akim@epita.fr>
14237
14238 * src/output.c (output_parser): Compute the `#line' lines when
14239 there are.
14240 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
14241 Suggested by Hans Aberg.
14242
ff61dabd
AD
142432000-12-19 Akim Demaille <akim@epita.fr>
14244
14245 Let the handling of the skeleton files be local to the procedures
14246 that use it.
14247
14248 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
14249 longer static.
14250 (fparser, open_extra_files): Remove.
14251 (open_files, output_files): Don't take care of fparser.
14252 * src/files.h: Adjust.
14253 * src/output.c (output_parser): Open and close the file to the
14254 skeleton.
14255 * src/reader.c (read_declarations): When %semantic_parser, open
14256 fguard.
14257
55b96341
AD
142582000-12-19 Akim Demaille <akim@epita.fr>
14259
14260 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
14261 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
14262
358c15b7
AD
142632000-12-19 Akim Demaille <akim@epita.fr>
14264
14265 * src/files.c (open_files): Yipee! We no longer need all the code
14266 looking for `/tmp' since we have no tmp file.
14267
7de3329e
AD
142682000-12-19 Akim Demaille <akim@epita.fr>
14269
14270 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
14271 New macros.
14272 * src/files.c (open_files): Less dependency on MSDOS etc.
14273
3abcd459
AD
142742000-12-14 Akim Demaille <akim@epita.fr>
14275
14276 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
14277 Provide a default definition.
14278 Use it when executing the default @ action.
14279 * src/reader.c (reader_output_yylsp): No longer include
14280 `timestamp' and `text' in the default YYLTYPE.
14281
2a91a95e
AD
142822000-12-12 Akim Demaille <akim@epita.fr>
14283
14284 * src/reader.c (copy_definition, parse_union_decl, copy_action)
14285 (copy_guard): Quote the file names.
14286 Reported by Laurent Mascherpa.
14287
14d3eb9b
AD
142882000-12-12 Akim Demaille <akim@epita.fr>
14289
14290 * src/output.c (output_headers, output_program, output): Be sure
14291 to escape special characters when outputting filenames.
14292 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
14293 (output_headers): Don't depend on them, Use ACTSTR.
14294
d7045ec6
AD
142952000-11-17 Akim Demaille <akim@epita.fr>
14296
14297 * lib/obstack.h: Formatting changes.
14298 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
14299 prevents type checking.
14300 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
14301 cast the value to (void *): assigning a `foo *' to a `void *'
14302 variable is valid.
14303 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
14304 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
14305 append characters.
14306
6fd54b73
AD
143072000-11-17 Akim Demaille <akim@epita.fr>
14308
14309 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
14310 as...
14311 (suite.m4, regression.m4, calc.m4): these.
14312 * tests/atgeneral.m4: Update from CVS Autoconf.
14313
4c50eae6
AD
143142000-11-17 Akim Demaille <akim@epita.fr>
14315
14316 * tests/regression.m4 (%union and --defines): New test,
14317 demonstrating a current bug in the obstack implementation.
14318
a35f64ea
AD
143192000-11-17 Akim Demaille <akim@epita.fr>
14320
14321 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
14322 macros.
14323 Use them to declare the variables which are global or local to
14324 `yyparse'.
14325
7de23534
AD
143262000-11-17 Akim Demaille <akim@epita.fr>
14327
14328 * acconfig.h: Remove, no longer used.
14329
aa7815f5
AD
143302000-11-07 Akim Demaille <akim@epita.fr>
14331
14332 * src: s/Copyright (C)/Copyright/g.
14333
5af1f549
AD
143342000-11-07 Akim Demaille <akim@epita.fr>
14335
14336 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
14337 defining.
14338 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
14339
553e2b22
AD
143402000-11-07 Akim Demaille <akim@epita.fr>
14341
14342 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
14343 Merge in a single CPP if/else.
14344
8a4f41d6
AD
143452000-11-07 Akim Demaille <akim@epita.fr>
14346
14347 * src/output.c (output): Remove useless variables.
14348 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
14349 argument `data' for consistency with the prototypes.
14350 Qualify it `const'.
14351 (obstack_copy, obstack_copy0): Rename the second argument as
14352 `address' for consistency. Qualify it `const'.
14353 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
14354 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
14355 `const' their input argument (`data' or `address').
14356 Adjust the corresponding macros to include `const' in casts.
14357
095a3fb5
AD
143582000-11-03 Akim Demaille <akim@epita.fr>
14359
14360 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
14361 s/PFILE1/BISON_HAIRY/.
14362 Adjust dependencies.
14363
d1cdce7c
AD
143642000-11-03 Akim Demaille <akim@epita.fr>
14365
090c5ebf 14366 For some reason, this was not applied.
d1cdce7c
AD
14367
14368 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
14369 `unlink': it's no longer used.
14370
9311529b
AD
143712000-11-03 Akim Demaille <akim@epita.fr>
14372
14373 * src/files.c (skeleton_find): New function, eved out of...
14374 (open_files, open_extra_files): here.
14375
d8880f69
AD
143762000-11-03 Akim Demaille <akim@epita.fr>
14377
14378 Don't use `atexit'.
14379
14380 * src/files.c (obstack_save): New function.
14381 (done): Rename as...
14382 (output_files): this.
14383 Use `obstack_save'.
14384 * src/main.c (main): Don't use `atexit' to register `done', since
14385 it no longer has to remove tmp files, just call `output_files'
14386 when there are no errors.
14387
0dbb648e
AD
143882000-11-02 Akim Demaille <akim@epita.fr>
14389
14390 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
14391 `unlink': it's no longer used.
14392 * src/files.h: Formatting changes.
14393
896fe5c1
AD
143942000-11-02 Akim Demaille <akim@epita.fr>
14395
14396 Remove the last uses of mktemp and unlink/delete.
14397
14398 * src/files.c (fdefines, ftable): Removed.
14399 (defines_ostack, table_obstack): New.
14400 Adjust dependencies of the former into uses of the latter.
14401 * src/output.c (output_short_or_char_table, output_short_table):
14402 Convert to using obstacks.
14403 * src/reader.c (copy_comment2): Accept one FILE * and two
14404 obstacks.
14405 (output_token_defines, reader_output_yylsp): Use obstacks.
14406 * src/system.h (obstack_fgrow3): New.
1f65350a 14407 * po/POTFILES.in: Adjust.
896fe5c1 14408
dd60faec
AD
144092000-11-01 Akim Demaille <akim@epita.fr>
14410
14411 Change each use of `fattrs' into a use of `attrs_obstack'.
14412
14413 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
14414 * src/files.c (fattrs): Remove.
14415 (attrs_obstack): New.
14416 Adjust all dependencies.
14417 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
14418
8c7ebe49
AD
144192000-11-01 Akim Demaille <akim@epita.fr>
14420
14421 Introduce obstacks.
14422 Change each use of `faction' into a use of `action_obstack'.
14423
14424 * lib/obstack.h, lib/obstack.c: New files.
14425 * src/files.c (faction): Remove.
14426 (action_obstack): New.
14427 Adjust all dependencies.
14428
77aee789
AD
144292000-10-20 Akim Demaille <akim@epita.fr>
14430
14431 * lib/quote.h (PARAMS): New macro. Use it.
14432
43591cec
AD
144332000-10-16 Akim Demaille <akim@epita.fr>
14434
14435 * src/output.c (output_short_or_char_table): New function.
14436 (output_short_table, output_token_translations): Use it.
14437 (goto_actions): Use output_short_table.
14438
1e9798d5
AD
144392000-10-16 Akim Demaille <akim@epita.fr>
14440
14441 * src/symtab.c (bucket_new): New function.
14442 (getsym): Use it.
14443
14444 * src/output.c (output_short_table): New argument to display the
14445 comment associated with the table.
14446 Adjust dependencies.
14447 (output_gram): Use it.
14448 (output_rule_data): Nicer output layout for YYTNAME.
14449
f282676b
AD
144502000-10-16 Akim Demaille <akim@epita.fr>
14451
14452 * src/lex.c (read_typename): New function.
14453 (lex): Use it.
14454 * src/reader.c (copy_dollar): Likewise.
14455
550a72a3
AD
144562000-10-16 Akim Demaille <akim@epita.fr>
14457
14458 * src/reader.c (copy_comment2): Expect the input stream to be on
14459 the `/' which is suspected to open a comment, instead of being
14460 called after `//' or `/*' was read.
14461 (copy_comment, copy_definition, parse_union_decl, copy_action)
14462 (copy_guard): Adjust.
14463
131e2fef
AD
144642000-10-16 Akim Demaille <akim@epita.fr>
14465
14466 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
14467 `read_signed_integer'.
14468
79282c5a
AD
144692000-10-16 Akim Demaille <akim@epita.fr>
14470
14471 * src/reader.c (copy_dollar): New function.
14472 (copy_guard, copy_action): Use it.
14473
ff4a34be
AD
144742000-10-16 Akim Demaille <akim@epita.fr>
14475
14476 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
14477 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
14478 New files, from Fileutils 4.0.27.
14479 * src/main.c (printable_version): Remove.
14480 * src/lex.c, src/reader.c: Use `quote'.
14481
144822000-10-04 Akim Demaille <akim@epita.fr>
14483
14484 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
14485
14ded682
AD
144862000-10-04 Akim Demaille <akim@epita.fr>
14487
14488 * doc/bison.texinfo: Various typos spotted by Neil Booth.
14489
8e03724b
AD
144902000-10-04 Akim Demaille <akim@epita.fr>
14491
14492 When a literal string is used to define two different tokens,
14493 `bison -v' segfaults.
14494 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
14495
14496 * tests/regression.m4: New file.
14497 Include the core of the sample provided by Piotr Gackiewicz.
14498 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
14499 properly.
14500
a9e64249
AD
145012000-10-04 Akim Demaille <akim@epita.fr>
14502
14503 * src/reader.c (parse_expect_decl): Keep `count' within the size
14504 of `buffer'.
14505 From Neil Booth.
14506
da9abf43
AD
145072000-10-02 Paul Eggert <eggert@twinsun.com>
14508
14509 * bison.s1 (yyparse): Assign the default value
14510 unconditionally, to avoid a GCC warning and make the parser a
14511 tad smaller.
14512
c33638bb
AD
145132000-10-02 Akim Demaille <akim@epita.fr>
14514
14515 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
14516 options.
14517
444c570a
AD
145182000-10-02 Akim Demaille <akim@epita.fr>
14519
14520 * src/derives.c, src/print.c, src/reduce.c: To ease the
14521 translation, move some `\n' out of the translated strings.
14522
89cab50d
AD
145232000-10-02 Akim Demaille <akim@epita.fr>
14524
14525 The location tracking mechanism is precious for parse error
14526 messages. Nevertheless, it is enabled only when `@n' is used in
14527 the grammar, which is a different issue (you can use it in error
14528 message, but not in the grammar per se). Therefore, there should
14529 be another means to enable it.
14530
14531 * src/getargs.c (getargs): Support `--locations'.
14532 (usage): Report it.
14533 * src/getargs.h (locationsflag): Export it.
14534 * src/lex.c (percent_table): Support `%locations'.
14535 * src/reader.c (yylsp_needed): Remove this variable, now replaced
14536 with `locationsflag'.
14537 * doc/bison.texinfo: Document `--locations' and `%locations'.
14538 Sort the options.
14539 * tests/calc.m4: Test it.
14540
14541 For regularity of the names, replace each
14542 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
14543 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
14544 In addition replace each `flag' with `_flag'.
14545
d6c2cba0
AD
145462000-10-02 Akim Demaille <akim@epita.fr>
14547
14548 Also test parse error messages, including with YYERROR_VERBOSE.
14549
14550 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
14551 associative).
14552 Use it to check the computations.
14553 Use it to check `nonassoc' is honored.
14554 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
14555 `--yyerror-verbose'.
14556 (_AT_CHECK_CALC): Adjust to this option.
14557 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
14558
5a35a6cb
AD
145592000-10-02 Akim Demaille <akim@epita.fr>
14560
14561 Test also `--verbose', `--defines' and `--name-prefix'. Testing
14562 the latter demonstrates a flaw in the handling of non debugging
14563 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
14564 was used in order to simplify:
14565
14566 #if YYDEBUG
14567 if (yydebug)
14568 {
14569 ...
14570 }
14571 #endif
14572
14573 into
14574
14575 if (yydebug)
14576 {
14577 ...
14578 }
14579
14580 unfortunately this leads to a CPP conflict when
14581 `--name-prefix=foo' is used since it produces `#define yydebug
14582 foodebug'.
14583
14584 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
14585 (YYDPRINTF): New macro.
14586 Spread its use.
14587 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
14588 the bison options.
14589 Also test `--verbose', `--defines' and `--name-prefix'.
14590
71da9eea
AD
145912000-10-02 Akim Demaille <akim@epita.fr>
14592
14593 Improve the readability of the produced parsers.
14594
14595 * src/bison.s1: Formatting changes.
14596 Improve the comment related to the `$' mark.
14597 (yydefault): Don't fall through to `yyresume': `goto' there.
14598 * src/output.c (output_parser): When the `$' is met, skip the end
14599 of its line.
14600 New variable, `number_of_dollar_signs', to check there's exactly
14601 one `$' in the parser skeleton.
14602
95e36146
AD
146032000-10-02 Akim Demaille <akim@epita.fr>
14604
14605 * lib/xstrdup.c: New file, from the fileutils.
14606 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
14607 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
14608 instead of strlen + xmalloc + strcpy.
14609 * src/symtab.c (copys): Remove, use xstrdup instead.
14610
d7020c20
AD
146112000-10-02 Akim Demaille <akim@epita.fr>
14612
14613 * src/gram.h (associativity): New enum type which replaces the
14614 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
14615 `right_assoc', `left_assoc' and `non_assoc'.
14616 Adjust all dependencies.
14617 * src/reader.c: Formatting changes.
14618 (LTYPESTR): Don't define it, use it as a literal in
14619 `reader_output_yylsp'.
14620 * src/symtab.h (symbol_class): New enum type which replaces the
14621 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
14622 `sunknown', `stoken and `snterm'.
14623
1916f98e
AD
146242000-10-02 Akim Demaille <akim@epita.fr>
14625
14626 * src/getargs.c (fixed_outfiles): Rename as...
14627 (yaccflag): for consistency and accuracy.
14628 Adjust dependencies.
14629
d7913476
AD
146302000-10-02 Akim Demaille <akim@epita.fr>
14631
14632 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
14633 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
14634 difficult and introduced a lot of core dump. It turns out that
14635 Bison used an implementation of `xmalloc' based on `calloc', and
14636 at various places it does depend upon the initialization to 0. I
14637 have not tried to isolate the pertinent places, and all the former
14638 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
14639 someone should address this issue.
14640
14641 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
14642 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
14643 files.
14644 Adjust dependencies.
14645 * src/warshall.h: New file.
14646 Propagate.
14647
340ef489
AD
146482000-10-02 Akim Demaille <akim@epita.fr>
14649
14650 Various anti-`extern in *.c' changes.
14651
14652 * src/system.h: Include `assert.h'.
14653
b2ca4022
AD
146542000-10-02 Akim Demaille <akim@epita.fr>
14655
14656 * src/state.h (nstates, final_state, first_state, first_shift)
14657 (first_reduction): Move their exportation from here...
14658 * src/LR0.h: to here.
14659 Adjust dependencies.
14660 * src/getargs.c (statisticsflag): New variable.
14661 Add support for `--statistics'.
14662 Adjust dependencies.
14663
14664 Remove a lot of now useless `extern' statements in most files.
14665
403b315b
AD
146662000-10-02 Akim Demaille <akim@epita.fr>
14667
14668 * src/LR0.h: New file.
14669 Propagate its use.
14670
07a58c13
AD
146712000-10-02 Akim Demaille <akim@epita.fr>
14672
14673 * src/print.h: New file.
14674 Propagate its use.
14675 * src/print.c: Formatting and ordering changes.
14676 (verbose, terse): Replace with...
14677 (print_results): this new function.
14678 Adjust dependencies.
14679
0619caf0
AD
146802000-10-02 Akim Demaille <akim@epita.fr>
14681
14682 * src/conflicts.c (conflict_report): New function.
14683 (conflict_log, verbose_conflict_log): Replace with...
14684 (print_conflicts): this function.
14685 Adjust dependencies.
14686 * src/conflicts.h: New file.
14687 Propagate its inclusion.
14688
3519ec76
AD
146892000-10-02 Akim Demaille <akim@epita.fr>
14690
14691 * src/nullable.h: New file.
14692 Propagate its inclusion.
14693 * src/nullable.c: Formatting changes.
14694
015acc48
AD
146952000-10-02 Akim Demaille <akim@epita.fr>
14696
14697 * src/reduce.h: New file.
14698 Propagate its inclusion.
14699 * src/reduce.c: Topological sort and other formatting changes.
14700 (bool, TRUE, FALSE): Move their definition to...
14701 * src/system.h: here.
14702
8963a27b
AD
147032000-10-02 Akim Demaille <akim@epita.fr>
14704
14705 * src/files.c: Formatting changes.
14706 (tryopen, tryclose, openfiles): Rename as...
14707 (xfopen, xfclose, open_files): this.
14708 (stringappend): static.
14709 * src/files.h: Complete the list of exported symbols.
14710 Propagate its use.
14711
a70083a3
AD
147122000-10-02 Akim Demaille <akim@epita.fr>
14713
14714 * src/reader.h: New file.
14715 Propagate its use instead of tedious list of `extern' and
14716 prototypes.
14717 * src/reader.c: Formatting changes, topological sort,
14718 s/register//.
14719
abadc117
AD
147202000-10-02 Akim Demaille <akim@epita.fr>
14721
14722 * src/lex.h: Prototype `lex.c' exported functions.
14723 * src/reader.c: Adjust.
14724 * src/lex.c: Formatting changes.
14725 (safegetc): Rename as...
14726 (xgetc): this.
14727
720d742f
AD
147282000-10-02 Akim Demaille <akim@epita.fr>
14729
14730 * src/lalr.h: New file.
14731 Propagate its inclusion instead of prototypes and `extern'.
14732 * src/lalr.c: Formatting changes, topological sorting etc.
14733
f2acea59
AD
147342000-10-02 Akim Demaille <akim@epita.fr>
14735
14736 * src/output.c (token_actions): Introduce a temporary array,
14737 YYDEFACT, that makes it possible for this function to use
14738 output_short_table.
14739
d019d655
AD
147402000-10-02 Akim Demaille <akim@epita.fr>
14741
14742 `user_toknums' is output as a `short[]' in `output.c', while it is
14743 defined as a `int[]' in `reader.c'. For consistency with the
14744 other output tables, `user_toknums' is now defined as a table of
14745 shorts.
14746
14747 * src/reader.c (user_toknums): Be a short table instead of an int
14748 table.
14749 Adjust dependencies.
14750
14751 Factor the short table outputs.
14752
14753 * src/output.c (output_short_table): New function.
14754 * src/output.c (output_gram, output_stos, output_rule_data)
14755 (output_base, output_table, output_check): Use it.
14756
6c89f1c1
AD
147572000-10-02 Akim Demaille <akim@epita.fr>
14758
14759 * src/output.c (output): Topological sort of the functions, in
14760 order to get rid of the `static' prototypes.
14761 No longer use `register'.
14762 * src/output.h: New file.
14763 Propagate its inclusion in files explicitly prototyping functions
14764 from output.c.
14765
d9efd181
AD
147662000-09-21 Akim Demaille <akim@epita.fr>
14767
14768 * src/atgeneral.m4: Update from Autoconf.
14769
c29240e7 147702000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
14771
14772 * src/closure.h: New file.
14773 * src/closure.c: Formatting changes, topological sort over the
14774 functions, use of closure.h.
14775 (initialize_closure, finalize_closure): Rename as...
14776 (new_closure, free_closure): these. Adjust dependencies.
14777 * src/LR0.c: Formatting changes, topological sort, use of
14778 cloture.h.
14779 (initialize_states): Rename as...
14780 (new_states): this.
14781 * src/Makefile.am (noinst_HEADERS): Adjust.
14782
499daa50
AD
147832000-09-20 Akim Demaille <akim@epita.fr>
14784
14785 * src/acconfig.h: Don't protect config.h against multiple
14786 inclusion.
14787 Don't define PARAMS.
14788 * src/system.h: Define PARAMS.
14789 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
14790 purpose of config.h. system.h must not try to fix wrong
14791 definitions in config.h.
14792
cc84fd5d
AD
147932000-09-20 Akim Demaille <akim@epita.fr>
14794
14795 * src/derives.h: New file.
14796 * src/main.c, src/derives.h: Use it.
14797 Formatting changes.
14798 * src/Makefile.am (noinst_HEADERS): Adjust.
14799
db5b3a89
AD
148002000-09-20 Akim Demaille <akim@epita.fr>
14801
14802 * tests/atgeneral.m4: Update from Autoconf.
14803 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
14804 (AT_CHECK_CALC): New macros.
14805 Use these macros to test bison with options `', `--raw',
14806 `--debug', `--yacc', `--yacc --debug'.
14807
ceed8467
AD
148082000-09-19 Akim Demaille <akim@epita.fr>
14809
14810 * src/output.c: Formatting changes.
14811 * src/machine.h: Remove, leaving its contents in...
14812 * src/system.h: here.
14813 Include stdio.h.
14814 Adjust all dependencies on stdio.h and machine.h.
14815 * src/getargs.h: New file.
14816 Let all `extern' declarations about getargs.c be replaced with
14817 inclusion of `getargs.h'.
14818 * src/Makefile.am (noinst_HEADERS): Adjust.
14819
14820 * tests/calc.m4 (yyin): Be initialized in main, not on the global
14821 scope.
14822 (yyerror): Returns void, not int.
14823 * doc/bison.texinfo: Formatting changes.
14824
05a1d24b
AD
148252000-09-19 Akim Demaille <akim@epita.fr>
14826
14827 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
14828 portable.
14829
cbd25751
AD
148302000-09-18 Akim Demaille <akim@epita.fr>
14831
14832 * configure.in: Append WARNING_CFLAGS to CFLAGS.
14833 * src/Makefile.am (INCLUDES): Don't.
14834 Be ready to fetch headers in lib/.
14835
13863333
AD
148362000-09-18 Akim Demaille <akim@epita.fr>
14837
14838 * doc/bison.texinfo: Update the copyright.
14839 ANSIfy and GNUify the examples.
14840 Remove the old menu.
14841
0d533154
AD
148422000-09-18 Akim Demaille <akim@epita.fr>
14843
14844 First set of tests: use the `calc' example from the documentation.
14845
14846 * src/bison.s1 (yyparse): Condition the code using `yytname' which
14847 is defined only when YYDEBUG is.
14848 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
14849 * src/files.c (tryopen, tryclose): Formatting changes.
14850 Move to the top and be static.
14851 * src/reader.c (read_signed_integer): Likewise.
14852 * tests/calc.m4: New file.
14853 * Makefile.am, suite.m4: Adjust.
14854 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
14855
e79137ac
AD
148562000-09-18 Akim Demaille <akim@epita.fr>
14857
14858 Add support for an Autotest test suite for Bison.
14859
14860 * m4/m4.m4, m4/atconfig.m4: New files.
14861 * m4/Makefile.am (EXTRA_DIST): Adjust.
14862 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
14863 files.
14864 * src/getargs.c: Display a more standard --version message.
14865 * src/reader.c (reader): Formatting changes.
14866 No longer depend upon VERSION_STRING.
14867 * configure.in: No longer use `dnl'.
14868 Set up the test suite and the new directory `tests/.
14869 (VERSION_STRING): Remove.
14870
27821bff
AD
148712000-04-14 Akim Demaille <akim@epita.fr>
14872
14873 * src/reader.c (copy_comment2): New function, same as former
14874 `copy_comment', but outputs into two FILE *.
14875 (copy_comment): Use it.
14876 (parse_union_decl): Use it.
14877 (get_type, parse_start_decl): Use the same `invalid' message.
14878 (parse_start_decl, parse_union_decl): Use the same `multiple'
14879 message.
14880 (parse_union_decl, copy_guard, copy_action): Use the same
14881 `unmatched' message.
14882 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
14883
cfe5fbc0
AD
148842000-03-31 Akim Demaille <akim@epita.fr>
14885
14886 * src/files.c (tryopen, tryclose): Move to the top.
14887 Be static.
14888
cb7db13e
AD
148892000-03-31 Akim Demaille <akim@epita.fr>
14890
14891 * src/main.c (main): Don't call `done', exit does it.
14892
a0f6b076
AD
148932000-03-31 Akim Demaille <akim@epita.fr>
14894
36281465
AD
14895 * allocate.c: s/return (foo)/return foo/.
14896 * lalr.c: Likewise.
14897 * LR0.c: Likewise.
14898 * output.c: Likewise.
14899 * reader.c: Likewise.
14900 * symtab.c: Likewise.
14901 * vmsgetargs.c: Likewise.
14902
149032000-03-31 Akim Demaille <akim@epita.fr>
14904
14905 Clean up the error reporting functions.
a0f6b076
AD
14906
14907 * src/report.c: New file.
14908 * src/report.h: Likewise.
14909 * src/Makefile.am: Adjust.
14910 * m4/error.m4: New file.
14911 * m4/Makefile.am: Adjust.
14912 * configure.in (jm_PREREQ_ERROR): Call it.
14913 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
14914 Remove.
14915 (fatal, fatals): Remove. All callers use complain.c::fatal.
14916 (warn, warni, warns, warnss, warnss): Remove. All callers use
14917 complain.c::complain.
14918 (toomany): Remove, use fatal instead.
14919 * src/files.c (done): No argument, use complain_message_count.
14920 * src/main.c (main): Register `done' to `atexit'.
14921
14922 * src/getargs.c (usage): More `fputs', less `fprintf'.
14923
18539825
AD
149242000-03-28 Akim Demaille <akim@epita.fr>
14925
14926 * lib/: New directory.
14927 * Makefile.am (SUBDIRS): Adjust.
14928 * configure.in: Adjust.
14929 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
14930 useless.
14931 * src/alloca.c: Moved to lib/.
14932 * src/getopt.c: Likewise.
14933 * src/getopt1.c: Likewise.
14934 * src/getopt.h: Likewise.
14935 * src/ansi2knr.c: Likewise.
14936 * src/ansi2knr.1: Likewise.
14937 * src/Makefile.am: Adjust.
14938 * lib/Makefile.am: New file.
14939
9f306f2a
AD
149402000-03-28 Akim Demaille <akim@epita.fr>
14941
14942 * src/getargs.c (usage): Refresh the help message.
14943
0ba347b6
AD
149442000-03-17 Akim Demaille <akim@epita.fr>
14945
14946 * src/getopt1.c: Updated from textutils 2.0e
14947 * src/getopt.c: Likewise.
14948 * src/getopt.h: Likewise.
14949
dbe7f271
AD
149502000-03-17 Akim Demaille <akim@epita.fr>
14951
14952 * src/Makefile.am (bison.simple): Fix the awk program: quote only
14953 the file name, not the whole `#line LINE FILE'.
14954
75bbe78d
AD
149552000-03-17 Akim Demaille <akim@epita.fr>
14956
14957 On syntax errors, report the token on which we choked.
14958
aa5fd0ee
AD
14959 * src/bison.s1 (yyparse): In the label yyerrlab, when
14960 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 14961
7b306f52
AD
149622000-03-17 Akim Demaille <akim@epita.fr>
14963
aa5fd0ee 14964 * src/reader.c (copy_at): New function.
7b306f52
AD
14965 (copy_guard): Use it.
14966 (copy_action): Use it.
14967
e87b5700
AD
149682000-03-17 Akim Demaille <akim@epita.fr>
14969
14970 Be kind to translators, save some useless translations.
14971
aa5fd0ee 14972 * src/main.c (banner): New function.
e87b5700
AD
14973 (fatal_banner): Use it.
14974 (warn_banner): Use it.
14975
ae3c3164
AD
149762000-03-17 Akim Demaille <akim@epita.fr>
14977
aa5fd0ee
AD
14978 * src/reader.c (copy_definition): Use copy_string and
14979 copy_comment. Removed now unused `match', `ended',
14980 `cplus_comment'.
ae3c3164
AD
14981 (copy_comment, copy_string): Moved, to be visible from
14982 copy_definition.
14983
4dc58e7c
AD
149842000-03-17 Akim Demaille <akim@epita.fr>
14985
aa5fd0ee
AD
14986 * src/reader.c (copy_string): Declare `static inline'. No
14987 problems with inline, since it is checked by configure.
4dc58e7c
AD
14988 (copy_comment): Likewise.
14989
0a6384c4
AD
149902000-03-17 Akim Demaille <akim@epita.fr>
14991
aa5fd0ee 14992 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 14993
3cef001a
AD
149942000-03-17 Akim Demaille <akim@epita.fr>
14995
aa5fd0ee 14996 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
14997 (copy_action): Use it. Removed now unused `match', `ended',
14998 `cplus_comment'.
14999 (copy_guard): Likewise.
15000
ca36d2ef
AD
150012000-03-17 Akim Demaille <akim@epita.fr>
15002
aa5fd0ee 15003 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
15004 (copy_action): Use it.
15005 (copy_guard): Likewise.
15006
6666f98f
AD
150072000-03-17 Akim Demaille <akim@epita.fr>
15008
15009 Change the handling of @s so that they behave exactly like $s.
15010 There is now a pseudo variable @$ (readble and writable), location
15011 of the lhs of the rule (by default ranging from the location of
15012 the first symbol of the rhs, to the location of the last symbol,
15013 or, if the rhs is empty, YYLLOC).
15014
15015 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
15016 yyval.
15017 (yyparse): When providing a default semantic action, provide a
15018 default location action.
15019 (after the $): No longer change `*YYLSP', just stack YYLOC the
15020 same way you stack YYVAL.
15021 * src/reader.c (read_declarations): Use warns.
15022 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
15023 (copy_action, case '@'): Likewise.
15024 Use a standard error message, to save useless work from
15025 translators.
15026
41aca2e0
AD
150272000-03-17 Akim Demaille <akim@epita.fr>
15028
aa5fd0ee
AD
15029 * src/bison.s1: Formatting and cosmetics changes.
15030 * src/reader.c: Likewise.
41aca2e0
AD
15031 Update the Copyright notice.
15032
dc08c1d5
AD
150332000-03-17 Akim Demaille <akim@epita.fr>
15034
aa5fd0ee
AD
15035 * src/bison.s1 (#line): All set to `#line' only, since the
15036 Makefile now handles them.
dc08c1d5 15037
9ee3c97b
AD
150382000-03-16 Akim Demaille <akim@epita.fr>
15039
15040 * src/output.c (output_rule_data): Output the documentation of
15041 some of the tables.
15042 (Copyright notice): Update.
15043 Formatting changes.
15044
0de741ca
AD
150452000-03-16 Akim Demaille <akim@epita.fr>
15046
15047 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
15048 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
15049 One `#if YYDEBUG' remains, since it uses variables which are
15050 defined only if `YYDEBUG != 0'.
15051
bb10be54
AD
150522000-03-16 Akim Demaille <akim@epita.fr>
15053
15054 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
15055 and related variables so that the similarities are highlighted.
15056
b07b484a
AD
150572000-03-16 Akim Demaille <akim@epita.fr>
15058
15059 * src/bison.s1: Properly indent CPP directives.
15060
361f60b3
AD
150612000-03-16 Akim Demaille <akim@epita.fr>
15062
15063 * src/bison.s1: Properly indent the `alloca' CPP section.
15064
8c44d3ec
AD
150652000-03-16 Akim Demaille <akim@epita.fr>
15066
15067 Do not hard code values of directories in `configure.in'.
15068 Update the `configure' tool chain.
15069
15070 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
15071 src/makefile.am.
15072 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
15073 (AC_OUTPUT): Add m4/Makefile.
15074 Bump to bison 1.28a, 1.29 has never been released.
15075 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
15076 handled via src/Makefile.am.
15077 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
15078 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
15079 autoheader.
15080 * Makefile.am (SUBDIRS): Add m4.
15081 (ACLOCAL_AM_FLAGS): New variable.
15082 (AUTOMAKE_OPTIONS): Add check-news.
15083 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
15084 the proper line number and file name.
15085 (DEFS): Propagate the location of bison library files and of the
15086 locale files.
15087 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
15088 builddir.
15089 * acinclude.m4: Remove, replaced by the directory m4.
15090 * m4/Makefile.am (EXTRA_DIST): New variable.
15091 * m4/gettext.m4: New file, from the fileutils.
15092 * m4/lcmessage.m4: Likewise
15093 * m4/progtest.m4: Likewise.
15094 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
15095
f95997e7
AD
150962000-03-10 Akim Demaille <akim@epita.fr>
15097
15098 * src/closure.c:
15099 Formatting changes of various comments.
15100 Respect the GNU coding standards at various places.
15101 Don't use `_()' when no translation is needed.
15102
151031999-12-13 Jesse Thilo <jthilo@gnu.org>
15104
15105 * src/files.c:
15106 OS/2 honors TMPDIR environment variable.
15107
151081999-12-13 Jesse Thilo <jthilo@gnu.org>
15109
15110 * doc/bison.texinfo: Tweaked spelling and grammar.
15111 Updated ISBN.
15112 Removed reference to price of printed copy.
15113 Mention BISON_SIMPLE and BISON_HAIRY.
15114
151151999-12-13 Jesse Thilo <jthilo@gnu.org>
15116
15117 * configure.in, NEWS:
15118 Bison 1.29 released.
15119
151201999-10-27 Jesse Thilo <jthilo@gnu.org>
15121
15122 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
15123 Added reference card.
15124
151251999-07-26 Jesse Thilo <jthilo@gnu.org>
15126
15127 * po/ru.po: Added Russian translation.
15128
151291999-07-26 Jesse Thilo <jthilo@gnu.org>
15130
15131 * configure.in: Added Russian translation.
15132
151331999-07-06 Jesse Thilo <jthilo@gnu.org>
15134
15135 * configure.in, NEWS, README:
15136 Released version 1.28.
15137
151381999-06-14 Jesse Thilo <jthilo@gnu.org>
15139
15140 * src/system.h:
15141 Squashed redefinition warning on some systems.
15142
15143 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
15144 Have configure build version string instead of relying on ANSI string
15145 concatentation.
15146
151471999-06-14 Jesse Thilo <jthilo@gnu.org>
15148
15149 * po/POTFILES.in: Got rid of version.c.
15150
151511999-06-14 Jesse Thilo <jthilo@gnu.org>
15152
15153 * acconfig.h, configure.in:
15154 Have configure build version string instead of relying on ANSI string
15155 concatentation.
15156
151571999-06-08 Jesse Thilo <jthilo@gnu.org>
15158
15159 * doc/bison.1:
15160 Dropped mention of `+' for long-named options.
15161
151621999-05-30 Jesse Thilo <jthilo@gnu.org>
15163
15164 * src/files.c: Added <unistd.h> for unlink().
15165
15166 * src/Makefile.am, src/system.h:
15167 I18n fixes.
15168
151691999-05-30 Jesse Thilo <jthilo@gnu.org>
15170
15171 * README: Added a FAQ list.
15172
15173 * configure.in, acconfig.h:
15174 I18n fixes.
15175
151761999-05-30 Jesse Thilo <jthilo@gnu.org>
15177
15178 * doc/FAQ, doc/Makefile.am:
15179 Added a FAQ list.
15180
151811999-05-19 Jesse Thilo <jthilo@gnu.org>
15182
15183 * src/alloc.h, src/symtab.h, src/version.c:
15184 Protected inclusion of "config.h" with HAVE_CONFIG_H.
15185
151861999-04-18 Jesse Thilo <jthilo@gnu.org>
15187
15188 * src/.cvsignore, src/Makefile.am:
15189 Reorganized: sources in `src', documentation in `doc'.
15190
15191 * src/lex.c (literalchar):
15192 fixed the code for escaping double quotes (thanks
15193 Jonathan Czisny.)
15194
151951999-04-18 Jesse Thilo <jthilo@gnu.org>
15196
15197 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
15198 Adjusted paths to reflect directory reorganization.
15199
152001999-04-18 Jesse Thilo <jthilo@gnu.org>
15201
15202 * doc/.cvsignore, doc/Makefile.am:
15203 Reorganized: sources in `src', documentation in `doc'.
15204
152051999-04-18 Jesse Thilo <jthilo@gnu.org>
15206
15207 * configure.in:
15208 Updated AC_INIT file to reflect directory reorganization.
15209
15210 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
15211 Reorganized: sources in `src', documentation in `doc'.
15212
152131999-04-13 Jesse Thilo <jthilo@gnu.org>
15214
15215 * src/allocate.c:
15216 Don't declare calloc() and realloc() if not necessary.
15217
152181999-04-13 Jesse Thilo <jthilo@gnu.org>
15219
15220 * configure.in, acconfig.h, acinclude.m4:
15221 Don't declare calloc() and realloc() if not necessary.
15222
152231999-03-23 Jesse Thilo <jthilo@gnu.org>
15224
15225 * po/.cvsignore: Added i18n support.
15226
152271999-03-23 Jesse Thilo <jthilo@gnu.org>
15228
15229 * acconfig.h, configure.in, Makefile.am:
15230 Added i18n support.
15231
152321999-03-22 Jesse Thilo <jthilo@gnu.org>
15233
15234 * src/bison.s1: Fixed #line numbers.
15235
152361999-03-15 Jesse Thilo <jthilo@gnu.org>
15237
15238 * po/es.po, po/fr.po, po/nl.po, po/de.po:
15239 Added PO files from Translation Project.
15240
152411999-03-03 Jesse Thilo <jthilo@gnu.org>
15242
15243 * Makefile.am:
15244 Added support for non-ANSI compilers (ansi2knr).
15245
152461999-02-16 Jesse Thilo <jthilo@gnu.org>
15247
15248 * configure.in: Bumped version number to 1.27.
15249
15250 * Makefile.am:
15251 Added `bison.simple' to list of files removed by `make distclean'.
15252
152531999-02-12 Jesse Thilo <jthilo@gnu.org>
15254
15255 * src/files.c, src/files.h:
15256 Defined locations of parser files in config.h instead of Makefile.
15257
152581999-02-12 Jesse Thilo <jthilo@gnu.org>
15259
15260 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
15261 Defined locations of parser files in config.h instead of Makefile.
15262
152631999-02-09 Jesse Thilo <jthilo@gnu.org>
15264
15265 * Makefile.am:
15266 Removed inappropriate use of $< macro.
15267
152681999-02-05 Jesse Thilo <jthilo@gnu.org>
15269
15270 * po/Makefile.in.in, po/POTFILES.in:
15271 Add `po' directory skeleton.
15272
152731999-01-27 Jesse Thilo <jthilo@gnu.org>
15274
15275 * README: Document help-bison list.
15276
15277 * configure.in: Add check for mkstemp().
15278
152791999-01-20 Jesse Thilo <jthilo@gnu.org>
15280
15281 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
15282 Hush a few compiler warnings.
15283
15284 * src/files.c:
15285 Add tryclose(), which verifies that fclose was successful.
15286 Hush a couple of compiler warnings.
15287
152881999-01-20 Jesse Thilo <jthilo@gnu.org>
15289
15290 * Makefile.am, OChangeLog:
15291 ChangeLog is now automatically generated. Include the old version as
15292 OChangeLog.
15293
152941999-01-14 Jesse Thilo <jthilo@gnu.org>
15295
15296 * 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:
15297 Update FSF address.
15298
152991999-01-14 Jesse Thilo <jthilo@gnu.org>
15300
15301 * doc/bison.texinfo: Fix formatting glitch.
15302
15303 * doc/bison.texinfo: Update FSF address.
15304
153051999-01-14 Jesse Thilo <jthilo@gnu.org>
15306
15307 * acconfig.h: Update FSF address.
15308
153091999-01-08 Jesse Thilo <jthilo@gnu.org>
15310
15311 * src/system.h:
15312 Don't define PACKAGE here, since config.h defines it.
15313
153141998-12-30 Jesse Thilo <jthilo@gnu.org>
15315
15316 * src/reader.c: Update copyright date.
15317
15318 * src/main.c:
15319 Ditch sprintf to statically-sized buffers in fatal/warn functions in
15320 favor of output directly to stderr (avoids buffer overruns).
15321
15322 * src/reader.c: Some checks for premature EOF.
15323
15324 * 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:
15325 Use prototypes if the compiler understands them.
15326
15327 * src/files.c: Honor TMPDIR on Unix hosts.
15328 Use prototypes if the compiler understands them.
15329
15330 * src/reader.c:
15331 Fix a couple of buffer overrun bugs.
15332 Use prototypes if the compiler understands them.
15333
15334 * src/system.h: Include unistd.h and ctype.h.
15335 Use #ifdef instead of #if for NLS symbols.
15336
153371998-12-30 Jesse Thilo <jthilo@gnu.org>
15338
15339 * doc/bison.texinfo:
15340 Delete comment "consider using @set for edition number, etc..." since
15341 we now are doing so.
15342
153431998-12-30 Jesse Thilo <jthilo@gnu.org>
15344
15345 * configure.in:
15346 Use prototypes if the compiler understands them.
15347
15348 * NEWS: Document 1.26 highlights.
15349
15350 * Makefile.am: Require Automake 1.3 or later.
15351
15352 * acconfig.h:
15353 Use prototypes if the compiler understands them.
15354
153551998-12-29 Jesse Thilo <jthilo@gnu.org>
15356
15357 * src/version.c:
15358 Use VERSION symbol from automake for version number.
15359
153601998-12-29 Jesse Thilo <jthilo@gnu.org>
15361
15362 * acconfig.h, configure.in, version.cin:
15363 Use VERSION symbol from automake for version number.
15364
153651998-11-28 Jesse Thilo <jthilo@gnu.org>
15366
15367 * Makefile.am:
15368 Distribute original version of simple parser (bison.s1), not built
15369 version (bison.simple).
15370
153711998-11-28 Jesse Thilo <jthilo@gnu.org>
15372
15373 * doc/bison.texinfo: Add info dir entry.
15374
15375 * doc/bison.texinfo:
15376 Let automake put version number into documentation.
15377
153781998-11-26 Jesse Thilo <jthilo@gnu.org>
15379
15380 * src/bison.cld, src/build.com, src/vmshlp.mar:
15381 Add non-RCS files from /gd/gnu/bison.
15382
153831998-11-26 Jesse Thilo <jthilo@gnu.org>
15384
15385 * doc/bison.1:
15386 Document the BISON_HAIRY and BISON_SIMPLE variables.
15387
153881998-11-25 Jesse Thilo <jthilo@gnu.org>
15389
15390 * src/version.c: Build version.c automatically.
15391
15392 * src/reader.c:
15393 Fix token numbering (used to start at 258, not 257).
15394
15395 * src/system.h: Include config.h.
15396
15397 * src/getargs.c: Update bug report address.
15398
15399 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
15400 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
15401
154021998-11-25 Jesse Thilo <jthilo@gnu.org>
15403
15404 * Makefile.am:
15405 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
15406
15407 * configure.in, version.cin:
15408 Build version.c automatically.
15409
15410 * AUTHORS: Add AUTHORS file.
15411
15412 * README: Update bug report address.
15413
15414 * bison.simple:
15415 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
15416
15417 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
15418 Add automake stuff.
15419
154201998-11-25 Jesse Thilo <jthilo@gnu.org>
15421
15422 * doc/bison.texinfo: Clean up some formatting.
15423
154241998-05-05 Richard Stallman <rms@gnu.org>
15425
15426 * doc/bison.texinfo:
15427 Explain better why to make a pure parser.
15428
154291998-01-05 Richard Stallman <rms@gnu.org>
15430
15431 * src/files.c (openfiles):
15432 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
15433 find a temporary directory, if possible. Do not unlink files while
15434 they are open.
15435
154361997-08-25 Richard Stallman <rms@gnu.org>
15437
15438 * src/reader.c (stack_offset;):
15439 Change some warni to warns.
15440
15441 * src/lex.c (literalchar): Use warns, not warni.
15442
154431997-06-28 Richard Stallman <rms@gnu.org>
15444
15445 * src/bison.s1: Add a Bison version comment.
15446
15447 * src/main.c (fatal, warn, berror):
15448 Use program_name.
15449
154501997-06-28 Richard Stallman <rms@gnu.org>
15451
15452 * Makefile.in (bison_version): New variable.
15453 (dist): Use that variable.
15454 (bison.s1): Substitute the Bison version into bison.simple.
15455
15456 * bison.simple: Add a Bison version comment.
15457
154581997-06-18 Richard Stallman <rms@gnu.org>
15459
15460 * src/main.c (fatal, warn, berror):
15461 Make error messages standard.
15462 (toomany): Improve error message text.
15463
15464 * 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:
15465 new.h renamed to alloc.h.
15466
154671997-06-18 Richard Stallman <rms@gnu.org>
15468
15469 * Makefile.in: new.h renamed to alloc.h.
15470
154711997-05-24 Richard Stallman <rms@gnu.org>
15472
15473 * src/lex.c (literalchar):
15474 Fix the code for escaping \, " and '.
15475
15476 (lex): Avoid trouble when there are many chars
15477 to discard in a char literal with just several chars in it.
15478
154791997-05-17 Richard Stallman <rms@gnu.org>
15480
15481 * src/bison.s1:
15482 Use malloc, if using alloca is troublesome.
15483 (YYSTACK_USE_ALLOCA): New flag macro.
15484 Define it for some systems and compilers.
15485 (YYSTACK_ALLOC): New macro.
15486 (yyparse): Use YYSTACK_ALLOC to allocate stack.
15487 If it was malloc'd, free it.
15488
154891997-05-17 Richard Stallman <rms@gnu.org>
15490
15491 * bison.simple:
15492 Use malloc, if using alloca is troublesome.
15493 (YYSTACK_USE_ALLOCA): New flag macro.
15494 Define it for some systems and compilers.
15495 (YYSTACK_ALLOC): New macro.
15496 (yyparse): Use YYSTACK_ALLOC to allocate stack.
15497 If it was malloc'd, free it.
15498
154991997-04-23 Richard Stallman <rms@gnu.org>
15500
15501 * src/bison.s1:
15502 (alloca) [__hpux]: Always define as __builtin_alloca.
15503
155041997-04-23 Richard Stallman <rms@gnu.org>
15505
15506 * bison.simple:
15507 (alloca) [__hpux]: Always define as __builtin_alloca.
15508
155091997-04-22 Richard Stallman <rms@gnu.org>
15510
15511 * src/bison.s1:
15512 [__hpux]: Include alloca.h (right for HPUX 10)
15513 instead of declaring alloca (right for HPUX 9).
15514
15515 * src/bison.s1 (__yy_memcpy):
15516 Declare arg `count' as unsigned int.
15517 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
15518
155191997-04-22 Richard Stallman <rms@gnu.org>
15520
15521 * bison.simple:
15522 [__hpux]: Include alloca.h (right for HPUX 10)
15523 instead of declaring alloca (right for HPUX 9).
15524
15525 * bison.simple (__yy_memcpy):
15526 Declare arg `count' as unsigned int.
15527 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
15528
155291997-01-03 Richard Stallman <rms@gnu.org>
15530
15531 * src/allocate.c: [__STDC__ or _MSC_VER]:
15532 Declare calloc and realloc to return void *.
15533
155341997-01-02 Richard Stallman <rms@gnu.org>
15535
15536 * src/system.h:
15537 [_MSC_VER]: Include stdlib.h and process.h.
15538 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
15539
15540 * src/main.c (main): Return FAILURE as a value.
15541 (printable_version): Declare arg as int, not char.
15542
155431997-01-02 Richard Stallman <rms@gnu.org>
15544
15545 * Makefile.in (dist):
15546 Explicitly check for symlinks, and copy them.
15547
155481996-12-19 Richard Stallman <rms@gnu.org>
15549
15550 * src/files.c:
15551 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
15552
155531996-12-18 Paul Eggert <eggert@gnu.org>
15554
15555 * src/bison.s1 (yyparse):
15556 If __GNUC__ and YYPARSE_PARAM are both defined,
15557 declare yyparse to have a void * argument.
15558
155591996-12-18 Paul Eggert <eggert@gnu.org>
15560
15561 * bison.simple (yyparse):
15562 If __GNUC__ and YYPARSE_PARAM are both defined,
15563 declare yyparse to have a void * argument.
15564
155651996-12-17 Richard Stallman <rms@gnu.org>
15566
15567 * src/reduce.c (nbits): Add some casts.
15568
155691996-08-12 Richard Stallman <rms@gnu.org>
15570
15571 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
15572
155731996-08-12 Richard Stallman <rms@gnu.org>
15574
15575 * bison.simple: Test _MSDOS as well as _MSDOS_.
15576
155771996-07-31 Richard Stallman <rms@gnu.org>
15578
15579 * src/bison.s1:
15580 [__sun && __i386]: Include alloca.h.
15581
155821996-07-31 Richard Stallman <rms@gnu.org>
15583
15584 * bison.simple:
15585 [__sun && __i386]: Include alloca.h.
15586
155871996-07-30 Richard Stallman <rms@gnu.org>
15588
15589 * src/bison.s1: Comment change.
15590
15591 * src/bison.s1: Test _MSDOS_, not MSDOS.
15592
155931996-07-30 Richard Stallman <rms@gnu.org>
15594
15595 * bison.simple: Comment change.
15596
15597 * bison.simple: Test _MSDOS_, not MSDOS.
15598
155991996-06-01 Richard Stallman <rms@gnu.org>
15600
15601 * 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:
15602 Insert `_' macro around many string constants.
15603
15604 * src/main.c:
15605 Insert `_' macro around many string constants.
15606
15607 (main): Call setlocale, bindtextdomain and textdomain.
15608
15609 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
15610 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
15611 [ENABLE_NLS]: Include libintl.h.
15612 [ENABLE_NLS] (gettext): Define.
15613 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
15614 (N_, PACKAGE, LOCALEDIR): New macros.
15615
156161996-06-01 Richard Stallman <rms@gnu.org>
15617
15618 * POTFILES.in: New file.
15619
15620 * Makefile.in (allocate.o):
15621 Define target explicitly.
15622
15623 * Makefile.in (CFLAGS): Set to @CFLAGS@.
15624 (LDFLAGS): Set to @LDFLAGS@.
15625 (configure): Run autoconf only if preceding `cd' succeeds.
15626 (bison.s1): Redirect output to temporary file then move the
15627 temporary to the target, rather than redirecting directly to bison.s1.
15628 (clean): Remove config.status and config.log.
15629 (distclean): Don't remove config.status here.
15630
156311996-05-12 Richard Stallman <rms@gnu.org>
15632
15633 * src/bison.s1:
15634 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
15635
156361996-05-12 Richard Stallman <rms@gnu.org>
15637
15638 * bison.simple:
15639 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
15640
156411996-05-11 Richard Stallman <rms@gnu.org>
15642
15643 * src/bison.s1 (__yy_memcpy):
15644 Really reorder the args, as was supposedly done on Feb 14 1995.
15645 (yyparse): Calls changed accordingly.
15646
156471996-05-11 Richard Stallman <rms@gnu.org>
15648
15649 * Makefile.in (dist): Don't use $(srcdir).
15650
15651 * bison.simple (__yy_memcpy):
15652 Really reorder the args, as was supposedly done on Feb 14 1995.
15653 (yyparse): Calls changed accordingly.
15654
156551996-01-27 Richard Stallman <rms@gnu.org>
15656
15657 * src/output.c (output_rule_data):
15658 Test YYERROR_VERBOSE in the conditional
15659 around the definition of ttyname.
15660
156611995-12-29 Richard Stallman <rms@gnu.org>
15662
15663 * src/bison.s1:
15664 Fix line numbers in #line commands.
15665
156661995-12-29 Richard Stallman <rms@gnu.org>
15667
15668 * bison.simple:
15669 Fix line numbers in #line commands.
15670
156711995-12-27 Richard Stallman <rms@gnu.org>
15672
15673 * src/bison.s1 (YYPARSE_PARAM_DECL):
15674 In C++, make it always null.
15675 (YYPARSE_PARAM_ARG): New macro.
15676 (yyparse): Use YYPARSE_PARAM_ARG.
15677
156781995-12-27 Richard Stallman <rms@gnu.org>
15679
15680 * bison.simple (YYPARSE_PARAM_DECL):
15681 In C++, make it always null.
15682 (YYPARSE_PARAM_ARG): New macro.
15683 (yyparse): Use YYPARSE_PARAM_ARG.
15684
156851995-11-29 Richard Stallman <rms@gnu.org>
15686
15687 * doc/bison.texinfo:
15688 Describe literal string tokens, %raw, %no_lines, %token_table.
15689
156901995-11-29 Daniel Hagerty <hag@gnu.org>
15691
15692 * doc/bison.texinfo: Fixed update date
15693
156941995-10-16 Richard Stallman <rms@gnu.org>
15695
15696 * src/version.c: Version 1.25.
15697
156981995-10-16 Richard Stallman <rms@gnu.org>
15699
15700 * NEWS: *** empty log message ***
15701
157021995-10-16 Richard Stallman <rms@gnu.org>
15703
15704 * doc/bison.1, doc/bison.rnh:
15705 Add new options.
15706
157071995-10-15 Richard Stallman <rms@gnu.org>
15708
15709 * src/vmsgetargs.c, src/getargs.c:
15710 Added -n, -k, and -raw switches.
15711 (noparserflag, toknumflag, rawtoknumflag): New variables.
15712
15713 * src/symtab.h (SALIAS):
15714 New #define for adding aliases to %token.
15715 (struct bucket): Added `alias' field.
15716
15717 * src/reduce.c (reduce_grammar):
15718 Revise error message.
15719 (print_notices): Remove final `.' from error message.
15720
15721 * src/reader.c (reader_output_yylsp):
15722 New function.
15723 (readgram): Use `#if 0' around code that accepted %command
15724 inside grammar rules: The documentation doesn't allow it,
15725 and it will fail since the %command processors scan for the next %.
15726 (parse_token_decl): Extended the %token
15727 declaration to allow a multi-character symbol as an alias.
15728 (parse_thong_decl): New function.
15729 (read_declarations): Added %thong declarations.
15730 (read_declarations): Handle NOOP to deal with allowing
15731 % declarations as another means to specify the flags.
15732 (readgram): Allow %prec prior to semantics embedded in a rule.
15733 (skip_to_char, read_declarations, copy_definition)
15734 (parse_token_decl, parse_start_decl, parse_type_decl)
15735 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
15736 (get_type_name, copy_guard, copy_action, readgram)
15737 (get_type, packsymbols): Revised most error messages.
15738 Changed `fatal' to `warnxxx' to avoid aborting for error.
15739 Revised and use multiple warnxxx functions to avoid using VARARGS1.
15740 (read_declarations): Improve the error message for
15741 an invalid character. Do not abort.
15742 (read_declarations, copy_guard, copy_action): Use
15743 printable_version to avoid unprintable characters in printed output.
15744 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
15745 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
15746 Allow the type of a non-terminal can be given
15747 more than once, as long as all specifications give the same type.
15748
15749 * src/output.c:
15750 (output_headers, output_trailers, output, output_gram)
15751 (output_rule_data): Implement noparserflag variable.
15752 Implement toknumflag variable.
15753 (output): Call reader_output_yylsp to output LTYPESTR.
15754
15755 * src/main.c (main):
15756 If reader sees an error, don't process the grammar.
15757 (fatals): Updated to not use VARARGS1.
15758 (printable_version, int_to_string, warn, warni, warns, warnss)
15759 (warnsss): New error reporting functions. Avoid abort for error.
15760
15761 * src/lex.h:
15762 Added THONG and NOOP for alias processing.
15763 Added SETOPT for the new code that allows setting options with %flags.
15764
15765 * src/lex.c:
15766 Include getopt.h. Add some extern decls.
15767 (safegetc): New function to deal with EOF gracefully.
15768 (literalchar); new function to deal with reading \ escapes.
15769 (lex): Use literalchar.
15770 (lex): Implemented "..." tokens.
15771 (literalchar, lex, parse_percent_token): Made tokenbuffer
15772 always contain the token. This includes growing the token
15773 buffer while reading an integer.
15774 (parse_percent_token): Replaced if-else statement with percent_table.
15775 (parse_percent_token): Added % declarations as another
15776 way to specify the flags -n, -l, and -r. Also added hooks for
15777 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
15778 major changes to files.c.
15779 (lex) Retain in the incoming stream a character following
15780 an incorrect '/'.
15781 (skip_white_space, lex): Revised most error messages
15782 and changed fatal to warn to avoid aborting.
15783 (percent_table): Added %thong declarations.
15784
15785 * src/gram.h: Comment changes.
15786
15787 * src/files.c (openfiles, open_extra_files, done):
15788 Add faction flag
15789 and actfile file. Handle noparserflag. Both for -n switch.
15790
15791 * src/conflicts.c (resolve_sr_conflict):
15792 Remove use of alloca.
15793
157941995-06-01 Jim Meyering <meyering@gnu.org>
15795
15796 * doc/bison.texinfo: *** empty log message ***
15797
157981995-05-06 Richard Stallman <rms@gnu.org>
15799
15800 * src/bison.s1: Comment change.
15801
158021995-05-06 Richard Stallman <rms@gnu.org>
15803
15804 * bison.simple: Comment change.
15805
158061995-05-03 Richard Stallman <rms@gnu.org>
15807
15808 * src/version.c: Version now 1.24.
15809
15810 * src/bison.s1: Change distribution terms.
15811
15812 * src/version.c: Version now 1.23.
15813
158141995-05-03 Richard Stallman <rms@gnu.org>
15815
15816 * doc/bison.texinfo:
15817 Rewrite "Conditions for Using Bison".
15818 Update version to 1.24.
15819
158201995-05-03 Richard Stallman <rms@gnu.org>
15821
15822 * bison.simple: Change distribution terms.
15823
158241995-02-23 Richard Stallman <rms@gnu.org>
15825
15826 * src/files.c: Test __VMS_POSIX as well as VMS.
15827
158281995-02-14 Jim Meyering <meyering@gnu.org>
15829
15830 * src/bison.s1 (__yy_memcpy):
15831 Renamed from __yy_bcopy to avoid
15832 confusion. Reverse FROM and TO arguments to be consistent with
15833 those of memcpy.
15834
158351995-02-14 Jim Meyering <meyering@gnu.org>
15836
15837 * bison.simple (__yy_memcpy):
15838 Renamed from __yy_bcopy to avoid
15839 confusion. Reverse FROM and TO arguments to be consistent with
15840 those of memcpy.
15841
158421994-11-10 David J. MacKenzie <djm@gnu.org>
15843
15844 * NEWS: reformat
15845
15846 * NEWS: New file.
15847
15848 * Makefile.in (DISTFILES): Include NEWS.
15849
15850 * Makefile.in (DISTFILES):
15851 Include install-sh, not install.sh.
15852
15853 * configure.in: Update to Autoconf v2 macro names.
15854
158551994-10-05 David J. MacKenzie <djm@gnu.org>
15856
15857 * Makefile.in: fix typo
15858
15859 * Makefile.in (prefix, exec_prefix):
15860 Let configure set them.
15861
158621994-09-28 David J. MacKenzie <djm@gnu.org>
15863
15864 * Makefile.in: Set datadir to $(prefix)/share.
15865
158661994-09-15 Richard Stallman <rms@gnu.org>
15867
15868 * src/bison.s1:
15869 Update copyright notice and GPL version.
15870
158711994-09-15 Richard Stallman <rms@gnu.org>
15872
15873 * bison.simple:
15874 Update copyright notice and GPL version.
15875
158761994-07-12 Richard Stallman <rms@gnu.org>
15877
15878 * src/reduce.c, src/reader.c:
15879 entered into RCS
15880
158811994-05-05 David J. MacKenzie <djm@gnu.org>
15882
15883 * Makefile.in: entered into RCS
15884
158851994-03-26 Richard Stallman <rms@gnu.org>
15886
15887 * src/bison.s1: entered into RCS
15888
158891994-03-26 Richard Stallman <rms@gnu.org>
15890
15891 * bison.simple: entered into RCS
15892
158931994-03-25 Richard Stallman <rms@gnu.org>
15894
15895 * src/main.c: entered into RCS
15896
158971994-03-24 Richard Stallman <rms@gnu.org>
15898
15899 * src/conflicts.c: entered into RCS
15900
159011994-01-02 Richard Stallman <rms@gnu.org>
15902
15903 * Makefile.in: *** empty log message ***
15904
159051993-11-21 Richard Stallman <rms@gnu.org>
15906
15907 * src/bison.s1: *** empty log message ***
15908
159091993-11-21 Richard Stallman <rms@gnu.org>
15910
15911 * doc/bison.texinfo: entered into RCS
15912
15913 * doc/bison.texinfo: *** empty log message ***
15914
159151993-11-21 Richard Stallman <rms@gnu.org>
15916
15917 * bison.simple: *** empty log message ***
15918
159191993-10-25 David J. MacKenzie <djm@gnu.org>
15920
15921 * doc/bison.texinfo: *** empty log message ***
15922
159231993-10-19 Richard Stallman <rms@gnu.org>
15924
15925 * src/bison.s1: *** empty log message ***
15926
159271993-10-19 Richard Stallman <rms@gnu.org>
15928
15929 * bison.simple: *** empty log message ***
15930
159311993-10-14 Richard Stallman <rms@gnu.org>
15932
15933 * src/bison.s1: *** empty log message ***
15934
159351993-10-14 Richard Stallman <rms@gnu.org>
15936
15937 * bison.simple: *** empty log message ***
15938
159391993-09-14 David J. MacKenzie <djm@gnu.org>
15940
15941 * doc/bison.texinfo: *** empty log message ***
15942
159431993-09-13 Noah Friedman <friedman@gnu.org>
15944
15945 * Makefile.in: *** empty log message ***
15946
159471993-09-10 Richard Stallman <rms@gnu.org>
15948
15949 * src/conflicts.c: *** empty log message ***
15950
15951 * src/system.h: entered into RCS
15952
159531993-09-10 Richard Stallman <rms@gnu.org>
15954
15955 * doc/bison.1: entered into RCS
15956
159571993-09-06 Noah Friedman <friedman@gnu.org>
15958
15959 * src/version.c: entered into RCS
15960
159611993-09-06 Noah Friedman <friedman@gnu.org>
15962
15963 * Makefile.in: *** empty log message ***
15964
159651993-07-30 David J. MacKenzie <djm@gnu.org>
15966
15967 * Makefile.in: *** empty log message ***
15968
159691993-07-24 Richard Stallman <rms@gnu.org>
15970
15971 * src/bison.s1: *** empty log message ***
15972
159731993-07-24 Richard Stallman <rms@gnu.org>
15974
15975 * bison.simple: *** empty log message ***
15976
159771993-07-08 David J. MacKenzie <djm@gnu.org>
15978
15979 * Makefile.in: *** empty log message ***
15980
159811993-07-04 Richard Stallman <rms@gnu.org>
15982
15983 * src/bison.s1: *** empty log message ***
15984
159851993-07-04 Richard Stallman <rms@gnu.org>
15986
15987 * bison.simple: *** empty log message ***
15988
159891993-06-26 David J. MacKenzie <djm@gnu.org>
15990
15991 * src/getargs.c: entered into RCS
15992
159931993-06-26 David J. MacKenzie <djm@gnu.org>
15994
15995 * doc/bison.texinfo: *** empty log message ***
15996
15997 * doc/bison.1: New file.
15998
159991993-06-25 Richard Stallman <rms@gnu.org>
16000
16001 * src/getargs.c: New file.
16002
160031993-06-16 Richard Stallman <rms@gnu.org>
16004
16005 * src/bison.s1: *** empty log message ***
16006
160071993-06-16 Richard Stallman <rms@gnu.org>
16008
16009 * bison.simple: *** empty log message ***
16010
160111993-06-03 Richard Stallman <rms@gnu.org>
16012
16013 * src/bison.s1: New file.
16014
160151993-06-03 Richard Stallman <rms@gnu.org>
16016
16017 * doc/bison.texinfo: *** empty log message ***
16018
160191993-06-03 Richard Stallman <rms@gnu.org>
16020
16021 * bison.simple: New file.
16022
160231993-05-19 Richard Stallman <rms@gnu.org>
16024
16025 * doc/bison.texinfo: New file.
16026
160271993-05-07 Noah Friedman <friedman@gnu.org>
16028
16029 * Makefile.in: *** empty log message ***
16030
160311993-04-28 Noah Friedman <friedman@gnu.org>
16032
16033 * src/reader.c: *** empty log message ***
16034
160351993-04-23 Noah Friedman <friedman@gnu.org>
16036
16037 * src/alloc.h: entered into RCS
16038
160391993-04-20 David J. MacKenzie <djm@gnu.org>
16040
16041 * src/version.c: *** empty log message ***
16042
16043 * src/files.c, src/allocate.c:
16044 entered into RCS
16045
16046 * src/reader.c: *** empty log message ***
16047
16048 * src/lex.c: entered into RCS
16049
16050 * src/conflicts.c: New file.
16051
16052 * src/symtab.c: entered into RCS
16053
16054 * src/alloc.h: New file.
16055
16056 * src/LR0.c: entered into RCS
16057
160581993-04-18 Noah Friedman <friedman@gnu.org>
16059
16060 * src/reader.c: New file.
16061
16062 * src/version.c: *** empty log message ***
16063
160641993-04-18 Noah Friedman <friedman@gnu.org>
16065
16066 * Makefile.in: *** empty log message ***
16067
160681993-04-17 Noah Friedman <friedman@gnu.org>
16069
16070 * Makefile.in: *** empty log message ***
16071
160721993-04-15 Richard Stallman <rms@gnu.org>
16073
16074 * src/main.c, src/files.c:
16075 New file.
16076
160771993-04-15 Noah Friedman <friedman@gnu.org>
16078
16079 * configure.in: entered into RCS
16080
16081 * configure.in: *** empty log message ***
16082
16083 * configure.in: New file.
16084
160851993-04-14 Richard Stallman <rms@gnu.org>
16086
16087 * Makefile.in: New file.
16088
160891993-04-13 Richard Stallman <rms@gnu.org>
16090
16091 * src/version.c: New file.
16092
160931993-03-25 Richard Stallman <rms@gnu.org>
16094
16095 * src/output.c: entered into RCS
16096
160971992-09-25 Richard Stallman <rms@gnu.org>
16098
16099 * configure.bat: entered into RCS
16100
161011992-06-22 Richard Stallman <rms@gnu.org>
16102
16103 * src/vmsgetargs.c: entered into RCS
16104
161051992-06-22 Richard Stallman <rms@gnu.org>
16106
16107 * doc/bison.rnh: entered into RCS
16108
161091992-04-20 David J. MacKenzie <djm@gnu.org>
16110
16111 * README: entered into RCS
16112
161131992-01-22 Richard Stallman <rms@gnu.org>
16114
16115 * src/machine.h: entered into RCS
16116
161171991-12-21 Richard Stallman <rms@gnu.org>
16118
16119 * src/lalr.c, src/closure.c:
16120 entered into RCS
16121
161221991-12-20 Richard Stallman <rms@gnu.org>
16123
16124 * src/state.h: entered into RCS
16125
161261991-12-18 Richard Stallman <rms@gnu.org>
16127
16128 * src/print.c, src/nullable.c, src/derives.c:
16129 entered into RCS
16130
161311991-11-03 David J. MacKenzie <djm@gnu.org>
16132
16133 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
16134 entered into RCS
16135
161361988-09-09 Richard Stallman <rms@gnu.org>
16137
16138 * src/bison.hairy: entered into RCS
16139
161401987-12-16 Richard Stallman <rms@gnu.org>
16141
16142 * REFERENCES: entered into RCS
dc546b0f 16143
f294a2c2 16144
04098407 16145 -----
f294a2c2 16146
04098407 16147 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
e2a21b6f
PE
16148 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
16149 Software Foundation, Inc.
f294a2c2 16150
04098407
PE
16151 Copying and distribution of this file, with or without
16152 modification, are permitted provided the copyright notice and this
16153 notice are preserved.
e9071366
AD
16154
16155$Id$